shader: draw the core pixel shader set on a Vulkan device #2289

Merged
Ybucaille merged 2 commits from upstream-pr/2297 into main 2026-11-25 12:08:42 +00:00
Ybucaille commented 2026-11-25 10:43:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T10:43:57Z.


Refs #614. Follows the Vulkan host and the subnormal check (tests/pixel_denorm_vulkan_check.py).

Summary

Runs the draw-core translated pixel shaders, with their negative controls, on a Vulkan 1.2 device.

  • tests/pixel_aot_check.py draw-core-vulkan <dxc> <device> [--allow-denorm-mismatch]: check_render runs
    unchanged. The renderer is the Python interpreter and the backend is the new adapter. compile_shader emits
    SPIR-V (SPIRV_ARGS, b0 to b2 at 0 to 2, t0 and t1 at 16 and 17, s0 at 32) and spirv-val checks it. Other
    modes build exactly the DXIL command they built before.
  • tests/vk_offscreen.py: stands in for offscreen_check for --check-pixel, --check-pixel-case,
    --check-pixel-batch and --check-pixel-quad-lod, with the same exit codes, pixel_mismatch x= y= words and
    case=N status= lines. The comparison is draw_verified's: every channel bit for bit, except the channels a
    case marks in its NaN-class mask. With no arguments (or --self-test) it runs device-free controls: the case
    parser, one-ulp mismatches reported first in scan order, a NaN-mask lane, the batch status lines through a fake
    host, and the refusals. It is added to the Linux Python checks and to the list in AGENTS.md.
  • tests/vk_pixel_draw.c: a --draw form with options for target, constants, b1/b2, mip chain, viewport,
    indices, write mask and clear color. The original positional form is unchanged.
  • Every module is compiled with -denorm preserve. A device without shaderDenormPreserveFloat32 is a
    capability skip (77). --allow-denorm-mismatch draws anyway and is a diagnostic run only.
  • Docs: docs/non-windows-hosts.md (usage) and docs/experiments.md (method and results).

Like #473 and the subnormal check, this is optional and not registered in CMake or CI beyond the device-free
self-test.

Reproduce

python3 -B tests/vk_offscreen.py
python3 -B tests/pixel_aot_check.py draw-core-vulkan /usr/bin/dxc Intel
VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json \
  python3 -B tests/pixel_aot_check.py draw-core-vulkan /usr/bin/dxc llvmpipe --allow-denorm-mismatch

Needs DXC, spirv-val, a C compiler and the Vulkan loader headers.

Results

Base 25317c63 plus this change, DXC 1.10.2605.37, Mesa 26.2.7, Arch Linux.

device shaderDenormPreserveFloat32 flag result
Intel UHD Graphics (TGL GT1), ANV 1 none exit 0, about 11 s
lavapipe 0 none exit 77
lavapipe 0 --allow-denorm-mismatch exit 0
NVIDIA RTX 3060 Laptop, driver 620.70.06 0 none exit 77
NVIDIA RTX 3060 Laptop 0 --allow-denorm-mismatch exit 1, pixel_mismatch x=16 y=0

NVIDIA (measured): the pixel at x=16 reads back 0x3e14a000 in byte 37 where the reference has 0x3e148000.
The reference comes from export16, which rounds a binary32 toward zero to binary16 through
f32tof16/f16tof32. A compute probe on the same device gave the binary16 0x30a5 and a widened value
0x3e149495. Hypothesis, not verified: the NVIDIA compiler folds f16tof32(f32tof16(x)) to x, so that
rounding does not happen. I do not know whether the NVIDIA D3D12 driver does the same. The run is a diagnostic
and says nothing about NVIDIA's subnormal handling.

Negative controls

On Intel every negative control of check_render is detected (wrong references and mutated shaders report
pixel_mismatch). The self-test adds its own: a one-ulp difference must fail with the first pixel in scan order,
a non-NaN actual in a NaN-masked lane must fail, a mask on a non-NaN expectation must be refused, and a title
memory trailer, a bad viewport, unknown flag bits and a short NaN mask must be refused.

