Skip to content

Tests: synchronize DirectStorage queue option readbacks - #2339

Draft
venetanji wants to merge 2 commits into
xcl-dev:mainfrom
venetanji:contrib/dstorage-status-readbacks
Draft

venetanji wants to merge 2 commits into
xcl-dev:mainfrom
venetanji:contrib/dstorage-status-readbacks

Conversation

@venetanji

@venetanji venetanji commented Nov 25, 2026 •

Copy link
Copy Markdown

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 DirectStorage: a queue made with AutoSubmitDisabled waits for Submit #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

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.

mgrein and others added 2 commits November 25, 2026 23:32
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 <noreply@anthropic.com>
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#1599. Its queue implementation and original tests remain attributed to their original author.

Assisted-by: Codex (GPT-6)
@SlopTart

Copy link
Copy Markdown

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 DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #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

Copy link
Copy Markdown

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.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants