Repository navigation
Conversation
55e89dc to
9552842
Compare
World runs of a game title on an RTX 3060 Ti lost the device (0x887a0005) after 3 to 5.5 minutes in about half of them. With XCL_DRED both faults were GPU page faults at address 0x0, which DRED placed at "window 10 + 0x0": the window table had an entry whose buffer address was 0, so uma_va_of of an address in that window gave its offset alone as the GPU address, and uma_window_buffer(_gpu) a null buffer. uma_window_va now gives None for such a window and the buffer lookups none for a null buffer, so callers fall back (most bind window 0's address in its place) or skip instead of handing the GPU address 0. This also covers the two-pass stage's window view that xcl-dev#3052 guards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9552842 to
7d656c9
Compare
|
Review (head 7d656c9, diff read, not a merge-check; checks red):
Fine: every caller handles the new None without unwrapping it. The only AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Test report (not a 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 7d656c9a: 3 finding(s) (2 high, 1 medium), most severe first.
- High
crates/xcl/src/hle/d3d12x/bind.rs:5305: see below. - High
crates/xcl/src/hle/d3d12x/bind.rs:5076: see below. - Medium
crates/xcl/src/hle/d3d12x/list_x.rs:5751: see below.
On lines outside the diff:
-
High
crates/xcl/src/hle/d3d12x/bind.rs:5305:va = |p| uma_va_of(p).unwrap_or(first)silently binds window 0's base as the io and res blocks now thatuma_va_ofreturns None for a window with no buffer. The same pattern is at bind.rs:3099 and console_list.rs:884. So the shader reads and writes the wrong memory instead of the bind failing. If the arena putsio_atorres_atin a window with no buffer, the GPU address used to be the bare offset (a fault). Now views[0] and views[1] are window 0's base: the shader reads window 0's first bytes as its io block (table address, limits, loop budget) and writes its results there, corrupting title memory, and may loop or read out of bounds. A None forio_at/res_atshould return Err. -
High
crates/xcl/src/hle/d3d12x/bind.rs:5076:uma_window_va(0)now returns None instead of Some(0), sofirst_windowrefuses unshadowed memory whose window 0 has no buffer, the case its test documents as 'keeps going as before'. With bufs[0] = (0,0) and memory unshadowed,bind_abiandprepare_two_pass_stageused to go on with first = 0. Now every bind on XCL's ABI fails with "unified memory is not open on the GPU" and every draw and dispatch on that path is dropped. The 'no buffer in window 0' message is never logged, andbinds_refuse_shadowed_memory_without_window_0still passes while testing an input (Some(0)) that can no longer occur. -
Medium
crates/xcl/src/hle/d3d12x/list_x.rs:5751:pc_va_instill hands the GPU an invalid address for a window that isn't a GPU view and has no buffer:None => vareturns the raw console address (before the PR it returned the offset alone). Ifsparse::initfailed for a sparse or VRAM window (bufs[k] stays (0,0), notis_view_window), IASetIndexBuffer/IASetVertexBuffers at a title address in it get pc_va = va.gpu_vathen seesu.contains(va)and returns it, so a console address is bound as a PC GPU address, giving the page fault or device removal this PR targets. Returning 0 (null view) there, as the view-window branch does, would fix it.
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.
Requested by Prime
On an RTX 3060 Ti, open-world runs of a game title lost the device (0x887a0005) after 3 to 5.5 minutes in about half of them. With
XCL_DREDboth faults were GPU page faults at address 0x0, which DRED placed at "window 10 + 0x0": the memory window table had an entry whose buffer address was 0, souma_va_ofof an address in that window returned the offset alone as the GPU address, anduma_window_buffer(_gpu)a null buffer.uma_window_vanow returns None for such a window, and the buffer lookups return none for a null buffer. Callers then fall back (most bind window 0's address instead) or skip, rather than handing the GPU address 0.Related: #3052 guards the two-pass stage's window view against the same null window. This change fixes the lookup itself, so it also covers that site.
What is in it
crates/xcl/src/hle/d3d12x/real.rs:uma_window_vafilters a 0 buffer address;uma_window_buffer/uma_window_buffer_gpureturn none for a null buffer.Tested
cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnupasses. The test suite was not run on this exact branch.Regression run
Not tested
scripts/smoke.ps1on this branch; AMD.AI use
🤖 Generated with Claude Code