runtime: test memory transfer prerequisite and failure chain #948
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/955"
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-23T18:35:51Z.
Summary
Adds a companion source-built caller (
tests/cpu/transfer_chain_caller.asm) and controlled provider (tests/cpu/transfer_chain_provider.cpp) for testing the prerequisite query, working-set statistics evaluation, and transfer memory sequence under both the Windows native loader andpe_map.The caller starts through
tests/cpu/exe_startup.asm, importsXMemIsToolsMemAvailable,XMemGetWorkingSetStatistics, andXMemTransferMemoryby name fromxmem.dll, and exits cleanly viacpu_exe_io!finish_exe.Verified cases
TRUE,XMemGetWorkingSetStatisticswith selector0x2000000Areports budget (32 MiB total, 16 MiB used), and memory transfer executes a 16 MiB transfer under test-provider policy partition 1. Returns milestone exit code0x870.FALSE(the no-tools desktop policy established in #896), sequence is blocked immediately.XMemTransferMemoryis never called (transfer_calls == 0), returning exit code0x101.XMemGetWorkingSetStatisticsreturnsFALSEor fails, sequence is aborted immediately.XMemTransferMemoryis never called (transfer_calls == 0), returning exit code0x102.total <= used), transfer is skipped.XMemTransferMemoryis never called (transfer_calls == 0), returning exit code0x103.XMemTransferMemoryreturnsFALSE, the failure is isolated and prior state remains intact. The provider records the transfer attempt (transfer_calls == 1) without reporting successful ownership transfer, returning exit code0x104.0x2000000Ato0x2000000Bin the caller binary causes the query to fail under both loaders, aborting with exit code0x102and leaving transfer uncalled.XMemIsToolsMemAvailable,XMemGetWorkingSetStatistics, orXMemTransferMemorystopspe_mapat import resolution before entry withSTATUS["unresolved"]naming the missing export.CPU_CRC_TEST_LIVE_WORKER=1, a live worker thread outlives the body under the Windows loader, andfinish_exeterminates the process cleanly with code0x870.Tested commands and environment
out/pe-env).06831afRefs #870.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:46:59Z.
The independent Windows Release run passed cpu_native_transfer_chain and cpu_native_transfer_mem. I tightened the controls on this branch. The failed transfer records the requested 16 MiB, all three missing imports leave an empty trace, and the child fixture ignores inherited test switches unless a case selects them. The run also passed with conflicting switches set in the parent environment. The fixture records a provider result and requested bytes; it has no backing pages or ownership state.