tests: handle serialized queues in the slot 148 acceptance client #2373

Merged
MasterDomino merged 2 commits from upstream-pr/2381 into main 2026-11-25 14:48:33 +00:00
MasterDomino commented 2026-11-25 14:29:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T14:29:42Z.


Refs #2210

What

The slot 148 acceptance client now detects adapters whose queues are serialized. On those it skips only the held-phase observer reads, says so in its output, and still runs every other check. It also always opens its gate and drains both queues before it returns.

startup_slot148_acceptance_serialized{,_nodebug}_{warp,hardware} force that path with X2W_TEST_FORCE_SERIALIZED_QUEUES=1, so it is tested on adapters whose queues do make progress.

The change is test-only. Nothing in src/ changes.

Why

Jess-Doit reported a failure on Windows 10 build 19045, in-box WARP 10.0.19041, main b7707495:

  • startup_slot148_acceptance_nodebug_warp waited the full 10 s and exited 18 in 4 of 4 runs.
  • In 2 of those runs the process then crashed on exit.
  • The same WARP with the debug layer, and a GTX 1060 with and without it, passed.

In the held phase, the observer queue reads A and B while the console queue waits on an unsignalled gate. If the adapter does not let the observer queue progress during that wait, the read cannot finish until the gate opens, so the client times out.

Measured here: I have no Windows 10 machine. I simulated serialized queues locally (method under Results): while a console gate is closed, every other desktop queue first waits on that gate before it executes. Under that simulation, the client from main exits 18 after about 10 s, which reproduces the report.

Still a hypothesis: that Windows 10 WARP 10.0.19041 without the debug layer behaves this way.

Changes

  • Preflight. Before the steps, the console queue waits on an unsignalled fence while the observer reads the 640-byte sentinel, with a 1 s limit. The fence is then signalled and both queues drained.
    • The client prints one of two preflight lines:
      • preflight: the observer queue finished a read while the console queue waited on an unsignalled fence
      • preflight: the observer queue made no progress ...
    • If the read did not finish, it prints queues serialized: held-phase checks not applicable.
    • It then skips only the observer reads in fresh, allocator and overwrite. Each skipped step says queues serialized: held-phase observer read not applicable.
  • What still runs on a serialized adapter:
    • the traced shape;
    • refusal after Close;
    • the stale and foreign resolver checks;
    • the in-list readback staying zero while held, which is a CPU read and needs no second queue;
    • the console submissions not completing while held;
    • the in-list reads of A and B after the gate opens, including the overwrite control;
    • reuse, foreign and arguments, which do not hold a queue;
    • device state.
  • Result lines. The final line is slot 148 acceptance passed with skips: held-phase observer reads in fresh, allocator and overwrite (queues serialized); every other check ran.
    • The skip is keyed to the preflight result, or to the explicit test switch. It is never silent.
    • An adapter that passes the preflight and then stalls still fails with exit 18, now with the observer read did not finish within 10000 ms while the gate was closed.
  • Cleanup on every exit path.
    • The gate guard opens the gate and drains the console queue.
    • A failed run of a list drains the console queue.
    • The client's destructor drains the observer and console queues before releasing anything.
    • Each wait is bounded at 10 s. If a drain does not finish, the objects that work may still use are kept (leaked) rather than released.
  • Registration. The four existing tests are unchanged. The four new serialized variants use PASS_REGULAR_EXPRESSION "slot 148 acceptance passed with skips: held-phase observer reads"; that line is printed only on exit 0.

Results

Commit 8cfefa98 on main at ff06794b, Release preset.

ctest --preset release --no-tests=error -R '^startup_(slot148_acceptance|upload_arena|upload_lifetime|list_resubmit)' -V gives 20 of 20 passed, 0 skipped:

Test WARP RX 9070 XT
startup_slot148_acceptance_* (debug on) pass; preflight progressed pass; preflight progressed
startup_slot148_acceptance_nodebug_* pass; preflight progressed pass; preflight progressed
startup_slot148_acceptance_serialized_* (debug on) pass with skips listed pass with skips listed
startup_slot148_acceptance_serialized_nodebug_* pass with skips listed pass with skips listed
startup_list_resubmit_* (4 per adapter) pass pass
startup_upload_arena_*, startup_upload_lifetime_* pass pass

Every acceptance run reported 0 debug-layer errors and the device not removed.

Serialized-queue simulation (local harness, not in this PR). The harness builds the client unchanged and patches two things:

  • the console queue's slot 17 Wait, to record the gate;
  • desktop ID3D12CommandQueue::ExecuteCommandLists, so that any non-console queue first Waits on a recorded gate that is still closed.
Client Adapter Debug layer Exit Output
main WARP off 18 held-phase observer read timed out after about 10 s (the reported symptom)
main WARP on 2173 (0x87D) output cut off mid-run; the process died abruptly
main RX 9070 XT off 18 the desktop device reported DXGI_ERROR_DEVICE_HUNG (0x887a0006)
this PR WARP and RX 9070 XT on and off 0 preflight made no progress; queues serialized; passed with skips; 0 debug errors
this PR, simulation only after the preflight WARP on and off 18 preflight progressed, then the held read timed out; clean exit, 0 debug errors (2 runs each)

Notes on the simulation:

  • The run that hung the RX 9070 XT, and the abrupt WARP exit with the debug layer, may correspond to the crash on exit in the report. That is not established.
  • The client from main was not rerun on hardware, to avoid another GPU hang.

python -B tests/docs_links_check.py, python -B tests/bidi_controls_check.py and git diff ff06794b HEAD --check pass.

Commands

$env:Path = "C:\Program Files (x86)\Microsoft Visual Studio\Installer;$env:Path"
. .\tools\dev.ps1
cmake --preset release
cmake --build --preset release --target startup_slot148_acceptance startup_upload_arena startup_upload_lifetime startup_list_resubmit
ctest --preset release --no-tests=error -R '^startup_(slot148_acceptance|upload_arena|upload_lifetime|list_resubmit)' -V

Environment

  • Windows 11 build 26300, MSVC 19.44.35221.
  • WARP 10.0.26100.9818.
  • AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31044.16.
  • Debug layer through X2W_D3D12_DEBUG=1, and off with X2W_D3D12_DEBUG=0.

Skips

None in these runs. The serialized variants pass with the held-phase observer reads skipped by design, and their output lists those reads.

Requested rerun (Windows 10, WARP 10.0.19041)

@Jess-Doit, could you rerun this on the Windows 10 machine?

ctest --preset release --no-tests=error -R '^startup_slot148_acceptance_' -V

Expected, if the serialized-queue hypothesis holds:

  • startup_slot148_acceptance_nodebug_warp passes. Its output contains:
    • preflight: the observer queue made no progress while the console queue waited on an unsignalled fence
    • queues serialized: held-phase checks not applicable
    • three ... queues serialized: held-phase observer read not applicable lines
    • and ends with slot 148 acceptance passed with skips: held-phase observer reads in fresh, allocator and overwrite (queues serialized); every other check ran.
  • It should take about 1.5 s instead of 10 s, and it should not crash on exit.
  • startup_slot148_acceptance_warp (debug on) and the hardware variants pass. Each probably reports preflight: the observer queue finished a read ... and ends with slot 148 acceptance passed.
  • The four serialized variants pass with the skips listed.

If the nodebug WARP test still fails, please post the preflight line and the last ten lines of output. If the preflight reports progress and the test then exits 18 with the observer read did not finish within 10000 ms, the hypothesis is wrong for that WARP and the cause lies elsewhere.

