runtime: bring XMem page-run fixes into cpp-migration #2918

Merged
sydney-0o merged 20 commits from upstream-pr/2918 into cpp-migration 2026-11-26 21:23:40 +00:00
sydney-0o commented 2026-11-26 20:26:01 +00:00 (Migrated from github.com)

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-runs into cpp-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 f602024969c28e70cfd15eae2280a25a3d2d7a46 against base 40365770 on 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 (system d3d10warp.dll 10.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.

. .\tools\dev.ps1
cmake --preset dev -DINTAKE_PYTHON=<Python-3.12-executable>
cmake --build --preset dev --target xmem_run_break_readers_check xmem_run_break_readers_control xmem_cross_call_merge_check xmem_placeholder_split_check xmem_map_split_first_check xmem_page_runs_device_check startup_dstorage_break_window_check startup_dstorage_destination_check compile_dxil -j 4
$env:TEMP = (New-Item -ItemType Directory -Force out/ctest-temp).FullName
$env:TMP = $env:TEMP
ctest --preset dev --no-tests=error -j 1 -R '^(xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first|shim_(mapped_pages|page_runs)|page_runs_device)|startup_dstorage_(break_window|destination)|native_direct_container)' -V

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's cpp-migration base does not trigger that workflow.

AI-assisted integration and fixture correction.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5516698995 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918). Originally posted by [sydney-0o](https://github.com/sydney-0o) on 2026-11-26T20:26:01Z. --- ## Change Bring the 17 XMem commits from JohnConnorNPC's `memory/merged-page-runs` into `cpp-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 `f602024969c28e70cfd15eae2280a25a3d2d7a46` against base `40365770` on 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 (system `d3d10warp.dll` 10.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. ```powershell . .\tools\dev.ps1 cmake --preset dev -DINTAKE_PYTHON=<Python-3.12-executable> cmake --build --preset dev --target xmem_run_break_readers_check xmem_run_break_readers_control xmem_cross_call_merge_check xmem_placeholder_split_check xmem_map_split_first_check xmem_page_runs_device_check startup_dstorage_break_window_check startup_dstorage_destination_check compile_dxil -j 4 $env:TEMP = (New-Item -ItemType Directory -Force out/ctest-temp).FullName $env:TMP = $env:TEMP ctest --preset dev --no-tests=error -j 1 -R '^(xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first|shim_(mapped_pages|page_runs)|page_runs_device)|startup_dstorage_(break_window|destination)|native_direct_container)' -V ``` 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's `cpp-migration` base does not trigger that workflow. AI-assisted integration and fixture correction.
MasterDomino commented 2026-11-26 20:36:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T20:36:55Z.

Review: CHANGES_REQUESTED


Review of head f6020249 on cpp-migration 40365770, with a Windows run that includes the test family left out of the description's filter.

What this is: git range-diff shows 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, release preset, D3D12 debug layer not enabled.

ctest --preset release --no-tests=error -j 4 --timeout 300 -R '^(xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first|shim_(mapped_pages|page_runs)|page_runs_device)|startup_dstorage_|linear_buffer_backing_|native_direct_container)'

56 tests: 53 passed, 1 skipped (77, xmem_placeholder_split_control, because Windows reports the placeholder bit), and 2 failed:

test this PR f6020249 base 40365770
xmem_page_runs_device_{warp,hardware} pass pass
linear_buffer_backing_share_{warp,hardware} fail pass

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_split maps alloc_pages - 1 pages 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 include linear_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, and xmem_page_runs_device passes 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

  1. linear_buffer_backing_share fails 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 of linear_buffer_backing_ is needed.
  2. Ordering with #2911. These are #2911's commits unchanged, and #2911 is still under review against main. It has the two Windows failures, @Not-Saii's four open points (the DirectStorage copy bypassing the #2685 resident check under memory.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 in cpp-migration first would bypass that review. I would hold this until #2911 settles, then bring over what lands there, or let @R0Y00 decide whether cpp-migration should carry it earlier.

For context: the -LazyMemory write 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.yml runs only for pull requests into main, 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6080250552 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#pullrequestreview-6080250552). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T20:36:55Z. **Review:** CHANGES_REQUESTED --- Review of head `f6020249` on `cpp-migration` `40365770`, with a Windows run that includes the test family left out of the description's filter. **What this is:** `git range-diff` shows 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, `release` preset, D3D12 debug layer not enabled. ```powershell ctest --preset release --no-tests=error -j 4 --timeout 300 -R '^(xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first|shim_(mapped_pages|page_runs)|page_runs_device)|startup_dstorage_|linear_buffer_backing_|native_direct_container)' ``` 56 tests: 53 passed, 1 skipped (77, `xmem_placeholder_split_control`, because Windows reports the placeholder bit), and **2 failed**: | test | this PR `f6020249` | base `40365770` | |---|---|---| | `xmem_page_runs_device_{warp,hardware}` | pass | pass | | `linear_buffer_backing_share_{warp,hardware}` | **fail** | pass | 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_split` maps `alloc_pages - 1` pages 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 include `linear_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, and `xmem_page_runs_device` passes 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** 1. `linear_buffer_backing_share` fails 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 of `linear_buffer_backing_` is needed. 2. Ordering with #2911. These are #2911's commits unchanged, and #2911 is still under review against `main`. It has the two Windows failures, @Not-Saii's four open points (the DirectStorage copy bypassing the #2685 resident check under `memory.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 in `cpp-migration` first would bypass that review. I would hold this until #2911 settles, then bring over what lands there, or let @R0Y00 decide whether `cpp-migration` should carry it earlier. **For context:** the `-LazyMemory` write 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.yml` runs only for pull requests into `main`, 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.
JohnConnorNPC commented 2026-11-26 21:14:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-26T21:14:39Z.


Thanks for carrying these commits into cpp-migration. Your xmem_page_runs_device change is now in #2911 as ad1980cb, the same patch as f6020249 (same patch-id). Your linear_buffer_backing change 27778f4f is 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:

  • Each provider and interface that the executable asks the system runtime for is logged once with the runtime's answer, refusals included (x2w-runtime query <provider> iid <iid>: system runtime 0x...).
  • With 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.

  • On #2911's head 4a43a173 plus this patch, with the switches from #2911's "How to test", there were three finished runs:
    • With the full switch set, the menus were skipped. Watched on screen, the first two loading screens appeared, but the next set did not. The run ended at the start-up watchdog at 219.2 s.
    • The same with lazy commit off ended at the same watchdog at 207.3 s.
    • The same with a local shader-cache diagnostic ended at the same watchdog at 231.4 s.
  • Earlier runs: one on main 6ee878d8 stopped at the start-up watchdog at 52.2 s, like main without the patch. Two on a build of main with #2911's commits through the ReadFile/WriteFile retry ended at the same watchdog at 282.4 s and 204.3 s.

git apply --check passes on this PR's head 27778f4f, on cpp-migration 40365770, on 4a43a173 and on main 6ee878d8. To apply it from the repository root, run git apply proxy-fallback.diff.

proxy-fallback.diff
diff --git a/src/startup_stubs/runtime_proxy.cpp b/src/startup_stubs/runtime_proxy.cpp
index 7c9a1704..3b366bd5 100644
--- a/src/startup_stubs/runtime_proxy.cpp
+++ b/src/startup_stubs/runtime_proxy.cpp
@@ -322,11 +322,35 @@ void fill_slots(std::index_sequence<I...>)
     ((slot_table[I] = reinterpret_cast<void*>(&forward<static_cast<int>(I)>)), ...);
 }
 
