Repository navigation
Wait for the ask walk's arrival before reading its settled scroll - #891
Conversation
`test_ask_binding_badges_do_not_cover_their_key_line` failed the nightly suite on main again, with the same shape #876 repaired: the badge the test scrolls one pixel into the shortcut bar's band was still worn, count 2 rather than 1, stable across all fourteen polls. Stillness is half a reading. A page that has not begun an effect is indistinguishable from one that finished it when the only evidence is the scroll number holding still, which `tests/CLAUDE.md` already states under **A wait consumes a fact the system states**. `goToAskNow` awaits `materializeAsk` and one or two `reveal`s before it issues any travel, so `scroll_settled` called straight after the press can count its three still frames on a page the walk has not moved yet. The test then measures its geometry where the walk began, issues its own `scrollTo` from there, and the travel lands on top of it with the badge back above the bar. #876 changed the unit and not the ordering. Measured here on the ask walk, the glide pause it addressed is nought to one frame and holds at nought under processor throttling, because the compositor starts the glide on the frame after the instant move whatever the main thread is doing. The window that grows under load is the asynchronous gesture before the travel is issued, and no count of frames bounds it. The walk arrives and then travels, in that order and in one task (`arriveAt` focuses, `scrollToElement` follows with no await between), so the arrival is a fact the stillness can be read behind. This test is the only `scroll_settled` call site in the suite that had none: every other one already waits on a moved scroll number, a painted attribute, a URL, or the focus. It now waits on the focus too, and the helper and `tests/CLAUDE.md` say why the fact comes first rather than leaving the next reader a frame count to raise.
|
This case recurred at the next commit, and the fix still holds against current Worth confirming because #887 (10d61b2) landed in The other five failures are #884's, unchanged and still open there. Between the two PRs the whole of |
…htly tests around what #886, #889 and #892 moved (#903) `ci` on `main` went red at 7925553 (#892): [`lint` and `test` passed and the complete suite in `nightly` failed on eleven cases](https://github.com/max-sixty/leaf/actions/runs/35650845868). Five of them were #884's and #891's, both since merged, and the visual-review one is green again on today's `main`. This PR is the other six, which arrived together because three features landed between that run and the one before it and none of them was validated against the nightly selection. One is a fault in the layer. The other five are tests still standing where those features used to put things. **The comparison handle's lift is cast in `--shade`.** #892 gave `wa-comparison`'s handle `box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 20%, transparent)`. The layer states one shadow ink per scheme precisely because a hand-mixed colour can only be right about one ground — a drop shadow written for the light paper lifts a dark one by a fraction of what it promises — and `test_every_shadow_the_layer_lifts_a_box_with_is_cast_in_the_scheme_s_own_ink` is the reading that holds every elevation shadow to the token. The handle now spends it. **#889 made a finding say where it is; two assertions held the old wording.** `render-checks/locate.js` reads an element without an id as `<strong> in <lf-option id=c-bearer>` rather than as the host alone. That is the change #889 made on purpose, so the two nightly assertions that spelled the host move to the stated form. **#892 made the screenshot's checkbox a fallback; a test still pressed it.** `test_a_widgets_native_control_names_the_press_the_platform_makes` scrolls `lf-shot`'s transparent checkbox into view and presses Space on it. Since #892 the theme hides that checkbox the moment Web Awesome's comparison lands, so on the live page there is no control there to scroll to. The test now holds the bundle from outside the page through `primed`, which is what `tests/CLAUDE.md` asks for when the ordering matters — an arrangement rather than a race. It needed a page of its own to do it: `lf-diff` imports the same bundle at the top of its module, so holding it on the combined fixture left that widget unupgraded and the page never presented. The staged-control half of the test now runs on `DIFF_PAGE`, and `NATIVE_CONTROL_PAGE` goes with the split. **#886 added a thread to the gallery; a walk was counting presses to a different one.** `test_a_forced_inline_thread_keeps_its_control_inside_the_margin_budget` pressed `t` twice to walk from the gallery's first thread to the crowded suggestion's. #886's summary example anchors at `bg-thread-checkpoint`, which sits between them, so the second press landed there and the test went on to measure a card three thousand pixels from the cluster it names. The walk now goes to the thread it is for, gives up when it comes back round to one it has already stood on, and waits for each press's arrival before the next. **#892's upgrade arrives after the page says it has presented; a settled-page reading started before it.** `test_a_settled_page_with_a_standing_reaction_stops_rendering_its_margin` counts margin layouts across thirty frames on the gallery and allows one. The gallery carries an `lf-shot`, and moving its two frames into `wa-comparison` lays the margin out twice a few milliseconds apart, at whatever moment the module happens to resolve. The stamps `open_page` waits on do not cover an upgrade deliberately placed after them, so the page was still arriving when the count began. The test waits for the comparison first. ## Verification The six cases pass on this branch and five of them still fail on `main` without it; the sixth is the intermittent one, measured below. `tests/test_render_controls.py`, `tests/test_render_anchors.py`, `tests/test_render_projection.py`, `tests/test_render_margin.py` and `tests/test_render_commands.py` were run whole under `--run-nightly`, along with the everyday suite, `npm run test:runtime` and pre-commit on the changed files. <details><summary>Evidence, and what this leaves</summary> **The settled-page case is intermittent, and the hold is what names its cause.** Without the wait it went red on 2 of 12 local runs, with both layouts landing 6–13ms apart somewhere in the first 700ms of the window — 296/302, 191/197, 521/527. With the wait it is 8 of 8 green. Holding `**/vendor/webawesome.esm.js` from outside the page instead, changing nothing else, is 8 of 8 with no layouts counted at all, which is what identifies the shot's upgrade rather than the two-second heartbeat the test's docstring had assumed. **Attribution.** Each failure was placed by running the case at the commits between the two nightly runs: the margin walk passes at 10d61b2 and 2f8ee1b and fails at 965369b (#886), and `git show 965369b -- examples/developer/feature-gallery.html` is the added `bg-thread-checkpoint` paragraph and its thread. **Not in this PR.** One document change producing two margin layouts on adjacent frames is a doubled render in the thing that test exists to bound; this change waits for it rather than removing it, and whether the upgrade should lay out once is #892's question to answer. The wait itself is the third place a test names, by hand, a widget of its own fixture that is still arriving after the page said it presented — `test_margin_layout_batches_the_composed_page_without_refolding_controls` and `test_unchanged_margin_refresh_cost_is_bounded_by_refresh_count` each wait on `[data-interaction-frame]` carrying `data-interaction-ready`, and this adds `lf-shot wa-comparison`. That is one missing fact rather than three waits: a page-level stamp a deferring widget raises when it lands, which `open_page` could wait through, would settle every fixture at once. It is a change to make on its own terms rather than inside a CI repair, and until it is made the next widget to defer will redden some other test at a wait far from its cause. Separately, four nightly cases are red on today's `main` and are not from this run — `test_a_thread_beside_its_cluster_takes_the_room_to_the_visible_edge`, `test_the_margin_groups_meanings_at_one_destination_without_moving_the_page` and `test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline` in both schemes. All four pass at 7925553 and fail at 39d9cad, so they are #895's, and the run that reaches them will be that commit's own. **Environment note.** Six everyday cases and the four browser-launch cases in `tests/test_render_commands.py` fail in this CI sandbox on a clean tree as well — no `AF_UNIX`, no installed Chrome for the subprocess gate — and all of them were green in the `test` job of the run under diagnosis. </details> Co-authored-by: leaf-agent <[email protected]>
cionmainwent red at f3de402 (#881):lintandtestpassed and the complete suite innightlyfailed on seven cases. Six are #884's, unchanged from the run before it and still open there. The seventh is this one, and it is not #881's: that commit moves the Pierre diff bundle and its pin, and the binding-badge fixture draws no diff.test_ask_binding_badges_do_not_cover_their_key_linefailed with the shape #876 repaired — the badge the test scrolls one pixel into the shortcut bar's band still worn, count 2 rather than 1, stable across all fourteen polls.What the wait could not see
Stillness is half a reading. A page that has not begun an effect is indistinguishable from one that finished it when the only evidence is the scroll number holding still, which
tests/CLAUDE.mdalready states under A wait consumes a fact the system states.goToAskNowawaitsmaterializeAskand one or tworeveals before it issues any travel, soscroll_settledcalled straight after the press can count its three still frames on a page the walk has not moved yet. The test then measures its geometry where the walk began, issues its ownscrollTofrom there, and the travel lands on top of it — the badge back above the bar, legitimately kept, for the rest of the assertion's timeout.#876 changed the unit and not the ordering, and the measurement says it addressed the smaller window. On the ask walk here the glide pause is nought to one frame and holds at nought under
Emulation.setCPUThrottlingRate, because the compositor starts the glide on the frame after the instant move whatever the main thread is doing. The window that grows under load is the asynchronous gesture before the travel is issued at all, which is main-thread work; no count of frames bounds it, so raising the count would have been the next wording rather than the fix.What this changes
The walk arrives and then travels, in that order and in one task —
arriveAtfocuses,scrollToElementfollows with no await between — so the arrival is a fact the stillness can be read behind. Each press in this test now waits on its ask's focus beforescroll_settled.That is the rule the rest of the suite already keeps. This was the only one of the suite's 38
scroll_settledcall sites that read stillness with nothing stated before it: every other waits on a moved scroll number, a painteddata-lf-ask, a URL,to_be_in_viewport, or the focus. So the durable half of the change is in the helper's own contract and intests/CLAUDE.md, which said the helper "waits for a scroller to have arrived" — a promise it cannot keep — and now says it waits for one to have stopped and is asked behind the fact that it started. The frames-versus-milliseconds reasoning #876 established stays; what it is for is now named as the glide, not the gesture.Verification
The mechanism reproduces on demand: with the stillness wait allowed to answer early (
frames=0), the page ends at the travel's own position rather than the test's, with the badge worn and the count stable at 2 — the run's failure exactly. The two windows were measured separately on the ask walk at throttling rates 1, 2, 4 and 10; the glide pause reads 0 frames at every rate and the press-to-travel window is the one that carries the slack.tests/test_render_widgets.py --run-nightlyis 179 passed,npm run test:runtime28 passed, andpre-commit run --all-filesclean. The everyday suite is 1195 passed beside six cases that fail in this sandbox and fail identically at the merge base — anAF_UNIXsocket it refuses, a umask it does not grant, and a Node bundle step it cannot run.What this does not do
The six Web Awesome cases stay with #884; nothing here touches them, and
nightlystays red until that merges.scroll_settledkeeps its signature: the ambiguity it carries is not one the helper can settle from outside the page — a gesture that legitimately moves nothing looks the same as one that has not started — so the caller consuming a stated fact is the fix rather than a way around it.The failing cases and where each was read
From the
nightlyjob at f3de402:test_render_export.py::test_a_copy_speaks_reader_origin_after_live_map_is_removed, the seventh in the 725fca7 run, passed here — consistent with #884 reading it as a latent race rather than #878's.The badge test passed 18 consecutive local runs before this change, including ten under six busy cores, so the window is not one an idle machine reaches. What reproduces it is letting the wait answer early, which is what the loaded runner does.