Skip to content

DirectStorage: BCPack decoder tables, lanes and BC1/BC3/BC4/BC5 - #947

Closed
Yeetbot159 wants to merge 1 commit into
xcl-dev:mainfrom
Yeetbot159:dstorage-bcpack-1-core
Closed

Yeetbot159 wants to merge 1 commit into
xcl-dev:mainfrom
Yeetbot159:dstorage-bcpack-1-core

Conversation

@Yeetbot159

Copy link
Copy Markdown

Overlap: #905 covers the same ground (all BCPack modes plus the dstorage.rs wiring, in the same hle/bcpack module). This is an alternative split of the same VIctory code into small stacked PRs, opened as drafts so the two can be compared. If #905 is preferred, please close these.

Adds a BCPack decoder module, hle::bcpack, that nothing calls yet: the constant tables, the rANS
lane reader and the BC1/BC3/BC4/BC5 record decoders. BC6H, BC7 and the wiring follow in the next PRs.
Ported from VIctory (crates/victory-formats/src/bcpack.rs), used with the author's permission
(confirmation from the VIctory author to be linked in a comment); header note and THIRD_PARTY.md row added.

What is in it

  • hle/bcpack/mod.rs: Tables, lanes, decode for BC1, 3, 4, 5 (6 and 7 return an error), tests
  • hle/bcpack/tables.rs: the 77,982-byte table file as a generated Rust array (binary files are not
    accepted outside tests/data/); scripts/gen_bcpack_tables.py regenerates it
  • hle/mod.rs, THIRD_PARTY.md: module and origin

Size: about 1,090 changed lines without tables.rs (3,255 generated), about 400 of them tests. It is
over 800 because the tables, the lane reader and the first formats only make sense together (the lane
tests need the tables, the formats need the lanes). It can be split at the lane reader if you prefer.

Tested

  • Windows / GPU suite: not run yet (draft until it is)
  • Also run on Linux x86-64, rustc 1.97, with the module in a scratch crate (xcl does not build there):
    8 passed, 0 failed, 2 ignored (a benchmark, and reference_chunks, which needs real data)

Regression run: not needed (no runtime change; nothing calls the module)

Not tested: reference_chunks against real BCPack data (set VICTORY_BCPACK_TABLES /
VICTORY_BCPACK_CASES); nothing on Windows yet.

AI use: Claude (Sonnet 5.5): selected and split the code, generated the tables file, wrote this text.

@SlopTart

Copy link
Copy Markdown

Heads-up: this stack does not compile as-is.

Lane rebuild today: head 5a19347 onto main 9aec53d, merge clean, but the build fails:

error: let chains are only allowed in Rust 2024 or later
   --> crates/xcl/src/hle/bcpack/mod.rs:353:16
error: let chains are only allowed in Rust 2024 or later
   --> crates/xcl/src/hle/bcpack/mod.rs:451:20

The workspace is edition = "2021" and none of #947/#948/#949/#950 bumps it, so every PR in the stack fails to build on any toolchain. Same failure in all four lanes. Fix is either an edition bump or rewriting the two && let chains.

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

ivall commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

#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 – this stack ported the same code; #905 already had the BC7 dictionary fix and builds on edition 2021.

@ivall ivall closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants