startup: identify a rotated rectangle corner by its diagonal #3142

Merged
lambirou merged 3 commits from upstream-pr/3142 into main 2026-11-27 22:59:42 +00:00
lambirou commented 2026-11-27 18:01:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:01:55Z.


Change

The indexed rectangle stage identified the right-angle corner by testing whether a corner shares an x or a y with each neighbour. A rotated rectangle has no axis-aligned edge, so no corner matched and the stage returned before emitting either triangle: the region the rectangle covered stayed unpainted, bounded by its diagonal. The vertex-stage rectangle expansion has no such restriction (v0 + v2 - v1), so the two implementations of the same rule disagreed.

The corner is now also identified from the shape: the vertex opposite the diagonal (the longest of the three edges), with the two sides required to meet at a right angle (|dot|^2 <= 1e-6 |pa|^2 |pb|^2) so a shape that is not a rectangle stays undrawn as before. The axis test keeps precedence, so every input it accepted is unchanged. Both src/startup_stubs/indexed_rect_geometry.h and the native rule of src/gfx1013_rect_geometry.cpp use it.

tests/startup_rect_geometry.cpp draws one rectangle named by three corners with back-face culling on: the axis order and the swung order keep their result, the same square turned by 15 degrees goes from 32/32 differing pixels to 0/32, and a non-rectangle stays undrawn.

tests/startup_rect_gap.cpp and tests/startup_rect_gap_check.py add the reported synthetic draw: eight 12-byte records (mask at +0, XY at +4), two vertex-buffer views over the same records, an R16 indexed triangle list and a six-vertex rectangle list of the same quad and edge ring, a mask-controlled pixel shader and a constant-colour control, an RGBA8 target, with and without back-face culling. It also pins the bound vertex and index bytes, the .ia request and the two generated fetch loads.

Refs #3131. Target main.

Verification

Windows 11 build 26300 (26H2), MSVC 19.44.35228, Windows SDK/DXC 10.0.26100.0, base 63a30dc1. Commit e387d855.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^(startup_rect_geometry|startup_rect_gap)_(warp|hardware)$' -V
ctest --preset dev --no-tests=error -R '^(startup_indirect_translated_indexed_rect|startup_indirect_rectlist|native_direct_container|rectlist_topology|rectlist_draw)_(warp|hardware)?$'
python -B tests/docs_links_check.py
  • startup_rect_geometry: 2/2, WARP (Microsoft Basic Render Driver 10.0.26100.10068) and AMD Radeon RX 9060 XT (driver 32.0.32029.2010). Rotated case: 32/32 differing pixels before the fix, 0/32 after; axis and swung orders unchanged; the non-rectangle refusal is kept.
  • startup_rect_gap: 2/2, but the runtime draw reported the Microsoft Basic Render Driver in both backends, so both pictures are WARP results. The reported diagonal gap does not reproduce for the described input (details in docs/experiments/startup-rect-gap.md).
  • Existing rectangle regressions: 6/6 pass.
  • docs_links_check: 98 files and 589 links.

The D3D12 debug layer is unavailable on this host (D3D12GetDebugInterface fails), so the fixtures print debug_layer=unavailable and no debug-layer verdict is claimed.

Evidence and follow-up

All inputs are source-built gfx1013 bytecode and synthetic vertex/index data; no game files or captures. The fix addresses a real cause of a sharply bounded missing region in an indexed rectangle pass, but the exact #3131 draw is not reproduced by the described 12-byte-stride triangle input. Open candidates are recorded in the note: a vertex view that declares fewer bytes than the indices name, a translated non-indexed indirect rectangle list that keeps the three-vertices-per-rectangle count, and the rectangle stage's flat FPARAM taking the first vertex's value for both triangles instead of each provoking vertex.

Review update (2026-11-27, 04c82a48)

tedin7's blocking compile failure is fixed. src/gfx1013_rect_geometry.cpp now writes the binary32 value of 1e-6 as the exact hexadecimal double 0x3EB0C6F7A0000000; LLVM IR accepts it and gfx1013-container-rect publishes the native pair again. native_rectangle_pso_warp passes in dev and release.

Added native_rectangle_geometry_warp for the coverage gap. It compiles a native VS/PS/GS pair whose VS exports only SV_Position, then runs the standalone startup_rect_geometry fixture with --native-vs, --native-ps and --native-gs. The native GS draws the independent axis, swung and rotated scenes with back-face culling on; all three read back 0 of 32 pixels differing from the literal rectangle model. The HLSL and native implementations are now pinned by readback, not only by compiling the IR.

Verification at 04c82a48:

ctest --preset dev --no-tests=error -j 1 -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|startup_rect_geometry_warp|startup_rect_geometry_hardware|startup_rect_gap_warp|startup_rect_gap_hardware)$'
ctest --preset release --no-tests=error -j 1 -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|startup_rect_geometry_warp|startup_rect_geometry_hardware|startup_rect_gap_warp|startup_rect_gap_hardware)$'

Both presets: 6/6 passed. The native readback is WARP-only; the standalone HLSL geometry test also passes on the RX 9060 XT. The debug layer remains unavailable (D3D12GetDebugInterface fails). docs_links_check passes with 98 files and 589 links.

Review update (2026-11-27, 24bf6c99)

pigalot's non-rectangle finding is addressed. The fixture now has a fourth scene, skewed: the top-left corner is moved a quarter of the way toward the top-right, so the triangle has no axis corner and no right angle. The stage must leave the target clear. The same scene runs through the HLSL and native geometry stages, so it pins the right-angle guard in both copies.

Debug and Release: native_rectangle_geometry_warp, startup_rect_geometry_warp and startup_rect_geometry_hardware all pass; skewed reports 0 of 32 pixels differing. The experiment note records the new case. CI is running on 24bf6c99.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5531062282 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T18:01:55Z. --- ## Change The indexed rectangle stage identified the right-angle corner by testing whether a corner shares an x or a y with each neighbour. A rotated rectangle has no axis-aligned edge, so no corner matched and the stage returned before emitting either triangle: the region the rectangle covered stayed unpainted, bounded by its diagonal. The vertex-stage rectangle expansion has no such restriction (`v0 + v2 - v1`), so the two implementations of the same rule disagreed. The corner is now also identified from the shape: the vertex opposite the diagonal (the longest of the three edges), with the two sides required to meet at a right angle (`|dot|^2 <= 1e-6 |pa|^2 |pb|^2`) so a shape that is not a rectangle stays undrawn as before. The axis test keeps precedence, so every input it accepted is unchanged. Both `src/startup_stubs/indexed_rect_geometry.h` and the native rule of `src/gfx1013_rect_geometry.cpp` use it. `tests/startup_rect_geometry.cpp` draws one rectangle named by three corners with back-face culling on: the axis order and the swung order keep their result, the same square turned by 15 degrees goes from 32/32 differing pixels to 0/32, and a non-rectangle stays undrawn. `tests/startup_rect_gap.cpp` and `tests/startup_rect_gap_check.py` add the reported synthetic draw: eight 12-byte records (mask at +0, XY at +4), two vertex-buffer views over the same records, an R16 indexed triangle list and a six-vertex rectangle list of the same quad and edge ring, a mask-controlled pixel shader and a constant-colour control, an RGBA8 target, with and without back-face culling. It also pins the bound vertex and index bytes, the `.ia` request and the two generated fetch loads. Refs #3131. Target main. ## Verification Windows 11 build 26300 (26H2), MSVC 19.44.35228, Windows SDK/DXC 10.0.26100.0, base `63a30dc1`. Commit `e387d855`. ``` cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^(startup_rect_geometry|startup_rect_gap)_(warp|hardware)$' -V ctest --preset dev --no-tests=error -R '^(startup_indirect_translated_indexed_rect|startup_indirect_rectlist|native_direct_container|rectlist_topology|rectlist_draw)_(warp|hardware)?$' python -B tests/docs_links_check.py ``` - `startup_rect_geometry`: 2/2, WARP (Microsoft Basic Render Driver 10.0.26100.10068) and AMD Radeon RX 9060 XT (driver 32.0.32029.2010). Rotated case: 32/32 differing pixels before the fix, 0/32 after; axis and swung orders unchanged; the non-rectangle refusal is kept. - `startup_rect_gap`: 2/2, but the runtime draw reported the Microsoft Basic Render Driver in both backends, so both pictures are WARP results. The reported diagonal gap does not reproduce for the described input (details in `docs/experiments/startup-rect-gap.md`). - Existing rectangle regressions: 6/6 pass. - `docs_links_check`: 98 files and 589 links. The D3D12 debug layer is unavailable on this host (`D3D12GetDebugInterface` fails), so the fixtures print `debug_layer=unavailable` and no debug-layer verdict is claimed. ## Evidence and follow-up All inputs are source-built gfx1013 bytecode and synthetic vertex/index data; no game files or captures. The fix addresses a real cause of a sharply bounded missing region in an indexed rectangle pass, but the exact #3131 draw is not reproduced by the described 12-byte-stride triangle input. Open candidates are recorded in the note: a vertex view that declares fewer bytes than the indices name, a translated non-indexed indirect rectangle list that keeps the three-vertices-per-rectangle count, and the rectangle stage's flat `FPARAM` taking the first vertex's value for both triangles instead of each provoking vertex. ## Review update (2026-11-27, `04c82a48`) tedin7's blocking compile failure is fixed. `src/gfx1013_rect_geometry.cpp` now writes the binary32 value of `1e-6` as the exact hexadecimal double `0x3EB0C6F7A0000000`; LLVM IR accepts it and `gfx1013-container-rect` publishes the native pair again. `native_rectangle_pso_warp` passes in dev and release. Added `native_rectangle_geometry_warp` for the coverage gap. It compiles a native VS/PS/GS pair whose VS exports only `SV_Position`, then runs the standalone `startup_rect_geometry` fixture with `--native-vs`, `--native-ps` and `--native-gs`. The native GS draws the independent `axis`, `swung` and `rotated` scenes with back-face culling on; all three read back 0 of 32 pixels differing from the literal rectangle model. The HLSL and native implementations are now pinned by readback, not only by compiling the IR. Verification at `04c82a48`: ``` ctest --preset dev --no-tests=error -j 1 -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|startup_rect_geometry_warp|startup_rect_geometry_hardware|startup_rect_gap_warp|startup_rect_gap_hardware)$' ctest --preset release --no-tests=error -j 1 -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|startup_rect_geometry_warp|startup_rect_geometry_hardware|startup_rect_gap_warp|startup_rect_gap_hardware)$' ``` Both presets: 6/6 passed. The native readback is WARP-only; the standalone HLSL geometry test also passes on the RX 9060 XT. The debug layer remains unavailable (`D3D12GetDebugInterface` fails). `docs_links_check` passes with 98 files and 589 links. ## Review update (2026-11-27, `24bf6c99`) pigalot's non-rectangle finding is addressed. The fixture now has a fourth scene, `skewed`: the top-left corner is moved a quarter of the way toward the top-right, so the triangle has no axis corner and no right angle. The stage must leave the target clear. The same scene runs through the HLSL and native geometry stages, so it pins the right-angle guard in both copies. Debug and Release: `native_rectangle_geometry_warp`, `startup_rect_geometry_warp` and `startup_rect_geometry_hardware` all pass; `skewed` reports 0 of 32 pixels differing. The experiment note records the new case. CI is running on `24bf6c99`.
tedin7 commented 2026-11-27 20:46:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T20:46:20Z.

