recomp: stop reachability at terminal traps #514

Open
github-bot wants to merge 1 commit from github-bot/gh-510 into native/arm64-run AGit
Owner

@⁠fruvs on GitHub · 2026-11-27 23:04 UTC · original
fruvs:codex/lift-terminal-traps → native/arm64-run · +49 −1 · 1 files · 1 commits · draft

Summary

Stop the lifter's reachability walk at instructions that already emit a nonreturning trap. Direct branches, jump tables, and independently seeded entries still reach their targets. This keeps inline data after a trap from causing an otherwise liftable routine to be replaced by an abort stub.

Verification

  • The synthetic regression fails before the fix and passes after it. It exercises five terminal traps and checks that a separately branched-to successor remains live.
  • All recompiler unit tests pass on this branch. With the same change applied to the PR #115 recompiler, all 16 library tests pass.
  • In a local windowed ARM64/Metal replay, rebuilding the affected library cleared both upscaler translation aborts. The title advanced to a later, separate access violation during story loading.
  • The asset-policy output is identical to the clean base branch. The Windows Clippy gate was unavailable locally because the pinned toolchain lacks the Clippy component.

The recompiler is on native/arm64-run, which is also the base for #115.

**@⁠fruvs** on GitHub · 2026-11-27 23:04 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/510) `fruvs:codex/lift-terminal-traps` → `native/arm64-run` · +49 −1 · 1 files · 1 commits · draft ## Summary Stop the lifter's reachability walk at instructions that already emit a nonreturning trap. Direct branches, jump tables, and independently seeded entries still reach their targets. This keeps inline data after a trap from causing an otherwise liftable routine to be replaced by an abort stub. ## Verification - The synthetic regression fails before the fix and passes after it. It exercises five terminal traps and checks that a separately branched-to successor remains live. - All recompiler unit tests pass on this branch. With the same change applied to the PR #115 recompiler, all 16 library tests pass. - In a local windowed ARM64/Metal replay, rebuilding the affected library cleared both upscaler translation aborts. The title advanced to a later, separate access violation during story loading. - The asset-policy output is identical to the clean base branch. The Windows Clippy gate was unavailable locally because the pinned toolchain lacks the Clippy component. The recompiler is on `native/arm64-run`, which is also the base for #115.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:08:11 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 16:59 UTC · original · approved these changes

Read the diff and ran the crate's tests on the head 7cc469bb: cargo test -p victory-recomp all green, including the new data_after_a_terminal_trap_does_not_block_a_function (five trap mnemonics; checks the bytes after the trap stay unreachable while a separately branched-to successor stays live, and that the lift emits the trap plus the successor's 0x7ull). The change moves the terminal-trap break ahead of the flow-control match and widens it from Ud2 to Int/Int1/Int3/Ud2/Hlt, preserving the old Ud2 behavior via the same path. Approving.

**@⁠AnastasisKon** on GitHub · 2026-11-28 16:59 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/510#pullrequestreview-6099165455) · **approved these changes** Read the diff and ran the crate's tests on the head 7cc469bb: `cargo test -p victory-recomp` all green, including the new `data_after_a_terminal_trap_does_not_block_a_function` (five trap mnemonics; checks the bytes after the trap stay unreachable while a separately branched-to successor stays live, and that the lift emits the trap plus the successor's `0x7ull`). The change moves the terminal-trap break ahead of the flow-control match and widens it from `Ud2` to `Int/Int1/Int3/Ud2/Hlt`, preserving the old `Ud2` behavior via the same path. Approving.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/514/head:github-bot/gh-510'
git switch 'github-bot/gh-510'

Merge

Merge the changes and update on Forgejo.
git switch 'native/arm64-run'
git merge --no-ff 'github-bot/gh-510'
git switch 'github-bot/gh-510'
git rebase 'native/arm64-run'
git switch 'native/arm64-run'
git merge --ff-only 'github-bot/gh-510'
git switch 'github-bot/gh-510'
git rebase 'native/arm64-run'
git switch 'native/arm64-run'
git merge --no-ff 'github-bot/gh-510'
git switch 'native/arm64-run'
git merge --squash 'github-bot/gh-510'
git switch 'native/arm64-run'
git merge --ff-only 'github-bot/gh-510'
git switch 'native/arm64-run'
git merge 'github-bot/gh-510'
git push origin 'native/arm64-run'
This discussion has been locked. Commenting is limited to contributors.
No description provided.