Share XMA scale-factor band layouts across decoders #25

Open
github-bot wants to merge 1 commit from github-bot/gh-25 into main AGit
Owner

@⁠avt0m4t48 on GitHub · 2026-12-03 03:16 UTC · original
avt0m4t48:perf-share-xma-band-layouts → main · +97 −51 · 1 files · 1 commits · draft

Change

Build the four XMA scale-factor band layouts at compile time and share them across decoders. The sample-rate boundaries and band calculations are unchanged. Coefficients, scale factors, overlap and other mutable stream state still belong to each voice.

On both x86-64 Linux and Windows MSVC, the compiled decoder shrinks from 14,304 to 11,480 bytes and each allocated HLE voice slot from 14,464 to 11,648 bytes. The four layouts occupy 11,328 bytes of read-only data.

Verification

The direct decoder replay compared every layout entry at the rate boundaries and exact PCM and errors across 6,400 synthetic calls per compiler configuration. It covered valid tiled mono and stereo streams, truncation, mutated data, consecutive calls, reset, clone and flush. The format tests also cover the rate selection boundaries.

The patch passes the staged asset check. The full-tree checker flags three pre-existing paths outside the patch. The timing replay is synthetic and Windows runtime, title audio and gameplay frame times remain unmeasured.

The replay also compared every carried sample and block length and exercised resume. With this fork's release fat LTO, the warmed constructor fell from 1,251 to 216 ns on default x86-64 Linux in 14 paired runs. Valid-frame decode was within 0.3% on both default and v3. A separate thin-LTO v3 harness measured 4.2% slower valid-frame decode. The measured benefits are constructor cost and voice storage.

The formats tests and the combined workspace's diagnostic test targets type-checked for Windows x64 MSVC. The combined check used a metadata-only mimalloc declaration on the Linux host.

The LinkoArts formats suite ran in an isolated build directory with 86 passes and 7 ignored tests.

**@⁠avt0m4t48** on GitHub · 2026-12-03 03:16 UTC · [original](https://github.com/linkoovosh/LinkoArts-build/pull/25) `avt0m4t48:perf-share-xma-band-layouts` → `main` · +97 −51 · 1 files · 1 commits · draft ### Change Build the four XMA scale-factor band layouts at compile time and share them across decoders. The sample-rate boundaries and band calculations are unchanged. Coefficients, scale factors, overlap and other mutable stream state still belong to each voice. On both x86-64 Linux and Windows MSVC, the compiled decoder shrinks from 14,304 to 11,480 bytes and each allocated HLE voice slot from 14,464 to 11,648 bytes. The four layouts occupy 11,328 bytes of read-only data. ### Verification The direct decoder replay compared every layout entry at the rate boundaries and exact PCM and errors across 6,400 synthetic calls per compiler configuration. It covered valid tiled mono and stereo streams, truncation, mutated data, consecutive calls, reset, clone and flush. The format tests also cover the rate selection boundaries. The patch passes the staged asset check. The full-tree checker flags three pre-existing paths outside the patch. The timing replay is synthetic and Windows runtime, title audio and gameplay frame times remain unmeasured. The replay also compared every carried sample and block length and exercised resume. With this fork's release fat LTO, the warmed constructor fell from 1,251 to 216 ns on default x86-64 Linux in 14 paired runs. Valid-frame decode was within 0.3% on both default and v3. A separate thin-LTO v3 harness measured 4.2% slower valid-frame decode. The measured benefits are constructor cost and voice storage. The formats tests and the combined workspace's diagnostic test targets type-checked for Windows x64 MSVC. The combined check used a metadata-only mimalloc declaration on the Linux host. The LinkoArts formats suite ran in an isolated build directory with 86 passes and 7 ignored tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 05:21:51 +00:00
This pull request has changes conflicting with the target branch.
  • crates/darner-formats/src/xma.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/25/head:github-bot/gh-25'
git switch 'github-bot/gh-25'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-25'
git switch 'github-bot/gh-25'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-25'
git switch 'github-bot/gh-25'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-25'
git switch 'main'
git merge --squash 'github-bot/gh-25'
git switch 'main'
git merge --ff-only 'github-bot/gh-25'
git switch 'main'
git merge 'github-bot/gh-25'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.