Skip to content

Add the core regression harness to the repo and CI - #51

Merged
asterick merged 1 commit into
mainfrom
asterick/regression-harness
Jun 7, 2026
Merged

Add the core regression harness to the repo and CI#51
asterick merged 1 commit into
mainfrom
asterick/regression-harness

Conversation

@asterick

@asterick asterick commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

The headless harness that proved every portability refactor bit-identical (PRs #39/#48/#49/#50) lived only in /tmp — one reboot from vanishing. It now lives in core/test/ with checked-in baselines and a third CI job.

make -C core/test check builds the core natively and diffs per-virtual-second FNV hashes of semantic machine state (register values + RAM + LCD gddram — never raw struct bytes, so hashes survive layout changes) against two 30-second baselines:

  • BIOS-only boot — the embedded BIOS running its no-cartridge loop
  • Synthetic peripheral workout — BIOS idle leaves cartridge-driven hardware cold, so the harness scripts the bus directly: patterned tiles/OAM in RAM, blitter map+sprite rendering (flips/inverts/offscreen clipping) with LCD copy landing in the hashed gddram, all three timers in 8- and 16-bit modes with a compare feeding the audio path, and per-second input wiggles firing edge IRQs

Workflow: an intentional behavior change regenerates with make -C core/test baseline and the baseline diff appears in the PR — behavior changes become explicit and reviewable. Real-ROM verification (core/test/harness rom.min 30) remains the local gold standard for cartridge-driven paths; documented in CLAUDE.md.

Verification

  • Both baselines byte-identical between g++ and clang builds (the portability invariant, now continuously enforced)
  • Deterministic across repeated runs
  • Cold-start make -C core/test check (no table.h, no binary) passes — same path CI takes; the new Core regression job on this PR is the live proof
  • Exercise-mode hashes evolve every second while PC sits in the BIOS idle loop — the mutation is all peripheral state, confirming the workout actually works the hardware

🤖 Generated with Claude Code

The headless harness that verified the portability refactors (PRs
#39/#48/#49/#50) lived in /tmp; it now lives in core/test/ with
checked-in baselines and a CI job, so every PR proves the core's
behavior unchanged — or shows an explicit baseline diff when a change
is intentional.

`make -C core/test check` builds the core with the system compiler and
diffs per-virtual-second FNV hashes of semantic machine state
(register values, RAM, LCD gddram — never raw struct bytes, so the
hash survives layout changes) against two baselines:

- a BIOS-only boot (the embedded BIOS runs its no-cartridge loop)
- a synthetic peripheral workout: since BIOS idle leaves the
  cartridge-driven hardware cold, the harness scripts the bus
  directly — patterned tiles/OAM in RAM, blitter map+sprite rendering
  with LCD copy, all three timers in both widths with compares
  feeding audio, and per-second input wiggles for edge IRQs

Cartridge-driven code paths still need a real ROM locally
(`core/test/harness rom.min 30`); documented in CLAUDE.md along with
the baseline-regeneration workflow for intentional changes.

Both baselines verified byte-identical between g++ and clang builds,
and deterministic across repeated runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@asterick
asterick merged commit 371e7c9 into main Jun 7, 2026
3 checks passed
@asterick
asterick deleted the asterick/regression-harness branch June 7, 2026 06:10
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