D3D12.X: a wait after a write into title memory in the same list is met by that write #1246

Closed
upipibi wants to merge 1 commit from upstream-pr/1256 into main
upipibi commented 2026-11-24 13:48:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T13:48:17Z.


wait_memory drops a Wait32/64BitValueX whose address the same list already wrote (has_prior_write): the GPU reaches the write before the wait, and polling the address on the CPU before the list is submitted would only run into the timeout. Two writers do not record their range, because they go to the CPU instead (cpu_writes):

  • a Write32/64BitValueX into the title's own memory outside the unified-memory windows;
  • a timestamp written there.

So a wait on such an address later in the same list stayed. execute_with_waits_on polled it before submitting the list, while the CPU makes the write only after the submit, so every such wait ran out its timeout and was then let through. Both writers now record the range, as the GPU writers (write, fill, CopyMemoryToMemoryX, timestamps into a window) already do.

Found while checking defect 1 of @chazi123's report on #646 ("the CPU poll for a list's Wait ran before that same list was submitted"). For writes into the unified-memory windows, main already drops or splits such waits. This was the one path where it can still happen. I can't tell whether it is the case in that report (their counter is in a window), so this PR does not claim to fix the +0x23cf683 stop.

What is in it

  • hle/d3d12x/list_x.rs: write()'s title-memory branch and timestamp()'s readback branch call note_write for the range they queue.
  • Test a_wait_after_a_title_memory_write_in_the_same_list_is_met_by_it: a synthetic list writes a heap word through write() (no unified memory in the test, so it takes the CPU path), then waits on it and on another word. Only the wait on the other word may stay. It fails on main (2 waits left) and passes here. It needs no GPU.

