D3D12.X: a same-list write drops a later wait only when its value meets it #2496

Open
tiagonleal wants to merge 1 commit from upstream-pr/2506 into main
tiagonleal commented 2026-11-25 21:03:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T21:03:55Z.


wait_memory drops a Wait32/64BitValueX whenever the same open list already wrote an overlapping address (has_prior_write, there since 3dfbcfbd). The comment gives the reason: the write is earlier in the same list, and polling the address before that list is submitted would only wait on our own unsubmitted list. That holds only when the value the list wrote meets the wait. A list that resets a counter (Write64BitValue…X(X, 0)) and then waits X >= 1 for another queue to raise it lost the wait, so it ran without waiting for the producer. With this change such a wait is recorded like any other wait. A wait that the list's own last write meets is still dropped, also after a mid-list split. Part of #1452.

Rebased onto main d8bd9a38. main replaced the written-range list with RecordedWriteProducers and moved the split carry-over into SplitCarry, so this is a port: the known written values are a ListState field cleared wherever main clears the segment's write producers, they travel in SplitCarry, and a wait that main's wait_placement would order inside the segment is kept (recorded here, or split after a Write64) when the list's own known value does not meet the comparison. The split test now goes through SplitCarry::capture(..).continuation_state(..); it fails when the continuation carries no values. The Write64 fallback has no test of its own.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: ListState keeps the value of the list's last immediate write (write: Write32/64BitValue…X) per address (this includes an immediate write into a window the GPU only has a copy of, the note_imm path main added, through the new helper note_written_value), cleared wherever the segment's write producers are cleared. A later write over it of unknown value (fill, CopyMemoryToMemoryX, timestamp) forgets it. wait_memory drops the wait when that value, masked, meets the comparison (compare_u64), or when there is no known value for exactly that address and width (fill, copy, partial write), as before. A split carries the written values to the next segment in SplitCarry, so a wait after a split is judged the same way.
  • Test a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it: the eight D3D12_COMPARISON_FUNCs for 32 and 64 bit, a 64-bit value above 32 bits, the Wait32BitValueX mask, the last of two writes, a write to another address, and a fill over the value.
  • Test a_split_segment_keeps_the_written_value_for_a_later_wait: a list writes X = 0 and then waits X >= 1; after the split the wait is kept. It goes through SplitCarry::capture(..).continuation_state(..), the carry-over a split uses.

