tests: add D3D12 and xmem lease tests for xmem_section_buffer.h #3683
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!3683
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3681"
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?
@Ammmae0x on GitHub · 2026-12-01 01:10 UTC · original
Ammmae0x:tests/startup-xmem-section-buffer→main· +1129 −0 · 5 files · 1 commits · merged 2026-12-02 02:08 UTCRefs #1149
x2w_startup::XMemSectionBuffer(src/startup_stubs/xmem_section_buffer.h) was untested directly intests/. This adds D3D12 + xmem lease tests for it with zero modifications to existing files (5 new files, +1129/−0; header and device code untouched).What landed
tests/startup_xmem_section_buffer_check.cpp—<warp|hardware> <xmem.dll> [<case>], honorsXBOX2WINDOWS_ADAPTER, exits 77 only when no hardware adapter is available (or the device lacks existing-heaps support), never skips WARP. The check never links the shim: the DLL path is passed as argv[2], so the missing-DLL case runs beforeLoadLibraryW. 13 cases: missing-DLL, null device, zero address, zero size, overflowing range, wrong lease version, CPU address, range crossing into an unmapped page, accept refusal (destructor must release the pinned lease), stale-match refusal (accept unmaps the mirrored pages; the finalmatches(address)must refuse), reopen refusal (first buffer, GPU address and lease untouched), and valid single-page (first_byte 0xf000) and multi-page (first_byte 0xf800, crossing the page boundary) leases with GPU fill/readback, exactly-once destructor release and re-acquire after release. A merely unaligned start is valid; the class has norelease()method, so idempotence is checked through the shim (a second release refuses).tests/cmake/startup_xmem_section_buffer.cmake—_warp/_hardwaretests (TIMEOUT 60,SKIP_RETURN_CODE 77) plus 5WILL_FAIL TRUEconfigure-time header mutation controls mirroringera_physical_owns_last_page_control.tests/startup_xmem_section_buffer_meta_check.py+tests/checks/python-linux/startup_xmem_section_buffer.txt— Linux contract audit plus a Python transliteration ofopen()and its destructor: 13 cases, 5/5 mutations killed. A scratch-copy self-audit of the meta check itself is killed 6/6 with exactFAIL:messages.docs/experiments/startup-xmem-section-buffer.md— cases, controls, and the Windows run.Mutation controls
startup_xmem_section_buffer_accept_mut|| !accept(lease)refuse_acceptstartup_xmem_section_buffer_matches_mut&& matches(address)refuse_stale_matchstartup_xmem_section_buffer_reopen_mutif (lease.id || !devicebecomesif (!devicerefuse_reopenstartup_xmem_section_buffer_destructor_mutrelease_(version_, lease.id)becomesfalserefuse_acceptstartup_xmem_section_buffer_bytes_mutbytes_ = bytesbecomesbytes_ = 0valid_single_pagerefuse_acceptkills two mutants through different assertions: the accept mutant makesopen()succeed, while the destructor mutant leaves the lease pinned after destruction. The early guards have no mutant of their own: dropping any of them does not flip its case, because the shim pin refuses the same range afterwards, so those guards are defence in depth and their cases pin the refusal.Linux verification (worktree on
origin/maina3bfd019)PASS: startup xmem section buffer: 13 cases, 5/5 mutations killedrun_checks_parallel.py --from-dir tests/checks/python-linux(workflow list): all 285 checks passedpy_compile,diff --checkclean,merge-treeexits 0, zero personal pathsWindows Verification (
16f36ec2f966565fceed8b94418e6c2787dfaa6b)AI-assisted.