tests: the shared pixel_aot vertex shader breaks three translated pixel pipelines #3693

Closed
opened 2026-12-01 02:36:18 +00:00 by KelboLive · 2 comments
KelboLive commented 2026-12-01 02:36:18 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-12-01T02:36:18Z.


tests: the shared pixel_aot_vs.hlsl vertex output breaks three translated pixel pipelines

Summary

Three tests fail on main with debug layer message 660, and the cause is not the shader lowering that #3623
adds — it is a fixture vertex shader that gained an output attribute and is compiled into offscreen_check,
where every translated pixel pipeline sees it.

startup_image_load_mip_{warp,hardware}        id 660
pixel_position_centers_hardware               id 660
startup_image_gather_lz_{warp,hardware}       id 660

D3D12 660: ID3D12Device::CreateGraphicsPipelineState: Vertex Shader - Pixel Shader linkage error:
Signatures between stages are incompatible. Semantic 'SV_Position' is defined for mismatched hardware
registers between the output stage and input stage.
Translated pixel pipeline failed (HRESULT 0x80070057)

Deterministic: startup_image_load_mip_warp fails 3/3 at the current head.

Cause

#3623 (4eb7e70d8) changed the shared fixture vertex shader:

-struct Vertex { float4 uv : TEXCOORD0; float4 position : SV_Position; };
+struct Vertex { float4 uv : TEXCOORD0; nointerpolation float4 flat : TEXCOORD1; float4 position : SV_Position; };
...
+    v.flat = float4(0.125f, -0.25f, 2.0f, 4.0f);

tests/pixel_aot_vs.hlsl is compiled into offscreen_check (via pixel_aot_render.cpp / pixel_compare_render.cpp).
Adding a packed output between TEXCOORD0 and SV_Position moves SV_Position to different hardware
registers, while the pixel shaders other fixtures build do not declare the new input — hence message 660.

Evidence

The previous hardware sweep at bee9c64 was 990/990; the current sweep at 12a0e309f has these three.

Bisect on the warp variant (0.7 s), rebuild at each step:

