Repository navigation
Share HiROM contracts and evidence while preserving execution banks - #199
Conversation
|
Replayed this on Secret of Mana (USA), as asked in #193. Short version: it works, and we can drop our hand-written bank aliases. Two observations below. Setup
Results
In the compiled runs of the save-game scripts, the master clock differs by at most ±50 master clocks from about frame 1460 on. A few stack bytes ($01DE–$01F4) differ as well. This starts after the point (frame 1280) where our fork's compiled and interpreted tiers already disagree in both builds. The cause there is a known cycle-accounting gap in our fork: dispatch table bytes are not charged. Shifting code between tiers moves that gap around, so I don't attribute these offsets to #199. Observation 1: expansion into every alias bank Every authored entry in C0–FF is copied into 40–7D, 80–BF and the 00–3F upper halves, including banks the game never executes from:
The C0–FF part is unchanged. Would you consider restricting expansion to alias banks that are actually entered, for example from vectors, observed coverage or an explicit cfg list? Making the wholesale expansion opt-in would also work. Observation 2: dispatch targets keep the authored bank Copied Here this did not change anything visible, because the generated bodies read PB at runtime. It is, however, the full-bank-for-low-bank body substitution that Suggestion: when a target is in the site's own bank, move it into the alias bank together with the site. |
922ed47 to
0dae9c8
Compare
|
@pogoflow The objective review fixes are pushed in The owner accepts longer generation time and larger output for broader native coverage, so no demand-driven/opt-in expansion redesign is requested. I also isolated full-bank mirror fallback checks from the established low-bank path after a dispatch microbenchmark exposed overhead there. The corrected five-PR bundle passes 856 Python tests (2 skips), 115 Rust tests, Clippy and the production dispatch fixture. The MMX/SMW/ALttP/Super Metroid gameplay and current-build save/load checks also pass, with brief paced runtime observations. These are LoROM titles; they cannot qualify your HiROM Secret of Mana project. The synthetic dispatch benchmark cannot establish its built runtime performance either. Please rerun a representative existing gameplay/save-load replay on this updated head, checking the state/video checkpoints that previously qualified the aliases. Please also provide a brief matched, warmed Release runtime comparison against your hand-alias baseline, with audio output muted: build identities, frame count, raw host times/frame times and AOT/interpreter share. Note startup or memory regressions if observed. Keep it proportionate; expand or repeat only if a failure or noisy result warrants it. We need updated title correctness and built runtime evidence, not a generation-time reduction. |
|
Reran this on Builds
Correctness Four scripts: boot without input (3600 frames), and three save-game scripts with load, field, ring menu, flight, shop and a cutscene with dialogue (3700–4600 frames). Each runs normally and as an interpreter-only reference with every AOT node denied. Checkpoints every 10 frames compare WRAM, VRAM, CGRAM, OAM, framebuffer, master clock and the savestate blob.
This time that includes WRAM and the master clock in the compiled runs too. The ±50 clock offsets from my last report were the dispatch-table charging gap in my fork, which is fixed now, so they no longer show up. Within each build, compiled and interpreter-only runs are also identical at every checkpoint. B executes about 0.5–0.8% more compiled blocks over the same scripts. The low-bank dispatch fix works: every 00–02 variant that A has also exists in B (previously 18 were missing), plus 280 more. Runtime Uncapped (frame delay off), headless SDL video, audio enabled with volume 0. Whole-process wall time, peak working set and per-frame host time (run_frame + draw, measured in my game host around the two calls). One warm-up pair, then 5 pairs with alternating order (AB, BA, …). Same three save-game scripts, no dumps.
Startup plus shutdown is about 2.1 s on both sides. Peak working set did not grow even though the binary doubled. Peak commit is within ±1%. Interpreter share (separate TIER2 capture run, interpreted guest cycles over total master clocks): 9.39% → 9.38%, 10.34% → 10.33%, 10.10% → 10.09%. Most of that is wait loops and RAM-resident overlay code, which #199 isn't meant to change. So from my side #199 is good to go. |
0dae9c8 to
8a409ac
Compare
Draw BG modes 4-6 with the compatibility renderer under NewRenderer. Qualified in the combined #199/#214/#215 regression batch at b19edfb: 860 Python tests, native checks, and four representative matched gameplay/save-load/runtime checks. Owner explicitly approved merge after regression confirmation.
Standard HiROM contracts authored in C0 did not reliably reach physical aliases, and inherited near-dispatch targets could make low-bank execution call a full-bank compiled body. Share physical contracts while analyzing each execution bank separately.
Rebased onto current main
246c0d4; head8a409ac. Range-diff confirms the three implementation commits are unchanged from qualified head0dae9c8; the additional commit records the reporter's qualification.Validation:
8a409ac, including Linux/Windows/macOS analyzer jobs.review/open-prs-final-20261026differs from the tested tree only in this qualification documentation.0dae9c8: boot, field/flight, cutscene and shop replays match the hand-alias baseline in WRAM, VRAM, CGRAM, OAM, framebuffer, master clock and current-build state checkpoints, in both compiled and interpreter-only runs.The reporter-owned qualification is complete, and the earlier owner approval for #199 remains accepted. The new current-main #199/#214/#215 bundle at
b19edfbalso passes matched muted gameplay/current-build save-load checks in Mega Man X, A Link to the Past, Super Mario World and Super Metroid, with exact engine/title/UI/ROM/executable provenance retained. Brief diagnostic runtime observations show no consistent introduced regression; Super Metroid's initial slow sample did not reproduce in opposite-order repeats. SMW is paced near 60fps in Yoshi's House (wide-stage margins unverified); SM uses the established original Zebes loader and bypasses Ceres. The owner explicitly authorized merging #199/#214/#215 after confirming the completed combined regression tests. All three are merged; final main503063ehas exactly the testedb19edfbtree. No additional visual check was performed or claimed. This does not claim to fix SD3 intro issue #80.Fixes #193. Tracked in beads-qc3k. Contract: docs/HIROM_ALIASES.md.