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

Open
github-bot wants to merge 2 commits from github-bot/gh-1156 into main AGit
Owner

@⁠adamdotpy on GitHub · 2026-11-24 16:17 UTC · original
adamdotpy:loader/title-asserts → main · +100 −0 · 2 files · 2 commits · open

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.

**@⁠adamdotpy** on GitHub · 2026-11-24 16:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1156) `adamdotpy:loader/title-asserts` → `main` · +100 −0 · 2 files · 2 commits · open *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.
A title asserts with `int3` where a check it believes it cannot recover
from failed, and without a debugger the first one ends the process. Every
report of "it stops at base+0x1ce6e13" then needs someone to reverse the
check before anything can be said about it.

`VICTORY_TITLE_ASSERTS=<n>` continues past up to `n` of them instead: the
byte at the faulting address is checked for `0xcc` (a debugger's breakpoint
patches the code, so its byte is the instruction it replaced, and that is
still fatal), the instruction is skipped, and the check is taken as passed,
so its caller keeps the value it computed. The count is spent only where it
is used, and the assert's address is logged so the next one is a line in a
log rather than a fresh investigation.

Off by default, and documented as what it is: a run that gets past a failed
check is not a run to trust, it is how the next thing that needs work is
found. On the title here it gets past five asserts and then to a
`0xc0000005` write of `0x20` inside `VCRUNTIME140.dll` — the null-ish
destination that the fifth check existed to prevent — which is the next
thing to look at, not a fix.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
An assert in a bring-up build usually says what it was checking on the
lines just before the `int3`; the skip logged only its own address. The
kept debug output (`note_title_output`, the same lines crash reports
carry) now prints with each skip, so a run that gets past an assert shows
the reason next to where it was taken.

`cargo test -p victory-loader` 23 + 2 + 1 passed, clippy
`--all-targets --all-features -D warnings` clean, release build fine;
rustfmt reports no diff of mine (the six it lists are pre-existing).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:21:31 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:01 UTC · original

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).

**@⁠Zipettte** on GitHub · 2026-11-24 18:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7140038622) 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)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:37 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 00:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7148714975) <!-- 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)_
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 06:45 UTC · original

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.

**@⁠Key-rs** on GitHub · 2026-11-25 06:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1156#issuecomment-7155128295) 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 has changes conflicting with the target branch.
  • crates/victory-loader/src/crash.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1156'
git switch 'github-bot/gh-1156'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1156'
git switch 'github-bot/gh-1156'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1156'
git switch 'main'
git merge --squash 'github-bot/gh-1156'
git switch 'main'
git merge --ff-only 'github-bot/gh-1156'
git switch 'main'
git merge 'github-bot/gh-1156'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1156
No description provided.