Tested

  • NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4:
    • this PR (23d1aa8): 752 passed, 0 failed, 41 ignored;
    • main 930e8b4: 751 passed, 0 failed, 41 ignored.
    • Both skip the same two tests (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.

Regression run

From Kalmarv's run (https://github.com/ivall/xcl/pull/1256#issuecomment-7136777645), thanks:

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1312 (PresentX 1312)
presents per 2 s (last 3): 38 22 59
device removals: 0
crashes: 0
peak commit: 26728 MB

PR:

xcl-smoke v1
commit: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1311 (PresentX 1311)
presents per 2 s (last 3): 43 55 11
device removals: 0
crashes: 0
peak commit: 28262 MB

Limits (from bmjask's review): the write stays CPU-emulated and is made only after the whole list's fence completes (cpu_writes::after), so commands after the dropped wait can run before the marker or timestamp lands. main has the same ordering (its CPU poll of the wait times out and lets the list through); this PR removes only the timeout. Ordering it properly means splitting the list at such a wait, which is a separate, larger change.

Overlap with #2506 (tiagonleal): #2506 drops a same-list wait only when the value the list wrote meets it, and keeps dropping it when no value is recorded. This PR records the title-memory and timestamp writes with note_write (no value), so on top of #2506 it would drop those waits whatever the value. The two conflict in list_x.rs. If #2506 lands first, I'll rebase this so the title-memory write() records its value through #2506's note_write_value, and the timestamp readback (value unknown) no longer drops a wait.

Not tested

  • A title. We don't know how often the title waits on its own memory right after writing it in the same list.
  • AMD, Wine.

AI use

  • Claude Code (Claude Opus 5.5) read the wait path, wrote the change and the test, ran the suites, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5473388015 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T13:48:17Z. --- `wait_memory` drops a `Wait32/64BitValueX` whose address the same list already wrote (`has_prior_write`): the GPU reaches the write before the wait, and polling the address on the CPU before the list is submitted would only run into the timeout. Two writers do not record their range, because they go to the CPU instead (`cpu_writes`): - a `Write32/64BitValueX` into the title's own memory outside the unified-memory windows; - a timestamp written there. So a wait on such an address later in the same list stayed. `execute_with_waits_on` polled it before submitting the list, while the CPU makes the write only after the submit, so every such wait ran out its timeout and was then let through. Both writers now record the range, as the GPU writers (`write`, `fill`, `CopyMemoryToMemoryX`, timestamps into a window) already do. Found while checking defect 1 of @chazi123's report on #646 ("the CPU poll for a list's Wait ran before that same list was submitted"). For writes into the unified-memory windows, `main` already drops or splits such waits. This was the one path where it can still happen. I can't tell whether it is the case in that report (their counter is in a window), so this PR does not claim to fix the `+0x23cf683` stop. **What is in it** - `hle/d3d12x/list_x.rs`: `write()`'s title-memory branch and `timestamp()`'s readback branch call `note_write` for the range they queue. - Test `a_wait_after_a_title_memory_write_in_the_same_list_is_met_by_it`: a synthetic list writes a heap word through `write()` (no unified memory in the test, so it takes the CPU path), then waits on it and on another word. Only the wait on the other word may stay. It fails on `main` (2 waits left) and passes here. It needs no GPU. **Tested** - NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug. - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4`: - this PR (`23d1aa8`): 752 passed, 0 failed, 41 ignored; - `main` `930e8b4`: 751 passed, 0 failed, 41 ignored. - Both skip the same two tests (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. **Regression run** From Kalmarv's run (https://github.com/ivall/xcl/pull/1256#issuecomment-7136777645), thanks: main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1312 (PresentX 1312) presents per 2 s (last 3): 38 22 59 device removals: 0 crashes: 0 peak commit: 26728 MB ``` PR: ``` xcl-smoke v1 commit: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1311 (PresentX 1311) presents per 2 s (last 3): 43 55 11 device removals: 0 crashes: 0 peak commit: 28262 MB ``` **Limits** (from bmjask's review): the write stays CPU-emulated and is made only after the whole list's fence completes (`cpu_writes::after`), so commands after the dropped wait can run before the marker or timestamp lands. `main` has the same ordering (its CPU poll of the wait times out and lets the list through); this PR removes only the timeout. Ordering it properly means splitting the list at such a wait, which is a separate, larger change. **Overlap with #2506** (tiagonleal): #2506 drops a same-list wait only when the value the list wrote meets it, and keeps dropping it when no value is recorded. This PR records the title-memory and timestamp writes with `note_write` (no value), so on top of #2506 it would drop those waits whatever the value. The two conflict in `list_x.rs`. If #2506 lands first, I'll rebase this so the title-memory `write()` records its value through #2506's `note_write_value`, and the timestamp readback (value unknown) no longer drops a wait. **Not tested** - A title. We don't know how often the title waits on its own memory right after writing it in the same list. - AMD, Wine. **AI use** - Claude Code (Claude Opus 5.5) read the wait path, wrote the change and the test, ran the suites, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DavidM1911 commented 2026-11-24 14:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:02:10Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib list_x new tests (wait_after_title_memory_write, copy_scratch_budget, new_list_takes_no_copy_scratch): 3 passed, 0 failed.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7133731504 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1256#issuecomment-7133731504). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:02:10Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - cargo test -p xcl --lib list_x new tests (wait_after_title_memory_write, copy_scratch_budget, new_list_takes_no_copy_scratch): 3 passed, 0 failed. Thanks!
Kalmarv commented 2026-11-24 16:07:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T15:53:15Z.


Regression pair for 23d1aa8 against main 930e8b4 (this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 100 % of main's frames, 106 % of its peak commit.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200.
  • scripts/smoke.ps1, the same retail title for 60 s each: main at 930e8b4 (this PR's base) first, then this PR's head, one after the other on the same machine. XCL_ACTIVITY=1 on both.

main 930e8b4:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1312 (PresentX 1312)
presents per 2 s (last 3): 38 22 59
device removals: 0
crashes: 0
peak commit: 26728 MB

this PR, 23d1aa8:

xcl-smoke v1
commit: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1311 (PresentX 1311)
presents per 2 s (last 3): 43 55 11
device removals: 0
crashes: 0
peak commit: 28262 MB

Wait…BitValueX timed out lines (the run you asked for): 0 on main and 0 on this PR. Both logs have the 30 activity (2 s) lines and their other warnings, so the warning would have been logged; neither 60 s run hit a wait timeout at all. The activity lines' frame-event waits also match: 2624 on main, 2620 here, none timed out.

Not tested

  • World loading and the #646 stop: a 60 s run ends before it, so it doesn't show whether this path is taken there.
  • The test suite, AMD, Linux.

AI use: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7136777645 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1256#issuecomment-7136777645). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T15:53:15Z. --- Regression pair for `23d1aa8` against `main` `930e8b4` (this PR's base), for the **Regression run** section. Both runs pass: no device removal, no crash, 100 % of `main`'s frames, 106 % of its peak commit. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200. - `scripts/smoke.ps1`, the same retail title for 60 s each: `main` at `930e8b4` (this PR's base) first, then this PR's head, one after the other on the same machine. `XCL_ACTIVITY=1` on both. `main` `930e8b4`: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1312 (PresentX 1312) presents per 2 s (last 3): 38 22 59 device removals: 0 crashes: 0 peak commit: 26728 MB ``` this PR, `23d1aa8`: ``` xcl-smoke v1 commit: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1311 (PresentX 1311) presents per 2 s (last 3): 43 55 11 device removals: 0 crashes: 0 peak commit: 28262 MB ``` **`Wait…BitValueX timed out` lines (the run you asked for):** 0 on `main` and 0 on this PR. Both logs have the 30 `activity (2 s)` lines and their other warnings, so the warning would have been logged; neither 60 s run hit a wait timeout at all. The activity lines' frame-event waits also match: 2624 on `main`, 2620 here, none timed out. **Not tested** - World loading and the #646 stop: a 60 s run ends before it, so it doesn't show whether this path is taken there. - The test suite, AMD, Linux. **AI use:** Claude Code (Claude Opus 5.5)
thehollowedone commented 2026-11-25 11:09:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T11:06:30Z.


Independent Windows run on 23d1aa8. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.

cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture reported 752 passed, 0 failed, 41 ignored, with two wave64 skips included in Cargo's pass count.

I extended the checked-in timestamp fixture in a scratch copy. One native D3D12 list recorded a 32-bit immediate write, two 64-bit timestamp writes, and matching waits on all three CPU-memory destinations. All three destinations were zero before submission. The recording left only an unrelated wait pending. Once I satisfied that wait, one native submission delivered the immediate value 42 and both nonzero GPU timestamps. The device remained healthy. Restoring the original recording code left all four waits pending and failed the assertion before submission.

cargo test --offline --locked -p xcl --lib timestamps_outside_unified_memory_land_after_the_queue -- --nocapture --test-threads=1 passed 1/0/0 with zero fixture skips. This covers matching same-list waits in the synthetic case. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7160596889 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7160596889). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T11:06:30Z. --- Independent Windows run on [23d1aa8](https://github.com/xcl-dev/xcl/commit/23d1aa8dfa38db7f468991d2850db0dfacbe79c7). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug. `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture` reported **752 passed, 0 failed, 41 ignored**, with two wave64 skips included in Cargo's pass count. I extended the checked-in timestamp fixture in a scratch copy. One native D3D12 list recorded a 32-bit immediate write, two 64-bit timestamp writes, and matching waits on all three CPU-memory destinations. All three destinations were zero before submission. The recording left only an unrelated wait pending. Once I satisfied that wait, one native submission delivered the immediate value 42 and both nonzero GPU timestamps. The device remained healthy. Restoring the original recording code left all four waits pending and failed the assertion before submission. `cargo test --offline --locked -p xcl --lib timestamps_outside_unified_memory_land_after_the_queue -- --nocapture --test-threads=1` passed 1/0/0 with zero fixture skips. This covers matching same-list waits in the synthetic case. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.
oni-swr commented 2026-11-25 20:08:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T19:44:25Z.


AMD RX 7800 XT test report

Tested locally by merging PR head 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 onto base main 3f2777019544c0ada2cd294aa792d3c378ff0df8 (no push). The base is an ancestor of current main and both trees merge cleanly.

Hardware and tools: AMD Radeon RX 7800 XT, driver 32.0.31035.1003; Windows 10 Pro; Rust 1.100.0 / Cargo 1.100.0; DXC 1.8.2502.11 (DXIL 1.8.2502.11). Debug test build.

cargo test --workspace --no-fail-fast -- --test-threads=4: 1,356 passed, 2 failed, 46 ignored. There were 7 SKIPPED reports: six GPU cases (wave32/wave64 variants for three unsupported instruction forms) and one heap-window case. The two failures and all 7 SKIPPED reports match the baseline (1,355 passed, 2 failed, 46 ignored).

Not tested

  • Smoke run or retail titles
  • Release build
  • Other GPUs

AI use
Codex (gpt-6-luna) ran Phase 2 tests and wrote this report (Phase 1 pre-compile / initial baseline run used Claude Code (Claude Sonnet 5.5)).

<!-- greyfinch-sync:ivall/xcl:comment:7172703466 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7172703466). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T19:44:25Z. --- AMD RX 7800 XT test report Tested locally by merging PR head `23d1aa8dfa38db7f468991d2850db0dfacbe79c7` onto base `main` `3f2777019544c0ada2cd294aa792d3c378ff0df8` (no push). The base is an ancestor of current `main` and both trees merge cleanly. Hardware and tools: AMD Radeon RX 7800 XT, driver 32.0.31035.1003; Windows 10 Pro; Rust 1.100.0 / Cargo 1.100.0; DXC 1.8.2502.11 (DXIL 1.8.2502.11). Debug test build. `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1,356 passed, 2 failed, 46 ignored. There were 7 `SKIPPED` reports: six GPU cases (wave32/wave64 variants for three unsupported instruction forms) and one heap-window case. The two failures and all 7 `SKIPPED` reports match the baseline (1,355 passed, 2 failed, 46 ignored). **Not tested** - Smoke run or retail titles - Release build - Other GPUs **AI use** Codex (gpt-6-luna) ran Phase 2 tests and wrote this report (Phase 1 pre-compile / initial baseline run used Claude Code (Claude Sonnet 5.5)).
bmjask commented 2026-11-25 20:41:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:41:32Z.

Review: COMMENTED


P1: this removes a wait after a CPU-emulated title-memory write as if the write were GPU-ordered. write() queues cpu_writes::Write::Immediate then note_write; wait_memory sees a prior write and drops the wait. But cpu_writes::after performs the immediate write only after a fence for the submitted list completes. Thus intended write -> wait -> later commands becomes entire list (including later commands) -> CPU write; no PC/GPU write orders the marker before post-wait work. Timestamp readbacks have the same issue. Split/fence/write before the post-wait segment, or retain waits for CPU-emulated writes. The test only asserts removal and does not execute/verify ordering.

<!-- greyfinch-sync:ivall/xcl:review:6064689557 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#pullrequestreview-6064689557). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:41:32Z. **Review:** COMMENTED --- P1: this removes a wait after a CPU-emulated title-memory write as if the write were GPU-ordered. write() queues cpu_writes::Write::Immediate then note_write; wait_memory sees a prior write and drops the wait. But cpu_writes::after performs the immediate write only after a fence for the submitted list completes. Thus intended write -> wait -> later commands becomes entire list (including later commands) -> CPU write; no PC/GPU write orders the marker before post-wait work. Timestamp readbacks have the same issue. Split/fence/write before the post-wait segment, or retain waits for CPU-emulated writes. The test only asserts removal and does not execute/verify ordering.
ClosetPie107 commented 2026-11-25 21:05:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T20:46:20Z.


Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 (merged cleanly onto main 6d12f58).

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu (debug for tests, release for retail)

Unit / GPU tests (XCL_REQUIRE_GPU=wave64, XCL_DXC_DIR, VKD3D_CONFIG=ignore_shared_fence, --test-threads=1 --nocapture)

  • hle::d3d12x::list_x::: 41 passed, 0 failed, 0 ignored (0 skipped)

Combined retail sanity run (main 6d12f58 + #2068, #1771, #1740, #1256 merged together; XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0)

  • Completed the full 300 s (exit=0) with 0 crashes and 0 device removals (11.55 GiB peak VRAM / 0 GTT spill, 13.35 GiB peak RSS, 1,800+ frames presented, 16,442 translated draws, 4,499 dispatches, 11,257 Opus packets).

Not tested

  • Full workspace test suite, native Windows, or an isolated single-PR retail run (retail sanity run above was on the 4-PR batch).

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged the PR onto main, ran the tests and combined retail run under Proton on this machine, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7174165456 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7174165456). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T20:46:20Z. --- Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head `23d1aa8dfa38db7f468991d2850db0dfacbe79c7` (merged cleanly onto `main` `6d12f58`). **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` (debug for tests, release for retail) **Unit / GPU tests** (`XCL_REQUIRE_GPU=wave64`, `XCL_DXC_DIR`, `VKD3D_CONFIG=ignore_shared_fence`, `--test-threads=1 --nocapture`) - `hle::d3d12x::list_x::`: **41 passed, 0 failed, 0 ignored** (0 skipped) **Combined retail sanity run** (`main` `6d12f58` + `#2068`, `#1771`, `#1740`, `#1256` merged together; `XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`) - Completed the full **300 s (`exit=0`)** with **0 crashes** and **0 device removals** (`11.55 GiB` peak VRAM / 0 GTT spill, `13.35 GiB` peak RSS, `1,800+` frames presented, `16,442` translated draws, `4,499` dispatches, `11,257` Opus packets). **Not tested** - Full workspace test suite, native Windows, or an isolated single-PR retail run (retail sanity run above was on the 4-PR batch). **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged the PR onto `main`, ran the tests and combined retail run under Proton on this machine, and drafted this report.
upipibi commented 2026-11-25 21:05:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T20:50:14Z.


@bmjask Agreed on P1: this doesn't order the CPU-emulated write before the commands after the wait. cpu_writes::after makes the write only once the whole list's fence completes, so commands after the wait can run before the marker lands. The same holds for the timestamp readback.

For context, main doesn't order it either. There, execute_with_waits_on polls that wait on the CPU before the list is submitted, the write only happens after the submit, so the wait runs out its timeout and is then let through, and the later commands still run before the write. This PR removes that timeout; it doesn't change the ordering. I've added that to the description as a limit.

The proper fix is what you describe: split the list at such a wait and make the write (or a GPU write of the same value) before the post-wait part. That is a bigger change in execute_with_waits_on's segmenting than this PR, so I'd rather do it separately than grow this one. If the maintainers prefer to hold this PR until then, that's fine.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7174254343 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7174254343). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T20:50:14Z. --- @bmjask Agreed on P1: this doesn't order the CPU-emulated write before the commands after the wait. `cpu_writes::after` makes the write only once the whole list's fence completes, so commands after the wait can run before the marker lands. The same holds for the timestamp readback. For context, `main` doesn't order it either. There, `execute_with_waits_on` polls that wait on the CPU before the list is submitted, the write only happens after the submit, so the wait runs out its timeout and is then let through, and the later commands still run before the write. This PR removes that timeout; it doesn't change the ordering. I've added that to the description as a limit. The proper fix is what you describe: split the list at such a wait and make the write (or a GPU write of the same value) before the post-wait part. That is a bigger change in `execute_with_waits_on`'s segmenting than this PR, so I'd rather do it separately than grow this one. If the maintainers prefer to hold this PR until then, that's fine. AI-assisted (Claude Code, Claude Opus 5.5).
brainhay5 commented 2026-11-30 05:33:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T05:33:09Z.


merge-check claim
head: 23d1aa8dfa

<!-- greyfinch-sync:ivall/xcl:comment:7269775523 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7269775523). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T05:33:09Z. --- merge-check claim head: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7
brainhay5 commented 2026-11-30 05:33:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T05:33:47Z.


merge-check
base: d52ff48caa
head: 23d1aa8dfa
merge: clean
build: cargo build --workspace -> failed
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (build failed)
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: not yet: cargo build --workspace failed
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7269785838 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7269785838). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T05:33:47Z. --- merge-check base: d52ff48caade1f5350d513bfffd370396dadfeb6 head: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 merge: clean build: cargo build --workspace -> failed tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (build failed) review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review. performance: not assessed beyond the suite. verdict: not yet: cargo build --workspace failed hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
ettehn commented 2026-11-30 05:59:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-30T05:59:41Z.


Independent Windows check of 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 merged locally onto main d52ff48caade1f5350d513bfffd370396dadfeb6. The merge was clean. The PR build failed with two E0061 errors, at the added s.note_write(va, size) calls in write() and timestamp() (list_x.rs lines 4137 and 4261 in the merged tree). The current API takes a WriteProducer, and both paths already record CpuAfterSegment in the line just above.

#2959 already adds the ordering discussed above. 342ba2dd splits the list for a wait overlapping a deferred CPU write, and d8ba6e8a prepares the earlier producer's completion for the continuation. I would treat this PR as superseded on current main unless there is a separate case missing from that path.

On the same Windows machine (RTX 5070 Ti Laptop, driver 621.24, Rust 1.97.1 MSVC), cargo build --offline --release --workspace passed on clean main. Five targeted main tests passed with no skips, including wait_placement_distinguishes_cpu_gpu_and_write64_producers, cpu_producer_completion_precedes_the_continuation_wait, and timestamps_outside_unified_memory_land_after_the_queue. The PR tests were blocked by its build failure. No retail run or full test-suite result in this check.

AI use

OpenAI Codex (GPT-6.2 Sol) assisted with source review and Windows verification.

<!-- greyfinch-sync:ivall/xcl:comment:7270199364 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7270199364). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-30T05:59:41Z. --- Independent Windows check of `23d1aa8dfa38db7f468991d2850db0dfacbe79c7` merged locally onto `main` `d52ff48caade1f5350d513bfffd370396dadfeb6`. The merge was clean. The PR build failed with two `E0061` errors, at the added `s.note_write(va, size)` calls in `write()` and `timestamp()` (`list_x.rs` lines 4137 and 4261 in the merged tree). The current API takes a `WriteProducer`, and both paths already record `CpuAfterSegment` in the line just above. #2959 already adds the ordering discussed above. [`342ba2dd`](https://github.com/xcl-dev/xcl/commit/342ba2dd4e01fb81b613da02b16807045d86c6c7) splits the list for a wait overlapping a deferred CPU write, and [`d8ba6e8a`](https://github.com/xcl-dev/xcl/commit/d8ba6e8a814bc972ef61db756f8af4c86d7ba9ab) prepares the earlier producer's completion for the continuation. I would treat this PR as superseded on current main unless there is a separate case missing from that path. On the same Windows machine (RTX 5070 Ti Laptop, driver 621.24, Rust 1.97.1 MSVC), `cargo build --offline --release --workspace` passed on clean main. Five targeted main tests passed with no skips, including `wait_placement_distinguishes_cpu_gpu_and_write64_producers`, `cpu_producer_completion_precedes_the_continuation_wait`, and `timestamps_outside_unified_memory_land_after_the_queue`. The PR tests were blocked by its build failure. No retail run or full test-suite result in this check. **AI use** OpenAI Codex (GPT-6.2 Sol) assisted with source review and Windows verification.
BBareth commented 2026-11-30 09:46:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:46:40Z.