Commit Result
0e8aabf1c (before #3623) Passed 3/3
4eb7e70d8 (#3623) Failed 3/3
12a0e309f (current main) Failed

Controlled experiment at 4eb7e70d8: restore the two files #3623 changed (tests/pixel_aot_vs.hlsl,
tools/pixel_aot.py) to their 0e8aabf1c content, rebuild, and all three pass. So the vertex-shader
change is the variable, not the renamed lowerings.

Note the rebuild is required: the shader is compiled in at build time, which is why an earlier attempt at the
same experiment looked like it made no difference.

Suggested fix

Keep the flat attribute out of the shared shader. Either:

  • put it behind a define that only pixel_aot_interp_mov builds with, as PIXEL_MIP_LINEAR already does for
    the MinLod variant, or
  • give the interpolation-move fixture its own vertex shader.

The new pixel_aot_interp_mov_{warp,hardware} tests need the attribute, so the fix has to keep those passing
while restoring the previous output layout for everything else.

Why it was not caught before merge

  • None of the three failing tests is in the pr preset.
  • main's own full runs have been cancelled for hours (see #3507), so the first full suite after the merge
    was this sweep.

Not covered here

Two other tests failed in the same sweep and look unrelated: startup_compute_gather_l_hardware and
bc7_draw_hardware (the second reports debug_errors=0, so it is a readback mismatch rather than a pipeline
failure). They need separate triage.

Refs #3623, #3507.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6711044394 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3693). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T02:36:18Z. --- # tests: the shared `pixel_aot_vs.hlsl` vertex output breaks three translated pixel pipelines ## Summary Three tests fail on `main` with debug layer message 660, and the cause is not the shader lowering that #3623 adds — it is a **fixture vertex shader** that gained an output attribute and is compiled into `offscreen_check`, where every translated pixel pipeline sees it. ``` startup_image_load_mip_{warp,hardware} id 660 pixel_position_centers_hardware id 660 startup_image_gather_lz_{warp,hardware} id 660 D3D12 660: ID3D12Device::CreateGraphicsPipelineState: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. Semantic 'SV_Position' is defined for mismatched hardware registers between the output stage and input stage. Translated pixel pipeline failed (HRESULT 0x80070057) ``` Deterministic: `startup_image_load_mip_warp` fails 3/3 at the current head. ## Cause #3623 (`4eb7e70d8`) changed the **shared** fixture vertex shader: ```diff -struct Vertex { float4 uv : TEXCOORD0; float4 position : SV_Position; }; +struct Vertex { float4 uv : TEXCOORD0; nointerpolation float4 flat : TEXCOORD1; float4 position : SV_Position; }; ... + v.flat = float4(0.125f, -0.25f, 2.0f, 4.0f); ``` `tests/pixel_aot_vs.hlsl` is compiled into `offscreen_check` (via `pixel_aot_render.cpp` / `pixel_compare_render.cpp`). Adding a packed output between `TEXCOORD0` and `SV_Position` moves `SV_Position` to different hardware registers, while the pixel shaders other fixtures build do not declare the new input — hence message 660. ## Evidence The previous hardware sweep at `bee9c64` was 990/990; the current sweep at `12a0e309f` has these three. Bisect on the warp variant (0.7 s), rebuild at each step: | Commit | Result | |---|---| | `0e8aabf1c` (before #3623) | Passed 3/3 | | `4eb7e70d8` (#3623) | Failed 3/3 | | `12a0e309f` (current main) | Failed | Controlled experiment at `4eb7e70d8`: restore the two files #3623 changed (`tests/pixel_aot_vs.hlsl`, `tools/pixel_aot.py`) to their `0e8aabf1c` content, **rebuild**, and all three pass. So the vertex-shader change is the variable, not the renamed lowerings. Note the rebuild is required: the shader is compiled in at build time, which is why an earlier attempt at the same experiment looked like it made no difference. ## Suggested fix Keep the flat attribute out of the shared shader. Either: - put it behind a define that only `pixel_aot_interp_mov` builds with, as `PIXEL_MIP_LINEAR` already does for the MinLod variant, or - give the interpolation-move fixture its own vertex shader. The new `pixel_aot_interp_mov_{warp,hardware}` tests need the attribute, so the fix has to keep those passing while restoring the previous output layout for everything else. ## Why it was not caught before merge - None of the three failing tests is in the `pr` preset. - `main`'s own full runs have been cancelled for hours (see #3507), so the first full suite after the merge was this sweep. ## Not covered here Two other tests failed in the same sweep and look unrelated: `startup_compute_gather_l_hardware` and `bc7_draw_hardware` (the second reports `debug_errors=0`, so it is a readback mismatch rather than a pipeline failure). They need separate triage. Refs #3623, #3507.
KelboLive commented 2026-12-01 02:46:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-12-01T02:46:30Z.


c7_draw_hardware belongs here too — I had filed it as "untriaged", but its failure is the same message:

Band control inside: the next texel must be accepted:
Translated pixel pipeline failed (HRESULT 0x80070057)
D3D12 660: ... Semantic 'SV_Position' is defined for mismatched hardware registers ...

So the shared vertex shader breaks four tests, not three. The readback lines that come before it (max_absolute_error=0, debug_errors=0) are what made it look like a separate readback mismatch.

That leaves only startup_compute_gather_l_hardware unexplained from the sweep; it is a value mismatch (word=0 expected=3f1020e2 actual=3f201062), reproduces on warp, and I am bisecting it separately.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7298981216 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3693#issuecomment-7298981216). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T02:46:30Z. --- c7_draw_hardware belongs here too — I had filed it as "untriaged", but its failure is the same message: ``` Band control inside: the next texel must be accepted: Translated pixel pipeline failed (HRESULT 0x80070057) D3D12 660: ... Semantic 'SV_Position' is defined for mismatched hardware registers ... ``` So the shared vertex shader breaks four tests, not three. The readback lines that come before it (`max_absolute_error=0`, `debug_errors=0`) are what made it look like a separate readback mismatch. That leaves only `startup_compute_gather_l_hardware` unexplained from the sweep; it is a value mismatch (`word=0 expected=3f1020e2 actual=3f201062`), reproduces on warp, and I am bisecting it separately.
KelboLive commented 2026-12-01 03:18:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-12-01T03:18:36Z.


Measured a candidate fix, and it narrows the answer usefully.

Reordering the new output so SV_Position keeps its register:

-struct Vertex { float4 uv : TEXCOORD0; nointerpolation float4 flat : TEXCOORD1; float4 position : SV_Position; };
+struct Vertex { float4 uv : TEXCOORD0; float4 position : SV_Position; nointerpolation float4 flat : TEXCOORD1; };

Result at daddf6155 + that change, after a rebuild:

Test Before After reorder
startup_image_load_mip_warp Failed (660) Passed 0.80 s
pixel_position_centers_hardware Failed (660) Passed 0.54 s
startup_image_gather_lz_warp Failed (660) Passed 7.32 s
bc7_draw_hardware Failed (660) Passed 27.85 s
pixel_aot_interp_mov_warp Passed Failed — 660 on TEXCOORD
pixel_aot_interp_mov_hardware Passed Failed — 660 on TEXCOORD

So the two consumers genuinely need different vertex layouts: whatever fixes the four moves flat off the register the interpolation-move shader expects, and the symmetry does not close.

That makes a single shared shader the wrong shape for this. The fix is a variant — the attribute behind a define the way PIXEL_MIP_LINEAR already provides a MinLod variant, or a separate vertex shader for the interpolation-move fixture — so the four unaffected fixtures keep the previous layout. I have left the tree unmodified; the experiment was reverted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7299567998 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3693#issuecomment-7299567998). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T03:18:36Z. --- Measured a candidate fix, and it narrows the answer usefully. Reordering the new output so `SV_Position` keeps its register: ```diff -struct Vertex { float4 uv : TEXCOORD0; nointerpolation float4 flat : TEXCOORD1; float4 position : SV_Position; }; +struct Vertex { float4 uv : TEXCOORD0; float4 position : SV_Position; nointerpolation float4 flat : TEXCOORD1; }; ``` Result at `daddf6155` + that change, after a rebuild: | Test | Before | After reorder | |---|---|---| | `startup_image_load_mip_warp` | Failed (660) | **Passed** 0.80 s | | `pixel_position_centers_hardware` | Failed (660) | **Passed** 0.54 s | | `startup_image_gather_lz_warp` | Failed (660) | **Passed** 7.32 s | | `bc7_draw_hardware` | Failed (660) | **Passed** 27.85 s | | `pixel_aot_interp_mov_warp` | Passed | **Failed** — 660 on TEXCOORD | | `pixel_aot_interp_mov_hardware` | Passed | **Failed** — 660 on TEXCOORD | So the two consumers genuinely need different vertex layouts: whatever fixes the four moves `flat` off the register the interpolation-move shader expects, and the symmetry does not close. That makes a single shared shader the wrong shape for this. The fix is a variant — the attribute behind a define the way `PIXEL_MIP_LINEAR` already provides a MinLod variant, or a separate vertex shader for the interpolation-move fixture — so the four unaffected fixtures keep the previous layout. I have left the tree unmodified; the experiment was reverted.
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#3693
No description provided.