feat(bcpack): opt-in DX12 Async Compute offload via bcpack-gpu-sdk v0.14.1 #2792
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2792
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2792"
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-26 13:19 UTC · original
POMXARK:feat/gpu-bcpack-v0141→nvidia-dev· +677 −11 · 4 files · 2 commits · openFollow-up PR to #2586 targeting
nvidia-dev(af2cecc4).What is in it
bcpack-gpu-sdk v0.15.1dependency behind--features gpu-bcpackincrates/xcl/Cargo.toml.crates/xcl/src/hle/bcpack/gpu.rsgated at compile time (--features gpu-bcpack) and runtime (XCL_GPU_BCPACK=1, off by default), falling back tohle::bcpack::victory::decode.xcl's own built-in tables (bcpack_gpu_set_{bc1,bc6h,bc7}_tables) at worker startup instead of bundling any tables in the SDK.BcPackDecodeBatch(decode_batch_with), initializing allBcPackBatchItem::statusfields to-1, rejecting negative batch return codes (rc < 0, e.g.-99early return) across the whole batch so untouched buffers are never treated as valid zeros, and returningOption<&'static Sender<Job>>cleanly without.expect()if worker thread spawn fails.bcpack-gpu-sdk v0.15.1(src/ffi.rsresets allitem.status = -1beforecatch_unwind/wait_compute_cpu;tests/v14_batch_and_tex2d.rsaddsbcpack-rs#10BC1 lane-1 parity vector).Tested
96bc0a7b.cargo check -p xcl(default features): PASS (exit 0).cargo test -p xcl --features gpu-bcpack --release hle::bcpack::gpu:: -- --nocapture: 4 passed, 0 failed (gpu_bcpack_matches_xcl_cpu_all_vectors[12 valid vectors across BC1/3/4/5/6H/7 + 1 expected-err: 0 byte mismatches],gpu_bcpack_batch_all_valid_vectors_and_isolation[12 valid + 1 isolated err: 0 mismatches],batch_early_error_return_rejects_items_and_falls_back_to_cpu,unavailable_worker_falls_back_to_cpu_without_panicking).Regression run
Not run locally (
scripts/smoke.ps1on a retail title requires a maintainer/contributor smoke run ortest-onlylabel for CI).Not tested
cargo test --workspacesuite and live retail titlescripts/smoke.ps1regression run.scripts/smoke.ps1withXCL_GPU_BCPACK=1on a full game stream.AI use
gpu.rs), batch/worker fallback hardening, and fallback unit tests; test outputs were verified locally on RTX 5080.@Prime1997 on GitHub · 2026-11-26 13:42 UTC · original · reviewed
Needs changes; retain as a draft. Source review of
bfff51a7a3668c4057dc1f8efdf4fd0744142ea8found a conditional failure in the advertised CPU fallback.In
crates/xcl/src/hle/bcpack/gpu.rs:108-155, valid batch items start with zero-filled output andstatus:0; the aggregateBcPackDecodeBatchreturn is discarded. In pinned SDK commit727a214b5d68a23dc5e1df7f5efd00089ab42d39, the batch pre-wait occurs before item statuses become failures. If a retained incomplete fence's SetEventOnCompletion fails, the SDK catches the panic and returns-99. XCL can then accept untouched status0 items as successful zero output, bypassing CPU decoding.Please treat a negative aggregate result as batch failure and initialize pending statuses to a failure sentinel. Add a controlled early-return test proving CPU fallback and original-input preservation. This is a narrow source-level failure sequence involving an already incomplete retained fence and another event-registration failure; I have not reproduced a driver fault or shown that normal healthy batches fail.
The worker
.spawn(...).expect(...)also panics if worker creation fails rather than retaining CPU decoding. Return an unavailable worker and exercise that fallback explicitly.I checked the pinned SDK's non-null-output contract: that route is synchronous, so this review makes no asynchronous output-buffer lifetime claim. The optional feature/dependency, embedded shaders and actual GPU decode were not built or executed. Those and CPU/GPU decode parity remain validation blockers.
AI use: Codex (GPT-6) reviewed XCL and pinned dependency source with an independent source cross-check; no runtime result is claimed. Optional temporary Discord for coordinating contributor work, testing and comparing results.
@SlopTart on GitHub · 2026-11-26 15:05 UTC · original
Linux/Wine confirmation, both vendors, on head
bfff51a7(basenvidia-devaf2cecc4).cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- bcpack= 10 passed, 0 failed, 1638 filtered.xvfb:bcpack_parityintegration target compiles and passes on both lanes.Caveat:
bcpack_parityis a no-op withoutXCL_SAMPLE_BCPACKretail chunks (the test returns immediately), so our lanes verify the build plus the 10 lib tests only, not the async-compute offload path against real chunks. No regressions to the bcpack family on either Linux vendor.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@POMXARK on GitHub · 2026-11-26 19:10 UTC · original
Thank you @SlopTart for the cross-vendor Linux/Wine verification on both AMD RX 7900 XT (RADV) and NVIDIA GTX 1070 (
10 passed, 0 failed)!Marking this PR Ready for Review now that all 6 formats (
BC1/3/4/5/6H/7) + batch isolation have passed across Windows 11 + RTX 5080 and Linux/Wine AMD + NVIDIA.(Note:
bcpack-gpu-sdk v0.15.0also just shippedBcPackDecodeBatchToTextures— reducing 16 MiB direct-to-Texture2D decode from2505.58 msin a loop down to31.18 ms/513.2 MB/s(80.37x) — which we can wire in a clean follow-up Phase 2 PR once this baseline lands.)@POMXARK on GitHub · 2026-11-26 20:31 UTC · original
Thank you for the thorough review @Prime1997 — that was a real conditional bug if
BcPackDecodeBatchreturns early (-99/ failed event registration) before per-item status initialization.Fixed in
96bc0a7b:crates/xcl/src/hle/bcpack/gpu.rs(decode_batch_with):BcPackBatchItem::statusto-1(failure sentinel) rather than0.BcPackDecodeBatchreturn code (if rc < 0) and immediately marks every job in the batch asErr(...), regardless of individual itemstatusfields, sosubmit_gpu_worker/try_decodecleanly falls back tohle::bcpack::victory::decodeon the untouchedsrcinput.bcpack-gpu-sdkbumped tov0.15.1(96b7e75):BcPackDecodeBatchandBcPackDecodeBatchToTexturesnow pre-reset everyitem.status = -1beforectx.is_null(),catch_unwind, andwait_compute_cpu.sender() -> Option<&'static Sender<Job>>):.spawn(...).expect(...)with.spawn(...).ok().map(|_| tx)andsubmit_with_sender(sender(), ...)so thread creation failure returnsNoneand falls back to CPU decoding cleanly.batch_early_error_return_rejects_items_and_falls_back_to_cpu(verifies sentinel-1,-99early return even when an item status is forced to0, input preservation, and CPU decode parity).unavailable_worker_falls_back_to_cpu_without_panicking(verifiesNonesender and disconnected channel returnNonewithout panicking and CPU decode succeeds)..github/pull_request_template.md.Verified on Windows 11 + NVIDIA GeForce RTX 5080:
cargo check -p xcl: PASScargo test -p xcl --features gpu-bcpack --release hle::bcpack::gpu:: -- --nocapture: 4 passed, 0 failed@LocranKing on GitHub · 2026-11-27 04:49 UTC · original
Independent paired 180 s check of
--features gpu-bcpack(96bc0a7bmerged withnvidia-devecc0bb57) togglingXCL_GPU_BCPACK=0vsXCL_GPU_BCPACK=1on AMD Ryzen 5 5500 (6C/12T) + NVIDIA RTX 3060 Ti (8 GB).Setup
621.40,nvprofileshader heap 2048 MB), DXC1.9.2602.17.cargo build --release -p xcl --features gpu-bcpack(built cleanly).XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_GFX_PSO_WAIT_MS=200 XCL_CS_PSO_WAIT_MS=50 XCL_PREPARE_GRAPHICS=0 XCL_DRED=1+XCL_PRESS_AT(18:A..74:A), identical warmlockhartcache snapshot.Results (180 s paired runs, same binary)
XCL_GPU_BCPACKPresentX)BCPack BC6Hfirst unpackedfirst_2pass_mesh_t0(CPU fallback)0 0 0116.7 s132.0 s1(GPU Async Compute)2 1 1103.3 s(-13.4 s)107.2 s(-24.8 s)Both runs exited
0x0with0crashes,0device removals, and unpackedBC7,BC5,BC1, andBC6Hrequests cleanly. (Note:xcl.logdoes not emit a separate GPU-vs-fallback batch counter, so per-chunk GPU vs CPU fallback ratio was not directly observed.)Not tested:
XCL_GPU_BCPACK_MIN_KBtuning, AMD/Intel GPUs.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.