DirectStorage: BCPack BC3, BC4 and BC5 block rebuilds, without their tables, not yet called #336
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/340"
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?
Imported from ivall/xcl. Originally posted by NiiRoZz on 2026-11-23T23:50:21Z.
Stacked on #273 (itself on #208); only the top three commits belong here:
6fd5a60(BC4),f58df2f(BC5),e02a003(BC3).Adds the block rebuild for the three remaining 12-lane BCPack modes, from #208's lanes and in the form of #273's
bc1.rs. Each needs constants that no stream carries: the order of the 64 selector pairs (BC3 also the order of the 256 colour quadrants) and a built-in history of 255 endpoint sets that a stream's first blocks refer back to. XCL has no source for them it can take, so they are aTablesparameter: no table is shipped, nothing calls the new code, and DirectStorage refuses BC3 / BC4 / BC5 requests exactly as onmain. It is here so that whoever has the tables only has to supply them.No overlap found: #273 and #233 cover BC1 only.
What is in it
hle/bcpack/bc4.rs,bc5.rs,bc3.rs: lanes to blocks, one commit per mode. A block whose history entry is unknown fails withError::Historyand nothing is written.hle/bcpack/mod.rs: the modules and their docs.hle/bcpack/tests.rs,tests/data/bcpack/generate.py,tests/data/bcpack/bc{3,4,5}-*: a synthetic fixture per mode, built with made-up tables by the generator's own per-texel assembly, and a hand-built case per mode that covers every field. The fixtures are 2 to 7 KB each.Tested
cargo test --release -p xcl --lib bcpack: 17 passed.cargo test --release -p xcl --lib dstorage: 13 passed.cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 665 passed, 0 failed, 40 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
scripts/smoke.ps1 -Game <folder> -Seconds 60, release builds, no input (the title stays on its first menu), each run with the machine to itself. The new code is not called by the runtime, so the runs can only show that nothing else moved. The stack sits on #273's base (9ab7d76), so the two builds differ by more than these commits.gpu:is the first video controller Windows lists (#281 / #282 / #285); XCL's log names the RTX 5090 as its backend in both runs.main:
PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T00:04:07Z.
Thanks - not merged for now: it is stacked on #273 / #208, whose BC1 tables come from bcpack-rs's estimates made from retail data, and that provenance question is still open on the maintainer's side; on its own the new code is not called yet. It stays open until #208 / #273 are decided.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T02:33:36Z.
@NiiRoZz, a note for your stack: #208 and #273 are rebased onto
main9ce2070, now42c90e0andce8839b(was34c0ee5and5f12643). The commits themselves are unchanged (git range-diffshows=for both), sogit rebase --onto ce8839b 5f12643should move your three commits across.🤖 Claude Opus 5.5
Imported from ivall/xcl. Originally posted by ethandepstein-del on 2026-11-24T05:05:54Z.
Independent NVIDIA RTX 5080 build/test run and code review at head
e02a0033071233a140dd3dfcb0286a3466e0159d.Code Review
Tables(no proprietary tables checked in, not yet wired into live DirectStorage calls). Straightforward extension of#208/#273.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09), debug build.cargo build --workspace && cargo test --workspace -- --test-threads=4ok):hle::bcpack::tests::bc3_block_rebuild,bc3_fixture_decodes_to_its_blockshle::bcpack::tests::bc4_block_rebuild,bc4_fixture_decodes_to_its_blockshle::bcpack::tests::bc5_block_rebuild,bc5_fixture_decodes_to_its_blocks#208/#273tests:bc1_block_rebuild,bc1_fixtures_decode_to_their_blocks,fitted_bc1_tables_are_well_formed,fixtures_decode_to_their_lanes,model_matches_the_patent_excerpt,damaged_streams_end_cleanly,random_streams_round_trip_in_every_model,hle::dstorage::tests::bcpack_bc1_requests_are_unpacked_alone_and_after_zlibhle::dstorage::tests::bcpack_*tests.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64)gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)test_title_draws_with_a_root_signature_under_the_debug_layer(no d3d12SDKLayers.dll)uploads_start_from_each_subresources_state(no D3D12 debug layer (0x887A002D))Not tested
AI use: Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, and drafted this comment.
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:15:58Z.
Test run of
e02a0033071233a140dd3dfcb0286a3466e0159don AMD RDNA4. I merged it onto currentmain6025201locally (clean merge), so the tree tested includes the stack under it (#273, #208).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 718 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 677 passed, 0 failed, 21 ignoredSKIPPED; thebcpacktests pass, the BC3 / BC4 / BC5 rebuild ones included.Review: Only an RDNA4 data point: per the maintainer's note above this stack is not being merged for now, and I reviewed nothing beyond confirming it builds and passes here.
Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T10:39:32Z.
#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 – BC3, BC4 and BC5 are decoded there with their tables.upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Pull request closed