A title that writes an address and then waits on it in the same list for a value its own write does not meet now gets that wait (before, it was dropped). If nothing else ever produces the value, the wait behaves like any other wait without a producer: the CPU fallback blocks the submitting thread for up to 2 s, or the GPU bridge waits until the watchdog releases it at 5 s. Before, the list just ran.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09); debug tests, release smoke builds. Head a4b66e81 on main 6d12f58a.
  • Without the fix: the first test on main 6d12f58a, with only the drop condition of main restored, fails on its first case: 64-bit: wrote 0x0, wait op 7 0x1, left: 0, right: 1 (the wait is dropped). The split test fails when the continuation carries no values (checked again on the current code): the wait after the split was dropped, left: 0, right: 1.
  • With the fix, on a4b66e81: cargo test -p xcl --lib -- a_wait_after_an_own_write a_split_segment_keeps: 2 passed, 3 of 3 runs.
  • cargo test -p xcl --lib -- hle::d3d12x, 6 runs (earlier head 46456f0d, not repeated on a4b66e81): 254 passed, 0 failed, 2 ignored in 5 runs. In 1 run a_dispatch_with_a_pipeline_still_building_waits_at_the_submit failed (segment count 389, expected 421). The same test failed 1 time in 6 runs on main 6d12f58a (252/253 passed), so it depends on timing and fails without this change too.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on a4b66e81: 1421 passed, 4 failed, 46 ignored both times. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState: E_OUTOFMEMORY). They failed on main 6d12f58a in earlier runs; I did not run them on main again today.
  • 25 SKIPPED lines on this adapter: 24 GPU tests that need wave32/wave64 forms this adapter does not have ("no wave64"), and heap_window_out_of_memory_falls_back_to_the_switch_form ("no heap windows").
  • After the rebase onto main d8bd9a38 (head 98566154): cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4, one run: 2615 passed, 5 failed, 49 ignored (26 SKIPPED lines). The 5 failures are the 4 gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_* (#1919 fixes them) and test_title_runs_under_the_debug_layer_with_dred, which failed on one check of the test title (a texture in title memory (XG layout, #44) follows CPU writes: subresource 2 row 0 differs from the title memory). That check is intermittent: the e2e target of this PR's tree run alone 3 times right after gave 5 passed, 0 failed each time. The PR does not touch title textures. On main d8bd9a38 on this machine: 2613 passed, 5 failed, 49 ignored; the same 4 fuzz tests fail there, and the fifth failure there is test_title_draws_with_a_root_signature_under_the_debug_layer, the same intermittent check. The other results in this section are from the earlier heads named in them.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (Newer Retail Game), release builds of both commits in clean trees, main d8bd9a38 first, one run each, in one queue with this account's other PRs. Both runs had XCL_PREPARE=0 and the same warm DXIL cache. A warm-up run of main came before them and is not shown. A second run of main at the end of the queue showed 1697 frames and a peak commit of 15496 MB, so differences of a few tens of frames between runs are noise here.

main (d8bd9a38):

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15467 MB

This PR (98566154):

xcl-smoke v1
commit: 98566154f02cef5038cf104778100cf4f23afc51
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1699 (PresentX 1699)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15240 MB

Not tested

  • Whether the retail title records the "reset, then wait for another queue" pattern in one list. In 100 s it never reaches the same-list check (see above); later parts of the load were not run. I do not know whether this fixes any stall or device removal in #1452.
  • A kept wait is still checked against memory before the list is submitted, so the list's own reset is not in memory yet. If memory still holds an older value that meets the wait, the wait passes at once. This PR does not change that.
  • A 32-bit wait on half of a 64-bit write: no known value, so it is still dropped as before.
  • The split test does not run split; it checks only the values split carries over.
  • AMD and Intel GPUs.

Overlap: #1256 (records cpu_writes ranges for this drop) and #592 (range tracking) change the same check. Neither looks at the written value. With #1256, its title-memory writes would have no known value here and would still be dropped.

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5499143168 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T21:03:55Z. --- `wait_memory` drops a `Wait32/64BitValueX` whenever the same open list already wrote an overlapping address (`has_prior_write`, there since 3dfbcfbd). The comment gives the reason: the write is earlier in the same list, and polling the address before that list is submitted would only wait on our own unsubmitted list. That holds only when the value the list wrote meets the wait. A list that resets a counter (`Write64BitValue…X(X, 0)`) and then waits `X >= 1` for another queue to raise it lost the wait, so it ran without waiting for the producer. With this change such a wait is recorded like any other wait. A wait that the list's own last write meets is still dropped, also after a mid-list `split`. Part of #1452. *Rebased onto `main` `d8bd9a38`.* `main` replaced the written-range list with `RecordedWriteProducers` and moved the split carry-over into `SplitCarry`, so this is a port: the known written values are a `ListState` field cleared wherever `main` clears the segment's write producers, they travel in `SplitCarry`, and a wait that `main`'s `wait_placement` would order inside the segment is kept (recorded here, or split after a Write64) when the list's own known value does not meet the comparison. The split test now goes through `SplitCarry::capture(..).continuation_state(..)`; it fails when the continuation carries no values. The Write64 fallback has no test of its own. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: `ListState` keeps the value of the list's last immediate write (`write`: `Write32/64BitValue…X`) per address (this includes an immediate write into a window the GPU only has a copy of, the `note_imm` path `main` added, through the new helper `note_written_value`), cleared wherever the segment's write producers are cleared. A later write over it of unknown value (fill, `CopyMemoryToMemoryX`, timestamp) forgets it. `wait_memory` drops the wait when that value, masked, meets the comparison (`compare_u64`), or when there is no known value for exactly that address and width (fill, copy, partial write), as before. A split carries the written values to the next segment in `SplitCarry`, so a wait after a split is judged the same way. - Test `a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it`: the eight `D3D12_COMPARISON_FUNC`s for 32 and 64 bit, a 64-bit value above 32 bits, the `Wait32BitValueX` mask, the last of two writes, a write to another address, and a fill over the value. - Test `a_split_segment_keeps_the_written_value_for_a_later_wait`: a list writes `X = 0` and then waits `X >= 1`; after the split the wait is kept. It goes through `SplitCarry::capture(..).continuation_state(..)`, the carry-over a split uses. A title that writes an address and then waits on it in the same list for a value its own write does not meet now gets that wait (before, it was dropped). If nothing else ever produces the value, the wait behaves like any other wait without a producer: the CPU fallback blocks the submitting thread for up to 2 s, or the GPU bridge waits until the watchdog releases it at 5 s. Before, the list just ran. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09); debug tests, release smoke builds. Head a4b66e81 on `main` 6d12f58a. - Without the fix: the first test on `main` 6d12f58a, with only the drop condition of `main` restored, fails on its first case: `64-bit: wrote 0x0, wait op 7 0x1`, `left: 0, right: 1` (the wait is dropped). The split test fails when the continuation carries no values (checked again on the current code): `the wait after the split was dropped`, `left: 0, right: 1`. - With the fix, on a4b66e81: `cargo test -p xcl --lib -- a_wait_after_an_own_write a_split_segment_keeps`: 2 passed, 3 of 3 runs. - `cargo test -p xcl --lib -- hle::d3d12x`, 6 runs (earlier head 46456f0d, not repeated on a4b66e81): 254 passed, 0 failed, 2 ignored in 5 runs. In 1 run `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` failed (segment count 389, expected 421). The same test failed 1 time in 6 runs on `main` 6d12f58a (252/253 passed), so it depends on timing and fails without this change too. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, run twice on a4b66e81: 1421 passed, 4 failed, 46 ignored both times. The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`CreateComputePipelineState`: E_OUTOFMEMORY). They failed on `main` 6d12f58a in earlier runs; I did not run them on `main` again today. - 25 `SKIPPED` lines on this adapter: 24 GPU tests that need wave32/wave64 forms this adapter does not have ("no wave64"), and `heap_window_out_of_memory_falls_back_to_the_switch_form` ("no heap windows"). - After the rebase onto `main` `d8bd9a38` (head `98566154`): `cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4`, one run: 2615 passed, 5 failed, 49 ignored (26 `SKIPPED` lines). The 5 failures are the 4 `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_*` (#1919 fixes them) and `test_title_runs_under_the_debug_layer_with_dred`, which failed on one check of the test title (a texture in title memory (XG layout, #44) follows CPU writes: subresource 2 row 0 differs from the title memory). That check is intermittent: the e2e target of this PR's tree run alone 3 times right after gave 5 passed, 0 failed each time. The PR does not touch title textures. On `main` `d8bd9a38` on this machine: 2613 passed, 5 failed, 49 ignored; the same 4 fuzz tests fail there, and the fifth failure there is `test_title_draws_with_a_root_signature_under_the_debug_layer`, the same intermittent check. The other results in this section are from the earlier heads named in them. **Regression run** `scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e` (Newer Retail Game), release builds of both commits in clean trees, `main` `d8bd9a38` first, one run each, in one queue with this account's other PRs. Both runs had `XCL_PREPARE=0` and the same warm DXIL cache. A warm-up run of `main` came before them and is not shown. A second run of `main` at the end of the queue showed 1697 frames and a peak commit of 15496 MB, so differences of a few tens of frames between runs are noise here. `main` (`d8bd9a38`): ``` xcl-smoke v1 commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15467 MB ``` This PR (`98566154`): ``` xcl-smoke v1 commit: 98566154f02cef5038cf104778100cf4f23afc51 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1699 (PresentX 1699) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15240 MB ``` **Not tested** - Whether the retail title records the "reset, then wait for another queue" pattern in one list. In 100 s it never reaches the same-list check (see above); later parts of the load were not run. I do not know whether this fixes any stall or device removal in #1452. - A kept wait is still checked against memory before the list is submitted, so the list's own reset is not in memory yet. If memory still holds an older value that meets the wait, the wait passes at once. This PR does not change that. - A 32-bit wait on half of a 64-bit write: no known value, so it is still dropped as before. - The split test does not run `split`; it checks only the values `split` carries over. - AMD and Intel GPUs. Overlap: #1256 (records `cpu_writes` ranges for this drop) and #592 (range tracking) change the same check. Neither looks at the written value. With #1256, its title-memory writes would have no known value here and would still be dropped. **AI use** - Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot] commented 2026-11-25 21:04:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T21:04:06Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

<!-- greyfinch-sync:ivall/xcl:review:6064958649 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#pullrequestreview-6064958649). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T21:04:06Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level. An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. [Learn about Copilot code review billing](https://docs.github.com/en/copilot/concepts/agents/code-review#code-review-usage).
DavidM1911 commented 2026-11-25 22:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:14:12Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7174796835 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7174796835). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T21:14:12Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
SlopTart commented 2026-11-25 22:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T21:15:36Z.


gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it: passed. Lane context: this fence/wait area is the same machinery behind the two red d11_* tests on #2439; this PR does not change them on this lane.

<!-- greyfinch-sync:ivall/xcl:comment:7174829504 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7174829504). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T21:15:36Z. --- `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it`: passed. Lane context: this fence/wait area is the same machinery behind the two red `d11_*` tests on #2439; this PR does not change them on this lane.
emirduran707 commented 2026-11-25 22:06:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:29:22Z.


Independent AMD RDNA4 (native wave64) test report on exact head 46456f0d4e5e2cbc55ddc3d15efd8002cb1f0165 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: hle::d3d12x::list_x::tests::a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 46456f0d4e5e2cbc55ddc3d15efd8002cb1f0165
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14173 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7175143656 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7175143656). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T21:29:22Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `46456f0d4e5e2cbc55ddc3d15efd8002cb1f0165` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1422 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `hle::d3d12x::list_x::tests::a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 46456f0d4e5e2cbc55ddc3d15efd8002cb1f0165 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14173 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
luckyteagirl commented 2026-11-26 08:42:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:42:41Z.

Review: COMMENTED


At exact head 46456f0 (base 6d12f58, current main b49be18), the new value-aware wait rule loses the written value across a mid-list split. This is a source-derived review; I did not run a split-enabled title fixture.

split copies written_ranges from the old ListState into the next segment (list_x.rs:2789,2879) but leaves written_values at its default empty value. wait_memory then treats an overlapping prior write with no matching known value as already ordered and returns (:3023–3025). One concrete path is: record Write64(A, 0), issue a wait on unrelated B so try_split_for_wait creates a second segment, then issue Wait64(A, >=, 1) while another queue is expected to raise A. The second segment remembers A's written range but not 0, so it drops a wait that the PR's rule would retain before the split. This is an incomplete case of the bug the PR addresses, rather than a regression newly introduced against main.

Could split carry written_values with written_ranges (keeping the existing invalidation on later overlapping writes)? A split-enabled fixture can inspect the second segment's pending waits after A >= 1, with A >= 0 as the satisfied control.

AI assistance: two GPT-6.2 Sol agents independently checked this path; GPT-6.2 Astra verified the exact-head source and wording.

<!-- greyfinch-sync:ivall/xcl:review:6070878088 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#pullrequestreview-6070878088). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:42:41Z. **Review:** COMMENTED --- At exact head `46456f0` (base `6d12f58`, current main `b49be18`), the new value-aware wait rule loses the written value across a mid-list split. This is a source-derived review; I did not run a split-enabled title fixture. `split` copies `written_ranges` from the old `ListState` into the next segment (`list_x.rs:2789,2879`) but leaves `written_values` at its default empty value. `wait_memory` then treats an overlapping prior write with no matching known value as already ordered and returns (`:3023–3025`). One concrete path is: record `Write64(A, 0)`, issue a wait on unrelated B so `try_split_for_wait` creates a second segment, then issue `Wait64(A, >=, 1)` while another queue is expected to raise A. The second segment remembers A's written range but not 0, so it drops a wait that the PR's rule would retain before the split. This is an incomplete case of the bug the PR addresses, rather than a regression newly introduced against main. Could `split` carry `written_values` with `written_ranges` (keeping the existing invalidation on later overlapping writes)? A split-enabled fixture can inspect the second segment's pending waits after `A >= 1`, with `A >= 0` as the satisfied control. AI assistance: two GPT-6.2 Sol agents independently checked this path; GPT-6.2 Astra verified the exact-head source and wording.
tiagonleal commented 2026-11-26 12:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T11:53:21Z.


Confirmed. split copied written_ranges into the next segment but left written_values empty, so after a split the wait on A was dropped as a write of unknown value.

Fixed in a4b66e81 (squashed with the first commit): split now carries both through a small writes_for_split helper. New test a_split_segment_keeps_the_written_value_for_a_later_wait records Write64(A, 0), moves the state to a new segment the way split does, then waits A >= 1. It exercises what split carries over, not split itself. With the values left out it fails (0 waits kept, 1 expected); with the fix it passes, 3 of 3 runs.

Run on a4b66e81: cargo test --workspace --no-fail-fast -- --test-threads=4, twice: 1421 passed, 4 failed, 46 ignored; the 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY, known on this machine). 60 s smoke runs on 6d12f58a and a4b66e81: both exit 0, no device removals, 1604 and 1616 frames shown. Not run: a split-enabled title fixture with the real split, and the four fuzz tests on main today.

<!-- greyfinch-sync:ivall/xcl:comment:7191294837 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7191294837). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T11:53:21Z. --- Confirmed. `split` copied `written_ranges` into the next segment but left `written_values` empty, so after a split the wait on A was dropped as a write of unknown value. Fixed in a4b66e81 (squashed with the first commit): `split` now carries both through a small `writes_for_split` helper. New test `a_split_segment_keeps_the_written_value_for_a_later_wait` records `Write64(A, 0)`, moves the state to a new segment the way `split` does, then waits `A >= 1`. It exercises what `split` carries over, not `split` itself. With the values left out it fails (0 waits kept, 1 expected); with the fix it passes, 3 of 3 runs. Run on a4b66e81: `cargo test --workspace --no-fail-fast -- --test-threads=4`, twice: 1421 passed, 4 failed, 46 ignored; the 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (E_OUTOFMEMORY, known on this machine). 60 s smoke runs on 6d12f58a and a4b66e81: both exit 0, no device removals, 1604 and 1616 frames shown. Not run: a split-enabled title fixture with the real `split`, and the four fuzz tests on `main` today.
tiagonleal commented 2026-11-26 15:03:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T14:53:25Z.


@raylitebull a note for amd-dev, since it carries this change:

amd-dev carries the first version of this change (a080eb6a). Its split in list_x.rs copies written_ranges to the next segment but not written_values, so after a mid-list split a wait on an address the list wrote with a value that does not meet it is judged without that value.
The PR head (a4b66e81) fixes that: new ListState::writes_for_split() returns the ranges and the values, split destructures both and sets written_values on the next segment, and the test a_split_segment_keeps_the_written_value_for_a_later_wait.
Delta against amd-dev c32c91a3 (about 30 added lines, list_x.rs only); it passes git apply --cached --check against that tree; the patch is below.
Run on the PR head (on main 6d12f58a, not on amd-dev): the two tests 3 of 3 runs; without writes_for_split carrying values the split test fails (0 waits kept, expected 1); cargo test --workspace --no-fail-fast -- --test-threads=4 twice: 1421 passed, 4 failed (the fuzz_validate_and_gpu_0..3 E_OUTOFMEMORY ones), 46 ignored; 60 s smoke: see the PR body.
The delta has not been compiled on amd-dev.

delta against amd-dev c32c91a3
diff --git a/crates/xcl/src/hle/d3d12x/list_x.rs b/crates/xcl/src/hle/d3d12x/list_x.rs
index 53a6ccc..edc3d50 100644
--- a/crates/xcl/src/hle/d3d12x/list_x.rs
+++ b/crates/xcl/src/hle/d3d12x/list_x.rs
@@ -1053,6 +1053,11 @@ impl ListState {
         std::mem::take(&mut self.write64_signals)
     }
 
+    /// What a mid-list split's next segment inherits of this list's writes: the ranges and the known values.
+    fn writes_for_split(&self) -> (Vec<(u64, u64)>, Vec<(u64, u64, u64)>) {
+        (self.written_ranges.clone(), self.written_values.clone())
+    }
+
     fn has_prior_write(&self, va: u64, size: u64) -> bool {
         let end = va.saturating_add(size);
         self.written_ranges.iter().any(|&(s, e)| va < e && s < end)
@@ -3293,7 +3298,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_
         }
         None => None,
     };
-    let (alloc, last_queue, bound_pso, depth_bias, index_buffer, depth_bounds, predication, pred_buf, pred_in_state, active_query, ended_early, written_ranges, bindings) = {
+    let (alloc, last_queue, bound_pso, depth_bias, index_buffer, depth_bounds, predication, pred_buf, pred_in_state, active_query, ended_early, (written_ranges, written_values), bindings) = {
         let mut g = LISTS.lock().unwrap();
         let s = g.as_mut()?.get_mut(&(list as usize))?;
         if s.allocator == 0 {
@@ -3314,7 +3319,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_
             pred_in_state,
             active_query,
             ended_early,
-            s.written_ranges.clone(),
+            s.writes_for_split(),
             s.bindings.clone(),
         )
     };
@@ -3415,6 +3420,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_
                 depth_bounds,
                 occlusion: Occlusion { active: None, ended_early },
                 written_ranges,
+                written_values,
                 pred_buf: pred_buf.clone(),
                 pred_in_state: false,
                 predication,
@@ -6138,6 +6144,25 @@ mod tests {
         assert_eq!(kept(&[], &fill), 0);
     }
 
+    #[test]
+    fn a_split_segment_keeps_the_written_value_for_a_later_wait() {
+        let cell = AtomicU64::new(0);
+        let va = &cell as *const AtomicU64 as u64;
+        let (mut a, mut b) = (0usize, 0usize);
+        let (list, next) = ((&mut a as *mut usize).cast::<c_void>(), (&mut b as *mut usize).cast::<c_void>());
+        let ge = D3D12_COMPARISON_FUNC_GREATER_EQUAL.0 as u32;
+        // `Write64(va, 0)`, then a split moves the recording to `next` with what `split` carries over
+        note_write_value(list as usize, va, &[0, 0]);
+        let (written_ranges, written_values) = LISTS.lock().unwrap().as_ref().unwrap()[&(list as usize)].writes_for_split();
+        on_release(list as usize);
+        LISTS.lock().unwrap().as_mut().unwrap().insert(next as usize, ListState { written_ranges, written_values, ..Default::default() });
+        // a wait the written 0 does not meet stays on the segment
+        unsafe { wait64_x(next, va, ge, 1, 0, 0) };
+        let n = LISTS.lock().unwrap().as_ref().unwrap()[&(next as usize)].pending_waits.len();
+        on_release(next as usize);
+        assert_eq!(n, 1, "the wait after the split was dropped");
+    }
+
     #[test]
     fn execute_with_waits_splits_batches_before_unsatisfied_list() {
         // Use synthetic non-zero list pointers distinct from real COM objects.

AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Sonnet 5.5) compared the trees and wrote this; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7195481183 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7195481183). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T14:53:25Z. --- @raylitebull a note for `amd-dev`, since it carries this change: amd-dev carries the first version of this change (a080eb6a). Its `split` in list_x.rs copies `written_ranges` to the next segment but not `written_values`, so after a mid-list split a wait on an address the list wrote with a value that does not meet it is judged without that value. The PR head (a4b66e81) fixes that: new `ListState::writes_for_split()` returns the ranges and the values, `split` destructures both and sets `written_values` on the next segment, and the test `a_split_segment_keeps_the_written_value_for_a_later_wait`. Delta against amd-dev c32c91a3 (about 30 added lines, list_x.rs only); it passes `git apply --cached --check` against that tree; the patch is below. Run on the PR head (on main 6d12f58a, not on amd-dev): the two tests 3 of 3 runs; without `writes_for_split` carrying values the split test fails (0 waits kept, expected 1); `cargo test --workspace --no-fail-fast -- --test-threads=4` twice: 1421 passed, 4 failed (the fuzz_validate_and_gpu_0..3 E_OUTOFMEMORY ones), 46 ignored; 60 s smoke: see the PR body. The delta has not been compiled on amd-dev. <details><summary>delta against amd-dev c32c91a3</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/list_x.rs b/crates/xcl/src/hle/d3d12x/list_x.rs index 53a6ccc..edc3d50 100644 --- a/crates/xcl/src/hle/d3d12x/list_x.rs +++ b/crates/xcl/src/hle/d3d12x/list_x.rs @@ -1053,6 +1053,11 @@ impl ListState { std::mem::take(&mut self.write64_signals) } + /// What a mid-list split's next segment inherits of this list's writes: the ranges and the known values. + fn writes_for_split(&self) -> (Vec<(u64, u64)>, Vec<(u64, u64, u64)>) { + (self.written_ranges.clone(), self.written_values.clone()) + } + fn has_prior_write(&self, va: u64, size: u64) -> bool { let end = va.saturating_add(size); self.written_ranges.iter().any(|&(s, e)| va < e && s < end) @@ -3293,7 +3298,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_ } None => None, }; - let (alloc, last_queue, bound_pso, depth_bias, index_buffer, depth_bounds, predication, pred_buf, pred_in_state, active_query, ended_early, written_ranges, bindings) = { + let (alloc, last_queue, bound_pso, depth_bias, index_buffer, depth_bounds, predication, pred_buf, pred_in_state, active_query, ended_early, (written_ranges, written_values), bindings) = { let mut g = LISTS.lock().unwrap(); let s = g.as_mut()?.get_mut(&(list as usize))?; if s.allocator == 0 { @@ -3314,7 +3319,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_ pred_in_state, active_query, ended_early, - s.written_ranges.clone(), + s.writes_for_split(), s.bindings.clone(), ) }; @@ -3415,6 +3420,7 @@ unsafe fn split(list: *mut c_void, dispatch: Option<Deferred>) -> Option<*mut c_ depth_bounds, occlusion: Occlusion { active: None, ended_early }, written_ranges, + written_values, pred_buf: pred_buf.clone(), pred_in_state: false, predication, @@ -6138,6 +6144,25 @@ mod tests { assert_eq!(kept(&[], &fill), 0); } + #[test] + fn a_split_segment_keeps_the_written_value_for_a_later_wait() { + let cell = AtomicU64::new(0); + let va = &cell as *const AtomicU64 as u64; + let (mut a, mut b) = (0usize, 0usize); + let (list, next) = ((&mut a as *mut usize).cast::<c_void>(), (&mut b as *mut usize).cast::<c_void>()); + let ge = D3D12_COMPARISON_FUNC_GREATER_EQUAL.0 as u32; + // `Write64(va, 0)`, then a split moves the recording to `next` with what `split` carries over + note_write_value(list as usize, va, &[0, 0]); + let (written_ranges, written_values) = LISTS.lock().unwrap().as_ref().unwrap()[&(list as usize)].writes_for_split(); + on_release(list as usize); + LISTS.lock().unwrap().as_mut().unwrap().insert(next as usize, ListState { written_ranges, written_values, ..Default::default() }); + // a wait the written 0 does not meet stays on the segment + unsafe { wait64_x(next, va, ge, 1, 0, 0) }; + let n = LISTS.lock().unwrap().as_ref().unwrap()[&(next as usize)].pending_waits.len(); + on_release(next as usize); + assert_eq!(n, 1, "the wait after the split was dropped"); + } + #[test] fn execute_with_waits_splits_batches_before_unsatisfied_list() { // Use synthetic non-zero list pointers distinct from real COM objects. ``` </details> AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Sonnet 5.5) compared the trees and wrote this; I checked it.
upipibi commented 2026-11-26 16:27:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:27:49Z.


Overlap with #1256 (open): it makes write()'s title-memory branch (the cpu_writes path, outside the unified-memory windows) and timestamp()'s readback branch call s.note_write(va, n), so a later wait on that address in the same list is dropped as on the GPU path. With this PR merged too, that branch records the range but no value, so a reset-then-wait on title memory (Write64BitValueX(X, 0), then X >= 1) would still be dropped by the "no known value, as before" rule. Whichever lands second should record the value on that branch as well (what note_write_value does, on the ListState that branch already holds locked). The two also conflict in list_x.rs. I can do it on #1256 if this lands first.

AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7197678186 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7197678186). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T16:27:49Z. --- Overlap with #1256 (open): it makes `write()`'s title-memory branch (the `cpu_writes` path, outside the unified-memory windows) and `timestamp()`'s readback branch call `s.note_write(va, n)`, so a later wait on that address in the same list is dropped as on the GPU path. With this PR merged too, that branch records the range but no value, so a reset-then-wait on title memory (`Write64BitValueX(X, 0)`, then `X >= 1`) would still be dropped by the "no known value, as before" rule. Whichever lands second should record the value on that branch as well (what `note_write_value` does, on the `ListState` that branch already holds locked). The two also conflict in list_x.rs. I can do it on #1256 if this lands first. AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this.
tiagonleal commented 2026-11-26 16:28:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T16:28:55Z.


