Memory: plan the coherent GPU heaps on the commit the page files can grow to #3546

Open
Chrysana wants to merge 1 commit from upstream-pr/3546 into main
Chrysana commented 2026-11-30 21:24:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-11-30T21:24:32Z.


XCL reads free commit as GlobalMemoryStatusEx's ullAvailPageFile, which counts each page file only at its current size. Windows grows a page file only when commit gets close to the current limit. So on a PC whose page files start small (the Windows default, or for example 2 GB growing to 16/32 GB), XCL reads a few GB free while much more is available. The check in uma.rs that puts the title's GPU heaps in the coherent window wants 17,408 MB of free commit at startup, so it keeps them out. This PR lets that one check count what each page file can still grow by: the heaps are planned once and live the whole run.

The compile gates keep reading the commit that is free now. They admit compiles that allocate side by side, and Windows can fail allocations when page-file growth lags behind concurrent demand (Microsoft). Under a job's commit limit the growth isn't counted either, because such a limit doesn't rise with the page files. Both follow thehollowedone's reviews below. Part of #2996, where the plan was posted first (comment).

What #2996 measured on a 32 GB PC with an RX 9070 XT (amd-dev and the hive recipe), with growable page files:

  • In the run where every page file started at 2 GB, Windows grew the commit limit from 44.4 to 60.9 GB during the run. XCL read a median of 1.7 GB free and kept the title's GPU heaps out of the coherent window.
  • In all 4 runs the throttle cut pipeline building to 1–2 workers, and presents stopped at world load. This PR does not change that throttle; see Not tested.

What is in it

  • crates/xcl/src/gpu/recomp/dxc.rs:
    • CommitSource { now, growth, job_limited }.
    • commit_free() is ullAvailPageFile, as on main.
    • The new commit_capacity() adds page_file_growth(). For each page file that's its maximum minus its current size, from NtQuerySystemInformation(SystemPageFileInformationEx), capped by the free space on its volume (GetDiskFreeSpaceExW), and 0 when either is unknown. The page files are logged once (commit: the page files can grow by N MB more than their size now (…)).
    • job_commit_limit(): if the process's immediate job sets JOB_OBJECT_LIMIT_PROCESS_MEMORY or JOB_OBJECT_LIMIT_JOB_MEMORY, no growth is added (logged once). ullAvailPageFile doesn't show job limits: on Windows 11 build 26200 a process in an 8 GB job read the system's 42 GB free.
    • wait_for_memory admits through wait_admitted, which reads only the current value.
    • 4 unit tests: growth from small page files; the volume cap, a fixed size, an unknown volume and a file over its maximum; a read of this machine's page files; and the gate boundary (2 GiB now, 20 GiB of growth, one background compile running: the second waits until 7 GiB are free now).
  • crates/xcl/src/gpu/uma.rs: heaps_window() takes the capacity query (dxc::commit_capacity). 1 test from CommitSource to the window: 4 GiB now and 20 GiB of growth give 4,095 MB outside a job and 512 MB under a job's limit; 17 GiB now is enough on its own; with no stored heaps there's no query.
  • crates/xcl/src/hle/d3d12x/real.rs: big_compile_commit_free() reads dxc::commit_free() instead of calling GlobalMemoryStatusEx itself. It's the same value as before.
  • Changing the gate to read capacity(), or capacity() to ignore the job limit, fails the matching test.

Tested

  • AMD Radeon RX 9070 XT 16 GB (driver 32.0.32015.2008), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 (stable-x86_64-pc-windows-msvc); debug build for the tests, release for the title runs
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on main d0832e61 merged with ae8050f1 (clean merge, git diff --check clean): 2887 passed, 9 failed, 51 ignored. On main d0832e61: 2882 passed, 9 failed, 51 ignored. The 5 more passes are this PR's tests. The same 8 tests fail on both, so they come from main on this card, not this PR: fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, gpu_smem_flat_descriptor_windows_and_limits, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random, gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, and the e2e two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (counted twice).
  • SKIPPED (6, the same on both): 2× no heap windows, 1× driver cache needs Windows Developer Mode, 3× no D3D12 debug layer
  • The page files read on this machine: C: 8,196 of 16,384 MB, D: 2,048 of 16,384 MB, X: 32,768 of 32,768 MB. Logged growth: 22,524 MB, which is (16,384 − 8,196) + (16,384 − 2,048) + 0.

Regression run

The page-file A/B on this head. Retail title, 60 s smoke runs, main and this PR alternated over 2 rounds, XCL_DIRECT_DXIL=1 on both sides: on AMD, current main crashes in AMD's shader compiler at ~43 s without it (#3544, fixed by #3455).

The page files on C: and D: can grow; X: is fixed at 32 GB. Before each run, a small helper held commit (VirtualAlloc(MEM_COMMIT), no RAM touched), so every run started at 11.4–12.3 GB of free commit. That's about what this PC has on a normal day with its usual programs open. The runs started from VS Code, inside a job with no memory limit.

run XCL's startup line frames peak commit
main ff0c364b r1 / r2 UMA: 12332 MB / 12164 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory (512 MB window) 1688 / crash at 56.7 s 17,168 / 18,424 MB
this PR ae8050f1 r1 / r2 commit: the page files can grow by 22524 MB more than their size now, then UMA opened (…, 4095 MB coherent window) 1687 / 1698 16,819 / 16,675 MB
  • main's r2 crash is in AMD's shader compiler (amdxc64.dll+0x85f80f, read at address 0x8). It hit the thread building graphics PSO 26aa07cb05c04290 (310,732 B DXIL). The PR's runs didn't get to that pipeline within 60 s, and neither did main's r1.
  • It isn't from this PR. On the previous head, cf7d80d2, it crashed main and this PR alike, 6 times. It went away after AMD's shader cache was cleared, and now it's back on the fresh cache as runs reach that pipeline again. So it's not a damaged cache, as I'd thought: AMD's compiler crashes on that pipeline. It's not #3544's address (+0x735dd8), and with XCL_DIRECT_DXIL=1 graphics pipelines stay on the HLSL path.

Under a job's commit limit, the same 60 s title run of this head in a job with a 37 GB JOB_OBJECT_LIMIT_JOB_MEMORY (XCL_PREPARE=0), at 11.6 GB free, logged:

commit: this process's job caps its commit (process 0 MB, job 37888 MB): the page files' growth is not counted for the GPU heaps
UMA: 11655 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window)

It got the 512 MB window and ended by itself (exit 0, job peak commit 16.9 GB).

xcl-smoke v1
commit: ff0c364b3de011c13ed45865480c21918a79ec89
gpu: AMD Radeon RX 9070 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1688 (PresentX 1688)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17168 MB
xcl-smoke v1
commit: ae8050f16375a210d3a3f12f56293d039cfe54bc
gpu: AMD Radeon RX 9070 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1687 (PresentX 1687)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16819 MB
xcl-smoke v1
commit: ff0c364b3de011c13ed45865480c21918a79ec89
gpu: AMD Radeon RX 9070 XT
title: 21222967
seconds: 60
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 2
peak commit: 18424 MB
xcl-smoke v1
commit: ae8050f16375a210d3a3f12f56293d039cfe54bc
gpu: AMD Radeon RX 9070 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1698 (PresentX 1698)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16675 MB