Review: COMMENTED


Review of e387d855 (comment only). I ran the PR's tests and the neighbouring native rectangle test on this exact head on Windows Server 2025 (D3D12 WARP, MSVC 14.44.35207), dev and release.

Blocking: the native rectangle path no longer compiles. native_rectangle_pso_warp passes on main and fails on this head in both presets. compile_dxil refuses the rectangle pair:

shader: floating point constant invalid for type
  %t109 = fmul float %t108, 1.000000e-06

LLVM IR only accepts a decimal float constant that is exactly representable in binary32, and 1e-6 is not. That is why the rest of the file and gfx1013_direct_compute.inl only use exact values such as 3.906250e-03. The new tolerance in native_rectangle_geometry (src/gfx1013_rect_geometry.cpp) should be written as the hex double of the rounded float, 0x3EB0C6F7A0000000, or replaced by an exact power of two such as 2^-20, written in full as 9.5367431640625e-07. As it stands, every native graphics pair that uses the rectangle stage is refused, not only the rotated case.

Coverage gap in the native path. The rotated case is drawn and read back only through the HLSL stage in indexed_rect_geometry.h (startup_rect_geometry_*, startup_rect_gap_*, all passing here). The IR copy in gfx1013_rect_geometry.cpp is checked only by native_rectangle_pso_warp, which builds a PSO but draws nothing. That test caught the constant above, but it would not catch a wrong corner choice. A readback of the rotated rectangle through the native pair, even an IR-level evaluation like the native_*_ir checks, would pin the two implementations to the same rule.

Logic, which reads correctly to me:

  • The fallback only runs when no axis corner matched, in both copies, so axis-aligned rectangles keep their old corner.
  • The longest-edge test picks at most one vertex.
  • A zero-length side cannot pass: across > side_b fails when p == a.
  • NaN positions fail the ordered compares.
  • The 1e-6 bound on the squared cosine allows about 0.06 degrees off a right angle, which is reasonable for transformed positions.

Results on e387d855, dev and release:

  • startup_rect_geometry_warp and _hardware: passed.
  • startup_rect_gap_warp and _hardware: passed.
  • startup_stream_draw_warp and _hardware: passed.
  • native_rectangle_pso_warp: failed, as above. It passes on main.

The PR does not touch any file that cpp-migration changes. I did not run the cpp-migration merge leg, because the head itself fails a native test.

Merge: I am leaving the merge to R0Y00. Besides the blocker above, #3131 comes from a rendering problem seen while running a title, and we cannot check the title-level claim ourselves.

