runtime: test ACP address and memory mapping sequence #993
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1000"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T20:37:24Z.
Add a source-built caller (
tests/cpu/apu_address_caller.asm) and controlled test recording provider (tests/cpu/apu_address_provider.cpp) exercising the ACP address and memory mapping exports fromacphal.dll:acphal.dll!ApuAlloc(MIT Microsoft/DirectXTK12 call shape)acphal.dll!ApuFree(MIT Microsoft/DirectXTK12 call shape)acphal.dll!ApuMapVirtualAddressacphal.dll!ApuMapApuAddressacphal.dll!ApuIsVirtualAddressValidFixture contract qualification
ApuAllocandApuFreecall shapes are taken from public MIT call sites in Microsoft/DirectXTK12 (SoundEffect.cpp,WaveBankReader.cpp,SoundStreamInstance.cpp), the three mapping and query signatures (ApuMapVirtualAddress,ApuMapApuAddress, andApuIsVirtualAddressValid) and the address translation behavior tested here are the recording provider's fixture contract (proposed test-provider policy) rather than verification against an original or production console provider.pe_map) can exercise, record, and verify bidirectional address translation, linear offset preservation, validity query lifecycle, and failure/withholding controls. Verification against an original console provider remains open.Verified behaviors
ApuMapVirtualAddresstranslates an allocated CPU virtual pointer to an APU device address (APU_ADDRESS/UINT64), andApuMapApuAddresstranslates it back to the exact identical CPU pointer (ApuMapApuAddress(ApuMapVirtualAddress(ptr)) == ptr).ApuMapVirtualAddress(ptr + offset) == apu_addr + offsetandApuMapApuAddress(apu_addr + offset) == ptr + offset).ApuIsVirtualAddressValid(ptr)returnsTRUE(1) while the block is live, and returnsFALSE(0) afterApuFree(ptr).ApuIsVirtualAddressValidreturnsFALSE,ApuMapVirtualAddressreturns 0,ApuMapApuAddressreturnsnullptr).APU_TEST_FAULTY) where mapping returnsnullptrcauses the caller to abort at Step 4 (0xF04).ApuMapVirtualAddress,ApuMapApuAddress, orApuIsVirtualAddressValidstopspe_mapat import resolution before entry withSTATUS["unresolved"]naming the missing export.Verification
Release build:
Documentation and hygiene checks:
All passed.
Refs #870.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:43:38Z.
Independent Windows Release run of
5f0aa84passedctest --preset release --no-tests=error -R '^cpu_native_apu_address$' -V(1/1). Native and pe_map returned0x8a1, the faulty provider returned0xf04in both, and withholding each mapping/query import failed before entry. The three mapping/query signatures and address behavior in this patch are the recording provider's fixture contract. Please carry that qualification into the PR summary so readers can distinguish this milestone from verification against the original provider.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T20:48:40Z.
Thanks @R0Y00, that qualification is important and makes complete sense. Updated the PR summary accordingly:
ApuMapVirtualAddress,ApuMapApuAddress,ApuIsVirtualAddressValid, and synthetic address translation) from verified behavior against an original/production console provider.