Skip to content

D3D12.X: two-pass mesh stages never bind a memory window at GPU VA 0 - #3052

Open
Raul-Paiva wants to merge 1 commit into
xcl-dev:mainfrom
Raul-Paiva:nvidia-dev-two-pass-window-va0
Open

Raul-Paiva wants to merge 1 commit into
xcl-dev:mainfrom
Raul-Paiva:nvidia-dev-two-pass-window-va0

Conversation

@Raul-Paiva

@Raul-Paiva Raul-Paiva commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

A two-pass stage (prepare_two_pass_stage, used by DispatchMesh and ExecuteIndirect(DispatchMesh)) binds the four memory windows as root UAVs u2–u5 with uma_window_va(k).unwrap_or(first). uma_window_va returns Some(0) for a window that has no buffer on the GPU. In real.rs the windows start as (0, 0) and only committed or sparse windows get a buffer, so such a window is bound as a null root view.

c685e12 added .filter(|&v| v != 0) to the same lookup in bind_abi, because direct DXIL compute reads every window slot (with_mem_raw_loads). The two-pass compute pass is a direct DXIL compute shader as well, but its bind was left out, so it can read GPU VA 0, which is a page fault and a device removal.

This PR moves the lookup into one helper, window_view, and uses it in both binds.

This is a defensive fix. On my setup (3 sparse windows + 1 coherent window), all four windows always have a buffer, so uma_window_va never returns 0 there and this path never triggers: the old and the new code bind the same addresses. It matters when a window has no buffer, for example when sparse::init fails or with a layout that has a gap.

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs:
    • window_view(window, first): a window's buffer, or window 0's when it has none (None or 0);
    • prepare_two_pass_stage and bind_abi use it;
    • unit test windows_without_a_buffer_take_window_0.

Tested

  • Hardware: RTX 3070 Laptop GPU 8 GB, driver 621.40, i7-11800H, 32 GB, Windows 10 19045, rustc 1.100.0, release build.
  • Base for the comparison: main 5b0d5fa (same commands, same machine). The head pushed here is the same change rebased onto main 9dfbe3e without conflicts; main's newer commits also change bind.rs, which the rebase merged. CI passes on this head; the test counts below were measured before that rebase.
  • On the previous head a921739 (the same change on main d52ff48), the lib tests of the modules this PR touches (hle::d3d12x::bind), release, serial, with the 20 skips: 116 passed, 1 failed, 0 ignored. The failure, bind::tests::gpu_two_pass_indirect_commands_keep_their_own_records (E_INVALIDARG from the driver on this adapter), fails the same way on main d52ff48.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4: the lib test binary ends early on main too (exit 0x80004005 after sparse upload preparation still failed after bounded retries), so the lib was also run alone, serially (--test-threads=1), with --skip for the 20 tests that end the binary on main (6 list_x, 12 sparse, 1 texture_upload, 1 uma_driver; each passes alone).
  • This PR tested at 621ea567 (on main 5b0d5fa):
    • integration tests: 138 passed, 1 failed, 20 ignored; main: 139 passed, 0 failed, 20 ignored. The failure is gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs ("releasing the title PSOs releases their two-pass state", 1 vs 0). Run 8 times alone it failed 2 times on this head and 2 times on main, so it is intermittent there too.
    • lib, serial with the 20 skips: 2604 passed, 14 failed, 29 ignored; main: 2604 passed, 13 failed, 29 ignored. The new windows_without_a_buffer_take_window_0 passes. The 13 failures of main fail here too; the 14th, list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list, passes alone 5/5 on this head and on main (it failed in the long run on main 0fe06eb as well).
  • SKIPPED on this adapter (same on main): the wave64 forms (no wave64), three f16/f32 per-lane forms refused by the recompiler, and the heap-window tests (no heap windows).

Regression run
scripts/smoke.ps1 -Seconds 120 -Title 'retail title A', release builds of clean trees, one after the other on the machine in Tested, with XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000. The title is left on its own, with no input; the shader cache was warmed by two runs of main before.

main:

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3362 (PresentX 3362)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16519 MB

This PR:

xcl-smoke v1
commit: 0364b388c60719f24e9043321f2c162e87a4ef5d
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3363 (PresentX 3363)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16640 MB