Commands:

  • cmake --build --preset <dev|release> --target startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check
  • ctest --preset <dev|release> -R '^startup_rect_(geometry|gap)|^native_rectangle_pso|^startup_stream_draw|^startup_indexed_rect'
  • git diff origin/main...pull/3142/head (read)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093200716 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#pullrequestreview-6093200716). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-27T20:46:20Z. **Review:** COMMENTED --- Review of e387d855 (comment only). I ran the PR's tests and the neighbouring native rectangle test on this exact head on Windows Server 2025 (D3D12 WARP, MSVC 14.44.35207), dev and release. **Blocking: the native rectangle path no longer compiles.** `native_rectangle_pso_warp` passes on main and fails on this head in both presets. `compile_dxil` refuses the rectangle pair: ``` shader: floating point constant invalid for type %t109 = fmul float %t108, 1.000000e-06 ``` LLVM IR only accepts a decimal `float` constant that is exactly representable in binary32, and 1e-6 is not. That is why the rest of the file and `gfx1013_direct_compute.inl` only use exact values such as `3.906250e-03`. The new tolerance in `native_rectangle_geometry` (`src/gfx1013_rect_geometry.cpp`) should be written as the hex double of the rounded float, `0x3EB0C6F7A0000000`, or replaced by an exact power of two such as 2^-20, written in full as `9.5367431640625e-07`. As it stands, every native graphics pair that uses the rectangle stage is refused, not only the rotated case. **Coverage gap in the native path.** The rotated case is drawn and read back only through the HLSL stage in `indexed_rect_geometry.h` (`startup_rect_geometry_*`, `startup_rect_gap_*`, all passing here). The IR copy in `gfx1013_rect_geometry.cpp` is checked only by `native_rectangle_pso_warp`, which builds a PSO but draws nothing. That test caught the constant above, but it would not catch a wrong corner choice. A readback of the rotated rectangle through the native pair, even an IR-level evaluation like the `native_*_ir` checks, would pin the two implementations to the same rule. **Logic, which reads correctly to me:** - The fallback only runs when no axis corner matched, in both copies, so axis-aligned rectangles keep their old corner. - The longest-edge test picks at most one vertex. - A zero-length side cannot pass: `across > side_b` fails when `p == a`. - NaN positions fail the ordered compares. - The 1e-6 bound on the squared cosine allows about 0.06 degrees off a right angle, which is reasonable for transformed positions. **Results on `e387d855`, dev and release:** - `startup_rect_geometry_warp` and `_hardware`: passed. - `startup_rect_gap_warp` and `_hardware`: passed. - `startup_stream_draw_warp` and `_hardware`: passed. - `native_rectangle_pso_warp`: failed, as above. It passes on main. The PR does not touch any file that `cpp-migration` changes. I did not run the `cpp-migration` merge leg, because the head itself fails a native test. **Merge:** I am leaving the merge to R0Y00. Besides the blocker above, #3131 comes from a rendering problem seen while running a title, and we cannot check the title-level claim ourselves. Commands: - `cmake --build --preset <dev|release> --target startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check` - `ctest --preset <dev|release> -R '^startup_rect_(geometry|gap)|^native_rectangle_pso|^startup_stream_draw|^startup_indexed_rect'` - `git diff origin/main...pull/3142/head` (read) AI-assisted; commands listed were executed locally.
lambirou commented 2026-11-27 21:04:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T21:04:09Z.


@tedin7 thanks, the compile failure was real. Fixed on 04c82a48: src/gfx1013_rect_geometry.cpp now writes the binary32 value of 1e-6 as 0x3EB0C6F7A0000000, so gfx1013-container-rect accepts the IR again.

I also addressed the coverage gap with a real native readback. native_rectangle_geometry_warp compiles a native VS/PS/GS pair whose VS exports only SV_Position, then runs the standalone geometry fixture with --native-vs/--native-ps/--native-gs. The native GS draws the independent axis, swung and rotated scenes with back-face culling on, and all three read back 0 of 32 pixels differing from the literal rectangle model. The HLSL and native rules are now pinned by readback, not only by PSO creation.

At 04c82a48, dev and release each pass 6/6: native_rectangle_pso_warp, native_rectangle_geometry_warp, startup_rect_geometry_{warp,hardware} and startup_rect_gap_{warp,hardware}. docs_links_check passes with 98 files and 589 links. The native readback is WARP-only; the standalone HLSL test still passes on the RX 9060 XT. CI is running on the new head. The debug layer is unavailable here (D3D12GetDebugInterface fails).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7228103103 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#issuecomment-7228103103). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T21:04:09Z. --- @tedin7 thanks, the compile failure was real. Fixed on `04c82a48`: `src/gfx1013_rect_geometry.cpp` now writes the binary32 value of `1e-6` as `0x3EB0C6F7A0000000`, so `gfx1013-container-rect` accepts the IR again. I also addressed the coverage gap with a real native readback. `native_rectangle_geometry_warp` compiles a native VS/PS/GS pair whose VS exports only `SV_Position`, then runs the standalone geometry fixture with `--native-vs/--native-ps/--native-gs`. The native GS draws the independent `axis`, `swung` and `rotated` scenes with back-face culling on, and all three read back 0 of 32 pixels differing from the literal rectangle model. The HLSL and native rules are now pinned by readback, not only by PSO creation. At `04c82a48`, dev and release each pass 6/6: `native_rectangle_pso_warp`, `native_rectangle_geometry_warp`, `startup_rect_geometry_{warp,hardware}` and `startup_rect_gap_{warp,hardware}`. `docs_links_check` passes with 98 files and 589 links. The native readback is WARP-only; the standalone HLSL test still passes on the RX 9060 XT. CI is running on the new head. The debug layer is unavailable here (`D3D12GetDebugInterface` fails).
lambirou commented 2026-11-27 21:07:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T21:07:29Z.