+// Each (provider, interface) the title asks the system runtime for, logged once with the runtime's answer,
+// failures included: a refused area is otherwise invisible, since only answered providers are proxied.
+void log_query_once(const GUID* provider, const GUID* iid, HRESULT hr)
+{
+    if (!x2w_local::readable(provider, sizeof(*provider))) return;
+    const unsigned long iid1 = iid && x2w_local::readable(iid, sizeof(*iid)) ? iid->Data1 : 0;
+    static SRWLOCK lock = SRWLOCK_INIT;
+    static GUID seen[64][2];
+    static int count;
+    AcquireSRWLockExclusive(&lock);
+    bool fresh = count < 64;
+    for (int i = 0; i < count && fresh; ++i)
+        fresh = !(std::memcmp(&seen[i][0], provider, sizeof(GUID)) == 0 && seen[i][1].Data1 == iid1);
+    if (fresh) {
+        seen[count][0] = *provider;
+        seen[count][1].Data1 = iid1;
+        ++count;
+    }
+    ReleaseSRWLockExclusive(&lock);
+    if (fresh)
+        x2w_local::logf("x2w-runtime query %08lx iid %08lx: system runtime 0x%08lx", provider->Data1, iid1, static_cast<unsigned long>(hr));
+}
+
 HRESULT __stdcall proxy_query(const GUID* provider, const GUID* iid, void** out)
 {
     const QueryApi query = load_real_query();
     if (!query) return E_FAIL;
     const HRESULT hr = query(provider, iid, out);
+    log_query_once(provider, iid, hr);
     const bool output_writable = FAILED(hr) && fake_user() && x2w_local::writable(out, sizeof(*out));
     const bool pair_readable = output_writable && x2w_local::readable(provider, sizeof(*provider)) &&
                                x2w_local::readable(iid, sizeof(*iid));
@@ -338,7 +362,9 @@ HRESULT __stdcall proxy_query(const GUID* provider, const GUID* iid, void** out)
         return S_OK;
     }
     const ApiPair* local = nullptr;
