DirectStorage: wake waiters from ordered completion events (#1833) #2569

Open
github-bot wants to merge 1 commit from github-bot/gh-2569 into main AGit
Owner

@⁠razormontana on GitHub · 2026-11-25 23:17 UTC · original
razormontana:directstorage/retire-queue-completion-events → main · +126 −8 · 3 files · 1 commits · open

Part of #1833. A title using IDStorageQueueX1::EnqueueSetEvent can wait for a group of DirectStorage reads to finish. XCL's X1 queue now signals that event in submission order after the earlier reads retire. Microsoft GDK method reference

What is in it

  • Implement the X1 vtable slot in hle/dstorage.rs. A queue entry owns a duplicate event handle and uses the existing submission and retirement path. The half-capacity submission trigger counts the marker. Close discards a pending marker and releases its handle.
  • Test the actual X1 slot with a sequential queue that auto-submits, gated parallel retirement after the caller closes its handle, and a pending marker discarded by Close. Document the method in README.md.
  • #2502's worker-start recovery adds a separate retirement match that will need to include the new marker if both changes land.

Tested

  • Windows 11 Pro (22631.5335), Core i7-10700K, NVIDIA GeForce RTX 3070 8 GB (driver 617.42), Rust 1.100.0 MSVC. Debug workspace tests, release retail smoke.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output on e499bfc reported 1426 passes, 0 failures, and 46 ignored. There were 26 explicit runner skips within the pass count.
  • cargo test --offline --locked -p xcl --lib hle::dstorage:: -- --test-threads=1 --nocapture passed 34/0/0 without skips in both the default and XCL_DSTORAGE_PARALLEL_DECOMPRESS=1 runs. Both event-wakeup tests timed out on the baseline X1 vtable stub.
  • cargo build --offline --locked --release -p xcl succeeded. scripts/smoke.ps1 ran the same title offline for 60 seconds per arm with direct DXIL and matching cache seeds.

Regression run

Main

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 493 (PresentX 493)
presents per 2 s (last 3): 12 13 8
device removals: 0
crashes: 0
peak commit: 15495 MB

PR head

xcl-smoke v1
commit: e499bfcabacc8dd57acb7d517a612648f157a5eb
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 743 (PresentX 744)
presents per 2 s (last 3): 2 19 18
device removals: 0
crashes: 0
peak commit: 14726 MB

Not tested

  • Whether the retail title reaches the X1 slot during world load. The ordering and handle checks use synthetic reads. Wine and AMD or Intel GPU coverage remain unmeasured.

AI use

Yes, Codex GPT-6.2 Sol implemented and independently reviewed the patch, ran the tests, and prepared this description.

**@⁠razormontana** on GitHub · 2026-11-25 23:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2569) `razormontana:directstorage/retire-queue-completion-events` → `main` · +126 −8 · 3 files · 1 commits · open Part of #1833. A title using `IDStorageQueueX1::EnqueueSetEvent` can wait for a group of DirectStorage reads to finish. XCL's X1 queue now signals that event in submission order after the earlier reads retire. [Microsoft GDK method reference](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/dstorage/interfaces/idstoragequeuex1/methods/idstoragequeuex_enqueuesetevent) **What is in it** - Implement the X1 vtable slot in `hle/dstorage.rs`. A queue entry owns a duplicate event handle and uses the existing submission and retirement path. The half-capacity submission trigger counts the marker. Close discards a pending marker and releases its handle. - Test the actual X1 slot with a sequential queue that auto-submits, gated parallel retirement after the caller closes its handle, and a pending marker discarded by Close. Document the method in `README.md`. - #2502's worker-start recovery adds a separate retirement match that will need to include the new marker if both changes land. **Tested** - Windows 11 Pro (22631.5335), Core i7-10700K, NVIDIA GeForce RTX 3070 8 GB (driver 617.42), Rust 1.100.0 MSVC. Debug workspace tests, release retail smoke. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` on `e499bfc` reported 1426 passes, 0 failures, and 46 ignored. There were 26 explicit runner skips within the pass count. - `cargo test --offline --locked -p xcl --lib hle::dstorage:: -- --test-threads=1 --nocapture` passed 34/0/0 without skips in both the default and `XCL_DSTORAGE_PARALLEL_DECOMPRESS=1` runs. Both event-wakeup tests timed out on the baseline X1 vtable stub. - `cargo build --offline --locked --release -p xcl` succeeded. `scripts/smoke.ps1` ran the same title offline for 60 seconds per arm with direct DXIL and matching cache seeds. **Regression run** Main ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 493 (PresentX 493) presents per 2 s (last 3): 12 13 8 device removals: 0 crashes: 0 peak commit: 15495 MB ``` PR head ``` xcl-smoke v1 commit: e499bfcabacc8dd57acb7d517a612648f157a5eb gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 743 (PresentX 744) presents per 2 s (last 3): 2 19 18 device removals: 0 crashes: 0 peak commit: 14726 MB ``` **Not tested** - Whether the retail title reaches the X1 slot during world load. The ordering and handle checks use synthetic reads. Wine and AMD or Intel GPU coverage remain unmeasured. **AI use** Yes, Codex GPT-6.2 Sol implemented and independently reviewed the patch, ran the tests, and prepared this description.
Implement the X1 event marker at slot 12. A queue retains a duplicate
handle until prior requests have retired, then signals or discards it
with the rest of its ordered notifications.

Both schedulers pass the real-vtable completion tests. The baseline slot
times out on the event wait.

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

@⁠DavidM1911 on GitHub · 2026-11-25 23:28 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.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 23:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2569#issuecomment-7177616239) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
Author
Owner

@⁠xpatfussy69x on GitHub · 2026-11-26 00:01 UTC · original

Test run on exact head e499bfc (e499bfcabacc8dd57acb7d517a612648f157a5eb, on its base e1d84b7), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1426 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too)
  • cargo test -p xcl --lib completion_event: 3 passed, 0 failed
  • This PR's new tests in the workspace run:
    • completion_event_auto_submits_a_half_full_sequential_queue: ok
    • completion_event_waits_for_parallel_retirement_and_keeps_its_handle: ok
    • completion_event_close_discards_the_pending_marker: ok

Regression run (60 s, default settings, a retail title)

main:

xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1571 (PresentX 1571)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14042 MB

this PR:

xcl-smoke v1
commit: e499bfcabacc8dd57acb7d517a612648f157a5eb
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1653 (PresentX 1653)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14071 MB

No crash or device removal; frames 105 % of main's, peak commit 100 %. The main run is on current main (08db802), newer than this PR's base.

Not tested

  • Whether the title waits on a DirectStorage completion event in this run; load time was not measured: a regression check only
  • The PR merged into current main (tested on its own base; it merges into 08db802 without conflicts)
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
**@⁠xpatfussy69x** on GitHub · 2026-11-26 00:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2569#issuecomment-7178320627) Test run on exact head `e499bfc` (`e499bfcabacc8dd57acb7d517a612648f157a5eb`, on its base `e1d84b7`), clean tree. **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs - `cargo test --workspace -- --test-threads=4`: 1426 passed, 0 failed, 46 ignored - SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (on `main` too) - `cargo test -p xcl --lib completion_event`: 3 passed, 0 failed - This PR's new tests in the workspace run: - `completion_event_auto_submits_a_half_full_sequential_queue`: ok - `completion_event_waits_for_parallel_retirement_and_keeps_its_handle`: ok - `completion_event_close_discards_the_pending_marker`: ok **Regression run** (60 s, default settings, a retail title) main: ``` xcl-smoke v1 commit: 08db8020d323bf478964fcc586152cce54959cfc gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1571 (PresentX 1571) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14042 MB ``` this PR: ``` xcl-smoke v1 commit: e499bfcabacc8dd57acb7d517a612648f157a5eb gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1653 (PresentX 1653) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14071 MB ``` No crash or device removal; frames 105 % of `main`'s, peak commit 100 %. The `main` run is on current `main` (`08db802`), newer than this PR's base. **Not tested** - Whether the title waits on a DirectStorage completion event in this run; load time was not measured: a regression check only - The PR merged into current `main` (tested on its own base; it merges into `08db802` without conflicts) - AMD / native wave64 **AI use** - Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
Author
Owner

