tests: isolate flat vertex attribute to interp-mov fixture #3700

Manually merged
github merged 1 commit from github-bot/gh-3698 into main 2026-12-02 02:13:49 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 03:03 UTC · original
Ammmae0x:tests/pixel-aot-vs-flat → main · +255 −20 · 8 files · 1 commits · merged 2026-12-02 02:09 UTC

Fixes #3695

#3625 added nointerpolation float4 flat : TEXCOORD1; unconditionally to the shared tests/pixel_aot_vs.hlsl, shifting SV_Position and breaking D3D12 PSO linkage (D3D12 660 / 0x80070057) on startup_image_load_mip_, pixel_position_centers_hardware, startup_image_gather_lz_ and bc7_draw_hardware.

This change guards the flat attribute behind PIXEL_FLAT_ATTR, builds a separate pixel_aot_vs_flat vertex shader, and routes only the v_interp_mov_f32 draw through it; every other pipeline keeps the default two-field vertex output.

What landed:

  • tests/pixel_aot_vs.hlsl: flat struct member and v.flat assignment inside #ifdef PIXEL_FLAT_ATTR; default keeps { float4 uv : TEXCOORD0; float4 position : SV_Position; }.
  • CMakeLists.txt: pixel_vs_flat build (-T vs_6_0 -E main -D PIXEL_FLAT_ATTR=1 -Vn pixel_aot_vs_flat), added to offscreen_check.
  • tests/pixel_aot_render.cpp + tests/desktop_gpu.h: bool flatAttr = false on draw_verified (both overloads), check_pixel and check_translated_pixel; flatAttr selects pixel_aot_vs_flat and refuses the combination with linearMips.
  • tests/offscreen_check.cpp: --check-pixel-flat-batch and --check-pixel-flat-case, dispatched next to their default counterparts, with self-test coverage.
  • tests/pixel_aot_check.py: check_interp_mov_draw uses --check-pixel-flat-batch / --check-pixel-flat-case (via run_pixel_batch flat=True); the channel-y and interpolated-uv negative mutations are unchanged.
  • tests/pixel_aot_vs_flat_check.py + tests/checks/python-linux/pixel_aot_vs_flat.txt: portable static regression test (39 checks).

Verification (Linux):

  • /tmp/pe-env/bin/python -B tests/pixel_aot_vs_flat_check.py: PASS (39 checks; kills the unconditional-flat mutation and the default-flag mutation on scratch copies)
  • /tmp/pe-env/bin/python -B tests/pixel_aot_check.py (no args, unit/lowering controls): exit 0
  • /tmp/pe-env/bin/python -B tests/form_coverage_check.py: pass
  • /tmp/pe-env/bin/python -B tests/docs_links_check.py: pass (198 files / 765 links)
  • /tmp/pe-env/bin/python -B tests/bidi_controls_check.py: pass (2793 files)
  • git diff --check: clean
  • No llvm-mc-15 on this host, so pixel_aot_check.py binary mode was not run; no mingw, so no Windows compile check. Windows verification is the arbiter for the GPU draws.

Windows Verification (1949fe015ca76a33409d0daa80855e2f4a3583ff)

