Repository navigation
Give up on a page handover only once it stops progressing, not once it has taken 240 s - #6376
Merged
Merged
Conversation
…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
previously approved these changes
Nov 18, 2026
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.
leaf-agent
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 240 s
arrivedfailures on the starved macOS nightly were deferred work landing late, not work that never lands.wait_until_readynow gives up only once a page has goneHANDOVER_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 newlfArrivalsOutstandingbesidelfReadiness. 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 -bbeside 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:runtimeandcheck:browserpass. The opt-in website-verifier tests indev/tests, whose fake page had drifted from #5228 and #6090, pass again. The first commit's message has the measurements.