XAudio2: precompute XMA inverse quantizer gains #525
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!525
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/525/head"
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?
@TG0000 on GitHub · 2026-11-24 01:19 UTC · original
TG0000:perf/xma-quantizer-gains→main· +27 −1 · 1 files · 1 commits · merged 2026-11-25 01:08 UTCXMA1/XMA2 inverse quantization calculated an exponential for every coded band. This PR initializes a 6.5 KiB gain table once and reuses it across decoder instances. The lookup preserves the original
f32rounding, including underflow and overflow.What is in it
crates/xcl/src/hle/xma2/mod.rsuses the shared table and adds a bit-for-bit comparison with the original formula, including exponents outside the table.Tested
xclbuild succeeded.cargo +stable-x86_64-pc-windows-msvc test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputrecorded 675 passed, 3 failed, and 41 ignored on this head, versus 674 passed, 3 failed, and 41 ignored onmain. Both runs hit the same 3D texture subresource mismatch inplaced_title_textures_share_vram_and_preserve_pixelsand two follow-on failures from poisoned test locks. All eight XMA tests passed on this head.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_stateskipped their GPU checks in both runs because the D3D12 debug layer was unavailable.Regression run
The first head run missed the frame-count gate and recorded zero XMA voices or decodes. The retry used the same head and 45-second command. The blocks are main, the first head run, and the retry in that order.
Not tested
AI use
@thehollowedone on GitHub · 2026-11-24 01:28 UTC · original
Tested
RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug. On each revision I ran
cargo build --offline --locked --workspacethencargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4, with allXCL_SAMPLE_*variables unset and separate build outputs for the reported runs.The new bit-for-bit quantization gain test passed. The reported 3D texture mismatch and follow-on failures did not occur on either revision here. Both runs skipped
gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardwarebecause the adapter lacks wave64. The parent is the commit from the author's smoke baseline. Current main includes the later FPS-counter merge. Main checked at 508a0c7Not tested
Retail titles, optimized decode performance, or integration with current main.
AI use
Codex with GPT-6.2 Sol ran the tests and drafted this report.
@MesshM on GitHub · 2026-11-24 04:14 UTC · original
Test run of
6aba0688b59bb2731226fab591ac0600c60a499don AMD RDNA4. I merged it onto currentmainf4ce27clocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED; thexma2tests pass, including the bit-for-bit comparison with the original formula.Review: The table covers −904..771 and clamps outside it. At the ends the original formula already saturates: 10^(−904/20) ≈ 6·10⁻⁴⁶ rounds to 0 in f32 and 10^(771/20) ≈ 3.5·10³⁸ overflows to inf, so clamping gives the same bits as computing. I found nothing to change.
Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.