merge-check claim
head: 23d1aa8dfa

<!-- greyfinch-sync:ivall/xcl:comment:7274671063 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7274671063). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T09:46:40Z. --- merge-check claim head: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7
BBareth commented 2026-11-30 09:53:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:53:21Z.


merge-check
base: 9dfbe3ea66
head: 23d1aa8dfa
merge: clean
build: cargo build --workspace -> failed
tests: not run (the merge result does not compile)
review: git merges it without a textual conflict, but the result does not build: both added calls are s.note_write(va, n) / s.note_write(va, 8), and on current main note_write takes a WriteProducer first (error E0061 at both call sites in list_x.rs). Beyond the signature: main has since gained its own handling of this case (d8ba6e8a "D3D12.X: prepare prior CPU-write dependencies": CPU-side writes are recorded as WriteProducer::CpuAfterSegment and a later wait on the range gets WaitPlacement::SplitAfterCpuWrite), so the PR should be rebased and checked against that code first; it may be superseded. I did not verify that main's handling covers the timestamp write.
performance: not assessed.
verdict: not yet: does not compile when merged into current main; rebase needed, and possibly superseded by d8ba6e8a
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7274823048 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7274823048). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T09:53:21Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 23d1aa8dfa38db7f468991d2850db0dfacbe79c7 merge: clean build: cargo build --workspace -> failed tests: not run (the merge result does not compile) review: git merges it without a textual conflict, but the result does not build: both added calls are `s.note_write(va, n)` / `s.note_write(va, 8)`, and on current main `note_write` takes a `WriteProducer` first (error E0061 at both call sites in `list_x.rs`). Beyond the signature: main has since gained its own handling of this case (d8ba6e8a "D3D12.X: prepare prior CPU-write dependencies": CPU-side writes are recorded as `WriteProducer::CpuAfterSegment` and a later wait on the range gets `WaitPlacement::SplitAfterCpuWrite`), so the PR should be rebased and checked against that code first; it may be superseded. I did not verify that main's handling covers the timestamp write. performance: not assessed. verdict: not yet: does not compile when merged into current main; rebase needed, and possibly superseded by d8ba6e8a hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
upipibi commented 2026-12-01 00:11:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-12-01T00:11:32Z.


Closing: superseded on main by 6f01fb12 and 342ba2dd (@bmjask). write() and timestamp() now record their CPU writes (note_write(WriteProducer::CpuAfterSegment, …), list_x.rs:4132 and :4255), and a wait on such a range splits the list after the CPU write (WaitPlacement::SplitAfterCpuWrite) rather than being dropped. That also covers the ordering problem raised in review here. This branch no longer builds on main (note_write takes the producer now), and nothing in it is left to add.

<!-- greyfinch-sync:ivall/xcl:comment:7296039542 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1256#issuecomment-7296039542). Originally posted by [upipibi](https://github.com/upipibi) on 2026-12-01T00:11:32Z. --- Closing: superseded on `main` by 6f01fb12 and 342ba2dd (@bmjask). `write()` and `timestamp()` now record their CPU writes (`note_write(WriteProducer::CpuAfterSegment, …)`, list_x.rs:4132 and :4255), and a wait on such a range splits the list after the CPU write (`WaitPlacement::SplitAfterCpuWrite`) rather than being dropped. That also covers the ordering problem raised in review here. This branch no longer builds on `main` (`note_write` takes the producer now), and nothing in it is left to add.

Pull request closed

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!1246
No description provided.