Skip to content

Trace replacement moves a margin marker without input #5165

Closed

Description

@leaf-agent

The scheduled run 41432142330 records the following failing boundary. This is CI evidence, not a claim that the failure persists on current main or that its cause is established.

Reconcile current main, existing repairs and active work before reproducing. Diagnose the shared failing operation before choosing a fix; split ownership if reproduction establishes different mechanisms. Preserve the intended behavior from the originating changes and follow the repository’s focused verification, review and landing gates.

tests.journeys.test_render_playwright_trace::test_trace_replaces_captures_without_blank_pixels_or_layout_displacement — Linux
_browser = <Browser type=<BrowserType name=chromium executable_path=/home/runner/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome> version=156.0.8078.4>
request = <SubRequest 'browser' for <Function test_trace_replaces_captures_without_blank_pixels_or_layout_displacement>>

    @pytest.fixture
    def browser(_browser, request):
        """The shared browser process, with context ownership scoped to one test.
    
        `Browser.new_page` opens a fresh context, so local and session storage remain
        isolated. Rejecting browser problems and then closing every remaining context at
        teardown makes health and lifetime fixture guarantees instead of conventions
        repeated at the end of each journey. Closing may itself cancel outstanding requests,
        so it happens after the health reading. Unroute first so cancellations of handlers
        still in flight cannot reach the shared driver's next test.
    
        Handed over wrapped, because the health half of that guarantee has to be installed
        on each page before it navigates: a test that makes its own page gets one already
        reporting to the collector this reads (`render_harness.WatchedBrowser`).
        """
        from render_harness import WatchedBrowser, clean_browser
    
        try:
>           with clean_browser(request.node):

tests/conftest.py:830: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.12/contextlib.py:144: in __exit__
    next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

test = <Function test_trace_replaces_captures_without_blank_pixels_or_layout_displacement>

    @contextmanager
    def clean_browser(test=None):
        """Reject every browser problem a test did not explicitly consume.
    
        The function-scoped browser fixture owns this collector along with its contexts.
        A worker runs one test at a time, so one process-local collector covers pages made
        by `WatchedBrowser`, render helpers, and tests that navigate a page
        themselves. The fixture hands over its `test` node to select shift coverage
        (`watches_shifts`); every problem a watch reports reaches this collector. A test
        that failed or left problems leaves a picture of each page (`_picture_pages`).
        """
        global _BROWSER_PROBLEM_LISTS, _TEST
        assert _BROWSER_PROBLEM_LISTS is None, "browser problem collector already active"
        captured = []
        _BROWSER_PROBLEM_LISTS = captured
        _TEST = test
        try:
            yield
        finally:
            _BROWSER_PROBLEM_LISTS = None
            _TEST = None
        problems = [
            f"{getattr(page, 'url', '<browser page>')}: {problem}"
            for page, problem_list in captured
            for problem in problem_list
        ]
        if test is not None and (problems or getattr(test, "lf_failed", False)):
            _picture_pages(test, [page for page, _ in captured])
