runtime: test memory transfer prerequisite and failure chain #955
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!955
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/955/head"
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?
@Holastor on GitHub · 2026-11-23 18:35 UTC · original
Holastor:xmem/transfer-prerequisite-chain→main· +553 −0 · 6 files · 3 commits · merged 2026-11-23 19:10 UTCSummary
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.
@R0Y00 on GitHub · 2026-11-23 18:46 UTC · original
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.