Repository navigation
The replay plays a red trunk its fix ends - #28
Conversation
A head is also guilty when, over the records read, no whole build that held it at that head passed, no landing of it was confirmed, two or more failed whole builds held it with no ejected culprit among their members, and it then left the queue at that head: its head moved, its label came off or it was gone. Probes count for neither side. The ejection rule stays; the two are a union, each head judged against the ejected heads alone. The red candidates of such a head leave the unblamed count, so they no longer become a chance of red for every build of the day. On hey2 on 26 Nov #2671's three red candidates were never ejected and read as a 13% chance of red.
A tree a guilty head breaks takes one of that head's recorded failing times, pushed to answered, from the failed whole builds that held it, the shortest drawn where the tree holds more than one. Those times leave the shared sample. A guilty head with no timed failure keeps drawing from the shared sample, and probes keep theirs. Perturbations scale these times.
A whole build read red on a base whose trunk the record reads red is no evidence against its members. The record reads the trunk red as the planner does: a red candidate's blame round in which the build of that base alone was read red and never green, and nothing was read green. A passing build of any kind that holds a head clears it, probes included, and a build once read green has passed whatever a later record reads for it. Builds of the trunk alone are kept in the replay's reading of the records, which dropped them before. The guilt fixtures are now the planner's own days, recorded pass by pass against the simulated CI.
Where the record's queue never ejected a head that broke the build, the replay's queue may eject it first, and the record's next head for that pull request then arrived with no label to queue it. The replay now labels it again at that head, with the record's queueing time. A pull request the record ejected comes back only with its own label, as before.
A whole build that takes a guilty head's failing time no longer draws from the shared sample first, so every other build's shared draws are main's. With no failing times recorded the lookup returns at once. One draw picks each held head's time, and the shortest stands. Two guilty heads in the same recorded build are still both given that build's time, and a failing time is still push to answered.
No record exercises the red-trunk clause. In the planner's form it cleared no head across the eighteen windows from 18 to 26 November, and the red trunk on hey-native-apps from 15:18 to 16:50 on 26 November clears nobody either: every member of its red candidates stayed queued and landed. A rule no record exercises cannot be scored against live. The replay's reading of the records no longer keeps builds of the trunk alone, which only that clause read. It comes back with a head the rule convicts whose failures all sit in a round the planner read as a red trunk. The test of a head's failing times now gives each of its three failed builds a time the shared sample does not hold, so a shared draw cannot pass for one. A head that moves without being held guilty is labelled once, which the red-trunk day used to show.
A wait figure through the window's own simulate comes from them, eight builds of a head with three recorded times take more than one, the shorter of two heads' times wins with it on either number, and the come-back label carries the record's queueing time.
The come-back label read only the heads the rule holds guilty. A head the record ejected, labelled again at that head and ejected again by the replay's queue, stayed out when its author pushed a new head while the record still queued it. It now comes back with every guilty head; where the replay had not ejected it, the label changes nothing.
A planner-made day of eight pull requests that break nothing, with builds of different times, gives the simulated and over-live halves of its row exactly as main gave them, so a build with no guilty head taking one draw more from the shared sample shows.
A build read green already passes every member it holds, and a head that passed is never guilty, so the clause decided nothing. The guard that a record queued the head stays, and now has a test: a head in two red builds that no loaded record queued was otherwise held guilty, its failures taken out of the shared sample and its candidates counted as blamed.
unejected_guilty_heads in the simulated half is how many heads the replay holds to have broken the build and left without an ejection, so a reader of the row can see a conviction and question it. It is a count over the window's records, the same on every seed.
A red trunk: the records do hold a head that left while the trunk failed, and the rule holds it guilty on those builds, so the sentence saying no record holds one goes. A head with one failed build, even one that failed alone. And a head it cannot tell from what it failed beside, unless the record ejected the other.
The records a window loads reach back before it opens, so a head held guilty on an earlier day was counted on every day after. The count now takes only the heads the window plays as guilty.
The verdict read each member's guilt by pull request number when the build answered, so a build pushed with a guilty head whose pull request moved to a clean head while it ran was read green. A tree's guilt is now that of the heads it was pushed with, as its failing time already was: the build pushed with the breaking head fails whatever its pull request holds by the time it answers. This changes what the replay did with a culprit the record ejected: its builds still running when the record moved it to its next head were read green, and are now read red. On the 18 windows only red builds, red candidates and their pull requests move, on four of hey-native-apps' days; landings, waits and builds per landing do not.
A recorded replay opened at the window's start, from the last record at or before it, with no running builds: a candidate building at the start was built again from nothing, so the day's first arrivals waited a build longer than they did live, and a red candidate at the start was replayed late. The open alone moved a figure by up to 17 points: hey2's wait p90 on 25 Nov went from 1.7% over live to 15.0% under it. The replay now opens a constant four hours before the window, from the last record at or before then, or from the first record where none is. Time zero stays at the window's start and the lead-in runs before it, so a window with no record before its start replays as before. The simulator counts its scores again from zero, so landings with their waits, labelled spans and queue-added minutes, builds and probes, red builds and candidates, and ejections count only from the window's start, each by when it happened; waiting_at_open is what waits at zero, and acts counts the acts from zero. withdrawn and departures_after_an_unconfirmed_plan count from the window's start as before. The record's hold is kept only on a head held at the replay's opening record, the one hold the replay did not see begin. A hold that begins in the lead-in is answered by git like one that begins in the window, so the unattributed holds are those of the heads held at the replay's opening. A pull request ejected in error now has never, not zero, for no return, as a return time before zero is a real one. With a 72-hour lead-in the 13 windows that were run sit within 2.2 points of the 4-hour rows on every figure. The count of unejected guilty heads takes in the lead-in: a head the replay plays as guilty before the window still shapes the queue the window opens on.
A replay that broke an invariant in the lead-in left its loop before the window opened, so the row took that seed's lead-in landings, waits, builds, last landing and the pull requests waiting at the break. Such a seed now gives the row its invariant failure and nothing else; the recorded acts the row counts are the window's, as before. The simulated landings an hour is left 0 where every seed's last landing is at the window's start, rather than divided by zero.
A guilty head's failing times came from the window's answered builds alone, so a head the replay plays as guilty only in the lead-in had none, and its lead-in builds drew from the shared sample. Its failing times are now those of its failed whole builds answered from the replay's opening record on, kept as the window's are, less those first read after an unrecorded stretch. The shared sample, the probe time and every rate stay the window's, and a lead-in build of a head that is not guilty gives nothing to any of them.
The red build before a replacement is shorter than the green ones; the opening record is the later of two before the cutoff, with the opening pull request's clocks as recorded; landings at the open are at zero and later; three ready clocks differ from their label's; an earlier landing's values, a lead-in probe and an empty window count nothing; a candidate pushed before zero and red after it is a red candidate, not a whole build; the population at the open changes at zero; a withdrawal seen at zero is pinned as it counts today; the return after a wrong ejection comes from a real one; the lead-in guilty head fails in its own time; and the pair holds clear before zero or are answered by git there.
The row's live half gained the first-candidate fields on main. The pin is the live half main's own build prints for the same records, so the test still shows the replay leaves it alone.
* replay-guilt: The pinned live half carries the first-candidate fields
The landings at the window's start give their wait samples, beside a later one that waits longer, and both wait percentiles of the row; the three own ready clocks give a row whose two percentiles differ, live and simulated; a window with no landing counts no wait, labelled span or queue-added sample; and the return after a wrong ejection runs through Run's opening tick with every build holding the pull request red, out just before its return time and back at the first tick from it.
Two red probes of the bare trunk on T, with no build on T pushed between them read green, make the trunk red from the record that made T the trunk to the push of the first build on T read green after the first probe. The replay plays that span as an episode from where it opens; the span's red builds, read on T where they were first read red, count neither towards the chance of red nor against a head's guilt. The row counts the spans it plays.
…again A pull request wrongly ejected at -13m is out at -5m, due back at -3m, queued again at that tick, and queued when the window opens, with the verdicts forced as in the in-window case beside it.
The first build on T read green after the first red probe ends the span. Where it is a candidate holding pull requests that go first in the record that pushes it, they are the fix: a tree is red unless it holds one, and the span ends when the replay's own queue lands it, with no fix of the simulator's own queued. Any other such build ends the span at its push record, on the acts' clock, a recorded replay's trees going by their push. A span whose fix landed before the replay opens plays no episode. The row counts the fixed spans each seed leaves red.
…firm them A build read green counts on the base it was pushed on as well as the one it is read on, so a green pushed on T between two red probes clears them however the records later rebase it. A span starts no earlier than the push of the last green build on T before its probes. A fix lands where the trunk's next observation confirms the landing, at the record that planned it; a refused one leaves the span running. A fix-ended span's builds are the red ones on T that hold none of its fixes, pushed before the fix lands.
A span no fix ends is still found, and its builds are still no evidence of a head's guilt, but the replay plays no episode for it and its red candidates stay in the chance of red. Trees are judged at their start in every world again. The row counts the unplayed spans that overlap the window.
…e row says so An unplayed span counts only where it overlaps the scored window, and the row gives the minutes it overlaps. The posted row adds a line under the simulator's when the replay landed through one.
* replay-warm: A wrong ejection's return that falls due before the window is tested again Four lead-in replay tests hold the waits they score
There was a problem hiding this comment.
🟡 Changes recommended
The replay logic can skip fix-ended spans when the first green verdict falls beyond the scoring cutoff; span resolution must use later records independently and include a bounded-window regression test.
1 open issue
What changed in this PR
Extends the merge-queue replay built on #26 and #27 to model failing trunk spans that end when a recorded fix lands, while leaving live metrics unchanged.
Changes:
- Detects red-trunk spans and excludes their failures from head-guilt evidence.
- Replays fix-ended spans and reports played, unresolved, and unplayed spans.
- Adds reporting and regression tests for span detection, fix behavior, and unchanged clean-day results.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
eval/tick_replay.go |
Detects red-trunk spans, identifies fixes, and adjusts failure attribution. |
eval/sim.go |
Supports recorded fixes and counts unresolved episodes. |
eval/red_trunk_test.go |
Tests span detection, replay behavior, and boundary cases. |
eval/live.go |
Connects episodes and span metrics to replay scoring. |
eval/live_replay_test.go |
Updates replay helpers and clean-day regression checks. |
eval/live_metrics.go |
Adds four red-trunk fields to simulated results. |
eval/daily-row.jq |
Renders a notice for red-trunk spans not replayed. |
eval/daily_row_test.go |
Tests notice text and compatibility with older rows. |
Review effort: Balanced
|
🤖 The automatic review reported at 06:50Z, five minutes after this merged. Its one finding, a fix read more than an hour past the window's end (thread), is declined: the nightly row cannot have those records, and it reports such a red trunk as not replayed. Resolved. |

