feat(hle): opt-in DX12 Async Compute BCPack offload via bcpack-gpu-sdk v0.14.1 #1299

Open
github-bot wants to merge 2 commits from github-bot/gh-1299 into main AGit
Owner

@⁠POMXARK on GitHub · 2026-11-26 12:56 UTC · original
POMXARK:feat/gpu-bcpack-v0141 → main · +1169 −15 · 6 files · 2 commits · open

Ref #1199 (Phase 1+batching Draft PR on ceb9e1f using bcpack-gpu-sdk v0.14.1).

Completely gated behind --features gpu-bcpack AND VICTORY_GPU_BCPACK=1 — zero impact on default builds or default runtime behavior.

What this Draft PR adds

  1. bcpack-gpu-sdk v0.14.1 (MIT OR Apache-2.0) optional dependency (Cargo.toml, crates/victory-hle/Cargo.toml, apps/victory/Cargo.toml):
    • All 6 BCPack formats: BC1 (incl. lane 1 index-reference SWAR fix matching bcpack-rs#11), BC3, BC4, BC5, BC6H (Modes 1–14), and BC7 (Modes 0–7, channel rotation guarded to modes 4 and 5).
    • Zero proprietary constants embedded in bcpack-gpu-sdk — uploads victory-formats/src/bcpack-tables.bin at worker init via runtime C-ABI setters (bcpack_gpu_set_{bc1,bc6h,bc7}_tables).
  2. Concurrent BcPackDecodeBatch coalescing (crates/victory-hle/src/modules/gpu_bcpack.rs, dstorage.rs):
    • Dedicated worker coalesces queued jobs via BcPackDecodeBatch (42.7x faster than single-chunk C-ABI loop on SDK benchmarks), while preserving strict per-item fallback to CPU bcpack::decode on small chunks (VICTORY_GPU_BCPACK_MIN_KB, default 32 KiB) or invalid layouts.

Verification (Windows 11 + NVIDIA GeForce RTX 5080 on ceb9e1f)

  • cargo test --release -p victory-hle --features gpu-bcpack gpu_bcpack -- --nocapture: 2 passed; 0 failed (0 byte mismatches across all 6 formats in both [no-ref] and [full-ref+dict], 12/13 mixed batch error isolation, and 6-thread concurrent worker coalescing)
  • cargo check -p victory-hle (default build without gpu-bcpack): PASS (0 errors)
**@⁠POMXARK** on GitHub · 2026-11-26 12:56 UTC · [original](https://github.com/fxceless/victory-fork/pull/1299) `POMXARK:feat/gpu-bcpack-v0141` → `main` · +1169 −15 · 6 files · 2 commits · open Ref #1199 (Phase 1+batching Draft PR on `ceb9e1f` using `bcpack-gpu-sdk v0.14.1`). Completely gated behind **`--features gpu-bcpack`** AND **`VICTORY_GPU_BCPACK=1`** — zero impact on default builds or default runtime behavior. ### What this Draft PR adds 1. **`bcpack-gpu-sdk v0.14.1`** (`MIT OR Apache-2.0`) optional dependency (`Cargo.toml`, `crates/victory-hle/Cargo.toml`, `apps/victory/Cargo.toml`): - All **6 BCPack formats**: `BC1` (incl. `lane 1` index-reference SWAR fix matching `bcpack-rs#11`), `BC3`, `BC4`, `BC5`, `BC6H` (Modes `1–14`), and `BC7` (Modes `0–7`, channel rotation guarded to modes `4` and `5`). - Zero proprietary constants embedded in `bcpack-gpu-sdk` — uploads `victory-formats/src/bcpack-tables.bin` at worker init via runtime C-ABI setters (`bcpack_gpu_set_{bc1,bc6h,bc7}_tables`). 2. **Concurrent `BcPackDecodeBatch` coalescing** (`crates/victory-hle/src/modules/gpu_bcpack.rs`, `dstorage.rs`): - Dedicated worker coalesces queued jobs via `BcPackDecodeBatch` (`42.7x` faster than single-chunk C-ABI loop on SDK benchmarks), while preserving strict per-item fallback to CPU `bcpack::decode` on small chunks (`VICTORY_GPU_BCPACK_MIN_KB`, default `32` KiB) or invalid layouts. ### Verification (Windows 11 + NVIDIA GeForce RTX 5080 on `ceb9e1f`) - `cargo test --release -p victory-hle --features gpu-bcpack gpu_bcpack -- --nocapture`: **`2 passed; 0 failed`** (`0` byte mismatches across all 6 formats in both `[no-ref]` and `[full-ref+dict]`, `12/13` mixed batch error isolation, and 6-thread concurrent worker coalescing) - `cargo check -p victory-hle` (default build without `gpu-bcpack`): **PASS (`0` errors)**
- Ref #1199 (100% gated behind --features gpu-bcpack and VICTORY_GPU_BCPACK=1, off by default)
- Upload victory-formats/src/bcpack-tables.bin at worker startup via runtime C-ABI setters
- Support all 6 BCPack formats (BC1 incl. lane 1 index ref, BC3, BC4, BC5, BC6H Modes 1-14, BC7 Modes 0-7 with modes-4/5 rotation guard)
- Coalesce concurrent worker jobs via BcPackDecodeBatch with per-item CPU fallback isolation

Tests (Windows 11 + RTX 5080 on ceb9e1f):
- cargo test --release -p victory-hle --features gpu-bcpack gpu_bcpack: 2 passed, 0 failed (0 byte mismatches)
- cargo check -p victory-hle: PASS
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:57:07 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1299/head:github-bot/gh-1299'
git switch 'github-bot/gh-1299'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1299'
git switch 'github-bot/gh-1299'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1299'
git switch 'github-bot/gh-1299'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1299'
git switch 'main'
git merge --squash 'github-bot/gh-1299'
git switch 'main'
git merge --ff-only 'github-bot/gh-1299'
git switch 'main'
git merge 'github-bot/gh-1299'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.