Skip to content

feat(vrt): run visual regression on the Canvas2D backend in CI#126

Merged
chiefcll merged 1 commit into
mainfrom
feat/canvas-vrt-ci
Jul 2, 2026
Merged

feat(vrt): run visual regression on the Canvas2D backend in CI#126
chiefcll merged 1 commit into
mainfrom
feat/canvas-vrt-ci

Conversation

@chiefcll

@chiefcll chiefcll commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the canvas visual-regression rollout started in #125. CI now tests both rendering backends on every PR.

Certified canvas baselines

  • 151 chromium-ci-canvas snapshots, captured in the Docker CI environment.
  • Determinism check: captured twice in separate container runs and pixel-diffed — all 151 byte-identical. (Protocol adopted after a one-off texture-placeholder timing flake during the feat(vrt): per-test render-mode gating for Canvas2D visual regression #125 triage; recommend the same capture-twice for future baseline updates.)
  • Reviewed against the WebGL counterparts: shaders (rounded, border, shadow, gradients, blur, hole-punch, edge-fade), clipping, text, resize-mode cover/clip, and scaling all render correctly; text differs only by expected canvas-vs-SDF rasterization.

Runner default → all

pnpm test:visual now runs webgl and canvas by default (the option's comment anticipated this flip once baselines existed). Single-backend runs remain available via --renderMode webgl|canvas.

CI workflow matrix

  • Unit tests split into their own job.
  • Visual regression runs as a renderMode: [webgl, canvas] matrix with fail-fast: false — a failing check names the backend that regressed, and both legs always report.
  • Failure artifacts are per-mode (failed-results-webgl / failed-results-canvas), which also fixes the artifact-name collision the matrix would otherwise hit.

Docs

visual-regression/README.md and CLAUDE.md now describe the dual-backend workflow: new rendering features need snapshots for both backends, or a renderModes = ['webgl'] export with a stated reason.

Verification

CI-style Docker compare run (RUNTIME_ENV=ci, default all mode) over the committed baselines:

  • webgl: 180/180 snapshots pass
  • canvas: 151/151 snapshots pass
  • zero page errors in both legs

🤖 Generated with Claude Code

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>
@chiefcll chiefcll merged commit bc31584 into main Jul 2, 2026
3 checks passed
@chiefcll chiefcll deleted the feat/canvas-vrt-ci branch July 2, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant