HLE/dstorage: VICTORY_DSTORAGE_ZERO_FAILED=1 zeroes the destination of a request that does not decode (damaged game copies; int3 at +0x4da6315) #816
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!816
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-816"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@deepdev237 on GitHub · 2026-11-25 08:39 UTC · original
deepdev237:dstorage-zero-failed→main· +31 −2 · 1 files · 1 commits · openWhat
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 newzero_failed_destination(request, size)writes zeros through the existinginto_destination(so plain and page destinations are both handled). It is called on the two decode-failure paths ofexecute: 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,
int3at+0x4da6315in 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 innavmeshes.rpfat[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: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-256C418BF2CB28A4632C4466B7F08A16EDFA3776F3D0A9FF13DFAAFD885629EB5D7; the only other difference from run 3's build is a shader-cache key change). The same three requests fail and are zeroed:68 requests were zeroed in this run (65 in TTDB texture archives, 3 navmesh), with no
int3at all.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 diagon this branch (main310c6eb+ this commit): 96 + 1 passed, 0 failed.cargo build --profile diag -p victory --features diagnosticson this branch: builds.cargo clippyon this branch alone (mainitself currently fails clippy indraw.rs/indirect.rs, see #642).Full environment and run setup
x86_64-pc-windows-msvc;diagprofile withdiagnostics.levels.rpf(12),audio.rpf(3),pack/story000/story000.rpf(3),navmeshes.rpf(1) and sixdata/ttdb/*.ttpf.main310c6ebplus about 130 open PRs of this repository, with #445 reverted. The list with every outcome isintegration-merge-log.tsvin https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8. The PR branch itself is this commit alone onmain.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 hadVICTORY_DSTORAGE_ZERO_FAILED=1. Relay at its default (stage 2).🤖 Generated with Claude Code
@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
77f9be6intomain9376fd6in a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warningsfails with exactly the errorsmainitself has on this machine (placed_filler_twinsnever used,depth_writtennever read, invictory-gpu); with--all-featuresit fails with the same number of errors asmain(4). This PR adds none and removes none.cargo test --workspace --locked: 540 passed, 0 failed, 10 ignored, two runs (mainalone: 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.