Tests: synchronize DirectStorage queue option readbacks #2339

Open
github-bot wants to merge 2 commits from github-bot/gh-2339 into main AGit
Owner

@⁠venetanji on GitHub · 2026-11-25 15:35 UTC · original
venetanji:contrib/dstorage-status-readbacks → main · +172 −10 · 1 files · 2 commits · draft

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.
**@⁠venetanji** on GitHub · 2026-11-25 15:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2339) `venetanji:contrib/dstorage-status-readbacks` → `main` · +172 −10 · 1 files · 2 commits · draft 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://git.gtahub.st/github/xcl-dev--xcl/pulls/2339) 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.
The newer factory's CreateQueue (slot 10) takes a 0x20-byte desc whose
u64 @0x18 is the queue's DSTORAGE_QUEUE_OPTIONS; a new retail game sets
bit 0, AutoSubmitDisabled. XCL ignored it, and a half-full queue still
submitted by itself. The title writes a request's destination page list
after EnqueueRequest and before its own Submit, so a request that the
half-full submit sent to the worker could run before its list was
written, with the pages of the slot's previous request.

Such a queue now runs its requests only at Submit, and an enqueue into
it at capacity waits until Submit, a cancel or Close takes entries, as
the console's queue stalls one. Queues made without the option, or
through the first CreateQueue, submit when half full as before. Other
option bits are logged once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reuse status completion and Acquire ordering before inspecting buffers in the two AutoSubmitDisabled regression fixtures. Keep source/destination buffers alive through queue cleanup, including assertion failures.

Stacked on xcl-dev/xcl#1599. Its queue implementation and original tests remain attributed to their original author.

Assisted-by: Codex (GPT-6)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:28:07 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 15:49 UTC · original

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.

**@⁠SlopTart** on GitHub · 2026-11-25 15:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7167345179) **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.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-25 16:16 UTC · original

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.

**@⁠fromthemoonx** on GitHub · 2026-11-25 16:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7167741338) **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 18:25 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 18:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2339#issuecomment-7170884968) 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!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2339/head:github-bot/gh-2339'
git switch 'github-bot/gh-2339'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2339'
git switch 'github-bot/gh-2339'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2339'
git switch 'github-bot/gh-2339'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2339'
git switch 'main'
git merge --squash 'github-bot/gh-2339'
git switch 'main'
git merge --ff-only 'github-bot/gh-2339'
git switch 'main'
git merge 'github-bot/gh-2339'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.