startup: implement next command-list slot in d3d12_xs_device (Part of #870) #2060

Closed
tedin7 wants to merge 3 commits from upstream-pr/2067 into main
tedin7 commented 2026-11-24 23:57:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:57:55Z.


Part of #870

What this unblocks: a title that binds stream-output buffers (command list slot 49, SOSetTargets) no longer falls to the no-op stub, so later draws can start using the bindings.

Records up to four stream-output views per list (desktop SOSetTargets order, slot 45 + 4). A null view array unbinds the named slots. A call that does not fit in four slots, or an unreadable array, is refused and logged, and the old bindings stay. Draws do not write stream output yet. The rules live in src/startup_stubs/stream_output_targets.h (no Windows types) with a unit test.

Verification:

  • g++ -std=c++17 -Wall -Isrc -o /tmp/so_test tests/startup_stream_output_targets_check.cpp && /tmp/so_test (Linux host) -> startup_stream_output_targets: ok
  • git diff --check -> clean
  • Win2025: NOT run. The d3d12_xs_device.cpp / d3d12_draw.inl change is not compiled yet, and slot 49 has no call-site confirmation (it is the shifted desktop slot, between confirmed slots 48 and 50). Needs a Win2025 build and ctest -R startup_stream_output_targets before merge.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593911599 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:57:55Z. --- Part of #870 What this unblocks: a title that binds stream-output buffers (command list slot 49, SOSetTargets) no longer falls to the no-op stub, so later draws can start using the bindings. Records up to four stream-output views per list (desktop SOSetTargets order, slot 45 + 4). A null view array unbinds the named slots. A call that does not fit in four slots, or an unreadable array, is refused and logged, and the old bindings stay. Draws do not write stream output yet. The rules live in `src/startup_stubs/stream_output_targets.h` (no Windows types) with a unit test. Verification: - `g++ -std=c++17 -Wall -Isrc -o /tmp/so_test tests/startup_stream_output_targets_check.cpp && /tmp/so_test` (Linux host) -> `startup_stream_output_targets: ok` - `git diff --check` -> clean - Win2025: NOT run. The `d3d12_xs_device.cpp` / `d3d12_draw.inl` change is not compiled yet, and slot 49 has no call-site confirmation (it is the shifted desktop slot, between confirmed slots 48 and 50). Needs a Win2025 build and `ctest -R startup_stream_output_targets` before merge. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 01:02:01 +00:00 (Migrated from github.com)

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


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-25T00:07:26.782233Z d9c37bd 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:7148108580 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7148108580). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:04:27Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d9c37bd26e136e23f954032765306556380d8027","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-25T00:07:26.782233Z">2026-11-25T00:07:26.782233Z</relative-time> | `d9c37bd` | 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>
R0Y00 commented 2026-11-25 13:00:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T12:34:40Z.

Review: CHANGES_REQUESTED


The four-slot unit test checks the container, but the production vtable entry at slot 49 is still inferred from desktop ordering. Please keep that binding opt-in until there is independent evidence for the slot and argument shape. A source-built Windows call through the shim should distinguish bind, partial unbind and rejected ranges, with the retained state checked after rejection. Keep the wording scoped to recording the bindings until draw actually consumes them.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6057678666 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#pullrequestreview-6057678666). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T12:34:40Z. **Review:** CHANGES_REQUESTED --- The four-slot unit test checks the container, but the production vtable entry at slot 49 is still inferred from desktop ordering. Please keep that binding opt-in until there is independent evidence for the slot and argument shape. A source-built Windows call through the shim should distinguish bind, partial unbind and rejected ranges, with the retained state checked after rejection. Keep the wording scoped to recording the bindings until draw actually consumes them.
tedin7 commented 2026-11-25 14:05:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:39:41Z.


Fixed in fb61f453: SOSetTargets at slot 49 is now opt-in, and the test now drives it through the production list vtable entry instead of the container alone. Head is now ef331bde (main merged in).

Windows Server 2025 WARP at ef331bde:

