Tests: synchronize DirectStorage queue option readbacks #2329

Open
venetanji wants to merge 2 commits from upstream-pr/2339 into main
venetanji commented 2026-11-25 15:35:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by venetanji on 2026-11-25T15:35:00Z.


Stacked on #1599; only the top commit (7a2d6d0) belongs here. The first commit is #1599's queue implementation, cherry-picked onto 0829441 with Grein's authorship preserved. This can also be folded into #1599 instead of merged separately.

The two queue-option tests poll ordinary destination bytes while the worker writes them. read_volatile does not synchronize those accesses. Wait for the existing status entry with an Acquire load, then check every destination byte after queue cleanup. Delay assertions until cleanup so a failed expectation cannot release buffers while a worker still uses them.

What is in it

  • crates/xcl/src/hle/dstorage.rs, test module only in 7a2d6d0: status completion, mutable destination pointers, and cleanup before assertions in the two existing regressions. The half-full fixture uses capacity 6 so its two copies and trailing status reach half capacity together.
  • No new runtime behavior beyond the dependency from #1599. No new dependency or game data.

Tested

  • git diff --check main..HEAD: passes.
  • Source comparison against the dependency commit: production code before the test module is byte-identical; both existing fixtures remain present once and no longer poll destination bytes.
  • scripts/pr_check.py rejects the missing main/head smoke blocks in the current stacked diff, as expected; no waiver is claimed.
  • Local exact-branch build and executable tests are pending. This remains a draft.
  • Peer report only: fromthemoonx tested exact 7a2d6d0 on RTX 3060 12 GB / driver 610.88, Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug. They report cargo test --workspace --no-fail-fast -- --test-threads=4: 1274 passed, 0 failed, 46 ignored, 25 SKIPPED lines; both queue tests 40/40 and deliberate broken-queue controls failed. These are their results, not independently rerun here. Their original polling controls also passed, so this is no observed Windows-race claim.

Regression run

  • Pending for the stacked runtime dependency. No smoke blocks were generated for this head. After #1599 merges, the remaining diff is test-only; the normal maintainer approval process still applies.

Not tested

  • Locally: native Windows, the whole GPU suite, retail smoke, and this branch's executable regressions. Targeted local qualification remains pending resource coordination.
  • The peer report does not cover release, a title, AMD or Intel; official main/head smoke blocks remain missing.
  • The retained 200 ms scheduling window does not prove that an unscheduled producer reached its enqueue. Parallel file decoding, cancellation waking a full queue, and multiple blocked producers are outside this correction.

AI use

  • Codex (GPT-6) audited the dependency and provenance, adapted our existing source-owned test correction, checked the diff, and wrote this description. This draft is published at the user's explicit request in a supervised session.
<!-- greyfinch-sync:ivall/xcl:issue:5494398285 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2339). Originally posted by [venetanji](https://github.com/venetanji) on 2026-11-25T15:35:00Z. --- Stacked on #1599; only the top commit (`7a2d6d0`) belongs here. The first commit is #1599's queue implementation, cherry-picked onto `0829441` with Grein's authorship preserved. This can also be folded into #1599 instead of merged separately. The two queue-option tests poll ordinary destination bytes while the worker writes them. `read_volatile` does not synchronize those accesses. Wait for the existing status entry with an Acquire load, then check every destination byte after queue cleanup. Delay assertions until cleanup so a failed expectation cannot release buffers while a worker still uses them. **What is in it** - `crates/xcl/src/hle/dstorage.rs`, test module only in `7a2d6d0`: status completion, mutable destination pointers, and cleanup before assertions in the two existing regressions. The half-full fixture uses capacity 6 so its two copies and trailing status reach half capacity together. - No new runtime behavior beyond the dependency from #1599. No new dependency or game data. **Tested** - `git diff --check main..HEAD`: passes. - Source comparison against the dependency commit: production code before the test module is byte-identical; both existing fixtures remain present once and no longer poll destination bytes. - `scripts/pr_check.py` rejects the missing main/head smoke blocks in the current stacked diff, as expected; no waiver is claimed. - Local exact-branch build and executable tests are pending. This remains a draft. - Peer report only: [fromthemoonx tested exact `7a2d6d0`](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7167741338) on RTX 3060 12 GB / driver 610.88, Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug. They report `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1274 passed, 0 failed, 46 ignored, 25 SKIPPED lines; both queue tests 40/40 and deliberate broken-queue controls failed. These are their results, not independently rerun here. Their original polling controls also passed, so this is no observed Windows-race claim. **Regression run** - Pending for the stacked runtime dependency. No smoke blocks were generated for this head. After #1599 merges, the remaining diff is test-only; the normal maintainer approval process still applies. **Not tested** - Locally: native Windows, the whole GPU suite, retail smoke, and this branch's executable regressions. Targeted local qualification remains pending resource coordination. - The peer report does not cover release, a title, AMD or Intel; official main/head smoke blocks remain missing. - The retained 200 ms scheduling window does not prove that an unscheduled producer reached its enqueue. Parallel file decoding, cancellation waking a full queue, and multiple blocked producers are outside this correction. **AI use** - Codex (GPT-6) audited the dependency and provenance, adapted our existing source-owned test correction, checked the diff, and wrote this description. This draft is published at the user's explicit request in a supervised session.
SlopTart commented 2026-11-25 16:12:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T15:49:28Z.


Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

Disclosure: this branch carries the cherry-picked #1599 queue commit underneath; the run covers the branch as-is.

  • gpu_ suite (--release --locked, --test-threads=2): 144 passed / 3 failed / 1 ignored, same three baseline failures as plain origin/main on this rig (rig's known baseline: fuzz seed 1003 of #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed).
  • Both new tests hle::dstorage::tests::a_queue_with_auto_submit_disabled_waits_for_submit and ...a_full_queue_with_auto_submit_disabled_holds_an_enqueue_until_submit: pass on this lane (--test-threads=1), exercising the real DirectStorage shim (CreateQueue (0x20 desc), options 0x1 logged under wine).

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7167345179 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7167345179). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T15:49:28Z. --- **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). Disclosure: this branch carries the cherry-picked #1599 queue commit underneath; the run covers the branch as-is. - `gpu_` suite (`--release --locked`, `--test-threads=2`): 144 passed / 3 failed / 1 ignored, same three baseline failures as plain `origin/main` on this rig (rig's known baseline: fuzz seed 1003 of #2115, `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_depth_buffer_created_for_unordered_access_is_placed`). - Both new tests `hle::dstorage::tests::a_queue_with_auto_submit_disabled_waits_for_submit` and `...a_full_queue_with_auto_submit_disabled_holds_an_enqueue_until_submit`: pass on this lane (`--test-threads=1`), exercising the real DirectStorage shim (`CreateQueue (0x20 desc), options 0x1` logged under wine). **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
fromthemoonx commented 2026-11-25 17:07:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T16:16:15Z.


Native Windows run: builds and passes. Both queue tests passed 40 of 40, and each one fails on a deliberately broken queue (without hanging). This covers the native build and the two tests listed under Not tested.

Tested: 7a2d6d0, which already contains main 0829441. RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1274 passed, 0 failed, 46 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
a_queue_with_auto_submit_disabled_waits_for_submit, alone, 40 runs 40 of 40
a_full_queue_with_auto_submit_disabled_holds_an_enqueue_until_submit, alone, 40 runs 40 of 40
hle::dstorage:: (32 tests), --test-threads=4, 10 runs 10 of 10
#1599's own versions of the two tests (a9433e7), same repeats 40 / 40 / 10 of 10: the old polling didn't fail here either, so this run shows no race on Windows. The fix is about correctness, not a failure seen on this machine.