Not tested

  • A limit on an outer job when XCL runs in nested jobs: it can't be read from inside the process (QueryInformationJobObject with a null handle gives the immediate job), so the growth is still counted there. main doesn't see any job limit either.
  • The world-load effect: the runs above last 60 s. This PR leaves the compile gates and the build throttle on the commit that's free now, so the throttling #2996 saw with growable page files at world load isn't addressed here. Easing it would need its own measurements at world load.
  • Smoke runs with the default XCL_DIRECT_DXIL (#3544), NVIDIA, Windows 10, a PC with no page file, and page files on a volume whose free space can't be read (the code counts no growth there).
  • amd-dev: it reads free commit separately in uma.rs, pso_async.rs and flight.rs, so this PR doesn't reach it as is.

AI use

  • Claude Code (Claude Opus 5.5) wrote the code and the tests, ran the suite and the guarded title runs, and drafted this description. The gate/capacity split and the job-limit check follow thehollowedone's reviews. I read the diff and checked the results before pushing.
<!-- greyfinch-sync:ivall/xcl:issue:5574031859 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-11-30T21:24:32Z. --- XCL reads free commit as `GlobalMemoryStatusEx`'s `ullAvailPageFile`, which counts each page file only at its current size. Windows grows a page file only when commit gets close to the current limit. So on a PC whose page files start small (the Windows default, or for example 2 GB growing to 16/32 GB), XCL reads a few GB free while much more is available. The check in `uma.rs` that puts the title's GPU heaps in the coherent window wants 17,408 MB of free commit at startup, so it keeps them out. This PR lets that one check count what each page file can still grow by: the heaps are planned once and live the whole run. The compile gates keep reading the commit that is free now. They admit compiles that allocate side by side, and Windows can fail allocations when page-file growth lags behind concurrent demand ([Microsoft](https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/slow-page-file-growth-memory-allocation-errors)). Under a job's commit limit the growth isn't counted either, because such a limit doesn't rise with the page files. Both follow thehollowedone's reviews below. Part of #2996, where the plan was posted first ([comment](https://github.com/xcl-dev/xcl/issues/2996#issuecomment-7289476913)). What #2996 measured on a 32 GB PC with an RX 9070 XT (`amd-dev` and the hive recipe), with growable page files: - In the run where every page file started at 2 GB, Windows grew the commit limit from 44.4 to 60.9 GB during the run. XCL read a median of 1.7 GB free and kept the title's GPU heaps out of the coherent window. - In all 4 runs the throttle cut pipeline building to 1–2 workers, and presents stopped at world load. This PR does not change that throttle; see Not tested. **What is in it** - `crates/xcl/src/gpu/recomp/dxc.rs`: - `CommitSource { now, growth, job_limited }`. - `commit_free()` is `ullAvailPageFile`, as on `main`. - The new `commit_capacity()` adds `page_file_growth()`. For each page file that's its maximum minus its current size, from `NtQuerySystemInformation(SystemPageFileInformationEx)`, capped by the free space on its volume (`GetDiskFreeSpaceExW`), and 0 when either is unknown. The page files are logged once (`commit: the page files can grow by N MB more than their size now (…)`). - `job_commit_limit()`: if the process's immediate job sets `JOB_OBJECT_LIMIT_PROCESS_MEMORY` or `JOB_OBJECT_LIMIT_JOB_MEMORY`, no growth is added (logged once). `ullAvailPageFile` doesn't show job limits: on Windows 11 build 26200 a process in an 8 GB job read the system's 42 GB free. - `wait_for_memory` admits through `wait_admitted`, which reads only the current value. - 4 unit tests: growth from small page files; the volume cap, a fixed size, an unknown volume and a file over its maximum; a read of this machine's page files; and the gate boundary (2 GiB now, 20 GiB of growth, one background compile running: the second waits until 7 GiB are free now). - `crates/xcl/src/gpu/uma.rs`: `heaps_window()` takes the capacity query (`dxc::commit_capacity`). 1 test from `CommitSource` to the window: 4 GiB now and 20 GiB of growth give 4,095 MB outside a job and 512 MB under a job's limit; 17 GiB now is enough on its own; with no stored heaps there's no query. - `crates/xcl/src/hle/d3d12x/real.rs`: `big_compile_commit_free()` reads `dxc::commit_free()` instead of calling `GlobalMemoryStatusEx` itself. It's the same value as before. - Changing the gate to read `capacity()`, or `capacity()` to ignore the job limit, fails the matching test. **Tested** - AMD Radeon RX 9070 XT 16 GB (driver 32.0.32015.2008), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 (`stable-x86_64-pc-windows-msvc`); debug build for the tests, release for the title runs - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `main` `d0832e61` merged with `ae8050f1` (clean merge, `git diff --check` clean): **2887 passed, 9 failed, 51 ignored**. On `main` `d0832e61`: 2882 passed, 9 failed, 51 ignored. The 5 more passes are this PR's tests. The same 8 tests fail on both, so they come from `main` on this card, not this PR: `fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_3`, `gpu_smem_flat_descriptor_windows_and_limits`, `f32_programs_on_the_gpu`, `gpu_f32_compares_with_nan`, `gpu_float_compares_random`, `gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends`, and the e2e `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (counted twice). - SKIPPED (6, the same on both): 2× no heap windows, 1× driver cache needs Windows Developer Mode, 3× no D3D12 debug layer - The page files read on this machine: C: 8,196 of 16,384 MB, D: 2,048 of 16,384 MB, X: 32,768 of 32,768 MB. Logged growth: 22,524 MB, which is (16,384 − 8,196) + (16,384 − 2,048) + 0. **Regression run** The page-file A/B on this head. Retail title, 60 s smoke runs, `main` and this PR alternated over 2 rounds, `XCL_DIRECT_DXIL=1` on **both** sides: on AMD, current `main` crashes in AMD's shader compiler at ~43 s without it (#3544, fixed by #3455). The page files on C: and D: can grow; X: is fixed at 32 GB. Before each run, a small helper held commit (`VirtualAlloc(MEM_COMMIT)`, no RAM touched), so every run started at 11.4–12.3 GB of free commit. That's about what this PC has on a normal day with its usual programs open. The runs started from VS Code, inside a job with no memory limit. | run | XCL's startup line | frames | peak commit | |---|---|---|---| | `main` `ff0c364b` r1 / r2 | `UMA: 12332 MB` / `12164 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory` (512 MB window) | 1688 / crash at 56.7 s | 17,168 / 18,424 MB | | this PR `ae8050f1` r1 / r2 | `commit: the page files can grow by 22524 MB more than their size now`, then `UMA opened (…, 4095 MB coherent window)` | 1687 / 1698 | 16,819 / 16,675 MB | - **`main`'s r2 crash** is in AMD's shader compiler (`amdxc64.dll+0x85f80f`, read at address 0x8). It hit the thread building graphics PSO `26aa07cb05c04290` (310,732 B DXIL). The PR's runs didn't get to that pipeline within 60 s, and neither did `main`'s r1. - **It isn't from this PR.** On the previous head, `cf7d80d2`, it crashed `main` and this PR alike, 6 times. It went away after AMD's shader cache was cleared, and now it's back on the fresh cache as runs reach that pipeline again. So it's not a damaged cache, as I'd thought: AMD's compiler crashes on that pipeline. It's not #3544's address (`+0x735dd8`), and with `XCL_DIRECT_DXIL=1` graphics pipelines stay on the HLSL path. **Under a job's commit limit**, the same 60 s title run of this head in a job with a 37 GB `JOB_OBJECT_LIMIT_JOB_MEMORY` (`XCL_PREPARE=0`), at 11.6 GB free, logged: ``` commit: this process's job caps its commit (process 0 MB, job 37888 MB): the page files' growth is not counted for the GPU heaps UMA: 11655 MB of commit free, under 17408 MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window) ``` It got the 512 MB window and ended by itself (exit 0, job peak commit 16.9 GB). ``` xcl-smoke v1 commit: ff0c364b3de011c13ed45865480c21918a79ec89 gpu: AMD Radeon RX 9070 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1688 (PresentX 1688) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17168 MB ``` ``` xcl-smoke v1 commit: ae8050f16375a210d3a3f12f56293d039cfe54bc gpu: AMD Radeon RX 9070 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1687 (PresentX 1687) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16819 MB ``` ``` xcl-smoke v1 commit: ff0c364b3de011c13ed45865480c21918a79ec89 gpu: AMD Radeon RX 9070 XT title: 21222967 seconds: 60 exit: 0xc0000005 frames shown: none logged (the run did not reach its end) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 2 peak commit: 18424 MB ``` ``` xcl-smoke v1 commit: ae8050f16375a210d3a3f12f56293d039cfe54bc gpu: AMD Radeon RX 9070 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1698 (PresentX 1698) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16675 MB ``` **Not tested** - A limit on an outer job when XCL runs in nested jobs: it can't be read from inside the process (`QueryInformationJobObject` with a null handle gives the immediate job), so the growth is still counted there. `main` doesn't see any job limit either. - The world-load effect: the runs above last 60 s. This PR leaves the compile gates and the build throttle on the commit that's free now, so the throttling #2996 saw with growable page files at world load isn't addressed here. Easing it would need its own measurements at world load. - Smoke runs with the default `XCL_DIRECT_DXIL` (#3544), NVIDIA, Windows 10, a PC with no page file, and page files on a volume whose free space can't be read (the code counts no growth there). - `amd-dev`: it reads free commit separately in `uma.rs`, `pso_async.rs` and `flight.rs`, so this PR doesn't reach it as is. **AI use** - Claude Code (Claude Opus 5.5) wrote the code and the tests, ran the suite and the guarded title runs, and drafted this description. The gate/capacity split and the job-limit check follow thehollowedone's reviews. I read the diff and checked the results before pushing.
thehollowedone commented 2026-11-30 23:37:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-30T23:37:56Z.


merge-check
base: d0832e614f
head: 7bbc9573ef
merge: clean
build: cargo build --workspace -> not run after the focused finding
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run after the focused finding; SKIPPED: 0 in the focused runs. A test-only admission check on the unchanged head failed (0 passed, 1 failed, 0 ignored). With the local candidate below, cargo test --offline --locked -p xcl --lib memory_gate_tests --target-dir ..\target -- --test-threads=4 passed (7 passed, 0 failed, 0 ignored).
review: The new commit_free() adds possible future page-file growth to ullAvailPageFile for every caller. That estimate is useful when planning the coherent GPU heap, but wait_for_memory, big_slots, and the driver compile gates use it to admit concurrent allocations now. In the synthetic gate check, one background DXC compile was active, current headroom was 2 GiB, and the page file could grow by 20 GiB. The unchanged head admitted a second background compile despite a 6 GiB reserve; with this estimate, it can admit many more before the file grows. Microsoft documents allocation failures when page-file growth lags concurrent demand. Keep current commit headroom for compile admission and the growth-aware capacity for long-lived heap planning. Add a regression at the query-to-gate boundary that supplies both values, so the second background worker waits until current headroom reaches the threshold. I read the full three-file diff. A title run and an actual allocation-failure reproduction remain untested.
performance: Reasoned risk of additional concurrent compile memory pressure; no frame-time, world-load, or memory delta was measured. The candidate preserves the growth-aware UMA decision.
verdict: not yet: future page-file capacity is used as immediately available commit for parallel compile admission.
hardware / tool and model: NVIDIA RTX 3080 Ti (621.40), Ryzen 7 9800X3D, Windows build 26300, rustc 1.99.1 / OpenAI Codex (GPT-6.2 Sol) traced and tested the candidate; OpenAI Codex (GPT-6.2 Astra) independently checked the memory-budget contract.

Local candidate diff against the PR head
diff --git a/crates/xcl/src/gpu/recomp/dxc.rs b/crates/xcl/src/gpu/recomp/dxc.rs
@@
-/// Commit that can still be had, the page files' growth included ([`avail_page_file`]), or
-/// `None` if the query fails.
+/// Commit currently available to this process, or `None` if the query fails.
 pub fn commit_free() -> Option<u64> {
     avail_page_file()
 }

+/// Commit capacity after page-file growth, for planning long-lived GPU heaps.
+pub fn commit_capacity() -> Option<u64> {
+    avail_page_file().map(|now| now.saturating_add(page_file_growth()))
+}
@@
-/// Available page-file commit bytes from Windows, or `None` if the query fails: what is free
-/// against the page files' current size (`ullAvailPageFile`) and what they can still grow by
-/// (`page_file_growth`). Windows grows a page file when a commit needs it, so with page files that
-/// start small (the default, and a 2 GB start with a 16 GB maximum) `ullAvailPageFile` alone read
-/// a few GB free on a 32 GB PC while over 20 GB more could be had: the title's GPU heaps stayed
-/// out of the coherent window (`uma`) and the compiles it waited for stood at these gates.
+/// Available commit from Windows at the page files' current size, or `None` on query failure.
 fn avail_page_file() -> Option<u64> {
@@
-    (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then(|| m.ullAvailPageFile.saturating_add(page_file_growth()))
+    (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
diff --git a/crates/xcl/src/gpu/uma.rs b/crates/xcl/src/gpu/uma.rs
@@
-/// Commit that can still be had, the page files' growth included (`dxc::commit_free`).
+/// Commit capacity including possible page-file growth (`dxc::commit_capacity`).
 fn free_commit() -> usize {
-    crate::gpu::recomp::dxc::commit_free().map_or(usize::MAX, |b| b as usize)
+    crate::gpu::recomp::dxc::commit_capacity().map_or(usize::MAX, |b| b as usize)
 }
diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
@@
-/// That much commit is free, the page files' growth included (true when that is not known).
+/// That much commit is free now (true when that is not known).
<!-- greyfinch-sync:ivall/xcl:comment:7295348166 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7295348166). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-30T23:37:56Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: 7bbc9573efcdbc75d83f6ad04bd94da6901d5d62 merge: clean build: cargo build --workspace -> not run after the focused finding tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run after the focused finding; SKIPPED: 0 in the focused runs. A test-only admission check on the unchanged head failed (0 passed, 1 failed, 0 ignored). With the local candidate below, `cargo test --offline --locked -p xcl --lib memory_gate_tests --target-dir ..\target -- --test-threads=4` passed (7 passed, 0 failed, 0 ignored). review: The new `commit_free()` adds possible future page-file growth to `ullAvailPageFile` for every caller. That estimate is useful when planning the coherent GPU heap, but `wait_for_memory`, `big_slots`, and the driver compile gates use it to admit concurrent allocations now. In the synthetic gate check, one background DXC compile was active, current headroom was 2 GiB, and the page file could grow by 20 GiB. The unchanged head admitted a second background compile despite a 6 GiB reserve; with this estimate, it can admit many more before the file grows. [Microsoft documents allocation failures when page-file growth lags concurrent demand](https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/slow-page-file-growth-memory-allocation-errors). Keep current commit headroom for compile admission and the growth-aware capacity for long-lived heap planning. Add a regression at the query-to-gate boundary that supplies both values, so the second background worker waits until current headroom reaches the threshold. I read the full three-file diff. A title run and an actual allocation-failure reproduction remain untested. performance: Reasoned risk of additional concurrent compile memory pressure; no frame-time, world-load, or memory delta was measured. The candidate preserves the growth-aware UMA decision. verdict: not yet: future page-file capacity is used as immediately available commit for parallel compile admission. hardware / tool and model: NVIDIA RTX 3080 Ti (621.40), Ryzen 7 9800X3D, Windows build 26300, rustc 1.99.1 / OpenAI Codex (GPT-6.2 Sol) traced and tested the candidate; OpenAI Codex (GPT-6.2 Astra) independently checked the memory-budget contract. <details> <summary>Local candidate diff against the PR head</summary> ```diff diff --git a/crates/xcl/src/gpu/recomp/dxc.rs b/crates/xcl/src/gpu/recomp/dxc.rs @@ -/// Commit that can still be had, the page files' growth included ([`avail_page_file`]), or -/// `None` if the query fails. +/// Commit currently available to this process, or `None` if the query fails. pub fn commit_free() -> Option<u64> { avail_page_file() } +/// Commit capacity after page-file growth, for planning long-lived GPU heaps. +pub fn commit_capacity() -> Option<u64> { + avail_page_file().map(|now| now.saturating_add(page_file_growth())) +} @@ -/// Available page-file commit bytes from Windows, or `None` if the query fails: what is free -/// against the page files' current size (`ullAvailPageFile`) and what they can still grow by -/// (`page_file_growth`). Windows grows a page file when a commit needs it, so with page files that -/// start small (the default, and a 2 GB start with a 16 GB maximum) `ullAvailPageFile` alone read -/// a few GB free on a 32 GB PC while over 20 GB more could be had: the title's GPU heaps stayed -/// out of the coherent window (`uma`) and the compiles it waited for stood at these gates. +/// Available commit from Windows at the page files' current size, or `None` on query failure. fn avail_page_file() -> Option<u64> { @@ - (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then(|| m.ullAvailPageFile.saturating_add(page_file_growth())) + (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } diff --git a/crates/xcl/src/gpu/uma.rs b/crates/xcl/src/gpu/uma.rs @@ -/// Commit that can still be had, the page files' growth included (`dxc::commit_free`). +/// Commit capacity including possible page-file growth (`dxc::commit_capacity`). fn free_commit() -> usize { - crate::gpu::recomp::dxc::commit_free().map_or(usize::MAX, |b| b as usize) + crate::gpu::recomp::dxc::commit_capacity().map_or(usize::MAX, |b| b as usize) } diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs @@ -/// That much commit is free, the page files' growth included (true when that is not known). +/// That much commit is free now (true when that is not known). ``` </details>
Chrysana commented 2026-12-01 03:26:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T03:26:15Z.


Thanks, @thehollowedone, agreed. Counting growth that hasn't happened yet is right for the one-time heap plan but not for admitting compiles side by side. I adopted your split and squashed it into the one commit; new head cf7d80d2:

  • dxc::commit_free() is current headroom again (ullAvailPageFile alone). wait_for_memory, big_slots, pieces_at_once and the driver-compile and build-ahead checks through big_compile_commit_free admit on it, as on main.
  • New dxc::commit_capacity(): current headroom plus the page files' growth. Only uma::free_commit reads it, for the coherent-heap decision.
  • Regression at the query-to-gate boundary: wait_for_memory now goes through wait_admitted(gate, source, …), which takes a CommitSource { now, growth } and admits on now only. a_background_compile_waits_for_commit_free_now_not_the_page_files_growth supplies 2 GiB now and 20 GiB of growth, with one background compile running and a 6 GiB reserve. The second compile waits, then goes in once 7 GiB are free now. With wait_admitted reading capacity() instead, the test fails ("a second background compile went in on page-file growth that had not happened").

I updated the description with the suite, the page-file A/B and the regression runs on the new head. The A/B shows the split keeps the fix: the PR still gets the 4,095 MB coherent window at 11.5–11.9 GB free, where main stays at 512 MB. During the regression runs, main and this PR both started crashing in amdxc64.dll (+0x85f80f) compiling the same graphics PSO, main first. That's not #3544's address. After AMD's shader cache was moved aside, 3 more rounds ran clean on both sides. The details are in the description.

<!-- greyfinch-sync:ivall/xcl:comment:7299703524 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7299703524). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-01T03:26:15Z. --- Thanks, @thehollowedone, agreed. Counting growth that hasn't happened yet is right for the one-time heap plan but not for admitting compiles side by side. I adopted your split and squashed it into the one commit; new head `cf7d80d2`: - `dxc::commit_free()` is current headroom again (`ullAvailPageFile` alone). `wait_for_memory`, `big_slots`, `pieces_at_once` and the driver-compile and build-ahead checks through `big_compile_commit_free` admit on it, as on `main`. - New `dxc::commit_capacity()`: current headroom plus the page files' growth. Only `uma::free_commit` reads it, for the coherent-heap decision. - Regression at the query-to-gate boundary: `wait_for_memory` now goes through `wait_admitted(gate, source, …)`, which takes a `CommitSource { now, growth }` and admits on `now` only. `a_background_compile_waits_for_commit_free_now_not_the_page_files_growth` supplies 2 GiB now and 20 GiB of growth, with one background compile running and a 6 GiB reserve. The second compile waits, then goes in once 7 GiB are free now. With `wait_admitted` reading `capacity()` instead, the test fails ("a second background compile went in on page-file growth that had not happened"). I updated the description with the suite, the page-file A/B and the regression runs on the new head. The A/B shows the split keeps the fix: the PR still gets the 4,095 MB coherent window at 11.5–11.9 GB free, where `main` stays at 512 MB. During the regression runs, `main` and this PR both started crashing in `amdxc64.dll` (+0x85f80f) compiling the same graphics PSO, `main` first. That's not #3544's address. After AMD's shader cache was moved aside, 3 more rounds ran clean on both sides. The details are in the description.
thehollowedone commented 2026-12-01 04:00:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T04:00:26Z.


One process-limit boundary remains on head cf7d80d2. CommitSource::capacity() adds system page-file growth to GlobalMemoryStatusEx().ullAvailPageFile. Microsoft defines that field as the maximum this process can still commit, which may be smaller than system-wide headroom; a hard job memory limit does not rise when a page file grows. For example, if a process has 4 GiB left under such a limit and the system page files could grow by 20 GiB, this calculation returns 24 GiB although the process can still commit only 4 GiB. coherent_hint_for can then clear its 17 GiB threshold and choose a coherent GPU-heap window the process cannot back.

Please cap growth-aware capacity by any remaining hard process/job commit limit, or conservatively use current process headroom when that limit is present; keep the page-file growth benefit for unrestricted processes. A synthetic query-to-routing regression can supply 4 GiB process headroom, 20 GiB system growth and a hard job limit, then check that the coherent window does not take the growth path. A control without the hard limit should retain it. This is an API-contract/source finding, not an observed allocation failure on this head. Microsoft's ullAvailPageFile definition

AI use: Codex (GPT-6.2 Sol) checked the PR call path and Microsoft documentation; Codex (GPT-6.2 Astra) independently checked the process-limit case.

<!-- greyfinch-sync:ivall/xcl:comment:7300282852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300282852). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T04:00:26Z. --- One process-limit boundary remains on [head `cf7d80d2`](https://github.com/xcl-dev/xcl/commit/cf7d80d2fa9f7a460d55527dfb83bfadf08059ca). [`CommitSource::capacity()`](https://github.com/xcl-dev/xcl/blob/cf7d80d2fa9f7a460d55527dfb83bfadf08059ca/crates/xcl/src/gpu/recomp/dxc.rs#L785-L797) adds system page-file growth to `GlobalMemoryStatusEx().ullAvailPageFile`. Microsoft defines that field as the maximum **this process** can still commit, which may be smaller than system-wide headroom; a [hard job memory limit](https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information) does not rise when a page file grows. For example, if a process has 4 GiB left under such a limit and the system page files could grow by 20 GiB, this calculation returns 24 GiB although the process can still commit only 4 GiB. [`coherent_hint_for`](https://github.com/xcl-dev/xcl/blob/cf7d80d2fa9f7a460d55527dfb83bfadf08059ca/crates/xcl/src/gpu/uma.rs#L1067-L1088) can then clear its 17 GiB threshold and choose a coherent GPU-heap window the process cannot back. Please cap growth-aware capacity by any remaining hard process/job commit limit, or conservatively use current process headroom when that limit is present; keep the page-file growth benefit for unrestricted processes. A synthetic query-to-routing regression can supply 4 GiB process headroom, 20 GiB system growth and a hard job limit, then check that the coherent window does not take the growth path. A control without the hard limit should retain it. This is an API-contract/source finding, not an observed allocation failure on this head. [Microsoft's `ullAvailPageFile` definition](https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex) AI use: Codex (GPT-6.2 Sol) checked the PR call path and Microsoft documentation; Codex (GPT-6.2 Astra) independently checked the process-limit case.
thehollowedone commented 2026-12-01 04:10:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T04:10:15Z.


One refinement to my process-limit note on head cf7d80d2: checking only QueryInformationJobObject(NULL, JobObjectExtendedLimitInformation) would miss a cap on an ancestor job. Microsoft says the null handle selects the process's immediate job, while nested jobs inherit the most restrictive applicable commit limit.

For a conservative fix that preserves growth-aware planning for processes outside jobs, use IsProcessInJob with a null job handle to detect any job. If it reports membership, use current process headroom for the heap decision unless an effective cap for the full job chain is known; otherwise retain the page-file growth estimate. A focused regression should cover an unconstrained immediate child job under a memory-limited parent, as well as a process outside a job. This is a source/API-contract follow-up; I did not run that nested-job regression.

AI use: Codex (GPT-6.2 Sol) checked the Windows API contracts and drafted this note.

<!-- greyfinch-sync:ivall/xcl:comment:7300451362 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300451362). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T04:10:15Z. --- One refinement to my [process-limit note](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300282852) on head [`cf7d80d2`](https://github.com/xcl-dev/xcl/commit/cf7d80d2fa9f7a460d55527dfb83bfadf08059ca): checking only `QueryInformationJobObject(NULL, JobObjectExtendedLimitInformation)` would miss a cap on an ancestor job. [Microsoft says the null handle selects the process's **immediate** job](https://learn.microsoft.com/en-us/windows/win32/api/jobapi2/nf-jobapi2-queryinformationjobobject), while [nested jobs inherit the most restrictive applicable commit limit](https://learn.microsoft.com/en-us/windows/win32/procthread/nested-jobs). For a conservative fix that preserves growth-aware planning for processes outside jobs, use [IsProcessInJob with a null job handle](https://learn.microsoft.com/en-us/windows/win32/api/jobapi/nf-jobapi-isprocessinjob) to detect **any** job. If it reports membership, use current process headroom for the heap decision unless an effective cap for the full job chain is known; otherwise retain the page-file growth estimate. A focused regression should cover an unconstrained immediate child job under a memory-limited parent, as well as a process outside a job. This is a source/API-contract follow-up; I did not run that nested-job regression. AI use: Codex (GPT-6.2 Sol) checked the Windows API contracts and drafted this note.
Chrysana commented 2026-12-01 04:35:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T04:35:24Z.


Thanks for both notes. I checked the API contract on this PC before changing anything, and it doesn't hold here. On Windows 11 build 26200, ullAvailPageFile doesn't show job limits:

process ullAvailPageFile system free commit (GetPerformanceInfo)
started from VS Code (already in a job, no memory limit) 42.4 GB 42.4 GB
in a job with an 8 GB JOB_OBJECT_LIMIT_JOB_MEMORY 42.6 GB 42.6 GB
in an unlimited job nested under that 8 GB job 42.6 GB 42.6 GB
in a job with an 8 GB JOB_OBJECT_LIMIT_PROCESS_MEMORY 42.6 GB 42.6 GB

So main's check already reads the system figure inside a job: an 8 GB job reads 42 GB, clears 17 GB and takes the window. Nothing in XCL sees a job limit today, and falling back to current headroom wouldn't respect one either.

On IsProcessInJob: everything started from VS Code here is in a job (pwsh ← cmd ← the IDE, breakaway allowed, no memory limit). Only processes started from Explorer are in none, and all my A/B runs ran inside such a job. Dropping the growth for any job would turn the fix off for IDE terminals and launchers that use jobs, without making the limited case right.

So head ae8050f1 takes the part that can be read from inside the process:

  • dxc::job_commit_limit(): if the immediate job (QueryInformationJobObject with a null handle) sets JOB_OBJECT_LIMIT_PROCESS_MEMORY or JOB_OBJECT_LIMIT_JOB_MEMORY, commit_capacity() adds no growth, and that's logged. A limit on an outer job of nested jobs can't be read from inside, as you say. I haven't written the nested-job regression, because the code can't detect that case; it's listed under Not tested. Honouring job limits in every gate (capping by what the job has left) would be its own change.
  • Query-to-routing regression: uma::heaps_window() now takes the capacity query. a_job_commit_limit_keeps_the_gpu_heaps_off_the_page_files_growth goes from CommitSource to the window: 4 GiB now and 20 GiB of growth give 4,095 MB outside a job and 512 MB under a job limit. It fails when capacity() ignores the limit.
  • On the retail title, inside a 37 GB JOB_MEMORY job at 11.6 GB free, the log shows commit: this process's job caps its commit (process 0 MB, job 37888 MB): the page files' growth is not counted for the GPU heaps, then the 512 MB window. Outside a job at the same free commit, this head takes 4,095 MB (A/B in the description).

The description is updated for the new head.

<!-- greyfinch-sync:ivall/xcl:comment:7300888293 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300888293). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-01T04:35:24Z. --- Thanks for both notes. I checked the API contract on this PC before changing anything, and it doesn't hold here. On Windows 11 build 26200, `ullAvailPageFile` doesn't show job limits: | process | `ullAvailPageFile` | system free commit (`GetPerformanceInfo`) | |---|---|---| | started from VS Code (already in a job, no memory limit) | 42.4 GB | 42.4 GB | | in a job with an 8 GB `JOB_OBJECT_LIMIT_JOB_MEMORY` | 42.6 GB | 42.6 GB | | in an unlimited job nested under that 8 GB job | 42.6 GB | 42.6 GB | | in a job with an 8 GB `JOB_OBJECT_LIMIT_PROCESS_MEMORY` | 42.6 GB | 42.6 GB | So `main`'s check already reads the system figure inside a job: an 8 GB job reads 42 GB, clears 17 GB and takes the window. Nothing in XCL sees a job limit today, and falling back to current headroom wouldn't respect one either. On `IsProcessInJob`: everything started from VS Code here is in a job (pwsh ← cmd ← the IDE, breakaway allowed, no memory limit). Only processes started from Explorer are in none, and all my A/B runs ran inside such a job. Dropping the growth for any job would turn the fix off for IDE terminals and launchers that use jobs, without making the limited case right. So head `ae8050f1` takes the part that can be read from inside the process: - `dxc::job_commit_limit()`: if the immediate job (`QueryInformationJobObject` with a null handle) sets `JOB_OBJECT_LIMIT_PROCESS_MEMORY` or `JOB_OBJECT_LIMIT_JOB_MEMORY`, `commit_capacity()` adds no growth, and that's logged. A limit on an outer job of nested jobs can't be read from inside, as you say. I haven't written the nested-job regression, because the code can't detect that case; it's listed under Not tested. Honouring job limits in every gate (capping by what the job has left) would be its own change. - Query-to-routing regression: `uma::heaps_window()` now takes the capacity query. `a_job_commit_limit_keeps_the_gpu_heaps_off_the_page_files_growth` goes from `CommitSource` to the window: 4 GiB now and 20 GiB of growth give 4,095 MB outside a job and 512 MB under a job limit. It fails when `capacity()` ignores the limit. - On the retail title, inside a 37 GB `JOB_MEMORY` job at 11.6 GB free, the log shows `commit: this process's job caps its commit (process 0 MB, job 37888 MB): the page files' growth is not counted for the GPU heaps`, then the 512 MB window. Outside a job at the same free commit, this head takes 4,095 MB (A/B in the description). The description is updated for the new head.
thehollowedone commented 2026-12-01 04:58:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T04:58:01Z.


On head ae8050f1, the new compile-admission regression depends on the waiter thread running during a 300 ms sleep. If the worker starts after now rises to 7 GiB, even a regressed wait_admitted that admits on page-file growth can pass. This is a test coverage issue; I found no new production-path defect in this review.

The fake commit query can return 2 GiB on its first call and 7 GiB on its second. That makes the rejected first attempt and later admission deterministic without another thread. A growth closure that panics also catches an accidental switch from free() to capacity(). The candidate below is source-reviewed, not run.

Candidate test-only diff
diff --git a/crates/xcl/src/gpu/recomp/dxc.rs b/crates/xcl/src/gpu/recomp/dxc.rs
@@ fn a_background_compile_waits_for_commit_free_now_not_the_page_files_growth() {
-        use std::sync::atomic::AtomicU64;
+        use std::cell::Cell;
         let gate = MemoryGate::new();
         let reserve = 6 * GB;
-        let now = AtomicU64::new(2 * GB);
-        let source = CommitSource { now: || Some(now.load(Ordering::SeqCst)), growth: || 20 * GB, job_limited: || false };
-        assert_eq!(source.capacity(), Some(22 * GB));
+        let plan = CommitSource { now: || Some(2 * GB), growth: || 20 * GB, job_limited: || false };
+        assert_eq!(plan.capacity(), Some(22 * GB));
         let unwanted: Wanted = Box::new(|| false);
-        assert!(gate.try_admit(reserve, || source.free(), false, &unwanted), "the first compile goes in with none running");
-        let admitted = AtomicBool::new(false);
-        let early = std::thread::scope(|s| {
-            s.spawn(|| {
-                let unwanted: Wanted = Box::new(|| false);
-                wait_admitted(&gate, &source, reserve, Duration::from_secs(60), &unwanted);
-                admitted.store(true, Ordering::SeqCst);
-            });
-            std::thread::sleep(Duration::from_millis(300));
-            let early = admitted.load(Ordering::SeqCst);
-            now.store(7 * GB, Ordering::SeqCst);
-            early
-        });
-        assert!(!early, "a second background compile went in on page-file growth that had not happened");
-        assert!(admitted.load(Ordering::SeqCst), "it goes in once 7 GB are free now");
+        assert!(gate.try_admit(reserve, || Some(2 * GB), false, &unwanted));
+        let reads = Cell::new(0);
+        let source = CommitSource {
+            now: || {
+                let n = reads.get();
+                reads.set(n + 1);
+                Some(if n == 0 { 2 * GB } else { 7 * GB })
+            },
+            growth: || panic!("compile admission must not read future page-file growth"),
+            job_limited: || false,
+        };
+        wait_admitted(&gate, &source, reserve, Duration::from_secs(60), &unwanted);
+        assert_eq!(reads.get(), 2, "reject 2 GiB now, then admit at 7 GiB now");
         assert_eq!(gate.working.load(Ordering::SeqCst), 2);

AI use: OpenAI Codex (GPT-6.2 Astra) identified the scheduling gap; OpenAI Codex (GPT-6.2 Sol) checked the admission path and prepared this suggestion.

<!-- greyfinch-sync:ivall/xcl:comment:7301284352 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7301284352). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T04:58:01Z. --- On head [`ae8050f1`](https://github.com/xcl-dev/xcl/commit/ae8050f16375a210d3a3f12f56293d039cfe54bc), the new compile-admission regression depends on the waiter thread running during a 300 ms sleep. If the worker starts after `now` rises to 7 GiB, even a regressed `wait_admitted` that admits on page-file growth can pass. This is a test coverage issue; I found no new production-path defect in this review. The fake commit query can return 2 GiB on its first call and 7 GiB on its second. That makes the rejected first attempt and later admission deterministic without another thread. A growth closure that panics also catches an accidental switch from `free()` to `capacity()`. The candidate below is source-reviewed, not run. <details> <summary>Candidate test-only diff</summary> ```diff diff --git a/crates/xcl/src/gpu/recomp/dxc.rs b/crates/xcl/src/gpu/recomp/dxc.rs @@ fn a_background_compile_waits_for_commit_free_now_not_the_page_files_growth() { - use std::sync::atomic::AtomicU64; + use std::cell::Cell; let gate = MemoryGate::new(); let reserve = 6 * GB; - let now = AtomicU64::new(2 * GB); - let source = CommitSource { now: || Some(now.load(Ordering::SeqCst)), growth: || 20 * GB, job_limited: || false }; - assert_eq!(source.capacity(), Some(22 * GB)); + let plan = CommitSource { now: || Some(2 * GB), growth: || 20 * GB, job_limited: || false }; + assert_eq!(plan.capacity(), Some(22 * GB)); let unwanted: Wanted = Box::new(|| false); - assert!(gate.try_admit(reserve, || source.free(), false, &unwanted), "the first compile goes in with none running"); - let admitted = AtomicBool::new(false); - let early = std::thread::scope(|s| { - s.spawn(|| { - let unwanted: Wanted = Box::new(|| false); - wait_admitted(&gate, &source, reserve, Duration::from_secs(60), &unwanted); - admitted.store(true, Ordering::SeqCst); - }); - std::thread::sleep(Duration::from_millis(300)); - let early = admitted.load(Ordering::SeqCst); - now.store(7 * GB, Ordering::SeqCst); - early - }); - assert!(!early, "a second background compile went in on page-file growth that had not happened"); - assert!(admitted.load(Ordering::SeqCst), "it goes in once 7 GB are free now"); + assert!(gate.try_admit(reserve, || Some(2 * GB), false, &unwanted)); + let reads = Cell::new(0); + let source = CommitSource { + now: || { + let n = reads.get(); + reads.set(n + 1); + Some(if n == 0 { 2 * GB } else { 7 * GB }) + }, + growth: || panic!("compile admission must not read future page-file growth"), + job_limited: || false, + }; + wait_admitted(&gate, &source, reserve, Duration::from_secs(60), &unwanted); + assert_eq!(reads.get(), 2, "reject 2 GiB now, then admit at 7 GiB now"); assert_eq!(gate.working.load(Ordering::SeqCst), 2); ``` </details> AI use: OpenAI Codex (GPT-6.2 Astra) identified the scheduling gap; OpenAI Codex (GPT-6.2 Sol) checked the admission path and prepared this suggestion.
thehollowedone commented 2026-12-01 05:14:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T05:14:28Z.


Correction to my process-limit note and follow-up: I inferred that GlobalMemoryStatusEx().ullAvailPageFile reflected the process's remaining job-memory allowance. The author's measured probes show that it continued to report system-wide free commit inside both process-limited and job-limited jobs, including a nested job. My proposed fallback to ullAvailPageFile for every job would therefore not enforce those limits, and would discard the page-file-growth benefit for jobs with no memory cap. Please disregard that recommendation.

Current head ae8050f1 instead detects the limits it can query on the immediate job and scopes the growth estimate accordingly. An inherited limit on an outer job remains a documented limitation, not a failure I reproduced. My separate compile-admission test finding is unaffected; it concerns whether that regression test can pass without exercising its intended low-headroom state.

AI use: OpenAI Codex (GPT-6.2 Sol) rechecked the thread and corrected its earlier inference.

<!-- greyfinch-sync:ivall/xcl:comment:7301563389 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7301563389). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T05:14:28Z. --- Correction to my [process-limit note](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300282852) and [follow-up](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300451362): I inferred that `GlobalMemoryStatusEx().ullAvailPageFile` reflected the process's remaining job-memory allowance. [The author's measured probes](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7300888293) show that it continued to report system-wide free commit inside both process-limited and job-limited jobs, including a nested job. My proposed fallback to `ullAvailPageFile` for every job would therefore **not** enforce those limits, and would discard the page-file-growth benefit for jobs with no memory cap. Please disregard that recommendation. Current head `ae8050f1` instead detects the limits it can query on the immediate job and scopes the growth estimate accordingly. An inherited limit on an outer job remains a documented limitation, not a failure I reproduced. My separate [compile-admission test finding](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7301284352) is unaffected; it concerns whether that regression test can pass without exercising its intended low-headroom state. AI use: OpenAI Codex (GPT-6.2 Sol) rechecked the thread and corrected its earlier inference.
Foniass commented 2026-12-01 08:03:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:03:33Z.


