D3D12.X: zero recycled vram::Pages tiles before reuse #2759
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2759
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2759"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@itsSio on GitHub · 2026-11-26 10:21 UTC · original
itsSio:d3d12x/zero-recycled-vram-tiles→main· +410 −24 · 1 files · 1 commits · openTilePoolhands cooled recycled tiles back toPages::bind_rangewith stale GPU bytes from their previous texture, which can surface as tile-shaped garbage blocks on newly bound render targets, depth buffers, and UAVs (part of#505, recycled-tile finding). This change tracks recycled dirty bits per backing heap inTilePooland lazily zeroes dirty recycled tiles onPages::queuebefore mapping them to the new resource. If zeroer initialization, reset, or command-list close fails,Pages::bind_rangereturns the reserved tiles toTilePoolwith their dirty bits restored and returnsNoneinstead of publishing an unzeroed mapping. Fresh heaps fromCreateHeapand same-address live orIDLEaliases incur no extra GPU work.What is in it
D3D12.X: zero recycled vram::Pages tiles before reuse(e5404036):crates/xcl/src/hle/d3d12x/vram.rs(TilePool::dirty_tilesper-heap bitset set indrain_cooling, restored on rollback inreturn_tiles, cleared onadd_heap_at/reclaim_empty_heapsand after successfultake_batch; lazyPages::Zeroerreturningboolsobind_rangerolls back and returnsNoneonZeroer::new,Reset, orClosefailure; unit teststile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollbackandtile_pool_return_tiles_restores_dirty_bits_after_take_batch; GPU testrecycled_pages_tiles_are_zeroed_before_reuseverifying recycled-tile zeroing and same-VAIDLEalias preservation)Tested
Commit
e54040363979e2c629e45e323bd0f84b692770e4(based onmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7), clean checkouts on each PC, debug builds for workspace tests and release builds for retail smoke runs.recycled_pages_tiles_are_zeroed_before_reusefailed without the fix (recycled tile row 0 leaked non-zero data: [ff, 00, ff, ff, ...]) and passes with the fix.32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace: exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1438 passed, 0 failed, 47 ignored.SKIPPED: 26 (wave64-only GPU tests,#1426wave32 f16/cvt refusals,heap_window_out_of_memory_falls_back_to_the_switch_form,pso_measurement_compiles_an_exact_synthetic_record0x887A002D).cargo test -p xcl --lib vram:: -- --test-threads=1 --nocapture: 22 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing), 0 SKIPPED (recycled_pages_tiles_are_zeroed_before_reuseandtile_pool_return_tiles_restores_dirty_bits_after_take_batchboth passed on the RTX 5080).32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace: exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1438 passed, 0 failed, 47 ignored.SKIPPED: 29 (same 26 as PC 1 plus 3 requiringd3d12SDKLayers.dll).cargo test -p xcl --lib vram:: -- --test-threads=1 --nocapture: 22 passed, 0 failed, 1 ignored, 0 SKIPPED.Regression run
main(b49be183, RTX 5080, release):PR (
e5404036, RTX 5080, release):Not tested
#505tile-mosaic scene (the 60 s regression run above stays in the loading phase and verifies no performance/memory/stability regression onmain).Zeroer::new,Reset, orClosefailure on a live GPU (covered by source audit andtile_pool_return_tiles_restores_dirty_bits_after_take_batchonTilePool).>256tiles) and multi-copy (>16tiles) GPU stress paths.scripts/smoke.ps1on the RTX 2080 SUPER.AI use
Ran via Samaritan:
94c59303and theZeroer/reset/close error-rollback fix and unit test ine5404036, independently reviewede5404036, ran the pre-fix/post-fix repro, dual-PC workspace andvram::suites, and the fresh RTX 5080e5404036smoke run.94c59303(verdict PASS, 0 P0/P1 blockers) and re-ranvram::GPU tests on the RTX 5080.scripts/smoke.ps1baseline, ranscripts/pr_check.py --local, updated this PR description, and pushede5404036.@luckyteagirl on GitHub · 2026-11-26 10:25 UTC · original · reviewed
On
94c5930, a recycled tile can still be mapped with its previous texture's bytes if the zeroer cannot start. For example, if the first batch contains a dirty recycled tile and creating the zeroer's upload buffer fails,Zeroer::newreturnsNone.zero_tilesreturns without submitting any clear, butbind_rangecontinues to map the tile and reports success. The reset and command-list-close error branches also proceed without clearing the affected chunk. The caller's non-tiled fallback only runs when the bind reports failure.Could
zero_tilesreport failure sobind_rangecan stop before publishing the new mapping and return all selected tiles with their original dirty bits?take_batchalready clears dirty bits on success, so the existing reservation rollback alone would need to restore those bits in this case. A failure-injection fixture could exhaust fresh tiles, recycle one dirty tile, fail zeroer initialization, then assert the bind does not publish a mapping and that a subsequent reservation still flags the tile for clearing.This is an exact-head source review. I did not inject a D3D12 failure or run a GPU test.
@oni-swr on GitHub · 2026-11-26 10:42 UTC · original
amd-win test report for
94c5930(head at the time of the run; merge-base withmainisb49be18). Library tests only: I did not runscripts/smoke.ps1or a retail title, and no integration tests (crates/xcl/tests/).Environment
XCL_ADAPTER=7800,XCL_REQUIRE_GPU=1,cargo -j 4, separate target dirTested (all with the PR checked out detached at
94c5930)cargo test -p xcl --lib vram -- --test-threads=1: 23 passed, 0 failed, 1 ignored. Includes the two new tests,recycled_pages_tiles_are_zeroed_before_reuseandtile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollback, both ok.cargo test -p xcl --lib d3d12x -- --test-threads=1: 256 passed, 0 failed, 2 ignored.cargo test -p xcl --lib -- --test-threads=4: 1310 passed, 1 failed, 27 ignored.Result
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722: res[30] = 0x1, CPU 0x7fffffff). It fails with the same message on the merge-baseb49be18(cargo test -p xcl --lib fuzz_validate_and_gpu_1), so it is not caused by this PR.SKIPPED(f16_programs_on_the_gpux4,f32_programs_on_the_gpux2: unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 per-lane forms). They are not counted as coverage and are unrelated to vram.Not tested
scripts/smoke.ps1main vs head, so the maintainer's regression-run requirement is not covered by this report.AI use: Claude Code (Claude Sonnet 5.5) ran the verification and wrote this report; Claude Code (Claude Opus 5.5) coordinated. Results are from the runs above.
@emirduran707 on GitHub · 2026-11-26 10:46 UTC · original
Independent AMD RDNA4 (native wave64) verification of exact PR head
94c593033ba03fb5a2302786ff810483be13663don Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC1.9.2602.17).Tested
cargo build --workspace(debug): passed (0errors).cargo test --workspace --no-fail-fast -- --test-threads=4:1435 passed, 2 failed, 47 ignored(8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1heap_window_out_of_memory_falls_back_to_the_switch_formno heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::vram::tests::recycled_pages_tiles_are_zeroed_before_reusehle::d3d12x::vram::tests::tile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollbackgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1andfuzz_validate_and_gpu_3) are pre-existing on unmodifiedmainon this RX 9060 XT / driver32.0.31044.16.cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):(Compare against
mainb49be183on this machine:1603 frames, 18576 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@luckyteagirl on GitHub · 2026-11-26 10:50 UTC · original
I ran the recycled-tile fixture on Windows at
94c593033ba03fb5a2302786ff810483be13663dto add RX 6800M evidence for the successful zeroing path.Tested
Windows 11 Home build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver
30.0.13002.13003, and Rust 1.99.0 MSVC.XCL_ADAPTER. It passed. A separate inbox D3D12 probe found the integrated Radeon was the default, but the fixture did not print its device LUID.AMD Radeon RX 6800Mexplicitly and verified the created device's LUID against the DXGI adapter. It printed PCI1002:73df, LUID00000000:00014d72, and passed. The overlay changed only adapter setup in this test and was restored afterward.Both runs used
XCL_REQUIRE_GPU=1and each exited 0 with 1 passed, 0 failed, 0 ignored, 1,337 filtered out, and no skip markers.Not tested
Zeroer initialization, reset, or close failures were not injected. I did not run the full workspace suite or a title.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the tests, prepared and restored the adapter overlay, and drafted this report.
94c593033btoe540403639@itsSio on GitHub · 2026-11-26 12:08 UTC · original
Thanks for the thorough review @luckyteagirl. Pushed squashed commit
e54040363979e2c629e45e323bd0f84b692770e4addressing all three failure branches (Zeroer::new,Reset, andClose) and updated the PR description with fresh dual-PC results and ane5404036RTX 5080 smoke block:Pages::zero_tilesnow returnsbool(falseifZeroer::newreturnsNone,alloc.Reset/list.Resetfails, orlist.Closefails after unmapping the scratch buffer).TilePool::return_tilesrestores each returned tile's dirty bit so failed-zero rollbacks keep recycled tiles marked dirty for subsequent reservations.Pages::bind_rangechecks!self.zero_tiles(dev, &to_zero)and callsself.pool.return_tiles(&fresh); return None;before publishing any mapping.tile_pool_return_tiles_restores_dirty_bits_after_take_batch.Tested (
e5404036)32.0.16.1088, Ryzen 7 9800X3D, Win11 26200,rustc 1.97.0, DXC1.9.2609.5): full workspace1438/0/47(26 SKIPPED),vram::22/0/1(0 SKIPPED), 60 s smoke1669frames (0removals/crashes).32.0.16.1088, Ryzen 5 5600X, Win11 26200,rustc 1.99.1, WinSDK DXC1.8.2502.11): full workspace1438/0/47(29 SKIPPED),vram::22/0/1(0 SKIPPED).Not tested
Zeroer::new/Reset/Close(rollback dirty-bit restoration is covered by the newTilePoolunit test and source audit).AI use
Ran via Samaritan:
e5404036error-rollback fix and unit test and ran the dual-PC workspace,vram::, and smoke checks.pr_check.py, pushede5404036, and posted this update.@Decodere on GitHub · 2026-11-26 12:50 UTC · original
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2759 at
e54040363979e2c629e45e323bd0f84b692770e4(exact parentorigin/mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.Setup
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)title: 29640639viascripts/smoke.ps1 -Seconds 60(XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)Targeted RTX 4060 release unit tests (
e5404036)cargo test --release -p xcl --lib tile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollback -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit0).cargo test --release -p xcl --lib tile_pool_return_tiles_restores_dirty_bits_after_take_batch -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit0).cargo test --release -p xcl --lib recycled_pages_tiles_are_zeroed_before_reuse -- --nocapture: 1 passed, 0 failed, 0 ignored (0.26 s, ran live on RTX 4060,0skipped, exit0).cargo test --release -p xcl --lib hle::d3d12x::vram:: -- --test-threads=4: 22 passed, 0 failed, 1 ignored (2.50 s,churn_update_tile_mappings_timingignored,0skipped, exit0).Observations
tile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollback,tile_pool_return_tiles_restores_dirty_bits_after_take_batch, and live RTX 4060recycled_pages_tiles_are_zeroed_before_reuse) plus the full 22-testhle::d3d12x::vram::module passed cleanly in--releaseon exact heade5404036with0skips.exit: 0x0,1570frames shown,60 60 60steady-state presents per 2 s,0device removals,0crashes,13987 MBpeak commit vs parentb49be183's14018 MB/1518frames).Paired 60 s RTX 4060 smoke (
b49be183vse5404036)Parent
origin/main(b49be183):PR #2759 head (
e5404036):Limits of coverage
e5404036(only targetedhle::d3d12x::vram::release tests plus paired quiet 60 s smoke).Zeroerfailure/rollback preservation and recycled-tile GPU zeroing are exercised by the 3vram::testscases above.RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.AI use
Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from
cargo testandscripts/smoke.ps1outputs.@Aniseto on GitHub · 2026-11-26 12:57 UTC · original
Ran the VRAM tile-recycling tests at
e5404036: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 three new tests pass here, including the GPU test
recycled_pages_tiles_are_zeroed_before_reuseon the real adapter. The ignored test is the existingchurn_update_tile_mappings_timing.What this adds: the author tested an RTX 5080 and an RTX 2080 SUPER with the same driver. This is a third NVIDIA host (Blackwell, 16 GB) and the thread has no report from another machine.
Not tested: the title's tile-mosaic visual A/B, injected zeroer failures, multi-chunk/multi-copy stress, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64, 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.
@SzczepanGrela on GitHub · 2026-11-26 13:30 UTC · original
RX 9070 / Wine verification of recycled-tile zeroing, including multi-chunk/slot-reuse coverage and a combined-suite limitation.
Tested
e54040363979e2c629e45e323bd0f84b692770e4against mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.#[cfg(test)]module on both revisions. Every original source byte was preserved and verified.1002:7550, LUID00000000:000003ef. It verifies reused physical tile identities, every recycled pixel byte, and every same-VA alias pixel. The two assertions about the newpages.zeroerfield are omitted in this shared fixture so it also builds on main.XCL_NETWORK=0, private caches, direct invocation of Windows libtest binaries through GE-Proton Wine with--exact,--nocapture,--test-threads=1. Each paired case was repeated in three fresh processes per revision.ff 00 ff ff)With the head's unchanged 256-tile chunk size and eight slots, the 4096-tile case exercises 16 chunks and slot reuse. This coverage follows from the observed tile count and the unchanged batching code; no production instrumentation was added.
The original
recycled_pages_tiles_are_zeroed_before_reusealso passed 3/3 standalone invocations on the head, without changing its default-device setup.Combined-module results and controls
Filter
hle::d3d12x::vram::tests::, separately at 1 and 4 threads. Main module runs omit the local negative-control fixture; head module runs include it.--skip d32s8_targets_take_their_own_size_of_video_memoryThe common failure is
d32s8_targets_take_their_own_size_of_video_memory. On the head, both the original recycled-tile test and the local fixture also fail in the combined run. All three errors occur atCreateCommandList, returning0x80070057. Those two recycled-tile tests pass standalone and in the module with D32S8 excluded. A separate fresh-process D32S8 invocation fails at that API call on each revision. These are observations, not a root-cause attribution.The ignored test is
churn_update_tile_mappings_timing. No runtime skip markers. All 25 process summaries, failure names, readback markers, executable hashes and source inventories were checked independently.Not tested
Injected zeroer initialization/reset/close failures, other formats, native Windows, full workspace suite, retail visual behavior, smoke workloads, performance or FPS. The combined module is not a clean pass on this setup.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, adapted the local fixture, ran and verified the paired tests and controls, and drafted this report. Publication authorized by the account owner.
@Royalflamejlh on GitHub · 2026-11-26 13:48 UTC · original
Under Wine + vkd3d-proton on an RTX 4070, this pull request's
vram::tests passed in 3 of 3 runs, and the title stopped presenting between 76 and 87 s in all five runs (78 to 82 s with it, 76 and 87 s without), with no device removal. From 42 to 68 s the runs with it made a median of 837 to 1,100 submissions per 2 s, against 64 and 95 without it.Setup:
mainb49be18+ #684 (e56dbc3, which our runs need to get this far), against the same + this pull request (e5404036), release, Wine 11.21 Staging + vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB, driver 615.71.09. Title: 120 s each, A pressed once the title presented steadily,XCL_PSO_PRELOAD=0, the first-run screens completed once, no story progress. Tests:-- vram:: --test-threads=4, with vkd3d-proton's device filter leaving only the RTX 4070 (Skipping: Device filterfor the others).main+ #684main+ #684submitscount is everyExecuteCommandListsthrough XCL's queue hook (real.rs:7291), andzero_tilesmakes one submission per 256 recycled tiles a bind takes (thechunksloop atvram.rs:888,ExecuteCommandListsatvram.rs:912). No run separated them by queue. Presents were alike up to 40 s (769 to 779 per run from 14 to 40 s) and fewer with it from 42 to 68 s (204 to 226, against 268 and 291).vram.rs:900) and is its own submission. WithZERO_SLOTS= 8 (vram.rs:621), a ninth chunk whose slot's copy is still on the GPU waits on the fence with a null event (vram.rs:895). That wait holdsPAGES(vram.rs:1186,1496), whichbefore_executetakes before every title submission (vram.rs:1386). I did not measure whether it waits. Is a blocking wait under that lock intended during loading?d32s8_targets_take_their_own_size_of_video_memoryandrecycled_pages_tiles_are_zeroed_before_reusepassed together in thevram::module here, in 3 of 3 runs at 4 threads (that report's local fixture was not run).Not tested: Windows; the new tests without this pull request; an injected
Zeroer::new,ResetorClosefailure; the title past the point where it stops here, so not the #505 scene; the whole test suite.AI use: Claude Code (Claude Opus 5.5) ran the title and the tests and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@safesearch77 on GitHub · 2026-11-26 14:09 UTC · original
Reviewed
e5404036againstmain(b49be183). The tile bookkeeping holds up: dirty bitsare only cleared after
take_batchsucceeds, so the OOM rollback keeps them, and reclaimedheap slots are reset. One thing that breaks once it meets
#2385:#2385and#2759apply cleanly on top of each other, but the result does not compileunder
cargo test.#2385(005a4427) adds a sixth parameterskip: &[bool]toPages::bind. The new testrecycled_pages_tiles_are_zeroed_before_reusecalls thefive-argument form three times:
pages.bind(&dev, &tex_a, 0x10_0000, None, total),... &tex_b, 0x20_0000 ...and... &tex_c, 0x20_0000 .... Onmain+#2385+ this PR:Whichever of the two merges second needs
&[]as the last argument at those three calls(
#2385's own tests pass&maskor&vec![false; total as usize]).cargo buildisunaffected; only
cargo test --workspacebreaks, soCIon the second PR to land willfail rather than the merge being refused.
Checked with
cargo check --testson a scratch tree (main+#2385+#2759),x86_64-pc-windows-gnu, compile only; nothing was run.AI use: Antigravity (Claude Sonnet 5.5) applied both patches and compiled the combined tree;
the error output above is from that run.
@tiagonleal on GitHub · 2026-11-26 15:07 UTC · original
Suite on RTX 5070 Ti (Windows 11) at
e5404036: 1434 passed, 4 failed (the fuzz out-of-memory ones, same onmain); all three new tests passTested
e54040363979e2c629e45e323bd0f84b692770e4(parentmainb49be183), clean detached worktree, built as is, debug. PR open and head unchanged when I started.cargo build --workspace: ok.cargo test --workspace --no-fail-fast -- --test-threads=4: 1434 passed, 4 failed, 47 ignored.SKIPPED: 21 "no wave64", 3 wave32 per-lane forms refused (f16 arithmetic, f16 packed, f32 conversions), 1heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, eachCreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E). They fail the same way onmainb49be183(cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu: 0 passed, 4 failed).cargo test -p xcl --lib -- vram:: --nocapture --test-threads=1: 22 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing). It includestile_pool_marks_recycled_tiles_dirty_and_preserves_dirty_on_rollback,tile_pool_return_tiles_restores_dirty_bits_after_take_batchandrecycled_pages_tiles_are_zeroed_before_reuse. The GPU one ran; it was not skipped.Not tested
AI use
@thehollowedone on GitHub · 2026-11-26 15:28 UTC · original
Independent native D3D12 measurement on #2759 head
e5404036, following the question about command-slot fence waits. I used a disposable test-only enlargement ofrecycled_pages_tiles_are_zeroed_before_reuse: an 8192×8192 RGBA8 reserved texture (4,096 tiles, 256 MiB), so the recycled bind runs 16 zeroing chunks and reuses the eight command-list slots. I counted only calls where the slot fence was incomplete beforeSetEventOnCompletionand timed thezero_tilesCPU call.Windows 11 build 26300; RTX 3080 Ti (621.35); Ryzen 7 9800X3D; rustc 1.99.1 MSVC; DXC 1.8.2502.11.
cargo test --offline --locked -p xcl --lib recycled_pages_tiles_are_zeroed_before_reuse -- --nocapture --test-threads=1passed in six fresh processes: each 1 passed, 0 failed, 0 ignored, 0 skipped. All 8,192 readback rows of the recycled texture were zero; the existing same-address alias check passed at rows 0, 4095 and 8191. Each run processed 4,096 recycled tiles in 16 chunks. Incomplete slot-fence waits were 0/6 runs. Thezero_tilesCPU call took 9.50–10.79 ms across those runs; that includes queue submission and mapping calls, not GPU completion.The production path can hold
PAGESwhile waiting for an unfinished slot, but this local fixture constructsPagesdirectly, and none of these six runs entered that wait. These results neither measure title-thread lock contention nor identify the cause of the Wine run's extra submissions. A native title comparison would need to count internal zeroing submissions separately from title submissions and time actual incomplete-slot waits. No title files or retail run were used; I did not run the full workspace suite on this test-only overlay.Exact test-only instrumentation diff (restored after testing)
AI use: Codex (GPT-6.2 Sol) reviewed the queue and fence path, ran the six synthetic GPU checks, and drafted this report.
@pvfreis on GitHub · 2026-11-26 16:00 UTC · original
By reading only, not run, at #2436
bab2f537and #2759e5404036merged ontomain8b957bec(clean merge): together these two can self-deadlock onPAGESunless #2703 (9e518da4) lands with or before them.place_on_pagesholdsPAGES(vram.rs:1404) and callspages.bind(vram.rs:1412) →zero_tiles(vram.rs:1171) →self.queue.ExecuteCommandListsinsideown_work(vram.rs:1091-1092).vram.rs:916), so it is adopted (real.rs:2899,3196) and itsExecuteCommandListsisq_execute_command_lists(real.rs:2945).own_workonly makesrefreshreturn early (title_textures.rs:708).q_execute_command_listsstill reachespresent::note_execute(real.rs:7464) →late_release::drain_known(false)(present.rs:316). When that drain finds a parked texture whose batch every queue is past, it calls #2436'svram::recycle_ready(late_release.rs:146), which locksPAGESagain (vram.rs:296), astd::sync::Mutex(vram.rs:28,905), on the same thread. The recycle pool is on by default (vram.rs:137-139). It depends on timing (thexcl-late-releasethread and other submits drain too); both halves are busiest while textures stream.main,vram.rshas noExecuteCommandListsoutside tests, and without #2436 there is norecycle_ready.amd-dev already hit this mechanism, with its own zeroing (
d625b209a,flush_zero_tilesunderPAGES) and the #2436 port (d40d02733). It was fixed there byb3931948a, which is #2703's diff. #2703's description reports the deadlock onamd-devb5c0275fatt=36sonPAGES.lock(), and bobosneefdev's report on #2703 has the symbolized stack (2 of 5 runs there). On the merge with #2703 added (clean), theis_own_work()early return (real.rs:7433) comes beforenote_execute, which breaks the chain.Ask: merge #2703 with or before #2436 + #2759.
AI use: Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.
@itsSio on GitHub · 2026-11-26 19:30 UTC · original
Thanks for the measurements and merge-interaction checks:
ZERO_SLOTS = 8(2,048 tiles = 128 MiB of in-flight zero fills) is intended backpressure to bound the zeroer's command-allocator pool rather than growing it during loading. As @thehollowedone measured on native D3D12 (4,096 tiles / 16 chunks wrapping the 8 slots twice on RTX 3080 Ti,0/6incomplete slot-fence waits), the GPU copies finish well ahead of wrapping the ring on Windows; the highersubmitscounter underXCL_ACTIVITYis expected because each 256-tile chunk submits onPages's queue through theExecuteCommandListshook.#2385Pages::bind6thskipparameter): noted — if#2385merges first, I will rebase and update the threepages.bind(...)test calls inrecycled_pages_tiles_are_zeroed_before_reuseto pass&[].#2436+#2703PAGESre-entry): agreed — merging#2703with or before#2436+#2759keepsq_execute_command_lists'sis_own_work()early return ahead ofpresent::note_execute/late_release::drain_known. Happy to keep#2759minimal againstmainas-is unless maintainers want it stacked on#2703.AI use
Ran via Samaritan:
vram.rslines one5404036and drafted this reply.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.