startup: handle vertex fetch with invalid input layout in gfx2hlsl (Part of #1723) #1995

Merged
tedin7 merged 7 commits from upstream-pr/2002 into main 2026-11-26 01:02:03 +00:00
tedin7 commented 2026-11-24 22:55:31 +00:00 (Migrated from github.com)

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


Part of #1723

What this unblocks: Completes 3 graphics pipelines blocked on vertex fetch without an input layout.

Change

A stream vertex shader that starts with the fetch-routine call was refused whenever the pipeline had no input layout ("vertex stage calls a fetch routine and the pipeline declares no input layout"). The stand-in published nothing for a layout with zero elements, so that case and an unreadable layout looked the same.

  • The stand-in now publishes a layout declared with zero elements as ia1 0 (it is hashed into the cache key like any other layout).
  • gfx2hlsl.py accepts ia1 0. Each fetch record then has no source, and its registers are set to zero. No vertex-buffer slot or stride entry is requested for it.
  • A stream with no INPUT_LAYOUT subobject, or one that cannot be read, is refused exactly as before.

Shortcut: the zero default for an input without a vertex buffer is an assumption, not a measurement.

Verification

Executed locally (Linux, translator checks only; no Windows draw was run):

  • python3 tests/startup_stream_fetch_check.py on this branch: exit 0. The new case "an empty declared layout reads every fetched input as zero" passes, and all existing refusals (no layout, unwritten, masked write, bypassed write, wqm, exec_hi, slot 8, per-instance, format 10, record kind 7) still pass.
  • The same test file against origin/main: fails with unsupported: invalid input layout request at the new case.
  • Not run: the Win2025 draw run of startup_stream_fetch_check.py <consumer> <backend>; it needs the Windows build.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593061831 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:55:31Z. --- Part of #1723 What this unblocks: Completes 3 graphics pipelines blocked on vertex fetch without an input layout. ## Change A stream vertex shader that starts with the fetch-routine call was refused whenever the pipeline had no input layout ("vertex stage calls a fetch routine and the pipeline declares no input layout"). The stand-in published nothing for a layout with zero elements, so that case and an unreadable layout looked the same. - The stand-in now publishes a layout declared with zero elements as `ia1 0` (it is hashed into the cache key like any other layout). - `gfx2hlsl.py` accepts `ia1 0`. Each fetch record then has no source, and its registers are set to zero. No vertex-buffer slot or stride entry is requested for it. - A stream with no INPUT_LAYOUT subobject, or one that cannot be read, is refused exactly as before. Shortcut: the zero default for an input without a vertex buffer is an assumption, not a measurement. ## Verification Executed locally (Linux, translator checks only; no Windows draw was run): - `python3 tests/startup_stream_fetch_check.py` on this branch: exit 0. The new case "an empty declared layout reads every fetched input as zero" passes, and all existing refusals (no layout, unwritten, masked write, bypassed write, wqm, exec_hi, slot 8, per-instance, format 10, record kind 7) still pass. - The same test file against `origin/main`: fails with `unsupported: invalid input layout request` at the new case. - Not run: the Win2025 draw run of `startup_stream_fetch_check.py <consumer> <backend>`; it needs the Windows build. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 23:03:32 +00:00 (Migrated from github.com)

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

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2379a3cd0d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048764328 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#pullrequestreview-6048764328). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:00:45Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `2379a3cd0d` <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". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot commented 2026-11-24 23:03:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:57:17Z.


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-24T23:00:48.633840Z 2379a3c 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:7146840156 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7146840156). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T22:57:17Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"2379a3cd0d1f5f254f365bdb4837f21e5a4bcbfd","has_any_findings":true,"has_unresolved_findings":true,"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-24T23:00:48.633840Z">2026-11-24T23:00:48.633840Z</relative-time> | `2379a3c` | 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>
chatgpt-codex-connector[bot commented 2026-11-24 23:03:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:00:46Z.

Code review location: src/startup_stubs/d3d12_draw.inl; line 227

@@ -223,7 +223,10 @@ bool stream_input_layout(const unsigned char* subobject, std::string& text)
 {
     D3D12_INPUT_LAYOUT_DESC layout;
     std::memcpy(&layout, subobject + 8, sizeof(layout));
-    if (!layout.NumElements) return true;
+    if (!layout.NumElements) {
+        text = "ia1 0\n";  // declared without elements: the translation reads every fetched input as zero

P1 Badge Document the new empty-layout request contract

For a stream declaring NumElements == 0, this now publishes a hashed ia1 0 request and enables translation, but the public documentation remains unchanged. docs/startup-runtime.md:53–55 still says that only non-empty layouts affect the cache key, and its fetch description does not cover this zero-fill path. AGENTS.md requires updating the README or docs/experiments.md when a public capability changes. Document the explicit-empty versus absent/unreadable distinction, the unmeasured zero default, and the translator-only reproduction command, and correct the stale cache-key description so contributors can reproduce and interpret this behavior accurately.

AGENTS.md reference: AGENTS.md:L206-L207

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4687711545 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#discussion_r4687711545). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:00:46Z. **Code review location:** `src/startup_stubs/d3d12_draw.inl`; line 227 ~~~~diff @@ -223,7 +223,10 @@ bool stream_input_layout(const unsigned char* subobject, std::string& text) { D3D12_INPUT_LAYOUT_DESC layout; std::memcpy(&layout, subobject + 8, sizeof(layout)); - if (!layout.NumElements) return true; + if (!layout.NumElements) { + text = "ia1 0\n"; // declared without elements: the translation reads every fetched input as zero ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Document the new empty-layout request contract** For a stream declaring `NumElements == 0`, this now publishes a hashed `ia1 0` request and enables translation, but the public documentation remains unchanged. `docs/startup-runtime.md:53–55` still says that only non-empty layouts affect the cache key, and its fetch description does not cover this zero-fill path. `AGENTS.md` requires updating the README or `docs/experiments.md` when a public capability changes. Document the explicit-empty versus absent/unreadable distinction, the unmeasured zero default, and the translator-only reproduction command, and correct the stale cache-key description so contributors can reproduce and interpret this behavior accurately. AGENTS.md reference: [AGENTS.md:L206-L207](https://github.com/R0Y00/Xbox2Windows/blob/2379a3cd0d1f5f254f365bdb4837f21e5a4bcbfd/AGENTS.md#L206-L207) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-25 01:01:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:55:51Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049898968 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#pullrequestreview-6049898968). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:55:51Z. **Review:** COMMENTED --- _No description provided._
ChazY11 commented 2026-11-25 01:01:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:24:53Z.


The new behaviour is well covered — four mutations caught — but merging this branch as is would revert #1987

Windows 11 build 26300.9974, device-free:

out/pe-env/Scripts/python.exe -B tests/startup_stream_fetch_check.py     # exit 0
mutation in this PR's own change result
the ia1 regex goes back to refusing 0 caught
the empty layout is recorded but the registers are not initialised caught
the consumer stops writing zeros for empty entries caught
at += 5 → at += 4 for the ia1 0 line caught

So the ia1 0 path, both halves of it (publish and consume), is pinned. Good.

The merge hazard

git diff origin/main review-2002 -- src/startup_stubs/d3d12_draw.inl contains, besides your change:

-    if (first_calls(tr->logged_bindings, 8)) {
+    if (InterlockedIncrement(&tr->logged_bindings) <= 8) {
-    if (first_calls(tr->logged_draws, 10) || (count > 100 && first_calls(tr->logged_large, 12))) {
+    if (InterlockedIncrement(&tr->logged_draws) <= 10 || (count > 100 && InterlockedIncrement(&tr->logged_large) <= 12)) {

Counted directly on both refs:

origin/main    first_calls uses = 2    old InterlockedIncrement uses = 0
review-2002    first_calls uses = 0    old InterlockedIncrement uses = 2

That is #1987's fix being undone. #1987's whole point was that InterlockedIncrement(&counter) <= N keeps counting past 2^31, turns negative, and
from then on logs every call — "millions of lines a minute and stalled the process" in the description. Your branch predates that merge, so this is
staleness rather than a decision, but a merge today would restore the flood at two sites and nothing in the diff calls it out.

A rebase onto current main fixes it and should be all that is needed — the ia1 hunks are in different lines of the same file.

Same pattern as two other open PRs

#2014 would revert ed7d09a4 (the SMEM guard shape), and #2012 would collide with #1995 which has now merged. Three PRs in one week whose diffs carry
someone else's reverted work. It is not a problem with any author: the branches are simply older than main, and git diff is the wrong tool to read
them with. Rebase before requesting review, or read git diff $(git merge-base origin/main HEAD).

What this PR is actually worth

Publishing a declared-but-empty input layout as ia1 0, instead of nothing, distinguishes "no layout declared" from "layout declared with zero elements"
— which is what unblocks the three pipelines. Reading the fetched registers as zero is stated in the code as an assumption, not a measurement, which
is the right framing: no fixture can prove what the GPU would do, because the stand-in is the model.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147372006 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7147372006). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T23:24:53Z. --- ## The new behaviour is well covered — four mutations caught — but merging this branch as is would revert #1987 Windows 11 build 26300.9974, device-free: ```powershell out/pe-env/Scripts/python.exe -B tests/startup_stream_fetch_check.py # exit 0 ``` | mutation in this PR's own change | result | |---|---| | the `ia1` regex goes back to refusing `0` | **caught** | | the empty layout is recorded but the registers are not initialised | **caught** | | the consumer stops writing zeros for `empty` entries | **caught** | | `at += 5` → `at += 4` for the `ia1 0` line | **caught** | So the `ia1 0` path, both halves of it (publish and consume), is pinned. Good. ## The merge hazard `git diff origin/main review-2002 -- src/startup_stubs/d3d12_draw.inl` contains, besides your change: ```diff - if (first_calls(tr->logged_bindings, 8)) { + if (InterlockedIncrement(&tr->logged_bindings) <= 8) { - if (first_calls(tr->logged_draws, 10) || (count > 100 && first_calls(tr->logged_large, 12))) { + if (InterlockedIncrement(&tr->logged_draws) <= 10 || (count > 100 && InterlockedIncrement(&tr->logged_large) <= 12)) { ``` Counted directly on both refs: ```text origin/main first_calls uses = 2 old InterlockedIncrement uses = 0 review-2002 first_calls uses = 0 old InterlockedIncrement uses = 2 ``` That is #1987's fix being undone. #1987's whole point was that `InterlockedIncrement(&counter) <= N` keeps counting past 2^31, turns negative, and from then on logs **every** call — "millions of lines a minute and stalled the process" in the description. Your branch predates that merge, so this is staleness rather than a decision, but a merge today would restore the flood at two sites and nothing in the diff calls it out. A rebase onto current `main` fixes it and should be all that is needed — the `ia1` hunks are in different lines of the same file. ## Same pattern as two other open PRs #2014 would revert `ed7d09a4` (the SMEM guard shape), and #2012 would collide with #1995 which has now merged. Three PRs in one week whose diffs carry someone else's reverted work. It is not a problem with any author: the branches are simply older than `main`, and `git diff` is the wrong tool to read them with. Rebase before requesting review, or read `git diff $(git merge-base origin/main HEAD)`. ## What this PR is actually worth Publishing a declared-but-empty input layout as `ia1 0`, instead of nothing, distinguishes "no layout declared" from "layout declared with zero elements" — which is what unblocks the three pipelines. Reading the fetched registers as zero is stated in the code as an assumption, not a measurement, which is the right framing: no fixture can prove what the GPU would do, because the stand-in *is* the model. ## Notes - AI-assisted review.
tedin7 commented 2026-11-25 01:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:55:51Z.

Code review location: src/startup_stubs/d3d12_draw.inl; line 227

@@ -223,7 +223,10 @@ bool stream_input_layout(const unsigned char* subobject, std::string& text)
 {
     D3D12_INPUT_LAYOUT_DESC layout;
     std::memcpy(&layout, subobject + 8, sizeof(layout));
-    if (!layout.NumElements) return true;
+    if (!layout.NumElements) {
+        text = "ia1 0\n";  // declared without elements: the translation reads every fetched input as zero

Fixed in cfe39e75 (branch rebased onto current main, so #1987's counter fix is preserved; the host force-pushes it). docs/startup-runtime.md now says: a layout declared with zero elements publishes ia1 0 and is part of the cache key; absent or unreadable layouts publish nothing and are still refused; the zero default is an assumption, not a measurement; translator-only reproduction is python -B tests/startup_stream_fetch_check.py.

Verification: python3 -B tests/startup_stream_fetch_check.py exit 0 on the rebased tree. The Win2025 C++ build was attempted but failed on an sccache connection reset (infrastructure, before any test ran).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688719471 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#discussion_r4688719471). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:55:51Z. **Code review location:** `src/startup_stubs/d3d12_draw.inl`; line 227 ~~~~diff @@ -223,7 +223,10 @@ bool stream_input_layout(const unsigned char* subobject, std::string& text) { D3D12_INPUT_LAYOUT_DESC layout; std::memcpy(&layout, subobject + 8, sizeof(layout)); - if (!layout.NumElements) return true; + if (!layout.NumElements) { + text = "ia1 0\n"; // declared without elements: the translation reads every fetched input as zero ~~~~ --- Fixed in cfe39e75 (branch rebased onto current main, so #1987's counter fix is preserved; the host force-pushes it). docs/startup-runtime.md now says: a layout declared with zero elements publishes `ia1 0` and is part of the cache key; absent or unreadable layouts publish nothing and are still refused; the zero default is an assumption, not a measurement; translator-only reproduction is `python -B tests/startup_stream_fetch_check.py`. Verification: `python3 -B tests/startup_stream_fetch_check.py` exit 0 on the rebased tree. The Win2025 C++ build was attempted but failed on an sccache connection reset (infrastructure, before any test ran). AI-assisted; commands listed were executed locally.
thepatrickworld commented 2026-11-25 04:04:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T03:48:17Z.


Ran the fetch check on hardware, head cfe39e75 — RX 9070 XT, driver 32.0.32029.2010:

hardware fetch: all 32 pixels exact
hardware swapped registers: the exact check fails; the TEXCOORD rectangles are drawn instead
hardware one slot: the exact check fails; the TEXCOORD rectangles are drawn instead
hardware no layout: refused and not drawn

So the generated fetch reads the layout's slots in the order the container asks for, on the card, including the base-vertex term in the indexed draw; both mutations land on the TEXCOORD rectangles as predicted, which is what makes the exact check meaningful; and the missing INPUT_LAYOUT case is still refused rather than drawn by accident.

Limits: AMD only, no NVIDIA card here. startup_stream_consumer had to be built for the run.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152257007 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7152257007). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T03:48:17Z. --- Ran the fetch check on hardware, head `cfe39e75` — RX 9070 XT, driver 32.0.32029.2010: ``` hardware fetch: all 32 pixels exact hardware swapped registers: the exact check fails; the TEXCOORD rectangles are drawn instead hardware one slot: the exact check fails; the TEXCOORD rectangles are drawn instead hardware no layout: refused and not drawn ``` So the generated fetch reads the layout's slots in the order the container asks for, on the card, including the base-vertex term in the indexed draw; both mutations land on the TEXCOORD rectangles as predicted, which is what makes the exact check meaningful; and the missing `INPUT_LAYOUT` case is still refused rather than drawn by accident. Limits: AMD only, no NVIDIA card here. `startup_stream_consumer` had to be built for the run. _AI-assisted._
tedin7 commented 2026-11-25 12:01:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:54:34Z.


Thank you @thepatrickworld for the RX 9070 XT hardware run at cfe39e75: all 32 pixels exact, both mutations caught, and the missing INPUT_LAYOUT case still refused. Recorded as extra evidence for this PR.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161665700 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7161665700). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:54:34Z. --- Thank you @thepatrickworld for the RX 9070 XT hardware run at `cfe39e75`: all 32 pixels exact, both mutations caught, and the missing `INPUT_LAYOUT` case still refused. Recorded as extra evidence for this PR. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 13:00:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:05:35Z.


Thank you @ChazY11, good catch. The branch was older than main, so the diff carried the old counters.

I merged origin/main into the branch (a merge, no rebase). New head: 9b761e9d. Old head was 6433805e.

  • src/startup_stubs/d3d12_draw.inl: first_calls uses = 22 (the #1987 helper is kept). Old InterlockedIncrement(&tr->logged...) uses = 0.
  • git diff origin/main HEAD -- src/startup_stubs/d3d12_draw.inl has no first_calls lines, so the diff against main is only the ia1 0 change (4 files, +30/-4).
  • python3 -B tests/startup_stream_fetch_check.py exits 0.

Commands run: git merge origin/main, grep -c first_calls, grep -c 'InterlockedIncrement(&tr->logged', git diff origin/main HEAD --stat, python3 -B tests/startup_stream_fetch_check.py.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161908977 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7161908977). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T12:05:35Z. --- Thank you @ChazY11, good catch. The branch was older than `main`, so the diff carried the old counters. I merged `origin/main` into the branch (a merge, no rebase). New head: `9b761e9d`. Old head was `6433805e`. - `src/startup_stubs/d3d12_draw.inl`: `first_calls` uses = 22 (the #1987 helper is kept). Old `InterlockedIncrement(&tr->logged...)` uses = 0. - `git diff origin/main HEAD -- src/startup_stubs/d3d12_draw.inl` has no `first_calls` lines, so the diff against main is only the `ia1 0` change (4 files, +30/-4). - `python3 -B tests/startup_stream_fetch_check.py` exits 0. Commands run: `git merge origin/main`, `grep -c first_calls`, `grep -c 'InterlockedIncrement(&tr->logged'`, `git diff origin/main HEAD --stat`, `python3 -B tests/startup_stream_fetch_check.py`. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:24 +00:00
tedin7 commented 2026-11-25 14:05:13 +00:00 (Migrated from github.com)

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


Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, 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:7164391973 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7164391973). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:51:29Z. --- Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.
upstream-sync reopened this pull request 2026-11-25 23:01:39 +00:00
R0Y00 commented 2026-11-26 00:00:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T23:18:58Z.

Review: CHANGES_REQUESTED


The three startup_stream_fetch Release tests pass on WARP and RTX. They show the translator distinguishes a declared ia1 0 from an absent layout and that its generated shader supplies zero. The new code labels zero as an assumption. Since this changes the production stream path, please add an independent reference for the value of a fetched input when the layout is declared with zero elements, or narrow the support to a path that explicitly selects zero-fill as an experimental policy while the production default still refuses the unverified fetch. Keep the strong color/position controls and the absent or malformed layout refusals. Any actual startup claim should cite the exact candidate and measured stage.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066317688 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#pullrequestreview-6066317688). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T23:18:58Z. **Review:** CHANGES_REQUESTED --- The three `startup_stream_fetch` Release tests pass on WARP and RTX. They show the translator distinguishes a declared `ia1 0` from an absent layout and that its generated shader supplies zero. The new code labels zero as an assumption. Since this changes the production stream path, please add an independent reference for the value of a fetched input when the layout is declared with zero elements, or narrow the support to a path that explicitly selects zero-fill as an experimental policy while the production default still refuses the unverified fetch. Keep the strong color/position controls and the absent or malformed layout refusals. Any actual startup claim should cite the exact candidate and measured stage.
R0Y00 commented 2026-11-26 01:01:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T00:58:51Z.

Review: APPROVED


The latest revision addresses the compatibility finding. The default leaves the empty declared layout unpublished and refuses the fetch; X2W_STREAM_ZERO_FILL=1 publishes ia1 0 under the layout-specific key. Windows Release passed 3/3 (ctest --preset release --no-tests=error -j 1 -R '^startup_stream_fetch($|_)' -V), including WARP and RTX 4060 Laptop. Both adapters refused the default case and matched the opt-in collapsed-geometry readback and existing vertex controls. The source-built run establishes the experimental behavior; guest zero-fill remains unmeasured.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6067125210 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#pullrequestreview-6067125210). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T00:58:51Z. **Review:** APPROVED --- The latest revision addresses the compatibility finding. The default leaves the empty declared layout unpublished and refuses the fetch; `X2W_STREAM_ZERO_FILL=1` publishes `ia1 0` under the layout-specific key. Windows Release passed 3/3 (`ctest --preset release --no-tests=error -j 1 -R '^startup_stream_fetch($|_)' -V`), including WARP and RTX 4060 Laptop. Both adapters refused the default case and matched the opt-in collapsed-geometry readback and existing vertex controls. The source-built run establishes the experimental behavior; guest zero-fill remains unmeasured.
tedin7 commented 2026-11-26 01:02:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:43:45Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit b8f1272494aa2a48aa1e464bb8fc20b86838115a:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target startup_stream_consumer cpu_placed_provider d3d12_xs_shim d3d12_xs_device_obj startup_stream_setup_obj -- -j 2): 24.85s (configure 1.90s)
    • Test (ctest --preset dev -R '^startup_stream_fetch_' --parallel 6 --no-tests=error --output-on-failure): 3/3 passed (1.35s: startup_stream_fetch_translate 0.25s, startup_stream_fetch_hardware 1.16s, startup_stream_fetch_warp 1.23s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target startup_stream_consumer cpu_placed_provider d3d12_xs_shim d3d12_xs_device_obj startup_stream_setup_obj -- -j 2): 49.74s (configure 1.93s)
    • Test (ctest --preset release -R '^startup_stream_fetch_' --parallel 6 --no-tests=error --output-on-failure): 3/3 passed (1.31s: startup_stream_fetch_translate 0.20s, startup_stream_fetch_warp 1.21s, startup_stream_fetch_hardware 1.20s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.6s), tests/startup_buffer_address_check.py ok (0.4s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.4s), tests/startup_compute_store_format_xyzw_check.py ok (0.2s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.1s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.6s), tests/startup_gfx2hlsl_capture_check.py ok (0.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.2s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.3s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.2s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.1s), tests/startup_gfx2hlsl_f32_nan_check.py ok (4.1s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.1s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.2s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.2s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.0s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.1s), tests/startup_gfx2hlsl_refusals_check.py ok (0.5s), tests/startup_gfx2hlsl_root_check.py ok (0.6s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.3s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.2s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.1s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (4.8s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.8s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_swap_check.py ok (0.2s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (3.7s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.4s), tests/startup_image_2d_array_check.py ok (0.1s), tests/startup_image_3d_check.py ok (0.1s), tests/startup_image_gather_lz_check.py ok (0.5s), tests/startup_image_load_d16_check.py ok (0.8s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.2s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.5s), tests/startup_inline_sampler_check.py ok (0.1s), tests/startup_mesh57_loop_refusal_check.py ok (0.1s), tests/startup_mesh57_skeleton_check.py ok (0.4s), tests/startup_run_ps1_check.py ok (9.8s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_shader_cache_rekey_check.py ok (2.0s), tests/startup_smem_address_check.py ok (0.1s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.3s)
  • sccache: 6/16 hits; wall 130.4s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179055157 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7179055157). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:43:45Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `b8f1272494aa2a48aa1e464bb8fc20b86838115a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target startup_stream_consumer cpu_placed_provider d3d12_xs_shim d3d12_xs_device_obj startup_stream_setup_obj -- -j 2`): `24.85s` (configure `1.90s`) - Test (`ctest --preset dev -R '^startup_stream_fetch_' --parallel 6 --no-tests=error --output-on-failure`): **3/3 passed** (`1.35s`: `startup_stream_fetch_translate` `0.25s`, `startup_stream_fetch_hardware` `1.16s`, `startup_stream_fetch_warp` `1.23s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target startup_stream_consumer cpu_placed_provider d3d12_xs_shim d3d12_xs_device_obj startup_stream_setup_obj -- -j 2`): `49.74s` (configure `1.93s`) - Test (`ctest --preset release -R '^startup_stream_fetch_' --parallel 6 --no-tests=error --output-on-failure`): **3/3 passed** (`1.31s`: `startup_stream_fetch_translate` `0.20s`, `startup_stream_fetch_warp` `1.21s`, `startup_stream_fetch_hardware` `1.20s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.6s`), `tests/startup_buffer_address_check.py` ok (`0.4s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.4s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.2s`), `tests/startup_compute_translate_check.py` ok (`0.2s`), `tests/startup_flat_param_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`4.1s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`2.0s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_s_abs_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_bitset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`4.8s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`3.7s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.4s`), `tests/startup_image_2d_array_check.py` ok (`0.1s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `tests/startup_image_gather_lz_check.py` ok (`0.5s`), `tests/startup_image_load_d16_check.py` ok (`0.8s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.2s`), `tests/startup_image_sample_c_check.py` ok (`0.2s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`0.5s`), `tests/startup_inline_sampler_check.py` ok (`0.1s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.1s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.4s`), `tests/startup_run_ps1_check.py` ok (`9.8s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.1s`), `tests/startup_shader_cache_rekey_check.py` ok (`2.0s`), `tests/startup_smem_address_check.py` ok (`0.1s`), `tests/startup_stream_fetch_check.py` ok (`0.2s`), `tests/startup_stream_interface_check.py` ok (`0.2s`), `tests/startup_translator_check.py` ok (`0.3s`) - `sccache`: 6/16 hits; wall `130.4s`
tedin7 commented 2026-11-26 01:02:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:43:46Z.


@R0Y00 thank you for the review. I took your second option: narrow the support to an explicit experimental policy, with the production default still refusing.

New head: b8f1272494aa2a48aa1e464bb8fc20b86838115a (a merge of origin/main, then one fix commit; no rebase).

  • src/startup_stubs/d3d12_draw.inl: a layout declared with zero elements publishes nothing by default, so the fetch is refused and not drawn, as before this PR. Only with X2W_STREAM_ZERO_FILL=1 is ia1 0 published and the translation zero-filled.
  • tests/startup_stream_fetch_check.py: new default case (no .ia file, not drawn). The zero-fill draw now runs only with the opt-in. The color/position controls and the absent-layout and malformed-layout refusals are unchanged.
  • docs/startup-runtime.md: says the zero value is an assumption, not a measurement, and that no startup claim rests on it. I do not claim any startup stage from this change.

Commands run on Win2025 (WARP) at that head: x2w_pipe.py win2025 2002 --keep-release --regex "^startup_stream_fetch_". Dev and release: startup_stream_fetch_translate, startup_stream_fetch_warp, startup_stream_fetch_hardware passed (3/3 each). Linux: python3 -B tests/startup_stream_fetch_check.py exits 0. CI is green. The receipt is in the next comment.

I am re-requesting your review. @MasterDomino for merge once @R0Y00 is satisfied.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179055407 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2002#issuecomment-7179055407). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:43:46Z. --- @R0Y00 thank you for the review. I took your second option: narrow the support to an explicit experimental policy, with the production default still refusing. New head: `b8f1272494aa2a48aa1e464bb8fc20b86838115a` (a merge of `origin/main`, then one fix commit; no rebase). - `src/startup_stubs/d3d12_draw.inl`: a layout declared with zero elements publishes nothing by default, so the fetch is refused and not drawn, as before this PR. Only with `X2W_STREAM_ZERO_FILL=1` is `ia1 0` published and the translation zero-filled. - `tests/startup_stream_fetch_check.py`: new default case (no `.ia` file, not drawn). The zero-fill draw now runs only with the opt-in. The color/position controls and the absent-layout and malformed-layout refusals are unchanged. - `docs/startup-runtime.md`: says the zero value is an assumption, not a measurement, and that no startup claim rests on it. I do not claim any startup stage from this change. Commands run on Win2025 (WARP) at that head: `x2w_pipe.py win2025 2002 --keep-release --regex "^startup_stream_fetch_"`. Dev and release: `startup_stream_fetch_translate`, `startup_stream_fetch_warp`, `startup_stream_fetch_hardware` passed (3/3 each). Linux: `python3 -B tests/startup_stream_fetch_check.py` exits 0. CI is green. The receipt is in the next comment. I am re-requesting your review. @MasterDomino for merge once @R0Y00 is satisfied. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 02:04:45 +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!1995
No description provided.