tests: restore the packed-vertex attribute count the mesh refactor dropped #3861

Merged
triggered02 merged 1 commit from upstream-pr/3861 into main 2026-12-02 15:19:06 +00:00
triggered02 commented 2026-12-02 14:56:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T14:56:30Z.


Fixes #3856.

native_direct_mesh fails on every pull request's Windows job. It is not a translator regression — the fixture is broken, and this restores the one line the refactor dropped.

Root cause. 5545de92 moved the sibling container cases onto tests/native_direct_container_check.mesh(), which writes the attribute count at io + 0x188. It left the packed-row case on the old pack(body + code, ...) path and deleted the struct.pack_into("<I", body, io + 0x188, 1) that path needed:

-        struct.pack_into('<I', body, io + 0x188, 1)

body is a shared, zero-filled bytearray, so from then on the container declared zero output attributes while still packing three signature rows.

Failure chain.

read_guest_shader_container:  attributes(0xc8, 6, 0x188, true)  -> count = 0 -> stage.outputs empty
gfx1013_direct_graphics.inl:450  if (!pixel && target >= 32) for (const auto &a : stage.outputs) ...
gfx1013_direct_graphics.inl:456  refuse(pc, "unmapped graphics export")

Instrumenting the refusal showed target=32 channel=0 pixel=0 outputs=0 sig=3 — the export is the first packed-vertex row in a mesh stage with no attribute row to map. The :469 exception does not apply because the signature has generic rows (COLOR, TEXCOORD).

No translator change is involved. Between the last passing tree and the failing one:

$ git diff --stat e3876780 5545de92 -- src/gfx1013_direct_graphics.inl src/guest_shader_container.cpp
(empty)

Linear ancestry: e3876780 PASS → 5545de92 FAIL (e3876780 is its parent).

Verification — Debian, clang-cl 19.1.1, Windows CPython under Wine, compile_dxil built at 5770f14e (the failing tree), same dxc.exe:

before: aborts at the integer-row case — native compute +0x34: unmapped graphics export
after:  exit 0 — "mesh allocation, indexed outputs, group exchange and negative controls passed"

Both loop iterations now run, which is the point of the case: the assertion expects TEXCOORD with interpolation mode 1 for the integer row and 2 for the float row. Previously the first iteration aborted, so the second never executed — the behaviour this fixture exists to test was not being exercised at all.

Not established. No MSVC or Windows host here, so the Windows job is the check for that side. I did not run the rest of the suite.

Alternative considered. The tidier change is to move this case onto mesh() like its siblings (mesh(code, 0, outputs, [(6, 1, 0, 0, 0, 0)])). I kept the one-line restore because it is the smallest change that fixes the fixture and leaves the case's intent visible; say the word and I will switch it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5608973135 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3861). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:56:30Z. --- Fixes #3856. `native_direct_mesh` fails on every pull request's Windows job. It is not a translator regression — the fixture is broken, and this restores the one line the refactor dropped. **Root cause.** `5545de92` moved the sibling container cases onto `tests/native_direct_container_check.mesh()`, which writes the attribute count at `io + 0x188`. It left the packed-row case on the old `pack(body + code, ...)` path and deleted the `struct.pack_into("<I", body, io + 0x188, 1)` that path needed: ``` - struct.pack_into('<I', body, io + 0x188, 1) ``` `body` is a shared, zero-filled `bytearray`, so from then on the container declared **zero** output attributes while still packing three signature rows. **Failure chain.** ``` read_guest_shader_container: attributes(0xc8, 6, 0x188, true) -> count = 0 -> stage.outputs empty gfx1013_direct_graphics.inl:450 if (!pixel && target >= 32) for (const auto &a : stage.outputs) ... gfx1013_direct_graphics.inl:456 refuse(pc, "unmapped graphics export") ``` Instrumenting the refusal showed `target=32 channel=0 pixel=0 outputs=0 sig=3` — the export is the first packed-vertex row in a mesh stage with no attribute row to map. The `:469` exception does not apply because the signature has generic rows (COLOR, TEXCOORD). **No translator change is involved.** Between the last passing tree and the failing one: ``` $ git diff --stat e3876780 5545de92 -- src/gfx1013_direct_graphics.inl src/guest_shader_container.cpp (empty) ``` Linear ancestry: `e3876780` PASS → `5545de92` FAIL (`e3876780` is its parent). **Verification** — Debian, clang-cl 19.1.1, Windows CPython under Wine, `compile_dxil` built at `5770f14e` (the failing tree), same `dxc.exe`: ``` before: aborts at the integer-row case — native compute +0x34: unmapped graphics export after: exit 0 — "mesh allocation, indexed outputs, group exchange and negative controls passed" ``` Both loop iterations now run, which is the point of the case: the assertion expects `TEXCOORD` with interpolation mode `1` for the integer row and `2` for the float row. Previously the first iteration aborted, so the second never executed — the behaviour this fixture exists to test was not being exercised at all. **Not established.** No MSVC or Windows host here, so the Windows job is the check for that side. I did not run the rest of the suite. **Alternative considered.** The tidier change is to move this case onto `mesh()` like its siblings (`mesh(code, 0, outputs, [(6, 1, 0, 0, 0, 0)])`). I kept the one-line restore because it is the smallest change that fixes the fixture and leaves the case's intent visible; say the word and I will switch it.
chatgpt-codex-connector[bot] commented 2026-12-02 14:56:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-12-02T14:56:44Z.


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-12-02T14:58:36.641233Z 002fc75 PR opened
ℹ️ 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:7349414155 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3861#issuecomment-7349414155). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-02T14:56:44Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"002fc75fada82948544298473585e3f3d972e902","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-12-02T14:58:36.641233Z">2026-12-02T14:58:36.641233Z</relative-time> | `002fc75` | PR opened | <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>
triggered02 commented 2026-12-02 15:00:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T15:00:35Z.


