D3D12.X: make shadowed textures active again when a draw samples them #2956
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2956"
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?
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-27T04:43:23Z.
When a newer texture is placed over part of an older one,
title_textures::Table::insertshadows the older one (and unmaps it if the new placement covers a different range). Shadowed textures are never uploaded again. A title can still sample them, though. GTA 6 does this with the Bink Y/Cr/Cb planes of its credit-card scene: a newer placement lands over part of the planes, the GPU then reads zeros from them, and the cards render green with blocky streaks. In one 355 s run, more than 131k draws sampled shadowed textures.This change makes a shadowed texture active again when a draw binds it. The active textures that overlap it are shadowed but not unmapped. The texture is remapped if it was unmapped, marked pending unless the GPU wrote it, and its known content is forgotten, so the next submit uploads it again.
When two overlapping textures are made active in turn (one draw sampling both, or two draws before their lists are submitted), the second shadows the first again, but a draw already recorded samples it. That first texture is "displaced" until two frames later. Its source stays watched, so what the title writes there still goes up. If it was pending, the next refresh uploads it whole even when no page was written and no other texture is pending. Displaced textures go up before the active ones, so on shared video memory the active content wins. ettehn, andrewDoing, retrope13 and thehollowedone found these cases in review.
Part of #505. Based on nvidia-dev
d1be8103.What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs:Table::uncover,uncover_drawnandhas_shadowed(anAtomicBool, so draws skip the scan when nothing is shadowed);Table::displaced: textures thatuncovershadowed again, with the frame they expire at (present::counters+ 2) and whether their whole upload is still owed. They keep their source linked (watched ranges andtouched_by) untilrefresh_partsexpires them.HAS_DISPLACEDkeepsrefresh_partsfrom returning early while a whole upload is owed;a_sampled_shadowed_texture_is_active_again. Its table section covers the watch staying through a refresh before the expiry frame and going away at it, one link each after A and B swap back and forth, and a release clearing it. With only the "keep it linked" change taken out, it fails at "A's source stays watched";gpu_both_overlapping_textures_a_draw_samples_go_up. A then B are made active, one refresh, and both read back. It then runs the sequence write, refresh,note_gpu_write(B),uncover_drawn(A, B), refresh, and A must read back the current bytes. With only theHAS_DISPLACEDguard taken out, it fails at that readback.crates/xcl/src/hle/d3d12x/bind.rs:uncover_bound_tablesreads the first 64 slots of each bound descriptor table that hold a T#. It resolves them to title textures throughconsole_heap::named_by_indexand passes them touncover_drawn. It is called frombind_abiand, for graphics only, fromprepare_two_pass_stage.Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on2608ea23: 1822 passed, 12 failed, 48 ignored, summed over alltest resultlines.d1be8103without this change. I ran each failing test binary or filter there.split_compute_prefers_the_offline_whole_pipelineandtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobseach count twice, because their harness runs them again. The failing tests:fuzz_validate_and_gpu_0..3;texture_upload::tests::pieces_hold_the_texels_of_their_levelsandgpu_parts_of_a_texture_go_up_and_the_rest_stays("attempt to multiply with overflow" at texture_upload.rs:1002, debug builds only);d3d12_mesh_streamconsole_ms_in_as_slot_and_ms_with_as_are_refused_cleanly;gpu_compute_e2easync_compute_pso_registers_real_pso_and_not_standin, andsplit_compute_prefers_the_offline_whole_pipeline(twice);gpu_two_pass_cache_e2e, twice.SKIPPEDlines, for these reasons: no wave64 (21), no heap windows, no debug layer / d3d12SDKLayers.dll, a driver cache that cannot be disabled, and refused f16 instructions.cargo test -p xcl --lib title_textures -- --test-threads=1: 31 passed.eae01502and on the first version of this PR (8fb41275), with the same environment:Regression run
The main block is from
b49be183, the last main commit before the shader-preparation screen (#2555). On the current main tip, shader preparation did not finish within 2 h on this machine. All blocks were made withXCL_PRESS_A_AT=70andXCL_DXC_DIRset, one run at a time, with warm shader caches, and withxcl.execopied asexoborne.exe, a name that gets NVIDIA's 2 GiB shader heap (#2403). Under the normal name, the based1be8103and this PR both lose the device (0x887a0005) at 123–126 s, in 3 of 3 rounds each, as video memory passes the 15.2 GB budget. Mainb49be183does not, even in a 160 s run. In runs 12/1 (this PR) and 13/1 (the base), the first start under the new exe name spent ~69 s on shader preparation. The A press at 70 s came before the title read input, so the world never loaded. Those two blocks are shown but left out of the comparison. Set 12 ran main and this PR in turn, set 13 the base and this PR in turn. Every block is below, unedited, labelled set/round.Against the mean of main's two runs (leaving out the two runs that missed the A press):
pr_check fails on these blocks: this PR has fewer frames and a higher peak commit than main. The base fails the same check, because nvidia-dev itself is at about 75 % of main's frames and 125–135 % of its commit in this scene. Against the base, this PR is within the run-to-run spread on frames and a few percent higher on commit (figures above).
These blocks are on
d1be8103. nvidia-dev has since moved tof8de0bf4. This PR merges onto it without conflicts, and none of the files it changes were touched there. I have not rerun the blocks onf8de0bf4.Run 12/1, this PR,
2608ea23(no A press: left out of the comparison):Run 13/1, nvidia-dev base
d1be8103(without this change) (no A press: left out of the comparison):Run 12/1, main
b49be183:Run 12/2, main
b49be183:Run 12/2, this PR,
2608ea23:Run 13/2, nvidia-dev base
d1be8103(without this change):Run 13/1, this PR,
2608ea23:Run 13/2, this PR,
2608ea23:Not tested
2608ea23stopped with a device removal (0x887a0020) while thesparse.rstests ran. This PR does not touchsparse.rs, and the same job stops with a device removal during thesparse.rstests on 9 other PR branches from 27–28 Nov. Those tests pass here.AI use
displacedfix and the two fixes for the cases found in review (theHAS_DISPLACEDguard and keeping a displaced texture watched until it expires), and their tests. It also ran the test suite, the base checks of the failing tests and the smoke runs on2608ea23.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T05:00:27Z.
I checked the overlapping-descriptor case called out under Not tested on
8fb41275. A standalone Windows x64 fixture used the PR’s descriptor scanner,uncover_drawnandTablewith fake resources.Astarts shadowed andBis the active overlapping placement. With one bound table, the results were:AAAA, BBBB, AAAThere is a potential correctness case beyond repeated uploads. The scanner visits table entries regardless of which slot the shader actually samples. If a draw uses only A with B also present later in the table, B can undo A’s reactivation before submission and remove A from the pending set. This verifies CPU state and descriptor traversal only, with COM and GPU operations stubbed. Pixel output and frame-time cost remain unmeasured.
OpenAI Codex assisted with verification.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T05:10:57Z.
I followed up on the overlapping-descriptor observation with a native GPU readback on RTX 5070 / NVIDIA 616.92. This uses the direct parent
eae015021c639866ab061cdff2e9daf8ba9daac5and PR head8fb41275ee8b5fbb3191f559cc767d6e9072e832, each in a separate build target and each case in a fresh process.Two 64×64 R8 committed textures had partially overlapping guest ranges. Each run verified A's initial GPU pixels and B's updated GPU pixels, then supplied an ordering directly to
uncover_drawn(on the PR head), called the production refresh, and read A back by GPU copy:The A-then-B case preserves all 4,096 old A texels, while the A-only and B-then-A controls restore all 4,096. This extends the earlier CPU-state report to the pixel consequence of the ordering. The fixture supplied the resource order itself; it did not execute descriptor scanning or shader sampling, use tiled resources, or run a retail title. It therefore does not establish the frequency or visual impact in gameplay.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed the results and prepared this report.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T05:16:32Z.
I tested a separate-draw case on RTX 5070 / NVIDIA 616.92, comparing the same two native draws on parent
eae015021c639866ab061cdff2e9daf8ba9daac5and head8fb41275ee8b5fbb3191f559cc767d6e9072e832in fresh processes. Two committed R8 textures have partially overlapping guest ranges. Each draw's pixel shader reads only its own texture and writes one 2,048-pixel half of an output target.For the head I supplied only the corresponding resource to
uncover_drawnimmediately before recording each draw, then called productionrefreshafter closing each list and before execution. This models the ordering of bind-time reactivation and submission-time refresh, but does not invoke the guest bind or KickoffX paths themselves.All stale A pixels matched the old value. Thus this synthetic committed-texture case also needs attention across draws in one submission: identifying exactly which resource each shader reads is insufficient if the second reactivation cancels the first before the shared refresh. The fixture did not exercise real guest binding, tiled resources, a retail title, or performance.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-27T05:46:31Z.
Verified PR #2956 (
8fb41275) independently on Windows 11 across NVIDIA Ada Lovelace (8 GB) and Intel UHD Graphics (targetedtitle_textures+bindruns) and reviewed the diff. All targeted tests pass on both GPUs and the full workspace suite shows zero new failures beyond the documentednvidia-deveae01502baseline.Environment
26300.9818)32.0.16.2140)32.0.101.7092)rustc 1.100.0(stable-x86_64-pc-windows-msvc), VS 2022 Build Tools17.14.45, Windows SDK10.0.26100.0(DXC1.9.2602.17)Test Results (
8fb41275)cargo test --locked -p xcl --lib -- title_textures -- --test-threads=12.63s, includesa_sampled_shadowed_texture_is_active_again)cargo test --locked -p xcl --lib -- hle::d3d12x::bind:: -- --test-threads=10.48s)cargo test --locked -p xcl --lib -- title_textures -- --test-threads=12.14s)cargo test --locked -p xcl --lib -- hle::d3d12x::bind:: -- --test-threads=10.51s)cargo build --workspace --locked && cargo test --workspace --locked --no-fail-fast -- --test-threads=4SKIPPEDlines)All 9 failures in the workspace run are a subset of the documented pre-existing
nvidia-deveae01502failures (gpu_compute_thread_limits_leave_the_lanes_past_them_out,texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,texture_upload::tests::pieces_hold_the_texels_of_their_levels,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,async_compute_pso_registers_real_pso_and_not_standin,split_compute_prefers_the_offline_whole_pipeline×2,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs×2;fuzz_validate_and_gpu_0..3passed here).Diff Review Notes
crates/xcl/src/hle/d3d12x/title_textures.rs:Table::uncoverpreservesby_va's disjointness invariant, updatespending_resandpending_deltacleanly on both displaced and restored entries, keeps displaced textures mapped for in-flight draws, resetsmax_shadowed_sizewhenshadowedempties, andHAS_SHADOWEDis updated across all four mutation sites (register,retire_overlapping,forget,uncover_drawn).uncover_drawnclones resources underTEXTURESand drops the mutex before callingvram::remap_if_unmapped/vram::map_levels, avoiding anyTEXTURES↔vram::PAGESlock-order inversion.crates/xcl/src/hle/d3d12x/bind.rs:uncover_bound_tablesshort-circuits viahas_shadowed(), safely falls back tocopy_readableoutside committed window 0, filters to texture T# descriptors (slot[15] >> 4 >= 8 && index != 0), and resolves byte-copied descriptors throughconsole_heap::named_by_index.Not Tested
#[ignore]tests in the workspace suite.(AI disclosure: diff review, test execution commands, and summary formatting were assisted by Antigravity / Gemini 4; all tests were executed locally on the hardware listed above.)
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-27T07:11:23Z.
Thanks @ettehn and @andrewDoing, the A-then-B case was a real bug, and your readbacks pinned it down. Thanks @retrope13 for the test run.
Fixed in
d5273351, squashed into the one commit. When a texture that is still pending is shadowed again by a lateruncover(one draw sampling both, or two draws in one submission), it now goes intoTable::displaced. The nextrefreshuploads it anyway, since a draw already recorded samples it, and it stays pending, so it goes up whole again if it is made active later.Tests:
a_sampled_shadowed_texture_is_active_againnow also checks that A stays pending and is queued for the next submit.gpu_both_overlapping_textures_a_draw_samples_go_up: two overlapping committed R8 textures,uncover_drawnwith A then B, onerefresh, then A and B read back. On8fb41275, A reads back the old bytes (0x11); with the fix, both match the current guest bytes. RTX 5070 Ti, driver 32.0.16.2124.Still open, and listed under Not tested: a texture that is active (not pending) and is displaced later in the same submission misses that submission's dirty-page updates, because those are tracked only for active entries. It catches up at the next refresh that has work.
AI use: Claude Code (Claude Opus 5.5) wrote this fix, its tests and this reply.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T07:22:06Z.
I reran the same two-draw native RTX 5070 fixture from my earlier report on updated head
d52733518f8a980a8218ffd0a78d2c527f4b4bc5, in an isolated build and fresh processes.Both focused runs passed without skips. As before, the fixture supplies each draw's resource directly to
uncover_drawnand models refresh timing; it does not run guest binding or a retail title. It does not cover the separate active-but-not-pending dirty-page limitation noted in the update.AI use: OpenAI Codex with GPT-6.2 Astra ran the retest; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-27T07:25:51Z.
Re-verified
d5273351(nvidia-dev) locally on Windows 11 26H2 (rustc 1.100.0, debug) across NVIDIA, Intel, and WARP:Results (
--test-threads=1)32.0.16.2140):cargo test --locked -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1: 31 passed, 0 failed (includinga_sampled_shadowed_texture_is_active_againandgpu_both_overlapping_textures_a_draw_samples_go_up)cargo test --locked -p xcl --lib hle::d3d12x::bind:: -- --test-threads=1: 53 passed, 0 failed32.0.101.7092):title_textures::tests::: 31 passed, 0 failedbind::: 53 passed, 0 failedXCL_ADAPTER=warp):title_textures::tests::: 31 passed, 0 failedbind::: 53 passed, 0 failedCode-reading note on
Table::displaced(crates/xcl/src/hle/d3d12x/title_textures.rs)One small edge case spotted while reading
d5273351:Table::uncover(lines 377-399), if a shadowed CPU-written textureAis uncovered (A.pending = true,PENDING:0 → 1) and then an overlapping shadowedgpu_writtentextureBis uncovered beforerefresh,Amoves intoself.displacedandpending_deltadropsPENDINGback to0(whileB.pendingstaysfalse).refresh_parts(line 1856): If no pages were dirtied since the last look (dirty_len == 0) andAGAINis empty,refresh_partsreturns early without drainingt.displacedor uploadingA(tracking an atomicHAS_DISPLACEDor includingdisplacedin that early-return check would close that gap; clearingself.displaced.remove(&res)inTable::remove/Table::uncoverwould also avoid stale entries across COM address reuse).Not Tested
d5273351or retail titles /xcl-smoke.gpu_writtenB+dirty_len == 0edge case above in a dedicated GPU test (code reading only).bind::tests::two_pass_binds_set_the_shared_view_heap(skipped withoutXCL_HEAP_WINDOWS=1).AI disclosure: Antigravity (Gemini 4) assisted with reading the
d5273351diff, running the local test commands, and drafting this report; all test runs executed natively on my Windows 11 RTX 4060 / Intel UHD laptop.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T08:26:57Z.
I reproduced @retrope13's
gpu_written/ displaced early-return case with native GPU output on RTX 5070 / driver 616.92, at headd52733518f8a980a8218ffd0a78d2c527f4b4bc5.The fixture uses partially overlapping committed R8 textures. It first uploads A's old value, updates the guest bytes, and gives B a distinct value through a real GPU copy followed by
note_gpu_write. It then supplies A and B individually touncover_drawnas it records two actual draws, with no subsequent guest writes. Each pixel shader reads only its own texture. Before refresh, A is displaced andAGAINis empty.0x190xc50x830xc5Each case ran in a fresh process. The normal case fails the expected-A assertion; the control passes it. This supports the early-return hypothesis and shows its pixel consequence in this fixture while preserving the GPU-written B value. The fixture supplies reactivation and the write notification directly; guest binding, tiled textures, retail incidence, and performance were not tested.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T08:53:11Z.
Follow-up to the native GPU reproduction on this head: I tested a narrow guard for the
gpu_writtenB / displaced A early return on #2956 headd5273351.PENDINGcounts active pending textures, so it can reach zero whileTable::displacedstill owes an upload for the next refresh. The candidate mirrors whether that set is nonempty in an atomic flag, includes it in the idle-return check, and removes queued IDs when a resource is released, retired, replaced or reactivated.On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC 1.8.2502.11, with
XCL_REQUIRE_GPU=1:gpu_both_overlapping_textures_a_draw_samples_go_uptest. After a guest write is consumed while A is shadowed, it marks B GPU-written throughnote_gpu_write, uncovers A then B, confirmsPENDING == 0and A displaced, and reads A after the next refresh. On the unchanged production head, 0 passed, 1 failed, 0 ignored, with A retaining its old pixel value. With the candidate, 1 passed, 0 failed, 0 ignored, all 4,096 A pixels current; no skip. This extension models the GPU-written state after B's GPU content was already updated by the fixture; it does not perform a new GPU copy for that marking step.cargo test --offline --locked -j 4 -p xcl --lib hle::d3d12x::title_textures::tests:: -- --test-threads=1with the candidate: 31 passed, 0 failed, 0 ignored. The unit test also checks that reactivated and released resources leavedisplaced.Local candidate diff (not committed)
This closes the measured early-return path for committed textures. The PR's separate active-but-not-pending dirty-page limitation still needs a focused regression and a design that retains those bytes through the refresh; this test does not validate placed/tiled overlaps, guest binding, a retail title, the full workspace suite, or paired smoke. AI use: Codex (GPT-6.2 Sol) wrote and ran the local GPU regression and candidate; Codex (GPT-6.2 Astra) independently traced the displaced-set lifecycle and refresh ordering.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T09:41:02Z.
On #2956 head
d5273351, I reproduced the active-but-not-pending case listed under Not tested. This is separate from the pending A / GPU-written B early return.The added table regression models A as already uploaded (
pending = false), with A and B overlapping in guest video memory but reading from distinct CPU source blocks. Afteruncover(B)displaces A,Table::uncoverunlinks A's source and does not add A todisplaced. The nextcached_watch_rangescan omit A's 16 MiB source block, andrefresh_partshas no displaced A to consider. The assertion below fails on the unchanged head at “A's source must stay watched until refresh.”Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC.
cargo test --offline --locked -j 4 -p xcl --lib a_sampled_shadowed_texture_is_active_again -- --test-threads=1: 0 passed, 1 failed, 0 ignored, no GPU skip notice. This verifies table bookkeeping, not GPU pixels or retail incidence for this case.Adding A only to
displacedwould not restore its missing watched range. A repair needs to keep the source watched, include an already-uploaded displaced A in dirty-page selection, and upload it only when dirty. The lifetime needs care:refresh_partsdrains the globaldisplacedset on any refresh, including an unrelated submission. Keeping the watch for one refresh alone can therefore lose a later CPU write before the command list that sampled A submits. Please retain the sampled resource obligation through the owning list's execution or replay (and clear it on reset/release), or provide an equivalent bounded way to keep displaced aliases eligible. Source changes, unmapping, andAGAINretries also need to preserve or retire that obligation correctly. I have not validated a production fix for those lifecycle paths. A GPU regression that submits the recorded draw after an intervening refresh and later CPU write would distinguish a complete fix from a one-refresh fix; a runtime change also needs the required paired smoke.Failing table regression
AI use: Codex (GPT-6.2 Sol) traced the relevant state transitions, wrote and ran the table regression, checked the lifecycle conditions, and drafted this report.
Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-27T12:20:59Z.
Tested PR #2956 (
d5273351) on Windows 11 with a paired A/B180 sopen-world run against its base (eae01502) and thetitle_texturesunit tests.Environment
32.0.16.2140)nvidia-devDXIL cache (XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE_GRAPHICS=0,XCL_DRED=1), Series S (lockhart) profile.Paired
180 sOpen-World Smoke Comparison (lockhart)PresentX)eae015020x00 / 01764109.31 s25679 MB8285 MB4288 MB3647 MB#2956(d5273351)0x00 / 01911122.32 s25488 MB8414 MB4353 MB3632 MBIn
#2956, once inside the open world (120.85 s–121.94 s), the title triggered the new reactivation path and logged:D3D12.X: 65 shadowed textures sampled by draws so far were made active again (0 needed remapping in this batch)(with1needing remapping per batch in earlier batches at120.85 s–121.81 s).Unit tests (
title_textures)Note on test stability when running
cargo test --locked -p xcl --lib -- title_texturesond5273351(31 tests total;placed_title_textures_share_vram_and_preserve_pixelsis newly added ond5273351and not present oneae01502):30 passed; 1 failed(hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels ... FAILED).-- --test-threads=1:31 passed; 0 failed(2.20 s).31 passed; 0 failed(2.26 s).So
placed_title_textures_share_vram_and_preserve_pixelspassed reliably sequentially and on retry, with one observed intermittent failure under parallel execution.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T19:19:52Z.
I retested the GPU-written B / displaced A early-return fixture from my earlier report on updated head
2608ea2367ead8d4aa43c9523ba7bad9b17e890d, RTX 5070 / NVIDIA 616.92. The test overlay changed only the displaced-set lookup to match the new map type.In the normal case (
PENDING=0,AGAINempty), both native draws now returned all 2,048 expected pixels: A was current (0x83), and B retained its GPU-written value (0xc5). On the earlierd5273351head, all 2,048 A pixels were stale. The unrelated-pending control also returned all expected A and B pixels. Each case ran in a fresh process, passed without skips, and left A tracked after the refresh, consistent with the revised retention behavior.This validates the specific synthetic early-return case. The fixture explicitly supplies resource reactivation and GPU-write notification; it does not establish retail rendering or cover every dirty-page and command-list lifetime case.
AI use: OpenAI Codex with GPT-6.2 Astra ran the test; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-28T00:33:49Z.
Thanks @retrope13, @andrewDoing and @thehollowedone for the two cases, the readbacks and the failing tests. Both are fixed in
2608ea23, squashed into the one commit and rebased onto nvidia-devd1be8103. Thanks also @LocranKing for the open-world run.Pending A displaced by a GPU-written B (the early return).
uncover_drawnsets the atomicHAS_DISPLACEDwhen a displaced texture still owes its whole upload.refresh_partsno longer returns early while it is set.gpu_both_overlapping_textures_a_draw_samples_go_upnow also does @thehollowedone's sequence: write, refresh,note_gpu_write(B),uncover_drawn(A, B),PENDING == 0, refresh, A reads back the current bytes. With only that guard taken out, it fails at that readback.Uploaded A displaced, then written by the title.
touched_by, sorefresh_partstakes it in its dirty-page selection and uploads it only when one of its pages was written.Table::displacedis a map with an expiry frame,present::counters+ 2. It is no longer drained by the next refresh.refresh_partsdrops the entries whose frame has passed and only then unlinks their source. The "whole" flag goes after the one whole upload, but the watch stays until the expiry. So an unrelated submit in between no longer ends the obligation.displaced, and its source is unlinked once, when it is made active again, released, replaced or retired.a_sampled_shadowed_texture_is_active_again, the table section covers:Limits, which are also in the description: the two frames are a bound, not tracking of the list that recorded the draw. A list submitted later than that misses writes made after the expiry. There is no GPU pixel test for the second case, because the test memory is not in the UMA write-watch regions, so it is tested on the table.
Thanks @andrewDoing for rerunning the GPU-written B / displaced A fixture on
2608ea23(2,048 of 2,048 current pixels for A, and B kept its GPU-written value).The description now has new smoke blocks on
2608ea23. Under its normal exe name, both this PR and the based1be8103lose the device at about 124 s in GTA 6 (3 of 3 rounds each) once the world loads, while mainb49be183does not. Run as a copy namedexoborne.exe, which gets NVIDIA's 2 GiB shader heap (#2403), both are clean. pr_check still fails against main on frames and commit, and it fails the same way for the base. Against the base, this PR is at 98–101 % of its frames and 100–108 % of its peak commit. I am marking the PR ready for review.On the parallel-run failure of
placed_title_textures_share_vram_and_preserve_pixels: that test comes from #248 (ad799324) and is not changed here. I did not see it fail in my runs (counts in the description).AI use: Claude Code (Claude Opus 5.5) wrote these fixes, their tests and this reply.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-28T18:04:39Z.
A title data point for this head (
2608ea23) together with #3179, from an RTX 5070 Ti 16 GB (driver 621.24): with both, more of GTA 6's intro cutscene is lit than with #3179 alone, and the run got further than any of ours.Setup: retail title, release,
XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_VIEW_REACH_MB=36 XCL_TWO_PASS_MB=4096 XCL_GFX_PSO_WAIT_MS=250 XCL_HUGE_PSO_CONCURRENCY=3 XCL_ALIAS_COPY=1 XCL_DRED=1, one A press at 150 s, 600 s. The tree is the same as in my #3179 report (nvidia-dev54225f58+ #3094 + KDenKC'sexp/sampler-prelude, prelude off, + a local #2799 port switched off). Each column adds one cherry-pick; this one applied without conflicts.Not tested: more than one run with both; this PR without #3179; this head on its own; the test suite; AMD.
AI use: Claude Code with Claude Opus 5.5 ran the title on the machine above and wrote this.
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T19:20:14Z.
Status of this PR against current
main, from the reporter's machine (RTX 5070 Ti 16 GB, driver 621.24; i7-12700K; Windows 11 26200). Short version: it is not ready formainas it stands, and I am not pushing the rebase yet.Tree: this PR's one commit rebased onto
main9dfbe3ea(local only; two test call sites followTable::remove's new return value; suite on the rebase: 2887 passed, 1 failed, 51 ignored, 28 SKIPPED, the failure beinggpu_direct_image_get_resinfo_d16, which failed on that base alone too), merged with #3516's head0dfcbd5e, which this card needs to stay in the world. Release build, the retail title of #505, shaders prepared before the runs,XCL_DRED=1 XCL_PLACE_RETIRE=0 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PRESS_A_AT=450 XCL_ACTIVITY=1 XCL_CS_PSO_WAIT_MS=250.What the runs show
main: over 500 shadowed textures are made active again within 2 s of the world starting.mainit does not.Not tested: whether the world's picture is better with this PR on
main(no frame comparison was made in these runs);nvidia-dev; AMD.Next: the swapping needs a rule that ends, e.g. letting two CPU-backed textures at the same range stay active together instead of taking turns. A first local attempt at that (placed + committed, exact same range) did not reduce the count reliably (131,072 at 400 s in one run, 262,144 at 645 s in the other), so it is not in the branch. Until there is one, please treat this PR as not mergeable into
main; the results onnvidia-devin the comments above are unchanged.Claude Code, Claude Fable 5.2 did the rebase, ran the suite and the game runs, read the logs and wrote this report.
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T01:53:59Z.
Triage note: this no longer merges with current
main(mergeable=false), so it cannot be built or tested as it stands.Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers.
If it has been superseded by merged work, saying so is enough and it can be closed.
AI use: an agent posted this triage note.
Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T02:23:04Z.
It is not superseded, but I am not rebasing it for now, for the reason in my status comment above: rebased onto
main9dfbe3ea(with #3516, which this card needs to stay in the world) the reactivation count grew by about 410 per second for the whole run and never settled (524,289 after 1,250 s of world), and the frame rate with and without it was inside the run-to-run spread. Until the swapping has a rule that ends, a rebased head would only cost testers time. I will push a rebase when there is one; if that does not happen it can be closed.On the symptom you describe (no presents after 50 to 80 s, device removed): on this RTX 5070 Ti that was
cs 95cc13288a27a96ein #3261's compact form, and #3516 is what fixed it here; a report of seven runs is on that PR.AI use: Claude Code, Claude Fable 5.2 wrote this reply from its own runs.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:13:28Z.
Triage (#1607) – head
2608ea2No PR into main makes this change on its own. amd-dev took it in
8942a5b9("after open PR #2956"), so the amd-dev-based PRs (#3099, #3111, #3112, #3335, #3361) and the amd-dev catch-up merges #3547 / #3554 carry the same lines. Those are not substitutes for this PR.Notes on the diff:
bind.rsuncover_bound_tablescopies 64 x 32 bytes of each bound table on every draw while any texture is shadowed. That is a hot-path cost.The branch conflicts with main now.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T14:12:24Z.
Code review location:
crates/xcl/src/hle/d3d12x/bind.rs; line 563This scan stops at 64 entries, but a D3D12 root descriptor range can be larger or unbounded (
NumDescriptors = UINT_MAX). The currentLayouttraversal records the table start but no descriptor count, so a shadowed T# SRV after slot 63 is omitted anduncover_drawnnever reactivates it. Could the scan follow the actual reachable range, or document a console-specific limit and add a slot-64 regression test? AI-assisted static review: I used an AI assistant to inspect this path; I checked the range limit against https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_descriptor_range1.Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T14:12:24Z.
Review: COMMENTED
AI-assisted static review: I used an AI assistant to trace descriptor-table traversal; I checked the range limit against Microsoft documentation.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.