tests: native_direct_mesh fails on every PR's Windows job ('native compute +0x34: unmapped graphics export') #3856

Closed
opened 2026-12-02 13:43:35 +00:00 by triggered02 · 9 comments
triggered02 commented 2026-12-02 13:43:35 +00:00 (Migrated from github.com)
Contributor

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


Summary. native_direct_mesh (test 486) is red on the Windows job for every pull request I can see, on main at 5770f14e. It is the only failing test in each job, so it blocks every PR from a green Windows run.

Observed failure (identical in all four jobs):

Start  486: native_direct_mesh
 29/283 Test  #486: native_direct_mesh .......***Failed   10.45 sec
compiler_init_ms=24.5899
cold_compile_and_publish_ms=7.9807 bytes=2386
Traceback (most recent call last):
  File "tests/native_direct_mesh_check.py", line 2522, in <module>
    main()
  File "tests/native_direct_mesh_check.py", line 883, in main
    assert result.returncode == 0, result.stderr
AssertionError: native compute +0x34: unmapped graphics export

Jobs. Four independent heads, none of which touches this area, all failing the same test:

PR Run Test result
#3855 (mine, a CMake warning-flag condition only) 46891352936 native_direct_mesh Failed, 10.45 s
#2773 (mine, slot-133 lazy textures) 46891910363 native_direct_mesh Failed
#3852 (shader, MSVC lambda capture) 46884314332 native_direct_mesh Failed
#1536 (audio validation) 46892779921 Windows job failed

main itself is also red: run 46880161821 on 5770f14e failed, though that one failed earlier still — FileNotFoundError: out/test-results.xml — so it never reached a test verdict. That is why this needs an issue rather than a pointer at a red main run.

What the message suggests. unmapped graphics export is raised for an export the native compute frontend cannot map; +0x34 is the guest offset it reached. The fixture prints its compile timings and then fails, so the compute stage compiled but its export set did not line up (bytes=2386 published).

Not established. I have not bisected which commit introduced it, and native_direct_mesh is a Windows-only test — this host is Linux, so I cannot run it or narrow it further than the CI evidence above. I am reporting the blocker, not a diagnosis.

Reproduce: the Windows job of any PR, or ctest --preset dev -R '^native_direct_mesh$' -V on Windows.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6746204621 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T13:43:35Z. --- **Summary.** `native_direct_mesh` (test 486) is red on the Windows job for every pull request I can see, on `main` at `5770f14e`. It is the only failing test in each job, so it blocks every PR from a green Windows run. **Observed failure** (identical in all four jobs): ``` Start 486: native_direct_mesh 29/283 Test #486: native_direct_mesh .......***Failed 10.45 sec compiler_init_ms=24.5899 cold_compile_and_publish_ms=7.9807 bytes=2386 Traceback (most recent call last): File "tests/native_direct_mesh_check.py", line 2522, in <module> main() File "tests/native_direct_mesh_check.py", line 883, in main assert result.returncode == 0, result.stderr AssertionError: native compute +0x34: unmapped graphics export ``` **Jobs.** Four independent heads, none of which touches this area, all failing the same test: | PR | Run | Test result | |---|---|---| | #3855 (mine, a CMake warning-flag condition only) | [46891352936](https://github.com/R0Y00/Xbox2Windows/actions/runs/46891352936) | `native_direct_mesh` Failed, 10.45 s | | #2773 (mine, slot-133 lazy textures) | [46891910363](https://github.com/R0Y00/Xbox2Windows/actions/runs/46891910363) | `native_direct_mesh` Failed | | #3852 (shader, MSVC lambda capture) | [46884314332](https://github.com/R0Y00/Xbox2Windows/actions/runs/46884314332) | `native_direct_mesh` Failed | | #1536 (audio validation) | [46892779921](https://github.com/R0Y00/Xbox2Windows/actions/runs/46892779921) | Windows job failed | `main` itself is also red: run [46880161821](https://github.com/R0Y00/Xbox2Windows/actions/runs/46880161821) on `5770f14e` failed, though that one failed earlier still — `FileNotFoundError: out/test-results.xml` — so it never reached a test verdict. That is why this needs an issue rather than a pointer at a red main run. **What the message suggests.** `unmapped graphics export` is raised for an export the native compute frontend cannot map; `+0x34` is the guest offset it reached. The fixture prints its compile timings and then fails, so the compute stage compiled but its export set did not line up (`bytes=2386` published). **Not established.** I have not bisected which commit introduced it, and `native_direct_mesh` is a Windows-only test — this host is Linux, so I cannot run it or narrow it further than the CI evidence above. I am reporting the blocker, not a diagnosis. **Reproduce:** the Windows job of any PR, or `ctest --preset dev -R '^native_direct_mesh$' -V` on Windows.
triggered02 commented 2026-12-02 13:48:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T13:48:42Z.


