Repository navigation
Conversation
…FFER dim in null_uav_desc
|
Verified the translated guest buffer-store path on The fixture allocated a 64 KiB-aligned block of committed coherent UMA and used the production The dispatch used the shader test runner with the coherent window bound and the fixture supplying the four SGPRs. Guest descriptor-table loading, shifted counter resources, and the native Uint/Float clear entry points remain separate coverage questions. AI disclosure: OpenAI Codex built and ran the fixture and drafted this report. |
|
Review (head 5cd9be1, diff read, not a merge-check):
Suggested verdict: not yet. (Review written with Claude Code, Claude Opus 5.5; both points were traced in the code.) |
bmjask
left a comment
There was a problem hiding this comment.
Review of 5cd9be1c: 2 finding(s). 1 are inline. These are on lines outside the diff:
crates/xcl/src/hle/d3d12x/real.rs:3730: buf_delta_null also applies when cpu isn't a console heap slot (the return pc_uav(cpu) path), so a plain PC descriptor becomes null and no UMA V# is written anywhere to fall back on. dev_create_srv_x returns f(this, res, desc, cpu) for non-console slots before its buf_delta_null check, so this doesn't mirror the SRV fix. A delta-buffer UAV at a non-console handle (XCL-internal heap, PC-handle ClearUAV via UavClearHandles::Pc, descriptor copies) silently reads, writes or clears nothing.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| crate::xlog_warn!("D3D12.X: a UAV of a resource that cannot have one on the PC (a depth buffer) – a null view"); | ||
| } | ||
| f(this, std::ptr::null_mut(), std::ptr::null_mut(), &null_desc, at) | ||
| } else if buf_delta_null { |
There was a problem hiding this comment.
Once a shifted buffer's slot gets the null PC UAV, ClearUnorderedAccessViewUint/Float in list_x::clear_uav, and the CLEAR_UAV_MARKER replay in console_list.rs (~967), still pass that null descriptor to the PC together with the real resource. Clearing a UAV of a buffer placed at va & 0xFFFF != 0 (common for counters and indirect args) now sends a descriptor that doesn't match pResource. The debug layer reports an error, the buffer isn't zeroed, or a strict driver removes the device. Before this PR the clear went through a real view. These clears are listed under Not tested.
When a console buffer was placed at a 64 KiB-aligned UMA backing address below its console address (
buffer_delta(res) != 0),dev_create_srv_xalready substituted a null PC buffer SRV (buf_delta_null) because PC D3D12FirstElementcannot express the sub-buffer byte delta, whilebuffer_viewwrote the exact UMA V# into the console descriptor slot.dev_create_uav_xdid not have the matchingbuf_delta_nullguard:buffer_delta != 0buffer (or counter buffer) toCreateUnorderedAccessViewon PC created a PC UAV referencing the shifted PC resource (at the wrong element offset, or failing PC validation when the buffer size + delta did not align withStructureByteStride/NumElements), and published the non-zero resource pointer into the console slot.null_uav_descfell through forD3D12_UAV_DIMENSION_BUFFER(1) toD3D12_UAV_DIMENSION_TEXTURE2D, which did not preserve buffer dimension for null buffer UAVs.What is in it
crates/xcl/src/hle/d3d12x/real.rs:D3D12_UAV_DIMENSION_BUFFER(1) arm tonull_uav_descreturning a valid null buffer UAV descriptor (DXGI_FORMAT_R32_UINT,D3D12_UAV_DIMENSION_BUFFER).dev_create_srv_x'sbuf_delta_nullhandling indev_create_uav_xwhenViewDimension == D3D12_UAV_DIMENSION_BUFFERand eitherresorcounterhasbuffer_delta(...) != 0: create a valid null PC buffer UAV inslot.pc_uavand publish0(whilebuffer_viewcontinues to write the exact UMA V# into the console descriptor slot).uav_buffer_delta_tests(null_uav_desc_preserves_buffer_dimensionanddev_create_uav_x_buffer_delta_uses_null_pc_uav_and_writes_uma_vsharp).Tested
32.0.16.1074),rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9 (1.9.2609).null_uav_descreturnedTEXTURE2D;dev_create_uav_xpublished the non-zero PC resource pointer instead of0).cargo test -p xcl --lib -- hle::d3d12x::real::uav_buffer_delta_tests::): 2 passed, 0 failed (0.17s, D3D12 debug layer enabled, 0 debug-layer errors, exact UMA V# verified).cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::withXCL_DXC_DIRset to DXC 1.9): 2601 passed, 0 failed, 49 ignored, 9 filtered (160.8s).SKIPPEDlines in workspace run (26 total): 21no wave64(RTX 5070 Ti is wave32), 3 wave32 per-lane#1426(V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), 2no heap windows(defaultXCL_HEAP_WINDOWSoff).cargo build --release -p xcl -j 4) succeeded and passed the paired 150 s title smoke below.Regression run
main (
f0e8fdd5c3942ddd399d5ee11384c8595c5aacff):PR (
5cd9be1c178887bc370f589c57b21eb7918860e5):Not tested
uma_driver::tests::andtest_title_runs_and_game_folder_is_untouched(filtered out of the workspace test run).ClearUnorderedAccessViewUint/ClearUnorderedAccessViewFloaton a buffer with a non-zerobuffer_delta(tracked separately from view creation).AI use