Loader (diagnostics): VICTORY_STEP_OVER steps over listed title breakpoints (#698) #2642

Open
Pierrot1398 wants to merge 2 commits from upstream-pr/2644 into main
Pierrot1398 commented 2026-11-25 17:29:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Pierrot1398 on 2026-11-25T17:29:39Z.


From a tester working with Claude (AI-assisted); measured on my own machine.

Refs #698. The approach is slauko's, described in #698 (a vectored-handler step over the title's own int3); this is an implementation of it on current main.

Problem

In the world, the title stops with 0x80000003 at +0x63966f or +0x5149aec (Series 1.0.2.1), several threads at once, its crash report showing a pool at its limit. Both offsets are a lone int3 on the allocator's own NULL-return path:

  • +0x63966f: cc then xor ebx, ebx; jmp back to the function's return (mov rax, rbx; ...; ret);
  • +0x5149aec: int3 then xor edi, edi; mov rax, rdi (slauko's disassembly in #698).

Stepped over, the allocation returns NULL and the caller goes on.

Change

Diagnostics builds only, off unless set: VICTORY_STEP_OVER=<hex offset>[,<hex offset>…].

  • The loader's vectored handler (crates/victory-loader/src/crash.rs) checks it right after the AMD-only instruction emulation.
  • A breakpoint is stepped over only when the faulting address lies in a mapped image (VirtualQuery, MEM_IMAGE), its offset from that image's AllocationBase is a listed one, and the byte there really is 0xCC. Rip then moves past it and the handler returns EXCEPTION_CONTINUE_EXECUTION.
  • Each listed offset counts its hits. The first three and every power of two are logged (stepped over the title's breakpoint (VICTORY_STEP_OVER)).
  • The README's diagnostics table lists it.

Nothing else about exceptions changes; with the variable unset the handler does exactly what it did before.

Measured

RTX 5060 Ti 8 GB (driver 621.24), Ryzen 7 5700G, 13.9 GB RAM, Windows 11 26300, diag build, VICTORY_STEP_OVER=63966f,5149aec, on a tree with the open NVIDIA fixes (#1832, #1763, #2332, #1779, #1906, #1922, #233, #2178).

without with
stop 0x80000003 at +0x63966f after 6–12 min, 7 threads none from the trap
world intro prestream the game world, HUD and ambient sound; runs of up to about 19 min in the world
hits – more than 2,048 at each offset

The runs end later on host GPU failures of their own (memory on this 8 GB card, a freed-texture page fault as in #557), not on the trap.

As slauko noted, this is a way around the stop, not its cause: the pool stays full, so what asked for it after that point is not drawn.

cargo xtask policy, cargo clippy -p victory-loader --features diagnostics -- -D warnings and cargo test -p victory-loader --features diagnostics pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb

<!-- greyfinch-sync:Marvisak/VIctory:issue:6610030277 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2644). Originally posted by [Pierrot1398](https://github.com/Pierrot1398) on 2026-11-25T17:29:39Z. --- *From a tester working with Claude (AI-assisted); measured on my own machine.* Refs #698. The approach is slauko's, described in #698 (a vectored-handler step over the title's own `int3`); this is an implementation of it on current `main`. ## Problem In the world, the title stops with `0x80000003` at `+0x63966f` or `+0x5149aec` (Series 1.0.2.1), several threads at once, its crash report showing a pool at its limit. Both offsets are a lone `int3` on the allocator's own NULL-return path: - `+0x63966f`: `cc` then `xor ebx, ebx; jmp` back to the function's return (`mov rax, rbx; ...; ret`); - `+0x5149aec`: `int3` then `xor edi, edi; mov rax, rdi` (slauko's disassembly in #698). Stepped over, the allocation returns NULL and the caller goes on. ## Change Diagnostics builds only, off unless set: `VICTORY_STEP_OVER=<hex offset>[,<hex offset>…]`. - The loader's vectored handler (`crates/victory-loader/src/crash.rs`) checks it right after the AMD-only instruction emulation. - A breakpoint is stepped over only when the faulting address lies in a mapped **image** (`VirtualQuery`, `MEM_IMAGE`), its offset from that image's `AllocationBase` is a listed one, and the byte there really is `0xCC`. `Rip` then moves past it and the handler returns `EXCEPTION_CONTINUE_EXECUTION`. - Each listed offset counts its hits. The first three and every power of two are logged (`stepped over the title's breakpoint (VICTORY_STEP_OVER)`). - The README's diagnostics table lists it. Nothing else about exceptions changes; with the variable unset the handler does exactly what it did before. ## Measured RTX 5060 Ti 8 GB (driver 621.24), Ryzen 7 5700G, 13.9 GB RAM, Windows 11 26300, diag build, `VICTORY_STEP_OVER=63966f,5149aec`, on a tree with the open NVIDIA fixes (#1832, #1763, #2332, #1779, #1906, #1922, #233, #2178). | | without | with | |---|---|---| | stop | `0x80000003` at `+0x63966f` after 6–12 min, 7 threads | none from the trap | | world | intro prestream | the game world, HUD and ambient sound; runs of up to about 19 min in the world | | hits | – | more than 2,048 at each offset | The runs end later on host GPU failures of their own (memory on this 8 GB card, a freed-texture page fault as in #557), not on the trap. As slauko noted, this is a way around the stop, not its cause: the pool stays full, so what asked for it after that point is not drawn. `cargo xtask policy`, `cargo clippy -p victory-loader --features diagnostics -- -D warnings` and `cargo test -p victory-loader --features diagnostics` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
kotekompotek commented 2026-11-25 18:02:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T17:48:12Z.


Verified live on Series 1.0.2.1 (diag build + this patch): VICTORY_STEP_OVER=1ce6e13,2224517,1d5cc69,22106e0,2219650 walked the boot chain — each site logged with its count, the run continued past all five into a later 0xc0000005 (a different, real failure downstream of the same missing service registration). The offset-via-AllocationBase arithmetic and the 0xCC byte check before stepping both behaved correctly.

Design notes from use: (1) sites listed but never hit stay silent — a 'listed but not hit' summary at exit would help catch typos; (2) stepping over an int3 mid-function continues into whatever follows, which is exactly right for assert-style sites like these (check → int3 → normal path).

This is the right tool for the assert chain in #2613 — poke-free, no writes to RX pages.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170020898 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2644#issuecomment-7170020898). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T17:48:12Z. --- Verified live on Series 1.0.2.1 (diag build + this patch): `VICTORY_STEP_OVER=1ce6e13,2224517,1d5cc69,22106e0,2219650` walked the boot chain — each site logged with its count, the run continued past all five into a later `0xc0000005` (a different, real failure downstream of the same missing service registration). The offset-via-AllocationBase arithmetic and the `0xCC` byte check before stepping both behaved correctly. Design notes from use: (1) sites listed but never hit stay silent — a 'listed but not hit' summary at exit would help catch typos; (2) stepping over an `int3` mid-function continues into whatever follows, which is exactly right for assert-style sites like these (check → int3 → normal path). This is the right tool for the assert chain in #2613 — poke-free, no writes to RX pages.
Marvisak commented 2026-11-26 00:03:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:23:05Z.


Automated triage for the maintainers.

This adds step_over to the vectored handler in crates/victory-loader/src/crash.rs, compiled only with the diagnostics feature and inert unless VICTORY_STEP_OVER is set: an EXCEPTION_BREAKPOINT is resumed past the int3 only when it lies in a MEM_IMAGE region (the title is loaded with LoadLibraryExW in windows.rs, so AllocationBase is its image base), the offset is listed and the byte is really 0xCC. With the variable unset the handler behaves as before; it adds no dependency and no new unsafe pattern beyond what crash.rs already does. One small point a maintainer may want trimmed: the README table row carries an explanation of #698 that is longer than its neighbours. CI (check) passes.

This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177486033 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2644#issuecomment-7177486033). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T23:23:05Z. --- <!-- victory-triage v1 head=26bd942f566c0f28bf30595de4e549528da2913e verdict=merge-candidate at=2026-11-25T23:22:57Z --> Automated triage for the maintainers. This adds `step_over` to the vectored `handler` in `crates/victory-loader/src/crash.rs`, compiled only with the `diagnostics` feature and inert unless `VICTORY_STEP_OVER` is set: an `EXCEPTION_BREAKPOINT` is resumed past the `int3` only when it lies in a `MEM_IMAGE` region (the title is loaded with `LoadLibraryExW` in `windows.rs`, so `AllocationBase` is its image base), the offset is listed and the byte is really `0xCC`. With the variable unset the handler behaves as before; it adds no dependency and no new unsafe pattern beyond what `crash.rs` already does. One small point a maintainer may want trimmed: the README table row carries an explanation of #698 that is longer than its neighbours. CI (`check`) passes. This is a recommendation for a maintainer to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
futurepro62 commented 2026-11-26 02:06:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T01:19:20Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 26bd942 (on its base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7179657110 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2644#issuecomment-7179657110). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T01:19:20Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `26bd942` (on its base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **773 passed, 0 failed, 9 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
fuzeofficlal commented 2026-11-26 16:20:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T16:20:28Z.

Review: APPROVED


Reviewed 26bd942f566c0f28bf30595de4e549528da2913e (merged cleanly onto 63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 x64 (rustc 1.98.1 MSVC).

Audit

  • crates/victory-loader/src/crash.rs:538, :547, :581, :607:
    • Gated behind #[cfg(feature = "diagnostics")] and short-circuits immediately when VICTORY_STEP_OVER is unset/empty, keeping default builds and normal runs unaffected.
    • step_over verifies EXCEPTION_BREAKPOINT, VirtualQuery returning MEM_IMAGE, RVA match against AllocationBase, and that the byte at ExceptionAddress is literally 0xCC before advancing ctx.Rip += 1 (and only when ctx.Rip as usize == at), with bounded log frequency (n <= 3 || n.is_power_of_two()).
  • Minor non-blocking note: trim_start_matches("0x") skips uppercase 0X prefixes (though 0x, +0x, bare hex, and uppercase hex digits all parse cleanly).

Verification

  • Clean merge onto 63bcca43c6a00a758510398fa43096ce7e4f7df0 + cargo run -p xtask -- policy (191 files ok)
  • cargo clippy -p victory-loader --all-targets -- -D warnings (default & --all-features)
  • cargo test -p victory-loader: 39/39 passed (default), 41/41 passed (--all-features).
  • Additional live MEM_IMAGE probe against the test binary's own .text section verified VICTORY_STEP_OVER parsing (+0x..., uppercase hex, whitespace, empty/invalid/overflow tokens) and confirmed step_over rejects non-breakpoint exceptions, heap 0xCC bytes, and listed MEM_IMAGE RVAs that are not 0xCC, while returning true and advancing ctx.Rip by 1 (without double-advancing when Rip != ExceptionAddress) on a listed 0xCC byte.
<!-- greyfinch-sync:Marvisak/VIctory:review:6077453497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2644#pullrequestreview-6077453497). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T16:20:28Z. **Review:** APPROVED --- Reviewed `26bd942f566c0f28bf30595de4e549528da2913e` (merged cleanly onto `63bcca43c6a00a758510398fa43096ce7e4f7df0`) and verified on Windows 11 x64 (`rustc 1.98.1` MSVC). ### Audit - `crates/victory-loader/src/crash.rs:538`, `:547`, `:581`, `:607`: - Gated behind `#[cfg(feature = "diagnostics")]` and short-circuits immediately when `VICTORY_STEP_OVER` is unset/empty, keeping default builds and normal runs unaffected. - `step_over` verifies `EXCEPTION_BREAKPOINT`, `VirtualQuery` returning `MEM_IMAGE`, RVA match against `AllocationBase`, and that the byte at `ExceptionAddress` is literally `0xCC` before advancing `ctx.Rip += 1` (and only when `ctx.Rip as usize == at`), with bounded log frequency (`n <= 3 || n.is_power_of_two()`). - Minor non-blocking note: `trim_start_matches("0x")` skips uppercase `0X` prefixes (though `0x`, `+0x`, bare hex, and uppercase hex digits all parse cleanly). ### Verification - Clean merge onto `63bcca43c6a00a758510398fa43096ce7e4f7df0` + `cargo run -p xtask -- policy` (`191 files ok`) - `cargo clippy -p victory-loader --all-targets -- -D warnings` (default & `--all-features`) - `cargo test -p victory-loader`: **39/39 passed** (default), **41/41 passed** (`--all-features`). - Additional live `MEM_IMAGE` probe against the test binary's own `.text` section verified `VICTORY_STEP_OVER` parsing (`+0x...`, uppercase hex, whitespace, empty/invalid/overflow tokens) and confirmed `step_over` rejects non-breakpoint exceptions, heap `0xCC` bytes, and listed `MEM_IMAGE` RVAs that are not `0xCC`, while returning `true` and advancing `ctx.Rip` by `1` (without double-advancing when `Rip != ExceptionAddress`) on a listed `0xCC` byte.
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/2644:upstream-pr/2644'
git switch 'upstream-pr/2644'

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/2644'
git switch 'upstream-pr/2644'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2644'
git switch 'upstream-pr/2644'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2644'
git switch 'main'
git merge --squash 'upstream-pr/2644'
git switch 'main'
git merge --ff-only 'upstream-pr/2644'
git switch 'main'
git merge 'upstream-pr/2644'
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!2642
No description provided.