Synthetic local computation. No model or remote service is contacted.
Experiment workspace
Decision trace
The mechanism
Parallel agent steps finish in whatever order their workers answer. This lab replays one synthetic help-desk case, CASE-4107, whose eight planned steps carry producer-assigned numbers. One message arrives per tick. The resequencer keeps the next expected number, buffers anything higher, and releases every contiguous run as soon as the missing number arrives. When the oldest buffered message has waited for the gap timeout, or the buffer holds more messages than its capacity, the missing numbers are declared lost and the buffered messages are released.
Synthetic fixture and controls
Four arrival patterns are provided. In the default pattern step 3 arrives sixth, after steps 4, 5 and 6. In the lost pattern step 3 never arrives. In the late pattern it arrives last, after the timeout. The duplicate pattern repeats step 2 and swaps steps 4 and 5. Capacity and gap timeout are integers in messages and ticks. The late policy decides what happens to a message whose number was already given up: reject sends it to a separate channel, deliver hands it to the consumer out of order.
Expected outcomes
The default releases all eight steps in order; the largest buffer is 3 messages and step 4 is held for 3 ticks. Set the gap timeout to 2 and step 3 is declared lost at tick 5; when it arrives at tick 6 it is rejected as late. Capacity 2 gives the same result through the capacity rule. With timeout 2 and the deliver policy, the consumer receives step 3 after step 6. In the lost pattern, steps 4 to 8 are released at tick 7 and step 3 is recorded as lost. The duplicate pattern releases six steps in order and drops one copy.
Read the decisions
Each trace line names the tick, the decision and the reason. A buffered line shows which number the resequencer is waiting for. A release line shows how long the message waited. A declared lost line states whether capacity or the timeout forced the decision. Late and out of order lines show where a message went after its gap was given up. The release list below the metrics is exactly what a downstream consumer would see.
Experiment before choosing settings
Predict the outcome before each run. Lower the timeout one tick at a time in the default pattern and find the first value that loses step 3. Then restore the timeout and lower capacity instead. Compare the two policies for the late pattern and decide which one your consumer can tolerate. Notice that no setting rescues a step that never arrives; it only decides how long the case waits before admitting the loss. Export records the inputs, release order, lost numbers and full trace.
Limits and production verification
This is a deterministic tick model with one case and one message per tick. It does not model several cases sharing memory, persistence across consumer restarts, timers firing between arrivals, or explicit skip notices from a planner. Real resequencers differ in how they measure the timeout and what they do at capacity. Before choosing values, measure arrival disorder and gap durations in your own logs, test boundary values and restarts, and read the linked article for when a resequencer is unnecessary.
Views are my own and do not represent any employer, past or present.