Commit: 1949fe015ca76a33409d0daa80855e2f4a3583ff (merge-tree upstream/main HEAD -> 1eaef4a4, exit 0; git diff --check clean)
Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (vendor=10de device=28e1, driver=32.0.15.9186; WARP Microsoft Basic Render Driver)
dev: cmake --build --preset dev --target offscreen_check && ctest --preset dev --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --output-on-failure -> 12/12 passed (43.16s)
release: cmake --build --preset release --target offscreen_check && ctest --preset release --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --output-on-failure -> 12/12 passed (35.06s)
Direct checks: offscreen_check.exe --self-test (dev & release) ok; pixel_aot_vs_flat_check.py passed
Checks: form_coverage_check.py, docs_links_check.py (198 files, 765 links), bidi_controls_check.py (2794 files) -> passed

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-01 03:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3698) `Ammmae0x:tests/pixel-aot-vs-flat` → `main` · +255 −20 · 8 files · 1 commits · merged 2026-12-02 02:09 UTC Fixes #3695 #3625 added `nointerpolation float4 flat : TEXCOORD1;` unconditionally to the shared tests/pixel_aot_vs.hlsl, shifting SV_Position and breaking D3D12 PSO linkage (D3D12 660 / 0x80070057) on startup_image_load_mip_*, pixel_position_centers_hardware, startup_image_gather_lz_* and bc7_draw_hardware. This change guards the flat attribute behind PIXEL_FLAT_ATTR, builds a separate pixel_aot_vs_flat vertex shader, and routes only the v_interp_mov_f32 draw through it; every other pipeline keeps the default two-field vertex output. What landed: - tests/pixel_aot_vs.hlsl: flat struct member and v.flat assignment inside #ifdef PIXEL_FLAT_ATTR; default keeps { float4 uv : TEXCOORD0; float4 position : SV_Position; }. - CMakeLists.txt: pixel_vs_flat build (-T vs_6_0 -E main -D PIXEL_FLAT_ATTR=1 -Vn pixel_aot_vs_flat), added to offscreen_check. - tests/pixel_aot_render.cpp + tests/desktop_gpu.h: bool flatAttr = false on draw_verified (both overloads), check_pixel and check_translated_pixel; flatAttr selects pixel_aot_vs_flat and refuses the combination with linearMips. - tests/offscreen_check.cpp: --check-pixel-flat-batch and --check-pixel-flat-case, dispatched next to their default counterparts, with self-test coverage. - tests/pixel_aot_check.py: check_interp_mov_draw uses --check-pixel-flat-batch / --check-pixel-flat-case (via run_pixel_batch flat=True); the channel-y and interpolated-uv negative mutations are unchanged. - tests/pixel_aot_vs_flat_check.py + tests/checks/python-linux/pixel_aot_vs_flat.txt: portable static regression test (39 checks). Verification (Linux): - /tmp/pe-env/bin/python -B tests/pixel_aot_vs_flat_check.py: PASS (39 checks; kills the unconditional-flat mutation and the default-flag mutation on scratch copies) - /tmp/pe-env/bin/python -B tests/pixel_aot_check.py (no args, unit/lowering controls): exit 0 - /tmp/pe-env/bin/python -B tests/form_coverage_check.py: pass - /tmp/pe-env/bin/python -B tests/docs_links_check.py: pass (198 files / 765 links) - /tmp/pe-env/bin/python -B tests/bidi_controls_check.py: pass (2793 files) - git diff --check: clean - No llvm-mc-15 on this host, so pixel_aot_check.py binary mode was not run; no mingw, so no Windows compile check. Windows verification is the arbiter for the GPU draws. ### Windows Verification (`1949fe015ca76a33409d0daa80855e2f4a3583ff`) ```text Commit: 1949fe015ca76a33409d0daa80855e2f4a3583ff (merge-tree upstream/main HEAD -> 1eaef4a4, exit 0; git diff --check clean) Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (vendor=10de device=28e1, driver=32.0.15.9186; WARP Microsoft Basic Render Driver) dev: cmake --build --preset dev --target offscreen_check && ctest --preset dev --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --output-on-failure -> 12/12 passed (43.16s) release: cmake --build --preset release --target offscreen_check && ctest --preset release --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --output-on-failure -> 12/12 passed (35.06s) Direct checks: offscreen_check.exe --self-test (dev & release) ok; pixel_aot_vs_flat_check.py passed Checks: form_coverage_check.py, docs_links_check.py (198 files, 765 links), bidi_controls_check.py (2794 files) -> passed ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=1949fe015ca76a33409d0daa80855e2f4a3583ff | targets=offscreen_check | ctest=^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw) | release=true -->
Fixes #3693: guard the flat p0 input in tests/pixel_aot_vs.hlsl behind
PIXEL_FLAT_ATTR, build a separate pixel_aot_vs_flat vertex shader, and
route only the v_interp_mov_f32 draw through it via --check-pixel-flat-batch
and --check-pixel-flat-case, so every other pipeline keeps the default
two-field vertex output and SV_Position stays on the same hardware register.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 03:06:43 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-12-01 03:46 UTC · original

Verified at 1949fe015 on this host (RTX 4070 Ti SUPER, driver 32.0.16.2101, Windows 10.0.26200) and on WARP, after a full rebuild:

startup_image_load_mip_warp            Passed  0.78 s
startup_image_load_mip_hardware        Passed  1.38 s
pixel_position_centers_warp            Passed  0.21 s
pixel_position_centers_hardware        Passed  0.54 s
startup_image_gather_lz_warp           Passed  4.93 s
startup_image_gather_lz_hardware       Passed  7.45 s
bc7_draw_warp                          Passed  6.36 s
bc7_draw_hardware                      Passed 16.07 s
pixel_aot_interp_mov_warp              Passed  4.25 s
pixel_aot_interp_mov_hardware          Passed  4.76 s
10/10

The four 660 failures are gone in both backends and the interpolation-move fixtures still pass, so the variant split does what the issue needed.

For the record, since #3695 suggested it: reordering the fields in the shared struct (flat after position) also clears the four failures, but then pixel_aot_interp_mov_{warp,hardware} fail with 660 on TEXCOORD. A single shared layout cannot serve both consumers, which is why this shape — a guarded variant — is the right one rather than a reorder.

**@⁠KelboLive** on GitHub · 2026-12-01 03:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3698#issuecomment-7300056379) Verified at `1949fe015` on this host (RTX 4070 Ti SUPER, driver 32.0.16.2101, Windows 10.0.26200) and on WARP, after a full rebuild: ``` startup_image_load_mip_warp Passed 0.78 s startup_image_load_mip_hardware Passed 1.38 s pixel_position_centers_warp Passed 0.21 s pixel_position_centers_hardware Passed 0.54 s startup_image_gather_lz_warp Passed 4.93 s startup_image_gather_lz_hardware Passed 7.45 s bc7_draw_warp Passed 6.36 s bc7_draw_hardware Passed 16.07 s pixel_aot_interp_mov_warp Passed 4.25 s pixel_aot_interp_mov_hardware Passed 4.76 s 10/10 ``` The four `660` failures are gone in both backends and the interpolation-move fixtures still pass, so the variant split does what the issue needed. For the record, since #3695 suggested it: reordering the fields in the shared struct (`flat` after `position`) also clears the four failures, but then `pixel_aot_interp_mov_{warp,hardware}` fail with 660 on `TEXCOORD`. A single shared layout cannot serve both consumers, which is why this shape — a guarded variant — is the right one rather than a reorder.
Author
Owner

@⁠Makto94 on GitHub · 2026-12-01 13:03 UTC · original

Independent run of the PR head against main a061032fc, plus the PR merged locally onto a fresh main e1161e43a (no conflicts; merge 822c2131d, not pushed).

Environment: NVIDIA GeForce RTX 3070 Ti (vendor=10de device=2482), driver 32.0.16.2101 (621.01); WARP 10.0.26100.9818; Windows 11 Pro 10.0.26300.9974; debug layer enabled (debug_layer=enabled in the test output); dxc from Windows SDK 10.0.26100.0. ctest --preset dev, -j1. Full build on main, then an incremental (ninja) rebuild of the PR head in the same tree.

Under test:

  • main a061032fc (before)
  • PR head 1949fe015 (merge base with main 1a9ccbc4e, tested as is, not rebased)
  • PR head merged onto main e1161e43a (local merge 822c2131d, incremental rebuild)

Commands:

  1. ctest --preset dev --no-tests=error -R 'startup_compute_gather_l' --repeat until-fail:30 -j1 -V
    (the regex also matches startup_compute_gather_lz*)
  2. ctest --preset dev --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --repeat until-fail:N -j1 (N=30 on main, N=5 on the PR head and on the merge)

Command 1:

Test main a061032fc PR 1949fe015 PR + main e1161e43a
startup_compute_gather_l_warp Failed, repetition 1 30/30 Passed 30/30 Passed
startup_compute_gather_l_hardware Failed, repetition 1 30/30 Passed 30/30 Passed
startup_compute_gather_l 30/30 Passed 30/30 Passed 30/30 Passed
startup_compute_gather_lz, _warp, _hardware Passed 30/30 Passed 30/30 Passed 30/30

First error on main (warp; hardware stops at the same assertion):
D3D12 660: CreateGraphicsPipelineState: Vertex Shader - Pixel Shader linkage error ... Semantic 'SV_Position' is defined for mismatched hardware registers and Translated pixel pipeline failed (HRESULT 0x80070057), raised from dispatch_ps (startup_compute_gather_l_check.py:337). The word=0 expected=3f1020e2 actual=... lines printed before it come from the negative controls of the same check (the last one before the traceback, actual=3f201062, is the ignored_max_lod mutant); they also appear in passing runs. startup_compute_gather_l (no suffix) passes on main too.

Command 2, main (this run used --repeat until-fail:30): 8 of 12 failed on repetition 1 with the same 660:
startup_image_load_mip_{warp,hardware}, pixel_position_centers_{warp,hardware}, startup_image_gather_lz_{warp,hardware}, bc7_draw_{warp,hardware}.
Passed 30/30: startup_image_gather_lz, startup_image_load_mip_controls, pixel_aot_interp_mov_{warp,hardware}.

Command 2, PR head (--repeat until-fail:5): 12/12 tests passed, 5/5 repetitions each, including pixel_aot_interp_mov_{warp,hardware}.

