DirectStorage: prototype documented BC7 mode-6 block reconstruction #438

Closed
github-bot wants to merge 1 commit from gh-pr/438/head into gh-pr/438/base
Owner

@⁠Prime1997 on GitHub · 2026-11-24 00:16 UTC · original
Prime1997:contrib/bc7-reconstruction → main · +230 −0 · 3 files · 1 commits · closed without merging

Adds an independently implemented, CPU-only reference for one documented BC7 mode-6 block configuration. The input is sixteen decoded symbol lanes. This gives #208 a tested reconstruction rule for a subset of its output. #233 and #273 handle BC1, and #340 covers BC3/4/5.

What is in it

  • crates/xcl/src/hle/bcpack_bc7.rs reconstructs the documented unrotated mode-6 configuration from decoded lanes, including zero and available same-mode history. Four synthetic tests cover fixed one- and two-block outputs and rejection paths.
  • crates/xcl/src/hle/mod.rs includes the reference under cfg(test). THIRD_PARTY.md and the module identify the MIT-licensed fixture sources. DirectStorage integration and broader mode support remain separate.

Tested

  • Windows 11 Pro build 26200, Intel Core i5-10400, GeForce RTX 3060 Ti (driver 32.0.16.1714), Rust 1.100.0.
  • Tested commit bf0ad870d921251b614c23e8afdf5b3bb8cd550e with cargo build --locked --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4 (debug). 680 passed, 0 failed, 41 ignored. 2 GPU tests reported a skip.
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
  • An earlier parallel suite run on the SSE4a test branch failed at the shared-page cubemap assertion and poisoned its test lock. We also reproduced that assertion on unmodified a6f5f7a in isolation on this GPU.
  • The four mode-6 CPU checks passed with cargo test --locked -p xcl --lib bcpack_bc7 -- --test-threads=1 --nocapture. Built the PR with cargo build --locked --release --workspace and main with cargo build --locked --release -p xcl.

Regression run

Both release builds ran the same title offline from a fresh title-data directory. The retail runs check startup. The synthetic controls exercise the new code.

Main

xcl-smoke v1
commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 235 (PresentX 235)
presents per 2 s (last 3): 9 10 9
device removals: 0
crashes: 0
peak commit: 15196 MB

PR

xcl-smoke v1
commit: bf0ad870d921251b614c23e8afdf5b3bb8cd550e
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 231 (PresentX 232)
presents per 2 s (last 3): 7 7 8
device removals: 0
crashes: 0
peak commit: 15175 MB

Not tested

Retail BC7 reconstruction, initial preset history, other configurations, comparison with console hardware, and AMD or Intel GPUs. Optional sample-data tests ran without external sample files.

AI use

OpenAI Codex (GPT-6) assisted with the independent reconstruction, tests, provenance and overlap checks, and validation.

I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord

**@⁠Prime1997** on GitHub · 2026-11-24 00:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/438) `Prime1997:contrib/bc7-reconstruction` → `main` · +230 −0 · 3 files · 1 commits · closed without merging Adds an independently implemented, CPU-only reference for one documented BC7 mode-6 block configuration. The input is sixteen decoded symbol lanes. This gives #208 a tested reconstruction rule for a subset of its output. #233 and #273 handle BC1, and #340 covers BC3/4/5. **What is in it** - `crates/xcl/src/hle/bcpack_bc7.rs` reconstructs the documented unrotated mode-6 configuration from decoded lanes, including zero and available same-mode history. Four synthetic tests cover fixed one- and two-block outputs and rejection paths. - `crates/xcl/src/hle/mod.rs` includes the reference under `cfg(test)`. `THIRD_PARTY.md` and the module identify the MIT-licensed fixture sources. DirectStorage integration and broader mode support remain separate. **Tested** - Windows 11 Pro build 26200, Intel Core i5-10400, GeForce RTX 3060 Ti (driver 32.0.16.1714), Rust 1.100.0. - Tested commit `bf0ad870d921251b614c23e8afdf5b3bb8cd550e` with `cargo build --locked --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug). 680 passed, 0 failed, 41 ignored. 2 GPU tests reported a skip. - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64` - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` - An earlier parallel suite run on the SSE4a test branch failed at the shared-page cubemap assertion and poisoned its test lock. We also reproduced that assertion on unmodified `a6f5f7a` in isolation on this GPU. - The four mode-6 CPU checks passed with `cargo test --locked -p xcl --lib bcpack_bc7 -- --test-threads=1 --nocapture`. Built the PR with `cargo build --locked --release --workspace` and main with `cargo build --locked --release -p xcl`. **Regression run** Both release builds ran the same title offline from a fresh title-data directory. The retail runs check startup. The synthetic controls exercise the new code. Main ``` xcl-smoke v1 commit: a6f5f7a74cc620c1f88a9e3669a633d10c3c8212 gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 235 (PresentX 235) presents per 2 s (last 3): 9 10 9 device removals: 0 crashes: 0 peak commit: 15196 MB ``` PR ``` xcl-smoke v1 commit: bf0ad870d921251b614c23e8afdf5b3bb8cd550e gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 231 (PresentX 232) presents per 2 s (last 3): 7 7 8 device removals: 0 crashes: 0 peak commit: 15175 MB ``` **Not tested** Retail BC7 reconstruction, initial preset history, other configurations, comparison with console hardware, and AMD or Intel GPUs. Optional sample-data tests ran without external sample files. **AI use** OpenAI Codex (GPT-6) assisted with the independent reconstruction, tests, provenance and overlap checks, and validation. I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. [Test coordination on Discord](https://discord.gg/gK3y7WRRY)
Keep the independent reconstruction and synthetic controls compiled only for tests. Accept the documented mode-6 configuration, zero predictors and references to preceding decoded mode-6 blocks; refuse unavailable preset history, other configurations and unsupported anchors without returning partial output. Carry the MIT fixture provenance and licence notice. This supplies a narrow block-rule prototype alongside the community entropy work in #208 without activating a second DirectStorage implementation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:21:51 +00:00
github-bot closed this pull request 2026-11-26 04:21:51 +00:00
Author
Owner

@⁠Abuudiii on GitHub · 2026-11-24 06:58 UTC · original

Independent synthetic mode-6 check on exact head bf0ad870d921251b614c23e8afdf5b3bb8cd550e (Arch Linux, GE-Proton 11-7, Rust 1.99.1 Windows GNU debug build).

Tested: Built the library unit-test executable with cargo test --locked --offline -p xcl --lib --target x86_64-pc-windows-gnu --no-run, then ran filter bcpack_bc7 with --test-threads=1 --nocapture: 4 passed, 0 failed, 0 ignored. This exercised byte-exact one- and two-block assembly, same-stream prediction, and the existing refusal checks on synthetic decoded lanes.

Not tested: rANS input, preset dictionary prediction, DirectStorage wiring, native Windows, or retail. No game assets or GPU were needed.

AI use: omp (GPT-6.2 Sol) ran the check and drafted this report.

**@⁠Abuudiii** on GitHub · 2026-11-24 06:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/438#issuecomment-7124489529) Independent synthetic mode-6 check on exact head `bf0ad870d921251b614c23e8afdf5b3bb8cd550e` (Arch Linux, GE-Proton 11-7, Rust 1.99.1 Windows GNU debug build). **Tested:** Built the library unit-test executable with `cargo test --locked --offline -p xcl --lib --target x86_64-pc-windows-gnu --no-run`, then ran filter `bcpack_bc7` with `--test-threads=1 --nocapture`: **4 passed, 0 failed, 0 ignored**. This exercised byte-exact one- and two-block assembly, same-stream prediction, and the existing refusal checks on synthetic decoded lanes. **Not tested:** rANS input, preset dictionary prediction, DirectStorage wiring, native Windows, or retail. No game assets or GPU were needed. **AI use:** omp (GPT-6.2 Sol) ran the check and drafted this report.
Author
Owner

@⁠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 – BC7 (all its modes) is decoded there.

**@⁠ivall** on GitHub · 2026-11-24 10:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/438#issuecomment-7129075146) #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 – BC7 (all its modes) is decoded there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.