Agreed, and that order works for me. On that branch #1256 records the range with note_write but no value, so with this PR's rule a Write64BitValueX(X, 0) into title memory followed by a wait on X >= 1 would still be dropped as a write of unknown value.

If this one lands first, your offer to record the value on that branch in #1256 covers it. If #1256 lands first, I'll rebase this PR and make that branch call note_write_value with the written bytes, with a test for the reset-then-wait case on title memory. I have not merged the two locally, so I can't say more about the list_x.rs conflict than that both touch write().

AI use: Claude Code with Claude Fable 5.2 wrote this from the two diffs; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7197702161 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7197702161). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T16:28:55Z. --- Agreed, and that order works for me. On that branch #1256 records the range with `note_write` but no value, so with this PR's rule a `Write64BitValueX(X, 0)` into title memory followed by a wait on `X >= 1` would still be dropped as a write of unknown value. If this one lands first, your offer to record the value on that branch in #1256 covers it. If #1256 lands first, I'll rebase this PR and make that branch call `note_write_value` with the written bytes, with a test for the reset-then-wait case on title memory. I have not merged the two locally, so I can't say more about the list_x.rs conflict than that both touch `write()`. AI use: Claude Code with Claude Fable 5.2 wrote this from the two diffs; I checked it.
Decodere commented 2026-11-26 16:36:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T16:36:00Z.


Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2506 updated head a4b66e811589677dc9c5a702248b6964f9da40d7 (with the split written_values fix; exact parent & merge-base 6d12f58a229bc73889878a448c64dc3af25eeba0). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0, default flags, no input)

