Loader: continue past a title's int3 asserts, for finding the next blocker #1156

Open
adamdotpy wants to merge 2 commits from upstream-pr/1156 into main
adamdotpy commented 2026-11-24 16:17:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by adamdotpy on 2026-11-24T16:17:32Z.


AI-assisted; measured on my own machine (Windows 11, Rust 1.98.1).

What

Titles assert with int3 where a check failed. Without a debugger the first one ends the process, so every "it stops at victory-image-….dll+0x1ce6e13" report needs someone to reverse the check before anything can be said about it.

VICTORY_TITLE_ASSERTS=<n> continues past up to n of them: the byte at the faulting address is checked for 0xcc before anything is skipped — a debugger's breakpoint patches the code, so the byte there is the instruction it replaced, and that still ends the process — then the instruction is skipped and the check is taken as passed, so its caller keeps the value it computed. Each skip is logged with the address and the count left. Off by default, and the README row says what it is for.

It sits in crash::handler next to emulate_amd_only, which is the same shape of thing: the host doing something the console's CPU would not, and the vectored handler being the one place that sees it first.

Testing

  • cargo test -p victory-loader: 23 passed in the lib (with the new a_title_int3_is_skipped_while_the_budget_lasts, which pins the 0xcc check, the exception-code check, and that the budget is spent only where it is used), 2 and 1 in the next targets.
  • cargo clippy -p victory-loader --all-targets --all-features --locked -- -D warnings: clean.
  • cargo build --release -p victory: builds. rustfmt --edition 2024 --check on the file adds no diff of mine; the six it reports are pre-existing in this file.

What it shows on the title here

Default, unchanged: dies at the first assert, 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x1ce6e13, as before.

VICTORY_TITLE_ASSERTS=8:

VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x1ce6e13 (7 left)
VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x2224517 (6 left)
VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x1d5cc69 (5 left)
VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x22106e0 (4 left)
VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x2219650 (3 left)
VIctory: first-chance exception 0xc0000005 at VCRUNTIME140.dll+0x12960 (write 0x20: nothing mapped there)

Five assert sites, then a write to 0x20 out of VCRUNTIME140.dll — the null-ish destination the last check existed to prevent, which is the failure mode the doc comment warns about. The useful outcome is that the crash moved somewhere new and the addresses now come out of a log instead of an afternoon of reverse engineering. It does not get the world running and is not meant to; it points at whatever those five checks were guarding.

Opt-in precisely because a run that gets past failed checks is not a run to trust. I would not want it on by default, and the commit says so.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586303252 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1156). Originally posted by [adamdotpy](https://github.com/adamdotpy) on 2026-11-24T16:17:32Z. --- *AI-assisted; measured on my own machine (Windows 11, Rust 1.98.1).* ## What Titles assert with `int3` where a check failed. Without a debugger the first one ends the process, so every "it stops at `victory-image-….dll+0x1ce6e13`" report needs someone to reverse the check before anything can be said about it. `VICTORY_TITLE_ASSERTS=<n>` continues past up to `n` of them: the byte at the faulting address is checked for `0xcc` before anything is skipped — a debugger's breakpoint patches the code, so the byte there is the instruction it replaced, and that still ends the process — then the instruction is skipped and the check is taken as passed, so its caller keeps the value it computed. Each skip is logged with the address and the count left. Off by default, and the README row says what it is for. It sits in `crash::handler` next to `emulate_amd_only`, which is the same shape of thing: the host doing something the console's CPU would not, and the vectored handler being the one place that sees it first. ## Testing - `cargo test -p victory-loader`: 23 passed in the lib (with the new `a_title_int3_is_skipped_while_the_budget_lasts`, which pins the `0xcc` check, the exception-code check, and that the budget is spent only where it is used), 2 and 1 in the next targets. - `cargo clippy -p victory-loader --all-targets --all-features --locked -- -D warnings`: clean. - `cargo build --release -p victory`: builds. `rustfmt --edition 2024 --check` on the file adds no diff of mine; the six it reports are pre-existing in this file. ## What it shows on the title here Default, unchanged: dies at the first assert, `0x80000003 at victory-image-b99f876b74d4a77f.dll+0x1ce6e13`, as before. `VICTORY_TITLE_ASSERTS=8`: ``` VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x1ce6e13 (7 left) VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x2224517 (6 left) VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x1d5cc69 (5 left) VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x22106e0 (4 left) VIctory: past a title assert at victory-image-b99f876b74d4a77f.dll+0x2219650 (3 left) VIctory: first-chance exception 0xc0000005 at VCRUNTIME140.dll+0x12960 (write 0x20: nothing mapped there) ``` Five assert sites, then a write to `0x20` out of `VCRUNTIME140.dll` — the null-ish destination the last check existed to prevent, which is the failure mode the doc comment warns about. The useful outcome is that the crash moved somewhere new and the addresses now come out of a log instead of an afternoon of reverse engineering. It does not get the world running and is not meant to; it points at whatever those five checks were guarding. Opt-in precisely because a run that gets past failed checks is not a run to trust. I would not want it on by default, and the commit says so.
Zipettte commented 2026-11-24 18:06:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:01:10Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 2f29526: cargo test -p victory-loader passes, 26 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140038622 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7140038622). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:01:10Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 2f29526: `cargo test -p victory-loader` passes, 26 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
mercuryVM commented 2026-11-24 20:01:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T19:27:41Z.