Not covered

  • The other offscreen_check modes and title-memory trailers.
  • The debug layer (the log says debug_layer=unavailable).
  • A D3D12 result, other Vulkan drivers (RADV was not run) and Windows.
  • draw (the full set) under Vulkan; only draw-core.

Other checks: git diff --check clean; tests/docs_links_check.py and tests/bidi_controls_check.py passed;
tests/pixel_denorm_vulkan_check.py (no arguments) passed. Not run: CMake, ctest and Windows CI.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6602661214 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297). Originally posted by [Ybucaille](https://github.com/Ybucaille) on 2026-11-25T10:43:57Z. --- Refs #614. Follows the Vulkan host and the subnormal check (`tests/pixel_denorm_vulkan_check.py`). ## Summary Runs the `draw-core` translated pixel shaders, with their negative controls, on a Vulkan 1.2 device. - `tests/pixel_aot_check.py draw-core-vulkan <dxc> <device> [--allow-denorm-mismatch]`: `check_render` runs unchanged. The renderer is the Python interpreter and the backend is the new adapter. `compile_shader` emits SPIR-V (`SPIRV_ARGS`, b0 to b2 at 0 to 2, t0 and t1 at 16 and 17, s0 at 32) and `spirv-val` checks it. Other modes build exactly the DXIL command they built before. - `tests/vk_offscreen.py`: stands in for `offscreen_check` for `--check-pixel`, `--check-pixel-case`, `--check-pixel-batch` and `--check-pixel-quad-lod`, with the same exit codes, `pixel_mismatch x= y=` words and `case=N status=` lines. The comparison is `draw_verified`'s: every channel bit for bit, except the channels a case marks in its NaN-class mask. With no arguments (or `--self-test`) it runs device-free controls: the case parser, one-ulp mismatches reported first in scan order, a NaN-mask lane, the batch status lines through a fake host, and the refusals. It is added to the Linux Python checks and to the list in `AGENTS.md`. - `tests/vk_pixel_draw.c`: a `--draw` form with options for target, constants, b1/b2, mip chain, viewport, indices, write mask and clear color. The original positional form is unchanged. - Every module is compiled with `-denorm preserve`. A device without `shaderDenormPreserveFloat32` is a capability skip (77). `--allow-denorm-mismatch` draws anyway and is a diagnostic run only. - Docs: `docs/non-windows-hosts.md` (usage) and `docs/experiments.md` (method and results). Like #473 and the subnormal check, this is optional and not registered in CMake or CI beyond the device-free self-test. ## Reproduce ```bash python3 -B tests/vk_offscreen.py python3 -B tests/pixel_aot_check.py draw-core-vulkan /usr/bin/dxc Intel VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json \ python3 -B tests/pixel_aot_check.py draw-core-vulkan /usr/bin/dxc llvmpipe --allow-denorm-mismatch ``` Needs DXC, `spirv-val`, a C compiler and the Vulkan loader headers. ## Results Base `25317c63` plus this change, DXC 1.10.2605.37, Mesa 26.2.7, Arch Linux. | device | `shaderDenormPreserveFloat32` | flag | result | |---|---|---|---| | Intel UHD Graphics (TGL GT1), ANV | 1 | none | exit 0, about 11 s | | lavapipe | 0 | none | exit 77 | | lavapipe | 0 | `--allow-denorm-mismatch` | exit 0 | | NVIDIA RTX 3060 Laptop, driver 620.70.06 | 0 | none | exit 77 | | NVIDIA RTX 3060 Laptop | 0 | `--allow-denorm-mismatch` | exit 1, `pixel_mismatch x=16 y=0` | NVIDIA (measured): the pixel at x=16 reads back `0x3e14a000` in byte 37 where the reference has `0x3e148000`. The reference comes from `export16`, which rounds a binary32 toward zero to binary16 through `f32tof16`/`f16tof32`. A compute probe on the same device gave the binary16 `0x30a5` and a widened value `0x3e149495`. Hypothesis, not verified: the NVIDIA compiler folds `f16tof32(f32tof16(x))` to `x`, so that rounding does not happen. I do not know whether the NVIDIA D3D12 driver does the same. The run is a diagnostic and says nothing about NVIDIA's subnormal handling. ## Negative controls On Intel every negative control of `check_render` is detected (wrong references and mutated shaders report `pixel_mismatch`). The self-test adds its own: a one-ulp difference must fail with the first pixel in scan order, a non-NaN actual in a NaN-masked lane must fail, a mask on a non-NaN expectation must be refused, and a title memory trailer, a bad viewport, unknown flag bits and a short NaN mask must be refused. ## Not covered - The other `offscreen_check` modes and title-memory trailers. - The debug layer (the log says `debug_layer=unavailable`). - A D3D12 result, other Vulkan drivers (RADV was not run) and Windows. - `draw` (the full set) under Vulkan; only `draw-core`. Other checks: `git diff --check` clean; `tests/docs_links_check.py` and `tests/bidi_controls_check.py` passed; `tests/pixel_denorm_vulkan_check.py` (no arguments) passed. Not run: CMake, ctest and Windows CI. AI-assisted.
tedin7 commented 2026-11-25 11:02:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:48:59Z.

Review: COMMENTED


Review of head 0671765ad96ff6aee4e9a9864b8021ba68425489.

Summary: The adapter and the draw-core-vulkan mode look correct. The comparison follows draw_verified (bit-exact, NaN-class mask only where marked). The default SPIR-V path is gated by SPIRV_ARGS, which is reset in finally, so the other modes keep building the same DXIL command. One test gap (P2) below.

Commands run locally (in a worktree at this head):

  • git diff --stat origin/main...HEAD: 7 files, +751/-41
  • python3 tests/vk_offscreen.py -> vk_offscreen self-test passed
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 438 links
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean
  • gh pr checks: Linux Python checks, Windows build/test and gfx1013 fixtures all pass; /O2 and chart jobs skipped.
  • Mutation: in tests/vk_offscreen.py compare(), changed elif expected[c] != actual[c]: to elif c != 3 and expected[c] != actual[c]: (alpha ignored). The self-test still passed (exit 0), so the mutation survived. Reverted with git checkout -- ..

Findings

  • P1: none.
  • P2: tests/vk_offscreen.py self-test (the one-ulp control at ~line 378 only perturbs channel 2) does not exercise a mismatch in every channel. A regression that skips the compare for channel 3 (alpha) passes the self-test. Suggest one control per channel (or a loop over c in 0..3) asserting the pixel_mismatch report and the channel index.
  • nit: the PR is not Draft; the Vulkan device run (draw-core-vulkan) needs a real device, so it was not run here. Linux CI covers only the device-free self-test.

No Windows run was done: the PR touches only the Vulkan test harness, not gfx2hlsl or C++ paths used on Windows.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6056159119 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297#pullrequestreview-6056159119). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:48:59Z. **Review:** COMMENTED --- Review of head `0671765ad96ff6aee4e9a9864b8021ba68425489`. **Summary:** The adapter and the `draw-core-vulkan` mode look correct. The comparison follows `draw_verified` (bit-exact, NaN-class mask only where marked). The default SPIR-V path is gated by `SPIRV_ARGS`, which is reset in `finally`, so the other modes keep building the same DXIL command. One test gap (P2) below. **Commands run locally (in a worktree at this head):** - `git diff --stat origin/main...HEAD`: 7 files, +751/-41 - `python3 tests/vk_offscreen.py` -> `vk_offscreen self-test passed` - `python3 tests/docs_links_check.py` -> Checked 18 Markdown files and 438 links - `python3 tests/bidi_controls_check.py` -> no bidirectional controls - `git diff --check origin/main...HEAD` -> clean - `gh pr checks`: Linux Python checks, Windows build/test and gfx1013 fixtures all pass; /O2 and chart jobs skipped. - Mutation: in `tests/vk_offscreen.py` `compare()`, changed `elif expected[c] != actual[c]:` to `elif c != 3 and expected[c] != actual[c]:` (alpha ignored). The self-test still passed (exit 0), so the mutation survived. Reverted with `git checkout -- .`. **Findings** - P1: none. - P2: `tests/vk_offscreen.py` self-test (the one-ulp control at ~line 378 only perturbs channel 2) does not exercise a mismatch in every channel. A regression that skips the compare for channel 3 (alpha) passes the self-test. Suggest one control per channel (or a loop over c in 0..3) asserting the `pixel_mismatch` report and the channel index. - nit: the PR is not Draft; the Vulkan device run (`draw-core-vulkan`) needs a real device, so it was not run here. Linux CI covers only the device-free self-test. No Windows run was done: the PR touches only the Vulkan test harness, not gfx2hlsl or C++ paths used on Windows. AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 11:02:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T10:54:36Z.


I tested the D3D12 side of the rounding question with the fixture at 0671765a. On a desktop RTX 4060 (Windows 11 build 26100.9711, driver 32.0.15.9579), python -B tests/pixel_aot_check.py draw-core <dxc> <offscreen_check> hardware exited 0, including the existing negative controls. DXC was 1.9.2609.5. The renderer was built from 59a05959; its pixel_aot_render.cpp is identical to this head.

I also compiled translate(assembly(False)) with compile_shader(..., ieee=False) and used --check-pixel-case shader.dxil ramp.case pixels.raw on the RTX and on WARP 10.0.26100.9711. The case used the 64 expected colors from vk_offscreen.ramp_input(False). At pixel (16, 0), input red byte 37, both devices returned [3e148000, 00000000, 3f008000, 3f800000]. The full 4,096 pixels matched on each device. Removing just the decrement in export16 also matched these fixtures on both.

As a control, I replaced the four export calls with widen16(narrow16(channel)), using the shader's integer nearest-even implementation. Both devices then failed first at (16, 0), red expected_bits=3e148000 actual_bits=3e14a000, and the raw output contained the same actual word. This adjacent half is distinguishable on the D3D12 path. The unchanged DXIL shader on these particular devices produced the reference value. The Linux Vulkan compiler-folding hypothesis remains open.

I also ran the same head on two Windows Vulkan drivers. I compiled the unchanged tests/vk_pixel_draw.c on Windows and used the PR's shader compiler arguments, SPIR-V validation, check_render(..., core_only=True) and vk_offscreen.py reference. The Windows launcher supplied the host binary and vertex SPIR-V in place of the Linux host-build step.

Device and driver Strict Vulkan Ramp red at (16, 0)
Intel UHD Graphics 770, 101.5973, Vulkan 1.3.289 Advertises float32 denorm preserve. The entire draw-core run exited 0, including its negative controls. 3e148000, all 4,096 pixels matched.
GeForce RTX 4060 desktop, 595.79, Vulkan 1.4.329 Does not advertise float32 denorm preserve. The ramp returned the expected capability skip (77). With the diagnostic override only, the first mismatch was red 3e14a000 at (16, 0). The other three channels matched.

The desktop RTX produced the reported adjacent half under the diagnostic Vulkan run on Windows as well. On that same GPU and driver the original DXIL ramp matched all pixels. These observations distinguish the two API paths on one device. They do not isolate which compiler step selected the rounding.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160334712 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297#issuecomment-7160334712). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T10:54:36Z. --- I tested the D3D12 side of the rounding question with the fixture at `0671765a`. On a desktop RTX 4060 (Windows 11 build 26100.9711, driver 32.0.15.9579), `python -B tests/pixel_aot_check.py draw-core <dxc> <offscreen_check> hardware` exited 0, including the existing negative controls. DXC was 1.9.2609.5. The renderer was built from `59a05959`; its `pixel_aot_render.cpp` is identical to this head. I also compiled `translate(assembly(False))` with `compile_shader(..., ieee=False)` and used `--check-pixel-case shader.dxil ramp.case pixels.raw` on the RTX and on WARP 10.0.26100.9711. The case used the 64 expected colors from `vk_offscreen.ramp_input(False)`. At pixel (16, 0), input red byte 37, both devices returned `[3e148000, 00000000, 3f008000, 3f800000]`. The full 4,096 pixels matched on each device. Removing just the decrement in `export16` also matched these fixtures on both. As a control, I replaced the four export calls with `widen16(narrow16(channel))`, using the shader's integer nearest-even implementation. Both devices then failed first at (16, 0), red `expected_bits=3e148000 actual_bits=3e14a000`, and the raw output contained the same actual word. This adjacent half is distinguishable on the D3D12 path. The unchanged DXIL shader on these particular devices produced the reference value. The Linux Vulkan compiler-folding hypothesis remains open. I also ran the same head on two Windows Vulkan drivers. I compiled the unchanged `tests/vk_pixel_draw.c` on Windows and used the PR's shader compiler arguments, SPIR-V validation, `check_render(..., core_only=True)` and `vk_offscreen.py` reference. The Windows launcher supplied the host binary and vertex SPIR-V in place of the Linux host-build step. | Device and driver | Strict Vulkan | Ramp red at (16, 0) | | --- | --- | --- | | Intel UHD Graphics 770, 101.5973, Vulkan 1.3.289 | Advertises float32 denorm preserve. The entire draw-core run exited 0, including its negative controls. | `3e148000`, all 4,096 pixels matched. | | GeForce RTX 4060 desktop, 595.79, Vulkan 1.4.329 | Does not advertise float32 denorm preserve. The ramp returned the expected capability skip (77). | With the diagnostic override only, the first mismatch was red `3e14a000` at (16, 0). The other three channels matched. | The desktop RTX produced the reported adjacent half under the diagnostic Vulkan run on Windows as well. On that same GPU and driver the original DXIL ramp matched all pixels. These observations distinguish the two API paths on one device. They do not isolate which compiler step selected the rounding.
stan495 commented 2026-11-25 12:01:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T11:14:46Z.

Review: COMMENTED


Review of head 0671765ad96ff6aee4e9a9864b8021ba68425489 on Windows 11 (26200.9974, MSVC 19.44.35228.0, Windows SDK / DXC 10.0.26100.0).

Findings

  • P2 (tests/vk_offscreen.py:401-422, Windows portability): AGENTS.md adds tests/vk_offscreen.py to the Pure-Python checks list, but python -B tests/vk_offscreen.py fails on Windows in self_test():
    File "...\tests\vk_offscreen.py", line 421, in self_test
      assert code == 1 and [l for l in out.splitlines() if l.startswith("case=")] == [
    AssertionError: case=0 status=error
    case=1 status=error
    case=2 status=error
    
    self_test() writes an extensionless shebang script (fake_host) and runs [host, "--draw", ...], which Windows CreateProcess rejects (%1 is not a valid Win32 application), so run_check_pixel_batch turns every case into status=error. Writing fake_host.py and invoking [sys.executable, host, ...] (or a .cmd wrapper on os.name == "nt") would let the self-test pass on Windows as well as Linux/macOS.

Additional Windows D3D12 data point (AMD RDNA 3 + WARP)

Built offscreen_check (dev preset) at 0671765a and ran draw-core on AMD hardware (draw-core-vulkan was not run because Vulkan SDK headers and spirv-val are not installed on this host):

python -B tests/pixel_aot_check.py draw-core "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxc.exe" out\build\dev\offscreen_check.exe hardware
python -B tests/pixel_aot_check.py draw-core "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxc.exe" out\build\dev\offscreen_check.exe warp
  • AMD Radeon RX 7900 XTX (vendor=1002, device=744c, driver 32.0.32029.2010, D3D12 debug layer enabled): exit 0 (max_absolute_error=0, debug_errors=0 debug_warnings=0, multitap_sample (hardware): 2 taps on tex verified, trig_unreduced_mismatches=0/4).
  • Microsoft Basic Render Driver (WARP 10.0.26100.9818, D3D12 debug layer enabled): exit 0 (max_absolute_error=0, debug_errors=0 debug_warnings=0, multitap_sample (warp): 2 taps on tex verified, trig_unreduced_mismatches=0/4).

Other local checks on 0671765a

  • python -B tests/pixel_denorm_vulkan_check.py -> passed (classification controls: 10 cases passed)
  • python -B tests/docs_links_check.py -> passed (18 files, 438 links)
  • python -B tests/bidi_controls_check.py -> passed (1585 tracked files)
  • git diff --check upstream/main...HEAD -> clean
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6056590445 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297#pullrequestreview-6056590445). Originally posted by [stan495](https://github.com/stan495) on 2026-11-25T11:14:46Z. **Review:** COMMENTED --- Review of head `0671765ad96ff6aee4e9a9864b8021ba68425489` on Windows 11 (`26200.9974`, MSVC `19.44.35228.0`, Windows SDK / DXC `10.0.26100.0`). ### Findings - **P2 (`tests/vk_offscreen.py:401-422`, Windows portability):** `AGENTS.md` adds `tests/vk_offscreen.py` to the Pure-Python checks list, but `python -B tests/vk_offscreen.py` fails on Windows in `self_test()`: ```text File "...\tests\vk_offscreen.py", line 421, in self_test assert code == 1 and [l for l in out.splitlines() if l.startswith("case=")] == [ AssertionError: case=0 status=error case=1 status=error case=2 status=error ``` `self_test()` writes an extensionless shebang script (`fake_host`) and runs `[host, "--draw", ...]`, which Windows `CreateProcess` rejects (`%1 is not a valid Win32 application`), so `run_check_pixel_batch` turns every case into `status=error`. Writing `fake_host.py` and invoking `[sys.executable, host, ...]` (or a `.cmd` wrapper on `os.name == "nt"`) would let the self-test pass on Windows as well as Linux/macOS. ### Additional Windows D3D12 data point (AMD RDNA 3 + WARP) Built `offscreen_check` (`dev` preset) at `0671765a` and ran `draw-core` on AMD hardware (`draw-core-vulkan` was not run because Vulkan SDK headers and `spirv-val` are not installed on this host): ```powershell python -B tests/pixel_aot_check.py draw-core "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxc.exe" out\build\dev\offscreen_check.exe hardware python -B tests/pixel_aot_check.py draw-core "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\dxc.exe" out\build\dev\offscreen_check.exe warp ``` - `AMD Radeon RX 7900 XTX` (`vendor=1002`, `device=744c`, driver `32.0.32029.2010`, D3D12 debug layer enabled): exit `0` (`max_absolute_error=0`, `debug_errors=0 debug_warnings=0`, `multitap_sample (hardware): 2 taps on tex verified`, `trig_unreduced_mismatches=0/4`). - `Microsoft Basic Render Driver` (`WARP 10.0.26100.9818`, D3D12 debug layer enabled): exit `0` (`max_absolute_error=0`, `debug_errors=0 debug_warnings=0`, `multitap_sample (warp): 2 taps on tex verified`, `trig_unreduced_mismatches=0/4`). ### Other local checks on `0671765a` - `python -B tests/pixel_denorm_vulkan_check.py` -> passed (`classification controls: 10 cases passed`) - `python -B tests/docs_links_check.py` -> passed (18 files, 438 links) - `python -B tests/bidi_controls_check.py` -> passed (1585 tracked files) - `git diff --check upstream/main...HEAD` -> clean
Ybucaille commented 2026-11-25 12:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T12:00:48Z.


Thanks for the reviews and the runs. Both P2 findings are fixed in e3c65e8f (only self_test() in tests/vk_offscreen.py changed; production code is untouched).

@stan495 (Windows): the fake host is now fake_host.py, started through sys.executable by a one-line launcher, a .cmd file on Windows and a sh script elsewhere, since the adapter takes a single host path. Nothing relies on a shebang any more. I could only run the Linux branch here, so a python -B tests/vk_offscreen.py on Windows would confirm it. Thanks also for the RX 7900 XTX and WARP draw-core results.

@tedin7 (channel coverage): the one-ulp control now loops over the four channels. Each pass perturbs one channel at (9, 5) and checks every channel=c line, actual_bits one above expected_bits on the perturbed channel and equal on the other three. Your mutation (elif c != 3 and expected[c] != actual[c]:) now fails the self-test, and the test passes again once it is reverted.

On the draft question: draw-core-vulkan cannot run without a device, so CI only covers the device-free self-test. The device runs so far are Intel ANV (exit 0, negative controls caught) here and on Windows (@RavenCurseBurg's UHD 770, all 4,096 ramp pixels), and lavapipe and NVIDIA returning the expected capability skip (77). I am happy to switch the PR to draft if you would rather wait for an AMD run.

@RavenCurseBurg: thanks, that comparison is useful. The same RTX 4060 gives 3e148000 through DXIL/D3D12 and 3e14a000 through SPIR-V/Vulkan, so the adjacent half comes from the Vulkan path rather than the GPU.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161802404 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297#issuecomment-7161802404). Originally posted by [Ybucaille](https://github.com/Ybucaille) on 2026-11-25T12:00:48Z. --- Thanks for the reviews and the runs. Both P2 findings are fixed in `e3c65e8f` (only `self_test()` in `tests/vk_offscreen.py` changed; production code is untouched). @stan495 (Windows): the fake host is now `fake_host.py`, started through `sys.executable` by a one-line launcher, a `.cmd` file on Windows and a `sh` script elsewhere, since the adapter takes a single host path. Nothing relies on a shebang any more. I could only run the Linux branch here, so a `python -B tests/vk_offscreen.py` on Windows would confirm it. Thanks also for the RX 7900 XTX and WARP `draw-core` results. @tedin7 (channel coverage): the one-ulp control now loops over the four channels. Each pass perturbs one channel at (9, 5) and checks every `channel=c` line, `actual_bits` one above `expected_bits` on the perturbed channel and equal on the other three. Your mutation (`elif c != 3 and expected[c] != actual[c]:`) now fails the self-test, and the test passes again once it is reverted. On the draft question: `draw-core-vulkan` cannot run without a device, so CI only covers the device-free self-test. The device runs so far are Intel ANV (exit 0, negative controls caught) here and on Windows (@RavenCurseBurg's UHD 770, all 4,096 ramp pixels), and lavapipe and NVIDIA returning the expected capability skip (77). I am happy to switch the PR to draft if you would rather wait for an AMD run. @RavenCurseBurg: thanks, that comparison is useful. The same RTX 4060 gives `3e148000` through DXIL/D3D12 and `3e14a000` through SPIR-V/Vulkan, so the adjacent half comes from the Vulkan path rather than the GPU.
upstream-sync closed this pull request 2026-11-25 13:00:40 +00:00
tedin7 commented 2026-11-25 13:00:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:05:03Z.

Review: COMMENTED


Review of head e3c65e8f563e6c64800a1766be756b8147eb80f0 (previous review by @tedin7 was on 0671765a, so this is a new head).

Scope read: tests/vk_offscreen.py (new adapter and self-test), the draw-core-vulkan mode and SPIRV_ARGS hook in tests/pixel_aot_check.py, the workflow and AGENTS.md lines, and the docs. I did not read all of tests/vk_pixel_draw.c line by line, and I did not run any Vulkan device or DXC. I did not request a Win2025 run: the change is test-only, the adapter self-test needs no device, and the Windows job on this head is green.

CI on this head: Linux Python checks pass, Windows build and test pass, gfx1013 fixtures pass. /O2 and chart jobs are skipped. The PR is mergeable, and the title is neutral.

Commands run locally in the PR worktree:

  • python3 -B tests/vk_offscreen.py -> vk_offscreen self-test passed
  • python3 tests/docs_links_check.py -> self-test passed, 18 Markdown files and 438 links checked
  • python3 tests/bidi_controls_check.py -> 1585 files, no bidirectional controls
  • git diff --check origin/main...HEAD -> clean

Mutations (reverted with git checkout -- .):

  1. In compare(), skip channel 3 in the exact-word comparison. The self-test fails with an AssertionError (pixel_mismatch x=1 y=20), so it is killed.
  2. In is_nan_bits(), drop the mantissa test, so +/-Inf counts as NaN. The self-test still passes, so it survives.

Findings:

  • P1: none.
  • P2: none.
  • Nit (tests/vk_offscreen.py:161, is_nan_bits): no self-test case has a NaN-masked channel where the actual word is an infinity, so mutation 2 survives. A case such as expected NaN bits with actual 0x7F800000 expecting pixel_mismatch would pin it. Infinity is the likeliest wrong value from a denorm or divide path, so it is worth one case.
  • Nit: SPIRV_ARGS is a module global that is set and reset in check_render_vulkan. It is restored in finally, so it is correct. Passing it as a parameter would be tidier, but it is not needed for this PR.

No blocking issues found in what I read.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6057276296 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2297#pullrequestreview-6057276296). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T12:05:03Z. **Review:** COMMENTED --- Review of head `e3c65e8f563e6c64800a1766be756b8147eb80f0` (previous review by @tedin7 was on `0671765a`, so this is a new head). Scope read: `tests/vk_offscreen.py` (new adapter and self-test), the `draw-core-vulkan` mode and `SPIRV_ARGS` hook in `tests/pixel_aot_check.py`, the workflow and AGENTS.md lines, and the docs. I did not read all of `tests/vk_pixel_draw.c` line by line, and I did not run any Vulkan device or DXC. I did not request a Win2025 run: the change is test-only, the adapter self-test needs no device, and the Windows job on this head is green. CI on this head: Linux Python checks pass, Windows build and test pass, gfx1013 fixtures pass. /O2 and chart jobs are skipped. The PR is mergeable, and the title is neutral. Commands run locally in the PR worktree: - `python3 -B tests/vk_offscreen.py` -> `vk_offscreen self-test passed` - `python3 tests/docs_links_check.py` -> self-test passed, 18 Markdown files and 438 links checked - `python3 tests/bidi_controls_check.py` -> 1585 files, no bidirectional controls - `git diff --check origin/main...HEAD` -> clean Mutations (reverted with `git checkout -- .`): 1. In `compare()`, skip channel 3 in the exact-word comparison. The self-test fails with an `AssertionError` (`pixel_mismatch x=1 y=20`), so it is killed. 2. In `is_nan_bits()`, drop the mantissa test, so +/-Inf counts as NaN. The self-test still passes, so it survives. Findings: - P1: none. - P2: none. - Nit (`tests/vk_offscreen.py:161`, `is_nan_bits`): no self-test case has a NaN-masked channel where the actual word is an infinity, so mutation 2 survives. A case such as expected NaN bits with actual `0x7F800000` expecting `pixel_mismatch` would pin it. Infinity is the likeliest wrong value from a denorm or divide path, so it is worth one case. - Nit: `SPIRV_ARGS` is a module global that is set and reset in `check_render_vulkan`. It is restored in `finally`, so it is correct. Passing it as a parameter would be tidier, but it is not needed for this PR. No blocking issues found in what I read. AI-assisted; commands listed were executed locally.
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!2289
No description provided.