Repository navigation
Conversation
…) and ResourceBarrierX (xcl-dev#140) Slots xcl-dev#137 (Write32BitValueBottomOfPipe2X), xcl-dev#138 (Write64BitValueBottomOfPipe2X), and xcl-dev#140 (ResourceBarrierX) on newer-layout console command lists fell through to unhooked console-extension stubs, silently dropping bottom-of-pipe marker/timestamp writes and extended resource barrier batches. - Add list_x::write32_bottom_2x and list_x::write64_bottom_2x with the 5-argument ABI (va, value, sync_flags, control_flags, flags), emitting a UAV barrier on DIRECT/COMPUTE lists when sync_flags or control_flags are non-zero, forwarding BOTTOM_TIMESTAMPS on 64-bit writes, and writing MARKER_OUT otherwise. - Add list_x::resource_barrier_ext_x for ResourceBarrierX, zeroing any non-null supplemental-actions out-parameter and forwarding the barrier batch through resource_barrier_x even when PREVENT_PIPELINE_SYNC is requested. - Wire slots xcl-dev#137, xcl-dev#138, and xcl-dev#140 in real.rs::console_slots(Kind::CommandList) and add unit, vtable, and D3D12 GPU tests.
|
Ordinary marker values from guest vtable slots 137 and 138 reached CPU memory on RTX 5070 (616.92), head I used aligned CPU-backed destinations outside unified memory, slot 137 with sync_flags=1 and slot 138 with control_flags=1, both with final flags=0. The initial DWORD and QWORD stayed unchanged through list close. I submitted through XCL's queue ExecuteCommandLists hook. Its log identified two deferred CPU writes. All five runs eventually produced One boundary worth keeping explicit in a regression: a subsequent native D3D12 fence can finish before the CPU worker publishes these stores. On the first observation after that fence, four runs still had both original values and one already had both final values. All reached the final values within the bounded five-second observation. The QWORD was checked as two DWORDs, matching the worker's store widths. This does not establish atomic QWORD visibility or an ordering defect in guest waits; the test isolates ordinary CPU-backed markers, without timestamps or a dependent guest wait. AI-assisted fixture and verification. |
|
Follow-up on the guest ordering boundary in the marker-only control. On the same head
This covers same-queue, same-batch dependent waits on ordinary markers to CPU-backed memory. It does not establish atomic QWORD publication or cross-queue ordering. AI-assisted fixture and verification. |
|
Review (head 61d9d4b, diff read, not a merge-check: CI is red, so not built or run here yet):
Fine: it reuses AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 61d9d4b9: 4 finding(s). 4 are inline.
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.
| // the newer layout's (called before anything tells the layouts apart) | ||
| (131, l::flush_cache_range_x as usize), | ||
| (132, l::flush_cache_range_x as usize), | ||
| (137, l::write32_bottom_2x as usize), |
There was a problem hiding this comment.
#137/#138/#140 are hooked for every list regardless of layout, but they're only known to be these methods on the newer layout, where the console methods sit two slots later (NEWER_LIST_SLOTS). On the older layout #138 is probably ResourceBarrierX. It would now go to write64_bottom_2x, which reads (n, barriers_ptr, ...) as (va, value, ...), writes to address n and drops the barrier batch. Before this it hit a logged no-op stub. Installing these through guard::make_layout_split with QUEUE_SHIFTED (older = the existing stub) keeps the older layout as it was.
| flush_barrier(this); | ||
| } | ||
| record_write_trace(this, va, value, flags, "W64B2"); | ||
| if flags & BOTTOM_TIMESTAMPS != 0 { |
There was a problem hiding this comment.
This tests the 2X flags against BOTTOM_TIMESTAMPS (0x3, the older Write64BitValueBottomOfPipeX bits), but the PR description says the 2X timestamp bit is 0x4, so one of the two is wrong. If it's 0x4, timestamp requests write the literal value (usually 0), and calls with bits 0x1/0x2 set for something else become timestamps and lose their marker value. The GPU test passes BOTTOM_TIMESTAMPS itself, so it can't catch this.
| _flags: u32, | ||
| actions: *mut u64, | ||
| ) { | ||
| if !actions.is_null() { |
There was a problem hiding this comment.
Not certain about this one: the supplemental-actions out-param is written as a full u64. If the console type is a 32-bit flags value, this also zeroes the 4 bytes after it on the title's stack. Is the width confirmed?
| ) { | ||
| if !actions.is_null() { | ||
| actions.write_unaligned(0); | ||
| } |
There was a problem hiding this comment.
Not certain about this one: this assumes ResourceBarrierX's array uses the 32-byte console D3D12_RESOURCE_BARRIER stride. If the X call takes a larger extended struct, every barrier after the first in an n>1 batch is decoded from the wrong offset. The tests only use n=1.
What is in it
Three newer-layout console command-list methods were unhooked in
real::console_slots(Kind::CommandList):#137:Write32BitValueBottomOfPipe2X#138:Write64BitValueBottomOfPipe2X#140:ResourceBarrierXTitles calling these methods fell through to unhooked console-extension stubs, silently dropping bottom-of-pipe marker/timestamp writes, their associated synchronization, and extended resource barrier batches (and leaving the
ResourceBarrierXsupplemental-actions out-parameter uninitialized).This change:
list_x::write32_bottom_2xandlist_x::write64_bottom_2xincrates/xcl/src/hle/d3d12x/list_x.rsmatching the 5-argument ABI(va, value, sync_flags, control_flags, flags): emitsflush_barrier(this)on DIRECT/COMPUTE lists whensync_flags != 0 || control_flags != 0, forwardsBOTTOM_TIMESTAMPS(flags & 0x4 != 0) on 64-bit writes throughwrite64_bottom_timestamp_x, recordsW32B2/W64B2andnote_write64_recorded, and writesMARKER_OUTotherwise.list_x::resource_barrier_ext_xincrates/xcl/src/hle/d3d12x/list_x.rsforResourceBarrierX: zeroes any non-null supplemental-actions out-parameter (actions: *mut u64) via unaligned write and forwards(this, n, barriers)throughresource_barrier_xeven whenPREVENT_PIPELINE_SYNC(0x10000) is set.(137, l::write32_bottom_2x),(138, l::write64_bottom_2x), and(140, l::resource_barrier_ext_x)incrates/xcl/src/hle/d3d12x/real.rs::console_slots(Kind::CommandList).sync_flags/control_flagsbarrier gating,BOTTOM_TIMESTAMPS64-bit GPU execution, andResourceBarrierXTexture2D transitions with non-nullactions.Tested
Hardware and toolchain: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11 Pro (Build 26200),
rustc 1.99.0 (b940084d7), DXC 1.9 (dxcompiler 1.9.2609.5,dxil 1.9.2609.5), debug + release builds.cargo test -p xcl --lib -- bop2x_and_resource_barrier_ext_x cache_flushes_are_uav_barriers console_slots_hook_sync_bop2x --test-threads=1 --nocapture: 4 passed, 0 failed (includesgpu_bop2x_and_resource_barrier_ext_x_execute_cleanlyexecuting on RTX 5070 Ti).cargo test --workspace -- --test-threads=4: 2611 passed, 0 failed, 49 ignored (26 GPU tests reportedSKIPPED: 21no wave64, 3#1426f16 compiler refusals, 2no heap windows).Regression run
Baseline (
origin/mainancestorf0e8fdd5, 150 s on RTX 5070 Ti):This PR (
61d9d4b9, 150 s on RTX 5070 Ti):Not tested
ResourceBarrierXactionsout-parameter (currently zeroed) or on deferred pipeline synchronization whenPREVENT_PIPELINE_SYNCis set.d3d12_x) command lists where slot indices differ from the newer console layout.AI use
Antigravity (Gemini) assisted with auditing the command-list slot layout, drafting the handlers and unit/GPU tests, and formatting this PR description. All code was reviewed, built, and verified locally on RTX 5070 Ti with the full workspace test suite and 150 s smoke run.