merge-check
base: 7d86c5d2b7
head: ae8050f163
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (dxc.rs, uma.rs, real.rs). "Can grow to" is current free commit (ullAvailPageFile) plus, per page file, its maximum minus its current size capped by free space on its volume (NtQuerySystemInformation(SystemPageFileInformationEx)), with no growth counted inside a memory-limited job. It changes the default path only for the heap plan: on a PC whose page files are small now but can grow, the coherent window goes from 512 MB to the title's stored need plus 512 MB (up to 4095 MB at 24 GB of RAM or more, RAM/8 below that); the compile gates still read free commit as on main. Findings: (1) from reading, not measured: this doesn't add commit (the PR's runs peak about where main's does), but the window grows, and per auto_coherent_cap's comment Windows keeps that window resident in RAM, so PCs under 24 GB with small growable page files are the ones whose behaviour changes most, while all the PR's runs are on 32 GB; a 16 GB run or a Not tested line would cover it. (2) uma.rs ~1087-1091 still labels the number "MB of commit free" while outside a job it includes the growth. (3) The thread-timing gap in a_background_compile_waits_for_commit_free_now_not_the_page_files_growth that a reviewer raised is still open on this head. (4) #632 edits the same block and calls free_commit(), which this removes, so whichever lands second needs a rebase. Fine: the SYSTEM_PAGEFILE_INFORMATION_EX layout (40 bytes, info class 144), sizes in pages, an empty result when the buffer is too small or the volume is unknown, the compile gates and big_compile_commit_free still on ullAvailPageFile, and the immediate-job query.
performance: 60 s smoke of a retail title, main 7d86c5d2 vs this merge (2b5a13ad): 1663 -> 1666 frames shown (100 %; last presents per 2 s: 60 60 61), peak commit 17153 -> 18768 MB, 0 device removals, 0 crashes. Peak commit is about 1.6 GB above main here (109 %), consistent with a larger coherent window on this 32 GB machine.
verdict: safe to merge (a run on a PC under 24 GB of RAM, or a Not tested line, would cover the case that changes most; the log label should say the number includes page-file growth)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7304819590 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7304819590). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:03:33Z. --- merge-check base: 7d86c5d2b7845695031eeea1327aa81b6c439323 head: ae8050f16375a210d3a3f12f56293d039cfe54bc merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (dxc.rs, uma.rs, real.rs). "Can grow to" is current free commit (`ullAvailPageFile`) plus, per page file, its maximum minus its current size capped by free space on its volume (`NtQuerySystemInformation(SystemPageFileInformationEx)`), with no growth counted inside a memory-limited job. It changes the default path only for the heap plan: on a PC whose page files are small now but can grow, the coherent window goes from 512 MB to the title's stored need plus 512 MB (up to 4095 MB at 24 GB of RAM or more, RAM/8 below that); the compile gates still read free commit as on main. Findings: (1) from reading, not measured: this doesn't add commit (the PR's runs peak about where main's does), but the window grows, and per `auto_coherent_cap`'s comment Windows keeps that window resident in RAM, so PCs under 24 GB with small growable page files are the ones whose behaviour changes most, while all the PR's runs are on 32 GB; a 16 GB run or a Not tested line would cover it. (2) `uma.rs` ~1087-1091 still labels the number "MB of commit free" while outside a job it includes the growth. (3) The thread-timing gap in `a_background_compile_waits_for_commit_free_now_not_the_page_files_growth` that a reviewer raised is still open on this head. (4) #632 edits the same block and calls `free_commit()`, which this removes, so whichever lands second needs a rebase. Fine: the `SYSTEM_PAGEFILE_INFORMATION_EX` layout (40 bytes, info class 144), sizes in pages, an empty result when the buffer is too small or the volume is unknown, the compile gates and `big_compile_commit_free` still on `ullAvailPageFile`, and the immediate-job query. performance: 60 s smoke of a retail title, main 7d86c5d2 vs this merge (2b5a13ad): 1663 -> 1666 frames shown (100 %; last presents per 2 s: 60 60 61), peak commit 17153 -> 18768 MB, 0 device removals, 0 crashes. Peak commit is about 1.6 GB above main here (109 %), consistent with a larger coherent window on this 32 GB machine. verdict: safe to merge (a run on a PC under 24 GB of RAM, or a Not tested line, would cover the case that changes most; the log label should say the number includes page-file growth) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 10:11:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:11:38Z.


