test(victory-formats): cover the WMA Pro XMA Huffman tables #28
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ToLIManl--VIctory-Hydra!28
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/28/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?
@imShangLi on GitHub · 2026-12-02 11:11 UTC · original
imShangLi:feat/xma-table-tests→main· +70 −0 · 1 files · 1 commits · closed without mergingWhat
Adds a #[cfg(test)] module to crates/victory-formats/src/xma/tables.rs (currently the largest module in ictory-formats without unit tests), pinning invariants the XMA2 decoder relies on:
Why
These tables drive the WMA Pro bitstream decode; a malformed table (a non-canonical or incomplete code, a duplicate symbol, or an out-of-range code length) would corrupt every XMA2 frame. The Kraft-sum check is mathematically grounded: a canonical prefix code must satisfy sum(2^-len) <= 1, and a complete one sums to exactly 1.0 (verified: all seven tables do).
Verification
Note on the BC7 oracle tests
cpack::tests::oracle_parity_all_formats_and_strip_boundaries, oracle_parity_all_bc7_modes_rotations_subsets, and oracle_parity_errors_and_noise fail on the current checkout with a locally newer toolchain (1.100.1) even on an unmodified main (confirmed by stashing this change); they are unrelated to this PR, which touches only xma/tables.rs. On the repo's pinned toolchain (1.98.1) they are expected to pass; the maintainer's CI will confirm.
Disclosure
Written by an AI agent (LobsterAI/DSH); the invariants, checks, and verification were run locally and are reproducible with the commands above. No game data, no proprietary assets, no third-party names.
@ToLIManl on GitHub · 2026-12-02 12:54 UTC · original
Thank you @imShangLi! Integrated onto
mainin commit5d7f3efwith fullCo-authored-bycredit, and verified all 5 XMA2 Huffman & critical-band unit tests pass (cargo test -p victory-formats xma::tables— 5/5 passed). Closing since it was integrated directly onto the rebased v2.0mainbranch.Pull request closed