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

Merged
JVProg merged 1 commit from upstream-pr/2393 into main 2026-11-25 15:12:05 +00:00
JVProg commented 2026-11-25 15:04:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T15:04:48Z.


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://github.com/R0Y00/Xbox2Windows/issues/2234#issuecomment-7165456279

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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6607493027 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2393). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T15:04:48Z. --- ## 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://github.com/R0Y00/Xbox2Windows/issues/2234#issuecomment-7165456279 ## 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).
upstream-sync closed this pull request 2026-11-25 16:05:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2385
No description provided.