[Showcase / Contribution] Clean-Room GPU Compute Backend (DX12 HLSL SM 6.6 + Vulkan 1.3 SPIR-V, 11.33 GB/s BC1 / 6.02 GB/s BC7 rANS) #9
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Ahmet-Dedeler--bcpack-rs#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@POMXARK on GitHub · 2026-11-25 19:28 UTC · original
Hi @Ahmet-Dedeler,
Huge thanks for
bcpack-rsand your clearBCPACK_SPEC.md— it served as our bit-exact CPU oracle! Usingbcpack-rs+microsoft/silicon-rans, I built an open-source (MIT OR Apache-2.0) GPU Compute decoder & AAA streaming suite in DX12 HLSL SM 6.6 + Vulkan 1.3 SPIR-V + Rust:v0.10.0(Win64 SDK + Demos): https://github.com/POMXARK/bcpack-gpu-hlsl/releases/tag/v0.10.0docs/AI_ARCHITECTURE.mdHighlights (Bit-Exact
19/19 PASSvsbcpack-rson RTX 5080, DX12 Debug Layer Clean)shaders/bcpack_decode.hlsl): Dual-chunk per warp, register-resident 64B stream window, 4-step branchless binary search → 11,327.6 MB/s (282.1× vs 1T CPU) with0byte mismatches across monolithic, tiled 4K strips, and full 10-level Mip + Packed Mip Tail (85-block tail).shaders/bcpack_bc7_rans.hlsl,100%Wave3232/32lanes): 6,024.0 MB/s equiv (247.1× vs 1T CPU) with0symbol mismatches againstbcpack::rans::decode_slice.shaders/gfx10_detile.hlsl):SW_64KB_D(8B/16B) &SW_4KB_S(8B) at 432.6 GB/s (0.144 ms/64 MiB).shaders/spirv/*.spv,shaders/compile_spirv.sh): All core compute kernels precompiled with DXCv1.9.2609.-O3Finding:WavePrefixCountBits+WaveActiveCountBitsmiscompiledstream_posin split-half Wave32 allocation; solved cleanly viaWaveActiveBallot+countbits.Saw your recent
bc5/bc7/bc6hprogress inbcpack-rs— would love to align/extend our GPU block-reconstruction pass with your updated CPU decoders if there's interest!@Ahmet-Dedeler on GitHub · 2026-11-26 02:54 UTC · original
Cool to see it used as an oracle for a GPU decoder, thanks for the credit.
One thing you should know since you checked bit-exactness against bcpack-rs: #10 found that the BC1 assembler ignored lane 1 (the index reference). It's fixed now (#11). On retail data it changes nothing because lane 1 was always 0 there. But if your BC1 kernel matched the old behaviour and you test with streams where lane 1 isn't 0, it would match the bug. Worth rerunning your 19 checks against current master. The rANS decoder also got a big speed-up in #8, with the output unchanged.
@POMXARK on GitHub · 2026-11-26 11:54 UTC · original
Thanks for the heads-up @Ahmet-Dedeler! Just audited our Wave32 BC1 kernel (
shaders/bcpack_decode.hlsl) and confirmed it indeed skippedlane 1(s1).Fixed and released in
bcpack-gpu-sdk v0.14.1(https://github.com/POMXARK/bcpack-gpu-sdk/releases/tag/v0.14.1):ring_line[2][256]+x = s1 & 255u,d = (x + unzigzag(s0)) & 255u, and branchless 16-pixel SWAR line-position arithmetic (codes_to_lines/add_lines/lines_to_codes, treating pre-startx > block_idxas zero, matchingbcpack-rs#11).Cargo.tomloracle pin tobcpack-rsmaster (7b2b421) and recompiled bothbcpack_decode.dxiland Vulkan 1.3spirv/bcpack_decode.spv.tests/v14_batch_and_tex2d:5/5 PASS): newbc1_lane1_index_reference_bit_exacttest (512 blocks with pre-start and1..=31lane 1index refs) matched CPUbcpack::bc1::decodewith 0 byte mismatches (kernel=0.593 ms).Also noticed the speedup from
#8directly in our CPU comparison (365.87 msvs725.26 mssingle-thread on20 MiB) — great work!@Ahmet-Dedeler on GitHub · 2026-11-26 12:06 UTC · original
Nice, that was quick. If you want a regression case for it,
bc1_lane1_index_referenceintests/roundtrip.rsis the small one from #10 (second block has to come out asa1 17 5d f0 0a 0a 5f f5).tests/vectors/*.jsonwere re-blessed with lane 1 in, so they work as a check too.Also, BC3, BC4, BC5 and BC7 decoding is in the CLI now (#12, thanks to brainbudt), with DDS export for all of them. So if you want to line your GPU block rebuild up against the CPU side for those formats,
decode-bc3/decode-bc7etc. give you per-chunk output to diff against. BC6H isn't done yet.