Repository navigation
Conversation
… rect lists A home in a sparse window is only reserved until its page is used there and gives its memory back while the page is mapped elsewhere: the retail game's 5.7 GB of pages were committed twice, with video-memory tiles (28.7 GB of commit, now 16-17 GB). chad.dll (XDsp) connects and takes commands; the newer list layout's #139 is Reset; console rect lists are drawn as triangles; a stream without a topology type is TRIANGLE. XCL_TRACE_MEM=n logs the first n allocations.
|
The concurrency test can fail even when the gate admits every worker correctly. It computes I checked a short schedule against the thresholds in Could the admission loop take a test-only memory sampler so all workers in this test see a fixed budget? That would let the test assert the exact cap and leave a live-memory run as a smoke check. I verified the admission arithmetic with a deterministic schedule on macOS. I did not run the Windows concurrency test. AI-assisted review. |
…de after a minute `wait_for_memory` (ivall#113) let a compile start with 6 GB of commit left plus 1 GB per compile already running. The available commit already excludes what the running compiles use, so that counted them twice: on a desktop with 8.1 GB of commit free (a browser and chat open) about three compiles ran and the other workers polled. - `may_start`: in at once while commit covers 6 GB + 300 MB per running compile (their growth still to come; a typical retail compile peaks at 0.1-0.3 GB per ivall#113's measurements); with less, one at a time. - After a minute's wait a compile still goes in when commit is short, but one per minute; before, every waiting worker went in at once - when commit was shortest. - The running count only rises from the value the decision saw (compare and swap), so workers deciding on the same reading cannot all go in. - Waiters wake when a compile ends (condition variable) instead of polling every 50 ms. Minecraft Preview's 716 programs, 4 memory windows, 15 threads (default), Ryzen 7 5700X, 8.1 GB of commit free, main and this interleaved, 3 runs each: 12.7-15.2 s -> 6.35-6.71 s wall (5.3-5.6 s with no gate at all); DXIL digest identical. Tests: `gate_tests` (the rule, short commit / one escape per interval, 32 threads never exceeding what the commit allows); `cargo test --workspace --release` green on an RTX 3090 with the Agility SDK (0 GPU skips). Driver PSO compiles are still not gated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ignored test for measuring compile changes: every program of a folder of console containers (`XCL_BENCH_DIR`) translated as a title does (`XCL_BENCH_WINDOWS`, `XCL_BENCH_SPLIT`) or saved HLSL (`XCL_BENCH_HLSL=1`), compiled on `XCL_BENCH_THREADS` threads with `XCL_DXC_ARGS`. Prints translate time, HLSL and DXIL digests (an HLSL change that keeps the DXIL shows the same DXIL digest), DXC wall / per-program times, cost per KB and peak commit; `XCL_BENCH_TIMES=<file>` writes each program's time, `XCL_BENCH_SLICE=k/n` splits a folder across processes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5d84b26 to
03e2efe
Compare
…ed commit The test computed its limit from one `GlobalMemoryStatusEx` reading while the gate reads the commit again at every decision: memory another process freed mid-test let the gate rightly admit more than the test allowed (review on ivall#139). It also ignored a failed reading, and other tests' compiles share the real gate's count. The gate is now a `Gate` (running count, lock with the last escape, wake-up) and `admit(gate, commit)` takes the commit reading; `wait_for_memory` is `admit(&GATE, available_commit)`. The test gives a gate of its own a fixed commit with room for exactly three and asserts that three run at once (the first ones in wait until the cap is full) and never four. A gate that lets one more in fails it (peak 4); 30 runs of `gate_tests` in a row pass. A second test sends 32 workers through the real gate and checks they all finish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks – you're right, the test could fail on a correct gate: its limit came from one reading while the gate re-reads commit per decision, and other tests' compiles share the real gate's count too. Fixed in 03e2efe: the gate is now a |
|
Measured on a machine with little commit: Ryzen 5 1600 (6C/12T), 16 GB RAM, 20.7 GB commit limit, GTX 1650, Windows 11 26300, DXC from SDK 10.0.26100, 11 DXC threads, debug build. Synthetic bench, no game data: 200 different compute shaders through
So about 14 % less here. These shaders are small and alike, so this says little about memory growth of big programs. The 4
|
|
Read: AI-assisted review (Gemini + Claude); code read only, not run. |
|
AI-assisted review (Claude Code). Windows 11 (10.0.26200), Ryzen 9 9950X (32 threads), Rust 1.99.0 MSVC, debug build, Windows SDK DXC 1.7.2308. Synthetic programs only, no game files, no GPU. Tested The PR's Method: real concurrent DXC compiles through the gate, against a fixed commit budget.
One compile alone grows private commit by 160 MB for a 2000-round program (987 KB of HLSL) and by 460 MB for 4000 rounds (1.9 MB). A probe of 8000 rounds (3.8 MB, 65 s) grew 1.5 GB.
* In S3 the budget is below floor + one compile, so any running compile puts the commit under 6 GB. That is the "one at a time" case working as intended. What this shows:
Accounting finding: 300 MB per running compile is too little for bigger programs, and compiles that start together aren't counted at all.
A cheap improvement: scale the reservation with the source, e.g. reserve per compile by HLSL size, since growth here went roughly with size: 160 MB at 1 MB, 460 MB at 1.9 MB, 1.5 GB at 3.8 MB. Or keep the per-compile reservation until the compile ends instead of only counting it. Even in S2 the PR stays better than the base, whose stampede reached 2.9 GB. Not tested:
|
|
Linux / Wine / GNU run of Setup: Ubuntu 24.04, cross-built for
All four new Not covered: the rebased PR; a run with little commit (this machine isn't short of it); AI-assisted test report (Claude); tests run locally as stated. |
The memory gate from #113 throttles DXC hard on a normal desktop. With 8.1 GB of commit free, Minecraft Preview's 716 programs took 12.7–15.2 s on the default 15 threads; with this change, 6.35–6.71 s. The DXIL is identical.
What was wrong
wait_for_memorylet a compile start while the system had 6 GB of commit left plus 1 GB for every compile already running.Changes (
crates/xcl/src/gpu/recomp/dxc.rs)may_start: a compile goes in at once while commit covers 6 GB plus 300 MB per running compile. The 300 MB covers their growth still to come; Faster shader compiles: one window switch per four dwords, every core, --precompile builds the cache titles use #113 measured a typical retail compile's peak at 0.1–0.3 GB. With less, compiles go one at a time.HANDOFF.md: the two places that describe the gate are updated.The second commit adds
dxc_bench_folder, an ignored test that times DXC for a folder of console shaders and prints HLSL and DXIL digests. It's how the numbers below were measured; drop it if you'd rather not have it.Numbers
Ryzen 7 5700X (8 cores / 16 threads), RTX 3090, DXC 1.9.2602, Minecraft Preview's 716 programs, 4 memory windows, default 15 threads. Free commit was 8.1 GB before every run. Both builds use the same benchmark, run interleaved, 3 runs each:
main(484dd57)mainand with this PR.Checked
cargo test --workspace --release --no-fail-faston an RTX 3090 with the Agility SDK 1.616.1: everything passes, 0 GPU skips.gate_testscovers the rule, short commit (one at a time, one escape per interval) and 32 threads through the real gate never exceeding what the commit allows.dxc.rs.mainhits the same way (being looked into separately).Not covered
xcl-psoworkers are still not memory-gated.🤖 Generated with Claude Code