Windows checks #8349 completed successfully on 04c82a48.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7228156690 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#issuecomment-7228156690). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T21:07:29Z. --- Windows checks #8349 completed successfully on `04c82a48`.
lambirou commented 2026-11-27 21:07:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T21:07:35Z.


@tedin7 the compile blocker and the native readback gap are addressed on 04c82a48; Windows checks #8349 is green. Could you take another look when you have a moment?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7228158327 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#issuecomment-7228158327). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T21:07:35Z. --- @tedin7 the compile blocker and the native readback gap are addressed on `04c82a48`; Windows checks #8349 is green. Could you take another look when you have a moment?
pigalot commented 2026-11-27 22:01:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:01:41Z.

Review: CHANGES_REQUESTED


Independently reviewed 04c82a48 integrated over main d474a393 (tree 170f7e5d). The merge is clean and git diff --cached --check origin/main is clean.

Earlier blocking review (tedin7 on e387d855).

  • The compile failure is addressed. 0x3EB0C6F7A0000000 is the exact double of (float)1e-6 (checked with struct.pack('>d', struct.unpack('<f', struct.pack('<f', 1e-6))[0])), and native_rectangle_pso_warp passes in both presets.
  • The native readback gap is addressed. native_rectangle_geometry_warp draws the three scenes through the native GS, and disabling the fallback in gfx1013_rect_geometry.cpp fails it (mutants below).

What I traced. In both copies the fallback runs only when no axis corner matched, so every input the old rule accepted keeps its corner. It picks the vertex opposite the strictly longest edge, provided dot(pa, pb)^2 <= 1e-6 |pa|^2 |pb|^2. A zero-length side fails across > side, and NaN fails the ordered compares. The RASTERIZER subobject's whole size equals sizeof(RasterLayoutStream), because D3D12_RASTERIZER_DESC is 44 bytes after the 4-byte tag; the static_assert pins the offset.

What I ran. I built startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check in dev and release, then ran:

ctest --test-dir out/build/<preset> --no-tests=error -j 4 --output-on-failure -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|native_direct_container|startup_rect_geometry_warp|startup_rect_gap_warp|startup_stream_draw_warp|startup_indirect_translated_indexed_rect_warp|startup_indirect_rectlist_warp|rectlist_topology|rectlist_draw_warp)$'
ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_rect_geometry_hardware|startup_rect_gap_hardware|startup_stream_draw_hardware|startup_indirect_translated_indexed_rect_hardware|startup_indirect_rectlist_hardware|rectlist_draw_hardware)$'
  • 10/10 WARP and 6/6 hardware pass in Debug and Release /O2, with no skips.
  • startup_rect_geometry_hardware runs on the RTX 5090 with the debug layer on. axis, swung and rotated each give 0 of 32 differing pixels.
  • As the description says, startup_rect_gap_hardware reports the Basic Render Driver, so it is a second WARP result.

Mutants. Each mutant was applied alone, the one target rebuilt, and the source restored afterwards (git diff --quiet clean).

Mutant Test Result
HLSL fallback disabled (if (corner == 3) → if (false)) startup_rect_geometry_warp killed: rotated: pixel (0, 0) is ffff0000, expected ff0000ff, 30 of 32 differ
HLSL right-angle check removed same survives
HLSL longest-edge check removed same survives
native fallback disabled (geometric[i] → false) native_rectangle_geometry_warp killed
native right-angle check made always true same survives

Finding.

  1. The non-rectangle case the description lists is not in the fixture. The description says the test checks that "a non-rectangle stays undrawn", and the experiment note says the right-angle test keeps a shape that is not a rectangle undrawn. But startup_rect_geometry.cpp has only axis, swung and rotated. swung is undrawn because of its winding, not because of the new rule. So nothing pins the guard that stops the fallback from drawing arbitrary triangles, in either copy.
    • Probe: I replaced the rotated records with a skewed triangle. The middle corner moved a quarter of the way toward the third, so there is no axis corner and no right angle, and I set covered = false.
    • With the PR's header the stage draws nothing, as intended: 0 of 32 differ on WARP and on the RTX 5090.
    • With the right-angle check removed, it draws the triangle: rotated: pixel (1, 0) is ff0000ff, expected ffff0000, 24 of 32 differ.
    • Suggested direction (unconfirmed): add that skewed scene as a fourth case with covered = false. native_rectangle_geometry_warp runs the same scenes, so one scene would pin both copies.

Non-blocking. The longest-edge survivor is equivalent for any true rectangle. It only matters for a degenerate input where two corners coincide, so a zero-length-side scene would pin it.