x2w_pipe.py win2025 2067
dev:     100% tests passed out of 25
release: 100% tests passed out of 25

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164103289 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7164103289). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:39:41Z. --- Fixed in fb61f453: SOSetTargets at slot 49 is now opt-in, and the test now drives it through the production list vtable entry instead of the container alone. Head is now ef331bde (main merged in). Windows Server 2025 WARP at ef331bde: ``` x2w_pipe.py win2025 2067 dev: 100% tests passed out of 25 release: 100% tests passed out of 25 ``` AI-assisted; commands listed were executed locally.
Makto94 commented 2026-11-25 17:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T16:38:37Z.


Hardware run and Windows 11 MSVC build at head ef331bde.

Environment: Windows 11 Pro build 26300.9974, Debug (dev preset), MSVC 19.44.35230.0 (cl 14.44.35207), driver 32.0.16.2101. The test does not print the adapter name; the only hardware adapter in this machine is an NVIDIA GeForce RTX 3070 Ti. The D3D12 debug layer was off (X2W_D3D12_DEBUG not set). The runs were serial (-j1); the hardware run was on an idle machine.

Build: cmake --build --preset dev exited 0. No warning comes from the files changed by this PR.

Tests:

  • ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output' -E 'hardware' -V: 3/3 passed (startup_stream_output_slot_warp_on, _warp_off, startup_stream_output_targets).
  • ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output_slot_hardware' -V: 2/2 passed (_hardware_on, _hardware_off). 0 capability skips (77).

Slot 49 (SOSetTargets) with X2W_D3D12_SO_TARGETS=1: start 1, count 2 binds 2; start 3 count 2, start 4 count 1 and start 0 count 5 are refused; GetDeviceRemovedReason returns 0; the test prints stream output slot 49 (on): bound 2 of 4, device OK. Without the variable the call reaches the no-op stub and the test prints bound 0 of 4, device OK. The _warp_* and _hardware_* tests print the same lines.

Not covered by this run: draws that consume the bindings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7168307341 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7168307341). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T16:38:37Z. --- Hardware run and Windows 11 MSVC build at head `ef331bde`. Environment: Windows 11 Pro build 26300.9974, Debug (`dev` preset), MSVC 19.44.35230.0 (cl 14.44.35207), driver 32.0.16.2101. The test does not print the adapter name; the only hardware adapter in this machine is an NVIDIA GeForce RTX 3070 Ti. The D3D12 debug layer was off (`X2W_D3D12_DEBUG` not set). The runs were serial (`-j1`); the hardware run was on an idle machine. Build: `cmake --build --preset dev` exited 0. No warning comes from the files changed by this PR. Tests: - `ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output' -E 'hardware' -V`: 3/3 passed (`startup_stream_output_slot_warp_on`, `_warp_off`, `startup_stream_output_targets`). - `ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output_slot_hardware' -V`: 2/2 passed (`_hardware_on`, `_hardware_off`). 0 capability skips (77). Slot 49 (`SOSetTargets`) with `X2W_D3D12_SO_TARGETS=1`: start 1, count 2 binds 2; start 3 count 2, start 4 count 1 and start 0 count 5 are refused; `GetDeviceRemovedReason` returns 0; the test prints `stream output slot 49 (on): bound 2 of 4, device OK`. Without the variable the call reaches the no-op stub and the test prints `bound 0 of 4, device OK`. The `_warp_*` and `_hardware_*` tests print the same lines. Not covered by this run: draws that consume the bindings.
Makto94 commented 2026-11-25 17:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T16:38:46Z.


Hardware run and Windows 11 MSVC build at head ef331bde.

Environment: Windows 11 Pro build 26300.9974, Debug (dev preset), MSVC 19.44.35230.0 (cl 14.44.35207), driver 32.0.16.2101. The test does not print the adapter name; the only hardware adapter in this machine is an NVIDIA GeForce RTX 3070 Ti. The D3D12 debug layer was off (X2W_D3D12_DEBUG not set). The runs were serial (-j1); the hardware run was on an idle machine.

Build: cmake --build --preset dev exited 0. No warning comes from the files changed by this PR.

Tests:

  • ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output' -E 'hardware' -V: 3/3 passed (startup_stream_output_slot_warp_on, _warp_off, startup_stream_output_targets).
  • ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output_slot_hardware' -V: 2/2 passed (_hardware_on, _hardware_off). 0 capability skips (77).

