XAudio2: honor requested alignment for 32-bit APU addresses in ApuAlloc #1460

Merged
b3IKK merged 1 commit from upstream-pr/1470 into main 2026-12-02 17:38:26 +00:00
b3IKK commented 2026-11-24 16:36:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T16:36:24Z.


ApuAlloc(va, apu, size, alignment, flags) aligned the host VA via alloc_aligned(size, alignment), but Apu::address / Apu::find_free_range hardcoded 4 KiB (0x1000) alignment for the returned 32-bit APU address. After any earlier smaller allocation advanced APU.next off a larger boundary, a subsequent ApuAlloc requesting alignment > 0x1000 (e.g. 0x20000) returned a misaligned APU address.

This threads alignment through Apu::address_aligned and Apu::find_free_range, aligning candidate starts and overlap skips up to alignment.max(1).checked_next_power_of_two()?.max(0x1000) with checked arithmetic.

What is in it

  • crates/xcl/src/hle/acphal.rs: add align parameter to Apu::find_free_range, add Apu::address_aligned called by ApuAlloc, and add unit test apu_alloc_honors_alignment_for_apu_address (verified failing before the fix with apu % 0x20000 == 0x1000).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 771 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib acphal: 8 passed, 0 failed (apu_alloc_honors_alignment_for_apu_address failed before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1643 (PresentX 1643)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14605 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited hle/acphal.rs, wrote the fix and unit test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5476301731 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T16:36:24Z. --- `ApuAlloc(va, apu, size, alignment, flags)` aligned the host VA via `alloc_aligned(size, alignment)`, but `Apu::address` / `Apu::find_free_range` hardcoded 4 KiB (`0x1000`) alignment for the returned 32-bit APU address. After any earlier smaller allocation advanced `APU.next` off a larger boundary, a subsequent `ApuAlloc` requesting `alignment > 0x1000` (e.g. `0x20000`) returned a misaligned APU address. This threads `alignment` through `Apu::address_aligned` and `Apu::find_free_range`, aligning candidate starts and overlap skips up to `alignment.max(1).checked_next_power_of_two()?.max(0x1000)` with checked arithmetic. **What is in it** - `crates/xcl/src/hle/acphal.rs`: add `align` parameter to `Apu::find_free_range`, add `Apu::address_aligned` called by `ApuAlloc`, and add unit test `apu_alloc_honors_alignment_for_apu_address` (verified failing before the fix with `apu % 0x20000 == 0x1000`). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 771 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib acphal`: 8 passed, 0 failed (`apu_alloc_honors_alignment_for_apu_address` failed before the fix) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1643 (PresentX 1643) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14605 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `hle/acphal.rs`, wrote the fix and unit test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
futurepro62 commented 2026-11-24 17:06:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T16:57:44Z.


Full-suite run, since this PR has no test report yet. Tested exact head 7fa09f3 (on its base b7aa9f3).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 771 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: apu_alloc_honors_alignment_for_apu_address.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 771 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7138474198 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7138474198). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T16:57:44Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `7fa09f3` (on its base `b7aa9f3`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **771 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `apu_alloc_honors_alignment_for_apu_address`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **771 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 19:07:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:53:08Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7141288461 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7141288461). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:53:08Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
oni-swr commented 2026-11-25 18:04:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T17:09:51Z.


amd-win test report for 7fa09f37 (exact head 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb) on AMD Radeon RX 7800 XT

Tested

  • AMD Radeon RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003; Ryzen 7 5700X3D; Windows 11 build 26200; rustc 1.100.0 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build for the tests, release build for the smoke runs
  • The PR head exactly as pushed (its base is older than current main; the merged tree was not tested). Merges cleanly into origin/main 55d64c27 (git merge-tree)
  • Focused: cargo test -p xcl --lib acphal: 8 passed, 0 failed (includes the new apu_alloc_honors_alignment_for_apu_address)
  • Full suite, cargo test --workspace -- --test-threads=4: 771 passed, 0 failed, 41 ignored; no SKIPPED lines printed

Regression run (own test title tests/testtitle, 60 s, release; same title and time for both. The test title exits with code 2 by design and shows no frames, so crashes: 1 is its normal exit and is the same on both)
PR head:

xcl-smoke v1
commit: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb
gpu: AMD Radeon RX 7800 XT
title: testgame
seconds: 60
exit: 0x2
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 
device removals: 0
crashes: 1
peak commit: n/a MB

main (b7aa9f3):

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: AMD Radeon RX 7800 XT
title: testgame
seconds: 60
exit: 0x2
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 
device removals: 0
crashes: 1
peak commit: n/a MB

Not tested

  • No retail title: this is a run of our own test title only, so the smoke run does not reach the code this PR changes and says nothing about frames or frame time
  • Other GPUs (NVIDIA / Intel), wave64-only paths on other adapters, and the merged tree on current main

AI use

  • Run and written up by Claude Code (Claude Sonnet 5.5) from real runs on the hardware named above, for oni-swr. No code was changed.
<!-- greyfinch-sync:ivall/xcl:comment:7169099901 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7169099901). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T17:09:51Z. --- **amd-win test report for `7fa09f37` (exact head `7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb`) on AMD Radeon RX 7800 XT** **Tested** - AMD Radeon RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003; Ryzen 7 5700X3D; Windows 11 build 26200; rustc 1.100.0 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build for the tests, release build for the smoke runs - The PR head exactly as pushed (its base is older than current `main`; the merged tree was not tested). Merges cleanly into `origin/main` `55d64c27` (`git merge-tree`) - Focused: `cargo test -p xcl --lib acphal`: 8 passed, 0 failed (includes the new `apu_alloc_honors_alignment_for_apu_address`) - Full suite, `cargo test --workspace -- --test-threads=4`: 771 passed, 0 failed, 41 ignored; no SKIPPED lines printed **Regression run** (own test title `tests/testtitle`, 60 s, release; same title and time for both. The test title exits with code 2 by design and shows no frames, so `crashes: 1` is its normal exit and is the same on both) PR head: ``` xcl-smoke v1 commit: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb gpu: AMD Radeon RX 7800 XT title: testgame seconds: 60 exit: 0x2 frames shown: none logged (the run did not reach its end) presents per 2 s (last 3): device removals: 0 crashes: 1 peak commit: n/a MB ``` `main` (b7aa9f3): ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: AMD Radeon RX 7800 XT title: testgame seconds: 60 exit: 0x2 frames shown: none logged (the run did not reach its end) presents per 2 s (last 3): device removals: 0 crashes: 1 peak commit: n/a MB ``` **Not tested** - No retail title: this is a run of our own test title only, so the smoke run does not reach the code this PR changes and says nothing about frames or frame time - Other GPUs (NVIDIA / Intel), wave64-only paths on other adapters, and the merged tree on current `main` **AI use** - Run and written up by Claude Code (Claude Sonnet 5.5) from real runs on the hardware named above, for `oni-swr`. No code was changed.
github-actions[bot] commented 2026-11-29 07:43:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:58Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252655759 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7252655759). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:43:58Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
BBareth commented 2026-11-30 13:24:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:24:36Z.


merge-check claim
head: 7fa09f37b9

<!-- greyfinch-sync:ivall/xcl:comment:7279803704 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7279803704). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T13:24:36Z. --- merge-check claim head: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb
BBareth commented 2026-11-30 13:36:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T13:36:31Z.


merge-check
base: 9dfbe3ea66
head: 7fa09f37b9
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test hle::acphal::tests::apu_alloc_honors_alignment_for_apu_address passed, as did the existing acphal tests.
review: no blocking finding; one file, every hunk read. ApuAlloc aligned the host address to the requested alignment but handed out a 32-bit APU address aligned to a page only. find_free_range now takes the alignment (rounded up to a power of two, at least 0x1000), aligns the first candidate and each candidate after an overlap with checked arithmetic, and ApuAlloc passes its alignment; the other caller keeps page alignment through address. For alignments up to a page the candidates are the same as before. One thing to know: a larger alignment can leave gaps below the aligned address; they are found again on the wrap to APU_BASE. Not tested by me: a title that asks for an alignment above a page.
performance: none to speak of.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7280089955 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7280089955). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T13:36:31Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test `hle::acphal::tests::apu_alloc_honors_alignment_for_apu_address` passed, as did the existing acphal tests. review: no blocking finding; one file, every hunk read. `ApuAlloc` aligned the host address to the requested alignment but handed out a 32-bit APU address aligned to a page only. `find_free_range` now takes the alignment (rounded up to a power of two, at least 0x1000), aligns the first candidate and each candidate after an overlap with checked arithmetic, and `ApuAlloc` passes its `alignment`; the other caller keeps page alignment through `address`. For alignments up to a page the candidates are the same as before. One thing to know: a larger alignment can leave gaps below the aligned address; they are found again on the wrap to `APU_BASE`. Not tested by me: a title that asks for an alignment above a page. performance: none to speak of. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
tiagonleal commented 2026-11-30 14:11:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T14:11:28Z.


merge-check
base: 9dfbe3ea66
head: 7fa09f37b9
merge: clean
build: cargo build --workspace -> ok (also cargo build --release -p xcl)
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it). hle::acphal::tests::apu_alloc_honors_alignment_for_apu_address ran and passed. With ApuAlloc calling the old page-aligned address again, it fails at acphal.rs:1328 (APU address 0x20000-aligned: left 4096, right 0); file restored after.
review: one file, whole diff read. find_free_range (acphal.rs:221) rounds the alignment up to a power of two and to at least a page (acphal.rs:225), the same rounding alloc_aligned uses for the host address (acphal.rs:276), so the two agree for odd values too. Candidate starts and overlap skips are aligned with checked adds; an overflow ends the search and ApuAlloc returns E_OUTOFMEMORY after freeing the host memory (acphal.rs:317-320), as before. ApuMapVirtualAddress still uses page alignment through address. What the title asks for, measured: with XCL_TRACE_APU=1 on the base and on the merge, the title makes three ApuAlloc calls in its menus, with alignments 0x100, 0x800 and 0x800, and gets the same APU addresses on both (0x10000000, 0x10006000, 0x10229000). No alignment above a page is requested there, so the changed path was not reached by the title.
performance: scripts/smoke.ps1, 60 s of a retail title, release: 1653 frames and 17995 MB peak commit against 1659 frames and 17322 MB on the base (today's base run after one warm-up). The traced pair: 1673 frames, 18272 MB against 1670 frames, 18142 MB on the base. No device removal, no crash in any of the four. Audio initialised as on the base: the same acphal and xapu lines (ApuCreateHeap, DSP connected with 128 streams, audio processor connected, xapu: decoder connected with 256 streams).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, tests and smoke, reviewed the diff against the merged source and wrote this)

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7280978307 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7280978307). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T14:11:28Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 7fa09f37b99fc8feef6a063f4f4d07cbb50b73cb merge: clean build: cargo build --workspace -> ok (also `cargo build --release -p xcl`) tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: `gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16`, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it). `hle::acphal::tests::apu_alloc_honors_alignment_for_apu_address` ran and passed. With `ApuAlloc` calling the old page-aligned `address` again, it fails at `acphal.rs:1328` (APU address 0x20000-aligned: left 4096, right 0); file restored after. review: one file, whole diff read. `find_free_range` (`acphal.rs:221`) rounds the alignment up to a power of two and to at least a page (`acphal.rs:225`), the same rounding `alloc_aligned` uses for the host address (`acphal.rs:276`), so the two agree for odd values too. Candidate starts and overlap skips are aligned with checked adds; an overflow ends the search and `ApuAlloc` returns `E_OUTOFMEMORY` after freeing the host memory (`acphal.rs:317-320`), as before. `ApuMapVirtualAddress` still uses page alignment through `address`. What the title asks for, measured: with `XCL_TRACE_APU=1` on the base and on the merge, the title makes three `ApuAlloc` calls in its menus, with alignments 0x100, 0x800 and 0x800, and gets the same APU addresses on both (0x10000000, 0x10006000, 0x10229000). No alignment above a page is requested there, so the changed path was not reached by the title. performance: `scripts/smoke.ps1`, 60 s of a retail title, release: 1653 frames and 17995 MB peak commit against 1659 frames and 17322 MB on the base (today's base run after one warm-up). The traced pair: 1673 frames, 18272 MB against 1670 frames, 18142 MB on the base. No device removal, no crash in any of the four. Audio initialised as on the base: the same `acphal` and `xapu` lines (ApuCreateHeap, DSP connected with 128 streams, audio processor connected, `xapu: decoder connected` with 256 streams). verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, tests and smoke, reviewed the diff against the merged source and wrote this) - Tiago
Foniass commented 2026-12-01 05:52:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:52:46Z.


Triage (#1607) – head 7fa09f3

#939 makes the same find_free_range change, rounding candidates to the requested alignment, which is passed from ApuAlloc. #939 also changes the ApuMapVirtualAddress / ApuIsVirtualAddressValid ABI, which this PR does not touch. If #939 is merged as is, this PR is superseded; if its ABI change is not taken, this is the alignment fix on its own. The change is not on main.
No problems found in the diff: align_up is checked, non-power-of-two alignments round up, and apu_alloc_honors_alignment_for_apu_address checks the APU address and the VA.

Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302235259 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1470#issuecomment-7302235259). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:52:46Z. --- **Triage (#1607)** – head 7fa09f3 #939 makes the same `find_free_range` change, rounding candidates to the requested alignment, which is passed from `ApuAlloc`. #939 also changes the `ApuMapVirtualAddress` / `ApuIsVirtualAddressValid` ABI, which this PR does not touch. If #939 is merged as is, this PR is superseded; if its ABI change is not taken, this is the alignment fix on its own. The change is not on main. No problems found in the diff: `align_up` is checked, non-power-of-two alignments round up, and `apu_alloc_honors_alignment_for_apu_address` checks the APU address and the VA. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!1460
No description provided.