XMA: gather frame payloads one byte at a time #1016

Manually merged
github merged 1 commit from gh-pr/1016/head into gh-pr/1016/base 2026-11-26 04:17:13 +00:00
Owner

@⁠heromike405-arch on GitHub · 2026-11-24 15:05 UTC · original
heromike405-arch:perf/xma-frame-bytes → main · +45 −3 · 1 files · 1 commits · merged 2026-11-25 00:20 UTC

Read complete XMA2 payload bytes directly within a packet. The existing bit reader still handles headers, interleaved streams and the last partial byte.

On Windows x86-64 with Rust 1.98.1, the victory-formats test binary passed 24 tests with four ignored. A synthetic differential check against ffe310e returned identical frame bytes, bit lengths, start positions and next-frame positions for 36,720 cases, including truncated buffers.

Median read_frame time across nine optimized runs on this machine:

Synthetic frame Before After
128 bytes 1.01 µs 0.17 µs
1 KiB 7.98 µs 1.06 µs
1 KiB crossing interleaved packets 7.80 µs 1.07 µs

The benchmark cycles through all eight bit alignments. It measures frame extraction only. Full-workspace CI and in-game playback remain unverified.

**@⁠heromike405-arch** on GitHub · 2026-11-24 15:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/1016) `heromike405-arch:perf/xma-frame-bytes` → `main` · +45 −3 · 1 files · 1 commits · merged 2026-11-25 00:20 UTC Read complete XMA2 payload bytes directly within a packet. The existing bit reader still handles headers, interleaved streams and the last partial byte. On Windows x86-64 with Rust 1.98.1, the victory-formats test binary passed 24 tests with four ignored. A synthetic differential check against ffe310e returned identical frame bytes, bit lengths, start positions and next-frame positions for 36,720 cases, including truncated buffers. Median read_frame time across nine optimized runs on this machine: | Synthetic frame | Before | After | | --- | ---: | ---: | | 128 bytes | 1.01 µs | 0.17 µs | | 1 KiB | 7.98 µs | 1.06 µs | | 1 KiB crossing interleaved packets | 7.80 µs | 1.07 µs | The benchmark cycles through all eight bit alignments. It measures frame extraction only. Full-workspace CI and in-game playback remain unverified.
Read complete payload bytes directly inside an XMA2 packet. Keep the bit reader for packet headers, interleaved stream skips and the final partial byte. Add coverage for all eight alignments at packet boundaries and EOF. On Windows x86-64, 36,720 synthetic reads matched the previous implementation, including returned bytes and the next frame position. A release microbenchmark of read_frame measured 1009 to 168 ns for 128-byte frames and 7977 to 1062 ns for 1 KiB frames (median of nine runs).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:11 +00:00
github manually merged commit 03a6f22906 into gh-pr/1016/base 2026-11-26 04:17:13 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:40 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 03a6f22: cargo test -p victory-formats passes, 24 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1016#issuecomment-7136419226) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 03a6f22: `cargo test -p victory-formats` passes, 24 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1016
No description provided.