startup: run GPU-counted indirect Dispatch records through slot 61 #2181

Manually merged
github merged 6 commits from gh-pr/2181/head into gh-pr/2181/base 2026-11-27 00:03:30 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-25 03:02 UTC · original
tedin7:x2w-w4-1759-exec-indirect → main · +152 −14 · 4 files · 6 commits · merged 2026-11-25 04:45 UTC

Part of #1759

What this unblocks: ExecuteIndirect through guest slot 61 can now run several desktop Dispatch records, with the number executed taken from a GPU-written count word.

Changes:

  • Slot 61 accepts a maximum command count above one for a rootless desktop Dispatch signature, with or without a count buffer. The count word must be 4 bytes at a word-aligned offset in a unique placed buffer tracked from COMMON. Every record up to the maximum must fit in the argument buffer.
  • Each refusal names its reason: zero count, count offset without a buffer, unmapped or unaligned count word, records past the buffer end. Graphics signatures keep the one-command, no-count-buffer rule.
  • New count mode in tests/startup_indirect_dispatch.cpp (ctest startup_indirect_count_{warp,hardware}): a GPU writer stores the count word and three distinct Dispatch records. Cases: count 2, count 9 (clamped to the max of 3), count 0, omitted writer, no count buffer with a zero word (all three run), unmapped argument, count word outside the buffer, unaligned count offset, short record range, placeholder signature. Results are compared word by word against a CPU reference.
  • docs/experiments.md: new section with the layout and commands.

Verification:

  • Linux: python3 -B tests/docs_links_check.py -> PASS. Linux CI jobs (fixtures, Python checks) pass.
  • Win2025 (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), head b74bf16c, via python3 x2w_pipe.py win2025 2181 --force (default 3-slot pool):
    • Debug (--preset dev): build 80.51s, ctest --preset dev on the 24 WARP/startup tests (including startup_indirect_dispatch_warp, startup_indirect_root_constants_warp, startup_indirect_count_warp): 24/24 passed, 0 skipped.
    • Release /O2 (--preset release): build 106.33s, same 24 tests: 24/24 passed, 0 skipped.
  • Not run: physical adapter (startup_indirect_count_hardware), and the fixture against the pre-change runtime.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 03:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181) `tedin7:x2w-w4-1759-exec-indirect` → `main` · +152 −14 · 4 files · 6 commits · merged 2026-11-25 04:45 UTC Part of #1759 What this unblocks: ExecuteIndirect through guest slot 61 can now run several desktop Dispatch records, with the number executed taken from a GPU-written count word. Changes: - Slot 61 accepts a maximum command count above one for a rootless desktop Dispatch signature, with or without a count buffer. The count word must be 4 bytes at a word-aligned offset in a unique placed buffer tracked from `COMMON`. Every record up to the maximum must fit in the argument buffer. - Each refusal names its reason: zero count, count offset without a buffer, unmapped or unaligned count word, records past the buffer end. Graphics signatures keep the one-command, no-count-buffer rule. - New `count` mode in `tests/startup_indirect_dispatch.cpp` (ctest `startup_indirect_count_{warp,hardware}`): a GPU writer stores the count word and three distinct Dispatch records. Cases: count 2, count 9 (clamped to the max of 3), count 0, omitted writer, no count buffer with a zero word (all three run), unmapped argument, count word outside the buffer, unaligned count offset, short record range, placeholder signature. Results are compared word by word against a CPU reference. - `docs/experiments.md`: new section with the layout and commands. Verification: - Linux: `python3 -B tests/docs_links_check.py` -> PASS. Linux CI jobs (fixtures, Python checks) pass. - Win2025 (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), head `b74bf16c`, via `python3 x2w_pipe.py win2025 2181 --force` (default 3-slot pool): - Debug (`--preset dev`): build 80.51s, `ctest --preset dev` on the 24 WARP/startup tests (including `startup_indirect_dispatch_warp`, `startup_indirect_root_constants_warp`, `startup_indirect_count_warp`): 24/24 passed, 0 skipped. - Release `/O2` (`--preset release`): build 106.33s, same 24 tests: 24/24 passed, 0 skipped. - Not run: physical adapter (`startup_indirect_count_hardware`), and the fixture against the pre-change runtime. AI-assisted; commands listed were executed locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:03:29 +00:00
github manually merged commit 1427cdcc4c into gh-pr/2181/base 2026-11-27 00:03:30 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 03:45 UTC · original · edited 2026-11-25 03:49 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T03:49:05.372240Z b74bf16 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 03:45 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#issuecomment-7152208777) · edited 2026-11-25 03:49 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"b74bf16c1ac686bb42613b78d1b2981781446e6c","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T03:49:05.372240Z">2026-11-25T03:49:05.372240Z</relative-time> | `b74bf16` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 04:25 UTC · original

