test(e2e): stop late overlays racing the GPU visibility spec (#10853)

Merged
LO
10d ago
+98-47

Closes #10853.

What was wrong

The grid axes, annotation text and structural glyphs load after the model, in idle time. They could land between two captures after the spec's 20-frame settle:

  • The #10639 delete scenario failed once on Metal (9,100 px). In the runs that passed, the overlay could satisfy its "occurrences are on screen" check by itself.
  • The same race hit an S2 case in this spec: storey isolation failed with 5,304 px, and its diff image shows only grid axes, dimension lines and the label.

Change (test-only, tests/e2e/gpu-entity-visibility.e2e.spec.ts)

  • Overlays off. open() turns the three overlays off through their persisted type-visibility keys before the page loads. No test in the spec is about them. The delete scenario asserts the store picked the setting up.
  • Occurrence mask. The delete scenario builds a mask of where the deleted occurrences are drawn: a frame with only those ids isolated, against an empty isolation. The on-screen check needs strong (>48/255) changes inside that mask. Bounds on the mask's size prove the empty isolation drew nothing.
  • Absence checks. They compare inside the mask, plus S2's whole-frame bound of ≤ 0.05 % strong px.
  • Still frames. Every capture waits for a still frame.

Coverage cost, stated in the header. With the overlays off, IfcAnnotation and IfcGrid meshes are not uploaded. No scenario here exercises them as hidden or visible batchmates.

Evidence

Apple M-series (Metal), headed Chrome. Three consecutive runs of the whole spec, all 11/11 green:

RunDelete: deleted vs hidden, in mask / whole-frame strongOccurrence px on screen (strong)S2 cases, strong px
10 / 0179 (mask 12,539 px)0 each
20 / 01790 each
30 / 01790 each

Storey isolation's 1,073 faint px in each run are the translucent draw-order difference S2 recorded in #10636 (1,011). Before the change to open(), a combined run failed on that case.

Pre-handoff: 15 pass, 1 skipped. The revert oracle is skipped because no production file changed.

Review

  • /code-review. Fixed:

    • masked absence checks;
    • a strong on-screen threshold;
    • a sanity bound on the empty isolation;
    • a frame assertion in the still-frame helper.

    Documented: the coverage cost and the mask's lighting footprint.

  • Independent reviewer (fresh sonnet, given only the diff and the issue): no blocker. Fixed: distinct messages for the two mask bounds, the upper bound tightened to 10 % (Institute measures 4.8 %), and the whole-frame bound named as S2's own tolerance. Kept: a separate decoder per helper, because each runs in its own page.evaluate.

  • /simplify. The still-frame helper grabs through capture(..., attach = false), the same signature #10799 adds, so the two merge cleanly.

  • Local CodeRabbit: not run (test-only, small).

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end coverage for overlay visibility, entity deletion, and model movement.
    • Added more stable screen captures and checks that compare changes within the affected on-screen area.