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

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

@⁠Pierrot1398 on GitHub · 2026-11-25 17:29 UTC · original
Pierrot1398:loader/step-over → main · +74 −0 · 2 files · 2 commits · open

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

**@⁠Pierrot1398** on GitHub · 2026-11-25 17:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2644) `Pierrot1398:loader/step-over` → `main` · +74 −0 · 2 files · 2 commits · open *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
GTA VI 1.0.2.1's pool allocator traps on an empty pool (int3 at +0x63966f and
+0x5149aec, #698) right before returning NULL. Stepped over, the allocation
fails and the title goes on: on an RTX 5060 Ti this reaches the world
(HUD and ambient sound). Off unless the variable is set; only an int3 in a
mapped image at a listed offset is stepped over. After slauko's patch in #698.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:04 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 17:48 UTC · original

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.

**@⁠kotekompotek** on GitHub · 2026-11-25 17:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2644#issuecomment-7170020898) 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.
Author
Owner

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

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

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

@⁠futurepro62 on GitHub · 2026-11-26 01:19 UTC · original

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.
**@⁠futurepro62** on GitHub · 2026-11-26 01:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2644#issuecomment-7179657110) 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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 16:20 UTC · original · approved these changes

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 16:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2644#pullrequestreview-6077453497) · **approved these changes** 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 can be merged automatically.
This branch is out-of-date with the base branch
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/2644/head:github-bot/gh-2644'
git switch 'github-bot/gh-2644'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2644'
git switch 'github-bot/gh-2644'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2644'
git switch 'github-bot/gh-2644'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2644'
git switch 'main'
git merge --squash 'github-bot/gh-2644'
git switch 'main'
git merge --ff-only 'github-bot/gh-2644'
git switch 'main'
git merge 'github-bot/gh-2644'
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!2644
No description provided.