@⁠ramon-victor on GitHub · 2026-11-26 00:09 UTC · original

Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head e499bfcabacc8dd57acb7d517a612648f157a5eb (clean detached checkout, no local changes).

Tested

  • Hardware & toolchain: NVIDIA GeForce RTX 3070 8 GiB (wave32, driver 621.24), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (build 26300), Rust 1.99.0 (x86_64-pc-windows-msvc), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug tests, release smoke.
  • Targeted PR tests (cargo test -p xcl --lib completion_event): 3 passed, 0 failed (completion_event_close_discards_the_pending_marker, completion_event_auto_submits_a_half_full_sequential_queue, completion_event_waits_for_parallel_retirement_and_keeps_its_handle).
  • Full workspace (.\scripts\test.ps1): 1426 passed, 0 failed, 46 ignored (25 GPU skips expected on this wave32 adapter: 21 no wave64, 1 no heap windows, 3 wave32 per-lane refused for #1426 f16/f32 semantics).
  • Release build (cargo build --release -p xcl) and 60 s retail smoke run (XCL_NETWORK=0, compared against main @ 08db802 baseline on the same machine today: 1605 frames, 15009 MB peak commit, 0 crashes, 0 device removals):

Regression run

xcl-smoke v1
commit: e499bfcabacc8dd57acb7d517a612648f157a5eb
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1625 (PresentX 1625)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15102 MB

Not tested

  • AMD / Intel GPUs and wave64-only GPU tests (skipped on RTX 3070); XCL_SAMPLE_* tests (unset).

AI use

  • Antigravity (Gemini 4 Neon) ran the build, test suite, and smoke run and drafted this report.
**@⁠ramon-victor** on GitHub · 2026-11-26 00:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2569#issuecomment-7178455340) Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head `e499bfcabacc8dd57acb7d517a612648f157a5eb` (clean detached checkout, no local changes). **Tested** - Hardware & toolchain: NVIDIA GeForce RTX 3070 8 GiB (wave32, driver 621.24), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (build 26300), Rust 1.99.0 (`x86_64-pc-windows-msvc`), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug tests, release smoke. - Targeted PR tests (`cargo test -p xcl --lib completion_event`): **3 passed, 0 failed** (`completion_event_close_discards_the_pending_marker`, `completion_event_auto_submits_a_half_full_sequential_queue`, `completion_event_waits_for_parallel_retirement_and_keeps_its_handle`). - Full workspace (`.\scripts\test.ps1`): **1426 passed, 0 failed, 46 ignored** (25 GPU skips expected on this wave32 adapter: 21 `no wave64`, 1 `no heap windows`, 3 wave32 per-lane refused for `#1426` f16/f32 semantics). - Release build (`cargo build --release -p xcl`) and 60 s retail smoke run (`XCL_NETWORK=0`, compared against `main @ 08db802` baseline on the same machine today: `1605` frames, `15009 MB` peak commit, `0` crashes, `0` device removals): **Regression run** ``` xcl-smoke v1 commit: e499bfcabacc8dd57acb7d517a612648f157a5eb gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1625 (PresentX 1625) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15102 MB ``` **Not tested** - AMD / Intel GPUs and wave64-only GPU tests (skipped on RTX 3070); `XCL_SAMPLE_*` tests (unset). **AI use** - Antigravity (Gemini 4 Neon) ran the build, test suite, and smoke run and drafted this report.
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/2569/head:github-bot/gh-2569'
git switch 'github-bot/gh-2569'

Merge

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