Review: APPROVED


Tested 2f295269 on Windows 11, RTX 5070, MSVC:

  • cargo test -p victory-loader passes on the head (23 passed).
  • Merged into our fork: workspace tests, shader tests and clippy -D warnings (default and all features) are all clean.
  • I didn't run a title with VICTORY_TITLE_ASSERTS set.

As an opt-in aid that is off by default, this is fine:

  • ExceptionAddress is the int3 itself, so Rip = at + 1 is right.
  • Checking the byte for 0xcc keeps it away from a debugger's patched breakpoints and from the two-byte CD 03 form.
  • The budget is spent only on a real skip.

One suggestion: skip_assert_at doesn't check that at lies in the title image, although the doc and the README say "in title code". An int3 in host code, or in 0xcc padding between functions that a bad jump lands in, would also be skipped. A range check against the title's image, which locate already resolves, would keep the aid to what it says.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045915990 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1156#pullrequestreview-6045915990). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T19:27:41Z. **Review:** APPROVED --- Tested 2f295269 on Windows 11, RTX 5070, MSVC: - `cargo test -p victory-loader` passes on the head (23 passed). - Merged into our fork: workspace tests, shader tests and `clippy -D warnings` (default and all features) are all clean. - I didn't run a title with `VICTORY_TITLE_ASSERTS` set. As an opt-in aid that is off by default, this is fine: - `ExceptionAddress` is the `int3` itself, so `Rip = at + 1` is right. - Checking the byte for `0xcc` keeps it away from a debugger's patched breakpoints and from the two-byte `CD 03` form. - The budget is spent only on a real skip. One suggestion: `skip_assert_at` doesn't check that `at` lies in the title image, although the doc and the README say "in title code". An `int3` in host code, or in `0xcc` padding between functions that a bad jump lands in, would also be skipped. A range check against the title's image, which `locate` already resolves, would keep the aid to what it says. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:08:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:37:56Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-loader/src/crash.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148714975 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7148714975). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:37:56Z. --- <!-- victory-triage v1 head=2f2952693ab1bfbe66365f7f6da35f70203b593b verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-loader/src/crash.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Key-rs commented 2026-11-25 07:03:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Key-rs on 2026-11-25T06:45:37Z.


A rebased copy of this branch is up as #2165 (Key-rs:loader/title-asserts-rebased), on current main (940d32f), because this PR is CONFLICTING.

The conflict is a single spot in crates/victory-loader/src/crash.rs: main grew a let code = …; let to_file = … block at the top of handler, and this patch inserts if unsafe { past_assert(info) } { return -1; } in the same place. #2165 keeps main's block whole and puts the skip ahead of it, which is also the order that matters (a skipped assert should not be reported first-chance on the way past).

No behaviour change is intended — same two commits, same switch, same log line.

If you would rather take the rebase into this PR directly, tell me and I will close #2165; I have no interest in competing with it, only in not leaving the generic switch unrebasable while three machines trap at +0x1330A44.

One data point in favour of it landing: with a narrower variant of the same idea ( xceless/victory-fork#719, which nops the two jumps into that specific int3), the same build on a Ryzen 7 8845H + RTX 4060 goes past the assert into the first-boot screens, the legal notices and the game itself, at 30 fps for 325 s with no crash log. So the check is survivable in the strong sense and "continue and see" is the right tool here.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155128295 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7155128295). Originally posted by [Key-rs](https://github.com/Key-rs) on 2026-11-25T06:45:37Z. --- A rebased copy of this branch is up as #2165 (Key-rs:loader/title-asserts-rebased), on current main (940d32f), because this PR is CONFLICTING. The conflict is a single spot in crates/victory-loader/src/crash.rs: main grew a let code = …; let to_file = … block at the top of handler, and this patch inserts if unsafe { past_assert(info) } { return -1; } in the same place. #2165 keeps main's block whole and puts the skip ahead of it, which is also the order that matters (a skipped assert should not be reported first-chance on the way past). No behaviour change is intended — same two commits, same switch, same log line. If you would rather take the rebase into this PR directly, tell me and I will close #2165; I have no interest in competing with it, only in not leaving the generic switch unrebasable while three machines trap at +0x1330A44. One data point in favour of it landing: with a narrower variant of the same idea ( xceless/victory-fork#719, which nops the two jumps into that specific int3), the same build on a Ryzen 7 8845H + RTX 4060 goes past the assert into the first-boot screens, the legal notices and the game itself, at 30 fps for 325 s with no crash log. So the check is survivable in the strong sense and "continue and see" is the right tool here. AI-assisted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1156:upstream-pr/1156'
git switch 'upstream-pr/1156'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1156'
git switch 'upstream-pr/1156'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1156'
git switch 'upstream-pr/1156'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1156'
git switch 'main'
git merge --squash 'upstream-pr/1156'
git switch 'main'
git merge --ff-only 'upstream-pr/1156'
git switch 'main'
git merge 'upstream-pr/1156'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1156
No description provided.