Command 2, PR merged onto e1161e43a (--repeat until-fail:5): 12/12 tests passed, 5/5 repetitions each.

pixel_aot_vs_flat matched no CTest entry in this build (the 12 tests above are the whole selection). Skips (77): none observed.

Main e1161e43a without the PR was not run; the failing column is main a061032fc. Between a061032fc and e1161e43a the only commit touching a file of this PR is 6a808745c (three lines in CMakeLists.txt). tests/pixel_aot_vs_flat_check.py was not run.

These results cover only the tests above, on one NVIDIA GPU and on WARP.

**@⁠Makto94** on GitHub · 2026-12-01 13:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3698#issuecomment-7312036682) Independent run of the PR head against main `a061032fc`, plus the PR merged locally onto a fresh main `e1161e43a` (no conflicts; merge `822c2131d`, not pushed). Environment: NVIDIA GeForce RTX 3070 Ti (vendor=10de device=2482), driver 32.0.16.2101 (621.01); WARP 10.0.26100.9818; Windows 11 Pro 10.0.26300.9974; debug layer enabled (`debug_layer=enabled` in the test output); dxc from Windows SDK 10.0.26100.0. `ctest --preset dev`, `-j1`. Full build on main, then an incremental (ninja) rebuild of the PR head in the same tree. Under test: - main `a061032fc` (before) - PR head `1949fe015` (merge base with main `1a9ccbc4e`, tested as is, not rebased) - PR head merged onto main `e1161e43a` (local merge `822c2131d`, incremental rebuild) Commands: 1. `ctest --preset dev --no-tests=error -R 'startup_compute_gather_l' --repeat until-fail:30 -j1 -V` (the regex also matches `startup_compute_gather_lz*`) 2. `ctest --preset dev --no-tests=error -R '^(startup_image_load_mip|pixel_aot_interp_mov|pixel_position_centers|startup_image_gather_lz|bc7_draw|pixel_aot_vs_flat)' --repeat until-fail:N -j1` (N=30 on main, N=5 on the PR head and on the merge) Command 1: | Test | main `a061032fc` | PR `1949fe015` | PR + main `e1161e43a` | |---|---|---|---| | startup_compute_gather_l_warp | Failed, repetition 1 | 30/30 Passed | 30/30 Passed | | startup_compute_gather_l_hardware | Failed, repetition 1 | 30/30 Passed | 30/30 Passed | | startup_compute_gather_l | 30/30 Passed | 30/30 Passed | 30/30 Passed | | startup_compute_gather_lz, _warp, _hardware | Passed 30/30 | Passed 30/30 | Passed 30/30 | First error on main (warp; hardware stops at the same assertion): `D3D12 660: CreateGraphicsPipelineState: Vertex Shader - Pixel Shader linkage error ... Semantic 'SV_Position' is defined for mismatched hardware registers` and `Translated pixel pipeline failed (HRESULT 0x80070057)`, raised from `dispatch_ps` (`startup_compute_gather_l_check.py:337`). The `word=0 expected=3f1020e2 actual=...` lines printed before it come from the negative controls of the same check (the last one before the traceback, `actual=3f201062`, is the `ignored_max_lod` mutant); they also appear in passing runs. `startup_compute_gather_l` (no suffix) passes on main too. Command 2, main (this run used `--repeat until-fail:30`): 8 of 12 failed on repetition 1 with the same 660: startup_image_load_mip_{warp,hardware}, pixel_position_centers_{warp,hardware}, startup_image_gather_lz_{warp,hardware}, bc7_draw_{warp,hardware}. Passed 30/30: startup_image_gather_lz, startup_image_load_mip_controls, pixel_aot_interp_mov_{warp,hardware}. Command 2, PR head (`--repeat until-fail:5`): 12/12 tests passed, 5/5 repetitions each, including pixel_aot_interp_mov_{warp,hardware}. Command 2, PR merged onto `e1161e43a` (`--repeat until-fail:5`): 12/12 tests passed, 5/5 repetitions each. `pixel_aot_vs_flat` matched no CTest entry in this build (the 12 tests above are the whole selection). Skips (77): none observed. Main `e1161e43a` without the PR was not run; the failing column is main `a061032fc`. Between `a061032fc` and `e1161e43a` the only commit touching a file of this PR is `6a808745c` (three lines in `CMakeLists.txt`). `tests/pixel_aot_vs_flat_check.py` was not run. These results cover only the tests above, on one NVIDIA GPU and on WARP.
github manually merged commit de1bb5aa73 into main 2026-12-02 02:13:49 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.