Not tested

  • The smoke runs stay in the menus or the start of a load, so they do not reach two-pass mesh draws. They are a regression check only.
  • That this removes a device removal in a real title. On my machine, removals with DRED page fault at GPU VA 0x0 happen during mesh-heavy scenes, but I have not tied one to this bind.
  • Which window layouts actually leave a window without a buffer. The code allows it: a WindowKind::None gap below shader_windows(), or sparse windows when sparse::init fails.
  • AMD, Series X profile, other NVIDIA GPUs.
  • The new test covers the helper. Before this change, the two-pass stage did not go through it, so the test does not fail on the old code by itself.

AI use

  • Claude Code (Claude Opus 5.5) found the missing filter while reviewing the code, wrote the change and the test, ran the tests and wrote this description. I read the diff and checked it.

🤖 Generated with Claude Code

@Raul-Paiva

Raul-Paiva commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Edit: the pattern in the last part of this comment does not hold. See the correction: #3052 (comment)

I ran this fix in a retail title's 3D world. It does not stop the page fault at GPU VA 0x0 removals I get there. The fix is still correct, but those removals have another cause. The data is below in case it helps with #2920.

Tree (local, not pushed)

Setup

  • RTX 3070 Laptop 8 GB, driver 621.24, i7-11800H, 32 GB RAM, Windows 10 19045, rustc 1.100.0, release build.
  • Env: XCL_DEVICE_TYPE=lockhart XCL_TEXTURE_LEVEL_PAGES=1 XCL_SPARSE_LAZY=1 XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000 XCL_TWO_PASS_MB=1024 XCL_DEPTH_UAV_TWIN=1.
  • 600 s runs, gamepad A pressed every 5 s. Play time is counted from the first present.

Result, the same tree with and without this commit:

Without With this PR
Play time until removal ~207 s ~150 s
Presents 1998 2187
Skipped draws (local counter) 70 0
End 0x887a0005, DRED page fault at GPU VA 0x0; allocations there: [] the same, plus DRED: no breadcrumbs (no list was in flight)

With one run each, the difference in play time is within the run-to-run spread I see on this title.

A pattern across all my world runs on this stack (the first two were made before nvidia-dev 3f39671 was merged in; runs of 600–900 s):

Memory settings Runs Play time End
default 1 ~894 s (whole run) exit 0
default 1 — host bugcheck 0x12B at ~175 s, not counted
XCL_TEXTURE_LEVEL_PAGES=1 XCL_SPARSE_LAZY=1 (includes the run with this PR) 7 150–782 s 6 × 0x887a0005 with DRED page fault at GPU VA 0x0, 1 × the title's own crash

Every VA 0x0 removal I have on this stack happened with those two switches on. The only run without them ran its whole 900 s. That is a correlation from few runs, not a cause. Still, reading the code, two things could fit:

  • vram.rs unmap_range calls UpdateTileMappings(NULL) without waiting for the title's queues.
  • With XCL_SPARSE_LAZY, give_memory runs with force = false, so GPU writes into lazy tiles that have no memory yet are lost.

I can open separate issues for those if that's useful.

AI use: Claude Code (Claude Opus 5.5) ran the builds and the runs, read the logs and drafted this comment; I checked it against the logs.

jessenic added a commit to jessenic/xcl that referenced this pull request Nov 27, 2026
…robes (lab)

Two stalls of a retail title's world load, both with locks held that
its recording threads need; the title's watchdog ended it after about
30 s without a submit (a write at address 0 at game+0x23cf683), 6 times
in about 31 runs. Found with XCL_THREAD_DUMP_AT in the stall.

1. sparse::State::drain_quarantined asked each mark's fence through
   real::probe_completed, which without XCL_FENCE_DIRECT is the title's
   hook (fence_get_completed_value): the hook tries ~2 ms for the sparse
   state's lock, which the caller holds. A mapping call that takes
   thousands of tiles (XMemMapPhysicalPagesScatter -> map_pages ->
   unmap_away -> home_again -> sparse::committed -> take_tile) spent
   that per fence per tile with the page maps and the sparse state
   held: one thread was in that stack in two dumps 30 s apart, others
   waited in page_now and on view_mem's lock. It reads the PC's value
   (real::fence_completed) now; the value is the same.
2. gpu::shader::readable fell back to a VirtualQuery walk for a range
   with a page out of the working set; the walk sizes the whole region
   (20-25 ms in a multi-gigabyte block). view_mem::ensure asks it per
   tile under its lock. A short range (<= 64 pages) is probed a byte a
   page with ReadProcessMemory instead (XCL_READABLE_PROBE=0: not).

