PR #89 split 3/4: BRK vectors architecturally - #145
Merged
Merged
Conversation
`brkHookEnabled` dates from a bridge that bounced through PLANTED BRK markers, where executing one had to be inert. Nothing plants them any more -- the bridge says so outright: "The bounce is via explicit JSR/JSL interception below, not via planted BRKs" -- so the only BRK the main CPU can now execute is one the guest really reached, which means it is off the rails. Swallowing it was actively harmful. Hardware vectors on the FIRST $00; this continued one byte at a time, so an off-rails run slid through blank memory, crossed back into real code and corrupted the stack before anything trapped. A Super Metroid fault executed 240 such bytes and only stopped on an unrelated COP some 9,000 steps later, by which point the instruction ring held nothing but the slide and the original bad jump was unrecoverable. Now it reports (capped at 8 per run, with PC and mode bits) and takes the architectural vector. The flag is kept for callers that set it explicitly -- SA-1 clears it -- and no longer suppresses the vector. It paid for itself immediately: the same fault moved from ~9,000 steps downstream to the instruction beside its cause, and the diagnosis followed in one run. A 900-frame trace is byte-identical and no BRK executes in a healthy run, so this only bites where the guest is already lost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 4e3ac80)
Member
Author
|
Not mergeable yet: CI fails |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Part 3 of 4 of the split of #89 (@TechnicallyComputers): BRK vectors architecturally instead of being swallowed. The commit is the contributor's 4e3ac80, cherry-picked with
-x, unchanged.Nothing plants BRK markers any more, so a main-CPU BRK is one the guest really reached. Swallowing it as a one-byte no-op let an off-rails run slide through
$00bytes into real code before anything trapped. The BRK now reports (at most 8 per process) and takes the hardware vector. Main's control-flow edge ring (#143) records it as avectoredge, so the jump that led there stays queryable.Evidence: main (097a355) vs this commit
Default (shipped) config, headless scripted runs:
[brk]main / branchNo title vectors on these workloads, and every outcome is identical. The path only fires once a guest is already off the rails.
Evidence is in
F:/Projects/snesrecomp/_wt-pr89-builds/evidence/<game>/<workload>/summary.json.🤖 Generated with Claude Code