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

Open
POMXARK wants to merge 2 commits from upstream-pr/1299 into main
POMXARK commented 2026-11-26 12:56:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by POMXARK on 2026-11-26T12:56:09Z.


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)
<!-- greyfinch-sync:fxceless/victory-fork:issue:5510416174 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1299). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-26T12:56:09Z. --- 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)**
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1299:upstream-pr/1299'
git switch 'upstream-pr/1299'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1299'
git switch 'upstream-pr/1299'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1299'
git switch 'upstream-pr/1299'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1299'
git switch 'main'
git merge --squash 'upstream-pr/1299'
git switch 'main'
git merge --ff-only 'upstream-pr/1299'
git switch 'main'
git merge 'upstream-pr/1299'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1296
No description provided.