D3D12.X: add depth+UAV color twins, format-aliased placed texture copies, and dual-twin UAV barriers #1979
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1989"
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 raylitebull on 2026-11-25T00:26:44Z.
Adds two D3D12.X translation layers for console texture behaviors not natively allowed on PC D3D12:
depth_uav.rs): tracks console depth-stencil textures created withALLOW_UNORDERED_ACCESS(includingCreatePlacedResource#29viadev_create_placed_resource_x), creates typeless/UAV-compatible color (and optional stencil) twin resources (TwinPlan,plan_for_console_format), redirectsCreateUnorderedAccessViewto the twin (resolve_uav, integratinguav_companion_srv+null_uav_descand pointingslot.pc_srvat the twin resource), synchronizes dirty per-subresource planes across both legacyResourceBarrier(filter_transition,on_uav_barrier), Enhanced Barriers (#146D3D12_BARRIER_GROUPtexture & global barriers infilter_enhanced_barriers), wildcard global UAV barriers (on_global_uav_barrier), and DSV binds/clears (before_bind_dsv,on_clear_dsv, keepingSTATE_COMMONtargets in legalDEPTH_READ/DEPTH_WRITEvianote_dsvflags and unifyingRowPitch = max(src_pitch, dst_pitch)across 2-planecopy_plane_through_buffer), emits post-DepthToTwinUAV barriers, and restores internal-pass graphics/compute root signatures, PSO state, and dynamic depth bias (restore_after_internal_pass).format_alias.rs): tracks aliased placed textures at overlapping GPU addresses with per-subresource state tracking (COMPUTE_VALID_STATES = 0xC48), copies/synchronizes between incompatible formats via RAIIOwnedCopyLocbuffer-through passes (copy_one_subresource_through_bufferwithmax(src_pitch, dst_pitch)pitch alignment,try_copy_texture_region), and routes evicted/orphaned descriptors and heaps throughlate_release::hold(is_adopted-guarded).Part of #1833.
What is in it
crates/xcl/src/hle/d3d12x/depth_uav.rs&mod.rs:TwinPlan/DepthSyncKind/PlaneMask/SyncOpper-subresource state machine (filter_enhanced_barriers,on_global_uav_barrier,note_dsv,pc_states_depth,pc_states_stencil,split_uav_*,copy_direct_subs,transition_plane_subs,on_uav_barrier), post-DepthToTwinUAV barrier,late_release::holdteardown, plus unit & WARP GPU tests (depth_uav::tests, includingenhanced_barriers_handle_texture_subresources_uav_and_discardandgpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testwithreal::preserve_vtableacross testResetcalls).crates/xcl/src/hle/d3d12x/format_alias.rs: placed texture alias tracking (list_reset), RAIIOwnedCopyLocbuffer-through sync (max(src_pitch, dst_pitch)),COMPUTE_VALID_STATES = 0xC48, element byte width / block-scaled dimension checks intry_copy_texture_region, and unit tests informat_alias::tests.crates/xcl/src/hle/d3d12x/bind.rs,device_x.rs,late_release.rs,list_x.rs,real.rs:rs_cs+rs_gfxrestoration (restore_after_internal_pass),is_adopted-guardedlate_release::drain_known,dev_create_placed_resource_x+dev_create_uav_xintegration (#1914companion SRV +slot.pc_srvtwin SRV +#2280pc_clear_for_desc), and Enhanced Barrier (#146) / UAV (#26) routing inlist_x.rs.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), WARP (XCL_ADAPTER=warp), rebased cleanly onto569f0fc5(bfafdf77).cargo check --workspace --tests: passed (0warnings in touched files).XCL_ADAPTER=warp cargo test -p xcl --lib "hle::d3d12x::" -- --test-threads=4: 251 passed, 0 failed, 2 ignored (4.25s,0crashes).XCL_ADAPTER=warp XCL_D3D12_DEBUG=1 cargo test -p xcl --lib -- --nocapture --test-threads=1 "hle::d3d12x::depth_uav" "hle::d3d12x::format_alias": 9 passed, 0 failed (0.11s,0D3D12 debug errors, includingenhanced_barriers_handle_texture_subresources_uav_and_discardandgpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_test).Regression run
scripts/smoke.ps1pair onbfafdf77vs569f0fc5has not been run yet. AMD and NVIDIA reviewers are invited to test onbfafdf77vs569f0fc5(includingscripts/smoke.ps1,depth_uav/format_aliasGPU tests, and world lighting/depth-UAV workloads) and post results in the comments.Not tested
scripts/smoke.ps1pair onbfafdf77, fullcargo test --workspacesuite onbfafdf77, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
569f0fc5, and unit/GPU tests; the author reviewed the diff and test output.Imported from ivall/xcl. Originally posted by gsucristo on 2026-11-25T00:57:05Z.
Technical review findings:
Blocking
depth_uav.rs:873-899copy_plane_through_buffer,format_alias.rs:696-722copy_one_subresource_through_buffer): Both populateD3D12_TEXTURE_COPY_LOCATION::pResourcewithManuallyDrop::new(Some(res.clone()))(AddRef), then callstd::mem::forget(...)withoutManuallyDrop::drop. This leaks +1 ref onsrc, +1 ref ondst, and +2 refs on the per-listCopyScratchbuffer per subresource per copy, preventingres_releasecleanup and leaking VRAM monotonically.FullscreenPassDepthToTwincompute dispatch (depth_uav.rs:1429-1438execute_syncs,list_x.rs:3857-3861resource_barrier_x):resource_barrier_xemits the global UAV barrier beforedepth_uav::execute_syncs. InDepthToTwin(FullscreenPass), the compute shader writestwin_resvia UAV whiletwin_resstays inUNORDERED_ACCESSand returns without a UAV barrier ontwin_res, racing subsequent title compute dispatches.restore_after_internal_passclobbers PC root signatures, root parameters, and dynamic depth-bias PSO state (list_x.rs:134-147,depth_uav.rs:1317-1336, 1423-1435):FullscreenPasscallsSetGraphicsRootSignature/SetComputeRootSignatureandSetPipelineStateon the PC list (invalidating bound root parameters), butrestore_after_internal_passdoesn't restore the title's PC root signature/root args or handleusing_fallback_pso/pso_dirty/RSSetDepthBiasX.StateBeforemismatches (depth_uav.rs:197-198, 563-642, 763-774, 802-827):Entrytracks only onepc_state_depth/pc_state_stencilper plane instead of per subresource, so a single-subresource barrier transitions all0..per_planesubresources.entering_uavsetsbefore_depth/before_stencilto the title'sbeforeinstead ofprev_d/prev_s.before_bind_dsv,PlaneMask::Bothtransitions both planes toe.pc_state_depthwithout updatinge.pc_state_stencil.depth_uav.rs:1128, 1147, 1179, 328-346):pass_dsv_heapandpass_srv_uav_heapare created viaorig_fn(dev_raw, 14)(bypassinglate_release), sodepth_uav::forgetdrops them immediately even if a command list that bound them is still in flight on the GPU.RENDER_TARGETstate allowed onCOMPUTElists (format_alias.rs:755sync_pair): The non-DIRECT guardst & !0xC4F != 0permits0x4(RENDER_TARGET),0x2(INDEX_BUFFER), and0x1(VERTEX_AND_CONSTANT_BUFFER), which are illegal onCOMPUTEcommand lists.Major
placed_uavs/placed_srvsinformat_alias.rsownID3D12Resources permanently (never evicted onforgetor VA reuse), andon_uav_barriercopies everyPlacedUavpair on the device on globalbind::activity()changes.note_title_transitionreturns early whenACTIVE_PAIRS == 0(leavingpc_statestale for textures that transitioned before their alias peer was created) and ignoressubresource/ split-barrierBEGIN_ONLYflags.try_copy_texture_regionskipscan_copy_through_bufferand only comparesrows/RowPitch/Depth, which can silently alias incompatible bytes-per-texel formats that share the same 256-byte-alignedRowPitch.dev_create_uav_x(real.rs:2435-2449) creates the paired SRV (slot.pc_srv) on the original depthresrather thanuav_res(twin_res).Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T00:59:40Z.
Full-suite run, since this PR has no test report yet. Tested exact head
3443fd3(on its base8c4a46a).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 991 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.twin_plans_cover_console_depth_formats,uav_format_and_plane_classification,state_machine_handles_split_and_async_compute_transitions,uav_barrier_returns_zero_for_untracked_resources,r32_uint_and_r9g9b9e5_alias_needs_buffer_through,placed_uav_and_srv_descs_are_sanitized,alias_table_links_in_both_creation_orders.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1001 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main7994cd1too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-25T01:47:40Z.
Regression run for this PR: head
3443fd3, based onmain80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
80f4819:this PR:
No device removals or crashes; 100 % of main's frames, 104 % of its peak commit.
Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings:
XCL_DIRECT_DXILandXCL_HEAP_WINDOWSunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:53:43Z.
Thanks for the exhaustive review and every single catch,
@gsucristo!Updated
#1989cleanly ontobf9eebd(39d08cc), addressing all 6 Blocking + 4 Major findings:depth_uav.rs,format_alias.rs): replacedManuallyDrop::new(Some(res.clone()))+mem::forgetwith RAIIOwnedCopyLoc(ManuallyDrop::drop) so COM refcounts and VRAM never leak.DepthToTwinUAV barrier (depth_uav.rs): emitted an explicitD3D12_RESOURCE_BARRIER_TYPE_UAVontwinimmediately afterFullscreenPassDepthToTwindispatches.bind.rs,list_x.rs): trackedbind::rs_csalongsiders_gfxand updatedlist_x::restore_after_internal_pass(list, clobbered_gfx, clobbered_cs)to restore PC root signatures,bound_pso,using_fallback_pso/pso_dirty, and dynamicRSSetDepthBias.depth_uavtracking: replaced scalar plane states with per-subresourcepc_states_depth/pc_states_stencil+split_uav_*, used trackedprevstates onentering_uav, preserved separate per-subresource depth/stencil states onbefore_bind_dsvPlaneMask::Both, and scoped transitions/copies (copy_direct_subs,transition_plane_subs) to the targeted subresources.late_release.rs,depth_uav.rs,format_alias.rs): guardedlate_release::drain_knownwithreal::is_adoptedand routedpass_dsv_heap/pass_srv_uav_heapteardown + evicted alias textures throughlate_release::hold.format_alias.rs::sync_pair): replaced0xC4FwithCOMPUTE_VALID_STATES = 0x8 | 0x40 | 0x400 | 0x800(0xC48).depth_uav.rs,format_alias.rs,real.rs): evicted stale/orphanedplaced_uavs/placed_srvsonforgetand VA reuse (late_release::hold), scopedon_uav_barrierto specific barrier targets when non-global, trackednote_title_transitionbefore peer creation with per-subresourcepc_states+BEGIN_ONLYignore, validated element byte width and block-scaled dimensions intry_copy_texture_region, and pointeddev_create_uav_x's paired SRV (slot.pc_srv) attwin_resinstead of depthres.Compiled cleanly in release (
0errors) and pushed39d08ccfor GitHub ActionsBuild and test+ reviewer verification.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:58:06Z.
Fixed the
Build and testcompile error in197b104(rebased cleanly onto1e4fc10):Noneas thespecific_targetsargument tosuper::format_alias::on_uav_barrier(this, None)atcrates/xcl/src/hle/d3d12x/list_x.rs:2889.descbinding incrates/xcl/src/hle/d3d12x/real.rs.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T02:25:55Z.
PR #1989 GPU verification
PR head
197b104b7a97a0fd9f68c7602291660802f552c4was fetched fromoriginatrefs/pull/1989/headand tested in a clean detached worktree. Fetchedorigin/mainwasaaa093657bd96a146c05c0c1a9b61149fe761453.git merge-tree --write-tree origin/main HEADexited 0 with treec301c54bdb36c4dc9be3e1b1c779e01438160404and no conflicts.Tested
32.0.101.9175,DoublePrecisionFloatShaderOps=0, wave size 8–32), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build26200.9974.rustc 1.100.0 (0ef1bc386 2026-11-09). DXC and DXIL1.9.2609.5.cargo build --workspaceandcargo test --workspace --no-runboth succeeded in unoptimized profiles with debug info and incremental compilation disabled.cargo test -p xcl --lib hle::d3d12x::depth_uav::tests -- --show-outputreported 4 passed, 0 failed, 0 ignored, 0 skips.cargo test -p xcl --lib hle::d3d12x::format_alias::tests -- --show-outputreported 3 passed, 0 failed, 0 ignored, 0 skips.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputcompleted in one pass. Cargo exit 101. Across 20 harness summaries, libtest reported 1100 passed, 28 failed, 46 ignored. There were 27 SKIPPED lines across 17 tests, including partial skips. The harness pass count includes early returns. Skipped paths are excluded from coverage.CreateComputePipelineStatereturned0x80070057. The other five reported result mismatches in FMA contraction, implicit LOD sampling, split-wave reduction tails, 16/64-bit VALU, and pixel-shader whole-wave reductions.test_title_runs_and_game_folder_is_untouched. Its dynamic depth-bias check (#94) read blue[0, 0, 255, 255]where the test expected green afterRSSetDepthBiasX(-1000.5).L:\XclTooling\sol-slot-9\tmp\pr1989-suite.log.SKIPPED output
Not tested
mainand the PR head, execution of the synthetic merge tree, and AMD or NVIDIA adapters. This run had nomainbaseline for the failures.XCL_SAMPLE_RPF,XCL_SAMPLE_TTPF, andXCL_SAMPLE_AWCinputs. The seven targeted CPU tests covered format, state, and alias tracking logic. Retail GPU execution of depth/UAV twin synchronization, alias copies, and dual-twin barriers remains unverified.AI use
T3 Code / Codex (gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 handles verification and publication.
Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against
pr1989-suite.logand published this report.upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T03:33:21Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:51:29Z.
Regression run of
51ee197con the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 103 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; both blocks are exactly as printed, and I approved posting this.upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-25T09:45:37Z.
A test of this PR in the retail title's world, on the case that matters most there: a 2560 × 1440 D24S8 target that a compute program writes through its two UAVs and that the title's tiled lighting then tests with EQUAL. Full write-up, setup and numbers on #970: https://github.com/xcl-dev/xcl/issues/970#issuecomment-7158756509
Setup in short:
197b104merged three-way into a local tree (main689f2db+ a stack of open PRs, listed in the linked comment; 9 conflicts, both sides kept), RTX 3090 24 GB (driver 616.56), Windows 11 22631.on_uav_barrier/filter_transition), and this title uses enhanced barriers (list #146), which end up as a global UAV barrier. Sobefore_bind_dsvfinds nothing dirty and the depth target stays 100 % zero.R24_UNORMplane, or a later overwrite.AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the merge and the runs) did this and drafted the comment.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T11:03:12Z.
Thanks so much for catching the D24S8 Enhanced Barriers sync issue on RTX 3090,
@CharlyRien(#issuecomment-7158762448)!Rebased
#1989cleanly ontof087b998(3c86172c) and fixed the Enhanced Barriers / global UAV sync path plus two additional bugs uncovered under the WARP D3D12 Debug Layer:#146list_x::uav_barrier_x) & global UAV barriers (#26res == 0):depth_uav::filter_enhanced_barriersto parseD3D12_BARRIER_GROUP(D3D12_BARRIER_TYPE_TEXTUREandD3D12_BARRIER_TYPE_GLOBAL) on slot#146, executingTwinToDepth/DepthToTwin/TransitionOnlydirectly onDIRECTlists (handlingAccess*,Layout*including queue-specific layouts,DISCARD,UNDEFINED, and per-planeSubresources) and deferring cleanly onCOMPUTElists.depth_uav::on_global_uav_barrierto mark materialized twins dirty on#146global barriers and#26wildcard UAV barriers only when!plane_dirty(so compute-written depth+UAV targets flush onbefore_bind_dsvwithout overwriting graphics-rendered depth targets).before_bind_dsvSTATE_COMMONlegal state &CreatePlacedResource#29hook:D3D12_DSV_FLAGS(READ_ONLY_DEPTH/READ_ONLY_STENCIL) innote_dsvso flushing a target still inSTATE_COMMONtransitions to legalDEPTH_READ/DEPTH_WRITEinstead of illegalSTATE_COMMON.depth_uav::register_if_depth_uavintoreal.rs::dev_create_placed_resource_x(#29) and integrated upstream#1914uav_companion_srv+null_uav_descindev_create_uav_x.RowPitchmismatch incopy_plane_through_buffer(depth_uav.rs,format_alias.rs):R24G8_TYPELESSplane 1 (stencil) can reportRowPitch = 512while itsR8_TYPELESStwin reports256, previously dropping the stencil copy onsrc_fp.RowPitch != dst_fp.RowPitch. Unified both footprints tomax(src_pitch, dst_pitch)in bothdepth_uav.rsandformat_alias.rs.Verified on WARP (
XCL_ADAPTER=warp,XCL_D3D12_DEBUG=1):cargo check --workspace --testsPASS (0warnings in touched files) andhle::d3d12x::depth_uav+hle::d3d12x::format_alias9 passed, 0 failed (0.07s), includingenhanced_barriers_handle_texture_subresources_uav_and_discardand GPU draw testgpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_test(D24_UNORM_S8_UINTandD16_UNORM_S8_UINTDepthFunc = EQUAL+ stencil preservation,0D3D12 debug errors). Pushed3c86172c!Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T11:12:49Z.
Fixed the
0xc0000005crash ingpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testunder--test-threads=4in commit51ee197c(rebased cleanly onto96331383):real::adopt(dev, Kind::Device)before creating its own test PC heaps/resources (uav_heap,dsv_heap,rtv_heap, PSOs, depth targets), causinguav_heapto be adopted with the consoleheap_cpu_start_xRAX-return ABI instead of PC's hidden out-param when called viawindows-rs.depth_uav.rs): created all test PC heaps, resources, footprints, and depth targets before adoptingdevandlist, usedorig_fn(dev, 21)forCreateDepthStencilViewafter adoption, and cleaned upPIPELINESfordevon test exit.XCL_ADAPTER=warp cargo test -p xcl --lib "hle::d3d12x::" -- --test-threads=4 --skip pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa(2 consecutive runs):214 passed, 0 failed, 2 ignored(0crashes).XCL_ADAPTER=warp XCL_D3D12_DEBUG=1 cargo test -p xcl --lib -- --nocapture --test-threads=1 "hle::d3d12x::depth_uav" "hle::d3d12x::format_alias":9 passed, 0 failed(0.09s,0D3D12 debug errors).Pushed
51ee197c!upstream-sync referenced this pull request2026-11-25 16:10:51 +00:00
Imported from ivall/xcl. Originally posted by ivall on 2026-11-25T15:16:11Z.
The crash in
gpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_test(0xc0000005, the CI failure of51ee197looks like it) is the test, not the twin code: fix below. With it, all tests of this PR pass on AMD.On AMD RDNA4, Windows, DXC 1.8.2502.11,
51ee197merged into my tree (main+ other open PRs), debug, the test crashed every time without the debug layer and passed withXCL_D3D12_DEBUG=1.Backtrace:
list_x::transition(list_x.rs:124) ←execute_syncs←before_bind_dsv← phase 2 of the test, reading the vtable slot before the list's vtable at0xffffffffffffffff. The runtime'sResetputs its own vtable back on the list; the title's path restores XCL's (preserve_vtable, called inlist_x::reset_pc). The test calls the originalResetat both phase changes and does not. The debug layer's list does not swap it, so the test passed there.After both resets:
cargo test -p xcl --lib -- hle::d3d12x --test-threads=4: 254 passed, 0 failed, 2 ignored (merged tree, so not only your tests).Not checked: the
D16_UNORM_S8change you described (the stencil-read depth asR16_UINTtimesasfloat(0x37800080)) is not in51ee197, so I have not run it; and no title run with this PR yet.AI use: Claude Code (Claude Opus 5.5) found it, wrote the fix and this on the maintainer's behalf.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:15:17Z.
Thanks for tracking down the debug-layer-off
Resetvtable overwrite on RDNA4/CI and sharing the exact fix,@ivall(#issuecomment-7166572303)!Updated
#1989cleanly onto73e3aba6(ced48914):Resetvtable preservation (depth_uav.rs): wrapped bothreset_origcalls ingpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testwithlet ext = *(list.as_raw() as *const usize); assert_eq!(reset_orig(...), 0); real::preserve_vtable(list.as_raw(), ext);so the PC runtime'sResetdoes not overwrite XCL's vtable whenXCL_D3D12_DEBUG=0.D16_UNORM_S8_UINTdepth/stencil note: for consoleD16_UNORM_S8_UINT(118..=120),depth_uav.rsallocates anR16_TYPELESS(53) depth twin and binds theFullscreenPassSRV asDXGI_FORMAT_R16_UNORM(56), which convertsu16depth directly in hardware without needing an explicitasfloat(0x37800080)scale (and if a title performs a separate stencil-view read on aD16_UNORM_S8_UINTtexture, we can check that in a dedicated follow-up).ced48914):XCL_ADAPTER=warp cargo test -p xcl --lib "hle::d3d12x::" -- --test-threads=4 --skip pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa->236 passed, 0 failed, 2 ignored(4.25s,0crashes).XCL_ADAPTER=warp XCL_D3D12_DEBUG=1 cargo test -p xcl --lib -- --nocapture --test-threads=1 "hle::d3d12x::depth_uav" "hle::d3d12x::format_alias"->9 passed, 0 failed(0.09s,0D3D12 debug errors).Pushed
ced48914!Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:24:14Z.
Rebased
#1989cleanly onto569f0fc5in commitbfafdf77, resolving thereal.rsadjacency conflict cleanly alongside#2280(pc_clear_for_desc+effective_st).Verified on WARP (
bfafdf77):cargo check --workspace --testsPASS (0warnings in touched files).XCL_ADAPTER=warp cargo test -p xcl --lib "hle::d3d12x::" -- --test-threads=4->251 passed, 0 failed, 2 ignored(4.25s).XCL_ADAPTER=warp XCL_D3D12_DEBUG=1 cargo test -p xcl --lib -- --nocapture --test-threads=1 "hle::d3d12x::depth_uav" "hle::d3d12x::format_alias"->9 passed, 0 failed(0.11s).Pushed
bfafdf77!Imported from ivall/xcl. Originally posted by St5sz2Jk on 2026-11-26T00:00:57Z.
Linux / Wine / RADV (RX 9070 XT) on
bfafdf7: all of this PR's tests pass with vkd3d-proton once the GPU test's two direct submits use #871'sUnadoptGuard(part 1). In the retail title the twins are created and sync thousands of times, but the cutscene frame behind the credits and subtitles stays the flat grey of #970. One run each.Setup:
ec207194.main+ #871 + #684 + #433 + #2357 (see #1269).vram.rs(the fences of #871 againstmain's retire changes).Correction (edited): my first version of part 1 came from a test run without
WINEDLLOVERRIDES. It used Wine's built-in vkd3d, not vkd3d-proton, and that run failed atfmt 44 stencil at (2,2)(0 for 17). With vkd3d-proton loaded, as the title runs:1. This PR's tests under Wine + vkd3d-proton (each run alone): 8 passed.
gpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testcrashes:d3d12core.dll+0x597fbd=d3d12_command_queue_ExecuteCommandLists.cold. In other words, vkd3d-proton was handed a command list it does not recognise; its release build has the vtable check compiled out.q.ExecuteCommandLists(&[Some(list.cast().unwrap())])submit a list whose vtable XCL patched. Wrapped in #871's guard, the test passes on RADV + vkd3d-proton, stencil check included: So the twin sync itself works on this driver. Only the test needs the guard under Wine (with #871). #1993's copy-back submit had the same crash, and the same line fixed it (#1993).2. The retail title, to the opening cutscene (
XCL_HEAP_WINDOWS=1, frame dumps):2560x1440x1, console fmt 19, two_plane true;2560x1440x1, console fmt 118, two_plane true;fmt 53).TwinToDepthand more than 4096 other syncs ran (execute_syncs, counted with local logging).3. Two other things the runs showed (not caused by this PR):
main's newvram::retire_heaps_and_sweepmakes its retire fences withdev.CreateFence. Under Wine the title then crashes about 20 s in, inRetireQueue::retire_with(IUnknown::clone, read of-1).real::create_raw_fencethere fixes it. #871's current head153730dalready does this.a UAV of a resource that cannot have one on the PC (a depth buffer) – a null view) are not depth buffers. They areR8G8B8A8_UNORM_SRGBrender targets with UNORM UAV views:pc_resource_descdropsALLOW_UNORDERED_ACCESSfrom them, because sRGB has no typed UAV.R8G8B8A8_TYPELESS(and gave description-less RTVs of them an sRGB format). The null UAVs went away, but the grey stayed, so they are not the cause of it.Update: a title assert with this PR in a longer run (one run each).
main569f0fc+ #871 + #684 + #2357 + #1993 (with itsUnadoptGuardline) + #751;XCL_TARGET_PAGES_MB=6144, warm caches.bfafdf7): the title asserts (0x80000003atgame+0x5149aec, 7 times) from about 614 s. I stopped the run there.Not tested:
AI use: Claude Code (Claude Opus 5.5) merged the tree, ran the tests and the title, added the local logging, and wrote this comment.
Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-26T05:42:35Z.
Test report, RTX 3090: a title-placed R32_UINT writer never reaches its R9G9B9E5
PlacedSrvreader when the title moves it with enhanced barriers. Copying it at the reader's bind, with copy buffers of its own, fills the screen-probe radiance atlas: from 0–10 KB to 2.5 MB non-zero of 4.96 MB. The picture is still over-exposed, so this is one missing piece, not a fix of the frame. One run per arm.What happens (read in
format_alias.rs)buffer_through true). It is synced only from a legacy transition out of a write state, or from a UAV barrier forPlacedUavwriters. This title uses enhanced barriers and aTitlePlacedwriter, so neither path fires and the reader stays zero.Local changes (local commits on our tree, not pushed)
sync_pairruns for anyPlacedSrvreader whose pair has aTitlePlacedwriter. A UAV barrier and a null aliasing barrier come before the copy.CopyResourceon Microsoft Learn, as 1:1 pairs. We copy texture to texture, with no intermediate buffer. Measured bit-exact on this 3090, with 0 debug-layer messages.Measured (in the title, captures of the reading pass and of the frame)
Setup
maine1d84b7dmerged with our integrated tree, which carries #1989 at197b104and #2384 (ported), plus local diagnostics. On top: the three changes above, behind local switches.XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0 XCL_GPU_VIEW_BUFFERS=1 XCL_DIRECT_DXIL=1 XCL_PAGE_BUDGET_MB=1024 XCL_GPU_VIEW_MB=1024, plus the switches of each row.Not tested: other GPUs; other pair formats.
AI use: Claude Code (Claude Opus 5.5, coordinating session and agents). The agents read captures and code, wrote the local switches and the analysis scripts, and drafted this report; the coordinating session ran the in-title runs and checked the numbers.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:51:44Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Imported from ivall/xcl. Originally posted by St5sz2Jk on 2026-11-26T18:36:19Z.
Correction (edited): the same assert also happened with this PR's features switched off (
XCL_FORMAT_ALIAS=0 XCL_DEPTH_UAV_TWIN=0, at 476 s), so it is probably not caused by this PR. Details are in #2092.The title assert I noted earlier with this PR came back today: two more of two long runs, AMD / Linux. It is
0x80000003at+0x5149aec, from several threads at once, and the earlier run was the same.Setup
ec207194.mainb49be18+ this PRbfafdf7+amd-dev's format-alias follow-ups (b2a2fec9,33709155,3ca3e457,c093211e) + #871, #684, #1993, #751, #2357, #2799, #541 and #2092.Runs
Format-alias side, for reference
CopyResource(a reinterpret pair), which avoids the per-list scratch.AI use: Claude Code (Claude Opus 5.5) ran and read the runs and wrote this.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T00:09:49Z.
RTX 5070 verification of depth and UAV synchronization
All nine focused tests passed on the clean head of PR #1989, commit
bfafdf77a42a39bff689a5e7e9a92c2d085799c5. The run finished in 0.63 seconds, with zero failures, ignored tests, or reported skips.The live GPU fixture performed depth comparisons and stencil readback for D24S8 and D16S8 across enhanced and global UAV barriers. The format-alias tests checked descriptor handling, resource pairing, and the need for a buffer intermediate. They are unit tests. The run requested the D3D12 debug layer. The GPU fixture asks D3D12 for the default hardware device when WARP is not requested. A separate default-device probe identified the RTX 5070, LUID
0:0000e7ea. Focused log · Default-device probeCommand:
cargo test --locked --offline -p xcl --lib -- --nocapture --test-threads=1 hle::d3d12x::depth_uav hle::d3d12x::format_alias, withXCL_D3D12_DEBUG=1,XCL_ADAPTER=RTX 5070, andXCL_REQUIRE_GPU=mesh. The focused tests used synthetic resources. Retail world lighting, title stability, and a comparison against the parent remain unmeasured.AI use: OpenAI Codex selected and ran the existing tests, inspected the device-selection and readback code, and wrote this report.
Imported from ivall/xcl. Originally posted by imnicho on 2026-11-27T23:25:09Z.
Test report, RTX 5080 16 GB, this PR merged into an
nvidia-devtree: the twins route the lighting target and the scene's lighting draws get through (the room after the opening cutscene is lit for the first time here). The frames are heavier for it and this tree's GPU hang comes sooner; a smaller loop budget for pixel programs moved the first stop in 5 of 7 runs and cured nothing.Setup
nvidia-devd1be8103plus other opennvidia-devPRs (#3012, #3048 among them) and local test changes; ray tracing inamd-dev's every-ray-misses mode (XCL_RT_GATE=miss,1aebe666, ported locally). This PR's headbfafdf77amerged into it.bind.rs,device_x.rs,late_release.rs,list_x.rs,mod.rs,real.rs, anddepth_uav.rs, whichnvidia-devhas as a module of its own since 25 Nov). I keptnvidia-dev's module as it is (off: itsXCL_DEPTH_UAV_TWINis 0 unless set) and put this PR's beside it under another name with a switch of its own, the PR's calls renamed.dev_create_uav_xasks this PR'sresolve_uavfirst.late_release::holdandtitle_textures::note_gpu_writetake a second argument onnvidia-dev(false, and list 0),tracked_root_sigsreadsnvidia-dev's sharded list state, andrestore_after_internal_pass(whichnvidia-devhas too, for another pass) became a second function onnvidia-dev's per-list state. Views by address (#70 / #71) stayednvidia-dev's: one placed resource per address and description, in the title's memory.XCL_FORMAT_ALIAS=0in all of them (the format-alias half is not tested here).1. What the twins do in this title
D16_UNORM_S8_UINT, 1280x720, R24G8 on the PC). The last one is the depth target the scene's lighting draws test with EQUAL (#970); its 16 bits are why their vertex shader writesz = permutation / 65535.SV_Depthpasses and 64 plane-to-twin compute copies in the first 170 s of the world.2. The picture (described; no screenshots of the title)
nvidia-dev's own twins do not change that: they give the depth plane of an R24G8 buffer no twin, and their copies hang on legacy transitions into and out of UNORDERED_ACCESS, which this title does not issue for these buffers (0 copies in three runs).3. The GPU hang, which is this tree's and not shown to be the PR's
nvlddmkm153 and then Display 4101 each time. Two of them show as the title's own assert (its 2 s GPU wait timed out) and two, run withXCL_WAIT_TIMEOUT_MS=15000, as device removed. Twins for two-plane buffers only gave the same.Not tested
XCL_FORMAT_ALIASon), the PR on its own base, AMD, the Series X profile.enhanced_barriers_handle_texture_subresources_uav_and_discardpasses;gpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testends in an access violation right after its firstSV_Depthpass is recorded (also with the vtable kept across the test'sReset, asamd-dev's98be4785does). I have not found out why; in the title the same pass runs hundreds of times a run. So take my merge as a test tree, not as a port.AI use: Claude Code with Claude Fable 5.2 did the merge, ran the runs and wrote this comment.
Imported from ivall/xcl. Originally posted by imnicho on 2026-11-28T03:11:03Z.
Plan: this PR's format-alias copies for
nvidia-dev, as one focused PR, with the title's enhanced barriers as the trigger. With them the retail title's room, sky and yard are lit here for the first time.Measured on an RTX 5080 16 GB (driver 610.47), tree and run conditions as in my report above, with
nvidia-dev's owndepth_uavmodule plus my draft for the R24G8 depth plane in place of this PR's twins:nvidia-dev. The written one is GPU-owned (vram). The sampled one is a texture of its own, kept in step with the title's memory (title_textures), which nothing writes. Many of the pairs are at addresses that are not on 64 KiB pages, where the two cannot share pages either.nvidia-devmakes one UAV barrier for all resources of that call and drops what it names (#1025 is not onnvidia-dev), so no legacy barrier names these textures: 121 frames into the world of one run my counters stood at 459 enhanced barriers of written textures of a pair, and 0 legacy transitions, 0 aliasing barriers and 0 UAV barriers naming one.Plan for the PR (against
nvidia-dev, behindXCL_ALIAS_COPY=1, default unchanged):CreatePlacedResourceX; a pair is a written one (render target or UAV) and a sampled one at the same address with the same size, levels, layers and texel width and another format.nvidia-devhas them (their creation states) around the copy.Not in it: views by address (#70 / #71),
CopyResourcebetween format families, the depth twins. The mechanism is @raylitebull's from this PR and will be credited as such. If you would rather bring it tonvidia-devyourself, say so and I stop.AI use: Claude Code with Claude Fable 5.2 read the logs and the code, wrote the local version and this comment.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-28T03:18:08Z.
@imnicho the pairs you describe are in the log on an RTX 3060 12 GB too, and the scene there is black past world load in the same way.
Tree:
nvidia-devwith #3039 (7cce7d3d) and #2975 (4e52050c) merged locally, release,XCL_TEXTURE_LEVEL_PAGES=1 XCL_TEXTURE_SYSMEM=1 XCL_DIRECT_DXIL=1, 900 s. ItsCreatePlacedResourceXlog lines name R9G9B9E5 textures (format 67, no flags) placed over R32_UINT ones (format 42, flags0x300004, so withALLOW_UNORDERED_ACCESS), with the same size: 1280x720 among them, also 2304x576, 2048x512, 1280x320 and 768x192. The log names the first ones only, so that isn't a count.What the run shows past world load: the title's in-play UI over a black scene.
XCL_DUMP_TARGETSon two in-play frames: the 2560x1440 targets of format 28 and 29 are 0 throughout, with ~98 % of their draws run (details on #2055). That fits a lighting input that is never updated.When the focused PR against
nvidia-devis up, I'll run it on this card on the same tree, with frame and target dumps before and after, and report here.RTX 3060 12 GB (driver 581.80), i9-14900KF, 64 GB RAM, Windows 11 26200.
AI use: Claude Code (Claude Opus 5.5) read the run's log and wrote this comment.
Imported from ivall/xcl. Originally posted by imnicho on 2026-11-28T04:43:38Z.
@Anon64 thank you. The focused PR is up: #3094 (
XCL_ALIAS_COPY=1, againstnvidia-dev). Two things for your run:XCL_DEPTH_UAV_TWIN=1, also againstnvidia-dev). The two do not touch the same lines except one helper's neighbourhood inlist_x.rs; my runs had both.What I measured, and what I did not, is in the PR's description: on my tree the copies light the scene, and runs with them end at that tree's GPU hang earlier than runs without.
AI use: Claude Code with Claude Fable 5.2 wrote this comment.
Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-28T05:01:52Z.
Thanks for #1989. Its format-alias pairing (R32_UINT writer / R9G9B9E5 reader at one address) is the piece main is missing for the retail title's TAA history. Because the PR leaves the view out of
title_textures, the view keeps its tiles mapped; credit for that idea goes to this PR. We hit the same problem on a local lab tree and found three remaining gaps. A suggested fix is on a branch stacked on this PR, linked at the end.Stack
753e8b1a+ #1989bfafdf77, cherry-picked as2313cfb4.2c717a04, with one trivial conflict inlist_x::reset_pc: main'sreset_own_alloc(this)is kept, followed byformat_alias::list_reset.753e8b1awith no further conflict.3b491e77(trim): a reader's pages end where its writer's copy does;1df47cf5(remap): an unmapped reader is mapped again before its copy;a6a9a2f3(test): the GPU test below;5e996e33(generation): the remap looks at the pages again only after some placed texture lost its tiles.2c717a04). The rebase changed only the base; the commits are the same.b49be183plus local commits that are not public, and it does the alias copy with its own mechanism, not #1989's. The cause sits in the same code in both trees:title_textures→vram::unmap_superseded, with the samexg::optimal_mode.What we measured (lab tree, retail title, reference scene: the window behind the character)
mapped false, pages used 0, not evicted).title_textures::insertshadows the older view and unmaps its tiles. In our log, the first view loses its tiles 2 ms after creation, to the second view placed 3 686 400 bytes further on.right after the copy, the view equals its source (window luminance 2.81 in the HDR target);
the window is lit: 193.2 / 255 over 85 world frames, 99 % of them above 40;
without any probe or dump, in our reference run's env, with the same binary (one run each):
All 11 remaps happen before the world (173-267 s; the world starts at about 290 s).
With the remap, the pace is 2.4 % lower. These are single runs and the 30 s slices overlap (2.82-3.04 against 2.82-3.14 after the first slice), so it may be noise.
It may also come from checking the pages at every copy (a lock, about 1600 copies a second).
5e996e33skips that check until some placed texture loses its tiles. The pace after that change is not measured yet in game.What remains in #1989 (READ in the diff, DEDUCED for this title)
3b491e77cuts the reader's pages to the bytes of a copy of its subresources whenformat_aliaspairs it at creation. Its tail tiles are then its own.title_textures, then retired with its tiles unmapped when the GPU-owned writer is placed over it (retire_overlapping). The pair still forms, but the copy lands nowhere.1df47cf5maps an unmapped reader again insync_pair, before the copy, with the same cut. It does nothing for a mapped reader.1df47cf5covers any other unmapping byunmap_superseded.5e996e33keeps that check cheap:vramkeeps an unmap generation, and each reader remembers the generation at which it was last found with its tiles.None of these three points is touched by the format-alias follow-ups on
amd-dev(b2a2fec9,33709155,3ca3e457,c093211e). #2270, which ordersunmap_supersededafter the work already submitted, is a separate question: it changes when the unmapping happens, not whether a copy lands after it.Test (
a6a9a2f3, plus a step (C) from5e996e33, GPU):format_alias::tests::gpu_format_aliased_views_keep_their_tiles_and_take_their_copies.create_placed_resource_x, it places two pairs one writer apart, plus a view before its writer.sync_title_writers, each view holds its own writer's texels whole;1 passed.depth_uav::tests::gpu_d24s8_and_d16s8_enhanced_barrier_twin_sync_passes_equal_depth_testalso passes on main + #1989 + these commits.753e8b1a:cargo checkand the CPU tests offormat_alias/depth_uavpass (9 tests).Smokes on main + #1989: not run on main. In our setup, main does not reach the world on this card without a translated-shader cache: we have one 200 s smoke, which showed loading screens only. The game numbers above come from our lab tree; on main + #1989, the evidence is the GPU test.
About #3094 (the focused port, which triggers the copies at the enhanced barriers): for comparison, on the RTX 3090 our lab runs with alias copies tonight had no GPU hang. That is 8 runs of about 10 minutes, each stopped by our watcher 240 s into the world: 0 device removals and 0 hangs. Our lab tree does its copies with its own mechanism, so this does not test #3094's code.
Suggestion. The branch is https://github.com/CharlyRien/xcl/tree/pr/alias-view-remap (4 commits on top of this PR, on main
753e8b1a; compare with this PR's branch). Take what you want into #1989, or we can open it as a stacked PR.XCL_FORMAT_ALIAS_TRIM=0andXCL_FORMAT_ALIAS_REMAP=0.format_aliaspairs, at the cost of up to 3-4 extra 64 KiB tiles per view.Open question. Why does XG lay these views out longer than the linear writer at the same address? If the console's library gives them the writer's layout,
xg::optimal_modeis the deeper cause, and other textures could be affected.AI use: Claude Code, model Claude Opus 5.5, found the cause from the logs and probes, wrote the four commits and the test, ran them on the machine above and wrote this. The person running these tests asked for this post.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-28T05:16:48Z.
@imnicho I ran #3094 (
839b33a1) with #3089 (3b12e0b2) on the RTX 3060 12 GB, as promised. The copies run, but the scene there stays black.Tree:
nvidia-devwith #3039 (7cce7d3d) and #2975 (4e52050c) merged locally, then #3094 and #3089. There was one conflict, insparse.rs: #3039's system-memory pools now keep their free tiles in #3094'sFreePools. Release build,XCL_TEXTURE_LEVEL_PAGES=1 XCL_TEXTURE_SYSMEM=1 XCL_DIRECT_DXIL=1 XCL_ALIAS_COPY=1 XCL_DEPTH_UAV_TWIN=1, a run of about 13 minutes, stopped by hand.XCL_DUMP_TARGETSon two in-play frames: the 2560x1440 targets 0, 1, 3, 4, 5 (formats 28 and 29) and 7 (format 42) still read 0. Target 2 has content, as before. Target 6 (format 10) changed: it read nearly 0 without the PRs and now has content. The frame on screen is a dark blue-grey instead of black, but nothing of the scene shows.So on this card the copy reaches part of the lighting but not the colour targets. One difference from your runs: here
XCL_TEXTURE_LEVEL_PAGEStakes texture pages away to fit 12 GB. That could leave a reader with no tiles mapped, the case CharlyRien's remap commit covers above. A run withXCL_TEXTURE_LEVEL_PAGES=0to test that device-hung at 279 s, at 18.9 GB of local video memory, before any dump.Edit, with the remap: I ported CharlyRien's remap commit (
1df47cf5) onto #3094's copy (inrecord, before each copy: a sampled texture with no tiles mapped gets them again throughvram::remap_superseded). Same tree and switches, 900 s: 3 331 frames, no device removal, no crash, peak commit 40.4 GB. The remap acted 11 times, all before 214 s (before world load), and the log counted 65 536 copies. The targets of two in-play frames read as before: 0, 1, 3, 4, 5 and 7 are 0; 2 and 6 have content. So on this card an unmapped reader isn't what keeps the colour targets at 0 either.Edit, fresh graphics pipelines: after Joori's report on the title's issue, I moved the 5 630 stored
gfx-*.psodriver blobs out (there were nomesh-*.pso) and ran the same tree again, so those pipelines were built in the run. The first in-play target dump (frame 1515) reads as before: targets 0, 1, 3, 4, 5 and 7 are 0, and 2 and 6 have content. So a stale graphics blob isn't the cause here either. The run then device-hung (0x887a0006) at 489 s while it was still building pipelines.Edit, 16 windows:
XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16, also withXCL_UMA_DRIVER=mixed:1536:1792as in KDenKC's 5090 run. Four tries on this tree, with 8 or 4 preparation threads. Each time shader preparation tookxcl.exeto ~41 GB of commit within a few minutes, before the title made its window, and my RAM watchdog ended it (free under 4 GB, 64 GB machine). The same window count on the tree without #3094 / #3089 peaks at about 34 GB in the first 180 s, so the merges aren't the cause: the 16-window preparation just doesn't fit next to the rest of the machine. So the view-window lead can't be tested on this 64 GB machine through re-translation. #3096 + #3097 would avoid that, but they're onmain, which lacks #3039's system-memory pools that this card needs.Edit, 16 windows reach play and light the G-buffer: the RAM problem above was shader preparation, so
XCL_PREPARE=0skips it and pipelines build as the title needs them. Four more runs on the same tree withnvidia-dev54225f58merged on top (#3090; its "console flag bits" warning never appears for this title, so it changes nothing here),XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16:XCL_UMA_DRIVER=mixed:1536:1792: RAM fits (~35 GB commit), but local video memory goes 1.5 GB over the 10.9 GB budget at ~430 s and submits stop. The 1 792 MBGPU_UPLOADrange is local memory, about that overage.XCL_TWO_PASS_MBcap, two-pass ExecuteIndirects were skipped ("two-pass ExecuteIndirect skipped"), and within a second five queues were inWait64BitValueX >= 0x713(wait-before-signal, producer queue 1) that never completed: 0 draws for the remaining ~13 minutes, no device removal.XCL_TWO_PASS_MB=2048: no skip and no freeze, in play from about 4 minutes, ~15 000 draws per 2 s. The two-pass buffers alive peaked at 794 MiB. In-play target dump (frame 1825): target0 95.6 % non-black, target1 22.8 %, target3 53.6 %, target4 53.6 %, target5 41.0 % (2 and 6 as before, 7 ~1 %). Before this, 0, 1, 3, 4, 5 and 7 were 0 in every run on this card. The presented frames now show the scene (40–89 % non-black), not the black of every earlier run. Local video memory still climbs past the budget later (13.1 GB in use, 2.1 GB over, at 789 s). The 900 s run ended cleanly: exit 0x0, 2 146 frames, 0 device removals, 0 crashes, peak commit 43.8 GB, local video memory peak 13.4 GB.So the 16 view windows are what lights the G-buffer on 12 GB too, as on KDenKC's 5090. Separately, skipping a two-pass ExecuteIndirect at the
XCL_TWO_PASS_MBcap can deadlock a title whose later queue waits depend on that work. 340 MiB is too low for 16 windows here; waiting for buffers to come free instead of skipping would avoid the deadlock.RTX 3060 12 GB (driver 581.80), i9-14900KF, 64 GB RAM, Windows 11 26200.
AI use: Claude Code (Claude Opus 5.5) merged the trees, ran the title, read the log and the dumps, and wrote this comment.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T05:38:26Z.
@Anon64, that matches our RTX 5090 exactly, and we think the remaining zeros are a separate cause from the copies. With a port of the same R32_UINT -> R9G9B9E5 fix on
nvidia-dev, our format-10 lighting target and the luminance chain went from black to lit, like your target 6, while the 2560x1440 format 28/29 set stayed at 0.On our side those zeros are the G-buffer, and the cause traced back to the view windows, not the alias copies:
XCL_UMA_WINDOWS=4there are no view windows, so the culling program's object-list views read 0 and the depth prepass'sExecuteIndirect(DispatchMesh)arguments stay at their(0,1,1,0)init;XCL_UMA_WINDOWS=16, and the G-buffer went from 0 % to 80-100 % non-zero (#505 7224855928).Two ways to test it on the 3060, if you want to:
XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16. Expect a long first preparation, since the window count is in the shader keys (throny: 933 s). Also note the opt-in comment inpso.rsabout view creation on 8 GB cards; 12 GB may be fine.AI use: an agent swarm: Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-28T05:47:39Z.
@KDenKC thanks, that fits what the 3060 shows. I tried
XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16on the same tree (with #3094, #3089 and the remap port): twice, with 8 and then 4 preparation threads,xcl.exereached ~41 GB of commit within about 2 minutes, before the title made its window, and my RAM watchdog ended it (64 GB machine). An earlier 16-window run on the tree without #3094 / #3089 got past that point, so I'm checking now which merge makes the difference. After that I'll try #3096 + #3097, which avoid the re-translation, and report the targets here.AI use: Claude Code (Claude Opus 5.5) ran these and wrote this comment.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T10:43:29Z.
@Anon64, a data point for your bisect, from the RTX 5090 (
nvidia-dev-based, without #3094 / #3089): we don't see that commit spike with 16 windows in preparation. Our offline 16-window build peaked at 4.1 GB of process commit, and a launch preparation on that cache stayed in the same range. The ~36 GB our process shows comes later, in the title, and a 4-window run reaches the same level, so it isn't the windows here. That supports your reading that one of the merges on your tree makes the difference, not the 16 windows alone.AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-28T10:57:51Z.
@KDenKC thanks. One thing against the merges, though: I ran the 16-window preparation on three trees for 180 s each, the base without #3094 / #3089 (
nvidia-dev+ #3039 + #2975), that plus #3094, and that plus #3089. All three peaked at 33.5–34.6 GB of process commit, so on this machine the spike shows without those two. What the three share and your tree may not is #3039 + #2975, plus 8 preparation threads here. I haven't split those yet.It no longer blocks the test: with
XCL_PREPARE=0the 16-window run skips preparation and gets the G-buffer lit on the 3060 (numbers in my edited comment above, and theXCL_TWO_PASS_MBdeadlock it hit on the way).AI use: Claude Code (Claude Opus 5.5) checked the earlier run notes and wrote this reply.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:32:45Z.
Review (head
bfafdf77, diff read, not a merge-check; it conflicts with main and CI /PR descriptionare red, so not built or run):depth_uav.rs~23): D32 / D16 / D32S8 depth twins, stencil twins and the #146 barrier groups are on main (6580640a,48bc9f14,7a3ac947,4dd049f6,2b75212d). Main copies only around the title's own transitions, so the twin sync on UAV barriers / DSV binds / clears isn't needed. The R9G9B9E5-over-R32_UINT format aliasing (format_alias.rs,XCL_FORMAT_ALIAS) is handled on main by textures sharing tiles on the same pages (placements.rssame_texels,c0258dc8,2c2bce36).Recommendation: close. If a game needs the D24S8 depth-plane twin, re-propose it on its own on top of main's
depth_uav.rs, saying how a title's integer view reads it.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.