>       assert not problems, "\n".join(problems)
E       AssertionError: http://127.0.0.1:46361/versions/v1.html: span.lf-margin-marker.lf-ui.lf-ui-face.lf-margin-entry.lf-holds-word moved without input by (0, 284)px
E         shift evidence: {"kind": "passive", "node": ["span.lf-margin-marker.lf-ui.lf-ui-face.lf-margin-entry.lf-holds-word"], "fragment": 0, "paint_at": 8344.599999999627, "comparisons": [{"before": {"at": 8162.800000000745, "rect": {"x": 1221, "y": -93.59375, "width": 26, "height": 26, "top": -93.59375, "right": 1247, "bottom": -67.59375, "left": 1221}, "layout": {"left": 1221, "top": 140.40625}}, "after": {"at": 8276.199999999255, "rect": {"x": 1221, "y": 190.40625, "width": 26, "height": 26, "top": 190.40625, "right": 1247, "bottom": 216.40625, "left": 1221}, "layout": {"left": 1221, "top": 346.40625}}, "observed": {"left": 0, "top": 284}, "scroll_credit": {"left": 0, "top": 0}, "animation_credit": {"left": 0, "top": 0}, "residual": {"left": 0, "top": 284}, "scroll_terms": [], "animation_terms": [], "animations": []}]}
E       assert not ['http://127.0.0.1:46361/versions/v1.html: span.lf-margin-marker.lf-ui.lf-ui-face.lf-margin-entry.lf-holds-word moved without input by (0, 284)px\nshift evidence: {"kind": "passive", "node": ["span.lf-margin-marker.lf-ui.lf-ui-face.lf-margin-entry.lf-holds-word"], "fragment": 0, "paint_at": 8344.599999999627, "comparisons": [{"before": {"at": 8162.800000000745, "rect": {"x": 1221, "y": -93.59375, "width": 26, "height": 26, "top": -93.59375, "right": 1247, "bottom": -67.59375, "left": 1221}, "layout": {"left": 1221, "top": 140.40625}}, "after": {"at": 8276.199999999255, "rect": {"x": 1221, "y": 190.40625, "width": 26, "height": 26, "top": 190.40625, "right": 1247, "bottom": 216.40625, "left": 1221}, "layout": {"left": 1221, "top": 346.40625}}, "observed": {"left": 0, "top": 284}, "scroll_credit": {"left": 0, "top": 0}, "animation_credit": {"left": 0, "top": 0}, "residual": {"left": 0, "top": 284}, "scroll_terms": [], "animation_terms": [], "animations": []}]}']

tests/render_harness.py:1305: AssertionError

The full tracebacks are in that run’s pytest-results-* JUnit artifacts.

Cause of a failure tracked in #4225.

Activity

  1. added
    tend-ci-cause
    on Nov 3, 2026
  2. leaf-agent commented on Nov 3, 2026

    @leaf-agent
    CollaboratorAuthor

    The cause is in the margin's pin seating, not the trace widget. #5211 adds a deterministic reproduction; there's no fix yet, because a correct one needs a design decision.

    The pin's cover reads lf-trace's sticky .lf-trace-heading where it is painted, which depends on the current scroll. The pin took its seat at the widget's top (document y 140) while the page was scrolled to 590, with the heading stuck far below. The "Last filmstrip image" click scrolled to 139, which put the heading back over that seat. A later, unrelated margin pass, set off by a Viewer class change, then moved the pin to 346 with no input. On CI's slower runner that pass falls outside the click's credited rendering, so the shift watch reports a passive move. Here it reproduces on current main with --cpu-throttle 6, 12 or 20 and passes unthrottled. Main's scheduled runs show it twice in five, both on Linux, with the same message.

    The new test in #5211 reaches the same seat change on a plain page with a sticky header, at scroll 0 and with the header stuck, and fails on main without throttling. Making the seat independent of scroll means reading a stuck sticky box at its in-flow position, and Chromium has no read-only API for that. The PR sets out the options: briefly unstick and measure, derive the slot from neighbouring flow, or count the sticky box over its whole travel. Choosing among them is the open decision, and this issue stays open until a fix lands.

  3. max-sixty commented on Nov 5, 2026

    @max-sixty
    Owner

    Max's decision from the backlog triage: go ahead with this repair.

    Repair: Choose the sticky-box reading yourself, under margin-layout.js's rule that a pin's seat doesn't depend on scroll, preferring a reading that changes nothing on the page. #5211's question doesn't need an answer from Max.

    What decides it: It is an engineering choice among three ways to measure a stuck sticky box, and the module already states the constraint each must meet.

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

  4. leaf-agent commented on Nov 5, 2026

    @leaf-agent
    CollaboratorAuthor

    The repair is on #5211. It reads a sticky box at its own place, through a view timeline, which writes nothing to the page. With it, the pin takes the same seat at every scroll in Chromium and WebKit. Firefox has no ViewTimeline and keeps the old reading; that gap is recorded in notes/browser-support.md. On this runner, the trace journey under --cpu-throttle 12 failed in 2 of 3 runs on main and passed 3 of 3 with the fix. I'll merge #5211 once its CI is green.

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