Skip to content

[B4] ci(visual): nightly/label trigger + deterministic golden-image diff as primary gate #874

Description

@MichaelFisher1997

Part of #834 (Production-Readiness Audit) — Batch B4 (make bench/visual actually fail, parallel-safe).
Replaces audit items #3b + #17 (merged because both touch the visual-test workflow + harness). Parallel with: audit-b4 siblings — this issue owns visual-test.yml + the visual harness.

Problem

Two related gaps sharing one area, so they ship as one PR:

  1. #3b — visual tests never run. visual-test.yml is workflow_dispatch only. Visual regressions are never caught.
  2. Refactor: Split main.zig into modular game components #17 — visual regression is LLM-judged only. visual-test.yml feeds screenshots to MiniMax-M3 for verification. There's no deterministic perceptual/pixel comparison against a golden image, so silent visual regressions the model normalizes away will ship.

Acceptance criteria

  • visual-test.yml runs on a nightly schedule and on a run-visual-test label trigger.
  • Deterministic golden-image diff added as the primary gate: pixelmatch / odiff / ImageMagick compare, with configurable tolerance.
  • LLM verification kept as a secondary diagnostic (comment-only, not gating) until golden-image confidence is established.
  • Golden images committed under docs/visual-test/golden/ (or similar) with a regeneration procedure documented.
  • Tolerance tuned for Lavapipe non-determinism across versions (flag in the workflow so it's not under-scoped).

Files in scope

  • .github/workflows/visual-test.yml
  • visual-test harness source (wherever screenshots are produced/compared)
  • docs/visual-test/golden/ (new — golden images)
  • comparison script (scripts/compare_images.sh or equivalent)

Dependencies

  • Coordinate with B4-1 (bench/Bencher) — different workflow file, parallel-safe.

Out of scope

  • New test scenes (use existing visual-test scenes as the golden set).
  • Replacing the LLM judge entirely (it stays as diagnostic).

Branch / PR

  • Branch: ci/visual-golden-diff · Targets: dev

Metadata

Metadata

Labels

audit-b4Audit Batch 4: Make bench/visual actually fail (needs B1)cidocumentationImprovements or additions to documentationhotfixproduction-readinessAudit findings: missing CI/lint/benchmark/regression guardrails for production-grade enginevisual-testIssues from automated visual regression tests

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions