D3D12.X: a memory window with no GPU buffer gives no GPU address #3658

Open
Prime1997 wants to merge 1 commit from upstream-pr/3658 into main
Prime1997 commented 2026-12-02 04:35:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-12-02T04:35:08Z.


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_DRED both 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, so uma_va_of of an address in that window returned the offset alone as the GPU address, and uma_window_buffer(_gpu) a null buffer. uma_window_va now 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_va filters a 0 buffer address; uma_window_buffer / uma_window_buffer_gpu return none for a null buffer.

Tested

  • RTX 3060 Ti 8 GB, Windows 11, release build: the change has been in our test builds since 1 Dec (no measured before/after on its own).
  • This branch (on main 1c8b5514): cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnu passes. The test suite was not run on this exact branch.

Regression run

  • Not run yet: testers welcome.

Not tested

  • The suite and scripts/smoke.ps1 on this branch; AMD.
  • No unit test: it needs a window table with a null buffer, which the UMA setup does not create on purpose.

AI use

  • Claude Code wrote the change and this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5599913906 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3658). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-12-02T04:35:08Z. --- <!-- claude-projects-attribution: {"github_login":"Prime1997"} --> _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_DRED` both 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, so `uma_va_of` of an address in that window returned the offset alone as the GPU address, and `uma_window_buffer(_gpu)` a null buffer. `uma_window_va` now 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_va` filters a 0 buffer address; `uma_window_buffer` / `uma_window_buffer_gpu` return none for a null buffer. **Tested** - RTX 3060 Ti 8 GB, Windows 11, release build: the change has been in our test builds since 1 Dec (no measured before/after on its own). - This branch (on main 1c8b5514): `cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnu` passes. The test suite was not run on this exact branch. **Regression run** - Not run yet: testers welcome. **Not tested** - The suite and `scripts/smoke.ps1` on this branch; AMD. - No unit test: it needs a window table with a null buffer, which the UMA setup does not create on purpose. **AI use** - Claude Code wrote the change and this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-02 09:17:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:17:17Z.


Review (head 7d656c9a, diff read, not a merge-check; checks red):

  • The lookups changed here never reach "window 10", so this cannot be the fix for that fault. log_device_removed (real.rs ~12489) labels a fault address with the first entry of uma_window_vas() within 4 GiB below it. A fault at 0x0 therefore matches the first window whose address is 0. In the 16-window layout with one coherent window (sparse 0-2, coherent 3, views 4-9), windows 10-15 are WindowKind::None and stay (0, 0) by construction (real.rs ~710). Uma::window gives them length 0 (uma.rs ~738), so window_of never returns them (uma.rs ~775), and uma_va_of, uma_window_buffer_gpu and pc_va_in never look them up. The only callers that pass an index ask for windows 0-3 (bind.rs ~3108, ~5317). The label "window 10" also shows that windows 0-9 all had addresses, so nothing this PR filters was 0 in that run. By reading, the PR changes nothing on the reported path. The same DRED fault is the evidence for #3657 (vertex or index buffer views at address 0), which fits it better.
  • Binds on XCL's ABI now fail when window 0 has no buffer and memory is not shadowed. first_window(uma_window_va(0), ..) (bind.rs ~3083, ~5291) now receives None instead of Some(0). When sparse::init could not make the reserved buffers (sparse.rs ~3408), every bind_abi and every two-pass stage is now refused with "unified memory is not open on the GPU", and the draw or dispatch is skipped (bind.rs ~3837). Main kept drawing in that case on purpose: binds_refuse_shadowed_memory_without_window_0 (bind.rs ~7964) says "unshadowed memory with none keeps going as before". That test still passes only because it calls first_window directly. The first == 0 && shadowed branch is now dead, and the shadowed case gets the wrong error message.
  • pc_va sends the title's CPU address to the GPU for a window with no buffer. In pc_va_in (list_x.rs ~5745), a non-view window whose lookup now gives None takes the None => va arm. That passes the raw title address on as a GPU address, which the comment above it says hangs the device. Main sent the offset alone instead. Neither of these is a null view.
  • No test. pc_va_in and first_window already take the window address as a parameter. A test that feeds them a window without a buffer would have shown the two behaviour changes above. The description says no window table with a null buffer exists "on purpose", which agrees with the first point.
  • PR description check is red. It refuses the PR because it has no xcl-smoke block for the head commit and none for main. The description also says the test suite was not run on this branch.

