runtime: test ACP HAL create, shape-context and heap sequence #1040
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1047"
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 rasptum on 2026-11-23T23:01:23Z.
Adds a source-built caller (
tests/cpu/acphal_hal_caller.asm) and a test-only recording provider (tests/cpu/acphal_hal_provider.cpp) for the remainingacphal.dllimports in #870:acphal.dll!ApuCreateHeapacphal.dll!AcpHalCreateacphal.dll!AcpHalAllocateShapeContextsacphal.dll!AcpHalReleaseShapeContextsThe caller also imports
ApuAllocandApuFree(the DirectXTK12 call shape used in #1000), so that heap creation has an observable effect. Same conventions as #1000:exe_startup.asm,finish_exe, Windows loader andpe_map, a faulty-provider build, and withheld-export controls. Test-only: no productionacphal.dllexport.Public evidence and what is not public
f8c3438listsAcpHalandShapeContextsmember pages, plus per-type pages (ShapeDmaContext,ShapeEqCompContext,ShapeFiltVolContext,ShapePcmContext,ShapeSrcContext,ShapeXmaContext,ShapeFlowGraph). These are names only.f3555e3namesApuCreateHeaponly in anApuAllocfailure diagnostic, as the heapApuAllocdraws from. It has no call site.HRESULT ApuCreateHeap(UINT32 size),HRESULT AcpHalCreate(void** hal),HRESULT AcpHalAllocateShapeContexts(void* hal, UINT32 count, void** contexts),HRESULT AcpHalReleaseShapeContexts(void* hal, void* contexts). The 64 KiB heap bound (4 KiB granularity), the single HAL instance, the 16-slot pool of 64-byte contexts, first-fit reuse and every refusal code are desktop policy for this fixture.Verified cases (identical under the Windows loader and
pe_map, exit0x8AC)ApuAllocbefore any heap returnsHRESULT_FROM_WIN32(ERROR_INVALID_STATE)and leaves the output.ApuCreateHeap(0)returnsE_INVALIDARG.ApuCreateHeap(0x2000)succeeds. A second heap returnsERROR_ALREADY_EXISTS.ApuAlloc: 4 KiB succeeds, a further 8 KiB returnsE_OUTOFMEMORYwith the output and the first block intact.E_HANDLE. The checker also replays the provider's real handle address before create, which only the created-state check can refuse. The same call succeeds after create.AcpHalCreate(nullptr)returnsE_POINTER. One HAL is created. A second create returnsERROR_ALREADY_EXISTSwith its output untouched.E_INVALIDARGand is counted. A wrong handle returnsE_HANDLE.pe_maprun match the expected call counts exactly (3 heap, 3ApuAlloc, 3 create, 7 allocate with 3 successes, 5 release, 1 double-release refusal, 2 handle refusals, 0 live).Controls: a provider that skips clearing the contexts (
ACPHAL_TEST_FAULTY) stops at Step 7 (0xF07) under both loaders. Withholding any of the four exports stopspe_mapbefore entry withunresolved import acphal.dll!<name>and no provider calls. With noacphal.dllat all,pe_mapstops before entry and the Windows loader exits0xC0000135(STATUS_DLL_NOT_FOUND).Mutation check (local, not committed): each mutation was built into the provider and the test rerun. All six failed at the expected point: double release accepted ->
0xF08,ApuAllocbefore heap allowed ->0xF01, heap bound ignored ->0xF03, second create allowed ->0xF05, created-state check removed -> replayed-handle control, release keeps slots ->0xF09.Environment
Windows 10 Pro 22H2 (
10.0.19045.6466), MSVC 19.44.35207.1 x64, CMake/Ninja, Python 3.13.13 (out/pe-env). Tested commit8e9393a5(rebased onorigin/mainat62b55f9).Commands and results
The same build and
ctestwith--preset release:100% tests passed, 0 tests failed out of 3. No capability skips.All passed.
docs/experiments.mdgains an "ACP HAL, shape-context and heap caller and recorder" section, and the four inventory rows now point at it. Their status stays "needs evidence".This does not establish the console signatures, the shape-context layout, the startup call order, or whether startup calls
ApuCreateHeapbeforeApuAlloc.Refs #870. Related: #947, #1000.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T23:06:52Z.
Independent Windows Release at
8e9393a5passed the ACP HAL fixture and the existing ApuAlloc/address fixtures (3/3). Native and mapped runs returned 0x8ac, the uncleared-context provider failed at 0xf07, and each withheld export stopped mapping before entry. Keep the ACP heap, HAL and context arguments labeled as test-provider policy until independent ABI evidence is available. This result can be tracked separately from the XApu/XDsp queue work in #870.