Verdict: changes requested on 04c82a48 for finding 1. The rest reads correctly and passes here. tedin7 asked to leave the merge to R0Y00, and I would leave it there too.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 and WARP 10.0.26100.9818, Windows 11 build 26200, MSVC 14.52.37025, Windows SDK 10.0.28000.0 DXC, debug layer on.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 04c82a48.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093769024 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#pullrequestreview-6093769024). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:01:41Z. **Review:** CHANGES_REQUESTED --- Independently reviewed `04c82a48` integrated over `main` `d474a393` (tree `170f7e5d`). The merge is clean and `git diff --cached --check origin/main` is clean. **Earlier blocking review (tedin7 on `e387d855`).** - The compile failure is addressed. `0x3EB0C6F7A0000000` is the exact double of `(float)1e-6` (checked with `struct.pack('>d', struct.unpack('<f', struct.pack('<f', 1e-6))[0])`), and `native_rectangle_pso_warp` passes in both presets. - The native readback gap is addressed. `native_rectangle_geometry_warp` draws the three scenes through the native GS, and disabling the fallback in `gfx1013_rect_geometry.cpp` fails it (mutants below). **What I traced.** In both copies the fallback runs only when no axis corner matched, so every input the old rule accepted keeps its corner. It picks the vertex opposite the strictly longest edge, provided `dot(pa, pb)^2 <= 1e-6 |pa|^2 |pb|^2`. A zero-length side fails `across > side`, and NaN fails the ordered compares. The `RASTERIZER` subobject's `whole` size equals `sizeof(RasterLayoutStream)`, because `D3D12_RASTERIZER_DESC` is 44 bytes after the 4-byte tag; the `static_assert` pins the offset. **What I ran.** I built `startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check` in `dev` and `release`, then ran: ```powershell ctest --test-dir out/build/<preset> --no-tests=error -j 4 --output-on-failure -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|native_direct_container|startup_rect_geometry_warp|startup_rect_gap_warp|startup_stream_draw_warp|startup_indirect_translated_indexed_rect_warp|startup_indirect_rectlist_warp|rectlist_topology|rectlist_draw_warp)$' ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_rect_geometry_hardware|startup_rect_gap_hardware|startup_stream_draw_hardware|startup_indirect_translated_indexed_rect_hardware|startup_indirect_rectlist_hardware|rectlist_draw_hardware)$' ``` - 10/10 WARP and 6/6 hardware pass in Debug and Release `/O2`, with no skips. - `startup_rect_geometry_hardware` runs on the RTX 5090 with the debug layer on. `axis`, `swung` and `rotated` each give 0 of 32 differing pixels. - As the description says, `startup_rect_gap_hardware` reports the Basic Render Driver, so it is a second WARP result. **Mutants.** Each mutant was applied alone, the one target rebuilt, and the source restored afterwards (`git diff --quiet` clean). | Mutant | Test | Result | |---|---|---| | HLSL fallback disabled (`if (corner == 3)` → `if (false)`) | `startup_rect_geometry_warp` | killed: `rotated: pixel (0, 0) is ffff0000, expected ff0000ff`, 30 of 32 differ | | HLSL right-angle check removed | same | **survives** | | HLSL longest-edge check removed | same | survives | | native fallback disabled (`geometric[i]` → `false`) | `native_rectangle_geometry_warp` | killed | | native right-angle check made always true | same | **survives** | **Finding.** 1. **The non-rectangle case the description lists is not in the fixture.** The description says the test checks that "a non-rectangle stays undrawn", and the experiment note says the right-angle test keeps a shape that is not a rectangle undrawn. But `startup_rect_geometry.cpp` has only `axis`, `swung` and `rotated`. `swung` is undrawn because of its winding, not because of the new rule. So nothing pins the guard that stops the fallback from drawing arbitrary triangles, in either copy. - Probe: I replaced the `rotated` records with a skewed triangle. The middle corner moved a quarter of the way toward the third, so there is no axis corner and no right angle, and I set `covered = false`. - With the PR's header the stage draws nothing, as intended: 0 of 32 differ on WARP and on the RTX 5090. - With the right-angle check removed, it draws the triangle: `rotated: pixel (1, 0) is ff0000ff, expected ffff0000`, 24 of 32 differ. - Suggested direction (unconfirmed): add that skewed scene as a fourth case with `covered = false`. `native_rectangle_geometry_warp` runs the same scenes, so one scene would pin both copies. **Non-blocking.** The longest-edge survivor is equivalent for any true rectangle. It only matters for a degenerate input where two corners coincide, so a zero-length-side scene would pin it. **Verdict:** changes requested on `04c82a48` for finding 1. The rest reads correctly and passes here. tedin7 asked to leave the merge to R0Y00, and I would leave it there too. Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 and WARP 10.0.26100.9818, Windows 11 build 26200, MSVC 14.52.37025, Windows SDK 10.0.28000.0 DXC, debug layer on. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `04c82a48`. This reply was AI-assisted.
lambirou commented 2026-11-27 22:08:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:08:47Z.


Review update (2026-11-27, 24bf6c99)

