Skip to content

Rewriter: resolve scheduled offset jump tables through x18 - #654

Open
aldotms89 wants to merge 1 commit into
igawa6:mainfrom
aldotms89:jump-table-scheduled
Open

aldotms89 wants to merge 1 commit into
igawa6:mainfrom
aldotms89:jump-table-scheduled

Conversation

@aldotms89

Copy link
Copy Markdown

What and why

Resident Evil 6 2.0.0 hits AssertionError: jump table 7a352c because instruction scheduling puts its unsigned guard beyond the older recognizers' lookback. Add a fallback that follows the register and flag definitions, checks the read-only table and the destinations within the unwind range, and checks merged worker results for incoming branches that would bypass the setup. The resolver matches the instruction sequence and uses no per-build addresses. See the rewriter reference.

This change can merge independently and is required to prepare Resident Evil 6.

Checked

  • Python tests — test_jump_copies and test_docs, 62 passed. Worker, Windows worker, tail-call and exclusive-window tests reported 31 passed and one platform skip.
  • Rewrote the Resident Evil 6 2.0.0 main module for Android with two workers. The fallback resolved main+0x7a352c and the rewrite completed.
  • Not re-run on the phone after porting onto current main (no new system-driver or Turnip runs).

Docs

  • Added the rewriter reference, regenerated the symptom index and passed the marker check.
  • Source only. The branch starts from current Peanuts Native main.

Resident Evil 6 schedules instructions between its unsigned guard and dispatch. Follow the reaching definitions and prove the table and destinations stay in bounds. Check merged worker results for incoming edges that would skip the setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant