Repository navigation
Conversation
ApuAlloc 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 smaller allocation advanced `APU.next` off a larger power-of-two boundary, subsequent ApuAlloc calls with `alignment > 0x1000` returned a misaligned APU address. Pass `alignment` through `Apu::address_aligned` and `find_free_range`, aligning both candidate starts and overlap skips up to `alignment.max(1).next_power_of_two().max(0x1000)` with checked math. Assisted-by: OpenCode (Gemini 4 Neon)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
amd-win test report for Tested
Regression run (own test title
Not tested
AI use
|
|
Nothing has happened on this PR for 3 days, so it is marked |
|
merge-check claim |
|
merge-check |
|
merge-check
|
|
#939 makes the same Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
ApuAlloc(va, apu, size, alignment, flags)aligned the host VA viaalloc_aligned(size, alignment), butApu::address/Apu::find_free_rangehardcoded 4 KiB (0x1000) alignment for the returned 32-bit APU address. After any earlier smaller allocation advancedAPU.nextoff a larger boundary, a subsequentApuAllocrequestingalignment > 0x1000(e.g.0x20000) returned a misaligned APU address.This threads
alignmentthroughApu::address_alignedandApu::find_free_range, aligning candidate starts and overlap skips up toalignment.max(1).checked_next_power_of_two()?.max(0x1000)with checked arithmetic.What is in it
crates/xcl/src/hle/acphal.rs: addalignparameter toApu::find_free_range, addApu::address_alignedcalled byApuAlloc, and add unit testapu_alloc_honors_alignment_for_apu_address(verified failing before the fix withapu % 0x20000 == 0x1000).Tested
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: 2no 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_addressfailed before the fix)Regression run
main:
PR:
Not tested
AI use
hle/acphal.rs, wrote the fix and unit test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.