When the trunk itself fails, the queue holds until a fix lands. The replay had no red trunk: it kept landing through the stretch, so the pull requests that waited it out live waited nothing there. On the one scored day in the records with such a stretch the replay's p90 was 29% under live.
This plays a red trunk that a fix ends. It is stacked on the lead-in replay. The live half of the row is unchanged; the simulated half gains four fields, and the rendered row one line.
The rule
red_trunk_spans(played),unfixed_red_trunk_spans(the mean over seeds of played spans whose fix has not landed when the window ends), andunplayed_red_trunk_spanswithunplayed_red_trunk_minutes(spans no fix ends, and the minutes of the scored window they cover). When a span was not replayed, a row rendered with its simulated half says so under the simulator's line:| Red trunk no fix ended, not replayed | 1 span, 64 min of the window: the replay landed through it |.The end was decided before any window ran: a clock cannot say "the trunk fails, the trunk plus the fix passes", and ending a fix-ended span at G's push would put the end on the replay's own push of the same candidate.
What the records hold
All the records kept, 15 to 26 Nov, both queues, hold two spans. Both are hey-native-apps':
26 Nov, whole day, simulated over live:
Landings while the trunk was red, 15:17 to 16:47: live 7, base branch 16.0, this branch 3.6. hey2's whole day is identical on both.
The other 18 windows (18 to 25 Nov and 26 Nov to 11:19, both queues): 17 give the base branch's simulated half exactly. hey-native-apps' 24 Nov, whose four hours before the window hold 23 Nov's span, moves by a head no longer held guilty on the trunk's builds: landings +1.9% → +1.6%, median +11.2% → +11.2%, p90 +9.4% → +10.3%, builds per landing +3.5% → +2.8%.
Why the span no fix ends is not played
It was built and measured first. Played as a clock episode, 23 Nov's span left the replay with 11.1 pull requests waiting when 24 Nov's window opened, against 7.0 without it, because the replay lets go about half an hour after live did: live pushed three stacked candidates in one tick and landed 24 pull requests by 00:05; the replay's median was 15. That window's p90 over live went from +10.3% to +14.9%. No scored window holds a span of that kind to show the other side, so the only evidence for playing it moves a window away from live.
The cost: a day with such a stretch inside its window is replayed as landing through it and will likely miss, as 26 Nov did before this change.
unplayed_red_trunk_spanssays so on that day's row.Limits
Checked
After two outside reads
Findings per read: 12 (4 High), then 9 (2 High). The first read the second commit; the second read the fourth. The fifth commit, which only reports, has had no read of its own.
Taken from the first: the trunk's builds for a fix-ended span run to the fix's confirmed landing and leave out builds holding the fix; a landing counts only where the records confirm it; a green counts under the base it was pushed on; a span starts no earlier than the last green before the pair. None moved a figure. Taken from the second: the minutes and the row line for a span not replayed, the overlap test for an empty span, and three tests.
Not changed, with reasons:
pushTimeskeeps the first planned push, as it did before this change.For main, on trial
It lands after the two changes under it (#26 and #27), the same day. An earlier form of this section held it back for a red trunk in a later day's records, read by hand; only the posted row counts, so the posted row is the test.
eval/daily-row.jq. It gets the line for a span not replayed when this lands; the change was run in its print mode against a row carrying the fields.