Fine: every caller handles the new None without unwrapping it. The only unwrap is in a GPU test (gpu/recomp/tests.rs ~5527). bind.rs ~5317 and list_x.rs ~5232 already filtered 0 on main, and uma_window_buffer has no callers. This PR overlaps the open #3052 at the two-pass site.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7340659095 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3658#issuecomment-7340659095). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T09:17:17Z. --- Review (head 7d656c9a, diff read, not a merge-check; checks red): - **The lookups changed here never reach "window 10", so this cannot be the fix for that fault.** `log_device_removed` (`real.rs ~12489`) labels a fault address with the first entry of `uma_window_vas()` within 4 GiB below it. A fault at 0x0 therefore matches the first window whose address is 0. In the 16-window layout with one coherent window (sparse 0-2, coherent 3, views 4-9), windows 10-15 are `WindowKind::None` and stay `(0, 0)` by construction (`real.rs ~710`). `Uma::window` gives them length 0 (`uma.rs ~738`), so `window_of` never returns them (`uma.rs ~775`), and `uma_va_of`, `uma_window_buffer_gpu` and `pc_va_in` never look them up. The only callers that pass an index ask for windows 0-3 (`bind.rs ~3108`, `~5317`). The label "window 10" also shows that windows 0-9 all had addresses, so nothing this PR filters was 0 in that run. By reading, the PR changes nothing on the reported path. The same DRED fault is the evidence for #3657 (vertex or index buffer views at address 0), which fits it better. - **Binds on XCL's ABI now fail when window 0 has no buffer and memory is not shadowed.** `first_window(uma_window_va(0), ..)` (`bind.rs ~3083`, `~5291`) now receives None instead of `Some(0)`. When `sparse::init` could not make the reserved buffers (`sparse.rs ~3408`), every `bind_abi` and every two-pass stage is now refused with "unified memory is not open on the GPU", and the draw or dispatch is skipped (`bind.rs ~3837`). Main kept drawing in that case on purpose: `binds_refuse_shadowed_memory_without_window_0` (`bind.rs ~7964`) says "unshadowed memory with none keeps going as before". That test still passes only because it calls `first_window` directly. The `first == 0 && shadowed` branch is now dead, and the shadowed case gets the wrong error message. - **`pc_va` sends the title's CPU address to the GPU for a window with no buffer.** In `pc_va_in` (`list_x.rs ~5745`), a non-view window whose lookup now gives None takes the `None => va` arm. That passes the raw title address on as a GPU address, which the comment above it says hangs the device. Main sent the offset alone instead. Neither of these is a null view. - **No test.** `pc_va_in` and `first_window` already take the window address as a parameter. A test that feeds them a window without a buffer would have shown the two behaviour changes above. The description says no window table with a null buffer exists "on purpose", which agrees with the first point. - **PR description check is red.** It refuses the PR because it has no `xcl-smoke` block for the head commit and none for main. The description also says the test suite was not run on this branch. Fine: every caller handles the new None without unwrapping it. The only `unwrap` is in a GPU test (`gpu/recomp/tests.rs ~5527`). `bind.rs ~5317` and `list_x.rs ~5232` already filtered 0 on main, and `uma_window_buffer` has no callers. This PR overlaps the open #3052 at the two-pass site. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-02 11:27:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T11:27:47Z.