Measured, 235 s runs, same switches: gaps without a submit between
110 and 235 s were up to 28 s before (two of six runs with only the
second change), 0 s in five of five runs with both; the world's rate
starts at 150-160 s instead of 230 s or later.

Also: two-pass binds give a window without a buffer window 0's, as
bind_abi does (xcl-dev#3052).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Raul-Paiva

Raul-Paiva commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction to my comment above: the pattern I posted there does not hold. VA 0x0 removals happen with and without XCL_TEXTURE_LEVEL_PAGES / XCL_SPARSE_LAZY, so please disregard the two code suspects I listed.

I ran the same tree again (this PR on top, commit 165d3058 locally) with the default memory settings, the same env as the 900 s run that finished cleanly. This env adds no XCL_TWO_PASS_MB and no XCL_DEPTH_UAV_TWIN:
XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000. It was a 900 s run with A pressed every 5 s, on the same hardware.

Result:

  • Removal 0x887a0005 after ~275 s of play (2536 presents), with DRED page fault at GPU VA 0x0; allocations there: []; recently freed: [] and DRED: no breadcrumbs (no list was in flight).
  • The two-pass record cap skipped ~80k draws in this run (256 MiB cap; no XCL_TWO_PASS_MB).
  • Process peak commit was 34 GB, on 32 GB of RAM.

The only thing I can still tell apart is that the clean run was made before nvidia-dev 3f39671 was merged into my stack. Edit: that was wrong. The clean run was built after that merge, on the same commit as this PR's parent (2b0aaa66 locally).

I then repeated the clean run exactly: the same commit (without this PR and without the local counter), the same env, 900 s. It removed the device after ~204 s of play, with the same DRED page fault at GPU VA 0x0 and no breadcrumbs (no list was in flight). Peak commit was 35 GB.

So the clean 900 s run was luck. On this tree the VA 0x0 removal comes with or without this PR, with or without the two memory switches, after 150–780 s of play. This PR neither causes it nor fixes it.

AI use: Claude Code (Claude Opus 5.5) ran this run, read the log and drafted this correction; I checked it against the log.

@Raul-Paiva

Copy link
Copy Markdown
Contributor Author

A question about the PR description check. It fails on this PR with:

Regression run needs an xcl-smoke block made on a commit of main (not the PR's), with the same title and time as the PR's

This PR targets nvidia-dev, so I made the comparison run on nvidia-dev d1be810, the PR's base. That commit is not on main.

For PRs to nvidia-dev, which do you prefer?

  • keep the comparison run on the PR's base, as it is now. If so, could the check accept that for this branch?
  • or add a run on a main commit as well, to satisfy the check as it is.

I can do the second if that's what you want. It means a full shader preparation on this machine, so I'd rather ask first.

I also added a note to the description: on my setup this path never triggers, because all four windows have a buffer. It is a defensive fix, in line with the same filter that amd-dev got in 0e19dc1.

AI use: Claude Code (Claude Opus 5.5) read the check's output and drafted this; I checked it.

@Aniseto

Aniseto commented Nov 28, 2026

Copy link
Copy Markdown

Ran the two-pass window binding test at 01196a8f on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib windows_without_a_buffer_take_window_0 -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 1727 filtered out      (exit 0)

The new test passes on a real NVIDIA part: a window whose GPU VA is 0, or that has no buffer, falls back to window 0's buffer in the shared window_view helper used by both the ABI and two-pass binds. This is a CPU-side assertion of the address choice; it does not exercise a title's two-pass DispatchMesh or a real page fault. The thread has discussion about VA 0 removals but no RTX 5070 Ti datapoint yet.

Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@andrewDoing

Copy link
Copy Markdown
Contributor

Verified the two-pass window fallback through GPU execution on RTX 5070 / NVIDIA 616.92 at 01196a8f. A test-only fixture supplied controlled lookup results to prepare_two_pass_stage and used the production emit_two_pass_stage for both compute and mesh. Valid window addresses referred to separate, aligned regions of a real GPU buffer. Before recording either pass, the fixture verified that all six emitted root addresses were nonzero and that each window resolved to its expected address.

The compute shader loaded one word through each of u2–u5 into a record. The mesh shader independently loaded the same four slots, checked them against that record, and rasterized a scissored triangle. Each row was a fresh process with a completed fence and full 4×4 RGBA32F readback.

Window lookup inputs Compute record Eight shaded pixels, each
Four distinct valid addresses [11, 22, 33, 44] [11, 22, 33, 44]
Valid 0, Some(0) for 1, valid 2, None for 3 [11, 11, 33, 11] [11, 11, 33, 11]

The other eight pixels retained the blue clear in both runs. This shows both absent forms reading window 0’s data while the unaffected third slot still reads its own data. The missing windows were modeled. The Dispatch, DispatchMesh, geometry, buffer reads and pixel readbacks were native. This fixture did not reproduce sparse initialization failure, exercise ExecuteIndirect, or establish the cause of a retail device removal.

AI use: OpenAI Codex adapted the fixture, ran the controls, and prepared this report.

@Raul-Paiva

Copy link
Copy Markdown
Contributor Author

Correction to my two comments above: the page fault at GPU VA 0x0 lines I quoted should not be read as GPU page faults at VA 0. In every one of those logs DRED reported device state 0 (UNKNOWN), empty allocation lists (allocations there: []; recently freed: []) and no list in flight. That is what DRED gives when it recorded no fault, though as Prime1997 pointed out on #3119 it does not rule one out. So those removals tell nothing about this PR, for or against; #3119 changes the log so it no longer reads as a fault at VA 0.

The PR is now on main (rebased onto 53e85fb, head 125dc93f). The two-pass bind there still uses uma_window_va(k).unwrap_or(first), so the fix still applies. The full suite against main is in the description (no new failure); the smoke runs on main and on this head are still to come.

Written with Claude Code (Claude Opus 5.5).

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) labels Nov 30, 2026
@Raul-Paiva
Raul-Paiva force-pushed the nvidia-dev-two-pass-window-va0 branch from 125dc93 to a921739 Compare November 30, 2026 07:19
@Raul-Paiva
Raul-Paiva marked this pull request as ready for review November 30, 2026 08:09
prepare_two_pass_stage bound windows 1-3 with
`uma_window_va(k).unwrap_or(first)`. uma_window_va returns Some(0) for a
window without a buffer on the GPU (real.rs starts every window at 0 and
only committed or sparse windows get one), so such a window was bound as
a null root UAV. Direct DXIL compute reads every window slot
(with_mem_raw_loads), and the two-pass compute pass is one of those
shaders, so the read goes to GPU VA 0: a page fault and a device removal.

4a69d80 added the window 0 check (first_window) but not the `!= 0`
filter that bind_abi has had since c685e12. amd-dev has the same filter
in its two-pass bind (0e19dc1).

window_view() now holds the lookup, and both binds use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AAsobu

AAsobu commented Nov 30, 2026

Copy link
Copy Markdown

Test report for #3052 at head 0364b388c60719f24e9043321f2c162e87a4ef5d

  • Merged into main ff0c364b3de011c13ed45865480c21918a79ec89: clean (merge commit ce1d0b13), git diff --check clean.
  • Hardware: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0; tests debug, title run release.
  • cargo build --workspace: ok.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 2890 passed, 0 failed, 51 ignored.
    • The new test hle::d3d12x::bind::tests::windows_without_a_buffer_take_window_0 passes.
  • SKIPPED (28): 22 no wave64, 2 no heap windows (opt-in), 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps.
  • Diff read in full (+20/-2, crates/xcl/src/hle/d3d12x/bind.rs): no findings.

Retail title, two runs, release build, XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1:

  • First run: the driver's pipeline cache was cold for this tree (huge mesh PSOs took 16-18 s each in the driver, against a few ms on earlier runs), so the title reached its world only at about 686 s and showed a black screen with subtitles while many draws were still skipped for pipelines being built.
  • The VA 0 removal still happens with this PR: device removal (0x887a0005) at 816 s, about 130 s into the world, DRED page fault at GPU VA 0x0, allocations there [], no breadcrumbs (no list in flight). System commit at the removal: 57.3 of 66.2 GB.
  • recorded last lists mostly two-pass ExecuteIndirect(DispatchMesh) by count, but the last 24 operations in order are mainly compute Dispatch / ExecuteIndirect (dispatches) after three DispatchMesh in two passes. So the VA 0 read may come from another path too.
  • Second run, same build and settings, driver cache now mostly warm: heavy scene work from about 118 s (up to 2422 draws / 7883 dispatches per 2 s), then a pipeline-build stall; device removal at 300 s, before reaching the world, again DRED page fault at GPU VA 0x0, allocations there [], no breadcrumbs; system commit 53.6 of 66.2 GB. This time all of the last 24 recorded operations in order are ExecuteIndirect (DispatchMesh) in two passes, the path this PR targets, so it does not cover every case of the VA 0 fault on this title. The removal surfaced on a CreatePlacedResourceX (8x1 buffer) call.
  • For comparison, same settings, without this PR: main abec7ce9 was removed at 188 s with the same VA 0 fault (before the world), and main abec7ce9 + D3D12.X: XCL_BACKGROUND_COMPILES=0 stops the driver's second compiles #1552 at 297 s, 3 s after reaching the world. One run each with different cache states, so the later removal in the first run is not evidence that this PR helps.

Not tested: AMD / wave64.

AI use: run and written with Claude Code (Claude Opus 5.5); results checked by me.

@AAsobu

AAsobu commented Dec 1, 2026 •

Copy link
Copy Markdown

Correction to my report above, about the device removal it mentions (0x887a0005, DRED "page fault at GPU VA 0x0", no breadcrumbs): on this machine it was most likely NVIDIA's 512 MB shader-heap limit (#2403), not a bug of main and not a regression range.

Hardware: NVIDIA GeForce RTX 3090 24 GB (driver 621.24), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300. Tool and model: Claude Code (Claude Opus 5.5), results checked by me.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head 0364b38

No open or merged PR makes the same change. On main, prepare_two_pass_stage in bind.rs still uses uma_window_va(k).unwrap_or(first), so it can bind a null root view for a window whose address is 0. bind_abi_with_root_resolved already filters that case. The new window_view helper gives both call sites the same filter, and it has a unit test.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: 493dbd3
head: 0364b38
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 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 the whole diff (+20/-2). The two-pass stage bind (bind.rs ~3108) was the last place that could bind a memory window whose GPU VA is 0 as a root view. Such a window is neither committed nor given a buffer by sparse::init (real.rs ~704-776), and a read through a null root view can remove the device. It now takes window 0 instead, as bind_abi and the replay in console_list.rs ~1077 already do. Findings: (1) The new test (windows_without_a_buffer_take_window_0, ~7958) covers the helper, not the two-pass call site, so it doesn't fail on main; andrewDoing's GPU fixture in the comments does exercise prepare_two_pass_stage and would make a good test. (2) When window 0 itself has VA 0, first_window (~5046-5048) returns 0 and window_view (~5058) still binds a null view. bind_abi has the same limit, so this PR doesn't add it (unverified that it happens). Fine: all four window slots and both passes are covered, and no other root parameters change. In the default 4-window layout every window has a buffer, so the smoke below runs the changed bind with the same addresses as main; it's a regression check, not a test of the new branch.
performance: 60 s smoke of a retail title, main 493dbd3 vs this merge (0abd5935): 1670 -> 1693 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17182 MB, 0 device removals, 0 crashes.
verdict: safe to merge (a test through prepare_two_pass_stage, like andrewDoing's fixture, would pin the call site)
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.

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Dec 1, 2026
@cj-tomlin

Copy link
Copy Markdown

merge-check claim
head: 0364b38

@cj-tomlin

Copy link
Copy Markdown

merge-check
base: 6bfb5c5
head: 0364b38
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll); failing: none. The new bind::tests::windows_without_a_buffer_take_window_0 passes.
review: none blocking, after reading the whole diff (+20/-2, bind.rs). prepare_two_pass_stage now filters a window address of 0 the way bind_abi_with_root_resolved already did, through one shared helper (window_view), so a window with no buffer gets window 0's buffer, never a null root view; addresses that are set are bound as before. As the description says, the new test checks the helper only and would not fail on the old two-pass code by itself, and on this setup every window has a buffer, so the changed path is not reached in a real title. No other open or merged PR makes this change; main still has the unfiltered line.
performance: no cost by default: one compare per window at bind time; the bound addresses are unchanged whenever every window has a buffer (reasoned, not measured).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 7 7800X3D, Windows 11 build 26300, debug build / Claude Code (Claude Opus 5.5) merged, built, ran the suite, read the diff and drafted this; I checked it.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Dec 1, 2026
Prime1997 added a commit to Prime1997/xcl that referenced this pull request Dec 2, 2026
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>
Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
Prime1997 added a commit to Prime1997/xcl that referenced this pull request Dec 2, 2026
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>
@throny throny added needs:amd-test Needs a test report or merge-check on an AMD GPU needs:title-run Runtime change: needs a merge-check with a real title run into the world (#3041) and removed ready-to-merge Has 2 independent safe merge-checks on current head (#3041) labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:title-run Runtime change: needs a merge-check with a real title run into the world (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants