runtime: make XApu typed completions opt-in #2260

Merged
R0Y00 merged 1 commit from upstream-pr/2268 into main 2026-11-25 09:01:45 +00:00
R0Y00 commented 2026-11-25 08:57:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T08:57:13Z.


Refs #1887 and #870. Two independent Windows hosts stopped on a null-destination copy shortly after the first XApu dequeue that reported typed fields. Their matched local reverts of #2242 advanced past the stop (Windows 10, Windows 11). The reports establish a regression with #2242. The downstream caller and its missing output contract still need to be traced.

The permissive path again retires one entry and writes a zeroed result by default. X2W_XAPU_TYPED_COMPLETIONS=1 selects the existing type/slot experiment explicitly. The bounded FIFO, command and result pointer checks, and strict traps stay in place.

Windows Release on build 26200.9974, using the source-built caller:

cmake --build --preset release --target startup_xapu_queue_check cpu_xapu_queue_caller cpu_xapu_queue_provider_lenient cpu_xapu_queue_provider_lifo pe_map
ctest --preset release --no-tests=error -R '^(startup_xapu_queue|cpu_native_xapu_queue)$' -V

2/2 passed. The new default-mode check enqueues an open command with nonzero type and slot, verifies an all-zero result and count 1 to 0, and checks that an empty dequeue preserves its sentinel. The previous typed FIFO, cap and pointer controls still run after opt-in. The same executable run against the pre-fix xapu.dll failed exactly the new default assertion (exit 1). This change awaits a matched application replay with the option unset.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6600808839 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2268). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T08:57:13Z. --- Refs #1887 and #870. Two independent Windows hosts stopped on a null-destination copy shortly after the first XApu dequeue that reported typed fields. Their matched local reverts of #2242 advanced past the stop ([Windows 10](https://github.com/R0Y00/Xbox2Windows/issues/1887#issuecomment-7156675524), [Windows 11](https://github.com/R0Y00/Xbox2Windows/issues/1887#issuecomment-7157496040)). The reports establish a regression with #2242. The downstream caller and its missing output contract still need to be traced. The permissive path again retires one entry and writes a zeroed result by default. `X2W_XAPU_TYPED_COMPLETIONS=1` selects the existing type/slot experiment explicitly. The bounded FIFO, command and result pointer checks, and strict traps stay in place. Windows Release on build 26200.9974, using the source-built caller: ```powershell cmake --build --preset release --target startup_xapu_queue_check cpu_xapu_queue_caller cpu_xapu_queue_provider_lenient cpu_xapu_queue_provider_lifo pe_map ctest --preset release --no-tests=error -R '^(startup_xapu_queue|cpu_native_xapu_queue)$' -V ``` 2/2 passed. The new default-mode check enqueues an open command with nonzero type and slot, verifies an all-zero result and count 1 to 0, and checks that an empty dequeue preserves its sentinel. The previous typed FIFO, cap and pointer controls still run after opt-in. The same executable run against the pre-fix xapu.dll failed exactly the new default assertion (exit 1). This change awaits a matched application replay with the option unset.
tedin7 commented 2026-11-25 08:59:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T08:59:20Z.

Review: COMMENTED


Review of head cb81521e6a977b9eebcf1e3304a8a5fe010fafa0 (3 files: src/startup_stubs/xapu.cpp, tests/startup_xapu_queue_check.cpp, docs/startup-runtime.md).

Summary: The change is small and correct for what it claims. XApuDequeueResult still retires one entry and zeroes 0x58 bytes. The type/slot echo now sits behind x2w_local::env_on("X2W_XAPU_TYPED_COMPLETIONS"). env_on is read on each call, so the test can flip the variable at run time. The default-mode block in the test (open cmd type 1 / slot 7: zero result, count 1 to 0, empty dequeue keeps sentinel) covers the new default. The later typed-FIFO checks run after the explicit opt-in, so the old coverage is kept.