Test report (not a merge-check: PR description red)
base: 1c8b551475
head: 7d656c9adb
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3658#issuecomment-7340659095 and its findings stand. Most serious: the changed lookups never reach the empty "window 10", so it can't fix the fault it cites, and binds now fail when window 0 has no buffer.
performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (7d656c9a): 1652 -> 1675 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 17821 MB, 0 device removals, 0 crashes.
assessment: merges, builds and passes the whole suite on current main, and the smoke run is clean; the blocking point is in the review: the changed lookups never reach the empty "window 10", so it can't fix the fault it cites, and binds now fail when window 0 has no buffer
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7343954028 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3658#issuecomment-7343954028). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T11:27:47Z. --- Test report (not a merge-check: `PR description` red) base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 7d656c9adbc7a22175ddbc2ba61713135751a130 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3658#issuecomment-7340659095 and its findings stand. Most serious: the changed lookups never reach the empty "window 10", so it can't fix the fault it cites, and binds now fail when window 0 has no buffer. performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (7d656c9a): 1652 -> 1675 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 17821 MB, 0 device removals, 0 crashes. assessment: merges, builds and passes the whole suite on current main, and the smoke run is clean; the blocking point is in the review: the changed lookups never reach the empty "window 10", so it can't fix the fault it cites, and binds now fail when window 0 has no buffer hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
bmjask commented 2026-12-02 19:41:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T19:41:50Z.

Review: COMMENTED


Review of 7d656c9a: 3 finding(s) (2 high, 1 medium), most severe first.

  1. High crates/xcl/src/hle/d3d12x/bind.rs:5305: see below.
  2. High crates/xcl/src/hle/d3d12x/bind.rs:5076: see below.
  3. Medium crates/xcl/src/hle/d3d12x/list_x.rs:5751: see below.

On lines outside the diff:

  1. 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 that uma_va_of returns 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 puts io_at or res_at in 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 for io_at/res_at should return Err.

  2. High crates/xcl/src/hle/d3d12x/bind.rs:5076: uma_window_va(0) now returns None instead of Some(0), so first_window refuses 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_abi and prepare_two_pass_stage used 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, and binds_refuse_shadowed_memory_without_window_0 still passes while testing an input (Some(0)) that can no longer occur.

  3. Medium crates/xcl/src/hle/d3d12x/list_x.rs:5751: pc_va_in still hands the GPU an invalid address for a window that isn't a GPU view and has no buffer: None => va returns the raw console address (before the PR it returned the offset alone). If sparse::init failed for a sparse or VRAM window (bufs[k] stays (0,0), not is_view_window), IASetIndexBuffer/IASetVertexBuffers at a title address in it get pc_va = va. gpu_va then sees u.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.

<!-- greyfinch-sync:ivall/xcl:review:6157660715 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3658#pullrequestreview-6157660715). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T19:41:50Z. **Review:** COMMENTED --- Review of `7d656c9a`: 3 finding(s) (2 high, 1 medium), most severe first. 1. **High** `crates/xcl/src/hle/d3d12x/bind.rs:5305`: see below. 2. **High** `crates/xcl/src/hle/d3d12x/bind.rs:5076`: see below. 3. **Medium** `crates/xcl/src/hle/d3d12x/list_x.rs:5751`: see below. **On lines outside the diff:** 1. **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 that `uma_va_of` returns 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 puts `io_at` or `res_at` in 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 for `io_at`/`res_at` should return Err. 2. **High** `crates/xcl/src/hle/d3d12x/bind.rs:5076`: `uma_window_va(0)` now returns None instead of Some(0), so `first_window` refuses 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_abi` and `prepare_two_pass_stage` used 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, and `binds_refuse_shadowed_memory_without_window_0` still passes while testing an input (`Some(0)`) that can no longer occur. 3. **Medium** `crates/xcl/src/hle/d3d12x/list_x.rs:5751`: `pc_va_in` still hands the GPU an invalid address for a window that isn't a GPU view and has no buffer: `None => va` returns the raw console address (before the PR it returned the offset alone). If `sparse::init` failed for a sparse or VRAM window (bufs[k] stays (0,0), not `is_view_window`), IASetIndexBuffer/IASetVertexBuffers at a title address in it get pc_va = va. `gpu_va` then sees `u.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._
Foniass commented 2026-12-03 15:05:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T15:05:27Z.