Adding the control and a repeat, since a single green run is weak evidence for a fixture fix.

Same host, same compile_dxil built at 5770f14e (the failing tree), same dxc.exe:

File Runs Result
unfixed tests/native_direct_mesh_check.py 4 4 × abort at the integer-row case, native compute +0x34: unmapped graphics export
fixed (this PR) 2 clean 2 × exit 0, ends mesh allocation, indexed outputs, group exchange and negative controls passed

The unfixed runs are the negative control: the only difference between pass and fail is the restored dword, so the fix is what moves it.

Two further invocations of the fixed file hit OSError: [WinError 731] before the fixture ran — that is Wine failing to CreateProcess on this host (the same artefact I described in #3822), not a test result, and I did not count them either way.

Nothing else in this file is affected: the added line sits in the packed-row block, and the sibling cases reach the attribute count through mesh(), which already writes it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7349540292 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3861#issuecomment-7349540292). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T15:00:35Z. --- Adding the control and a repeat, since a single green run is weak evidence for a fixture fix. Same host, same `compile_dxil` built at `5770f14e` (the failing tree), same `dxc.exe`: | File | Runs | Result | |---|---|---| | **unfixed** `tests/native_direct_mesh_check.py` | 4 | 4 × abort at the integer-row case, `native compute +0x34: unmapped graphics export` | | **fixed** (this PR) | 2 clean | 2 × exit 0, ends `mesh allocation, indexed outputs, group exchange and negative controls passed` | The unfixed runs are the negative control: the only difference between pass and fail is the restored dword, so the fix is what moves it. Two further invocations of the fixed file hit `OSError: [WinError 731]` before the fixture ran — that is Wine failing to `CreateProcess` on this host (the same artefact I described in #3822), not a test result, and I did not count them either way. Nothing else in this file is affected: the added line sits in the packed-row block, and the sibling cases reach the attribute count through `mesh()`, which already writes it.
R0Y00 commented 2026-12-02 15:18:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T15:18:41Z.

Review: APPROVED


Reviewed 002fc75f against main. The fixture now declares the single attribute it writes, so the target-32 export reaches the packed-row interpolation assertions. Both integer and float assertions remain intact, and the translator is unchanged. The Windows CI run for this head passed, along with the two Linux checks.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6153698039 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3861#pullrequestreview-6153698039). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T15:18:41Z. **Review:** APPROVED --- Reviewed 002fc75f against main. The fixture now declares the single attribute it writes, so the target-32 export reaches the packed-row interpolation assertions. Both integer and float assertions remain intact, and the translator is unchanged. The Windows CI run for this head passed, along with the two Linux checks.
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!3861
No description provided.