pigalot's non-rectangle finding is addressed. The fixture now has a fourth scene, skewed: the top-left corner is moved a quarter of the way toward the top-right, so the triangle has no axis corner and no right angle. The stage must leave the target clear. The same scene runs through the HLSL and native geometry stages, so it pins the right-angle guard in both copies.

Debug and Release: native_rectangle_geometry_warp, startup_rect_geometry_warp and startup_rect_geometry_hardware all pass; skewed reports 0 of 32 pixels differing. The experiment note records the new case. CI is running on 24bf6c99.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229067748 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#issuecomment-7229067748). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:08:47Z. --- ## Review update (2026-11-27, `24bf6c99`) pigalot's non-rectangle finding is addressed. The fixture now has a fourth scene, `skewed`: the top-left corner is moved a quarter of the way toward the top-right, so the triangle has no axis corner and no right angle. The stage must leave the target clear. The same scene runs through the HLSL and native geometry stages, so it pins the right-angle guard in both copies. Debug and Release: `native_rectangle_geometry_warp`, `startup_rect_geometry_warp` and `startup_rect_geometry_hardware` all pass; `skewed` reports 0 of 32 pixels differing. The experiment note records the new case. CI is running on `24bf6c99`.
lambirou commented 2026-11-27 22:19:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T22:19:23Z.


@pigalot the skewed non-rectangle scene is added on 24bf6c99; Debug and Release both pass the HLSL and native rectangle fixtures. Could you take another look?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229227982 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#issuecomment-7229227982). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T22:19:23Z. --- @pigalot the skewed non-rectangle scene is added on `24bf6c99`; Debug and Release both pass the HLSL and native rectangle fixtures. Could you take another look?
pigalot commented 2026-11-27 22:30:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:30:42Z.

Review: APPROVED


Retested 24bf6c99 integrated over main b66cdce6 (tree 13266b11). The merge is clean and git diff --cached --check origin/main is clean.

Earlier finding (my changes-requested review on 04c82a48).

  1. Non-rectangle case missing: addressed. startup_rect_geometry.cpp adds a fourth scene, skewed, with covered = false. Its top-left corner moves to x = -0.5, so the three records have no axis corner and no right angle. This is the case my probe used. The same scene runs through the HLSL stage and the native geometry stage.

What I ran. I built startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check in dev and release, then ran:

ctest --test-dir out/build/<preset> --no-tests=error -j 4 --output-on-failure -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|native_direct_container|startup_rect_geometry_warp|startup_rect_gap_warp|startup_stream_draw_warp|startup_indirect_translated_indexed_rect_warp|startup_indirect_rectlist_warp|rectlist_topology|rectlist_draw_warp)$'
ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_rect_geometry_hardware|startup_rect_gap_hardware|startup_stream_draw_hardware|startup_indirect_translated_indexed_rect_hardware|startup_indirect_rectlist_hardware|rectlist_draw_hardware)$'

All 10 WARP and 6 hardware tests pass in Debug and Release /O2, with no skips. On the RTX 5090, startup_rect_geometry_hardware reports 0 of 32 differing pixels for each of axis, swung, rotated and skewed.

Mutants. Each was applied alone, the one target rebuilt in dev, the test run, and the source restored afterwards (git diff --quiet clean).

Mutant Test Result
HLSL fallback disabled (if (corner == 3) → if (false)) startup_rect_geometry_warp killed
HLSL right-angle check removed same killed: skewed: pixel (2, 0) is ff0000ff, expected ffff0000 (survived on 04c82a48)
HLSL longest-edge check removed same survives (non-blocking, as before)
native fallback disabled (geometric[i] → false) native_rectangle_geometry_warp killed
native right-angle check made always true same killed: skewed: pixel (2, 0) is ff0000ff, expected ffff0000 (survived on 04c82a48)

Non-blocking, unchanged. The longest-edge survivor is equivalent for any true rectangle. It matters only for a degenerate input where two corners coincide.