Targeted RTX 4060 release unit & GPU tests (a4b66e81)

  • cargo test --release -p xcl --lib a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it -- --nocapture: 1 passed, 0 failed, 0 ignored (0.02 s, 0 SKIPPED).
  • cargo test --release -p xcl --lib a_split_segment_keeps_the_written_value_for_a_later_wait -- --nocapture: 1 passed, 0 failed, 0 ignored (0.02 s, 0 SKIPPED).
  • cargo test --release -p xcl --lib hle::d3d12x::list_x:: (3 consecutive parallel passes): 42 passed, 0 failed, 0 ignored on all 3 passes (0.78 s / 0.78 s / 0.79 s, 0 SKIPPED).

Paired 60 s RTX 4060 smoke (exact parent 6d12f58a vs a4b66e81)

Both runs completed cleanly at steady 60/2 s pacing with 0 device removals and 0 crashes (a4b66e81 vs 6d12f58a xcl.log: 6,175 / 6,115 MB vs 6,176 / 6,116 MB peak/end local VRAM, 4,683 MB end non-local VRAM on both, 19,543 vs 19,600 translated draws / 1,024 dispatches with 0 skipped, 4096 sparse submits in 321 ms vs 317 ms).

Exact parent (6d12f58a):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB

PR #2506 head (a4b66e81):

xcl-smoke v1
commit: a4b66e811589677dc9c5a702248b6964f9da40d7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14019 MB

Limits of coverage

  • Full workspace test suite was not run on a4b66e81 (only the 2 new tests individually, 3 parallel passes of hle::d3d12x::list_x::, release build, and exact-parent paired 60 s smokes).
  • The 60 s no-input menu/intro smoke did not log live mid-list Write64/Wait64 splits; the post-split written_values preservation path was covered by the targeted release unit test a_split_segment_keeps_the_written_value_for_a_later_wait.
  • Single discrete NVIDIA 8 GB GPU (RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit/GPU tests, release build, and exact-parent paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts, timings, memory figures, and smoke blocks were extracted directly from cargo test, xcl.log, and scripts/smoke.ps1 outputs.

<!-- greyfinch-sync:ivall/xcl:comment:7197855744 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7197855744). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T16:36:00Z. --- **Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2506 updated head `a4b66e811589677dc9c5a702248b6964f9da40d7`** (with the `split` `written_values` fix; exact parent & merge-base `6d12f58a229bc73889878a448c64dc3af25eeba0`). Measurements and targeted test results only; not a full source review. ### Setup - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` - **Toolchain / caches:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5`, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs) - **Workload:** Retail workload `title: 29640639` via `scripts/smoke.ps1 -Seconds 60` (`XCL_NETWORK=0`, default flags, no input) ### Targeted RTX 4060 release unit & GPU tests (`a4b66e81`) - `cargo test --release -p xcl --lib a_wait_after_an_own_write_is_dropped_only_when_the_written_value_meets_it -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.02 s`, `0` `SKIPPED`). - `cargo test --release -p xcl --lib a_split_segment_keeps_the_written_value_for_a_later_wait -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.02 s`, `0` `SKIPPED`). - `cargo test --release -p xcl --lib hle::d3d12x::list_x::` (3 consecutive parallel passes): **42 passed, 0 failed, 0 ignored** on all 3 passes (`0.78 s` / `0.78 s` / `0.79 s`, `0` `SKIPPED`). ### Paired 60 s RTX 4060 smoke (exact parent `6d12f58a` vs `a4b66e81`) Both runs completed cleanly at steady 60/2 s pacing with `0` device removals and `0` crashes (`a4b66e81` vs `6d12f58a` `xcl.log`: `6,175` / `6,115 MB` vs `6,176` / `6,116 MB` peak/end local VRAM, `4,683 MB` end non-local VRAM on both, `19,543` vs `19,600` translated draws / `1,024` dispatches with `0` skipped, `4096` sparse submits in `321 ms` vs `317 ms`). Exact parent (`6d12f58a`): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` PR #2506 head (`a4b66e81`): ``` xcl-smoke v1 commit: a4b66e811589677dc9c5a702248b6964f9da40d7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14019 MB ``` ### Limits of coverage - Full workspace test suite was not run on `a4b66e81` (only the 2 new tests individually, 3 parallel passes of `hle::d3d12x::list_x::`, release build, and exact-parent paired 60 s smokes). - The 60 s no-input menu/intro smoke did not log live mid-list `Write64`/`Wait64` splits; the post-split `written_values` preservation path was covered by the targeted release unit test `a_split_segment_keeps_the_written_value_for_a_later_wait`. - Single discrete NVIDIA 8 GB GPU (`RTX 4060`) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host. ### AI use Ran the targeted release unit/GPU tests, release build, and exact-parent paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts, timings, memory figures, and smoke blocks were extracted directly from `cargo test`, `xcl.log`, and `scripts/smoke.ps1` outputs.
ClosetPie107 commented 2026-11-27 12:51:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T12:51:50Z.


