Repository navigation
Conversation
2 tasks done
JS-banana
force-pushed
the
fix/masked-dispatch-cfg
branch
from
November 12, 2026 03:57
1118950 to
7ff1176
Compare
Tied Together reuses a base register across masked dispatch loops and initializes it later in address order. Prove their table candidates together over control flow instead of trusting a linear writer search. The equality guard excludes the highest masked index: seven targets. Include external direct and recognized table entries as unknown states. Index direct entries once, lazily, and recheck newly accepted functions after every table is known. Synthetic cross-function entries otherwise bypassed the proof and left reachable targets out of the rewrite. Keep existing recognizers and safe complete-initializer entries. On main 3852186, 151 rewriter and documentation tests pass, with no new Python lint findings. Ten unsafe full-rewriter cases failed against the previous PR implementation and pass with the entry checks. Game routes and Metal GPU regression remain untested on this revision.
JS-banana
force-pushed
the
fix/masked-dispatch-cfg
branch
from
November 13, 2026 07:23
7ff1176 to
27e5175
Compare
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.
What and why
Tied Together stops in
patch_nso.pyat a masked dispatch whose base is initialized later in address order and reused by other loops. Its equality guard excludes the highest masked value, so the table has seven entries, not eight.Add a final fallback that proves candidate table bases together over the function's control flow. It rejects unknown incoming values, bypassed guards and return-address writes. Earlier recognizers are unchanged. The rewriter entry records the bounds and rejection rules.
The follow-up review found that an entry from another function could bypass this proof and leave a valid target out of the rewrite. Incoming direct branches now supply unknown states, including branches from code without x18 sites. Functions accepted by this fallback are checked again after all jump tables have been collected, so later-discovered table edges cannot bypass the proof either. Entry at a complete initializer remains valid. The direct-branch index is built once, lazily; embedded words resembling branches can conservatively refuse this fallback.
Validation
Rechecked on upstream main
38521863(2026-11-13), including its stack-frame alignment change.test_jump_copies,test_nso,test_nso_match,test_rewrite_parallel,test_sp_frameandtest_docs.git diff --checkpasses.regress.py impact upstream/main..HEAD: Hades, Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom match the broad rewriter rule; 161 profiles have no usage manifest. This is static reach analysis, not a game regression result.Earlier local repair: Tied Together (
0100B6D00C2DE000) 1.0.2 built and reached its menu; two-player gameplay was reported working on November 8. This rebased revision has not been played.Docs
docs/reference/rewriter.md; symptom index regenerated.