Verdict: approve on 24bf6c99. This supersedes my changes-requested review on 04c82a48. tedin7 left the merge to R0Y00 because the title-level claim cannot be checked here, and I am leaving it there too.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 with the debug layer enabled, and WARP 10.0.26100.9818, on Windows 11 25H2 build 26200.9974, MSVC 19.52.37029.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on 24bf6c99.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093967125 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#pullrequestreview-6093967125). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:30:42Z. **Review:** APPROVED --- Retested `24bf6c99` integrated over `main` `b66cdce6` (tree `13266b11`). The merge is clean and `git diff --cached --check origin/main` is clean. **Earlier finding (my changes-requested review on `04c82a48`).** 1. **Non-rectangle case missing:** addressed. `startup_rect_geometry.cpp` adds a fourth scene, `skewed`, with `covered = false`. Its top-left corner moves to x = -0.5, so the three records have no axis corner and no right angle. This is the case my probe used. The same scene runs through the HLSL stage and the native geometry stage. **What I ran.** I built `startup_rect_geometry startup_stream_consumer compile_dxil native_recording_check` in `dev` and `release`, then ran: ```powershell ctest --test-dir out/build/<preset> --no-tests=error -j 4 --output-on-failure -R '^(native_rectangle_pso_warp|native_rectangle_geometry_warp|native_direct_container|startup_rect_geometry_warp|startup_rect_gap_warp|startup_stream_draw_warp|startup_indirect_translated_indexed_rect_warp|startup_indirect_rectlist_warp|rectlist_topology|rectlist_draw_warp)$' ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(startup_rect_geometry_hardware|startup_rect_gap_hardware|startup_stream_draw_hardware|startup_indirect_translated_indexed_rect_hardware|startup_indirect_rectlist_hardware|rectlist_draw_hardware)$' ``` All 10 WARP and 6 hardware tests pass in Debug and Release `/O2`, with no skips. On the RTX 5090, `startup_rect_geometry_hardware` reports 0 of 32 differing pixels for each of `axis`, `swung`, `rotated` and `skewed`. **Mutants.** Each was applied alone, the one target rebuilt in `dev`, the test run, and the source restored afterwards (`git diff --quiet` clean). | Mutant | Test | Result | |---|---|---| | HLSL fallback disabled (`if (corner == 3)` → `if (false)`) | `startup_rect_geometry_warp` | killed | | HLSL right-angle check removed | same | killed: `skewed: pixel (2, 0) is ff0000ff, expected ffff0000` (survived on `04c82a48`) | | HLSL longest-edge check removed | same | survives (non-blocking, as before) | | native fallback disabled (`geometric[i]` → `false`) | `native_rectangle_geometry_warp` | killed | | native right-angle check made always true | same | killed: `skewed: pixel (2, 0) is ff0000ff, expected ffff0000` (survived on `04c82a48`) | **Non-blocking, unchanged.** The longest-edge survivor is equivalent for any true rectangle. It matters only for a degenerate input where two corners coincide. **Verdict:** approve on `24bf6c99`. This supersedes my changes-requested review on `04c82a48`. tedin7 left the merge to R0Y00 because the title-level claim cannot be checked here, and I am leaving it there too. Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 with the debug layer enabled, and WARP 10.0.26100.9818, on Windows 11 25H2 build 26200.9974, MSVC 19.52.37029. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `24bf6c99`. This reply was AI-assisted.
R0Y00 commented 2026-11-27 22:59:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T22:59:30Z.

Review: APPROVED


Independently retested 24bf6c99 integrated over main 4b0350ea (clean tree ed3e7b27). The native and HLSL rules preserve the axis-aligned selection and use the shape check for a rotated right-angle corner. The added skewed input remained clear. I rebuilt startup_rect_geometry startup_stream_consumer d3d12_xs_shim compile_dxil native_recording_check and ran ctest --test-dir <build> --no-tests=error -j1 -V -R '^(startup_rect_(geometry|gap)_(warp|hardware)|startup_stream_draw_(warp|hardware)|native_rectangle_(geometry|pso)_warp|native_direct_container)$'. Debug and Release /O2 each passed 9/9 with no skips. The rectangle-geometry fixture matched all 32 pixels in each axis, swung, rotated and skewed scene on WARP and RTX 4060 Laptop. The gap fixture logged Microsoft Basic Render Driver even in its hardware-labelled run, so both of those readbacks are WARP evidence. Windows 11 26200.9974, WARP 10.0.26100.9818 and NVIDIA driver 32.0.16.1656. The standalone geometry fixture enabled the debug layer. Docs link check and hosted Windows passed. This validates the isolated rectangle behavior. The original executable's draw described in #3131 remains unreproduced by the fixture. GitHub marked that issue completed before this merge.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094119240 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3142#pullrequestreview-6094119240). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T22:59:30Z. **Review:** APPROVED --- Independently retested `24bf6c99` integrated over `main` `4b0350ea` (clean tree `ed3e7b27`). The native and HLSL rules preserve the axis-aligned selection and use the shape check for a rotated right-angle corner. The added skewed input remained clear. I rebuilt `startup_rect_geometry startup_stream_consumer d3d12_xs_shim compile_dxil native_recording_check` and ran `ctest --test-dir <build> --no-tests=error -j1 -V -R '^(startup_rect_(geometry|gap)_(warp|hardware)|startup_stream_draw_(warp|hardware)|native_rectangle_(geometry|pso)_warp|native_direct_container)$'`. Debug and Release /O2 each passed 9/9 with no skips. The rectangle-geometry fixture matched all 32 pixels in each axis, swung, rotated and skewed scene on WARP and RTX 4060 Laptop. The gap fixture logged Microsoft Basic Render Driver even in its hardware-labelled run, so both of those readbacks are WARP evidence. Windows 11 26200.9974, WARP 10.0.26100.9818 and NVIDIA driver 32.0.16.1656. The standalone geometry fixture enabled the debug layer. Docs link check and hosted Windows passed. This validates the isolated rectangle behavior. The original executable's draw described in #3131 remains unreproduced by the fixture. GitHub marked that issue completed before this merge.
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!3142
No description provided.