formats/bcpack: strip-streaming, branchless rANS, and fast BC1-BC7 reconstruction #674
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/674"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by mint17 on 2026-11-28T03:22:15Z.
Optimizes BCPack texture decoding in
crates/victory-formats/src/bcpack.rswith zerounsafecode and bit-exact parity across all 6 BC formats (clean standalone port of our mergedTaynanGT/Vice-Tay#233, preservingVIctory-NVIDIA's baseline BC7 dictionary parsing verbatim).Changes
STRIP = 256): Decodes 256 blocks per strip so intermediate symbol streams stay resident in L1 cache instead of allocating multi-megabyte full-texture scratch vectors.ModelTable: Replaces branching symbol lookup / renormalization with branchless rANS over 64-byte-aligned tables, heap-allocating large decode arrays viaalloc_boxed_arrayto avoid stack-frame bloat.unsafe.VIctory-NVIDIA's exact baseline BC7 dictionary parsing and pure LF line endings.Release Throughput Benchmark (
cargo test --release --locked -p victory-formats bcpack_throughput -- --ignored --nocapture, 16,384 blocks × 40 runs)Verification
cargo test --locked -p victory-formats(50 passed, 0 failed — includes bit-exact reference-oracle parity across BC1–BC7 and strip-boundary tests).cargo clippy -p victory-formats --all-targets --locked -- -D warnings(default +--all-features),rustfmt --check --edition 2024, andcargo test --locked -p xtask(6 passed, 0 failed, including asset policy).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T05:34:35Z.
Review: APPROVED
LGTM — verified on Windows:
cargo test -p victory-formats --lib bcpack::passed (15/15, including all 4 neworacle_parity_*tests across BC1–BC7 modes, rotations, subsets, strip boundaries, and malformed inputs)cargo clippy -p victory-formats --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (294 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).