D3D12.X: anchor XCL_LOOK_SKIP per frame and clear CLOSED on list reset/release #2768
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!2768
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2768"
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?
@Decodere on GitHub · 2026-11-26 11:26 UTC · original
Decodere:ws8-part3-look-skip-per-frame-and-lifecycle→nvidia-dev· +271 −20 · 5 files · 1 commits · openAnchor
XCL_LOOK_SKIPper presented frame and clear staleCLOSEDtimestamps on command-list reset,KickoffXreopen, and final release soXCL_LOOK_SKIP=1stays sound across frames and pointer reuse.XCL_LOOK_SKIPremains opt-in (off by default, zero behavior change when unset), and lists closed at or after the last look began (or with pendingWALK_FOUND) still force a full look.Part of #2688
What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs: replaceLOOK_BEGAN: AtomicU64withLAST_LOOK: Mutex<(u64, u64)>storing(began_us, frame)sampled atomically together (present::activity().0beforenow_us()intake_roundandrefresh_parts, updated monotonically in(frame, began)viaadvance_lookso a lateXCL_LOOK_AHEADround cannot rewind a newer frame); requirelook_frame == current_frameinsideclosed_before_last_look_inso every new frame guarantees at least one fresh write-watch look while same-frame pre-closed lists still skip underXCL_LOOK_SKIP=1; addforget_list_closed(list)(also invoked fromlist_reset), pureshould_look, and#[cfg(test)] is_list_closed_for_test(list).crates/xcl/src/hle/d3d12x/title_list.rs: recordnote_list_closed(this)incloseonly onhr >= 0, and clearforget_list_closed(this)inresetonhr >= 0and inreleaseonn == 0before wrapper deallocation.crates/xcl/src/hle/d3d12x/console_list.rs: addis_backing(pc)(fast-path!enabled()), movenote_list_closed(obj)from the start ofcloseto afterlist.Close()?succeeds (so UMA writes during translation/close cannot be missed by a concurrent look), and clearforget_list_closed(obj)incl_resetandcl_releasebefore freeing the wrapper.crates/xcl/src/hle/d3d12x/list_x.rs: savekickoff_wrapper = title_list::wrapper_of(this)beforereclaim_for_kickoffand clearforget_list_closed(w)onkickoff_xreset; recordnote_list_closed(this)indma_close_xwhenhr >= 0 && !is_own_work() && !presenting() && title_list::wrapper_of(this).is_none() && !console_list::is_backing(this).crates/xcl/src/hle/d3d12x/real.rs: recordnote_list_closed(this)incl_closeunder the same five guards (hr >= 0 && !is_own_work() && !presenting() && title_list::wrapper_of(this).is_none() && !console_list::is_backing(this)), and clearforget_list_closed(this)incl_resetwhenhr >= 0 && !is_own_work() && !presenting().a_block_the_walk_found_since_ends_the_skipand added 6 deterministic tests intitle_textures::tests(closed_timestamp_cleared_on_list_reset,closed_timestamp_cleared_on_release_and_pointer_reuse,new_frame_forces_look_even_for_pre_closed_list,same_frame_pre_closed_lists_skip_look_when_enabled,list_closed_after_look_began_runs_look,walk_found_at_or_after_look_began_runs_look) plus 1 end-to-end lifecycle test intitle_list::tests(title_list_close_reset_and_release_maintain_closed_tracking).Tested
rustc 1.100.0, DXC1.9.2609.5, debug (WARP) and release (RTX 4060).hle::d3d12x::title_textures::tests::+hle::d3d12x::title_list::tests::title_list_close_reset_and_release_maintain_closed_tracking):XCL_WARP=1):8 passed, 0 failed, 0 ignored(0.02 s).8 passed, 0 failed, 0 ignored(0.02 s).--test-threads=4):193 passed, 0 failed, 0 ignored(0skipped,2.07 s—title_textures35,title_list6,console_list9,list_x49,real94).cargo clippy --all-targets:0new errors and0new warnings across all added/changed lines in the 5 modified files (4 pre-existingnvidia-devclippy errors remain in untouchedlower_valu.rs,lower_wide.rs,recomp/lower.rs, andsparse.rs).cargo test --release --workspace --no-fail-fast -- --test-threads=4:1754 passed, 3 failed, 48 ignoredacross 40 targets (xcl --lib:1627 passed, 0 failed, 28 ignored; SKIPPED GPU/sample-pack tests: 30 lines whose optional env vars were unset). All 3 failures are pre-existing on unmodifiedorigin/nvidia-dev(af2cecc4):d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin, andgpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.title: 29640639underXCL_LOOK_STATS=2+ 8 GB flags (XCL_HEAP_WINDOWS=1,XCL_UMA_WINDOWS=16,XCL_DIRECT_DXIL=1,XCL_TEXTURE_SAFE_READ=1,XCL_WATCH_HOT_MS=60000) comparingXCL_LOOK_SKIP=0vsXCL_LOOK_SKIP=1(2x):XCL_LOOK_SKIP=0:1578frames (PresentX 1578),60 60 60presents/2 s,0device removals,0crashes,15207 MBpeak commit;1506 of 6144ExecuteCommandListseligible (+256per1024steady-state),256looks per512submits (3.13-3.24 msand8pages/look; youngest closed128 <50 ms, 128 longer), steady-state submit cost1.72-1.76 ms(look 1.57-1.61 msat120 submits/s).XCL_LOOK_SKIP=1(run 1):1565frames (PresentX 1565),60 60 60presents/2 s,0device removals,0crashes,15140 MBpeak commit;1507 of 6144ExecuteCommandListsskipped (+256per1024steady-state),256looks per1024submits (3.35-3.51 msand15-16pages/look; youngest closed0 <50 ms, 256 longer), steady-state submit cost0.95-1.03 ms(look 0.81-0.88 msat120 submits/s).XCL_LOOK_SKIP=1(run 2):1546frames (PresentX 1546),60 60 60presents/2 s,0device removals,0crashes,15148 MBpeak commit;1511 of 6144ExecuteCommandListsskipped (+256per1024steady-state),256looks per1024submits (3.19-3.28 msand17-18pages/look; youngest closed0 <50 ms, 256 longer), steady-state submit cost0.93-0.96 ms(look 0.80-0.82 msat120 submits/s).Regression run
Default-flags quiet 60 s
scripts/smoke.ps1runs ontitle: 29640639(XCL_LOOK_SKIPunset; default-flagsxcl.logon PR head also reports1507 of 6144ExecuteCommandListseligible withlook 0.03-0.04 mssteady-state):main (
b49be183, merge-base ofmainandnvidia-dev):nvidia-dev (
af2cecc4, target base):PR (
936bb90e, default flags):Not tested
XCL_CONSOLE_LISTS=1,XCL_LOOK_AHEAD=1, or titles submitting unwrappedKind::DmaList/ unwrappedKind::CommandListlists directly (those hooks are covered by code review and module unit tests rather than exercised live bytitle: 29640639).XCL_LOOK_SKIP=1.#[ignore]workspace tests and 30SKIPPEDoptional-env/sample-pack tests.AI use
XCL_LOOK_SKIP/CLOSEDlifecycle and cross-frame behavior across the 5 D3D12.X files, implemented the per-frameLAST_LOOKanchoring and reset/release/close hooks, wrote the 7 new unit tests (and updated 1 existing test), ran the build/test/smoke verification suites, and drafted this PR description.@itsSio on GitHub · 2026-11-26 12:37 UTC · original
Independent dual-PC NVIDIA verification at
936bb90e17e702b20ab1c465372317875d30d0b6(clean detached checkouts,XCL_ADAPTER=NVIDIA):Tested
32.0.16.1088, wave32), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5(dxcompiler.dll+dxil.dll, confirmed in test log).cargo build --workspace(debug): exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(debug): 1754 passed, 7 failed, 48 ignored, 27SKIPPED(21no wave64, 3#1426wave32 per-lane f16/cvt refusals, 2no heap windows, 1pso_measurementdriver cache). All 8 new/updated tests intitle_textures::testsandtitle_list::testspass. The 7 failures are the 6 pre-existingnvidia-dev(af2cecc4) failures (texture_upload::testsx2,d3d12_mesh_stream,gpu_compute_e2e,gpu_two_pass_cache_e2eacross 2 test binaries) plus the intermittent RTX 5080e2e::test_title_runs_and_game_folder_is_untouchedfailure (NVIDIA Corporation\umdlogscreated in the game folder during shader preparation).cargo test --release -p xcl --lib -- --test-threads=4 hle::d3d12x::title_textures:: hle::d3d12x::title_list:: hle::d3d12x::console_list:: hle::d3d12x::list_x:: hle::d3d12x::real::: 193 passed, 0 failed, 0 ignored, 0SKIPPED(1.74 s).32.0.16.1088, wave32), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11(dxcompiler.dll+dxil.dll, confirmed in test log).cargo build --workspace(debug): exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(debug): 1754 passed, 7 failed, 48 ignored, 30SKIPPED(same 27 + 3 no D3D12 debug layer). All 8 new/updated tests pass. Failures: the same 6 pre-existingnvidia-dev(af2cecc4) failures plushle::d3d12x::sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory, which passed 3/3 standalone (cargo test -p xcl --lib hle::d3d12x::sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory -- --nocapture).title_textures::tests,title_list::tests,console_list::tests,list_x::tests,real::tests): 99 passed, 0 failed, 0 ignored.Not tested
XCL_LOOK_SKIP=1, AMD/Intel GPUs, Linux, and the 48#[ignore]/SKIPPEDtests.AI use
Ran via Samaritan:
@GustavoEllwanger on GitHub · 2026-11-26 12:40 UTC · original
Test report on head
936bb90against its basenvidia-devaf2cecc(the PR is on the current tip, so as is and merged are the same tree), on NVIDIA Blackwell (32-lane waves) and AMD RDNA2 (native wave64), with and withoutXCL_LOOK_SKIP=1.Tested
XCL_ADAPTER=5060XCL_ADAPTER=Radeoncargo test --workspace --no-fail-fast -- --test-threads=4, base and head in turn on the same machine:af2cecc936bb90XCL_LOOK_SKIP=1texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_staysandpieces_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, on the RTX 5060 alsotwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, and on the iGPUgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 783, #2115). Sonvidia-devitself is not green on these cards.test_title_runs_and_game_folder_is_untouched,split_compute_prefers_the_offline_whole_pipelineandunreadable_shader_pack_stops_launch_before_host_start(exit code130088962instead of2). They are flaky under the whole suite, not tied to this PR or toXCL_LOOK_SKIP: runninge2e,gpu_compute_e2eandlauncher_e2eon their own 3 times on each tree gives the same result on both (4/0, 6/1 with onlyasync_compute_pso..., 7/0).XCL_LOOK_SKIPunset and set.a_block_the_walk_found_since_ends_the_skipintitle_textures::tests, andtitle_list::tests::title_list_close_reset_and_release_maintain_closed_tracking.XCL_ADAPTER=5060 cargo test -p xcl --lib -- hle::d3d12x::title_textures::tests hle::d3d12x::title_list::tests --test-threads=8, 30 runs each: this PR (41 tests) 30 passed, 0 failed; base (34 tests) 30 passed, 0 failed. The newLAST_LOOKandCLOSEDstate does not leak between tests running at the same time.Not tested
XCL_LOOK_SKIP=1saves per frame (#2688 workstream 8 numbers).Tests run and this report drafted with Claude Code (Claude Opus 5.5); I checked the numbers against the logs.
@Prime1997 on GitHub · 2026-11-26 12:46 UTC · original · reviewed
Good within the frame/reset/release tracking scope. The focused tests cover new-frame invalidation, close-after-look, reset/release/pointer reuse and the title-list wrapper. I also checked the suggested Close lock cycle: console_list::close explicitly drops its LISTS guard before calling the underlying Close, so that specific self-deadlock finding is not supported.
Tested clean PR head
936bb90e17e702b20ab1c465372317875d30d0b6, targeting currentnvidia-devaf2cecc40886a8682ecf3267f5328c6dc4b66ad7, in its own worktree and build directory. 8 passed, 0 failed, 0 ignored, 0 skipped. Each filter ran in a fresh process:hle::d3d12x::title_textures::tests::a_block_the_walk_found_since_ends_the_skiphle::d3d12x::title_textures::tests::closed_timestamp_cleared_on_list_resethle::d3d12x::title_textures::tests::closed_timestamp_cleared_on_release_and_pointer_reusehle::d3d12x::title_textures::tests::new_frame_forces_look_even_for_pre_closed_listhle::d3d12x::title_textures::tests::same_frame_pre_closed_lists_skip_look_when_enabledhle::d3d12x::title_textures::tests::list_closed_after_look_began_runs_lookhle::d3d12x::title_textures::tests::walk_found_at_or_after_look_began_runs_lookhle::d3d12x::title_list::tests::title_list_close_reset_and_release_maintain_closed_trackingBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Execution:<test-exe> <each-exact-name-above> --exact --test-threads=1 --nocapture. Only private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug tests; no GPU calls in these selected fixtures.Not tested: No live-title XCL_LOOK_SKIP=1 performance or texture-upload correctness is established by these CPU state tests. This supports retaining the PR; it is not whole-branch or merge certification.
AI use: Codex (GPT-6) reviewed source, ran the exact tests and checked the raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
@retrope13 on GitHub · 2026-11-26 13:02 UTC · original
Independent Ada Lovelace (RTX 4060 Laptop 8 GB, driver
621.40) verification and diff review of#2768(936bb90e17e7) against basenvidia-dev(af2cecc40886): full workspace suite + release targeted stress, zero new failures. No title was run.Tested
32.0.16.2140, wave32), Intel Core i5-14500HX (14C/20T), 24 GB RAM, Windows 11 26H2 (build26300.9818),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture(debug):af2cecc40886(XCL_LOOK_SKIPunset)936bb90e17e7(XCL_LOOK_SKIPunset)936bb90e17e7(XCL_LOOK_SKIP=1)nvidia-devfailures:texture_upload::tests×2,d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin, andgpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs×2).cargo test --release --locked -p xcl --lib -- --test-threads=4 hle::d3d12x::title_textures:: hle::d3d12x::title_list:: hle::d3d12x::console_list:: hle::d3d12x::list_x:: hle::d3d12x::real::): 193 passed, 0 failed, 0 ignored (1.83 s).cargo test --release --locked -p xcl --lib -- --test-threads=8 hle::d3d12x::title_textures::tests hle::d3d12x::title_list::tests, 5 runs withXCL_LOOK_SKIPunset + 5 runs withXCL_LOOK_SKIP=1): 10/10 passed (41 tests/run, 0 failures).Code Review Notes (
af2cecc40886..936bb90e17e7)title_textures.rs): Samplingpresent::activity().0beforenow_us()in bothtake_roundandrefresh_parts, together withadvance_lookupdating(frame, began)monotonically, fails safe across frame transitions (a lateXCL_LOOK_AHEADround cannot rewind a newer frame, and a frame advance mid-look forces a fresh look on the new frame).refresh_forholdsREFRESHacrossrefresh_once, andrefresh_partsstill drainsAHEADwhenlook == false, so skipped submits do not drop look-ahead pages.CLOSEDkey & lock-ordering check: All four list paths (title_list,console_list, unwrapped PCCommandList, andDmaList) keyCLOSEDby the same pointerreal.rs:8915passes torefresh_for. Inconsole_list::close,drop(guard)runs beforelist.Close(), soreal::cl_close→console_list::is_backingdoes not re-enterLISTS.real::cl_releaseclearsCLOSEDvialist_x::on_release→title_textures::list_resetafter nativeReleasereturns0(unliketitle_list::release/console_list::cl_release, which clear before deallocation). Any concurrent pointer reuse in that window still fails safe (at worst clears a fresh entry and forces one extra look, never a false skip); likewiseconsole_list::cl_resetclearingCLOSEDbefore PCResetis fail-safe.XCL_LOOK_SKIPunset,refresh_forstill callsclosed_before_last_lookfor the diagnostic counter and now takesLAST_LOOK.lock()instead of an atomic load (underREFRESH, so only contending withxcl-look-ahead's end-of-roundnote_look_began).Not Tested
XCL_LOOK_SKIP=1timing or stability data for #2688 WS8).#[ignore]/SKIPPEDtests.AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the builds/tests, reviewed the diff, and drafted this report.
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.