DirectStorage: unpack BCPack requests (BC1, BC3-BC7) instead of refusing them #950
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!950
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/950/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?
@Yeetbot159 on GitHub · 2026-11-24 09:24 UTC · original
Yeetbot159:dstorage-bcpack-4-wire→main· +4963 −26 · 6 files · 4 commits · closed without mergingStacked on #949; only the top commit belongs here.
Stacked on PR 3; only the top commit belongs here. Open as a draft.
dstorage.rsrefused every BCPack request (E_DECOMPRESSION). NowRequest::checkaccepts BC1 andBC3-BC7, and
executeunpacks them after the optional zlib stage, into the destination (a part blockat the end is handled by unpacking whole blocks and keeping the destination size). BC2 and modes 8-15
are still refused, counted and filled as before, so the
XCL_DSTORAGE_BCPACK_FILLstopgap and thereport counters keep working for those. Semantics follow VIctory's handling of a retail title:
intermediate_sizeis the size of the BCPack stream for zlib + BCPack.Behaviour changes to check: zlib + BCPack with
intermediate_size == 0now returns E_DESTINATION_SIZE(it was E_DECOMPRESSION; the stream size is not knowable); a bad stream returns E_DECOMPRESSION
and logs once under "BCPack".
What is in it:
hle/dstorage.rs(check, execute, tables cache, module docs, tests)Statements that are now out of date:
HANDOFF.md~line 656 ("BCPack … refused"); not edited, per AGENTS.md.Tested: not run yet (draft until it is). Author-side:
dstorage.rsis Windows-only and was NOT compiled or run; only asyntax parse was done (no syntax errors). Treat as untested until you have built it.
Regression run: not run yet (draft until it is) (required)
Not tested: the success path through
execute(the tests cover the validation matrix and a badstream; a valid stream needs real data); AMD / NVIDIA; the retail title.
AI use: Claude (Sonnet 5.5): wrote the change and tests, not compiled.
@ettehn on GitHub · 2026-11-24 09:29 UTC · original
BC7 byte-parity issue on
4bada6b(in the decoder this PR wires into DirectStorage). A minimal synthetic input is 1,024 bytes of0x01, BC7, 16 output bytes: both decoders succeed but XCL differs from the VIctory reference. Across fills 0–63 and output lengths of 1, 4 and 16 blocks, 85 of the 156 accepted BC7 cases differed.In the BC7 dictionary reader, offsets 52–53 are being consumed as the first signed index. Skipping that u16, reading 31 indices into the flattened 32 slots, and leaving the last slot zero fixed all 85 differences locally. With that change all 1,056 accepted cases across the six supported formats matched byte-for-byte, with 96 jointly rejected. The same table layout is covered in #856 and already used in #905. No retail input required.
Verification assisted by OpenAI Codex (GPT-6.2 Astra).
@ettehn on GitHub · 2026-11-24 09:33 UTC · original
One separate build blocker surfaced when moving the BC7 control into the actual DirectStorage request path. At
4bada6b,xclinherits workspace edition 2021, butbcpack/mod.rsuses two&& let Some(...)chains (self.latch.take()andlane.out.take()). Cargo rejects both before the Windows tests run. My earlier standalone codec comparison used edition 2024.Rewriting those two expressions as nested
if/if letpreserved short-circuiting and built under the existing workspace edition. With that and the dictionary offset correction, all 15 targeted DirectStorage tests passed on Windows, including a local memory-request test checking the 16 output bytes against the reference and both adjacent sentinel bytes.Verification assisted by OpenAI Codex (GPT-6.2 Astra).
@SlopTart on GitHub · 2026-11-24 10:38 UTC · original
Compile-blocked in rebuild: this PR merges the same
&& letchains intocrates/xcl/src/hle/bcpack/mod.rs(errors at lines 353/451 after merge onto9aec53d) while the workspace isedition = "2021", so the lane fails to build before any test runs. Full detail in my comment on #947 (same failure across the whole #947-#950 stack).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.
@ivall on GitHub · 2026-11-24 10:39 UTC · original
#905 is merged (
67a3735): DirectStorage now unpacks BCPack BC1, BC3, BC4, BC5, BC6H and BC7 with the format's exact tables, so this PR is superseded. Thanks.Pull request closed