Independent test report under Wine/Proton (not native Windows) for head a4b66e81.

Setup

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5
  • Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 with a local patch dropping the lpVtbl checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu
  • Head merged onto main 83b00818, test commit 8c98501c

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::list_x::: 42 passed, 0 failed (main: 40 passed, 0 failed), including both new tests
  • cargo test --workspace --no-fail-fast -- --test-threads=4, lib binary: 1322 passed, 9 failed, 27 ignored (main the same run: 1320 passed, 9 failed, 27 ignored). The failures are main's, except gpu_geometry_wave32_prefix_count_over_a_mask (timing-dependent: it also failed on unrelated trees today).

Retail title, 300 s (release, from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • 1 run: exit 0, no crash, no device removal, 2,066 presents. main, 4 runs: all clean, 1,892–2,122.

Not tested

  • Native Windows, NVIDIA/Intel

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7218766165 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7218766165). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T12:51:50Z. --- Independent test report under Wine/Proton (not native Windows) for head `a4b66e81`. **Setup** - AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5 - Proton Experimental `experimental-11.0-20261112`, vkd3d-proton master `ec207194` with a local patch dropping the `lpVtbl` checks in `d3d12_command_allocator_from_iface` / `d3d12_command_list_from_iface`, DXC `1.9.2609.5`, Rust 1.96.0, `x86_64-pc-windows-gnu` - Head merged onto `main` `83b00818`, test commit `8c98501c` **Tests** (debug, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::list_x::`: 42 passed, 0 failed (`main`: 40 passed, 0 failed), including both new tests - `cargo test --workspace --no-fail-fast -- --test-threads=4`, lib binary: 1322 passed, 9 failed, 27 ignored (`main` the same run: 1320 passed, 9 failed, 27 ignored). The failures are `main`'s, except `gpu_geometry_wave32_prefix_count_over_a_mask` (timing-dependent: it also failed on unrelated trees today). **Retail title, 300 s** (release, from a copy of the same warm-cache snapshot; `XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence`, `A` pressed every 10 s) - 1 run: exit 0, no crash, no device removal, 2,066 presents. `main`, 4 runs: all clean, 1,892–2,122. **Not tested** - Native Windows, NVIDIA/Intel **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
Foniass commented 2026-12-01 08:12:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:12:57Z.


Triage (#1607) – head 9856615

No open or merged PR makes the same change. #592 changes how written_ranges merges ranges, and #3035 covers waits after deferred CPU writes; neither keys the dropped wait on the value the list wrote. The other #1452 PRs touch unrelated paths.
No problems found in the diff. The test covers the eight comparisons, the mask, the last of two writes and a fill over the value, plus carry-over across SplitCarry.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7305024488 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7305024488). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:12:57Z. --- **Triage (#1607)** – head 9856615 No open or merged PR makes the same change. #592 changes how `written_ranges` merges ranges, and #3035 covers waits after deferred CPU writes; neither keys the dropped wait on the value the list wrote. The other #1452 PRs touch unrelated paths. No problems found in the diff. The test covers the eight comparisons, the mask, the last of two writes and a fill over the value, plus carry-over across `SplitCarry`. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
fromthemoonx commented 2026-12-02 19:16:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T19:16:49Z.


merge-check
base: c53e969602
head: 98566154f0
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored (base: 3004 passed, 0 failed, 52 ignored on 817eb1f; c53e9696 adds only triage tooling); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. The hle::d3d12x::list_x:: tests at 8 threads: 7 of 70 runs had a failure here and 10 of 70 on main, in the same three known flaky tests, so not this PR.
review: read the whole diff (1 file, +139 -3). The tracking of the written value reads right: cleared with the segment, carried over a split, forgotten on a fill or copy.

  1. Blocking: a wait that main drops can now stop the title. XCL records immediate writes, fills, copies, query results and timestamps, but not what a shader writes. Take a list that writes X = 0, raises X in its own dispatch, and waits for X >= 1. The known value is still 0, so the wait is kept. It is then checked before the list is submitted, and the dispatch that would raise X can never run.
    I ran that case through execute_with_waits_on on this GPU, with the shader's write simulated by a store right after the submit:
waits kept result
range recorded only, as on main (32 and 64 bit) 0 submitted at once
value recorded, this PR (32 and 64 bit) 1 timed out after 2000 ms, then "a CPU fallback memory wait timed out without a proven completion – the title is stopped before its remaining GPU submission", process exit 5
  1. The description says a wait nobody meets costs 2 s or 5 s. That is no longer so: since dd84e0ad (already in this PR's base) such a wait stops the title, unless XCL_WAIT_TIMEOUT_CONTINUE=1 is set.
  2. From reading only: the same happens with a 32-bit counter when the other queue raises X only after it has seen this list's reset. The wait is placed before the segment that holds the reset. After a recorded 64-bit signal the list is split, so there the reset goes first.
  3. Ways out, not tried: keep the wait only when another queue or list is known to write X, or let a wait kept by this new rule go on after the time-out, as main would have.
  4. Not tested: a retail title (none on this machine). The description says the smoke title never reaches this check, so the smoke pair shows neither the gain nor this risk.
    performance: a scan of at most 256 entries per recorded write, under the lock that is already held (reasoned, not measured)
    verdict: not yet: a list that resets a counter, raises it in its own shader and waits for it runs on main and stops the title with this PR
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7355912546 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#issuecomment-7355912546). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-02T19:16:49Z. --- merge-check base: c53e96960265a82477a9c98677afb0402e98d486 head: 98566154f02cef5038cf104778100cf4f23afc51 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored (base: 3004 passed, 0 failed, 52 ignored on 817eb1f; c53e9696 adds only triage tooling); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. The `hle::d3d12x::list_x::` tests at 8 threads: 7 of 70 runs had a failure here and 10 of 70 on main, in the same three known flaky tests, so not this PR. review: read the whole diff (1 file, +139 -3). The tracking of the written value reads right: cleared with the segment, carried over a split, forgotten on a fill or copy. 1) Blocking: a wait that main drops can now stop the title. XCL records immediate writes, fills, copies, query results and timestamps, but not what a shader writes. Take a list that writes `X = 0`, raises X in its own dispatch, and waits for `X >= 1`. The known value is still 0, so the wait is kept. It is then checked before the list is submitted, and the dispatch that would raise X can never run. I ran that case through `execute_with_waits_on` on this GPU, with the shader's write simulated by a store right after the submit: | | waits kept | result | |---|---|---| | range recorded only, as on main (32 and 64 bit) | 0 | submitted at once | | value recorded, this PR (32 and 64 bit) | 1 | timed out after 2000 ms, then "a CPU fallback memory wait timed out without a proven completion – the title is stopped before its remaining GPU submission", process exit 5 | 2) The description says a wait nobody meets costs 2 s or 5 s. That is no longer so: since dd84e0ad (already in this PR's base) such a wait stops the title, unless `XCL_WAIT_TIMEOUT_CONTINUE=1` is set. 3) From reading only: the same happens with a 32-bit counter when the other queue raises X only after it has seen this list's reset. The wait is placed before the segment that holds the reset. After a recorded 64-bit signal the list is split, so there the reset goes first. 4) Ways out, not tried: keep the wait only when another queue or list is known to write X, or let a wait kept by this new rule go on after the time-out, as main would have. 5) Not tested: a retail title (none on this machine). The description says the smoke title never reaches this check, so the smoke pair shows neither the gain nor this risk. performance: a scan of at most 256 entries per recorded write, under the lock that is already held (reasoned, not measured) verdict: not yet: a list that resets a counter, raises it in its own shader and waits for it runs on main and stops the title with this PR hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
gut0to commented 2026-12-02 19:38:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-12-02T19:38:31Z.

Review: COMMENTED


AI-assisted review: GPT-6 helped inspect the diff; I verified the overlap path.

<!-- greyfinch-sync:ivall/xcl:review:6157608157 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#pullrequestreview-6157608157). Originally posted by [gut0to](https://github.com/gut0to) on 2026-12-02T19:38:31Z. **Review:** COMMENTED --- AI-assisted review: GPT-6 helped inspect the diff; I verified the overlap path.
gut0to commented 2026-12-02 19:38:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-12-02T19:38:31Z.

Code review location: crates/xcl/src/hle/d3d12x/list_x.rs; line 1083

@@ -1069,6 +1076,22 @@ impl ListState {
         self.written_ranges.overlaps(WriteProducer::InSegmentGpu, va, size)
     }
 
+    /// Whether this list's last immediate write to exactly `va..va + size`, masked, meets the wait;
+    /// true when there is no known value (a fill, a copy, a partial write), as before.
+    fn own_write_meets(&self, va: u64, size: u64, comparison: u32, mask: u64, value: u64) -> bool {
+        let own = self.written_values.iter().find(|&&(w, len, _)| w == va && len == size);
+        own.is_none_or(|&(_, _, v)| compare_u64(comparison, v & mask, value) == Some(true))

Medium: This fallback treats any overlapping write without an exact (va, size) entry as satisfying the wait. That can drop a valid wait after a wider immediate write: for example, WriteBufferImmediate writes 8 bytes at A, then the same list waits with Wait32(A + 4, >=, 1) while another queue is expected to update that DWORD. written_values contains (A, 8, value), so this exact-range lookup misses and returns true; wait_memory then discards the wait. Could the recorded write be compared against the actual waited subrange, or keep the wait when widths or ranges differ, with tests for both DWORDs of an 8-byte write? AI-assisted review: GPT-6 helped inspect the diff; I verified the overlap path.

<!-- greyfinch-sync:ivall/xcl:review-comment:4774931822 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2506#discussion_r4774931822). Originally posted by [gut0to](https://github.com/gut0to) on 2026-12-02T19:38:31Z. **Code review location:** `crates/xcl/src/hle/d3d12x/list_x.rs`; line 1083 ~~~~diff @@ -1069,6 +1076,22 @@ impl ListState { self.written_ranges.overlaps(WriteProducer::InSegmentGpu, va, size) } + /// Whether this list's last immediate write to exactly `va..va + size`, masked, meets the wait; + /// true when there is no known value (a fill, a copy, a partial write), as before. + fn own_write_meets(&self, va: u64, size: u64, comparison: u32, mask: u64, value: u64) -> bool { + let own = self.written_values.iter().find(|&&(w, len, _)| w == va && len == size); + own.is_none_or(|&(_, _, v)| compare_u64(comparison, v & mask, value) == Some(true)) ~~~~ --- **Medium**: This fallback treats any overlapping write without an exact `(va, size)` entry as satisfying the wait. That can drop a valid wait after a wider immediate write: for example, `WriteBufferImmediate` writes 8 bytes at `A`, then the same list waits with `Wait32(A + 4, >=, 1)` while another queue is expected to update that DWORD. `written_values` contains `(A, 8, value)`, so this exact-range lookup misses and returns `true`; `wait_memory` then discards the wait. Could the recorded write be compared against the actual waited subrange, or keep the wait when widths or ranges differ, with tests for both DWORDs of an 8-byte write? AI-assisted review: GPT-6 helped inspect the diff; I verified the overlap path.
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/2506:upstream-pr/2506'
git switch 'upstream-pr/2506'

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/2506'
git switch 'upstream-pr/2506'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2506'
git switch 'upstream-pr/2506'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2506'
git switch 'main'
git merge --squash 'upstream-pr/2506'
git switch 'main'
git merge --ff-only 'upstream-pr/2506'
git switch 'main'
git merge 'upstream-pr/2506'
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!2496
No description provided.