Deliberate breaks in QueueInner (scratch, 3 runs each):

  • The half-full check ignores auto_submit: the first test fails, options 0x1: … left: true, right: false.
  • The half-full check never submits: the first test fails, options 0x0: … left: false, right: true.
  • wait_for_room never holds: the second test fails at an enqueue into a full queue waits. It runs to the end and doesn't hang, so the asserts placed after cleanup work as intended.

One thing to know about the first test: with capacity 6, the two requests fill the queue to 2. It reaches half full (3) only when the test's own Entry::Status is enqueued. So in the options 0 case, the auto-submit is set off by that status entry, not by the requests. The test still tells the two options apart (the first two breaks above), but the comment two requests + status: half full at 3 is the only place that says so.

Not tested: a release build, a title, AMD / Intel.

AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7167741338 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7167741338). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-25T16:16:15Z. --- **Native Windows run: builds and passes. Both queue tests passed 40 of 40, and each one fails on a deliberately broken queue (without hanging).** This covers the native build and the two tests listed under Not tested. **Tested:** `7a2d6d0`, which already contains `main` `0829441`. RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1274 passed, 0 failed, 46 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | `a_queue_with_auto_submit_disabled_waits_for_submit`, alone, 40 runs | 40 of 40 | | `a_full_queue_with_auto_submit_disabled_holds_an_enqueue_until_submit`, alone, 40 runs | 40 of 40 | | `hle::dstorage::` (32 tests), `--test-threads=4`, 10 runs | 10 of 10 | | #1599's own versions of the two tests (`a9433e7`), same repeats | 40 / 40 / 10 of 10: the old polling didn't fail here either, so this run shows no race on Windows. The fix is about correctness, not a failure seen on this machine. | Deliberate breaks in `QueueInner` (scratch, 3 runs each): - The half-full check ignores `auto_submit`: the first test fails, `options 0x1: … left: true, right: false`. - The half-full check never submits: the first test fails, `options 0x0: … left: false, right: true`. - `wait_for_room` never holds: the second test fails at `an enqueue into a full queue waits`. It runs to the end and doesn't hang, so the asserts placed after cleanup work as intended. One thing to know about the first test: with capacity 6, the two requests fill the queue to 2. It reaches half full (3) only when the test's own `Entry::Status` is enqueued. So in the `options 0` case, the auto-submit is set off by that status entry, not by the requests. The test still tells the two options apart (the first two breaks above), but the comment `two requests + status: half full at 3` is the only place that says so. **Not tested:** a release build, a title, AMD / Intel. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.
DavidM1911 commented 2026-11-25 19:09:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:25:20Z.


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:7170884968 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7170884968). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T18:25:20Z. --- 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!
Foniass commented 2026-12-01 07:51:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:51:48Z.


Triage (#1607) – head 7a2d6d0

This PR is stacked on #1599 (AutoSubmitDisabled queues). #1599 has been merged, so the shared lines are already on main. Its own commit (7a2d6d0, which makes the two AutoSubmitDisabled tests in dstorage.rs wait on a Status entry with Acquire ordering instead of polling the buffers with read_volatile, and keeps the buffers alive until cleanup) is not on main, and no other open PR makes it. It needs a rebase that drops a9433e7, which also clears the conflict. The lines it shares with #3099, #3111, #3112, #3335, #3361 and #2706 are the same #1599 base, not the same change. No problems found in the diff.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7304576365 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7304576365). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:51:48Z. --- **Triage (#1607)** – head 7a2d6d0 This PR is stacked on #1599 (AutoSubmitDisabled queues). #1599 has been merged, so the shared lines are already on main. Its own commit (7a2d6d0, which makes the two AutoSubmitDisabled tests in dstorage.rs wait on a Status entry with Acquire ordering instead of polling the buffers with `read_volatile`, and keeps the buffers alive until cleanup) is not on main, and no other open PR makes it. It needs a rebase that drops a9433e7, which also clears the conflict. The lines it shares with #3099, #3111, #3112, #3335, #3361 and #2706 are the same #1599 base, not the same change. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2339:upstream-pr/2339'
git switch 'upstream-pr/2339'

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