-    if (output_writable && InterlockedCompareExchange(&local_active, 0, 0)) {
+    // With X2W_FAKE_USER (output_writable requires it), a refused area falls back to its local object
+    // even when the system runtime itself initialised.
+    if (output_writable) {
         *out = nullptr;
         if (!pair_readable) return hr;
         for (const auto& pair : local_pairs) {

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7203532722 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#issuecomment-7203532722). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-26T21:14:39Z. --- Thanks for carrying these commits into `cpp-migration`. Your `xmem_page_runs_device` change is now in #2911 as `ad1980cb`, the same patch as `f6020249` (same patch-id). Your `linear_buffer_backing` change `27778f4f` is 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`: - Each provider and interface that the executable asks the system runtime for is logged once with the runtime's answer, refusals included (`x2w-runtime query <provider> iid <iid>: system runtime 0x...`). - With `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`. - On #2911's head `4a43a173` plus this patch, with the switches from #2911's "How to test", there were three finished runs: - With the full switch set, the menus were skipped. Watched on screen, the first two loading screens appeared, but the next set did not. The run ended at the start-up watchdog at 219.2 s. - The same with lazy commit off ended at the same watchdog at 207.3 s. - The same with a local shader-cache diagnostic ended at the same watchdog at 231.4 s. - Earlier runs: one on `main` `6ee878d8` stopped at the start-up watchdog at 52.2 s, like `main` without the patch. Two on a build of `main` with #2911's commits through the `ReadFile`/`WriteFile` retry ended at the same watchdog at 282.4 s and 204.3 s. `git apply --check` passes on this PR's head `27778f4f`, on `cpp-migration` `40365770`, on `4a43a173` and on `main` `6ee878d8`. To apply it from the repository root, run `git apply proxy-fallback.diff`. <details><summary>proxy-fallback.diff</summary> ```diff diff --git a/src/startup_stubs/runtime_proxy.cpp b/src/startup_stubs/runtime_proxy.cpp index 7c9a1704..3b366bd5 100644 --- a/src/startup_stubs/runtime_proxy.cpp +++ b/src/startup_stubs/runtime_proxy.cpp @@ -322,11 +322,35 @@ void fill_slots(std::index_sequence<I...>) ((slot_table[I] = reinterpret_cast<void*>(&forward<static_cast<int>(I)>)), ...); } +// Each (provider, interface) the title asks the system runtime for, logged once with the runtime's answer, +// failures included: a refused area is otherwise invisible, since only answered providers are proxied. +void log_query_once(const GUID* provider, const GUID* iid, HRESULT hr) +{ + if (!x2w_local::readable(provider, sizeof(*provider))) return; + const unsigned long iid1 = iid && x2w_local::readable(iid, sizeof(*iid)) ? iid->Data1 : 0; + static SRWLOCK lock = SRWLOCK_INIT; + static GUID seen[64][2]; + static int count; + AcquireSRWLockExclusive(&lock); + bool fresh = count < 64; + for (int i = 0; i < count && fresh; ++i) + fresh = !(std::memcmp(&seen[i][0], provider, sizeof(GUID)) == 0 && seen[i][1].Data1 == iid1); + if (fresh) { + seen[count][0] = *provider; + seen[count][1].Data1 = iid1; + ++count; + } + ReleaseSRWLockExclusive(&lock); + if (fresh) + x2w_local::logf("x2w-runtime query %08lx iid %08lx: system runtime 0x%08lx", provider->Data1, iid1, static_cast<unsigned long>(hr)); +} + HRESULT __stdcall proxy_query(const GUID* provider, const GUID* iid, void** out) { const QueryApi query = load_real_query(); if (!query) return E_FAIL; const HRESULT hr = query(provider, iid, out); + log_query_once(provider, iid, hr); const bool output_writable = FAILED(hr) && fake_user() && x2w_local::writable(out, sizeof(*out)); const bool pair_readable = output_writable && x2w_local::readable(provider, sizeof(*provider)) && x2w_local::readable(iid, sizeof(*iid)); @@ -338,7 +362,9 @@ HRESULT __stdcall proxy_query(const GUID* provider, const GUID* iid, void** out) return S_OK; } const ApiPair* local = nullptr; - if (output_writable && InterlockedCompareExchange(&local_active, 0, 0)) { + // With X2W_FAKE_USER (output_writable requires it), a refused area falls back to its local object + // even when the system runtime itself initialised. + if (output_writable) { *out = nullptr; if (!pair_readable) return hr; for (const auto& pair : local_pairs) { ``` </details> This comment was AI-assisted.
JohnConnorNPC commented 2026-11-26 21:22:47 +00:00 (Migrated from github.com)

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: f6020249 as ad1980cb and 27778f4f as 238ed78a.

27778f4f is unmeasured on Windows: we have no run of linear_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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7203668627 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#issuecomment-7203668627). Originally posted by [JohnConnorNPC](https://github.com/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: `f6020249` as `ad1980cb` and `27778f4f` as `238ed78a`. `27778f4f` is unmeasured on Windows: we have no run of `linear_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.
MasterDomino commented 2026-11-26 21:23:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T21:23:36Z.


merging under my own discretion until Royoo isnt back

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7203681753 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#issuecomment-7203681753). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T21:23:36Z. --- merging under my own discretion until Royoo isnt back
MasterDomino commented 2026-11-26 21:45:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T21:45:40Z.


Reverting on cpp-migration in #2931. These are #2911's commits, and #2911 is still under review against main. A review of cpp-migration against main also lists them as a blocker for merging the branch. I merged this before #2911 had settled, which was a mistake. Once #2911 lands on main, merging main into cpp-migration brings in the reviewed version. @sydney-0o, your two fixture changes are with JC on #2911: f6020249 is in as ad1980cb, and 27778f4f is being considered with the review points.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7204033519 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#issuecomment-7204033519). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T21:45:40Z. --- Reverting on `cpp-migration` in #2931. These are #2911's commits, and #2911 is still under review against `main`. A review of `cpp-migration` against `main` also lists them as a blocker for merging the branch. I merged this before #2911 had settled, which was a mistake. Once #2911 lands on `main`, merging `main` into `cpp-migration` brings in the reviewed version. @sydney-0o, your two fixture changes are with JC on #2911: `f6020249` is in as `ad1980cb`, and `27778f4f` is being considered with the review points. AI-assisted.
MasterDomino commented 2026-11-26 21:52:31 +00:00 (Migrated from github.com)

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. PR 27778f4f against base cpp-migration 40365770. Counts only.

base, run 1 base, run 2 PR, run 1 PR, run 2
end timeout timeout timeout timeout
frames presented 10,412 10,219 10,420 10,213
storage requests done 11,547 11,439 11,548 11,482
textures uploaded 3,060 3,051 3,024 2,918
pipelines translated / missing 61 / 403 64 / 406 61 / 403 61 / 406
null bindings 6,953 7,622 26,809 10,867
— buffer 2,531 2,589 19,720 2,368
— token 4,422 4,996 7,089 8,499
second-chance exceptions / ring refusals 0 / 8 0 / 8 0 / 8 0 / 8
  • With shared views off, the always-on parts are the slot 31 fallback, the DirectStorage copy under the mutex, split-first and the fault-retry fixes. They change neither how far the run gets nor its speed, within run-to-run noise.
  • The burst of about 19,000 buffer nulls in the first PR run, between about 378 and 393 s, did not repeat. The second PR run's buffer nulls (2,368) match the base, so that burst was a one-off.
  • One difference shows in both pairs: token null bindings, 7,089 and 8,499 with the PR against 4,422 and 4,996 on the base, about 1.6 times as many. With two runs per side this is a hint, not a result. A token null is a binding whose descriptor token had nothing behind it at draw time. If the DirectStorage copy now waiting on memory.mutex delays 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7204145940 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2918#issuecomment-7204145940). Originally posted by [MasterDomino](https://github.com/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. PR `27778f4f` against base `cpp-migration` `40365770`. Counts only. | | base, run 1 | base, run 2 | PR, run 1 | PR, run 2 | |---|---|---|---|---| | end | timeout | timeout | timeout | timeout | | frames presented | 10,412 | 10,219 | 10,420 | 10,213 | | storage requests done | 11,547 | 11,439 | 11,548 | 11,482 | | textures uploaded | 3,060 | 3,051 | 3,024 | 2,918 | | pipelines translated / missing | 61 / 403 | 64 / 406 | 61 / 403 | 61 / 406 | | null bindings | 6,953 | 7,622 | 26,809 | 10,867 | | — buffer | 2,531 | 2,589 | 19,720 | 2,368 | | — token | 4,422 | 4,996 | 7,089 | 8,499 | | second-chance exceptions / ring refusals | 0 / 8 | 0 / 8 | 0 / 8 | 0 / 8 | - With shared views off, the always-on parts are the slot 31 fallback, the DirectStorage copy under the mutex, split-first and the fault-retry fixes. They change neither how far the run gets nor its speed, within run-to-run noise. - The burst of about 19,000 buffer nulls in the first PR run, between about 378 and 393 s, did not repeat. The second PR run's buffer nulls (2,368) match the base, so that burst was a one-off. - One difference shows in both pairs: **token** null bindings, 7,089 and 8,499 with the PR against 4,422 and 4,996 on the base, about 1.6 times as many. With two runs per side this is a hint, not a result. A token null is a binding whose descriptor token had nothing behind it at draw time. If the DirectStorage copy now waiting on `memory.mutex` delays 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.
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!2918
No description provided.