Skip to content

Margin thread does not move down when its source changes on macOS #4233

Closed

Description

@leaf-agent

Scheduled CI run 40311120380 on f919fdebec5313bfbc0e67a4d989fa76c3652bf8 records this failure on macOS.

  • tests.browser.test_render_margin::test_a_thread_uses_a_free_margin_and_tracks_its_source

The diagnostic below establishes the failing boundary; it does not yet establish whether the repair belongs in the product or the test.

Deciding CI diagnostics

macOS, tests.browser.test_render_margin::test_a_thread_uses_a_free_margin_and_tracks_its_source:

AssertionError: {'high': {'card': 119.84375, 'cardBottom': 755.59375, 'foot': 842, 'controls': 119.84375, ...}, 'higher': {'card': 79.84375, 'cardBottom': 715.59375, 'foot': 842, 'controls': 79.84375, ...}, 'low': {'card': 529.84375, 'cardBottom': 1165.59375, 'foot': 842, 'controls': 529.84375, ...}}
assert 529.84375 > 529.84375

This report session read the CI log and JUnit results, without a local reproduction. Reproduce on current main, read earlier CI results and the introducing PR, and preserve its intent and the user behavior when choosing a repair. Do not clear an intermittent failure on a passing rerun alone.

Cause of a failure tracked in #4225.

Activity

  1. added
    tend-ci-cause
    on Oct 26, 2026
  2. leaf-agent commented on Oct 26, 2026

    @leaf-agent
    CollaboratorAuthor

    This remains unresolved; I could not reproduce it on Linux and have no verified fix to merge.

    The failing macOS record shows that the card did follow its source between the first two reads (119.84 → 79.84px). On the reverse scroll it followed down to 529.84px but had not moved upward to clear the panel: its bottom was 1165.59px, against the panel's top at 842px. The failing boundary is therefore bottom clamping, rather than source tracking generally.

    Verification and remaining causal boundary
    • On current main, f919fdebec5313bfbc0e67a4d989fa76c3652bf8, uv run pytest tests/browser/test_render_margin.py::test_a_thread_uses_a_free_margin_and_tracks_its_source -q -n0 passed. Separate runs with --cpu-throttle 10 and --cpu-throttle 20 also passed.
    • The downloaded macOS JUnit artifacts for runs 40156291557 and 40196342887 record this test passing; run 40311120380 records the assertion in this issue. Those passes do not establish that the intermittent failure is fixed.
    • The test waits exactly two animation frames after each scroll. browser/runtime/annotation-overlay/thread-preview.js schedules placement through nextRender, then asynchronously computes and commits Floating UI's result. A premature geometry read is a candidate cause, but these runs do not prove it. Replacing the wait without reproducing that ordering would risk hiding a product defect.
    • Keep margin tracking test clear of the banner boundary #1977 changed the earlier scroll offsets to avoid the top boundary; its diff leaves this reverse-scroll check and its two-frame wait intact. Run every tier on macOS nightly, and fix the tests main and macOS fail #3939's description already identified an unreproduced macOS “scroll repaint” failure, but does not establish that it is this same mechanism.

    @max-sixty, this needs a macOS reproduction that distinguishes a pending placement from a completed placement with the wrong bottom constraint. I’m leaving the cause open rather than changing the placement policy or weakening its assertion without that evidence.

  3. leaf-agent commented on Oct 28, 2026

    @leaf-agent
    CollaboratorAuthor

    Push run 40640006419 adds Linux evidence for the bottom-clamping boundary: test_a_thread_uses_a_free_margin_and_tracks_its_source follows its source from card top 106.84375 to 66.84375, then its low reading has cardBottom: 892 against expected 834 ± 0.5 (foot: 842, card: 283.25, controls: 516.84375). This fails at the later bottom assertion rather than the original macOS upward-movement assertion. It broadens the reproduction environment; it does not establish whether asynchronous placement or the completed constraint owns the failure.

  4. leaf-agent commented on Oct 28, 2026

    @leaf-agent
    CollaboratorAuthor

    #4579 repairs the newer Linux failure: #4555 intentionally lets a card beside the floating panel reach the window foot, but this test still expected the panel's top to constrain it. I reproduced the reported 892px versus 834px assertion on current main at 6× CPU slowdown and inspected the failure screenshot: the card stands beside the panel and correctly ends 8px above the 900px window foot. The correction reads that foot and also asserts that the card clears the panel horizontally. The targeted test passes afterward at normal speed and at 6× and 20× slowdown.

    The original macOS failure remains unresolved, so this is a partial repair and leaves this issue open. Its two-frame wait and upward-movement assertion are unchanged. The next diagnostic needs to record the card's geometry and placement completion around that reverse scroll on macOS, distinguishing a pending constraint update from a completed wrong placement; the newer Linux diagnostic does not prove that mechanism. Review and CI for #4579 pass to the queued review and landing workflows (await_ci: false).

  5. leaf-agent commented on Oct 31, 2026

    @leaf-agent
    CollaboratorAuthor

    #4829 repairs the premature geometry read without changing placement or weakening the assertions. I reproduced the original upward-clamping assertion on current main under Linux CPU slowdown. At 40×, a diagnostic sequence reads the card bottom at 1122.64px, then correctly clamped at 892px in the next sampled frame, with subsequent samples unchanged. That establishes a pending placement at the failing read.

    The test now calls the existing rendered() helper after each scroll instead of assuming two animation frames suffice. It passes at normal speed and at 40× slowdown. macOS verification has not run in this session. Pushed as 94f2f74b9; review and CI follow-up belong to the queued review and landing workflows (await_ci: false).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions