Repository navigation
Conversation
|
I checked the overlapping-descriptor case called out under Not tested on
There 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. |
|
I followed up on the overlapping-descriptor observation with a native GPU readback on RTX 5070 / NVIDIA 616.92. This uses the direct parent 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
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. |
|
I tested a separate-draw case on RTX 5070 / NVIDIA 616.92, comparing the same two native draws on parent For the head I supplied only the corresponding resource to
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. |
|
Verified PR #2956 ( Environment
Test Results (
|
| Command | Adapter | Result |
|---|---|---|
cargo test --locked -p xcl --lib -- title_textures -- --test-threads=1 |
NVIDIA RTX 4060 Laptop | 30 passed, 0 failed (2.63s, includes a_sampled_shadowed_texture_is_active_again) |
cargo test --locked -p xcl --lib -- hle::d3d12x::bind:: -- --test-threads=1 |
NVIDIA RTX 4060 Laptop | 53 passed, 0 failed (0.48s) |
cargo test --locked -p xcl --lib -- title_textures -- --test-threads=1 |
Intel(R) UHD Graphics | 30 passed, 0 failed (2.14s) |
cargo test --locked -p xcl --lib -- hle::d3d12x::bind:: -- --test-threads=1 |
Intel(R) UHD Graphics | 53 passed, 0 failed (0.51s) |
cargo build --workspace --locked && cargo test --workspace --locked --no-fail-fast -- --test-threads=4 |
NVIDIA RTX 4060 Laptop | 1,817 passed, 9 failed, 48 ignored (30 SKIPPED lines) |
All 9 failures in the workspace run are a subset of the documented pre-existing nvidia-dev eae01502 failures (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..3 passed 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
- Live retail title runs / visual verification of shadowed Bink planes (no retail game files used).
- AMD or native wave64 hardware.
- The 48
#[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.)
8fb4127 to
d527335
Compare
|
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 d527335, squashed into the one commit. When a texture that is still pending is shadowed again by a later Tests:
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 |
|
I reran the same two-draw native RTX 5070 fixture from my earlier report on updated head
Both focused runs passed without skips. As before, the fixture supplies each draw's resource directly to AI use: OpenAI Codex with GPT-6.2 Astra ran the retest; Codex reviewed and prepared this report. |
|
Re-verified Results (
|
|
I reproduced @retrope13's 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
Each 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. |
|
Follow-up to the native GPU reproduction on this head: I tested a narrow guard for the On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC 1.8.2502.11, with
Local candidate diff (not committed)diff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs
index 5c139fea..bc4d6806 100644
--- a/crates/xcl/src/hle/d3d12x/title_textures.rs
+++ b/crates/xcl/src/hle/d3d12x/title_textures.rs
@@ -269,2 +269,3 @@ impl Table {
if let Some(old) = self.by_res.remove(&ores) {
+ self.displaced.remove(&ores);
self.unlink_src(ores, old.src, old.tex.size() as usize);
@@ -282,2 +283,3 @@ impl Table {
if let Some(old) = self.shadowed.remove(&sres) {
+ self.displaced.remove(&sres);
if old.placed && !old.unmapped {
@@ -300,2 +302,3 @@ impl Table {
fn insert(&mut self, res: usize, mut entry: Entry) -> (isize, Vec<usize>) {
+ self.displaced.remove(&res);
let va = entry.va;
@@ -365,2 +368,3 @@ impl Table {
let mut e = self.shadowed.remove(&res)?;
+ self.displaced.remove(&res);
self.shadowed_by_va.remove(&(e.va, res));
@@ -410,2 +414,3 @@ impl Table {
fn remove(&mut self, res: usize) -> (bool, isize, Vec<usize>) {
+ self.displaced.remove(&res);
if let Some(old) = self.shadowed.remove(&res) {
@@ -436,2 +441,3 @@ impl Table {
if let Some(mut e) = self.shadowed.remove(&sres) {
+ self.displaced.remove(&sres);
// (the one that lay over it may have been uploaded over the same video memory)
@@ -498,2 +504,3 @@ static TEXTURES_LEN: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicU
static HAS_SHADOWED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+static HAS_DISPLACED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
/// cached `watch_ranges` keyed by `watch_key`
@@ -589,2 +596,3 @@ pub(super) unsafe fn register(device: *mut c_void, res: *mut c_void, va: usize,
HAS_SHADOWED.store(!t.shadowed.is_empty(), Ordering::Relaxed);
+ HAS_DISPLACED.store(!t.displaced.is_empty(), Ordering::Release);
clone_resources(&unmap_ptrs)
@@ -895,2 +903,3 @@ pub(super) unsafe fn retire_overlapping(va: usize, len: usize) {
HAS_SHADOWED.store(!t.shadowed.is_empty(), Ordering::Relaxed);
+ HAS_DISPLACED.store(!t.displaced.is_empty(), Ordering::Release);
(retired, clone_resources(&unmap_ptrs))
@@ -914,2 +923,3 @@ pub fn forget(res: usize) {
HAS_SHADOWED.store(!t.shadowed.is_empty(), Ordering::Relaxed);
+ HAS_DISPLACED.store(!t.displaced.is_empty(), Ordering::Release);
(removed, unsafe { clone_resources(&remap_ptrs) })
@@ -958,2 +968,3 @@ pub(super) fn uncover_drawn(res: &[usize]) {
HAS_SHADOWED.store(!t.shadowed.is_empty(), Ordering::Relaxed);
+ HAS_DISPLACED.store(!t.displaced.is_empty(), Ordering::Release);
(restored, unsafe { clone_resources(&remap) })
@@ -1855,3 +1866,3 @@ unsafe fn refresh_parts(queue: *mut c_void, look: bool) {
recheck_streamed_unwatched(&ranges, recheck_frame);
- if dirty_len == 0 && PENDING.load(Ordering::Relaxed) == 0 && AGAIN.lock().unwrap().is_empty() {
+ if dirty_len == 0 && PENDING.load(Ordering::Relaxed) == 0 && !HAS_DISPLACED.load(Ordering::Acquire) && AGAIN.lock().unwrap().is_empty() {
return;
@@ -1867,2 +1878,3 @@ unsafe fn refresh_parts(queue: *mut c_void, look: bool) {
let displaced = std::mem::take(&mut t.displaced);
+ HAS_DISPLACED.store(false, Ordering::Release);
names.extend(displaced.iter().copied());
@@ -3913,2 +3925,3 @@ pub(super) mod tests {
assert!(tbl.by_res.contains_key(&1));
+ assert!(!tbl.displaced.contains(&1), "reactivated A is owned by the active pending queue");
@@ -3922,2 +3935,13 @@ pub(super) mod tests {
assert!(tbl.by_res.contains_key(&10) && !tbl.by_res[&11].pending && tbl.shadowed.contains_key(&12));
+
+ let mut released = Table::new();
+ let mut gpu_b = entry(0x30_0000, &tex_64k, false, false);
+ gpu_b.gpu_written = true;
+ released.insert(20, entry(0x30_4000, &tex_16k, true, false));
+ released.insert(21, gpu_b);
+ assert!(released.uncover(20).is_some());
+ assert!(released.uncover(21).is_some());
+ assert!(released.displaced.contains(&20));
+ assert!(released.remove(20).0);
+ assert!(!released.displaced.contains(&20), "released resources cannot be uploaded after address reuse");
}
@@ -3977,2 +4001,15 @@ pub(super) mod tests {
assert_eq!(read_r8(dev, &queue, &b), vec![0x33; 64 * 64]);
+ // Consume the next guest write while A is shadowed, then model a GPU write to B.
+ // B must not become pending when it displaces A before the following refresh.
+ std::ptr::write_bytes(base as *mut u8, 0x44, 2 * size);
+ refresh(queue.as_raw());
+ note_gpu_write(0, kb);
+ uncover_drawn(&[ka, kb]);
+ assert_eq!(PENDING.load(Ordering::Relaxed), 0);
+ assert!(TEXTURES.lock().unwrap().displaced.contains(&ka));
+ assert!(HAS_DISPLACED.load(Ordering::Acquire));
+ refresh(queue.as_raw());
+ assert!(!HAS_DISPLACED.load(Ordering::Acquire));
+ let a_pixels = read_r8(dev, &queue, &a);
+ assert_eq!(a_pixels.iter().filter(|&&v| v == 0x44).count(), 64 * 64, "displaced A goes up with no dirty pages or active pending texture");
drop((_rb, _ra));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. |
|
On #2956 head The added table regression models A as already uploaded ( Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC. Adding A only to Failing table regressiondiff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs
index 5c139fea..8b22c9b3 100644
--- a/crates/xcl/src/hle/d3d12x/title_textures.rs
+++ b/crates/xcl/src/hle/d3d12x/title_textures.rs
@@ -3921,4 +3921,17 @@ pub(super) mod tests {
assert_eq!(tbl.uncover(11), Some((0, false)));
assert!(tbl.by_res.contains_key(&10) && !tbl.by_res[&11].pending && tbl.shadowed.contains_key(&12));
+
+ // An already uploaded A is displaced by B before its next dirty-page scan.
+ let mut dirty_tbl = Table::new();
+ let mut b = entry(0x30_0000, &tex_64k, false, true);
+ b.src = 0x5000_0000;
+ let mut a = entry(0x30_4000, &tex_16k, false, true);
+ a.src = 0x4000_0000;
+ assert_eq!(dirty_tbl.insert(20, b).0, 0);
+ assert_eq!(dirty_tbl.insert(21, a).0, 0);
+ assert!(dirty_tbl.coarse.contains_key(&(0x4000_0000 >> SRC_COARSE_SHIFT)));
+ assert_eq!(dirty_tbl.uncover(20), Some((1, true)));
+ assert!(dirty_tbl.coarse.contains_key(&(0x4000_0000 >> SRC_COARSE_SHIFT)), "A's source must stay watched until refresh");
+ assert!(dirty_tbl.displaced.contains(&21), "refresh must consider dirty A");
}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. |
|
Tested PR #2956 ( Environment
Paired
|
| Run | Exit | Crashes / Removals | Frames (PresentX) |
Heavy world start | Peak Commit | Peak Local VRAM | Peak Non-Local | Target Pages |
|---|---|---|---|---|---|---|---|---|
Base eae01502 |
0x0 |
0 / 0 |
1764 |
109.31 s |
25679 MB |
8285 MB |
4288 MB |
3647 MB |
#2956 (d5273351) |
0x0 |
0 / 0 |
1911 |
122.32 s |
25488 MB |
8414 MB |
4353 MB |
3632 MB |
In #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_textures on d5273351 (31 tests total; placed_title_textures_share_vram_and_preserve_pixels is newly added on d5273351 and not present on eae01502):
- First default parallel batch run:
30 passed; 1 failed(hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels ... FAILED). - Re-run with
-- --test-threads=1:31 passed; 0 failed(2.20 s). - Follow-up standalone default parallel run:
31 passed; 0 failed(2.26 s).
So placed_title_textures_share_vram_and_preserve_pixels passed reliably sequentially and on retry, with one observed intermittent failure under parallel execution.
Table::insert shadows the active textures a newer one overlaps, and a placed texture over a different range is unmapped as well. Shadowed textures are never uploaded again, but a title can keep sampling them: GTA 6 samples the Bink planes of its credit-card scene after a newer placement lands over part of them, so the GPU read zeros and the cards rendered green with blocky streaks (over 131k draws sampled shadowed textures in one 355 s run). When a draw binds descriptor tables, the textures they name that are shadowed become active again: the active ones overlapping them are shadowed without being unmapped, the texture is marked pending (unless the GPU wrote it), remapped if it was unmapped, and its known content is forgotten so the next submit uploads it. 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, and if it was pending, the next refresh uploads it whole even when no page was written and no other texture is pending (the early return used to skip it). Displaced textures go up before the active ones, so on shared video memory the active content wins. Assisted-by: Codex CLI (gpt-6.2-sol) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d527335 to
2608ea2
Compare
|
I retested the GPU-written B / displaced A early-return fixture from my earlier report on updated head In the normal case ( 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. |
|
Thanks @retrope13, @andrewDoing and @thehollowedone for the two cases, the readbacks and the failing tests. Both are fixed in 2608ea2, squashed into the one commit and rebased onto nvidia-dev d1be810. Thanks also @LocranKing for the open-world run. Pending A displaced by a GPU-written B (the early return).
Uploaded A displaced, then written by the title.
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 2608ea2 (2,048 of 2,048 current pixels for A, and B kept its GPU-written value). The description now has new smoke blocks on 2608ea2. Under its normal exe name, both this PR and the base d1be810 lose the device at about 124 s in GTA 6 (3 of 3 rounds each) once the world loads, while main b49be18 does not. Run as a copy named On the parallel-run failure of AI use: Claude Code (Claude Opus 5.5) wrote these fixes, their tests and this reply. 🤖 Generated with Claude Code |
|
A title data point for this head ( Setup: retail title, release,
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. |
…d textures drawn again Work in progress on the visual defects of a retail title on an RX 9070 XT (direct DXIL), not split into single changes yet: - ambient: the resolve's light and depth are taken from their own slots; the estimate is made in space from the depth (cells placed, gathered at 160x90 points, raised along a normal rebuilt from the depth), the air's light is held to the light around, magenta is rejected in the reflection clamps. Switches: XCL_AMBIENT_SPACE, XCL_AMBIENT_SPLIT, XCL_AMBIENT_MOST, XCL_AMBIENT_SKY. Credit in THIRD_PARTY.md. - shadowed textures a draw's tables name are made active again (after open PR #2956): video frames no longer come up green. - draws of bake pipelines (drawn once and kept) wait for their pipeline and make the shadowed textures they pick by index active again (XCL_KEPT_DRAWS, XCL_BAKE_SOURCES). - diagnostics: XCL_TRACE_LATE, XCL_TRACE_SLOT. - earlier fixes of this branch: vertex buffers kept out of the alias space, the PS export patch table for all pixel shaders, ambient levels. Tested: cargo test -p xcl --lib -- ambient stage_name placements title_textures pso_async bcpack rt_leave_out: 117 passed, 0 failed (RX 9070 XT, release build runs of 300 s without device removal). Not tested: the whole suite, scripts/smoke.ps1, other GPUs. Open: black heads at a distance, dotted diagonals, 3-5 fps in the world. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
|
Status of this PR against current Tree: this PR's one commit rebased onto What the runs show
Not tested: whether the world's picture is better with this PR on 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 Claude Code, Claude Fable 5.2 did the rebase, ran the suite and the game runs, read the logs and wrote this report. |
|
Triage note: this no longer merges with current 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. |
|
It is not superseded, but I am not rebasing it for now, for the reason in my status comment above: rebased onto On the symptom you describe (no presents after 50 to 80 s, device removed): on this RTX 5070 Ti that was AI use: Claude Code, Claude Fable 5.2 wrote this reply from its own runs. |
|
No PR into main makes this change on its own. amd-dev took it in 8942a5b ("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.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
| /// samples the resource named by its heap index in word 0. | ||
| unsafe fn uncover_bound_tables(layout: Option<&Layout>, args: &[u8], u: &crate::gpu::uma::Uma) { | ||
| let Some(layout) = layout.filter(|_| super::title_textures::has_shadowed()) else { return }; | ||
| const TABLE_SLOTS: usize = 64; |
There was a problem hiding this comment.
This scan stops at 64 entries, but a D3D12 root descriptor range can be larger or unbounded (NumDescriptors = UINT_MAX). The current Layout traversal records the table start but no descriptor count, so a shadowed T# SRV after slot 63 is omitted and uncover_drawn never 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.
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 d1be810.
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) on 2608ea2: 1822 passed, 12 failed, 48 ignored, summed over alltest resultlines.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.Regression run
The main block is from b49be18, 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 with
XCL_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 base d1be810 and 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. Main b49be18 does 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 d1be810. nvidia-dev has since moved to f8de0bf. This PR merges onto it without conflicts, and none of the files it changes were touched there. I have not rerun the blocks on f8de0bf.
Run 12/1, this PR, 2608ea2 (no A press: left out of the comparison):
Run 13/1, nvidia-dev base d1be810 (without this change) (no A press: left out of the comparison):
Run 12/1, main b49be18:
Run 12/2, main b49be18:
Run 12/2, this PR, 2608ea2:
Run 13/2, nvidia-dev base d1be810 (without this change):
Run 13/1, this PR, 2608ea2:
Run 13/2, this PR, 2608ea2:
Not tested
sparse.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 on 2608ea2.🤖 Generated with Claude Code