fix(z80): legal spill operands and emitted split labels — no invalid asm on fuzz2 (P8) - #64
Merged
Merged
Conversation
Route byte and wide spills through legal register paths, preserve staging values, size spill data correctly, and collect orphan TSMC stores before data emission. Forward split return values and include nested dependencies; lower conditional intrinsics through the shared call path. Add red/green assembly and execution regressions and replace the recorded u32 assembly limitation with a 65,636-case Z80 judge. Seeded assembly failures fall from 683/1100 to zero; the corpus assertion matrix has zero new failures. Retain source-oracle discrepancies and remaining corpus classes in the measurement report. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wrwo36SzxKRZYTgpDo7hzo
Keep aggregate and pointer spill values in word slots, gate shadow-bank staging on 24/32-bit integers, and reject insufficient staging pairs. Store every byte of spilled constant block parameters and cache register information per function. Add executed regressions and document remaining correctness defects and final corpus/fuzzer/assertion measurements. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wrwo36SzxKRZYTgpDo7hzo
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wrwo36SzxKRZYTgpDo7hzo
PR tests: 🟢 passCommit:
The external CZECH and full Zork I stories are not part of this PR gate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P8: production Z80 no longer emits invalid assembly on fuzz2-shaped programs
Fixes the root-cause classes behind the assembly failures the differential fuzzer found on main:
SBCthrough an index register;Each fix routes the value through a legal register path. Wide staging and wide slot sizes now apply only to u24/u32 integers. A constant copied into a spilled block parameter is now stored at full width.
Numbers (base 6b8fc39)
nanz/nc.nanznanz/rotozoomer.nanznanz/test_irc_minimal.nanzglsl_sphere_demo.minzOpCallCondemittedCALL ccwith no argument setup (a silent miscompile).highByte(spill)wrote the low byte twice.Honesty note
Correctness evidence covers fuzz2-shaped programs only. On the critic's second generator (globals, u8 temporaries), production Z80 is wrong on essentially every program, on main and on this branch alike. Bugs that already existed now show up as wrong values instead of assembly errors. The report lists them:
emitMov32.Those are the next correctness track.
Gate
Report:
reports/2026-10-02-P8-Invalid-Asm.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01Wrwo36SzxKRZYTgpDo7hzo