Skip to content

The replay times a candidate overtaken while building by its age - #25

Open
jeremy wants to merge 6 commits into
mainfrom
overtaken-times
Open

jeremy wants to merge 6 commits into
mainfrom
overtaken-times

Conversation

@jeremy

@jeremy jeremy commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

With cancels on, a candidate still building when a later candidate lands all its members is deleted before it answers. Those are the day's slowest builds, and none of them reached the replay's sample of build times, so the replay ran fast on any day cancels was on. hey-native-apps turned it on at 20:46Z on 25 Nov; hey2 has had it throughout.

A candidate the record plans to delete while it is still building, once the trunk holds every member of its chain, now gives the sample its age at that record: a lower bound on the time it would have taken. Nothing else reads it. The live half of the row is unchanged.

The rule

A build gives a sample when the first record that plans its delete reads it as a candidate, pending, not past the timeout (the planner's own test), not marked landed, with an empty chain; it was seen with members before; that record is inside the window; its age is above zero; and it never answered in the records the window reads. The age runs from the deleting record's own push time.

An empty-chain candidate is always overtaken by one pushed after it, so its age is at least a whole build's time. In nine days of records, both queues, the ten such candidates had built 37 to 62 minutes.

What the records say

Simulated over live, per cent, main then this branch, at the head that holds main. The 18 windows (18 to 25 Nov, and 26 Nov to 11:19Z) and both queues' whole 26 Nov. The live half is identical in all 20.

Row Samples added Median p90 Builds per landing
hey-native-apps, whole 26 Nov 5 −4.0 → −1.1 −6.9 → −4.0 +0.5 → −0.1
hey-native-apps, 26 Nov to 11:19Z 3 −8.2 → −2.9 +2.7 → +3.0 +3.2 → +2.1
hey2, whole 26 Nov 4 −4.2 → −2.5 −14.2 → −12.3 +1.8 → +1.8
hey2, 26 Nov to 11:19Z 1 −0.4 → +0.5 −16.9 → −10.0 0.0 → 0.0
hey2, 23 Nov 2 +1.8 → +2.2 −8.4 → −0.6 −0.7 → −1.0
hey2, 21 Nov 1 +1.5 → +3.6 +2.5 → +2.9 0.0 → 0.0
hey2, 18 Nov 1 +2.0 → +2.8 +5.6 → +5.6 +14.7 → +14.8
hey2, 24 Nov 1 +1.5 → +1.7 +2.4 → +2.4 +0.1 → +0.1
the other 12 0 identical identical identical

No figure main has inside 20% is outside with this, and no row has a broken invariant. The moves under about three points are no evidence either way: the replay's figure is a mean over 200 seeds, and a move that size comes and goes between two builds of the eval.

Both replay checks pass on the build of this head: every window within, every perturbation fails as it should.

Checked

  • Each part of the rule has a test that fails with that part removed by hand: candidates only; not past the timeout, at the boundary; the age from the deleting record's push time, and from the recorded push where that record has none; counted where the delete first qualifies, in or out of the window; no sample for a head that moved, a build that answered before or after, a landed mark, a candidate never seen with members, or an age that is not above zero.
  • The live median cannot move: answered times 20, 30 and 40 with one overtaken at 50 keep 30, against a control recording.
  • The fixture is a world the planner produces: two slots, the lower candidate still building when the upper one lands its members.

After three outside reads

The first read the first commit and found the rule too wide: it also took round checks cleared while pending (two in hey2's records, at 21 and 22 minutes, which pull the sample the wrong way), builds past the timeout, and the first planned push time where a push was refused and made again. All fixed. The second read the fix and found one edge, a negative age when a tick dies between its push and its mark, and tests that passed with their guard removed. Fixed in the third commit. The third read that commit and found that a delete planned at an age not above zero still used up the candidate's one sample, so a refused delete lost the valid age the next record would give; it also found no test for the pending guard, none for a delete at the push time itself, and a fixture whose trunk moved a record too early. The fourth commit moves the age test beside the others, as that read proposed, and fixes the three tests; it has had no read of its own. Findings per read: 7, 5, 4, none High in the last.

Not changed, with reasons:

  • A retry that keeps its member in its chain is not counted. The one in nine days of records was deleted at 22 minutes; its members were landed by a candidate pushed before it, so its age bounds nothing.
  • "Never answered" means within the records the window reads, an hour past its end. A build that answers later than that after a refused delete would count in both windows; it needs an overtaker that built in minutes.
  • An unbounded run tracks membership for a sample it then discards. No output changes.
  • With no recorded push time on the deleting record, the age runs from the planned push, which can be one tick earlier than the real one. The replay's clock is the tick.

Brought up to main

Main changed where the replay's build times are made: it keeps each timed build with its commit, whether it failed and when it answered, and the replay leaves out the failed builds of a head it holds guilty. An overtaken candidate now joins those as a build that did not fail, with its age as the time and the deleting record's time as its answer, so it is always kept. Every test of both sides passes with its own values.

One outside read of the merge: no finding on the resolution, the order of the times, their readers, the four hours before the window, or double counting. One Low, taken: a test compared a sorted copy of the times though the replay draws by a seeded index; it now holds the order.

For main after tonight

It lands after tonight's rows and comparison have posted. It is then judged on the posted rows each night as the other replay changes are: reverted if it takes a figure outside 20% that main without it keeps inside.

With cancels on, a candidate still building when a later candidate lands all
its members is deleted before it answers, so the slowest builds of the day
never reached the replay's sample of build times. A candidate or check that
was recorded with members, is read pending with an empty chain (the trunk
holds every member) and is deleted in the window now gives the sample its age
at that record, a lower bound on its time. A build deleted for any other
reason, one with no push time, and one that answered before or after gives no
such sample. The live half of the row is unchanged.
A check cleared with its round while building is not overtaken, and a
candidate past the timeout is a lost run, not a slow one: neither gives a
sample now. The age runs from the push the deleting record reads, where it
has one. A build is counted where its delete is first planned, so a delete
planned before the window and again inside it adds nothing. The tests run the
positive case with cancels on, and compare the live half with a control
recording whose candidate is never deleted, with answered times that a leak
into the live median would move.
A read that mends a push its tick never marked stamps it a second after the
record's time, so the deleting record can read a push later than itself. The
first such delete still marks the candidate, and no sample is taken. The
tests now stand on a two-slot stacked landing with cancels on, real round
builds for the check and the probe, and a keep that has run out for the
landed mark, and each guard has a row that fails without it: the push time
with no timeout, its fallback to the recorded push, a candidate never read
with members, and a first delete planned before the window on a chain not
yet landed. The helper says what the rule does not see.
A delete whose age is not above zero no longer marks the candidate as
deleted, so a later delete of it still gives its age. Pin the pending
guard, the equality at the push time, and the first valid delete before
the window on a chain the trunk had not yet landed.
…eplay samples

An overtaken candidate reaches the replay's sample as a timed build that did not fail, answered at
the record that plans its delete, so recorded keeps it among the times as it keeps any build no
guilty head failed.
…build times

The replay draws a build's time by a seeded index, so the order is part of
what a row gives. The test compared a sorted copy.
@jeremy
jeremy marked this pull request as ready for review November 27, 2026 08:29
Copilot AI balanced review requested due to automatic review settings November 27, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues are identified for the replay build-time sampling change.

No open issues 🎉

What changed in this PR

This PR reduces replay timing bias by including the age of qualifying candidates deleted while still building after all their members have landed. These ages provide lower-bound build-time samples without changing live metrics.

Changes:

  • Track qualifying overtaken candidates and include their ages only when no answer appears in the records read for the window.
  • Add tests for eligibility, timing boundaries, duplicate deletes, sample order, and unchanged live metrics.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
eval/​live.go Adds qualifying overtaken candidates’ ages to replay build-time samples.
eval/​live_replay_test.go Tests sampling rules, edge cases, ordering, and live-metric preservation.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants