formats: the XMA docs say three subframe sizes, not four #592

Open
qnjk wants to merge 1 commit from qnjk/Darner:xma-doc-subframe-sizes into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: the darner-formats module doc said the XMA2 frame decoder is restricted to "at most two channels, four subframe sizes (512 down to 128), no LFE channel" (crates/darner-formats/src/xma.rs:12). The format and the code have three: FRAME_SAMPLES 512, SUBFRAME_SAMPLES 128 (:24-32), and Rotations built for "subframes of 128, 256 and 512" (:603); the subframe-length reader takes a 1-bit "not maximal" and then one bit of shift, which yields 512, 256 or 128 and nothing else. The same "four" appeared again in the comment at :910, directly above the code that produces three.

  • This change says three in both places and names them (512, 256 and 128). Documentation only: no code changes.

How it was tested

  • Tested revision: 44cdd32 (one commit on c8258f9).
  • cargo test --locked -p darner-formats --lib — 94 passed, 0 failed, 7 ignored.
  • cargo xtask policy — 576 files ok.
  • No behaviour change, so no A/B result and no gameplay run.
  • Gates run on that revision:
    • Gate 1, cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
    • Gate 2, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
    • Gate 3, cargo test --workspace --locked: not run to completion here; the pre-existing darner-gpu test deadlock (#224) and darner-shader waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. darner-formats' suite is green.
  • Changes a default: no.

Checklist

  • Documentation only, so it needs no gameplay run.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md (cargo xtask policy: 576 files ok).
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found. No open pull request changes crates/darner-formats/src/xma.rs (checked against the file list of all 189 open pull requests), and no open or closed issue mentions the subframe sizes.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: the `darner-formats` module doc said the XMA2 frame decoder is restricted to "at most two channels, **four** subframe sizes (512 down to 128), no LFE channel" (`crates/darner-formats/src/xma.rs:12`). The format and the code have **three**: `FRAME_SAMPLES` 512, `SUBFRAME_SAMPLES` 128 (`:24-32`), and `Rotations` built for "subframes of 128, 256 and 512" (`:603`); the subframe-length reader takes a 1-bit "not maximal" and then one bit of shift, which yields 512, 256 or 128 and nothing else. The same "four" appeared again in the comment at `:910`, directly above the code that produces three. - This change says three in both places and names them (512, 256 and 128). Documentation only: no code changes. ## How it was tested - Tested revision: `44cdd32` (one commit on `c8258f9`). - `cargo test --locked -p darner-formats --lib` — 94 passed, 0 failed, 7 ignored. - `cargo xtask policy` — 576 files ok. - No behaviour change, so no A/B result and no gameplay run. - Gates run on that revision: - Gate 1, `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - Gate 2, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passes. - Gate 3, `cargo test --workspace --locked`: not run to completion here; the pre-existing `darner-gpu` test deadlock (#224) and `darner-shader` waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. `darner-formats`' suite is green. - Changes a default: no. ## Checklist - [x] Documentation only, so it needs no gameplay run. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md` (`cargo xtask policy`: 576 files ok). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found. No open pull request changes `crates/darner-formats/src/xma.rs` (checked against the file list of all 189 open pull requests), and no open or closed issue mentions the subframe sizes. - Replaces or overlaps: none found
The module doc claimed "four subframe sizes (512 down to 128)" and the
comment in `subframe_length` repeated the count, but the header it reads has
a 1-bit "not maximal" flag and then at most one bit of shift, so only 512,
256 and 128 are reachable: `BLOCK_SIZES` is 3, `MIN_SUBFRAME` is 128 and
`Decoder::new` builds one scale-factor layout per `FRAME_SAMPLES >> i`. The
"four" is WMA Pro's general case leaking in, and a contributor re-checking
the subframe header against it would read a two-bit shift and desync every
subframe after the first. Say three, and list the sizes they are.
TrustNo1 changed title from [pr-docs] formats: the XMA docs say three subframe sizes, not four to formats: the XMA docs say three subframe sizes, not four 2026-12-06 03:26:47 +00:00
This pull request can be merged automatically.
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 'xma-doc-subframe-sizes:qnjk-xma-doc-subframe-sizes'
git switch 'qnjk-xma-doc-subframe-sizes'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'qnjk-xma-doc-subframe-sizes'
git switch 'qnjk-xma-doc-subframe-sizes'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-xma-doc-subframe-sizes'
git switch 'qnjk-xma-doc-subframe-sizes'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-xma-doc-subframe-sizes'
git switch 'Main'
git merge --squash 'qnjk-xma-doc-subframe-sizes'
git switch 'Main'
git merge --ff-only 'qnjk-xma-doc-subframe-sizes'
git switch 'Main'
git merge 'qnjk-xma-doc-subframe-sizes'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
TrustNo1/Darner!592
No description provided.