Triage (#1607) – head ae8050f

No open or merged PR makes the same change: #632 also touches the NEEDS_FOR_COHERENT_HEAPS check in uma.rs, but to give a title a whole coherent window in its first run, not to count page-file growth. The compile gates (wait_for_memory, big_compile_commit_free) still admit against commit free now, and the SystemPageFileInformationEx struct layout matches the kernel's (the padding before PageFileName.Buffer is implicit in repr(C)).
Minor: page_files reads into a fixed 4 KiB buffer and treats any non-zero status (including STATUS_INFO_LENGTH_MISMATCH) as no page files, so growth falls back to 0. That is the safe side.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307813159 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7307813159). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:11:38Z. --- **Triage (#1607)** – head ae8050f No open or merged PR makes the same change: #632 also touches the `NEEDS_FOR_COHERENT_HEAPS` check in `uma.rs`, but to give a title a whole coherent window in its first run, not to count page-file growth. The compile gates (`wait_for_memory`, `big_compile_commit_free`) still admit against commit free now, and the `SystemPageFileInformationEx` struct layout matches the kernel's (the padding before `PageFileName.Buffer` is implicit in `repr(C)`). Minor: `page_files` reads into a fixed 4 KiB buffer and treats any non-zero status (including `STATUS_INFO_LENGTH_MISMATCH`) as no page files, so growth falls back to 0. That is the safe side. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Chrysana commented 2026-12-01 14:23:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T14:23:13Z.


Thanks to both of you. The next head, 9f4160ce, is ready locally and changes only a test and a log line:

  • The gate test now uses thehollowedone's form, with no second thread and no sleep: the fake query reads 2 GiB, then 7 GiB, the growth closure panics, and the test checks for exactly 2 reads. I ran it. With wait_admitted switched to capacity(), it fails on the growth closure's panic, which is the regression it's there to catch.
  • The uma.rs label (Foniass, point 2) now says what the number is: UMA: N MB of commit free, counting the page files' room to grow unless a job caps commit, under 17408 MB: ….
  • PCs under 24 GB of RAM (point 1): I don't have one, so it goes under Not tested. Below 24 GB, auto_coherent_cap caps the window at RAM/8 (1 GiB at least), so on a 16 GB PC this PR can move the window from 512 MB to 2 GB at most, never to 4,095 MB. 2 GB is the size that cap's comment measured on a 16 GB machine.
  • #632 (point 4): it already conflicts with main. It reads the same 17,408 MB check, so if this lands first, its free_commit() becomes dxc::commit_capacity(). If #632 lands first, I'll rebase this onto it.

Why I haven't pushed it yet: the regression run needs a clean title run of the head, and on AMD current main can't give one in either setting:

  • With the default XCL_DIRECT_DXIL, #3544 crashes at ~43 s. #3455 fixes it but isn't merged.
  • With XCL_DIRECT_DXIL=1, which the earlier heads were run with, AMD's compiler now crashes building graphics PSO 26aa07cb05c04290 (amdxc64.dll+0x85f80f) at 10–35 s, on main b2b1f109 and on this head alike.

So I'll push 9f4160ce, rebased, with its smoke blocks once #3455 is on main.

As a check in the meantime, RX 9070 XT, default XCL_DIRECT_DXIL, with #3455 merged on both sides:

  • main b2b1f109 + #3455: 1692 / 1689 frames, peak 18,107 / 18,668 MB.
  • The same + 9f4160ce: 1663 / 1657 frames, peak 18,441 / 18,466 MB.
  • 0 crashes, 0 device removals. All 4 runs got past #3544's pixel shader (7381166e806847c9, loaded at ~41 s) and got the 4,095 MB window, since free commit was above 17,408 MB at the start.

Suite on main b2b1f109 merged with 9f4160ce: 2899 passed, 9 failed, 51 ignored. On main b2b1f109 alone: 2894 / 9 / 51, with the same 8 tests failing on this card, so none of the failures come from this PR.

AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the title runs, and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7314166459 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7314166459). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-01T14:23:13Z. --- Thanks to both of you. The next head, `9f4160ce`, is ready locally and changes only a test and a log line: - **The gate test** now uses thehollowedone's form, with no second thread and no sleep: the fake query reads 2 GiB, then 7 GiB, the growth closure panics, and the test checks for exactly 2 reads. I ran it. With `wait_admitted` switched to `capacity()`, it fails on the growth closure's panic, which is the regression it's there to catch. - **The `uma.rs` label** (Foniass, point 2) now says what the number is: `UMA: N MB of commit free, counting the page files' room to grow unless a job caps commit, under 17408 MB: …`. - **PCs under 24 GB of RAM** (point 1): I don't have one, so it goes under Not tested. Below 24 GB, `auto_coherent_cap` caps the window at RAM/8 (1 GiB at least), so on a 16 GB PC this PR can move the window from 512 MB to 2 GB at most, never to 4,095 MB. 2 GB is the size that cap's comment measured on a 16 GB machine. - **#632** (point 4): it already conflicts with `main`. It reads the same 17,408 MB check, so if this lands first, its `free_commit()` becomes `dxc::commit_capacity()`. If #632 lands first, I'll rebase this onto it. **Why I haven't pushed it yet:** the regression run needs a clean title run of the head, and on AMD current `main` can't give one in either setting: - With the default `XCL_DIRECT_DXIL`, #3544 crashes at ~43 s. #3455 fixes it but isn't merged. - With `XCL_DIRECT_DXIL=1`, which the earlier heads were run with, AMD's compiler now crashes building graphics PSO `26aa07cb05c04290` (`amdxc64.dll+0x85f80f`) at 10–35 s, on `main` `b2b1f109` and on this head alike. So I'll push `9f4160ce`, rebased, with its smoke blocks once #3455 is on `main`. As a check in the meantime, RX 9070 XT, default `XCL_DIRECT_DXIL`, with #3455 merged on both sides: - `main` `b2b1f109` + #3455: 1692 / 1689 frames, peak 18,107 / 18,668 MB. - The same + `9f4160ce`: 1663 / 1657 frames, peak 18,441 / 18,466 MB. - 0 crashes, 0 device removals. All 4 runs got past #3544's pixel shader (`7381166e806847c9`, loaded at ~41 s) and got the 4,095 MB window, since free commit was above 17,408 MB at the start. Suite on `main` `b2b1f109` merged with `9f4160ce`: 2899 passed, 9 failed, 51 ignored. On `main` `b2b1f109` alone: 2894 / 9 / 51, with the same 8 tests failing on this card, so none of the failures come from this PR. AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the title runs, and drafted this reply.
gut0to commented 2026-12-01 15:07:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T15:07:18Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 890

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {
+    files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add)

Could volume free space be counted once per distinct volume? page_files() attaches GetDiskFreeSpaceExW free bytes to each page-file entry, and growth_of() caps every entry independently. If two reported page files resolve to the same volume, both can claim the same free bytes, so commit_capacity() may overestimate how much commit can be added and admit a heap plan that later cannot grow. Please aggregate the growth limits by volume and add a test with two page files sharing one volume.

<!-- greyfinch-sync:ivall/xcl:review-comment:4756194653 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4756194653). Originally posted by [gut0to](https://github.com/gut0to) on 2026-12-01T15:07:18Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 890 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { + files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add) ~~~~ --- Could volume free space be counted once per distinct volume? `page_files()` attaches `GetDiskFreeSpaceExW` free bytes to each page-file entry, and `growth_of()` caps every entry independently. If two reported page files resolve to the same volume, both can claim the same free bytes, so `commit_capacity()` may overestimate how much commit can be added and admit a heap plan that later cannot grow. Please aggregate the growth limits by volume and add a test with two page files sharing one volume.
gut0to commented 2026-12-01 15:07:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T15:07:18Z.

Review: COMMENTED


AI-assisted review: I traced the page-file enumeration, per-path free-space query, and capacity calculation. I used AI assistance and checked the current implementation; I did not run a Windows configuration test.

<!-- greyfinch-sync:ivall/xcl:review:6133998596 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#pullrequestreview-6133998596). Originally posted by [gut0to](https://github.com/gut0to) on 2026-12-01T15:07:18Z. **Review:** COMMENTED --- AI-assisted review: I traced the page-file enumeration, per-path free-space query, and capacity calculation. I used AI assistance and checked the current implementation; I did not run a Windows configuration test.
Chrysana commented 2026-12-02 00:29:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-02T00:29:44Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 890

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {
+    files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add)

Yes, done locally. The page files' growth is now added up per volume, and each volume's total is capped once by its free space. Each page file still stops at its own maximum.

The volume is now found by its name (GetVolumePathNameW, then GetVolumeNameForVolumeMountPointW, giving \\?\Volume{…}\), not by the path's drive letter. Two paths on one volume share one budget that way, and a page file on a volume mounted in a folder (C:\mnt\x\pagefile.sys) is counted against that volume, not against C:. Before, that case also read C:'s free space.

New test page_files_on_one_volume_share_its_free_space: two page files on one volume with 10 GB free, each able to grow by 14 GB, and one on another volume with 4 GB of room. The result is 14 GB. With the old per-file cap it reads 24 GB, so the test fails; I checked that.

On this PC the three page files resolve to three different volume names, each with its free space, so nothing measured so far changes. System Properties sets one page file per drive, so two on one volume would take a hand-edited registry setting; I didn't set one up. The sum is right either way.

This goes into the same push as the changes in my last comment, once #3455 is on main.

AI use: Claude Code (Claude Opus 5.5) made the change, wrote and ran the test, and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:review-comment:4763032963 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4763032963). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-02T00:29:44Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 890 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { + files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add) ~~~~ --- Yes, done locally. The page files' growth is now added up per volume, and each volume's total is capped once by its free space. Each page file still stops at its own maximum. The volume is now found by its name (`GetVolumePathNameW`, then `GetVolumeNameForVolumeMountPointW`, giving `\\?\Volume{…}\`), not by the path's drive letter. Two paths on one volume share one budget that way, and a page file on a volume mounted in a folder (`C:\mnt\x\pagefile.sys`) is counted against that volume, not against `C:`. Before, that case also read `C:`'s free space. New test `page_files_on_one_volume_share_its_free_space`: two page files on one volume with 10 GB free, each able to grow by 14 GB, and one on another volume with 4 GB of room. The result is 14 GB. With the old per-file cap it reads 24 GB, so the test fails; I checked that. On this PC the three page files resolve to three different volume names, each with its free space, so nothing measured so far changes. System Properties sets one page file per drive, so two on one volume would take a hand-edited registry setting; I didn't set one up. The sum is right either way. This goes into the same push as the changes in my last comment, once #3455 is on `main`. AI use: Claude Code (Claude Opus 5.5) made the change, wrote and ran the test, and drafted this reply.
bmjask commented 2026-12-02 12:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T12:42:29Z.

Code review location: crates/xcl/src/gpu/uma.rs; line 1076

@@ -1073,17 +1073,26 @@ pub fn coherent_hint_for(windows: usize) -> usize {
     let cap = auto_coherent_cap(total_physical()).map_or(cap, |c| c.clamp(GRAIN, cap));
     let route = crate::hle::kernelx::coherent_heaps_route();
     let title = std::fs::read_to_string(coherent_file(&route)).map_or(0, |s| stored_need(&s));
-    // only with the commit for all of it: the title's ~13 GB, video memory for its render targets
-    // and textures (WDDM charges commit for each video-memory allocation too) and the window
-    // itself – a retail game took ~18 GB; with less free it runs without (its GPU heaps outside
-    // unified memory: no image) rather than taking the system's commit
-    if title > 0 && free_commit() < NEEDS_FOR_COHERENT_HEAPS {
-        crate::xlog_warn!(
-            "UMA: {} MB of commit free, under {} MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window)",
-            free_commit() >> 20,
-            NEEDS_FOR_COHERENT_HEAPS >> 20
-        );
-        return RUNTIME_COMMITTED_CAP.min(cap);
+    heaps_window(title, cap, crate::gpu::recomp::dxc::commit_capacity)

heaps_window now allows the large coherent window based on page-file growth, but reserve_runtime/with_windows commit that whole window at startup (MEM_RESERVE|MEM_COMMIT), and growth that hasn't happened yet doesn't back the commit. On the PR's target machine (2 GB page files, 1.7-4 GiB free now, 20 GiB of growth), capacity() is about 22 GiB. The 4-window layout plans 4095 MB, and the 16-window layout plans title+512 MB (~13.5 GiB) committed in 4 GiB chunks. Those single VirtualAlloc commits exceed the current commit limit, and Windows can fail them when the page file can't grow fast enough, the lag the PR cites for the compile gates. reserve_exactly then fails, reserve_runtime retries the multi-GB commit at each of ~127 (4-window) or ~15 (16-window) slots, then falls back to Uma::new(max(mb, coherent)) with the same size. The result can be "could not reserve … plain allocations" (no UMA) after a long startup stall, where main gave a working 512 MB window. Sizing the startup commit from free-now, and growing into page-file growth later, would avoid it.

<!-- greyfinch-sync:ivall/xcl:review-comment:4769668168 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4769668168). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T12:42:29Z. **Code review location:** `crates/xcl/src/gpu/uma.rs`; line 1076 ~~~~diff @@ -1073,17 +1073,26 @@ pub fn coherent_hint_for(windows: usize) -> usize { let cap = auto_coherent_cap(total_physical()).map_or(cap, |c| c.clamp(GRAIN, cap)); let route = crate::hle::kernelx::coherent_heaps_route(); let title = std::fs::read_to_string(coherent_file(&route)).map_or(0, |s| stored_need(&s)); - // only with the commit for all of it: the title's ~13 GB, video memory for its render targets - // and textures (WDDM charges commit for each video-memory allocation too) and the window - // itself – a retail game took ~18 GB; with less free it runs without (its GPU heaps outside - // unified memory: no image) rather than taking the system's commit - if title > 0 && free_commit() < NEEDS_FOR_COHERENT_HEAPS { - crate::xlog_warn!( - "UMA: {} MB of commit free, under {} MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window)", - free_commit() >> 20, - NEEDS_FOR_COHERENT_HEAPS >> 20 - ); - return RUNTIME_COMMITTED_CAP.min(cap); + heaps_window(title, cap, crate::gpu::recomp::dxc::commit_capacity) ~~~~ --- `heaps_window` now allows the large coherent window based on page-file growth, but `reserve_runtime`/`with_windows` commit that whole window at startup (MEM_RESERVE|MEM_COMMIT), and growth that hasn't happened yet doesn't back the commit. On the PR's target machine (2 GB page files, 1.7-4 GiB free now, 20 GiB of growth), `capacity()` is about 22 GiB. The 4-window layout plans 4095 MB, and the 16-window layout plans title+512 MB (~13.5 GiB) committed in 4 GiB chunks. Those single VirtualAlloc commits exceed the current commit limit, and Windows can fail them when the page file can't grow fast enough, the lag the PR cites for the compile gates. `reserve_exactly` then fails, `reserve_runtime` retries the multi-GB commit at each of ~127 (4-window) or ~15 (16-window) slots, then falls back to `Uma::new(max(mb, coherent))` with the same size. The result can be "could not reserve … plain allocations" (no UMA) after a long startup stall, where main gave a working 512 MB window. Sizing the startup commit from free-now, and growing into page-file growth later, would avoid it.
bmjask commented 2026-12-02 12:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T12:42:29Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 926

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {
+    files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add)
+}
+
+/// [`growth_of`] the page files the kernel has now (0 when they cannot be read). Logged once.
+fn page_file_growth() -> u64 {
+    let files = page_files();
+    let growth = growth_of(&files);
+    static LOGGED: AtomicBool = AtomicBool::new(false);
+    if !LOGGED.swap(true, Ordering::Relaxed) {
+        crate::xlog_info!(
+            "commit: the page files can grow by {} MB more than their size now ({} page file(s): {})",
+            growth >> 20,
+            files.len(),
+            files.iter().map(|f| format!("{} of {} MB", f.size >> 20, f.max >> 20)).collect::<Vec<_>>().join(", ")
+        );
+    }
+    growth
+}
+
+/// Whether the job this process is in caps its commit (`JOB_OBJECT_LIMIT_PROCESS_MEMORY` or
+/// `JOB_OBJECT_LIMIT_JOB_MEMORY`). Such a limit does not rise when a page file grows, and
+/// `ullAvailPageFile` does not show it: on Windows 11 build 26200 a process in an 8 GB job read
+/// the system's free commit (42 GB). Only the process's immediate job: a limit set on an outer
+/// job of nested jobs cannot be read from inside. Read at each call (a job can be assigned
+/// while the process runs), logged the first time it is found.
+fn job_commit_limit() -> bool {
+    use windows_sys::Win32::Foundation::HANDLE;
+    use windows_sys::Win32::System::JobObjects::{
+        JobObjectExtendedLimitInformation, QueryInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOB_OBJECT_LIMIT_JOB_MEMORY,
+        JOB_OBJECT_LIMIT_PROCESS_MEMORY,
+    };
+    let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = unsafe { std::mem::zeroed() };
+    // a null job handle names the job this process is in; the query fails when it is in none
+    let none: HANDLE = unsafe { std::mem::zeroed() };
+    let size = std::mem::size_of_val(&info) as u32;
+    let ok = unsafe { QueryInformationJobObject(none, JobObjectExtendedLimitInformation, (&mut info as *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(), size, std::ptr::null_mut()) } != 0;
+    let limited = ok && info.BasicLimitInformation.LimitFlags & (JOB_OBJECT_LIMIT_PROCESS_MEMORY | JOB_OBJECT_LIMIT_JOB_MEMORY) != 0;

job_commit_limit reads JobMemoryLimit/ProcessMemoryLimit but only uses it to skip the growth term, and capacity() still returns system-wide ullAvailPageFile, which the PR itself notes doesn't show job limits. With an 8 GB JOB_OBJECT_LIMIT_JOB_MEMORY on a PC with 42 GB of system commit free, capacity() returns 42 GB, so the title's ~13 GiB of heaps go to the coherent window, its commits pass the job's 8 GB limit and fail (no image, or a crash). Capping capacity at min(now, limit - the job's current commit) would respect it.

<!-- greyfinch-sync:ivall/xcl:review-comment:4769668186 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4769668186). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T12:42:29Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 926 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { + files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add) +} + +/// [`growth_of`] the page files the kernel has now (0 when they cannot be read). Logged once. +fn page_file_growth() -> u64 { + let files = page_files(); + let growth = growth_of(&files); + static LOGGED: AtomicBool = AtomicBool::new(false); + if !LOGGED.swap(true, Ordering::Relaxed) { + crate::xlog_info!( + "commit: the page files can grow by {} MB more than their size now ({} page file(s): {})", + growth >> 20, + files.len(), + files.iter().map(|f| format!("{} of {} MB", f.size >> 20, f.max >> 20)).collect::<Vec<_>>().join(", ") + ); + } + growth +} + +/// Whether the job this process is in caps its commit (`JOB_OBJECT_LIMIT_PROCESS_MEMORY` or +/// `JOB_OBJECT_LIMIT_JOB_MEMORY`). Such a limit does not rise when a page file grows, and +/// `ullAvailPageFile` does not show it: on Windows 11 build 26200 a process in an 8 GB job read +/// the system's free commit (42 GB). Only the process's immediate job: a limit set on an outer +/// job of nested jobs cannot be read from inside. Read at each call (a job can be assigned +/// while the process runs), logged the first time it is found. +fn job_commit_limit() -> bool { + use windows_sys::Win32::Foundation::HANDLE; + use windows_sys::Win32::System::JobObjects::{ + JobObjectExtendedLimitInformation, QueryInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOB_OBJECT_LIMIT_JOB_MEMORY, + JOB_OBJECT_LIMIT_PROCESS_MEMORY, + }; + let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = unsafe { std::mem::zeroed() }; + // a null job handle names the job this process is in; the query fails when it is in none + let none: HANDLE = unsafe { std::mem::zeroed() }; + let size = std::mem::size_of_val(&info) as u32; + let ok = unsafe { QueryInformationJobObject(none, JobObjectExtendedLimitInformation, (&mut info as *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(), size, std::ptr::null_mut()) } != 0; + let limited = ok && info.BasicLimitInformation.LimitFlags & (JOB_OBJECT_LIMIT_PROCESS_MEMORY | JOB_OBJECT_LIMIT_JOB_MEMORY) != 0; ~~~~ --- `job_commit_limit` reads JobMemoryLimit/ProcessMemoryLimit but only uses it to skip the growth term, and `capacity()` still returns system-wide `ullAvailPageFile`, which the PR itself notes doesn't show job limits. With an 8 GB JOB_OBJECT_LIMIT_JOB_MEMORY on a PC with 42 GB of system commit free, `capacity()` returns 42 GB, so the title's ~13 GiB of heaps go to the coherent window, its commits pass the job's 8 GB limit and fail (no image, or a crash). Capping capacity at `min(now, limit - the job's current commit)` would respect it.
bmjask commented 2026-12-02 12:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T12:42:29Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 889

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {

Not certain about this one: growth_of caps each page file by its volume's whole free space separately, so several page files on one volume count the same free bytes more than once. With two paging files on C: (allowed through the PagingFiles registry value), each 2 GB of 16 GB, and 10 GB free on C:, growth counts 10+10 = 20 GB where only 10 GB can be had, which can push capacity over the 17 GiB threshold when it shouldn't.

<!-- greyfinch-sync:ivall/xcl:review-comment:4769668199 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4769668199). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T12:42:29Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 889 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { ~~~~ --- Not certain about this one: `growth_of` caps each page file by its volume's whole free space separately, so several page files on one volume count the same free bytes more than once. With two paging files on C: (allowed through the PagingFiles registry value), each 2 GB of 16 GB, and 10 GB free on C:, growth counts 10+10 = 20 GB where only 10 GB can be had, which can push capacity over the 17 GiB threshold when it shouldn't.
bmjask commented 2026-12-02 12:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T12:42:29Z.

Review: COMMENTED


Review of ae8050f1: 3 finding(s). 3 are inline.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

<!-- greyfinch-sync:ivall/xcl:review:6150925251 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#pullrequestreview-6150925251). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T12:42:29Z. **Review:** COMMENTED --- Review of `ae8050f1`: 3 finding(s). 3 are inline. --- _These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it._
Chrysana commented 2026-12-02 14:11:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-02T14:11:12Z.

Code review location: crates/xcl/src/gpu/uma.rs; line 1076

@@ -1073,17 +1073,26 @@ pub fn coherent_hint_for(windows: usize) -> usize {
     let cap = auto_coherent_cap(total_physical()).map_or(cap, |c| c.clamp(GRAIN, cap));
     let route = crate::hle::kernelx::coherent_heaps_route();
     let title = std::fs::read_to_string(coherent_file(&route)).map_or(0, |s| stored_need(&s));
-    // only with the commit for all of it: the title's ~13 GB, video memory for its render targets
-    // and textures (WDDM charges commit for each video-memory allocation too) and the window
-    // itself – a retail game took ~18 GB; with less free it runs without (its GPU heaps outside
-    // unified memory: no image) rather than taking the system's commit
-    if title > 0 && free_commit() < NEEDS_FOR_COHERENT_HEAPS {
-        crate::xlog_warn!(
-            "UMA: {} MB of commit free, under {} MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window)",
-            free_commit() >> 20,
-            NEEDS_FOR_COHERENT_HEAPS >> 20
-        );
-        return RUNTIME_COMMITTED_CAP.min(cap);
+    heaps_window(title, cap, crate::gpu::recomp::dxc::commit_capacity)

I tested this on the case you describe: about 2.4–3 GB of commit free now and 22.5 GB of page-file growth, on Windows 11 build 26200 with an RX 9070 XT. The startup commit went through every time, in under 0.1 s, with no retries.

Title runs. Main b2b1f109 against this PR's next head 5e4c76ab, 2 rounds each, 20 s per run, default settings. Before each run, a commit-only filler left 2.4–3.0 GB free. Page files: C: 8,196 of 16,384 MB, D: 2,048 of 16,384 MB, X: fixed 32,768 MB.

run free now at start coherent window window reserved (log time) frames peak commit
main r1 2,298 MB 512 MB 0.076 s 475 14,600 MB
PR r1 2,435 MB 4,095 MB 0.148 s 493 14,040 MB
main r2 2,931 MB 512 MB 0.058 s 493 14,657 MB
PR r2 2,960 MB 4,095 MB 0.134 s 492 14,016 MB

The PR's window landed at 0x400000000 both times. That's the first slot, the same base as main, so reserve_runtime never retried or fell back. The 4,095 MB commit added 70–90 ms to startup. None of the 4 runs had a crash or a device removal.

The same VirtualAlloc without a title. MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE, timed, with page-file sizes read while it was held:

free now commit result page files while held
3.3 GB 4,095 MB in one call ok, 81 ms C: 8,196 → 9,099 MB
1.2 GB 4,095 MB in one call ok, 94 ms C: 8,196 → 11,149 MB
3.2 GB 13.5 GiB in 4 GiB chunks (16-window layout) ok, 47–69 ms per chunk C: 16,384 MB (its max), D: 2,048 → 5,521 MB
1.3 GB 13.5 GiB in 4 GiB chunks ok, 59–105 ms per chunk C: 16,384 MB, D: 2,048 → 7,428 MB

Windows grew the page files inside the call, filling C: to its maximum and then moving on to D:. A commit over the current limit waited for that growth and then succeeded. The page files went back to their minimums once the commit was released.

So on this PC, a startup commit within what the page files can grow to doesn't fail. What would make it fail is growth that can't happen at all: a page file already at its maximum, or a volume without the free space. capacity() already leaves both out (each page file's growth stops at its maximum, and each volume's total is capped by its free space). The 16-window layout ran only in the probe; I didn't run a title with XCL_UMA_WINDOWS=16.

I'd rather not size the startup commit from free-now. Below 17 GiB of free now, that would put the window back to main's 512 MB on the machines this PR is for. If you know of a setup where a commit within the page files' growth room fails, I can test it here.

AI use: Claude Code (Claude Opus 5.5) wrote the probe and runner scripts, ran the tests and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:review-comment:4770854934 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4770854934). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-02T14:11:12Z. **Code review location:** `crates/xcl/src/gpu/uma.rs`; line 1076 ~~~~diff @@ -1073,17 +1073,26 @@ pub fn coherent_hint_for(windows: usize) -> usize { let cap = auto_coherent_cap(total_physical()).map_or(cap, |c| c.clamp(GRAIN, cap)); let route = crate::hle::kernelx::coherent_heaps_route(); let title = std::fs::read_to_string(coherent_file(&route)).map_or(0, |s| stored_need(&s)); - // only with the commit for all of it: the title's ~13 GB, video memory for its render targets - // and textures (WDDM charges commit for each video-memory allocation too) and the window - // itself – a retail game took ~18 GB; with less free it runs without (its GPU heaps outside - // unified memory: no image) rather than taking the system's commit - if title > 0 && free_commit() < NEEDS_FOR_COHERENT_HEAPS { - crate::xlog_warn!( - "UMA: {} MB of commit free, under {} MB: the title's GPU heaps stay outside unified memory (a larger page file gives them the coherent window)", - free_commit() >> 20, - NEEDS_FOR_COHERENT_HEAPS >> 20 - ); - return RUNTIME_COMMITTED_CAP.min(cap); + heaps_window(title, cap, crate::gpu::recomp::dxc::commit_capacity) ~~~~ --- I tested this on the case you describe: about 2.4–3 GB of commit free now and 22.5 GB of page-file growth, on Windows 11 build 26200 with an RX 9070 XT. The startup commit went through every time, in under 0.1 s, with no retries. **Title runs.** Main `b2b1f109` against this PR's next head `5e4c76ab`, 2 rounds each, 20 s per run, default settings. Before each run, a commit-only filler left 2.4–3.0 GB free. Page files: C: 8,196 of 16,384 MB, D: 2,048 of 16,384 MB, X: fixed 32,768 MB. | run | free now at start | coherent window | window reserved (log time) | frames | peak commit | |---|---|---|---|---|---| | main r1 | 2,298 MB | 512 MB | 0.076 s | 475 | 14,600 MB | | PR r1 | 2,435 MB | 4,095 MB | 0.148 s | 493 | 14,040 MB | | main r2 | 2,931 MB | 512 MB | 0.058 s | 493 | 14,657 MB | | PR r2 | 2,960 MB | 4,095 MB | 0.134 s | 492 | 14,016 MB | The PR's window landed at `0x400000000` both times. That's the first slot, the same base as main, so `reserve_runtime` never retried or fell back. The 4,095 MB commit added 70–90 ms to startup. None of the 4 runs had a crash or a device removal. **The same `VirtualAlloc` without a title.** `MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH`, `PAGE_READWRITE`, timed, with page-file sizes read while it was held: | free now | commit | result | page files while held | |---|---|---|---| | 3.3 GB | 4,095 MB in one call | ok, 81 ms | C: 8,196 → 9,099 MB | | 1.2 GB | 4,095 MB in one call | ok, 94 ms | C: 8,196 → 11,149 MB | | 3.2 GB | 13.5 GiB in 4 GiB chunks (16-window layout) | ok, 47–69 ms per chunk | C: 16,384 MB (its max), D: 2,048 → 5,521 MB | | 1.3 GB | 13.5 GiB in 4 GiB chunks | ok, 59–105 ms per chunk | C: 16,384 MB, D: 2,048 → 7,428 MB | Windows grew the page files inside the call, filling C: to its maximum and then moving on to D:. A commit over the current limit waited for that growth and then succeeded. The page files went back to their minimums once the commit was released. So on this PC, a startup commit within what the page files can grow to doesn't fail. What would make it fail is growth that can't happen at all: a page file already at its maximum, or a volume without the free space. `capacity()` already leaves both out (each page file's growth stops at its maximum, and each volume's total is capped by its free space). The 16-window layout ran only in the probe; I didn't run a title with `XCL_UMA_WINDOWS=16`. I'd rather not size the startup commit from free-now. Below 17 GiB of free now, that would put the window back to `main`'s 512 MB on the machines this PR is for. If you know of a setup where a commit within the page files' growth room fails, I can test it here. AI use: Claude Code (Claude Opus 5.5) wrote the probe and runner scripts, ran the tests and drafted this reply.
bmjask commented 2026-12-02 14:11:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:11:36Z.


@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.

<!-- greyfinch-sync:ivall/xcl:comment:7348139627 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7348139627). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T14:11:36Z. --- @Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Chrysana commented 2026-12-02 14:14:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-02T14:14:22Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 889

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {

Right, and gut0to found the same thing (thread). The fix is in the next head, 5e4c76ab. It's ready locally and goes out in the same push as the other changes, once #3455 is on main.

growth_of now adds up the page files' room per volume and caps each volume's total once by its free space. Each page file still stops at its own maximum. The volume comes from its volume name (GetVolumePathNameW, then GetVolumeNameForVolumeMountPointW), not the drive letter, so a volume mounted in a folder is counted on its own too. In your example, two page files on C: at 2 of 16 GB with 10 GB free on C: now count 10 GB, not 20.

The test page_files_on_one_volume_share_its_free_space covers it: two page files on one volume with 10 GB free, each able to grow by 14 GB, plus one on another volume with 4 GB of room, gives 14 GB. With the old per-file cap it reads 24 GB and the test fails.

AI use: Claude Code (Claude Opus 5.5) made the change, wrote and ran the test, and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:review-comment:4770899668 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4770899668). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-02T14:14:22Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 889 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { ~~~~ --- Right, and gut0to found the same thing ([thread](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4763032963)). The fix is in the next head, `5e4c76ab`. It's ready locally and goes out in the same push as the other changes, once #3455 is on `main`. `growth_of` now adds up the page files' room per volume and caps each volume's total once by its free space. Each page file still stops at its own maximum. The volume comes from its volume name (`GetVolumePathNameW`, then `GetVolumeNameForVolumeMountPointW`), not the drive letter, so a volume mounted in a folder is counted on its own too. In your example, two page files on C: at 2 of 16 GB with 10 GB free on C: now count 10 GB, not 20. The test `page_files_on_one_volume_share_its_free_space` covers it: two page files on one volume with 10 GB free, each able to grow by 14 GB, plus one on another volume with 4 GB of room, gives 14 GB. With the old per-file cap it reads 24 GB and the test fails. AI use: Claude Code (Claude Opus 5.5) made the change, wrote and ran the test, and drafted this reply.
Chrysana commented 2026-12-02 14:14:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-02T14:14:41Z.

Code review location: crates/xcl/src/gpu/recomp/dxc.rs; line 926

@@ -830,14 +866,128 @@ impl Drop for MemorySlot {
     }
 }
 
-/// Available page-file commit bytes from Windows, or `None` if the query fails.
+/// Available page-file commit bytes from Windows at the page files' current size
+/// (`ullAvailPageFile`), or `None` if the query fails.
 fn avail_page_file() -> Option<u64> {
     use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX};
     let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() };
     m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32;
     (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile)
 }
 
+/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the
+/// free space of its volume (`None`: not known).
+#[derive(Clone, Copy, Debug)]
+struct PageFile {
+    size: u64,
+    max: u64,
+    volume_free: Option<u64>,
+}
+
+/// What the page files can still grow by: each up to its maximum, and no further than its
+/// volume's free space (nothing when that is not known).
+fn growth_of(files: &[PageFile]) -> u64 {
+    files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add)
+}
+
+/// [`growth_of`] the page files the kernel has now (0 when they cannot be read). Logged once.
+fn page_file_growth() -> u64 {
+    let files = page_files();
+    let growth = growth_of(&files);
+    static LOGGED: AtomicBool = AtomicBool::new(false);
+    if !LOGGED.swap(true, Ordering::Relaxed) {
+        crate::xlog_info!(
+            "commit: the page files can grow by {} MB more than their size now ({} page file(s): {})",
+            growth >> 20,
+            files.len(),
+            files.iter().map(|f| format!("{} of {} MB", f.size >> 20, f.max >> 20)).collect::<Vec<_>>().join(", ")
+        );
+    }
+    growth
+}
+
+/// Whether the job this process is in caps its commit (`JOB_OBJECT_LIMIT_PROCESS_MEMORY` or
+/// `JOB_OBJECT_LIMIT_JOB_MEMORY`). Such a limit does not rise when a page file grows, and
+/// `ullAvailPageFile` does not show it: on Windows 11 build 26200 a process in an 8 GB job read
+/// the system's free commit (42 GB). Only the process's immediate job: a limit set on an outer
+/// job of nested jobs cannot be read from inside. Read at each call (a job can be assigned
+/// while the process runs), logged the first time it is found.
+fn job_commit_limit() -> bool {
+    use windows_sys::Win32::Foundation::HANDLE;
+    use windows_sys::Win32::System::JobObjects::{
+        JobObjectExtendedLimitInformation, QueryInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOB_OBJECT_LIMIT_JOB_MEMORY,
+        JOB_OBJECT_LIMIT_PROCESS_MEMORY,
+    };
+    let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = unsafe { std::mem::zeroed() };
+    // a null job handle names the job this process is in; the query fails when it is in none
+    let none: HANDLE = unsafe { std::mem::zeroed() };
+    let size = std::mem::size_of_val(&info) as u32;
+    let ok = unsafe { QueryInformationJobObject(none, JobObjectExtendedLimitInformation, (&mut info as *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(), size, std::ptr::null_mut()) } != 0;
+    let limited = ok && info.BasicLimitInformation.LimitFlags & (JOB_OBJECT_LIMIT_PROCESS_MEMORY | JOB_OBJECT_LIMIT_JOB_MEMORY) != 0;

That's right about capacity() inside a job, but this PR doesn't change it. With a job memory limit, capacity() returns ullAvailPageFile alone, with no growth added. That's the same value main's free_commit() in uma.rs reads for the same check. So in your 8 GB job with 42 GB of system commit free, main also sees 42 GB and picks the same window. The PR only keeps the page files' growth out of that case.

In practice, an 8 GB job stops the title with or without the window. In our runs it commits 14–15 GB in its first 20 s with main's 512 MB window, and 16–18 GB over 60 s. A cap at the job's remaining commit would only change the outcome for a limit in a narrow band: above what the title needs without the window, but below what it needs with it.

I'd rather keep that out of this PR, since main has the same gap. Capping it needs the job's current commit, and JOBOBJECT_EXTENDED_LIMIT_INFORMATION only has the peaks. For a per-process limit the process's PrivateUsage would do; for a job-wide limit it means adding up every process in the job. And only the immediate job can be read, as we found with thehollowedone above. I can open an issue for it, or do a follow-up PR after this one, if you think it's worth having.

AI use: Claude Code (Claude Opus 5.5) checked the code paths on main and this PR and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:review-comment:4770903814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#discussion_r4770903814). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-02T14:14:41Z. **Code review location:** `crates/xcl/src/gpu/recomp/dxc.rs`; line 926 ~~~~diff @@ -830,14 +866,128 @@ impl Drop for MemorySlot { } } -/// Available page-file commit bytes from Windows, or `None` if the query fails. +/// Available page-file commit bytes from Windows at the page files' current size +/// (`ullAvailPageFile`), or `None` if the query fails. fn avail_page_file() -> Option<u64> { use windows_sys::Win32::System::SystemInformation::{GlobalMemoryStatusEx, MEMORYSTATUSEX}; let mut m: MEMORYSTATUSEX = unsafe { std::mem::zeroed() }; m.dwLength = std::mem::size_of::<MEMORYSTATUSEX>() as u32; (unsafe { GlobalMemoryStatusEx(&mut m) } != 0).then_some(m.ullAvailPageFile) } +/// A page file as the kernel has it now, in bytes: its size, the most it may grow to, and the +/// free space of its volume (`None`: not known). +#[derive(Clone, Copy, Debug)] +struct PageFile { + size: u64, + max: u64, + volume_free: Option<u64>, +} + +/// What the page files can still grow by: each up to its maximum, and no further than its +/// volume's free space (nothing when that is not known). +fn growth_of(files: &[PageFile]) -> u64 { + files.iter().map(|f| f.max.saturating_sub(f.size).min(f.volume_free.unwrap_or(0))).fold(0, u64::saturating_add) +} + +/// [`growth_of`] the page files the kernel has now (0 when they cannot be read). Logged once. +fn page_file_growth() -> u64 { + let files = page_files(); + let growth = growth_of(&files); + static LOGGED: AtomicBool = AtomicBool::new(false); + if !LOGGED.swap(true, Ordering::Relaxed) { + crate::xlog_info!( + "commit: the page files can grow by {} MB more than their size now ({} page file(s): {})", + growth >> 20, + files.len(), + files.iter().map(|f| format!("{} of {} MB", f.size >> 20, f.max >> 20)).collect::<Vec<_>>().join(", ") + ); + } + growth +} + +/// Whether the job this process is in caps its commit (`JOB_OBJECT_LIMIT_PROCESS_MEMORY` or +/// `JOB_OBJECT_LIMIT_JOB_MEMORY`). Such a limit does not rise when a page file grows, and +/// `ullAvailPageFile` does not show it: on Windows 11 build 26200 a process in an 8 GB job read +/// the system's free commit (42 GB). Only the process's immediate job: a limit set on an outer +/// job of nested jobs cannot be read from inside. Read at each call (a job can be assigned +/// while the process runs), logged the first time it is found. +fn job_commit_limit() -> bool { + use windows_sys::Win32::Foundation::HANDLE; + use windows_sys::Win32::System::JobObjects::{ + JobObjectExtendedLimitInformation, QueryInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOB_OBJECT_LIMIT_JOB_MEMORY, + JOB_OBJECT_LIMIT_PROCESS_MEMORY, + }; + let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = unsafe { std::mem::zeroed() }; + // a null job handle names the job this process is in; the query fails when it is in none + let none: HANDLE = unsafe { std::mem::zeroed() }; + let size = std::mem::size_of_val(&info) as u32; + let ok = unsafe { QueryInformationJobObject(none, JobObjectExtendedLimitInformation, (&mut info as *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(), size, std::ptr::null_mut()) } != 0; + let limited = ok && info.BasicLimitInformation.LimitFlags & (JOB_OBJECT_LIMIT_PROCESS_MEMORY | JOB_OBJECT_LIMIT_JOB_MEMORY) != 0; ~~~~ --- That's right about `capacity()` inside a job, but this PR doesn't change it. With a job memory limit, `capacity()` returns `ullAvailPageFile` alone, with no growth added. That's the same value `main`'s `free_commit()` in `uma.rs` reads for the same check. So in your 8 GB job with 42 GB of system commit free, `main` also sees 42 GB and picks the same window. The PR only keeps the page files' growth out of that case. In practice, an 8 GB job stops the title with or without the window. In our runs it commits 14–15 GB in its first 20 s with `main`'s 512 MB window, and 16–18 GB over 60 s. A cap at the job's remaining commit would only change the outcome for a limit in a narrow band: above what the title needs without the window, but below what it needs with it. I'd rather keep that out of this PR, since `main` has the same gap. Capping it needs the job's current commit, and `JOBOBJECT_EXTENDED_LIMIT_INFORMATION` only has the peaks. For a per-process limit the process's `PrivateUsage` would do; for a job-wide limit it means adding up every process in the job. And only the immediate job can be read, as we found with thehollowedone above. I can open an issue for it, or do a follow-up PR after this one, if you think it's worth having. AI use: Claude Code (Claude Opus 5.5) checked the code paths on `main` and this PR and drafted this reply.
ClosetPie107 commented 2026-12-02 17:13:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-12-02T17:13:16Z.


Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on ae8050f

Merged onto main 5eaadb54 (clean merge) and compared with main run twice on the same machine.

Setup

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS (kernel 7.3.7)
  • Wine 11.23 (system), stock vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi.dll from GE-Proton11-16, DXC 1.9.2609.5
  • Debug build, cross-compiled for x86_64-pc-windows-msvc with cargo-xwin; test binaries run under Wine

Tested: cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>

passed failed ignored
main 5eaadb54 2769 177 52
this PR merged 2774 177 52
  • Tests that fail with this PR and pass on main: hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_was.
    • Not caused by this PR, which does not touch kernelx.rs: the test also fails on main when its module runs on its own (hle::kernelx::tests, 4 threads: 0 of 5 runs pass on main, 2 of 3 on this PR). It passed in both full-suite runs of main, so under Wine it depends on which tests ran before it.
  • Tests this PR adds: 5 of 5 pass (page_files_that_start_small_count_what_they_can_grow_by, page_file_growth_stops_at_its_volume_free_space_and_a_fixed_size, the_page_files_read_from_the_kernel_are_within_their_maximum, a_background_compile_waits_for_commit_free_now_not_the_page_files_growth, a_job_commit_limit_keeps_the_gpu_heaps_off_the_page_files_growth).
  • Passing here and failing on main: gpu::recomp::tests::gpu_qsad_and_mqsad (flaky on main under Wine).
About the failures on main and the 31 skipped tests (same for every PR in this batch)
  • Most of main's 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (d3d12_command_list_Reset: Invalid command allocator), and later tests get E_INVALIDARG (0x80070057). Running vkd3d-proton master with its vtable check taken out, hle::d3d12x::sparse::tests goes from 106 passed / 38 failed to 144 / 0.
  • The 31 skipped tests make vkd3d-proton's dxil-spirv call std::terminate() (Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private), which kills the whole test binary. They are the split-wave64, dispatch-chain and bridged-mask GPU tests, gpu_compute_mode_dispatch_abi, gpu_compute_thread_limits_leave_the_lanes_past_them_out, the two gpu_mesh_mode_* tests, and console_wave64_compute_through_the_pso_hook_dispatch_and_read_back, plus serialize_root_signature_strips_console_flags_and_preserves_pc_flags, whose null descriptor vkd3d-proton dereferences. The dxil-spirv ones crash the same way with vkd3d-proton master (f8c1cae8, dxil-spirv 93ab44c5).
  • main was run twice: same counts, same failure set. SKIPPED lines (same as main): no heap windows (2), no D3D12 debug layer (2-3), driver cache control not implemented in vkd3d-proton (1).

Not tested: Windows, NVIDIA, a retail title / scripts/smoke.ps1, a review of the diff. This is a test report, not a merge-check.

AI use: omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with main, and drafted this report. The user asked for it to be posted.

<!-- greyfinch-sync:ivall/xcl:comment:7353064612 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3546#issuecomment-7353064612). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-12-02T17:13:16Z. --- **Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on `ae8050f`** Merged onto `main` `5eaadb54` (clean merge) and compared with `main` run twice on the same machine. **Setup** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS (kernel 7.3.7) - Wine 11.23 (system), stock vkd3d-proton `v3.1-83-gcae8353ed` and DXVK `dxgi.dll` from GE-Proton11-16, DXC 1.9.2609.5 - Debug build, cross-compiled for `x86_64-pc-windows-msvc` with `cargo-xwin`; test binaries run under Wine **Tested:** `cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>` | | passed | failed | ignored | |---|---|---|---| | `main` `5eaadb54` | 2769 | 177 | 52 | | this PR merged | 2774 | 177 | 52 | - **Tests that fail with this PR and pass on `main`:** `hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_was`. - Not caused by this PR, which does not touch `kernelx.rs`: the test also fails on `main` when its module runs on its own (`hle::kernelx::tests`, 4 threads: 0 of 5 runs pass on `main`, 2 of 3 on this PR). It passed in both full-suite runs of `main`, so under Wine it depends on which tests ran before it. - **Tests this PR adds:** 5 of 5 pass (`page_files_that_start_small_count_what_they_can_grow_by`, `page_file_growth_stops_at_its_volume_free_space_and_a_fixed_size`, `the_page_files_read_from_the_kernel_are_within_their_maximum`, `a_background_compile_waits_for_commit_free_now_not_the_page_files_growth`, `a_job_commit_limit_keeps_the_gpu_heaps_off_the_page_files_growth`). - Passing here and failing on `main`: `gpu::recomp::tests::gpu_qsad_and_mqsad` (flaky on `main` under Wine). <details><summary>About the failures on <code>main</code> and the 31 skipped tests (same for every PR in this batch)</summary> - Most of `main`'s 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (`d3d12_command_list_Reset: Invalid command allocator`), and later tests get `E_INVALIDARG` (`0x80070057`). Running vkd3d-proton master with its vtable check taken out, `hle::d3d12x::sparse::tests` goes from 106 passed / 38 failed to 144 / 0. - The 31 skipped tests make vkd3d-proton's dxil-spirv call `std::terminate()` (`Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private`), which kills the whole test binary. They are the split-wave64, dispatch-chain and bridged-mask GPU tests, `gpu_compute_mode_dispatch_abi`, `gpu_compute_thread_limits_leave_the_lanes_past_them_out`, the two `gpu_mesh_mode_*` tests, and `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back`, plus `serialize_root_signature_strips_console_flags_and_preserves_pc_flags`, whose null descriptor vkd3d-proton dereferences. The dxil-spirv ones crash the same way with vkd3d-proton master (`f8c1cae8`, dxil-spirv `93ab44c5`). - `main` was run twice: same counts, same failure set. `SKIPPED` lines (same as `main`): no heap windows (2), no D3D12 debug layer (2-3), driver cache control not implemented in vkd3d-proton (1). </details> **Not tested:** Windows, NVIDIA, a retail title / `scripts/smoke.ps1`, a review of the diff. This is a test report, not a `merge-check`. **AI use:** omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with `main`, and drafted this report. The user asked for it to be posted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3546:upstream-pr/3546'
git switch 'upstream-pr/3546'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3546'
git switch 'upstream-pr/3546'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3546'
git switch 'upstream-pr/3546'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3546'
git switch 'main'
git merge --squash 'upstream-pr/3546'
git switch 'main'
git merge --ff-only 'upstream-pr/3546'
git switch 'main'
git merge 'upstream-pr/3546'
git push origin 'main'
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
xcl-dev/xcl!3546
No description provided.