Claiming to try to reproduce it locally, same approach that worked for startup_slot133_lazy_textures_check: native_direct_mesh drives tools/startup/compile_dxil through tests/native_direct_mesh_check.py, and both halves are buildable here.

Plan: build compile_dxil with clang-cl, then run tests/native_direct_mesh_check.py under the Windows CPython in Wine 11 + vkd3d-proton with the Windows dxc.exe from the staged SDK tools. If it reproduces, I can bisect the guest offset and see which export the native compute frontend fails to map; if it does not, that is a useful negative and it means the failure is specific to the Windows toolchain or the WARP path.

Caveat I will keep in the report: Linux + Wine is not the failing environment, so a reproduction here is evidence about the code path, not about the Windows job's flake rate, and a negative result does not clear the Windows job.

Overlap: none — I filed this issue and nobody has touched it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7347498364 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7347498364). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T13:48:42Z. --- Claiming to try to reproduce it locally, same approach that worked for `startup_slot133_lazy_textures_check`: `native_direct_mesh` drives `tools/startup/compile_dxil` through `tests/native_direct_mesh_check.py`, and both halves are buildable here. **Plan:** build `compile_dxil` with clang-cl, then run `tests/native_direct_mesh_check.py` under the Windows CPython in Wine 11 + vkd3d-proton with the Windows `dxc.exe` from the staged SDK tools. If it reproduces, I can bisect the guest offset and see which export the native compute frontend fails to map; if it does not, that is a useful negative and it means the failure is specific to the Windows toolchain or the WARP path. **Caveat I will keep in the report:** Linux + Wine is not the failing environment, so a reproduction here is evidence about the code path, not about the Windows job's flake rate, and a negative result does not clear the Windows job. **Overlap:** none — I filed this issue and nobody has touched it.
triggered02 commented 2026-12-02 13:59:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T13:59:13Z.


Reproduced on Linux, isolated the failing sub-case, and narrowed the regression window. The bisect itself is blocked by this host, not by the code.

1. It reproduces outside Windows. Building compile_dxil with clang-cl at 5770f14e and running the test under the Windows CPython in Wine:

compiler_init_ms=90.1129
cold_compile_and_publish_ms=1.5524 bytes=2386
AssertionError: native compute +0x34: unmapped graphics export

Same bytes=2386, same message, same assertion line as the Windows jobs. So this is not a Windows-toolchain effect and not WARP.

2. The failing sub-case. tests/native_direct_mesh_check.py:883 sits in the loop

for name, component, mode in (('integer-row', 1, 1), ('float-row', 3, 2)):

