Repository navigation
Conversation
Preparation for buffers a title places outside the memory windows (xcl-dev#505), not called yet: `sparse::place_buffer_when(.., lazy)` makes the reserved resource without tiles and `sparse::use_range(va, len)` gives the lazily placed buffers there the window's video memory when a list is about to use an address of them. `place_buffer` is `place_buffer_when(.., false)` and behaves as before. The newer retail title places 128+ GPU-only buffers (~580 MB) at start; in a lab tree that gave them all video memory at once it ran out of RAM before the world, and lazily it had 108 / 526 MB in use 25 s into the world. `use_range` checks two atomics before it takes the sparse state's lock, so a call for an address outside every lazy buffer costs nothing. A lazy buffer released before its first use leaves the list in `forget_in`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A buffer the title places (CreatePlacedResourceX) outside every memory window became a committed resource of its own, and every view of it an empty V#: shaders read zeros and their writes were dropped. The newer retail title (xcl-dev#505) places all its compute buffers - light, ray and tile lists, BVH data, 128+ buffers, ~580 MB - in plain reservations above its GPU views, so its final gather had no tiles and wrote nothing, and its targets kept other targets' bytes. Such a buffer, at an address with no committed CPU pages (only the GPU uses it), now gets an address in the sparse windows, placed lazily (`sparse::place_buffer_when`): its views name that address, root CBV / SRV / UAV addresses into it are rewritten to it, and it gets video memory when a draw or dispatch names it (a root address or a buffer V# in the first 64 slots of a bound table), a copy or an ExecuteIndirect uses it. A range with committed pages is placed as before. Measured in a lab tree with the same logic (RTX 5080): "empty V#" warnings went from hundreds to 0, the final gather's tile list was filled, and 573 of 578 MB of these buffers were in use by 365 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows/NVIDIA check of
Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop GPU (12 GB, driver 621.24, device confirmed by DXGI LUID), Rust 1.97.1 MSVC debug: 7 passed, 0 failed, 0 ignored, no reported skips. This checks mapping and GPU queue completion on the isolated path plus the existing address and table tests. Shader data readback through the alias, the full suite, and a retail title were outside this run. OpenAI Codex assisted with the synthetic test and verification. The exact model identifier was unavailable in this session. |
|
Ran the outside-buffer tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. All four pass here: the CPU-page check, the title-address-to-window map, the root address rewrite and the descriptor-table address tracking. These are unit tests; I did not run a title with these buffers. What this adds: the author tested an RTX 5080 (16 GB, same driver) and did the title measurements in a separate lab tree. This is a second Blackwell host with a different DXC version; the thread has no report from another machine. Not tested: this branch in a retail title, the ~580 MB buffer set described in the PR, AMD and Intel GPUs, tier-1 tiled-resource GPUs, the full workspace suite, a paired smoke run, Wine, release profile, title data. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2799 at Setup
Targeted RTX 4060 release unit tests (
|
| Metric (60 s quiet run, MB) | Parent #2798 (1b11d3d5) |
PR #2799 (321ada6a) |
Delta |
|---|---|---|---|
| Peak process commit | 14,019 | 13,386 | -633 MB (-632 MB vs main b49be183) |
Peak local VRAM (t ~ 18 s) |
6,176 | 5,610 | -566 MB |
End local VRAM (t ~ 58 s) |
6,115 | 5,550 | -565 MB |
End non-local VRAM (t ~ 58 s) |
4,685 | 4,650 | -35 MB |
target pages / arenas / sparse mapped (t ~ 58 s) |
3541 / 401 / 838 |
3540 / 401 / 838 |
unchanged |
- Lazy sparse placement of GPU-only outside-window buffers cut steady-state and peak local VRAM by ~565 MB and peak process commit by 633 MB on this 8 GB RTX 4060 right in the first 60 s, while keeping steady 60/2 s pacing (
1583frames shown,60 60 60,0device removals,0crashes,exit: 0x0).
Paired 60 s RTX 4060 smoke (b49be183 / 1b11d3d5 vs 321ada6a)
Merge-base origin/main (b49be183):
xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB
Parent PR #2798 (1b11d3d5):
xcl-smoke v1
commit: 1b11d3d54f2380d9a680192a8214246b97fc6ee8
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1558 (PresentX 1558)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14019 MB
PR #2799 head (321ada6a):
xcl-smoke v1
commit: 321ada6adef2953aeb0f49720b7f929fee1693a9
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1583 (PresentX 1583)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13386 MB
Limits of coverage
- Full workspace test suite was not re-run on
321ada6a(only all 145 targeted release tests acrosssparse::,bind::,device_x::,list_x::, andreal::plus paired quiet 60 s smokes). - The 60 s no-input menu/intro smoke confirms substantial local VRAM / commit savings (
-566 MB/-633 MB) with zero crashes or removals; visual inspection under extended interactive world-load compute dispatches was not performed on this host. - Single discrete NVIDIA 8 GB GPU (
RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.
AI use
Ran the targeted release unit tests, paired quiet 60 s smoke runs, and xcl.log memory comparisons with assistance from Google Antigravity (Gemini 4 Neon); all test counts, memory figures, and smoke blocks were extracted directly from cargo test, xcl.log, and scripts/smoke.ps1 outputs.
|
Reviewed
Checked with AI use: Antigravity (Gemini 4 Carbon High) traced the call graph and ran the host reproduction; |
|
Tested - retail title on native Windows AMD RDNA2, PR head Tool: OpenCode with DeepSeek V4.1 Flash 1017
The The 45,965 MB peak is late and transient: it happens at 527 s, after the stall, while 87 driver Not tested: world/FPS (never reached), NVIDIA/Intel GPUs, full workspace, debug build. AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests, read the logs and wrote this comment; the figures and warning counts were checked against the run logs. |
Stacked on #2798; only the top commit belongs here.
A buffer the title places with CreatePlacedResourceX outside every memory window became a committed resource of its own. Every view of it got an empty V# ("not in UMA"), so shaders read zeros and their writes were dropped. The newer retail title places all its compute buffers outside the windows, in plain reservations above its GPU views: light, ray and tile lists, BVH data, 128+ buffers, about 580 MB. Its final gather therefore had an empty tile list and wrote nothing, and its targets kept other targets' bytes.
Such a buffer, at an address with no committed CPU pages (so only the GPU uses it), now gets an address in the sparse windows. It is placed lazily (previous PR), and:
A range with committed pages is placed as before. Part of #505.
What is in it
crates/xcl/src/hle/d3d12x/real.rs:place_outside_buffer,has_cpu_pages, the title address -> window address map (dropped on the buffer's release),use_buffer; tests of the page check and the address map.crates/xcl/src/hle/d3d12x/device_x.rs:create_placed_resource_xtries it afterplace_at_title_address.crates/xcl/src/hle/d3d12x/bind.rs:outside_buffers_in_useinbind_abi(root addresses rewritten; buffers named by the root addresses and the tables' V#s get their memory),use_bufferfor ExecuteIndirect's argument and count buffers; tests oftable_addressesand the root address rewrite.crates/xcl/src/hle/d3d12x/list_x.rs:use_bufferfor CopyBufferRegion.crates/xcl/src/hle/d3d12x/sparse.rs:lazy_pending.Tested
cargo test -p xcl --lib -- outside_buffer table_addresses root_addresses_in_outside --test-threads=4: 4 passed, 0 failed.cargo test -p xcl --lib -- hle::d3d12x --test-threads=4(with the logging PR on top): 260 passed, 0 failed, 2 ignored, no SKIPPED lines.stable-x86_64-pc-windows-msvc, release.cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4on321ada6: 1437 passed, 4 failed, 47 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(CreateComputePipelineState: out of memory (0x8007000E)), which fail onmainas well. SKIPPED (the same as onmain): 21 "no wave64", 3 refused by the per-lane form,heap_window_out_of_memory_falls_back_to_the_switch_form,pso_measurement_compiles_an_exact_synthetic_record.main+ open PRs + lab work, not this branch), in the newer retail title:Regression run
main:
this PR:
Not tested
CreateShaderResourceView/ CBV by GPU address), and V#s past the first 64 slots of a table. They are not rewritten or mapped here, and the lab did not handle them either.AI use
main, added the CPU-page check, wrote the tests and this description; Claude Opus 5.5 (coordinating) ran the full suite and the regression runs and reviewed the diff.🤖 Generated with Claude Code