1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55:38 +00:00
nescript/tests/emulator/goldens
Claude 20a244b9e7
examples: regenerate ROMs, gifs, and goldens after codegen local fix
Commit 76d0fd0 moved function-locals from a codegen-minted
`$0300+` absolute range into the analyzer's zero-page
allocations so inline-asm `{param}` substitutions resolve
correctly (compiler-bugs.md #1). Observable semantics are
preserved — the analyzer + codegen now agree, and every
primitive that used to work still does — but the emitted ROM
bytes change whenever a function reads or writes a local,
because zero-page addressing uses a 2-byte instruction and
absolute addressing uses 3.

Consequences that need regenerated artifacts:

- **Twelve committed `.nes` files are stale.** Same source, new
  compiler, different bytes. The `Build Examples` CI job
  rebuilds each example into a tmp path and diffs against the
  committed ROM, so any drift is a hard failure. Rebuilt all
  twelve (arrays_and_functions, bitwise_ops, coin_cavern,
  function_chain, loop_break_continue, mmc1_banked, platformer,
  pong, sprites_and_palettes, state_machine, structs_enums_for,
  war).

- **Three goldens drift by one animation frame.** Zero-page
  addressing shaves a cycle per local access, which over a full
  frame handler shifts timing-sensitive sequences by a cycle or
  two. war's dealing animation and platformer + pong's audio
  tick stream catch the shift at frame 180 — war's card under
  player A's deck is now one frame earlier in its slide, and all
  three programs' captured audio buffers start from slightly
  different envelope positions. The new goldens (`war.png` + the
  three `.audio.hash` files) reflect the same code compiled with
  the cycle-count-corrected primitives.

- **`platformer.gif` and `war.gif` rebuild.** Same one-frame
  timing drift, integrated across 360 frames of captured
  gameplay — the emulator job's gif-reproducibility check
  wouldn't pass without the refresh. `pong.gif` happened to
  byte-match the old capture after rebuild.

All verified:
  - `cargo clippy --all-targets -- -D warnings` clean on both
    rustc 1.94.1 and 1.95.0.
  - `cargo test --all-targets` — 616 + 3 + 75 tests pass.
  - Full emulator harness — 34/34 ROMs match goldens.
  - Committed-ROM reproducibility diff clean — every
    `examples/*.ne` compiles byte-identical to its committed
    `.nes`.
  - `docs/{platformer,war,pong}.gif` byte-match fresh captures.
  - SHA-256 of "NES" still computes to `AE9145DB…4E0D`.

https://claude.ai/code/session_01FRmSBruVWCufm3LsUVMs8v
2026-04-16 16:12:46 +00:00
..
arrays_and_functions.audio.hash
arrays_and_functions.png compiler: fix three scoping bugs; war: revert all local/param workarounds 2026-04-15 20:33:41 +00:00
audio_demo.audio.hash platformer: end-to-end side-scroller demo + three runtime bug fixes 2026-04-13 13:04:26 +00:00
audio_demo.png
auto_chr_background.audio.hash assets: auto-generate CHR data from @nametable() PNG sources 2026-04-15 03:29:58 +00:00
auto_chr_background.png assets: auto-generate CHR data from @nametable() PNG sources 2026-04-15 03:29:58 +00:00
bitwise_ops.audio.hash
bitwise_ops.png
bouncing_ball.audio.hash
bouncing_ball.png
coin_cavern.audio.hash
coin_cavern.png
comparisons.audio.hash
comparisons.png
friendly_assets.audio.hash language: pleasant asset syntax for palettes, CHR, bg, sfx, music 2026-04-13 16:09:53 +00:00
friendly_assets.png language: pleasant asset syntax for palettes, CHR, bg, sfx, music 2026-04-13 16:09:53 +00:00
function_chain.audio.hash
function_chain.png
hello_sprite.audio.hash
hello_sprite.png
inline_asm_demo.audio.hash
inline_asm_demo.png codegen: reuse analyzer's local allocations so inline asm {param} works 2026-04-16 16:03:10 +00:00
logic_ops.audio.hash
logic_ops.png
loop_break_continue.audio.hash
loop_break_continue.png
match_demo.audio.hash
match_demo.png
metasprite_demo.audio.hash parser/lowering: declarative metasprites for multi-tile sprite groups 2026-04-15 03:13:30 +00:00
metasprite_demo.png parser/lowering: declarative metasprites for multi-tile sprite groups 2026-04-15 03:13:30 +00:00
mmc1_banked.audio.hash
mmc1_banked.png
mmc3_per_state_split.audio.hash
mmc3_per_state_split.png
nested_structs.audio.hash analyzer/lowering: support nested struct fields and array struct fields 2026-04-15 02:19:49 +00:00
nested_structs.png analyzer/lowering: support nested struct fields and array struct fields 2026-04-15 02:19:49 +00:00
noise_triangle_sfx.audio.hash audio: always enable all four tone channels on sfx trigger 2026-04-14 12:09:46 +00:00
noise_triangle_sfx.png audio: triangle and noise sfx channels 2026-04-14 10:42:53 +00:00
palette_and_background.audio.hash palette/background: first-class declarations with reset-time load and runtime swaps 2026-04-13 11:11:33 +00:00
palette_and_background.png palette/background: first-class declarations with reset-time load and runtime swaps 2026-04-13 11:11:33 +00:00
platformer.audio.hash examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00
platformer.png feat(platformer): add stomp-or-die enemy collisions, live HUD, GameOver state 2026-04-13 20:23:07 +00:00
pong.audio.hash examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00
pong.png examples/pong: production-quality Pong game with powerups and multi-ball 2026-04-16 01:25:29 +00:00
scanline_split.audio.hash
scanline_split.png
sfx_pitch_envelope.audio.hash audio: per-frame pitch envelopes for pulse SFX 2026-04-15 02:54:56 +00:00
sfx_pitch_envelope.png audio: per-frame pitch envelopes for pulse SFX 2026-04-15 02:54:56 +00:00
sha256.audio.hash examples/sha256: interactive SHA-256 hasher with on-screen keyboard 2026-04-16 14:02:58 +00:00
sha256.png examples/sha256: interactive SHA-256 hasher with on-screen keyboard 2026-04-16 14:02:58 +00:00
sprite_flicker_demo.audio.hash sprite-per-scanline: add cycle_sprites runtime flicker + debug telemetry 2026-04-15 22:07:19 +00:00
sprite_flicker_demo.png sprite-per-scanline: add cycle_sprites runtime flicker + debug telemetry 2026-04-15 22:07:19 +00:00
sprites_and_palettes.audio.hash
sprites_and_palettes.png
state_machine.audio.hash
state_machine.png
structs_enums_for.audio.hash
structs_enums_for.png
two_player.audio.hash
two_player.png
uxrom_banked.audio.hash
uxrom_banked.png
uxrom_banked_to_banked.audio.hash codegen: support banked → banked cross-bank function calls 2026-04-15 02:37:19 +00:00
uxrom_banked_to_banked.png codegen: support banked → banked cross-bank function calls 2026-04-15 02:37:19 +00:00
uxrom_user_banked.audio.hash codegen: user code in switchable banks via cross-bank trampolines 2026-04-14 11:41:20 +00:00
uxrom_user_banked.png codegen: user code in switchable banks via cross-bank trampolines 2026-04-14 11:41:20 +00:00
war.audio.hash examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00
war.png examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00