Not covered

  • No run on Windows 10 or WARP 10.0.19041. The serialized case was measured only through the local simulation.
  • The cause of the reported crash on exit is not established. The bounded cleanup removes the paths where the client exited with the gate closed or work pending.
  • unified_buffer_paths_* was not run.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6606803563 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2381). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T14:29:42Z. --- Refs #2210 ## What The slot 148 acceptance client now detects adapters whose queues are serialized. On those it skips only the held-phase observer reads, says so in its output, and still runs every other check. It also always opens its gate and drains both queues before it returns. `startup_slot148_acceptance_serialized{,_nodebug}_{warp,hardware}` force that path with `X2W_TEST_FORCE_SERIALIZED_QUEUES=1`, so it is tested on adapters whose queues do make progress. The change is test-only. Nothing in `src/` changes. ## Why Jess-Doit reported a failure on Windows 10 build 19045, in-box WARP 10.0.19041, `main` `b7707495`: - `startup_slot148_acceptance_nodebug_warp` waited the full 10 s and exited 18 in 4 of 4 runs. - In 2 of those runs the process then crashed on exit. - The same WARP with the debug layer, and a GTX 1060 with and without it, passed. In the held phase, the observer queue reads A and B while the console queue waits on an unsignalled gate. If the adapter does not let the observer queue progress during that wait, the read cannot finish until the gate opens, so the client times out. **Measured here:** I have no Windows 10 machine. I simulated serialized queues locally (method under Results): while a console gate is closed, every other desktop queue first waits on that gate before it executes. Under that simulation, the client from `main` exits 18 after about 10 s, which reproduces the report. **Still a hypothesis:** that Windows 10 WARP 10.0.19041 without the debug layer behaves this way. ## Changes - **Preflight.** Before the steps, the console queue waits on an unsignalled fence while the observer reads the 640-byte sentinel, with a 1 s limit. The fence is then signalled and both queues drained. - The client prints one of two preflight lines: - `preflight: the observer queue finished a read while the console queue waited on an unsignalled fence` - `preflight: the observer queue made no progress ...` - If the read did not finish, it prints `queues serialized: held-phase checks not applicable`. - It then skips only the observer reads in `fresh`, `allocator` and `overwrite`. Each skipped step says `queues serialized: held-phase observer read not applicable`. - **What still runs on a serialized adapter:** - the traced shape; - refusal after Close; - the stale and foreign resolver checks; - the in-list readback staying zero while held, which is a CPU read and needs no second queue; - the console submissions not completing while held; - the in-list reads of A and B after the gate opens, including the overwrite control; - `reuse`, `foreign` and `arguments`, which do not hold a queue; - device state. - **Result lines.** The final line is `slot 148 acceptance passed with skips: held-phase observer reads in fresh, allocator and overwrite (queues serialized); every other check ran`. - The skip is keyed to the preflight result, or to the explicit test switch. It is never silent. - An adapter that passes the preflight and then stalls still fails with exit 18, now with `the observer read did not finish within 10000 ms while the gate was closed`. - **Cleanup on every exit path.** - The gate guard opens the gate and drains the console queue. - A failed run of a list drains the console queue. - The client's destructor drains the observer and console queues before releasing anything. - Each wait is bounded at 10 s. If a drain does not finish, the objects that work may still use are kept (leaked) rather than released. - **Registration.** The four existing tests are unchanged. The four new `serialized` variants use `PASS_REGULAR_EXPRESSION "slot 148 acceptance passed with skips: held-phase observer reads"`; that line is printed only on exit 0. ## Results Commit `8cfefa98` on `main` at `ff06794b`, Release preset. `ctest --preset release --no-tests=error -R '^startup_(slot148_acceptance|upload_arena|upload_lifetime|list_resubmit)' -V` gives 20 of 20 passed, 0 skipped: | Test | WARP | RX 9070 XT | |---|---|---| | `startup_slot148_acceptance_*` (debug on) | pass; preflight progressed | pass; preflight progressed | | `startup_slot148_acceptance_nodebug_*` | pass; preflight progressed | pass; preflight progressed | | `startup_slot148_acceptance_serialized_*` (debug on) | pass with skips listed | pass with skips listed | | `startup_slot148_acceptance_serialized_nodebug_*` | pass with skips listed | pass with skips listed | | `startup_list_resubmit_*` (4 per adapter) | pass | pass | | `startup_upload_arena_*`, `startup_upload_lifetime_*` | pass | pass | Every acceptance run reported 0 debug-layer errors and the device not removed. **Serialized-queue simulation (local harness, not in this PR).** The harness builds the client unchanged and patches two things: - the console queue's slot 17 Wait, to record the gate; - desktop `ID3D12CommandQueue::ExecuteCommandLists`, so that any non-console queue first Waits on a recorded gate that is still closed. | Client | Adapter | Debug layer | Exit | Output | |---|---|---|---|---| | `main` | WARP | off | 18 | held-phase observer read timed out after about 10 s (the reported symptom) | | `main` | WARP | on | 2173 (0x87D) | output cut off mid-run; the process died abruptly | | `main` | RX 9070 XT | off | 18 | the desktop device reported `DXGI_ERROR_DEVICE_HUNG` (0x887a0006) | | this PR | WARP and RX 9070 XT | on and off | 0 | preflight `made no progress`; `queues serialized`; passed with skips; 0 debug errors | | this PR, simulation only after the preflight | WARP | on and off | 18 | preflight progressed, then the held read timed out; clean exit, 0 debug errors (2 runs each) | Notes on the simulation: - The run that hung the RX 9070 XT, and the abrupt WARP exit with the debug layer, may correspond to the crash on exit in the report. That is not established. - The client from `main` was not rerun on hardware, to avoid another GPU hang. `python -B tests/docs_links_check.py`, `python -B tests/bidi_controls_check.py` and `git diff ff06794b HEAD --check` pass. ## Commands ```powershell $env:Path = "C:\Program Files (x86)\Microsoft Visual Studio\Installer;$env:Path" . .\tools\dev.ps1 cmake --preset release cmake --build --preset release --target startup_slot148_acceptance startup_upload_arena startup_upload_lifetime startup_list_resubmit ctest --preset release --no-tests=error -R '^startup_(slot148_acceptance|upload_arena|upload_lifetime|list_resubmit)' -V ``` ## Environment - Windows 11 build 26300, MSVC 19.44.35221. - WARP 10.0.26100.9818. - AMD Radeon RX 9070 XT (`1002:7550`), driver 32.0.31044.16. - Debug layer through `X2W_D3D12_DEBUG=1`, and off with `X2W_D3D12_DEBUG=0`. ## Skips None in these runs. The `serialized` variants pass with the held-phase observer reads skipped by design, and their output lists those reads. ## Requested rerun (Windows 10, WARP 10.0.19041) @Jess-Doit, could you rerun this on the Windows 10 machine? ```powershell ctest --preset release --no-tests=error -R '^startup_slot148_acceptance_' -V ``` Expected, if the serialized-queue hypothesis holds: - `startup_slot148_acceptance_nodebug_warp` passes. Its output contains: - `preflight: the observer queue made no progress while the console queue waited on an unsignalled fence` - `queues serialized: held-phase checks not applicable` - three `... queues serialized: held-phase observer read not applicable` lines - and ends with `slot 148 acceptance passed with skips: held-phase observer reads in fresh, allocator and overwrite (queues serialized); every other check ran`. - It should take about 1.5 s instead of 10 s, and it should not crash on exit. - `startup_slot148_acceptance_warp` (debug on) and the hardware variants pass. Each probably reports `preflight: the observer queue finished a read ...` and ends with `slot 148 acceptance passed`. - The four `serialized` variants pass with the skips listed. If the nodebug WARP test still fails, please post the preflight line and the last ten lines of output. If the preflight reports progress and the test then exits 18 with `the observer read did not finish within 10000 ms`, the hypothesis is wrong for that WARP and the cause lies elsewhere. ## Not covered - No run on Windows 10 or WARP 10.0.19041. The serialized case was measured only through the local simulation. - The cause of the reported crash on exit is not established. The bounded cleanup removes the paths where the client exited with the gate closed or work pending. - `unified_buffer_paths_*` was not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-25 15:01:53 +00:00
R0Y00 commented 2026-11-25 15:02:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:41:24Z.


I verified the eight Release variants on WARP and RTX 4060 Laptop. I also tightened the observer preflight: a fence timeout may take the serialized path only if the observer subsequently drains and reads the correct sentinel. Setup, wait and readback errors remain failures. In a temporary control build, I put a real fence wait on the observer queue. It stayed pending, drained after release and took the serialized path. Injecting an observer error instead failed the check. Both controls used source-built inputs. The original Windows 10 report still needs a rerun on that OS.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165663026 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2381#issuecomment-7165663026). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:41:24Z. --- I verified the eight Release variants on WARP and RTX 4060 Laptop. I also tightened the observer preflight: a fence timeout may take the serialized path only if the observer subsequently drains and reads the correct sentinel. Setup, wait and readback errors remain failures. In a temporary control build, I put a real fence wait on the observer queue. It stayed pending, drained after release and took the serialized path. Injecting an observer error instead failed the check. Both controls used source-built inputs. The original Windows 10 report still needs a rerun on that OS.
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
R0Y00/Xbox2Windows!2373
No description provided.