Slot 49 (SOSetTargets) with X2W_D3D12_SO_TARGETS=1: start 1, count 2 binds 2; start 3 count 2, start 4 count 1 and start 0 count 5 are refused; GetDeviceRemovedReason returns 0; the test prints stream output slot 49 (on): bound 2 of 4, device OK. Without the variable the call reaches the no-op stub and the test prints bound 0 of 4, device OK. The _warp_* and _hardware_* tests print the same lines.

Not covered by this run: draws that consume the bindings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7168311570 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7168311570). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T16:38:46Z. --- Hardware run and Windows 11 MSVC build at head `ef331bde`. Environment: Windows 11 Pro build 26300.9974, Debug (`dev` preset), MSVC 19.44.35230.0 (cl 14.44.35207), driver 32.0.16.2101. The test does not print the adapter name; the only hardware adapter in this machine is an NVIDIA GeForce RTX 3070 Ti. The D3D12 debug layer was off (`X2W_D3D12_DEBUG` not set). The runs were serial (`-j1`); the hardware run was on an idle machine. Build: `cmake --build --preset dev` exited 0. No warning comes from the files changed by this PR. Tests: - `ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output' -E 'hardware' -V`: 3/3 passed (`startup_stream_output_slot_warp_on`, `_warp_off`, `startup_stream_output_targets`). - `ctest --preset dev --no-tests=error -j1 -R 'startup_stream_output_slot_hardware' -V`: 2/2 passed (`_hardware_on`, `_hardware_off`). 0 capability skips (77). Slot 49 (`SOSetTargets`) with `X2W_D3D12_SO_TARGETS=1`: start 1, count 2 binds 2; start 3 count 2, start 4 count 1 and start 0 count 5 are refused; `GetDeviceRemovedReason` returns 0; the test prints `stream output slot 49 (on): bound 2 of 4, device OK`. Without the variable the call reaches the no-op stub and the test prints `bound 0 of 4, device OK`. The `_warp_*` and `_hardware_*` tests print the same lines. Not covered by this run: draws that consume the bindings.
tedin7 commented 2026-11-25 17:01:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:43:00Z.


Thanks @Makto94, this is a useful hardware data point for head ef331bde.

It confirms on an RTX 3070 Ti (Windows 11, MSVC 19.44, Debug) what the WARP runs showed: slot 49 SOSetTargets with X2W_D3D12_SO_TARGETS=1 binds the valid range (start 1, count 2) and refuses the three out-of-range calls without removing the device, and with the variable unset the call stays on the no-op stub. 5/5 startup_stream_output* tests passed, 0 capability skips.

Agreed on the gap you note: no draw consumes the bindings yet. That belongs with the slice that wires stream-output draws, not this one.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7168421374 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7168421374). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:43:00Z. --- Thanks @Makto94, this is a useful hardware data point for head `ef331bde`. It confirms on an RTX 3070 Ti (Windows 11, MSVC 19.44, Debug) what the WARP runs showed: slot 49 `SOSetTargets` with `X2W_D3D12_SO_TARGETS=1` binds the valid range (start 1, count 2) and refuses the three out-of-range calls without removing the device, and with the variable unset the call stays on the no-op stub. 5/5 `startup_stream_output*` tests passed, 0 capability skips. Agreed on the gap you note: no draw consumes the bindings yet. That belongs with the slice that wires stream-output draws, not this one. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 19:04:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:30:24Z.


@R0Y00 the changes you requested are addressed on the current head ef331bde4d7153e962c67db1a4f4bddb0e37de37 (see our reply above). Could you re-review, or dismiss the change request if it is resolved? Under the new scope, MasterDomino can then review and merge it.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171000096 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7171000096). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T18:30:24Z. --- @R0Y00 the changes you requested are addressed on the current head `ef331bde4d7153e962c67db1a4f4bddb0e37de37` (see our reply above). Could you re-review, or dismiss the change request if it is resolved? Under the new scope, MasterDomino can then review and merge it. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 22:01:50 +00:00
tedin7 commented 2026-11-25 22:02:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T21:33:37Z.


Closing this PR for now so we can focus on the test-speed work. The branch stays as it is, and review comments here remain valid.

We will reopen it later, bring it up to date with main, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7175238776 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2067#issuecomment-7175238776). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T21:33:37Z. --- Closing this PR for now so we can focus on the test-speed work. The branch stays as it is, and review comments here remain valid. We will reopen it later, bring it up to date with `main`, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.

Pull request closed

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!2060
No description provided.