runtime: bring XMem page-run fixes into cpp-migration #2918
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2918"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by sydney-0o on 2026-11-26T20:26:01Z.
Change
Bring the 17 XMem commits from JohnConnorNPC's
memory/merged-page-runsintocpp-migration. This preserves the native DXIL compiler and adds the Wine placeholder fallback, DirectStorage copy synchronization during XMem run breaks, and opt-in joining of adjacent XMem mappings.The integration adds one fixture correction. The single-page device case maps high addresses first so it constructs two separate views regardless of backing-slot allocation order. Before the correction, both device tests saw one view where the fixture expected two. The assertion and placed-resource checks are unchanged.
Refs #2911.
Verification
Tested
f602024969c28e70cfd15eae2280a25a3d2d7a46against base40365770on Windows 10 Pro 22H2 (19045.6456), MSVC 19.31.31105, and Python 3.12.14. The build passed. CTest reported 23 passed, 1 skipped, 0 failed. The placed-buffer cases passed on WARP (systemd3d10warp.dll10.0.19041.5794) and NVIDIA GeForce GTX 1080 Ti (32.0.15.8278). The fixture did not enable the D3D12 debug layer. The placeholder fallback control skipped because native Windows reports the placeholder bit.Verification used the repository's source-built fixtures. The no-merge and DirectStorage run-break controls passed. Wine results for the incoming branch are recorded in #2911. The Windows Actions workflow is configured for PRs targeting
main, so this PR'scpp-migrationbase does not trigger that workflow.AI-assisted integration and fixture correction.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T20:36:55Z.
Review: CHANGES_REQUESTED
Review of head
f6020249oncpp-migration40365770, with a Windows run that includes the test family left out of the description's filter.What this is:
git range-diffshows the 17 commits of #2911 (4a43a173), unchanged, plus one fixture commit,f6020249.Environment: Windows 11 build 26300.9974, AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP 10.0.26100.9818, MSVC 19.44.35221,
releasepreset, D3D12 debug layer not enabled.56 tests: 53 passed, 1 skipped (77,
xmem_placeholder_split_control, because Windows reports the placeholder bit), and 2 failed:f602024940365770xmem_page_runs_device_{warp,hardware}linear_buffer_backing_share_{warp,hardware}The failing row is
share xmem split FAIL: slot 133 -> 0x00000000, copied (share 0x80070032, feature 0x00000000, 131072 bytes in 1 refreshes, staging 1). That is the same failure I reported on #2905 and @Not-Saii reported on #2911.allocate_splitmapsalloc_pages - 1pages and then one more page with a second call, and expects a view boundary inside the buffer. With shared views, the second call now joins the first. The description's filter does not includelinear_buffer_backing_, so the 23/1/0 result does not cover it.f6020249: this fixture change is correct as far as it goes. A join only attaches a call to the run that ends at its address, so mapping the single pages from high to low leaves every page in its own view whatever slot it got, andxmem_page_runs_devicepasses again on WARP and on hardware. The assertion is unchanged. It would fix one of the two failures on #2911 as well, so it may be better offered to @JohnConnorNPC there.Requested before this lands
linear_buffer_backing_sharefails on both adapters with this PR and passes on the base. Either the joins must not change that case's layout, or the fixture must build its boundary in a way joins cannot merge. Then a Windows run oflinear_buffer_backing_is needed.main. It has the two Windows failures, @Not-Saii's four open points (the DirectStorage copy bypassing the #2685 resident check undermemory.mutex, the 64-break history now that every join is a break, joins being active on native Windows through-LazyMemory, and the one-page placeholder check under Wine), and the smaller items. Landing the same commits incpp-migrationfirst would bypass that review. I would hold this until #2911 settles, then bring over what lands there, or let @R0Y00 decide whethercpp-migrationshould carry it earlier.For context: the
-LazyMemorywrite fault on Windows predates these commits. On #2905 I measured it at the same executable offset with and without the PR, and @pigalot's runs on #2911 show the same. It is not a reason to hold this PR, but this PR does not fix it either..github/workflows/windows.ymlruns only for pull requests intomain, so this PR has no CI. The local runs above and in the description are the only evidence.AI-assisted; the commands above were run locally.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-26T21:14:39Z.
Thanks for carrying these commits into
cpp-migration. Yourxmem_page_runs_devicechange is now in #2911 asad1980cb, the same patch asf6020249(same patch-id). Yourlinear_buffer_backingchange27778f4fis being considered together with the review points on #2911.For anyone repeating our start-up runs on this branch: we used one more local patch, attached below. It is a diagnostic aid, not part of #2911, and not proposed for merge. It changes only
src/startup_stubs/runtime_proxy.cpp:x2w-runtime query <provider> iid <iid>: system runtime 0x...).X2W_FAKE_USER, an area that the system runtime refuses falls back to its local object even when the runtime itself initialised. With this change our runs read a save at start-up and skip the menus.Where it was run: only on Linux, under Proton Experimental (wine-11.0), with the clang-cl cross build. It was never run on
cpp-migration.4a43a173plus this patch, with the switches from #2911's "How to test", there were three finished runs:main6ee878d8stopped at the start-up watchdog at 52.2 s, likemainwithout the patch. Two on a build ofmainwith #2911's commits through theReadFile/WriteFileretry ended at the same watchdog at 282.4 s and 204.3 s.git apply --checkpasses on this PR's head27778f4f, oncpp-migration40365770, on4a43a173and onmain6ee878d8. To apply it from the repository root, rungit apply proxy-fallback.diff.proxy-fallback.diff
This comment was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-26T21:22:47Z.
@MasterDomino thanks for the Windows run. #2911 now carries both fixture changes from this PR unchanged, with the same patch-ids:
f6020249asad1980cband27778f4fas238ed78a.27778f4fis unmeasured on Windows: we have no run oflinear_buffer_backing_(our Wine prefix does not start those tests). The Windows run of that family is still needed.The order of #2918 and #2911 is for the maintainers.
This comment was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T21:23:36Z.
merging under my own discretion until Royoo isnt back
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T21:45:40Z.
Reverting on
cpp-migrationin #2931. These are #2911's commits, and #2911 is still under review againstmain. A review ofcpp-migrationagainstmainalso lists them as a blocker for merging the branch. I merged this before #2911 had settled, which was a mistake. Once #2911 lands onmain, mergingmainintocpp-migrationbrings in the reviewed version. @sydney-0o, your two fixture changes are with JC on #2911:f6020249is in asad1980cb, and27778f4fis being considered with the review points.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T21:52:31Z.
Start-up runs with lazy memory off, as promised in #2931. This PR has since been reverted on
cpp-migration, and the same commits are #2911, so @JohnConnorNPC, this mainly concerns #2911.Setup: two matched pairs of 420 s runs, the first pair with the PR first and the second with the base first. Windows 11 build 26300.9974, AMD Radeon RX 9070 XT, driver 32.0.32029.2010,
release, D3D12 debug layer off. Switches:-MemoryGiB 40 -FakeUser -Render -Translate -GpuMirror -HostCpu -StartupBelow40 -ContinueAsserts 100000, no-LazyMemory,X2W_DEVICE_TYPE=6 X2W_PRESENT_COMPOSITE=1 X2W_D3D12_RELEASE_RETIRED=1 X2W_D3D12_RELEASE_RETIRED_VIEWS=1 X2W_XAPU_TYPED_COMPLETIONS=1 X2W_D3D12_BUDGET=1, and the same input script. Each run started from a fresh copy of the same shader cache. PR27778f4fagainst basecpp-migration40365770. Counts only.memory.mutexdelays the data behind some descriptors (@Not-Saii's point 1 on #2911), it could show up here first. I have not tested that.AI-assisted; the commands above were run locally.