Instrumenting a throwaway copy (not the repo's file) shows the first iteration fails and the second never runs:

CASE integer-row component 1 rc 1
  STDERR: native compute +0x34: unmapped graphics export

That is the case with signature rows SV_Position, COLOR as an integer element (component 1, constant mode) and TEXCOORD. The refusal is the fall-through at src/gfx1013_direct_graphics.inl:456: the export's target matches neither the position row nor clip/cull distance nor a target >= 32 packed vertex row in stage.outputs.

3. Regression window. f17ef459 (#3825, "keep mesh output rows with an integer element constant") added this case and changed the row-mode computation, and its own Windows job passed at merge (8m37s, 2026-12-02 08:57Z). So native_direct_mesh was green at f17ef459 and is red at 5770f14e. The commits touching src/gfx1013_direct_graphics.inl in between are e3876780 (#3792), 45c809ab (#3826), 8407fdd3 (#3828) and 9b89e581 (#3831).

4. What blocked the bisect. Running the same test at f17ef459 fails earlier, at a subprocess call that spawns dxc.exe:

File "tests/native_direct_mesh_check.py", line 788, in run_offen
    return subprocess.check_output([sdk/'dxc.exe', '-dumpbin', out], text=True)
OSError: [WinError 731] Windows Error 0x2db

Three runs in a row. That is the same Wine CreateProcess failure I hit looping another fixture in #3822, and it is an artefact of this host, not of the code. So I cannot complete the bisect here; a Windows host or a quieter harness can.

I have not changed any code. If you want, the next step from my side is to apply the local #3853 clang build fix to a bisect worktree and retry the four candidate commits when Wine cooperates — but that is guessing at reliability, so I would rather hand over the narrowed window than spend it on flakes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7347793744 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7347793744). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T13:59:13Z. --- Reproduced on Linux, isolated the failing sub-case, and narrowed the regression window. The bisect itself is blocked by this host, not by the code. **1. It reproduces outside Windows.** Building `compile_dxil` with clang-cl at `5770f14e` and running the test under the Windows CPython in Wine: ``` compiler_init_ms=90.1129 cold_compile_and_publish_ms=1.5524 bytes=2386 AssertionError: native compute +0x34: unmapped graphics export ``` Same `bytes=2386`, same message, same assertion line as the Windows jobs. So this is not a Windows-toolchain effect and not WARP. **2. The failing sub-case.** `tests/native_direct_mesh_check.py:883` sits in the loop ```python for name, component, mode in (('integer-row', 1, 1), ('float-row', 3, 2)): ``` Instrumenting a throwaway copy (not the repo's file) shows the first iteration fails and the second never runs: ``` CASE integer-row component 1 rc 1 STDERR: native compute +0x34: unmapped graphics export ``` That is the case with signature rows `SV_Position`, `COLOR` as an **integer** element (component 1, constant mode) and `TEXCOORD`. The refusal is the fall-through at `src/gfx1013_direct_graphics.inl:456`: the export's target matches neither the position row nor clip/cull distance nor a `target >= 32` packed vertex row in `stage.outputs`. **3. Regression window.** `f17ef459` (#3825, "keep mesh output rows with an integer element constant") added this case *and* changed the row-mode computation, and its own Windows job passed at merge (`8m37s`, 2026-12-02 08:57Z). So `native_direct_mesh` was green at `f17ef459` and is red at `5770f14e`. The commits touching `src/gfx1013_direct_graphics.inl` in between are `e3876780` (#3792), `45c809ab` (#3826), `8407fdd3` (#3828) and `9b89e581` (#3831). **4. What blocked the bisect.** Running the same test at `f17ef459` fails earlier, at a `subprocess` call that spawns `dxc.exe`: ``` File "tests/native_direct_mesh_check.py", line 788, in run_offen return subprocess.check_output([sdk/'dxc.exe', '-dumpbin', out], text=True) OSError: [WinError 731] Windows Error 0x2db ``` Three runs in a row. That is the same Wine `CreateProcess` failure I hit looping another fixture in #3822, and it is an artefact of this host, not of the code. So I cannot complete the bisect here; a Windows host or a quieter harness can. I have not changed any code. If you want, the next step from my side is to apply the local `#3853` clang build fix to a bisect worktree and retry the four candidate commits when Wine cooperates — but that is guessing at reliability, so I would rather hand over the narrowed window than spend it on flakes.
triggered02 commented 2026-12-02 14:02:11 +00:00 (Migrated from github.com)
Author
Contributor

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


Addendum — correcting a claim I made too strongly in the previous comment, plus the history that reframes this.

Correction. I wrote "it is not a Windows effect". What I actually measured is: it reproduces on this host with the staged dxc.exe from the SDK-tools folder. The test spawns dxc.exe repeatedly (-dumpbin) and compiles HLSL with it, so if CI's DXC_BIN_DIR is a different DXC version than the one staged here, my reproduction may be the older failure rather than the current one. Same message and same assertion line, but I have not shown the two share a root cause. Treat the Linux reproduction as a lead, not as proof about the Windows job.

History that matters more. 3d33b0d9 ("ci: select native_direct_mesh in the pr preset", 2026-11-30) says in its own message:

native_direct_mesh has no _ir/_dxil/_controls suffix, so the alternation missed it, and it was one of the four tests red on main today.

So this test has been red on main before, and selecting it in the pr preset is what made it visible to PRs. That means:

Point State
before 3d33b0d9 (2026-11-30) red on main, not selected by the pr preset
3d33b0d9 selected — PRs start seeing it
f17ef459 (#3825, 2026-12-02 08:57Z) Windows job passed 8m37s — so it was green here, having presumably been fixed by the mesh work in between
5770f14e (current main) red again

So the regression window is still "after f17ef459", and the four commits touching src/gfx1013_direct_graphics.inl in that window are e3876780, 45c809ab, 8407fdd3, 9b89e581. I read their diffs and the only one touching that file in isolation is e3876780, which changes a single line (DirectCompute alu{emitter} → DirectCompute alu{emitter, translation_options()}) — a plausible way for a lowering decision to change, but I am not claiming it.

What would settle it fastest, and I cannot do here: run ctest --preset dev -R '^native_direct_mesh$' -V on a Windows host at f17ef459 and at e3876780. Two runs, ten minutes, and the window becomes one commit.

I am leaving the bisect at that rather than continuing to fight the Wine dxc.exe spawn failures, and I have not modified any code.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7347875092 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7347875092). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:02:11Z. --- Addendum — correcting a claim I made too strongly in the previous comment, plus the history that reframes this. **Correction.** I wrote "it is not a Windows effect". What I actually measured is: it reproduces on **this** host with the **staged** `dxc.exe` from the SDK-tools folder. The test spawns `dxc.exe` repeatedly (`-dumpbin`) and compiles HLSL with it, so if CI's `DXC_BIN_DIR` is a different DXC version than the one staged here, my reproduction may be the *older* failure rather than the current one. Same message and same assertion line, but I have not shown the two share a root cause. Treat the Linux reproduction as a lead, not as proof about the Windows job. **History that matters more.** `3d33b0d9` ("ci: select native_direct_mesh in the pr preset", 2026-11-30) says in its own message: > `native_direct_mesh` has no `_ir`/`_dxil`/`_controls` suffix, so the alternation missed it, and **it was one of the four tests red on main today**. So this test has been red on `main` before, and selecting it in the `pr` preset is what made it visible to PRs. That means: | Point | State | |---|---| | before `3d33b0d9` (2026-11-30) | red on main, not selected by the `pr` preset | | `3d33b0d9` | selected — PRs start seeing it | | `f17ef459` (#3825, 2026-12-02 08:57Z) | **Windows job passed 8m37s** — so it was green here, having presumably been fixed by the mesh work in between | | `5770f14e` (current main) | red again | So the regression window is still "after `f17ef459`", and the four commits touching `src/gfx1013_direct_graphics.inl` in that window are `e3876780`, `45c809ab`, `8407fdd3`, `9b89e581`. I read their diffs and the only one touching that file in isolation is `e3876780`, which changes a single line (`DirectCompute alu{emitter}` → `DirectCompute alu{emitter, translation_options()}`) — a plausible way for a lowering decision to change, but I am not claiming it. **What would settle it fastest**, and I cannot do here: run `ctest --preset dev -R '^native_direct_mesh$' -V` on a Windows host at `f17ef459` and at `e3876780`. Two runs, ten minutes, and the window becomes one commit. I am leaving the bisect at that rather than continuing to fight the Wine `dxc.exe` spawn failures, and I have not modified any code.
triggered02 commented 2026-12-02 14:14:07 +00:00 (Migrated from github.com)
Author
Contributor

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


Bisected. The regression is 45c809ab (#3826), "shader: lower pixel SAVEXEC lane-mask expressions".

Method: built compile_dxil at each commit with clang-cl and ran tests/native_direct_mesh_check.py under the Windows CPython in Wine, retrying when Wine failed to spawn dxc.exe (WinError 731) so a spawn flake was never counted as a verdict.

f17ef459  PASS   (full summary: "mesh allocation, indexed outputs, group exchange and negative ...")
e3876780  PASS
45c809ab  FAIL   "native compute +0x34: unmapped graphics export"

Ancestral order on the main line between the last green merge and 5770f14e is e3876780 → 45c809ab → 8407fdd3 → 9b89e581, so the break is exactly 45c809ab. I did not need to test the last two.

This also settles my previous correction. I had withdrawn the claim that my Linux reproduction is comparable to the Windows job, because the test spawns dxc.exe and CI's DXC_BIN_DIR might differ. It is the same host, the same staged dxc.exe and the same fixture across all three builds above — pass at f17ef459, fail at 45c809ab — so the reproduction is sound and DXC parity is not a factor.

Why a pixel change breaks a mesh test (hypothesis, not proven): 45c809ab adds a lane-mask chain analysis (MaskChain, lane_compare, writes_pair) in GraphicsMaskRegions inside src/gfx1013_direct_graphics.inl, which lower_graphics shares with the mesh path. The refusal is still the export fall-through at :456, so the new analysis appears to change what the shared lowering does with an export it previously mapped. The flat row logic that f17ef459 added immediately before is still present at 45c809ab, so that is not simply reverted.

Reproduce in one command on any host with a Windows DXC:

ctest --preset dev -R '^native_direct_mesh$' -V      # at 45c809ab: fails; at e3876780: passes

I have not attempted a fix: the change is a large shared-code refactor by another author and my hypothesis above is unproven. Handing over the bisect result rather than a speculative patch.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7348208006 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7348208006). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:14:07Z. --- **Bisected. The regression is `45c809ab` (#3826), "shader: lower pixel SAVEXEC lane-mask expressions".** Method: built `compile_dxil` at each commit with clang-cl and ran `tests/native_direct_mesh_check.py` under the Windows CPython in Wine, retrying when Wine failed to spawn `dxc.exe` (`WinError 731`) so a spawn flake was never counted as a verdict. ``` f17ef459 PASS (full summary: "mesh allocation, indexed outputs, group exchange and negative ...") e3876780 PASS 45c809ab FAIL "native compute +0x34: unmapped graphics export" ``` Ancestral order on the main line between the last green merge and `5770f14e` is `e3876780` → `45c809ab` → `8407fdd3` → `9b89e581`, so the break is exactly `45c809ab`. I did not need to test the last two. **This also settles my previous correction.** I had withdrawn the claim that my Linux reproduction is comparable to the Windows job, because the test spawns `dxc.exe` and CI's `DXC_BIN_DIR` might differ. It is the same host, the same staged `dxc.exe` and the same fixture across all three builds above — pass at `f17ef459`, fail at `45c809ab` — so the reproduction is sound and DXC parity is not a factor. **Why a pixel change breaks a mesh test** (hypothesis, not proven): `45c809ab` adds a lane-mask chain analysis (`MaskChain`, `lane_compare`, `writes_pair`) in `GraphicsMaskRegions` inside `src/gfx1013_direct_graphics.inl`, which `lower_graphics` shares with the mesh path. The refusal is still the export fall-through at `:456`, so the new analysis appears to change what the shared lowering does with an export it previously mapped. The `flat` row logic that `f17ef459` added immediately before is still present at `45c809ab`, so that is not simply reverted. Reproduce in one command on any host with a Windows DXC: ``` ctest --preset dev -R '^native_direct_mesh$' -V # at 45c809ab: fails; at e3876780: passes ``` I have not attempted a fix: the change is a large shared-code refactor by another author and my hypothesis above is unproven. Handing over the bisect result rather than a speculative patch.
triggered02 commented 2026-12-02 14:19:51 +00:00 (Migrated from github.com)
Author
Contributor

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


Mechanism, from an instrumented build of the failing commit. This turns the bisect into something actionable.

What actually refuses. I printed the export target and the stage's output list at the refusal site:

X2WDBG unmapped export: target=32 channel=0 pixel=0 outputs=0 sig=3
native compute +0x34: unmapped graphics export

So:

  • the export is target 32 — the first packed-vertex row — in a non-pixel stage,
  • stage.outputs is empty, while stage.output_signature has 3 rows (the fixture packs SV_Position, COLOR, TEXCOORD),
  • the refusal is the fall-through at src/gfx1013_direct_graphics.inl:456: the target >= 32 loop at :450 iterates stage.outputs, finds nothing, and the special case at :469 only allows an empty output list when the signature has no non-system row — here it has two.

Why that is the right place to look. stage.outputs is filled by read_guest_shader_container from the native container header at offset 0xc8 (src/guest_shader_container.cpp:93), while stage.output_signature comes from the packed OSG1 chunk. The fixture builds the OSG1 signature but the two lists end up disagreeing: three signature rows, zero output attributes. Whether the container header should carry those rows, or the translator should fall back to the signature when stage.outputs is empty, is a design question I am not going to answer from here.

What 45c809ab did to reach it. Its diff adds the MaskChain / lane_compare / writes_pair analysis inside GraphicsMaskRegions in the same file, and lower_graphics is shared with the mesh path. I have not traced which of its hunks changes the decision for this export — that is where I would look first, and the two hunks that touch lower_graphics are at :2397 and :2765 in that commit's diff.

Reproduce the instrumented value by adding an fprintf above refuse(pc, "unmapped graphics export") — that is all I changed, and I reverted it immediately; the tree I built from is clean.

I am stopping at the mechanism: the remaining step is a judgement about which side (container header vs translator fallback) should own the outputs, and guessing it would be the same mistake as the retire-semantics patch I withdrew earlier in this work.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7348364371 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7348364371). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:19:51Z. --- Mechanism, from an instrumented build of the failing commit. This turns the bisect into something actionable. **What actually refuses.** I printed the export target and the stage's output list at the refusal site: ``` X2WDBG unmapped export: target=32 channel=0 pixel=0 outputs=0 sig=3 native compute +0x34: unmapped graphics export ``` So: - the export is **target 32** — the first packed-vertex row — in a **non-pixel** stage, - **`stage.outputs` is empty**, while **`stage.output_signature` has 3 rows** (the fixture packs `SV_Position`, `COLOR`, `TEXCOORD`), - the refusal is the fall-through at `src/gfx1013_direct_graphics.inl:456`: the `target >= 32` loop at `:450` iterates `stage.outputs`, finds nothing, and the special case at `:469` only allows an empty output list when the signature has **no** non-system row — here it has two. **Why that is the right place to look.** `stage.outputs` is filled by `read_guest_shader_container` from the native container header at offset `0xc8` (`src/guest_shader_container.cpp:93`), while `stage.output_signature` comes from the packed `OSG1` chunk. The fixture builds the `OSG1` signature but the two lists end up disagreeing: three signature rows, zero output attributes. Whether the container header should carry those rows, or the translator should fall back to the signature when `stage.outputs` is empty, is a design question I am not going to answer from here. **What `45c809ab` did to reach it.** Its diff adds the `MaskChain` / `lane_compare` / `writes_pair` analysis inside `GraphicsMaskRegions` in the same file, and `lower_graphics` is shared with the mesh path. I have not traced which of its hunks changes the decision for this export — that is where I would look first, and the two hunks that touch `lower_graphics` are at `:2397` and `:2765` in that commit's diff. **Reproduce the instrumented value** by adding an `fprintf` above `refuse(pc, "unmapped graphics export")` — that is all I changed, and I reverted it immediately; the tree I built from is clean. I am stopping at the mechanism: the remaining step is a judgement about which side (container header vs translator fallback) should own the outputs, and guessing it would be the same mistake as the retire-semantics patch I withdrew earlier in this work.
triggered02 commented 2026-12-02 14:36:55 +00:00 (Migrated from github.com)
Author
Contributor

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


A deduction from reading the culprit's diff, which narrows where to look next.

45c809ab's only changes in lower_graphics are SSA-side: it adds a regions.mask_ops branch that writes a lane-mask bit at 1024+pc and marks the destination pair unavailable, plus one line recording a compare's bit for later mask expressions. Neither touches exports.

But the refusal we see is entirely static:

unmapped export: target=32 channel=0 pixel=0 outputs=0 sig=3

target comes from the instruction word, outputs and sig come from the parsed container, and the check at :450 only iterates stage.outputs. No SSA value feeds that decision. So 45c809ab's lowering change cannot directly produce this refusal for a given container.

Which means the container being compiled must be different between the passing and failing builds — i.e. an earlier step in tests/native_direct_mesh_check.py diverges, and the integer-row case is the first place that divergence becomes fatal rather than the cause.

Where to look, concretely: the test reuses one body bytearray and mutates it between sub-cases (body[io + 0xc8:io + 0xce] = bytes((6, 1, 0, 0, 0, 0)) just before the loop), and io + 0xc8 is the same offset the container parser reads stage.outputs from (guest_shader_container.cpp:93). So a sub-case that writes — or fails to write — those six bytes will silently change what stage.outputs contains for a later case. That is worth checking before blaming the translator.

I can test this directly by dumping the container bytes in both builds and diffing them, which is the next thing I would do; I am recording it rather than starting another build cycle right now, since the answer also depends on whether the intent is "the signature owns these rows" or "the header does", which is your call.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7348845869 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7348845869). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:36:55Z. --- A deduction from reading the culprit's diff, which narrows where to look next. `45c809ab`'s only changes in `lower_graphics` are SSA-side: it adds a `regions.mask_ops` branch that writes a lane-mask bit at `1024+pc` and marks the destination pair unavailable, plus one line recording a compare's bit for later mask expressions. Neither touches exports. But the refusal we see is **entirely static**: ``` unmapped export: target=32 channel=0 pixel=0 outputs=0 sig=3 ``` `target` comes from the instruction word, `outputs` and `sig` come from the parsed container, and the check at `:450` only iterates `stage.outputs`. No SSA value feeds that decision. So `45c809ab`'s lowering change **cannot directly** produce this refusal for a given container. Which means the container being compiled must be **different** between the passing and failing builds — i.e. an earlier step in `tests/native_direct_mesh_check.py` diverges, and the integer-row case is the first place that divergence becomes fatal rather than the cause. Where to look, concretely: the test reuses one `body` bytearray and mutates it between sub-cases (`body[io + 0xc8:io + 0xce] = bytes((6, 1, 0, 0, 0, 0))` just before the loop), and `io + 0xc8` is the same offset the container parser reads `stage.outputs` from (`guest_shader_container.cpp:93`). So a sub-case that writes — or fails to write — those six bytes will silently change what `stage.outputs` contains for a later case. That is worth checking before blaming the translator. I can test this directly by dumping the container bytes in both builds and diffing them, which is the next thing I would do; I am recording it rather than starting another build cycle right now, since the answer also depends on whether the intent is "the signature owns these rows" or "the header does", which is your call.
triggered02 commented 2026-12-02 14:50:21 +00:00 (Migrated from github.com)
Author
Contributor

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


Correction: my bisect was wrong. The culprit is 5545de92 (#3806), not 45c809ab. Please disregard the culprit in my earlier comment; the evidence below supersedes it.

What I got wrong. I built the candidate window from a path-filtered log and treated 45c809ab as the next commit after the passing tree. It is not — the ancestry is linear and has one commit in between:

e3876780  (passing)
  └─ 5545de92   shader: lower literal FMAs, straight SAVEXEC and reflected POS1 in mesh (#3806)
       └─ 45c809ab   shader: lower pixel SAVEXEC lane-mask expressions (#3826)

5545de92 also changed tests/native_direct_mesh_check.py, which is why it did not appear where I expected. I should have walked the first-parent chain instead of assuming adjacency.

Verdicts, all with each tree's own test file, same host, same dxc.exe, Wine spawn flakes retried and never counted:

e3876780   PASS
5545de92   FAIL   native compute +0x34: unmapped graphics export
45c809ab   FAIL   (same)

Since 5545de92's parent is the passing tree and it is the only commit in between, the regression is 5545de92.

And it fits the symptom far better than my previous answer. Its subject line is "lower literal FMAs, straight SAVEXEC and reflected POS1 in mesh" — a mesh-side change to reflected position exports, which is exactly the area that refuses here (an export row at target=32, outputs=0, sig=3). A pixel SAVEXEC lowering was always an odd culprit for a mesh export refusal; that mismatch should have made me check the ancestry more carefully.

The mechanism findings stand: the refusal is static (target from the instruction word, outputs/sig from the parsed container), so the thing to compare is what stage.outputs contains for the same container at the two trees — and 5545de92 is the tree to compare against, not 45c809ab.

I am sorry for the wrong name in the previous comment. If you have already started looking at 45c809ab, the useful part of that comment — the mechanism, offset and refusal site — is unchanged.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7349224948 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7349224948). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:50:21Z. --- **Correction: my bisect was wrong. The culprit is `5545de92` (#3806), not `45c809ab`.** Please disregard the culprit in my earlier comment; the evidence below supersedes it. **What I got wrong.** I built the candidate window from a path-filtered log and treated `45c809ab` as the next commit after the passing tree. It is not — the ancestry is linear and has one commit in between: ``` e3876780 (passing) └─ 5545de92 shader: lower literal FMAs, straight SAVEXEC and reflected POS1 in mesh (#3806) └─ 45c809ab shader: lower pixel SAVEXEC lane-mask expressions (#3826) ``` `5545de92` also changed `tests/native_direct_mesh_check.py`, which is why it did not appear where I expected. I should have walked the first-parent chain instead of assuming adjacency. **Verdicts, all with each tree's own test file, same host, same `dxc.exe`, Wine spawn flakes retried and never counted:** ``` e3876780 PASS 5545de92 FAIL native compute +0x34: unmapped graphics export 45c809ab FAIL (same) ``` Since `5545de92`'s parent is the passing tree and it is the only commit in between, the regression is `5545de92`. **And it fits the symptom far better than my previous answer.** Its subject line is *"lower literal FMAs, straight SAVEXEC and **reflected POS1 in mesh**"* — a mesh-side change to reflected position exports, which is exactly the area that refuses here (an export row at `target=32`, `outputs=0`, `sig=3`). A pixel SAVEXEC lowering was always an odd culprit for a mesh export refusal; that mismatch should have made me check the ancestry more carefully. The mechanism findings stand: the refusal is static (target from the instruction word, `outputs`/`sig` from the parsed container), so the thing to compare is what `stage.outputs` contains for the same container at the two trees — and `5545de92` is the tree to compare against, not `45c809ab`. I am sorry for the wrong name in the previous comment. If you have already started looking at `45c809ab`, the useful part of that comment — the mechanism, offset and refusal site — is unchanged.
triggered02 commented 2026-12-02 14:56:43 +00:00 (Migrated from github.com)
Author
Contributor

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


Root-caused and fixed: PR #3861.

The translator is not involved. 5545de92 moved the sibling container cases onto mesh(), which writes the attribute count at io + 0x188, but left the packed-row case on the old pack(body + code, ...) path and deleted the struct.pack_into('<I', body, io + 0x188, 1) line that path needed. The shared zero-filled body then declared no output attributes, so read_guest_shader_container produced stage.outputs empty against three signature rows and the export at target 32 had nothing to map.

git diff e3876780 5545de92 -- src/gfx1013_direct_graphics.inl src/guest_shader_container.cpp is empty, which is the direct evidence that this was a fixture bug and not a lowering one.

Verified against a compile_dxil built at 5770f14e: before, it aborts at the integer-row case with unmapped graphics export; after, the fixture exits 0 and both loop iterations run.

For the record, the two wrong turns in this issue were mine: I first named 45c809ab as the culprit by assuming adjacency in a path-filtered log, and before that I framed this as a translator regression at all. The bisect was correct about when the behaviour changed; it took reading the test diff to see that the thing that changed was the fixture.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7349413378 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7349413378). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T14:56:43Z. --- Root-caused and fixed: PR #3861. The translator is not involved. `5545de92` moved the sibling container cases onto `mesh()`, which writes the attribute count at `io + 0x188`, but left the packed-row case on the old `pack(body + code, ...)` path and deleted the `struct.pack_into('<I', body, io + 0x188, 1)` line that path needed. The shared zero-filled `body` then declared no output attributes, so `read_guest_shader_container` produced `stage.outputs` empty against three signature rows and the export at `target 32` had nothing to map. `git diff e3876780 5545de92 -- src/gfx1013_direct_graphics.inl src/guest_shader_container.cpp` is empty, which is the direct evidence that this was a fixture bug and not a lowering one. Verified against a `compile_dxil` built at `5770f14e`: before, it aborts at the integer-row case with `unmapped graphics export`; after, the fixture exits 0 and both loop iterations run. For the record, the two wrong turns in this issue were mine: I first named `45c809ab` as the culprit by assuming adjacency in a path-filtered log, and before that I framed this as a translator regression at all. The bisect was correct about *when* the behaviour changed; it took reading the test diff to see that the thing that changed was the fixture.
triggered02 commented 2026-12-02 15:08:12 +00:00 (Migrated from github.com)
Author
Contributor

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


Windows is green on PR #3861: Build and test on Windows passed in 9m4s, alongside gfx1013 (3m50s) and the Linux Python checks (5m26s). That is the first run of this job on a tree containing the fixture fix, and native_direct_mesh no longer appears in the failures.

So the sequence is: fixture bug from 5545de92 -> every PR's required Windows check red -> #3861 restores the dropped attribute count -> Windows job green.

For anyone with a PR currently red on this: the fix lives in #3861, not on main yet, so re-running your checks will not help until it merges. After that, merge current main and re-run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7349786888 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3856#issuecomment-7349786888). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T15:08:12Z. --- **Windows is green on PR #3861**: `Build and test on Windows` passed in 9m4s, alongside gfx1013 (3m50s) and the Linux Python checks (5m26s). That is the first run of this job on a tree containing the fixture fix, and `native_direct_mesh` no longer appears in the failures. So the sequence is: fixture bug from `5545de92` -> every PR's required Windows check red -> #3861 restores the dropped attribute count -> Windows job green. For anyone with a PR currently red on this: the fix lives in #3861, not on `main` yet, so re-running your checks will not help until it merges. After that, merge current `main` and re-run.
Sign in to join this conversation.
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#3856
No description provided.