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

Merged
tedin7 merged 6 commits from upstream-pr/2181 into main 2026-11-25 04:45:40 +00:00
tedin7 commented 2026-11-25 03:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T03:02:18Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6596212612 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:02:18Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-25 04:04:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:45:11Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152208777 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#issuecomment-7152208777). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T03:45:11Z. --- <!-- 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>
upstream-sync closed this pull request 2026-11-25 05:04:46 +00:00
R0Y00 commented 2026-11-25 05:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T04:09:28Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051733691 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051733691). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T04:09:28Z. **Review:** CHANGES_REQUESTED --- 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 commented 2026-11-25 05:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T04:33:12Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051896857 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051896857). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T04:33:12Z. **Review:** APPROVED --- 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 commented 2026-11-25 05:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T04:35:33Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051913176 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051913176). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T04:35:33Z. **Review:** CHANGES_REQUESTED --- 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 commented 2026-11-25 05:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T04:37:06Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051924189 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#pullrequestreview-6051924189). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T04:37:06Z. **Review:** APPROVED --- 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.
tedin7 commented 2026-11-25 05:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:25:44Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152833473 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2181#issuecomment-7152833473). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T04:25:44Z. --- 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.
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!2173
No description provided.