Repository navigation
Conversation
…lock wait_for_commit previously polled GlobalMemoryStatusEx in an unbounded loop until 3 GB of pagefile commit were free, while holding BIG_COMPILES (most: 1). On Windows with a system-managed dynamic pagefile (e.g. 32 GB RAM + 15 GB initial pagefile = ~47 GB commit limit), once a retail title commits ~41-42 GB, ullAvailPageFile remains below 3 GB because Windows only grows pagefile.sys on an actual allocation rather than while threads poll GlobalMemoryStatusEx. The background worker then slept indefinitely holding BIG_COMPILES, starving every queued compute PSO behind it. Add a 5 s grace timeout (wait_for_commit_with) while keeping BIG_COMPILES serialized to 1 and the 3 GB target unchanged, log once if the grace window expires, and add unit tests covering both headroom recovery and bounded return. Assisted-by: Antigravity (Gemini)
…lock From xcl-dev/xcl#567 by @gridoe, squashed.
|
A before/after on the case listed here under Not tested (a fixed page file), on an NVIDIA machine whose 32 GB run stopped in the same place. This is data on the mechanism; #567 itself was not built or run. Setup
What it shows
Limits
Not tested: #567 on any build, plain AI use: Claude Code (Claude Opus 5.5) read the logs, matched the stack frames, built the binary and wrote this comment, and posted it at the account owner's request. The owner did the runs. Counts and offsets only; no game data. |
|
Test run of Tested
Review: Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Code audit + NVIDIA RTX 5080 test run on ReviewLooks clean and ready to merge — bounding Tested
Not tested
AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above. |
|
Tested merged onto It does not change the stall here. XCL's own overlay at 95 s: On plain The thread dump at the end shows Not tested: AMD, other titles, longer runs. AI use: OpenCode, DeepSeek V4.1 Flash 1017. |
|
Closing as superseded by ivall's commits Thanks to @chadatouille, @MesshM, @mastrr9, and @brainhay5 for testing and feedback! AI use
|
Bound
wait_for_commitind3d12x/real.rswith a 5 s grace timeout so big background compute PSO compiles cannot permanently deadlockBIG_COMPILES.Previously,
wait_for_commitpolledGlobalMemoryStatusExin an unbounded loop untilullAvailPageFile >= 3 GiBwhile holding the singleBIG_COMPILES(most: 1) slot. On a 32 GB Windows system with a system-managed dynamic pagefile (~47 GB initial commit limit), once a retail title commits ~41–42 GB, Windows does not expandpagefile.syswhile threads only pollGlobalMemoryStatusEx. The worker then slept indefinitely holdingBIG_COMPILES, starving every subsequent queued compute PSO behind it.Keeping
BIG_COMPILESserialized to 1 and the 3 GiB target unchanged,wait_for_commitnow waits up to 5 s (BIG_COMMIT_GRACE) before proceeding one compile at a time and logging once if the grace window expires.What is in it
crates/xcl/src/hle/d3d12x/real.rs: extractavail_pagefile_bytesandwait_for_commit_withwith a 5 sBIG_COMMIT_GRACEcap, log once when proceeding below the 3 GiB target, and add unit testswait_for_commit_returns_when_headroom_appearsandwait_for_commit_does_not_hang_forever_below_reserve.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13)(stable-x86_64-pc-windows-msvc), debug (tests) and release (smoke)..\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 682 passed, 0 failed, 41 ignored.SKIPPEDGPU tests on this adapter: 2 (no wave64—gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).wait_for_commit_returns_when_headroom_appearsandwait_for_commit_does_not_hang_forever_below_reservepass.Regression run
Not tested
pagefile.syscannot grow past the initial commit limit.XCL_SAMPLE_*env vars.wait_for_commitpreviously wedged; that path is exercised by the new unit tests.AI use
wait_for_commit_with, unit tests, and the PR description; all builds, tests, and smoke runs were executed locally on the hardware listed above.