tests: open the vm_translation_check section heaps from a mapped view #2393

Manually merged
github merged 1 commit from gh-pr/2393/head into gh-pr/2393/base 2026-11-27 00:48:04 +00:00
Owner

@⁠JVProg on GitHub · 2026-11-25 15:04 UTC · original
JVProg:tests/vm-section-heap-mapped-view → main · +4 −2 · 2 files · 1 commits · merged 2026-11-25 15:12 UTC

Change

vm_translation_check now opens its two 64 KiB section heaps (SectionBuffer, used by the range scenario) with OpenExistingHeapFromAddress on the mapped view, instead of OpenExistingHeapFromFileMapping. On the affected build, the old call left these sections committed after the process exited. The destructor already releases the placed buffer and the heap before it unmaps the view, and it runs after the fixture has waited for the queue, so that order is unchanged. One sentence in docs/experiments.md records the choice.

vm_copy_queue_check is not changed: its growth stayed within the idle drift.

Refs #2234. Follows #2295. Baseline report: #2234

Verification

Commit 9bb4a441 (base 15b89898; tests and measurements ran on the same change before it was committed), release preset. Windows 11 build 26300, WARP and AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010). The fixture does not enable the D3D12 debug layer.

cmake --build --preset release --target vm_translation_check d3d12_xs_shim
ctest --preset release --no-tests=error -j 1 -R "^vm_translation_"

11/11 passed, no skips. I also ran range_warp and range_hardware directly: both exit 0 with range failures=0; the offset, neighbour-tile, staging-write and Close checks all report ok.

Manual commit measurement (not part of CTest): system-wide SharedCommittedPages from NtQuerySystemInformation(SystemPerformanceInformation), read before and after 1000 sequential runs (median of 5 samples, after a 3 s wait). All runs exited 0. Not measured from a fresh reboot.

Case (1000 runs) Before the change After the change
range_warp +124.82 MiB +2.89 MiB
range_hardware +133.86 MiB +45.60, -14.79, -18.22, -9.63 MiB (four batches)

About 128 MiB is expected per batch if both sections stay committed.

Controls measured with the change:

  • Mapped-view-only child (a Python process that creates, maps, writes and closes two 64 KiB pagefile sections, with no D3D12 heap), first / last: -0.33 / +0.06 MiB.
  • device_hardware (same adapter, creates no pagefile section), two batches: +10.14, -2.27 MiB.

The first range_hardware batch after the change read +45.60 MiB, above these controls. The next three batches were negative, so I did not see steady per-run growth. The counter is system-wide, so background activity affects it; I did not isolate the cause of that first reading. The "before" figures come from an earlier session on the same host, with idle controls of -3.20 and +3.51 MiB.

Not run: the rest of the test suite, the dev preset, and other adapters or Windows builds.

Evidence and follow-up

No new fixture. Commit sampling stays out of CI.

AI-assisted (Claude Code).

**@⁠JVProg** on GitHub · 2026-11-25 15:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2393) `JVProg:tests/vm-section-heap-mapped-view` → `main` · +4 −2 · 2 files · 1 commits · merged 2026-11-25 15:12 UTC ## Change `vm_translation_check` now opens its two 64 KiB section heaps (`SectionBuffer`, used by the `range` scenario) with `OpenExistingHeapFromAddress` on the mapped view, instead of `OpenExistingHeapFromFileMapping`. On the affected build, the old call left these sections committed after the process exited. The destructor already releases the placed buffer and the heap before it unmaps the view, and it runs after the fixture has waited for the queue, so that order is unchanged. One sentence in `docs/experiments.md` records the choice. `vm_copy_queue_check` is not changed: its growth stayed within the idle drift. Refs #2234. Follows #2295. Baseline report: https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/2234 ## Verification Commit `9bb4a441` (base `15b89898`; tests and measurements ran on the same change before it was committed), `release` preset. Windows 11 build 26300, WARP and AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010). The fixture does not enable the D3D12 debug layer. ```powershell cmake --build --preset release --target vm_translation_check d3d12_xs_shim ctest --preset release --no-tests=error -j 1 -R "^vm_translation_" ``` 11/11 passed, no skips. I also ran `range_warp` and `range_hardware` directly: both exit 0 with `range failures=0`; the offset, neighbour-tile, staging-write and Close checks all report `ok`. Manual commit measurement (not part of CTest): system-wide `SharedCommittedPages` from `NtQuerySystemInformation(SystemPerformanceInformation)`, read before and after 1000 sequential runs (median of 5 samples, after a 3 s wait). All runs exited 0. Not measured from a fresh reboot. | Case (1000 runs) | Before the change | After the change | |---|---:|---:| | `range_warp` | +124.82 MiB | +2.89 MiB | | `range_hardware` | +133.86 MiB | +45.60, -14.79, -18.22, -9.63 MiB (four batches) | About 128 MiB is expected per batch if both sections stay committed. Controls measured with the change: - Mapped-view-only child (a Python process that creates, maps, writes and closes two 64 KiB pagefile sections, with no D3D12 heap), first / last: -0.33 / +0.06 MiB. - `device_hardware` (same adapter, creates no pagefile section), two batches: +10.14, -2.27 MiB. The first `range_hardware` batch after the change read +45.60 MiB, above these controls. The next three batches were negative, so I did not see steady per-run growth. The counter is system-wide, so background activity affects it; I did not isolate the cause of that first reading. The "before" figures come from an earlier session on the same host, with idle controls of -3.20 and +3.51 MiB. Not run: the rest of the test suite, the `dev` preset, and other adapters or Windows builds. ## Evidence and follow-up No new fixture. Commit sampling stays out of CI. AI-assisted (Claude Code).
OpenExistingHeapFromFileMapping can leave the section committed after
the process exits (#2234). Open the two 64 KiB section heaps of the range
scenario with OpenExistingHeapFromAddress on the mapped view instead.
The destructor already releases the heap before it unmaps the view.

Refs #2234

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:48:00 +00:00
github manually merged commit 9bb4a4411e into gh-pr/2393/base 2026-11-27 00:48:04 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.