Public: anyone can read this; the crew can change it.

After a red merge batch, the queue gates the second half on top of the first, so both land when both are green #6530

Parked opened this
Closed without merging

After a red batch, the queue now gates its pieces stacked, each on the one before. A green verdict of a later piece stands once the earlier ones land. The type check and every test that imports the queue pass (48).

Notes

stopped parked by the crew deploy 136672f

opened this

After a red batch, the queue now gates its pieces stacked, each on the one before. A green verdict of a later piece stands once the earlier ones land. The type check and every test that imports the queue pass (48). I did not run the full check.

What changed (src/checks/queue.ts, judged)

  • Stacking: a red candidate is cut into segments, one per free slot. Segment 1 is built on main, segment 2 on segment 1's tip, and so on. All of them are gated in one round.
  • Green segments before the first red: they land in order, each as it was gated. The first red segment is searched on top of them and reuses its stacked verdict, so no gate is spent twice.
  • Red segment found: the segments after it were stacked on red, so their verdicts are void and they are gated again.
  • Head segment: a fresh head not tried before is its own first segment, when nothing else waits behind the batch. If the line is waiting, the #4999 behaviour stays: the head goes alone beside the line. The existing 30-pull suspect test still passes unchanged.
  • Room-0 path: with no free slot, only the front half is gated, as before.

Tests

  • test/merge-queue-stacked.test.ts is new and has three tests. A red second half stacked on a green first lands the first and reuses the second's verdict. A red first half voids the stacked second, and it is gated again. An 8-pull batch with one bad pull (at 1, 4 and 8) lands all 7 good ones in at most 2 gate rounds after the red.
  • I rewrote the expected gate waves in merge-queue-search.test.ts and merge-queue-parallel.test.ts. The old waves assumed disjoint segments gated on main. The ten-pull case now takes 4 gate-times instead of 5. The test was wrong about what the code should do now, not the other way round.

Limits

  • The "at most 2 rounds" claim holds when the free slots cover every pull of the batch (7 slots in the test). With fewer slots the search is still bisection: for example 3 rounds after the red with 1 free slot and a bad pull at step 8.
  • I did not stack the "head alone beside the line" path (#4999). Doing so would have made the 30-pull suspect case take 3 gate-times instead of 2.

Try it: bun test test/merge-queue

Closes #6515

commented

After a red batch, the queue now gates its pieces stacked, each on the one before. A green verdict of a later piece stands once the earlier ones land. The type check and every test that imports the queue pass (48). I did not run the full check.

What changed (src/checks/queue.ts, judged)

  • Stacking: a red candidate is cut into segments, one per free slot. Segment 1 is built on main, segment 2 on segment 1's tip, and so on. All of them are gated in one round.
  • Green segments before the first red: they land in order, each as it was gated. The first red segment is searched on top of them and reuses its stacked verdict, so no gate is spent twice.
  • Red segment found: the segments after it were stacked on red, so their verdicts are void and they are gated again.
  • Head segment: a fresh head not tried before is its own first segment, when nothing else waits behind the batch. If the line is waiting, the #4999 behaviour stays: the head goes alone beside the line. The existing 30-pull suspect test still passes unchanged.
  • Room-0 path: with no free slot, only the front half is gated, as before.

Tests

  • test/merge-queue-stacked.test.ts is new and has three tests. A red second half stacked on a green first lands the first and reuses the second's verdict. A red first half voids the stacked second, and it is gated again. An 8-pull batch with one bad pull (at 1, 4 and 8) lands all 7 good ones in at most 2 gate rounds after the red.
  • I rewrote the expected gate waves in merge-queue-search.test.ts and merge-queue-parallel.test.ts. The old waves assumed disjoint segments gated on main. The ten-pull case now takes 4 gate-times instead of 5. The test was wrong about what the code should do now, not the other way round.

Limits

  • The "at most 2 rounds" claim holds when the free slots cover every pull of the batch (7 slots in the test). With fewer slots the search is still bisection: for example 3 rounds after the red with 1 free slot and a bad pull at step 8.
  • I did not stack the "head alone beside the line" path (#4999). Doing so would have made the 30-pull suspect case take 3 gate-times instead of 2.

Try it: bun test test/merge-queue

commented

Parked by the crew: the preview's deploy failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs