gpu: verify cross-page copy provenance for mapped sections #996

Merged
R0Y00 merged 1 commit from upstream-pr/1003 into main 2026-11-23 21:01:17 +00:00
R0Y00 commented 2026-11-23 20:42:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:42:53Z.


Refs #874. Extends the #986 fixture with a source-side test for a cross-page transfer.

  • Create two distinct pagefile sections and map them in reverse creation order at adjacent CPU addresses. The two section handles also back two real D3D12 buffers through OpenExistingHeapFromFileMapping.
  • Copy the 4 KiB span centered on the CPU page boundary to one DEFAULT buffer and compare all 1,024 readback words with the expected token order and offsets.
  • Write new words through the CPU aliases. Readback without another upload must still match the prior GPU contents. After the second upload the same readback must match the new words.

The test uses Win32 and D3D12 APIs and synthetic data. The separate queue ordering tests from #986 still run.

Local verification

Commit 1d7954f. Windows 26200.9974, MSVC 19.51, Windows SDK 10.0.26100. RTX 4060 Laptop (32.0.16.1656) and in-box WARP (10.0.26100.9818). The fixture leaves the debug layer disabled.

.\tools\dev.ps1
cmake --preset release '-DCMAKE_CXX_FLAGS_DEBUG=/Z7 /Od /RTC1' '-DCMAKE_C_FLAGS_DEBUG=/Z7 /Od /RTC1'
cmake --build --preset release --target vm_copy_queue_check
ctest --preset release --no-tests=error -R '^vm_(copy_queue|page_provenance)_' -V

The local configure points INTAKE_PYTHON at the existing requirements environment. The workstation uses embedded debug info because its installed PDB manager rejects /Zi.

All four CTests passed without skips. Both adapters had zero mismatches at all three provenance checkpoints. Two temporary /O2 mutants, copying from the original section order and skipping the second upload, each failed with 1,024 of 1,024 words wrong at the expected checkpoint on both adapters and returned 1.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6568436074 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1003). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T20:42:53Z. --- Refs #874. Extends the #986 fixture with a source-side test for a cross-page transfer. - Create two distinct pagefile sections and map them in reverse creation order at adjacent CPU addresses. The two section handles also back two real D3D12 buffers through `OpenExistingHeapFromFileMapping`. - Copy the 4 KiB span centered on the CPU page boundary to one DEFAULT buffer and compare all 1,024 readback words with the expected token order and offsets. - Write new words through the CPU aliases. Readback without another upload must still match the prior GPU contents. After the second upload the same readback must match the new words. The test uses Win32 and D3D12 APIs and synthetic data. The separate queue ordering tests from #986 still run. ## Local verification Commit `1d7954f`. Windows 26200.9974, MSVC 19.51, Windows SDK 10.0.26100. RTX 4060 Laptop (32.0.16.1656) and in-box WARP (10.0.26100.9818). The fixture leaves the debug layer disabled. ```powershell .\tools\dev.ps1 cmake --preset release '-DCMAKE_CXX_FLAGS_DEBUG=/Z7 /Od /RTC1' '-DCMAKE_C_FLAGS_DEBUG=/Z7 /Od /RTC1' cmake --build --preset release --target vm_copy_queue_check ctest --preset release --no-tests=error -R '^vm_(copy_queue|page_provenance)_' -V ``` The local configure points `INTAKE_PYTHON` at the existing requirements environment. The workstation uses embedded debug info because its installed PDB manager rejects `/Zi`. All four CTests passed without skips. Both adapters had zero mismatches at all three provenance checkpoints. Two temporary /O2 mutants, copying from the original section order and skipping the second upload, each failed with 1,024 of 1,024 words wrong at the expected checkpoint on both adapters and returned 1.
upstream-sync closed this pull request 2026-11-24 06:45:48 +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!996
No description provided.