merge-check
base: 16c2fd082a
head: 7d656c9adb
merge: clean
build: ok
tests: 3012 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 4 high, 3 medium (below)
performance: 60 s smoke run: 1683 → 1664 frames (98 % of main), peak commit 18505 → 18768 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 237 s there, 0 device removals, 0 crashes, 3.1 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 4 blocking findings (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: uma_window_va now returns None for a window whose address is 0, and the buffer lookups return none for a null buffer, to stop GPU faults at address 0. The head has not changed since my earlier review, and all of its findings are still open: the changed lookups never reach the "window 10" the description cites, and when a window lacks a buffer, binds that worked are now refused and addresses that faulted now point at the wrong memory. It blocks.

High

  1. Cannot be the fix for the cited fault. Still open from my earlier review. log_device_removed (real.rs ~12496) labels a fault with the first window within 4 GiB below it, so address 0 matches the first window whose address is 0. In the 16-window layout, windows 10-15 are WindowKind::None, have length 0 (uma.rs ~738), and window_of never returns them (uma.rs ~775). So uma_va_of, uma_window_buffer_gpu and pc_va_in never look them up. The label "window 10" also means windows 0-9 all had addresses. The same DRED fault fits #3657 (vertex or index buffer views at address 0), which is still open.
  2. Binds refused when window 0 has no buffer and memory is not shadowed. Still open. first_window(uma_window_va(0), ..) (bind.rs ~3083, ~5291) now gets None instead of Some(0). When sparse::init could not make the reserved buffers, every bind_abi and two-pass stage fails with "unified memory is not open on the GPU" and the draw or dispatch is skipped, where main went on. binds_refuse_shadowed_memory_without_window_0 (bind.rs ~7964) still passes only because it feeds first_window an input that can no longer occur, the first == 0 && shadowed branch is now dead, and the shadowed case gets the wrong message.
  3. pc_va sends the title's CPU address to the GPU. Still open. In pc_va_in (list_x.rs ~5751), a window that is not a view window and now gives None takes the None => va arm. That binds the raw console address as a PC GPU address, which the comment above it says hangs the device; main sent the offset alone. Return 0 (a null view) there, as the view-window arm does.
  4. No test. Still open. A fix needs a test that fails without it. pc_va_in and first_window already take the window address as a parameter, so a test that feeds them a window without a buffer needs no device; it would have shown the two changes above.

Medium

  1. io and res blocks bound at window 0 for a window with no buffer. va = |p| uma_va_of(p).unwrap_or(first) (bind.rs ~5305, ~3099; console_list.rs ~884 with uma_va) now falls back to window 0's base when io_at or res_at lies in a window with no buffer. Main gave a bare offset there, which faults. Now the shader reads window 0's first bytes as its io block and writes its results over them: silent corruption instead of a fault. A None for io_at/res_at should return Err.
  2. Overlaps #3052. #3052 (open) guards the two-pass stage's window view against the same null window; the description says this PR covers that site too. One of them should be closed or rebased onto the other.
  3. Description gaps. Still open. No suite counts and no xcl-smoke blocks (Tested has only cargo check for the gnu target). AI use does not name the model.
Checked and fine
  • Every caller handles the new None without unwrapping it (the only unwrap is in a GPU test, gpu/recomp/tests.rs ~5527)
  • bind.rs ~5317 and list_x.rs ~5232 already filtered 0 on main, and uma_window_buffer has no callers
How this was tested
  • Merged onto main 16c2fd08, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 16c2fd08 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7382544860 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3658#issuecomment-7382544860). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T15:05:27Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: 7d656c9adbc7a22175ddbc2ba61713135751a130 merge: clean build: ok tests: 3012 passed, 0 failed, 56 ignored; 28 skipped, the same as on main review: 4 high, 3 medium (below) performance: 60 s smoke run: 1683 → 1664 frames (98 % of main), peak commit 18505 → 18768 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 237 s there, 0 device removals, 0 crashes, 3.1 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 4 blocking findings (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** uma_window_va now returns None for a window whose address is 0, and the buffer lookups return none for a null buffer, to stop GPU faults at address 0. The head has not changed since my earlier review, and all of its findings are still open: the changed lookups never reach the "window 10" the description cites, and when a window lacks a buffer, binds that worked are now refused and addresses that faulted now point at the wrong memory. It blocks. #### High 1. **Cannot be the fix for the cited fault.** Still open from my earlier review. log_device_removed (real.rs ~12496) labels a fault with the first window within 4 GiB below it, so address 0 matches the first window whose address is 0. In the 16-window layout, windows 10-15 are WindowKind::None, have length 0 (uma.rs ~738), and window_of never returns them (uma.rs ~775). So uma_va_of, uma_window_buffer_gpu and pc_va_in never look them up. The label "window 10" also means windows 0-9 all had addresses. The same DRED fault fits #3657 (vertex or index buffer views at address 0), which is still open. 2. **Binds refused when window 0 has no buffer and memory is not shadowed.** Still open. first_window(uma_window_va(0), ..) (bind.rs ~3083, ~5291) now gets None instead of Some(0). When sparse::init could not make the reserved buffers, every bind_abi and two-pass stage fails with "unified memory is not open on the GPU" and the draw or dispatch is skipped, where main went on. binds_refuse_shadowed_memory_without_window_0 (bind.rs ~7964) still passes only because it feeds first_window an input that can no longer occur, the first == 0 && shadowed branch is now dead, and the shadowed case gets the wrong message. 3. **pc_va sends the title's CPU address to the GPU.** Still open. In pc_va_in (list_x.rs ~5751), a window that is not a view window and now gives None takes the None => va arm. That binds the raw console address as a PC GPU address, which the comment above it says hangs the device; main sent the offset alone. Return 0 (a null view) there, as the view-window arm does. 4. **No test.** Still open. A fix needs a test that fails without it. pc_va_in and first_window already take the window address as a parameter, so a test that feeds them a window without a buffer needs no device; it would have shown the two changes above. #### Medium 5. **io and res blocks bound at window 0 for a window with no buffer.** va = |p| uma_va_of(p).unwrap_or(first) (bind.rs ~5305, ~3099; console_list.rs ~884 with uma_va) now falls back to window 0's base when io_at or res_at lies in a window with no buffer. Main gave a bare offset there, which faults. Now the shader reads window 0's first bytes as its io block and writes its results over them: silent corruption instead of a fault. A None for io_at/res_at should return Err. 6. **Overlaps #3052.** #3052 (open) guards the two-pass stage's window view against the same null window; the description says this PR covers that site too. One of them should be closed or rebased onto the other. 7. **Description gaps.** Still open. No suite counts and no xcl-smoke blocks (Tested has only cargo check for the gnu target). AI use does not name the model. <details><summary>Checked and fine</summary> - Every caller handles the new None without unwrapping it (the only unwrap is in a GPU test, gpu/recomp/tests.rs ~5527) - bind.rs ~5317 and list_x.rs ~5232 already filtered 0 on main, and uma_window_buffer has no callers </details> <details><summary>How this was tested</summary> - Merged onto main `16c2fd08`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `16c2fd08` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3658:upstream-pr/3658'
git switch 'upstream-pr/3658'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3658'
git switch 'upstream-pr/3658'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3658'
git switch 'upstream-pr/3658'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3658'
git switch 'main'
git merge --squash 'upstream-pr/3658'
git switch 'main'
git merge --ff-only 'upstream-pr/3658'
git switch 'main'
git merge 'upstream-pr/3658'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3658
No description provided.