DirectStorage: XCL_DSTORAGE_BCPACK_DUMP keeps refused BCPack sources #888
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!888
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/888/head"
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?
@Koro4e on GitHub · 2026-11-24 07:32 UTC · original
Koro4e:dstorage-bcpack-dump→main· +154 −1 · 1 files · 3 commits · closed without mergingA refused BCPack request's source bytes are the input any BCPack decoder implementation needs, and they were gone once the enqueue failed.
The new
XCL_DSTORAGE_BCPACK_DUMP=nkeeps the firstnrefused sources underdata_root()/bcpack/—NNN-modeM.binplus a.metaline with the request fields (source/destination/intermediate sizes, swizzle, zlib, options). Both source kinds are readable at enqueue time: a memory range asexecutereads it, a file through the title's ownIDStorageFile.Measured on the retail title 1.0.2.1 (Series X): a world load refuses 2048+ BCPack requests (BC1 1761, BC5 108, BC6H 1, BC7 178 in one run — 102 MB of texture data the title never receives). With the dump set to 200 the kept chunks decode past the rANS entropy layer with the community clean-room decoders (bcpack-rs, bcpack-decoder), which is where the block-layer work is.
Tested
cargo test -p xcl --lib -- --test-threads=1: 674 passed, 0 failed (the new test included)..metalines, all consumed past the entropy layer by the external clean-room decoders.Not tested
anacondamode only.Regression run
AI use
Written with an AI agent (free-pi); the author reviewed and ran it (
cargo test -p xcl --lib, 674 passed).@ettehn on GitHub · 2026-11-24 07:54 UTC · original
Reproduced a mismatched capture pair on native Windows at
e1a9072. The request counter restarts at 1 in each process. In a private temp root I seeded 001-mode1.bin and its .meta with a 16-byte synthetic capture, held the .bin open without write sharing, and submitted a new 64-byte synthetic BC1 source. The helper logged “request 1 kept (64 bytes, mode 1)”. The .bin still held the old 16 bytes, but .meta had been replaced with source_size 64. A decoder using that pair would be testing the wrong input.Checking the .bin write result and returning on error preserved the previous pair in this test (Windows error 32); checking the .meta write before logging success also keeps that failure visible. The original successful-dump test still passed with these local changes. This handles the reproduced failure; if both files must stay paired across repeated runs and partial writes, a fresh per-run directory and publishing metadata last would also avoid reusing old names. Synthetic inputs only.
OpenAI Codex (GPT-6.2 Astra) assisted with verification.
@Koro4e on GitHub · 2026-11-24 09:25 UTC · original
Fixed, and the repro is a test now — pushed as
09c6a47.The pair is written as one unit or not at all:
dump_pairwrites<stem>.bin.tmpand<stem>.meta.tmp, renames the bytes into place, and renames the description only after them. If any step fails it removes both temporaries and the slot's.bin/.meta, and the log saysnot kept (<err>); no pair left behindinstead of claimingkept.bcpack_dump_failure_leaves_no_meta_that_describes_missing_bytesis exactly your scenario: it seeds001-mode1.binwith 16 bytes and a.meta, opens the.binwithshare_mode(0), submits a 64-byte source, and asserts the bytes are untouched and no.metaremains (no temporaries either). It fails againstb559b01— the meta was replaced while the bin kept its 16 bytes — and passes now.Library suite on this box: 671 passed, 3 failed. The three are the known GPU VRAM cascade (
d3d12x::title_texturestwice,d3d12x::vram::d32s8), unrelated to this change; they also fail on the branch without the fix.@Diskuss on GitHub · 2026-11-24 09:29 UTC · original
Tested on AMD Radeon RX 9070 XT (RDNA4) at
09c6a47190540f8a130acafcc29f7d1a4b6d84d1Ryzen 7 5700X3D, 32 GB RAM, Windows 11 Pro build 26300.9974, driver 32.0.32015.7029, Rust 1.100.0 (0ef1bc386) msvc, DXC 1.9.2602.17, debug build.
So far this PR has only been tested on an RTX 3060. These are CPU-side unit tests, so the GPU model matters little. This adds an AMD / Windows 11 26300 full-suite run.
Tested (PR head
09c6a47merged locally with main077ce40; the branch was 9 commits behind main, merge was clean, nothing pushed):cargo build --workspace: OK.cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 3 failed, 41 ignored. The 3 failures are the known #718 flake (placed_title_textures_share_vram_and_preserve_pixelsplus 2 PoisonError knock-ons:transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory).cargo test -p xcl --lib bcpack_dump -- --test-threads=1: 2 passed, 0 failed (bcpack_dump_failure_leaves_no_meta_that_describes_missing_bytes,bcpack_dump_keeps_the_source_bytes_and_meta_of_refused_requests).Not tested: retail title /
scripts/smoke.ps1(no game files), release build.Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine.
Correction (hidden skips): "SKIPPED 0" above means no
SKIPPEDline appeared in the normal run. A-- --nocapturerun on this machine shows that two tests skip silently, because the D3D12 debug layer is not installed (no Graphics Tools /d3d12SDKLayers.dll):e2e::test_title_draws_with_a_root_signature_under_the_debug_layerandtexture_states::uploads_start_from_each_subresources_state. Neither is related to this change.@Koro4e on GitHub · 2026-11-24 09:31 UTC · original
Withdrawing this PR for now. The pair-atomicity fix for the repro above stays on the branch (
09c6a47), so it can come back rebased once the block-layer work it feeds is ready.@SlopTart on GitHub · 2026-11-24 09:34 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
b559b01onto main077ce40, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 707 passed, 10 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). BCPack dump-keep tests green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Pull request closed