Commands run locally (Linux worktree at this head):

  • git diff --stat origin/main...HEAD: 3 files, +24/-10
  • python3 tests/docs_links_check.py: Self-test passed. Checked 18 Markdown files and 433 links.
  • python3 tests/bidi_controls_check.py: Checked 1562 tracked files, no bidirectional controls.
  • git diff --check origin/main...HEAD: clean
  • gh pr checks: Linux Python checks pass. Windows build and gfx1013 jobs were still pending when I looked. Mergeable. The title is neutral.

Not run: the C++ targets (startup_xapu_queue, cpu_native_xapu_queue) need MSVC/Windows. I did not run a mutation (for example, removing the env_on guard) because it cannot be built on Linux. By reading, dropping the guard would fail the new "default: ... all_zero" assertion. The PR body reports the same result against the pre-fix DLL. I did not queue a Windows VM run: the change touches no gfx2hlsl/shader code, and the PR reports a Windows Release run on build 26200.9974.

Findings:

  • P1: none.
  • P2: none.
  • nit (docs/startup-runtime.md:~1108): the Switches table lists X2W_AUDIO_PERMISSIVE but not the new X2W_XAPU_TYPED_COMPLETIONS. It is only described in prose near line 1996. Add a row so the opt-in is discoverable with the other switches.
  • nit (docs/startup-runtime.md:~1996-2002): the sentence "An empty queue returns..." now starts on a short, broken line. This is cosmetic. Re-wrap the paragraph.
  • note: the PR body says the downstream caller and its missing output contract are still untraced. That is honest, and the default-off choice is a fair stopgap. Keep #1887 open until a matched replay with the option unset confirms it.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6054524453 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2268#pullrequestreview-6054524453). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T08:59:20Z. **Review:** COMMENTED --- Review of head `cb81521e6a977b9eebcf1e3304a8a5fe010fafa0` (3 files: `src/startup_stubs/xapu.cpp`, `tests/startup_xapu_queue_check.cpp`, `docs/startup-runtime.md`). **Summary:** The change is small and correct for what it claims. `XApuDequeueResult` still retires one entry and zeroes 0x58 bytes. The type/slot echo now sits behind `x2w_local::env_on("X2W_XAPU_TYPED_COMPLETIONS")`. `env_on` is read on each call, so the test can flip the variable at run time. The default-mode block in the test (open cmd type 1 / slot 7: zero result, count 1 to 0, empty dequeue keeps sentinel) covers the new default. The later typed-FIFO checks run after the explicit opt-in, so the old coverage is kept. **Commands run locally (Linux worktree at this head):** - `git diff --stat origin/main...HEAD`: 3 files, +24/-10 - `python3 tests/docs_links_check.py`: Self-test passed. Checked 18 Markdown files and 433 links. - `python3 tests/bidi_controls_check.py`: Checked 1562 tracked files, no bidirectional controls. - `git diff --check origin/main...HEAD`: clean - `gh pr checks`: Linux Python checks pass. Windows build and gfx1013 jobs were still pending when I looked. Mergeable. The title is neutral. **Not run:** the C++ targets (`startup_xapu_queue`, `cpu_native_xapu_queue`) need MSVC/Windows. I did not run a mutation (for example, removing the `env_on` guard) because it cannot be built on Linux. By reading, dropping the guard would fail the new "default: ... all_zero" assertion. The PR body reports the same result against the pre-fix DLL. I did not queue a Windows VM run: the change touches no gfx2hlsl/shader code, and the PR reports a Windows Release run on build 26200.9974. **Findings:** - P1: none. - P2: none. - nit (`docs/startup-runtime.md:~1108`): the Switches table lists `X2W_AUDIO_PERMISSIVE` but not the new `X2W_XAPU_TYPED_COMPLETIONS`. It is only described in prose near line 1996. Add a row so the opt-in is discoverable with the other switches. - nit (`docs/startup-runtime.md:~1996-2002`): the sentence "An empty queue returns..." now starts on a short, broken line. This is cosmetic. Re-wrap the paragraph. - note: the PR body says the downstream caller and its missing output contract are still untraced. That is honest, and the default-off choice is a fair stopgap. Keep #1887 open until a matched replay with the option unset confirms it. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 09:04:10 +00:00
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!2260
No description provided.