Fixed in 024cd7a1.

  • Scope check: a Dispatch signature with root constants now stays single-command. In list_execute_indirect, a count above one or any count buffer is refused with a named reason, even when the signature root matches the bound root. Batched and count-buffer calls remain rootless-only.
  • Regression tests (startup_indirect_root_constants_*): a rooted two-record call and a rooted count-buffer call are both refused and leave the result untouched. The existing one-record root-constant success case still runs.
  • docs/experiments.md states the rule next to the slot 61 description.

Verification:

  • python3 tests/docs_links_check.py: passed (18 files, 405 links).
  • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 2181 --force (3-slot pool): dev 24/24 passed, release 24/24 passed, no skips. This includes startup_indirect_dispatch_warp, startup_indirect_root_constants_warp and startup_indirect_count_warp. A first attempt hit an sccache server error during compile and was rerun unchanged.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 04:25 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#issuecomment-7152833473) Fixed in 024cd7a1. - Scope check: a Dispatch signature with root constants now stays single-command. In `list_execute_indirect`, a count above one or any count buffer is refused with a named reason, even when the signature root matches the bound root. Batched and count-buffer calls remain rootless-only. - Regression tests (`startup_indirect_root_constants_*`): a rooted two-record call and a rooted count-buffer call are both refused and leave the result untouched. The existing one-record root-constant success case still runs. - `docs/experiments.md` states the rule next to the slot 61 description. Verification: - `python3 tests/docs_links_check.py`: passed (18 files, 405 links). - `python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 2181 --force` (3-slot pool): dev 24/24 passed, release 24/24 passed, no skips. This includes `startup_indirect_dispatch_warp`, `startup_indirect_root_constants_warp` and `startup_indirect_count_warp`. A first attempt hit an sccache server error during compile and was rerun unchanged. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 04:09 UTC · original · requested changes

Windows Release passed the 11 selected WARP and RTX indirect tests. One scope check is still missing. The PR describes batched/count-buffer support for rootless Dispatch only, but the new one-command gate checks only the graphics flag. A Dispatch signature with root constants can follow the same batched path whenever its root matches the bound root. Please keep that shape single-command for this slice and test both a rooted multi-record call and a rooted count-buffer call as refusals, alongside the existing successful one-record root-constant case.

**@⁠R0Y00** on GitHub · 2026-11-25 04:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051733691) · **requested changes** Windows Release passed the 11 selected WARP and RTX indirect tests. One scope check is still missing. The PR describes batched/count-buffer support for rootless Dispatch only, but the new one-command gate checks only the graphics flag. A Dispatch signature with root constants can follow the same batched path whenever its root matches the bound root. Please keep that shape single-command for this slice and test both a rooted multi-record call and a rooted count-buffer call as refusals, alongside the existing successful one-record root-constant case.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 04:33 UTC · original · approved these changes

Re-reviewed 024cd7a1. The new check rejects a rooted Dispatch with multiple records or a count buffer before executing it. All 13 relevant Windows Release cases passed independently, including the root-constant controls on WARP and hardware.

**@⁠R0Y00** on GitHub · 2026-11-25 04:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051896857) · **approved these changes** Re-reviewed 024cd7a1. The new check rejects a rooted Dispatch with multiple records or a count buffer before executing it. All 13 relevant Windows Release cases passed independently, including the root-constant controls on WARP and hardware.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 04:35 UTC · original · requested changes

Follow-up on the 13/13 run: the two-record control still allocates only one full rooted argument record. It can pass through the older span check even with the new rootless-only guard removed. Keep the production guard and give the control two complete 20-byte records with a nonzero second record. I have a source-built version of that control and will validate it against this head.

**@⁠R0Y00** on GitHub · 2026-11-25 04:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051913176) · **requested changes** Follow-up on the 13/13 run: the two-record control still allocates only one full rooted argument record. It can pass through the older span check even with the new rootless-only guard removed. Keep the production guard and give the control two complete 20-byte records with a nonzero second record. I have a source-built version of that control and will validate it against this head.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 04:37 UTC · original · approved these changes

Verified 1427cdcc after extending the controls. The two-record case now has two complete rooted Dispatch records with a valid nonzero second record. The independent Windows Release run passed all 13 indirect-dispatch and adjacent cases, including WARP and hardware.

**@⁠R0Y00** on GitHub · 2026-11-25 04:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051924189) · **approved these changes** Verified 1427cdcc after extending the controls. The two-record case now has two complete rooted Dispatch records with a valid nonzero second record. The independent Windows Release run passed all 13 indirect-dispatch and adjacent cases, including WARP and hardware.
This discussion has been locked. Commenting is limited to contributors.
No description provided.