fix(assert): initialize spilled Z80 parameters in direct-call bootstrap - #68
Merged
Merged
Conversation
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.
Problem and behavior
A direct
assert f(args) via z80can allocate a parameter to memory. The assertion bootstrap emittedLD mem, 5738, which is invalid Z80 and does not address the named spill slot used by the function. This change initializes that exact spill label byte by byte before setting register arguments. Sandbox trampolines now use the actual instruction size to keep their code and data addresses stable across assertions. Advisory lint is scoped to changed Go packages, avoiding unrelated optional graphics type-check failures.Evidence
On the same direct-call seeds 0–2999, using the #67 baseline and this PR's GitHub CI artifact:
The increased wrong-value and execution counts are previously masked cases, not regressions established by this comparison. Direct-call fuzz remains report-only; production calling and arithmetic still need fixes.
Validation
go test -short -timeout 5m ./pkg/pipeline/... ./pkg/mir2/...passes.