HLE/dstorage: VICTORY_DSTORAGE_ZERO_FAILED=1 zeroes the destination of a request that does not decode (damaged game copies; int3 at +0x4da6315) #816

Open
github-bot wants to merge 1 commit from github-bot/gh-816 into main AGit
Owner

@⁠deepdev237 on GitHub · 2026-11-25 08:39 UTC · original
deepdev237:dstorage-zero-failed → main · +31 −2 · 1 files · 1 commits · open

🤖 AI-generated pull request. The change, the tests, the game runs and this description were made by Claude Opus 5.5 (Anthropic, model claude-opus-5-5), running as an autonomous agent in Claude Code. A person asked for this work; they did not review this text before it was posted. Please verify anything you rely on.

What

VICTORY_DSTORAGE_ZERO_FAILED=1 (opt-in, off by default). When a DirectStorage request's zlib or BCPack data does not decode, the request's destination is zeroed instead of keeping a partial decode on top of whatever bytes were there before. The request still reports the failure exactly as before (hr=0x8007000d), and nothing changes when the switch is unset.

Change: one file, crates/victory-hle/src/modules/dstorage.rs, +31/−2. A new zero_failed_destination(request, size) writes zeros through the existing into_destination (so plain and page destinations are both handled). It is called on the two decode-failure paths of execute: the final zlib/BCPack decode, and the zlib stage before BCPack.

Why

Some copies of the game have archives with zero-filled regions (missing data). Requests whose source bytes lie in such a region fail to decode. The title never reads a request's result: it only polls for completion. So it goes on to pointer-fix the resource it asked for. Over stale bytes the fixup finds a pointer outside the resource's ranges and the title stops on its own breakpoint, int3 at +0x4da6315 in 1.0.2.1. This is the routine described statically in xcl-dev/xcl#1164: it walks the resource map's chunks and traps when no chunk contains the pointer. Zeros read as null pointers, which that routine passes.

This does not bring the missing data back. Whatever the resource was is still missing. It only stops stale bytes from being read as pointers. Copies without damaged archives never take this path.

Evidence (two runs, same save, same machine)

Both runs used the same save, which reaches the first gameplay scene of the prologue a few minutes after loading. Both had VICTORY_WALLS_TRACE=1, which names each request's source file. The game copy here has a zero-filled region in navmeshes.rpf at [0x2caa7000, 0x2daa4000), among 11 damaged archives.

Run 3, switch unset (build SHA-256 728DC6EE66335E33CBEF4C94082B4B567753AB4F04D62817C6D3D77C5A242F4D). Three navmesh requests fail, and 0.9 s later the title stops:

05:22:22.438904Z WARN dstorage: request failed: zlib options=0x1 offset=757833744 source_size=246735 destination_size=851968 ... hr=0x8007000d
05:22:22.439141Z INFO walls trace: a read request is done file="G:\\navmeshes.rpf" offset=757833744 ... to_pages=false options=0x1 ms=2 ok=false hr=0x8007000d
05:22:22.442217Z WARN dstorage: request failed: zlib options=0x1 offset=758080480 source_size=11695 destination_size=18032 ... hr=0x8007000d
05:22:22.444730Z WARN dstorage: request failed: zlib options=0x1 offset=758374416 source_size=128086 destination_size=458752 ... hr=0x8007000d
VIctory: first-chance exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x4da6315
VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x4da6315

The run ended at 197.5 s (exitCode=0x80000003). Earlier runs on this copy stopped at the same address every time they got this far.

Run 4, VICTORY_DSTORAGE_ZERO_FAILED=1 (build SHA-256 C418BF2CB28A4632C4466B7F08A16EDFA3776F3D0A9FF13DFAAFD885629EB5D7; the only other difference from run 3's build is a shader-cache key change). The same three requests fail and are zeroed:

08:29:49.141917Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=758080480 destination_size=18032 zeroed=true
08:29:49.144324Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=757833744 destination_size=851968 zeroed=true
08:29:49.145308Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=758374416 destination_size=458752 zeroed=true

68 requests were zeroed in this run (65 in TTDB texture archives, 3 navmesh), with no int3 at all.

  • The title ran on for another 6 min 12 s after these three. It got into the first gameplay scene: the player walks around the cell, the scripted dialogue plays, and the room's walls are drawn.
  • It ended at 900.4 s on an unrelated GPU device removal: host GPU device removed after 1 submissions sent ahead ... 0x887A0005, with the relay on. That is being looked at separately.

One run each, so this is evidence rather than proof.

Tests

  • cargo test -p victory-hle --profile diag on this branch (main 310c6eb + this commit): 96 + 1 passed, 0 failed.
  • cargo build --profile diag -p victory --features diagnostics on this branch: builds.
  • No unit test added for the new path: it needs a request whose decode fails into a real destination, and the existing DirectStorage tests have no failing-decode fixture. Happy to add one if you'd like it.
  • Not run: cargo clippy on this branch alone (main itself currently fails clippy in draw.rs / indirect.rs, see #642).
Full environment and run setup
  • OS: Windows 11 Pro, version 10.0.26300 (build 26300)
  • CPU: AMD Ryzen 9 5950X, 16 cores / 32 threads
  • RAM: 24 GB DDR4 at 2666 MT/s; page file 32 GiB on the system drive (commit limit 55.92 GiB)
  • GPU: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32015.7029 (2026-10-18); host wave lanes min 32 / max 64; DXGI local budget 15,419 MB. A virtual display adapter (Parsec Virtual Display Adapter 0.45) is also installed.
  • Toolchain: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1, LLVM 22.1.8, x86_64-pc-windows-msvc; diag profile with diagnostics.
  • Game: Series X build 1.0.2.1. This copy has zero-filled regions in levels.rpf (12), audio.rpf (3), pack/story000/story000.rpf (3), navmeshes.rpf (1) and six data/ttdb/*.ttpf.
  • The two runs' builds are my integration branch: main 310c6eb plus about 130 open PRs of this repository, with #445 reverted. The list with every outcome is integration-merge-log.tsv in https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8. The PR branch itself is this commit alone on main.
  • Switches in both runs: VICTORY_BAKE_TEXTURES_MS=0 VICTORY_CARD_FETCH_INFLIGHT=1 VICTORY_NO_WATCHDOG=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_RAGE_DEBUGINFO=30 VICTORY_WALLS_TRACE=1 VICTORY_SKIP_PIPELINES=c1eee35dbc50a9ef,f16876929fa64f9f,39f0e9aeb156a61c; run 4 also had VICTORY_DSTORAGE_ZERO_FAILED=1. Relay at its default (stage 2).
  • Shader cache and host pipeline library prebuilt before both runs (27,154 pipelines, 0 driver failures).
  • Run 4 in the world: 3 fps (326–376 ms a frame), 5,000–6,900 draws a frame, about 27 GiB process private memory.

🤖 Generated with Claude Code

**@⁠deepdev237** on GitHub · 2026-11-25 08:39 UTC · [original](https://github.com/fxceless/victory-fork/pull/816) `deepdev237:dstorage-zero-failed` → `main` · +31 −2 · 1 files · 1 commits · open > 🤖 **AI-generated pull request.** The change, the tests, the game runs and this description were made by **Claude Opus 5.5** (Anthropic, model `claude-opus-5-5`), running as an autonomous agent in **Claude Code**. A person asked for this work; they did not review this text before it was posted. Please verify anything you rely on. ## What `VICTORY_DSTORAGE_ZERO_FAILED=1` (opt-in, **off by default**). When a DirectStorage request's zlib or BCPack data does not decode, the request's destination is zeroed instead of keeping a partial decode on top of whatever bytes were there before. The request still reports the failure exactly as before (`hr=0x8007000d`), and nothing changes when the switch is unset. Change: one file, `crates/victory-hle/src/modules/dstorage.rs`, +31/−2. A new `zero_failed_destination(request, size)` writes zeros through the existing `into_destination` (so plain and page destinations are both handled). It is called on the two decode-failure paths of `execute`: the final zlib/BCPack decode, and the zlib stage before BCPack. ## Why Some copies of the game have archives with zero-filled regions (missing data). Requests whose source bytes lie in such a region fail to decode. The title never reads a request's result: it only polls for completion. So it goes on to pointer-fix the resource it asked for. Over stale bytes the fixup finds a pointer outside the resource's ranges and the title stops on its own breakpoint, `int3` at **`+0x4da6315`** in 1.0.2.1. This is the routine described statically in xcl-dev/xcl#1164: it walks the resource map's chunks and traps when no chunk contains the pointer. Zeros read as null pointers, which that routine passes. This does not bring the missing data back. Whatever the resource was is still missing. It only stops stale bytes from being read as pointers. Copies without damaged archives never take this path. ## Evidence (two runs, same save, same machine) Both runs used the same save, which reaches the first gameplay scene of the prologue a few minutes after loading. Both had `VICTORY_WALLS_TRACE=1`, which names each request's source file. The game copy here has a zero-filled region in `navmeshes.rpf` at `[0x2caa7000, 0x2daa4000)`, among 11 damaged archives. **Run 3, switch unset** (build SHA-256 `728DC6EE66335E33CBEF4C94082B4B567753AB4F04D62817C6D3D77C5A242F4D`). Three navmesh requests fail, and 0.9 s later the title stops: ``` 05:22:22.438904Z WARN dstorage: request failed: zlib options=0x1 offset=757833744 source_size=246735 destination_size=851968 ... hr=0x8007000d 05:22:22.439141Z INFO walls trace: a read request is done file="G:\\navmeshes.rpf" offset=757833744 ... to_pages=false options=0x1 ms=2 ok=false hr=0x8007000d 05:22:22.442217Z WARN dstorage: request failed: zlib options=0x1 offset=758080480 source_size=11695 destination_size=18032 ... hr=0x8007000d 05:22:22.444730Z WARN dstorage: request failed: zlib options=0x1 offset=758374416 source_size=128086 destination_size=458752 ... hr=0x8007000d VIctory: first-chance exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x4da6315 VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x4da6315 ``` The run ended at 197.5 s (`exitCode=0x80000003`). Earlier runs on this copy stopped at the same address every time they got this far. **Run 4, `VICTORY_DSTORAGE_ZERO_FAILED=1`** (build SHA-256 `C418BF2CB28A4632C4466B7F08A16EDFA3776F3D0A9FF13DFAAFD885629EB5D7`; the only other difference from run 3's build is a shader-cache key change). The same three requests fail and are zeroed: ``` 08:29:49.141917Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=758080480 destination_size=18032 zeroed=true 08:29:49.144324Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=757833744 destination_size=851968 zeroed=true 08:29:49.145308Z WARN dstorage: a request that did not decode left its destination zeroed (VICTORY_DSTORAGE_ZERO_FAILED) offset=758374416 destination_size=458752 zeroed=true ``` 68 requests were zeroed in this run (65 in TTDB texture archives, 3 navmesh), with **no `int3` at all**. - The title ran on for another 6 min 12 s after these three. It got into the first gameplay scene: the player walks around the cell, the scripted dialogue plays, and the room's walls are drawn. - It ended at 900.4 s on an unrelated GPU device removal: `host GPU device removed after 1 submissions sent ahead ... 0x887A0005`, with the relay on. That is being looked at separately. One run each, so this is evidence rather than proof. ## Tests - `cargo test -p victory-hle --profile diag` on this branch (`main` `310c6eb` + this commit): 96 + 1 passed, 0 failed. - `cargo build --profile diag -p victory --features diagnostics` on this branch: builds. - No unit test added for the new path: it needs a request whose decode fails into a real destination, and the existing DirectStorage tests have no failing-decode fixture. Happy to add one if you'd like it. - Not run: `cargo clippy` on this branch alone (`main` itself currently fails clippy in `draw.rs` / `indirect.rs`, see #642). <details><summary>Full environment and run setup</summary> - OS: Windows 11 Pro, version 10.0.26300 (build 26300) - CPU: AMD Ryzen 9 5950X, 16 cores / 32 threads - RAM: 24 GB DDR4 at 2666 MT/s; page file 32 GiB on the system drive (commit limit 55.92 GiB) - GPU: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32015.7029 (2026-10-18); host wave lanes min 32 / max 64; DXGI local budget 15,419 MB. A virtual display adapter (Parsec Virtual Display Adapter 0.45) is also installed. - Toolchain: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1, LLVM 22.1.8, `x86_64-pc-windows-msvc`; `diag` profile with `diagnostics`. - Game: Series X build 1.0.2.1. This copy has zero-filled regions in `levels.rpf` (12), `audio.rpf` (3), `pack/story000/story000.rpf` (3), `navmeshes.rpf` (1) and six `data/ttdb/*.ttpf`. - The two runs' builds are my integration branch: `main` `310c6eb` plus about 130 open PRs of this repository, with #445 reverted. The list with every outcome is `integration-merge-log.tsv` in https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8. The PR branch itself is this commit alone on `main`. - Switches in both runs: `VICTORY_BAKE_TEXTURES_MS=0 VICTORY_CARD_FETCH_INFLIGHT=1 VICTORY_NO_WATCHDOG=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_RAGE_DEBUGINFO=30 VICTORY_WALLS_TRACE=1 VICTORY_SKIP_PIPELINES=c1eee35dbc50a9ef,f16876929fa64f9f,39f0e9aeb156a61c`; run 4 also had `VICTORY_DSTORAGE_ZERO_FAILED=1`. Relay at its default (stage 2). - Shader cache and host pipeline library prebuilt before both runs (27,154 pipelines, 0 driver failures). - Run 4 in the world: 3 fps (326–376 ms a frame), 5,000–6,900 draws a frame, about 27 GiB process private memory. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Opt-in, off by default. When a DirectStorage request's zlib or BCPack data
does not decode (damaged or missing source bytes), its destination is
zeroed instead of keeping a partial decode over stale bytes. The title never
reads a request's result, so it goes on to fix up the resource it asked for;
over stale bytes that finds pointers outside the resource and the title
stops on its own breakpoint (int3 at +0x4da6315 in 1.0.2.1). Zeros read as
null pointers. The resource is still missing; this only changes how the
title meets it. Meant for game copies with damaged archives.

AI-generated: written by Claude Opus 5.5 (Anthropic) in Claude Code, and
tested by it on an AMD Radeon RX 9060 XT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:51:46 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 10:12 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 77f9be6 into main 9376fd6 in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins never used, depth_written never read, in victory-gpu); with --all-features it fails with the same number of errors as main (4). This PR adds none and removes none. cargo test --workspace --locked: 540 passed, 0 failed, 10 ignored, two runs (main alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 10:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/816#issuecomment-7159389168) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `77f9be6` into `main` `9376fd6` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins` never used, `depth_written` never read, in `victory-gpu`); with `--all-features` it fails with the same number of errors as `main` (4). This PR adds none and removes none. `cargo test --workspace --locked`: 540 passed, 0 failed, 10 ignored, two runs (`main` alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
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/816/head:github-bot/gh-816'
git switch 'github-bot/gh-816'

Merge

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