feat(vrt): per-test render-mode gating for Canvas2D visual regression#125
Merged
Conversation
Groundwork for running the visual regression suite against the Canvas2D
backend (runner support for --renderMode canvas already exists):
- Test modules can export `renderModes: ('webgl' | 'canvas')[]`;
runAutomation skips non-matching tests and logs the skip.
ExampleSettings gains `renderMode` so tests can branch per backend.
- Marked webgl-only (canvas can't produce meaningful output):
rtt-dimension, rtt-spritemap (renderToTexture is a canvas noop),
text-ssdf (SSDF atlas fonts are SDF-renderer-only).
- Made 17 tests mode-aware: the text/stress tests that render sdf and
canvas text-renderer variants side by side now skip the sdf variants
under the canvas backend (the SDF engine is not registered there and
createTextNode throws); render-settings swaps its SDF-only
Ubuntu-ssdf font for the canvas-loaded Ubuntu face.
Under webgl every test produces byte-identical output to before,
verified by a full visual regression compare run. Under canvas the
full suite now runs clean: 151 snapshots, zero throws, zero page
errors.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chiefcll
added a commit
that referenced
this pull request
Jul 2, 2026
Completes the canvas visual-regression rollout started in #125: - Certify chromium-ci-canvas baselines (151 snapshots), captured in the Docker CI environment. Captured twice and pixel-diffed: both runs byte-identical, guarding against the texture-placeholder timing flake seen once during triage. - Flip the runner's default renderMode from 'webgl' to 'all', as the option's comment anticipated — local runs and CI now cover both backends by default. - Split the CI workflow: unit tests in their own job, visual regression as a webgl/canvas matrix (fail-fast off, per-mode failed-results artifacts) so a red X names the backend that regressed. - Document the dual-backend workflow in visual-regression/README.md and CLAUDE.md, including the per-test renderModes opt-out. Validated with a CI-style Docker compare run over both backends: webgl 180/180 and canvas 151/151 snapshots pass. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
First step toward running the visual regression suite against both backends (the runner already supports
--renderMode canvas|all; what was missing is test-level compatibility). This PR makes the full example suite run clean under the Canvas2D backend: 151 snapshots, zero throws, zero page errors.Gating mechanism
renderModes: ('webgl' | 'canvas')[](default: all modes).runAutomationskips non-matching tests and logs the skip so excluded coverage is visible in runner output.ExampleSettingsgains arenderModefield so tests can branch per backend.WebGL-only marks (3 tests)
rtt-dimension,rtt-spritemap—renderToTextureis a documented noop onCanvasRenderer; the tests render blank.text-ssdf— SSDF atlas fonts exist only for the SDF/WebGL text renderer (confirmed blank under canvas).Made mode-aware (17 tests)
The text/stress tests that deliberately render
sdfandcanvastext-renderer variants side by side threw under the canvas backend (No compatible text renderer found— the SDF engine is not registered there). They now skip the sdf variants whenrenderMode === 'canvas'and keep both under webgl. Notable cases:text-offscreen-movehad a subheader hardcoded to'sdf'even on its canvas pages.stress-animation/stress-tvuse SDF text as HUD/content rather than as a comparison variant — they substitute the canvas text renderer wholesale under canvas.render-settingsused the SDF-onlyUbuntu-ssdffont family for every label, leaving all text as blank/placeholder boxes under canvas; it now falls back to the canvas-loadedUbuntuface.Verification
pnpm test:visual --capture --renderMode canvascompletes 151 snapshots with no page errors and no automation throws, including spot-review of shader, clipping, scaling, and text output against webgl counterparts.Next steps (separate PRs)
chromium-ci-canvasbaselines via the Docker flow (capture twice + pixel-diff to guard against a texture-placeholder timing flake observed once during triage).renderModetoalland split the CI visual job into a webgl/canvas matrix.🤖 Generated with Claude Code