xma: decode a frame across published input buffers #3484

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "codex/xma-split-input:kaoru-maki-codex/xma-split-input"
git switch "kaoru-maki-codex/xma-split-input"
Open
leonida/mandy
kaoru-maki wants to merge 6 commits from kaoru-maki/mandy:codex/xma-split-input into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/xma-split-input:kaoru-maki-codex/xma-split-input'
git switch 'kaoru-maki-codex/xma-split-input'
Contributor

Claimed in the coordination issue as XMA-SPLIT-PUBLISHED-INPUT.

What changed

An XMA frame, including its length field, can span the last packet of one input and a continuation packet in the other input. The voice now reads the carry when both inputs are published and the packet headers agree. It queues the frame's PCM, updates the cursor, and then returns the consumed input. Loop rewind retains the inputs for the next pass.

Validation

  • The Windows synthetic HLE regression reproduced the missing frame on the base. The patched split and joined inputs produce identical PCM.
  • Generated packets cover both input slots, a continuation-only end, a following frame, loop rewind, and an unavailable second input. Format tests cover continuation-length validation and skips up to 255. The prepared Windows run passed 48 format tests and 309 HLE tests.
  • The project's no-game-data scanner passed for both changed files.

AI-assisted with OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol and a follow-up review after the packet-skip fix.

Claimed in the coordination issue as [XMA-SPLIT-PUBLISHED-INPUT](https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-26268). ### What changed An XMA frame, including its length field, can span the last packet of one input and a continuation packet in the other input. The voice now reads the carry when both inputs are published and the packet headers agree. It queues the frame's PCM, updates the cursor, and then returns the consumed input. Loop rewind retains the inputs for the next pass. ### Validation - The Windows synthetic HLE regression reproduced the missing frame on the base. The patched split and joined inputs produce identical PCM. - Generated packets cover both input slots, a continuation-only end, a following frame, loop rewind, and an unavailable second input. Format tests cover continuation-length validation and skips up to 255. The prepared Windows run passed 48 format tests and 309 HLE tests. - The project's no-game-data scanner passed for both changed files. AI-assisted with OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol and a follow-up review after the packet-skip fix.
Read a frame that continues into the other published input. Preserve the loop rewind and update the cursor before releasing a consumed input.

Compare PCM against joined input using generated packets.
First-time contributor

RUN — In-game & Unit Test Gate (NVIDIA RTX 5070 12 GB, Windows 11)

Tested PR head 7d9f12849 merged cleanly onto main (f22b9fa64), diagnostic release build (-SeriesS, no frame generation, 315 s automated run from the same save), compared against our recent main (30c683055) baseline:

Metric main baseline (30c683055) PR #3484 (7d9f12849)
World samples (>=1000 draws) 36 (max_draws=5187) 41 (max_draws=5467)
Median FPS / frame time 23.0 fps (43.5 ms) 24.5 fps (40.9 ms)
Slowest 10% / fastest 10% 13.7 / 25.0 fps 17.5 / 25.2 fps
3000-4999 draws/frame median 23.2 fps (28 samples) 24.7 fps (31 samples)
Errors / warnings / device lost 0 / 0 / 0 0 / 0 / 0

Unit & Repo Checks

  • cargo test -p leonida-formats --locked xma — PASS
  • cargo test -p leonida-hle --lib --locked xma — 4/4 PASS (including published_xma_inputs_keep_the_frame_across_the_boundary)
  • cargo clippy -p leonida-formats --all-targets --locked -- -D warnings — 0 warnings
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md — PASS
  • python -I scripts/check_no_game_data.py — PASS

Verdict

PASS — clean merge onto f22b9fa64, all XMA decoder/HLE tests and clippy pass, and the 315 s in-game run completed cleanly with zero errors/warnings and no regression. Ready for merge.

AI-assisted.

### RUN — In-game & Unit Test Gate (NVIDIA RTX 5070 12 GB, Windows 11) Tested PR head `7d9f12849` merged cleanly onto `main` (`f22b9fa64`), diagnostic release build (`-SeriesS`, no frame generation, 315 s automated run from the same save), compared against our recent `main` (`30c683055`) baseline: | Metric | `main` baseline (`30c683055`) | PR `#3484` (`7d9f12849`) | | --- | --- | --- | | World samples (`>=1000` draws) | `36` (`max_draws=5187`) | `41` (`max_draws=5467`) | | Median FPS / frame time | `23.0 fps` (`43.5 ms`) | `24.5 fps` (`40.9 ms`) | | Slowest 10% / fastest 10% | `13.7` / `25.0 fps` | `17.5` / `25.2 fps` | | `3000-4999` draws/frame median | `23.2 fps` (`28` samples) | `24.7 fps` (`31` samples) | | Errors / warnings / device lost | `0` / `0` / `0` | `0` / `0` / `0` | ### Unit & Repo Checks - `cargo test -p leonida-formats --locked xma` — PASS - `cargo test -p leonida-hle --lib --locked xma` — `4/4` PASS (including `published_xma_inputs_keep_the_frame_across_the_boundary`) - `cargo clippy -p leonida-formats --all-targets --locked -- -D warnings` — `0` warnings - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` — PASS - `python -I scripts/check_no_game_data.py` — PASS ### Verdict **PASS** — clean merge onto `f22b9fa64`, all XMA decoder/HLE tests and `clippy` pass, and the 315 s in-game run completed cleanly with zero errors/warnings and no regression. Ready for merge. AI-assisted.
First-time contributor

Independent local verification of this change (I changed no code).

  • Head 7d9f1284, merge base 00e245be. Both new tests are absent on the base: git grep -F <test> 00e245be -- <path> -> exit 1 for each.
  • On the PR head, with module-qualified names, -- --exact and a private CARGO_TARGET_DIR: xma::tests::split_frame_follows_the_full_packet_skip (-p leonida-formats, 1 passed / 55 filtered) and modules::audio::tests::published_xma_inputs_keep_the_frame_across_the_boundary (-p leonida-hle, 1 passed / 310 filtered).
  • git diff --check 00e245be 7d9f1284 -> clean. python -I scripts/check_no_game_data.py on both changed files -> clean.

GPUs tested: none (synthetic packet/buffer inputs, CPU-only unit tests; no device-gated test). Driver: n/a. No game data, assets or extracted shaders were used or attached.

AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.

Independent local verification of this change (I changed no code). - Head `7d9f1284`, merge base `00e245be`. Both new tests are absent on the base: `git grep -F <test> 00e245be -- <path>` -> exit 1 for each. - On the PR head, with module-qualified names, `-- --exact` and a private `CARGO_TARGET_DIR`: `xma::tests::split_frame_follows_the_full_packet_skip` (`-p leonida-formats`, 1 passed / 55 filtered) and `modules::audio::tests::published_xma_inputs_keep_the_frame_across_the_boundary` (`-p leonida-hle`, 1 passed / 310 filtered). - `git diff --check 00e245be 7d9f1284` -> clean. `python -I scripts/check_no_game_data.py` on both changed files -> clean. GPUs tested: none (synthetic packet/buffer inputs, CPU-only unit tests; no device-gated test). Driver: n/a. No game data, assets or extracted shaders were used or attached. AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.
Author
Contributor

Updated the branch to upstream main 0036195a72. The XMA decoder change is byte-for-byte identical.

  • The Windows run on the 6b0498d377 merge passed 14 synthetic XMA format tests and 5 HLE audio tests. Two tests that use saved samples and a benchmark were excluded. The update to 0036195a72 leaves the Rust build and test inputs unchanged.
  • The boundary regression assembles the 15-bit frame length from 8 bits in one published input and 7 bits in the next, then verifies that the split frame is preserved.
  • The repository clean-room and diff checks passed on the updated branch.

AI-assisted update with OpenAI Codex (GPT-6), independently reviewed with GPT-6.2 Sol.

Updated the branch to upstream main 0036195a72f8. The XMA decoder change is byte-for-byte identical. - The Windows run on the 6b0498d37714 merge passed 14 synthetic XMA format tests and 5 HLE audio tests. Two tests that use saved samples and a benchmark were excluded. The update to 0036195a72f8 leaves the Rust build and test inputs unchanged. - The boundary regression assembles the 15-bit frame length from 8 bits in one published input and 7 bits in the next, then verifies that the split frame is preserved. - The repository clean-room and diff checks passed on the updated branch. AI-assisted update with OpenAI Codex (GPT-6), independently reviewed with GPT-6.2 Sol.
Author
Contributor

Merged upstream main at f4b0404e95. The PR-only diff is byte-for-byte unchanged.

The Windows repeat on the updated tree passed 14 synthetic XMA format tests and five HLE audio tests. The clean-room and diff checks passed.

AI-assisted update with OpenAI Codex (GPT-6), independently reviewed with GPT-6.2 Sol.

Merged upstream main at f4b0404e95fa. The PR-only diff is byte-for-byte unchanged. The Windows repeat on the updated tree passed 14 synthetic XMA format tests and five HLE audio tests. The clean-room and diff checks passed. AI-assisted update with OpenAI Codex (GPT-6), independently reviewed with GPT-6.2 Sol.
Author
Contributor

Updated this branch from upstream main at 93b9d90a22c1 with a regular merge. The PR diff is byte-for-byte identical. The new head is 9a2a1be54dbb.

The Windows run repeated 14 format tests and five HLE tests with synthetic XMA inputs after verifying the build inputs. All passed. git diff --check, the switch catalogue check, and check_no_game_data.py passed.

AI-assisted.

Updated this branch from upstream `main` at `93b9d90a22c1` with a regular merge. The PR diff is byte-for-byte identical. The new head is `9a2a1be54dbb`. The Windows run repeated 14 format tests and five HLE tests with synthetic XMA inputs after verifying the build inputs. All passed. `git diff --check`, the switch catalogue check, and `check_no_game_data.py` passed. AI-assisted.
Author
Contributor

Updated this branch from upstream main at e1b0248c12ea with a regular merge. The XMA PR diff is byte-for-byte identical. The new head is 7b1846b88d04.

All 14 synthetic format tests passed after verifying the build inputs. I also rebuilt the HLE test executable on the merged tree and all five targeted synthetic HLE cases passed. git diff --check and check_no_game_data.py passed.

AI-assisted.

Updated this branch from upstream `main` at `e1b0248c12ea` with a regular merge. The XMA PR diff is byte-for-byte identical. The new head is `7b1846b88d04`. All 14 synthetic format tests passed after verifying the build inputs. I also rebuilt the HLE test executable on the merged tree and all five targeted synthetic HLE cases passed. `git diff --check` and `check_no_game_data.py` passed. AI-assisted.
Sign in to join this conversation.
No description provided.