Skip to content

Give up on a page handover only once it stops progressing, not once it has taken 240 s - #6376

Merged
max-sixty merged 4 commits into
mainfrom
macos-handover-deadline
Nov 18, 2026
Merged

max-sixty merged 4 commits into
mainfrom
macos-handover-deadline

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

The 240 s arrived failures on the starved macOS nightly were deferred work landing late, not work that never lands. wait_until_ready now gives up only once a page has gone HANDOVER_DEADLINE_MS (still 240 s) without progress, rather than once the whole handover has taken that long. Progress is a readiness stage the wait hasn't seen, or fewer arrivals left at its stage than at any reading before (HandoverProgress), read from a new lfArrivalsOutstanding beside lfReadiness. A page whose arrivals only make way for others still fails at the bound. The render gate's shared handover budget goes.

Closes #6302 (its 30 s half was #6310).

Why a progress bound rather than a fourth raise (30 → 90 → 240 s): each live sample a check starts loads its own page, three at a time, so the whole handover grows with the page's samples. Reproduced here under taskpolicy -b beside 96 busy loops: on main the feature gallery's check fails exactly as on the nightly, at 240 s with 43 of 50 arrivals landed; with the deadline raised all land by 260 s into that wait, never more than 62 s apart. This branch passes both galleries starved.

To weigh: a sample's whole page is still one arrival of its host, and the widget upgrade has no finer signal, so each must fit one 240 s window.

Tests: a new browser test fails on main and passes here, and a model test covers a page whose arrivals only swing; focused render-gate, readiness and gallery-check tests, test:runtime and check:browser pass. The opt-in website-verifier tests in dev/tests, whose fake page had drifted from #5228 and #6090, pass again. The first commit's message has the measurements.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits November 17, 2026 23:34
…t has taken 240 s

`wait_until_ready` failed a page whose whole handover took longer than
HANDOVER_DEADLINE_MS. On the starved macOS nightly (run 44068597322, four
workers on three cores), plain `page check` on the feature and
thread-panel galleries failed that way at stage `arrived`: "work the page
deferred past presentation never landed within 240000ms" (#6302).

The work was landing late, not never. Reproduced on this Mac with the test
under `taskpolicy -b` beside 96 busy loops: on main, the feature gallery's
check failed exactly as on CI, at 240 s into the wait for its samples with
43 of 50 arrivals landed and the rest still landing. With the deadline
raised, every arrival landed, 260 s into that wait, and no two landings were
more than 62 s apart. The thread-panel gallery's handover took 2 s idle,
8 s under `taskpolicy -b` alone, 21 s beside 24 loops and 115 s beside 96.
Each live sample a check starts loads a Leaf page of its own, three at a
time, so the whole handover grows with the page's samples (sample pages took
25-92 s each to present at 96 loops).

The deadline had already gone 30 s -> 90 s -> 240 s for load. Raising it
again would fail the next, larger gallery. So the bound now restarts
whenever the page progresses: a readiness stage the wait hasn't seen, or
fewer arrivals left at its stage than at any reading there before
(`HandoverProgress`). The page exposes the count beside `lfReadiness` as
`lfArrivalsOutstanding`. Arrivals that only make way for others, or a stage
that swings back and forth, are no progress, so such a page still fails at
the bound. The failure now reads "...: no progress in 240000ms".

The render gate's shared handover budget (`scheme.py`) is gone, since each
of its waits is bounded by progress, and the iOS probe polls the same way. A
sample's whole page still counts as one arrival of its host, so the bound
must outlast the slowest single sample page, and a stage with no finer
signal, such as the widget upgrade, gets one window of its own.

Behaviour that moved in tests: the readiness-wait message in
`test_the_readiness_wait_names_the_stage_a_page_still_owes`, the
render-gate deadline `test_plain_check_reports_page_request_failures_...`
shortens (now `render_checks.HANDOVER_DEADLINE_MS`), and the website
verifier's fake page answers the new wait. New: a browser test that a page
landing fifteen arrivals over 1.5 bounds passes while one whose arrivals
only swing fails at `arrived` (fails on main at its first wait), and a model
test that a swinging page's wait ends however fast its readings come.

Closes #6302.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
leaf-agent previously approved these changes Nov 18, 2026
leaf-agent
leaf-agent previously approved these changes Nov 18, 2026
… journey does since #5228 and #6090

dev/tests/process/test_website_server.py's fake page still served
locator('main'), which the journey stopped reading in #5228, and expected
an eight-character release marker, which #6090 made seven. The opt-in dev
tests run outside CI, so the drift went unnoticed.
@max-sixty
max-sixty merged commit 7310268 into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the macos-handover-deadline branch November 18, 2026 18:12
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.

page check and the reply markup check give up on the starved macOS nightly: 240 s deferred-work and 30 s goto deadlines

2 participants