shader: lower and verify the plain e32 float-to-uint pixel conversion #545

Manually merged
github merged 2 commits from gh-pr/545/head into gh-pr/545/base 2026-11-26 22:00:31 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-22 10:28 UTC · original
R0Y00:codex/ps-e32-float-uint → main · +159 −1 · 7 files · 2 commits · merged 2026-11-22 10:38 UTC

Behavior

Teach the pixel translator and its scanner the plain gfx1013 e32 float-to-unsigned conversion. Reuse the conversion helper contributed in #449. Keep register readiness, whole-quad input validity, and affine coordinate checks. Narrowly overlaps the unsigned e32 portion of #438. Refs #360 and follows #536.

Verification

Tested head 9790c73 on Windows 11 build 26200.9974 with the D3D12 debug layer enabled, RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818.

  • ctest --preset dev --no-tests=error -R '^pixel_aot_u32_from_f32_' -V passed 2/2. On each adapter, both entry and whole-quad draws matched all 32 bits for 27 input words across 4,096 pixels. Replacing truncation with rounding produced the expected mismatches for 1.875 and 3.75. The float immediately below 2^32 yielded 0xffffff00, and 2^32 yielded 0xffffffff.
  • python3 -B tests/pixel_aot_check.py binary ../pixel-aot/llvm-tools/usr/lib/llvm-15/bin/llvm-mc ../pixel-aot/llvm-tools/usr/lib/llvm-15/bin/llvm-objcopy libLLVM-15.so.1 passed under WSL with LLVM 15. Both draws use source-built fixtures.
  • The fixed-profile scan in docs/experiments.md covered all 26,503 records. Of the original 530 PS (459 streams), zero passed their first conversion with the original bindings, and zero completed. The diagnostic now identifies the missing input at that instruction, v3 in 447 or v2 in 83. All 530 declare reads of SV_Position.xy in the logical signature. The physical entry mapping remains open.
  • A separate diagnostic injected two distinct, defined fixture values. All 530 then crossed both conversions and reached an unbound scalar input, s17 in 505 records, s15 in 23, and s14 in 2.
  • Full verified record counts remain 851 PS, 12 CS, 2 MS, 0 VS and 0 GS. Across 988 matching profile/container outputs, 616 sources were identical and all remaining 372 pairs produced byte-identical DXIL with the same DXC. Pipeline and output totals carry forward the prior draws on the same binaries. The conversion fixtures above ran on both adapters this round.

Integrated main comparison

Compared main 075413d and the integrated PR head f4c566e on all 26,503 records with the same profiles. Both lower 852 PS, 13 CS and 2 MS (867 total), with zero VS and GS. All 990 generated profile/container sources match byte-for-byte between them. The additional PS and CS relative to the earlier 865-record snapshot both compiled with DXC and were already accepted on main. No new draw or dispatch readback is claimed for these two.

On the integrated head, the same 447/83 split remains. Both adapter CTests passed again with the rebuilt renderer and the main branch's ps_6_2 -denorm preserve pixel compiler configuration, including both wrong-rounding counterexamples. The LLVM 15 binary regression also passed again.

AI-assisted contribution.

**@⁠R0Y00** on GitHub · 2026-11-22 10:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/545) `R0Y00:codex/ps-e32-float-uint` → `main` · +159 −1 · 7 files · 2 commits · merged 2026-11-22 10:38 UTC ## Behavior Teach the pixel translator and its scanner the plain gfx1013 e32 float-to-unsigned conversion. Reuse the conversion helper contributed in #449. Keep register readiness, whole-quad input validity, and affine coordinate checks. Narrowly overlaps the unsigned e32 portion of #438. Refs #360 and follows #536. ## Verification Tested head `9790c73` on Windows 11 build 26200.9974 with the D3D12 debug layer enabled, RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818. - `ctest --preset dev --no-tests=error -R '^pixel_aot_u32_from_f32_' -V` passed 2/2. On each adapter, both entry and whole-quad draws matched all 32 bits for 27 input words across 4,096 pixels. Replacing truncation with rounding produced the expected mismatches for 1.875 and 3.75. The float immediately below 2^32 yielded 0xffffff00, and 2^32 yielded 0xffffffff. - `python3 -B tests/pixel_aot_check.py binary ../pixel-aot/llvm-tools/usr/lib/llvm-15/bin/llvm-mc ../pixel-aot/llvm-tools/usr/lib/llvm-15/bin/llvm-objcopy libLLVM-15.so.1` passed under WSL with LLVM 15. Both draws use source-built fixtures. - The fixed-profile scan in docs/experiments.md covered all 26,503 records. Of the original 530 PS (459 streams), zero passed their first conversion with the original bindings, and zero completed. The diagnostic now identifies the missing input at that instruction, v3 in 447 or v2 in 83. All 530 declare reads of SV_Position.xy in the logical signature. The physical entry mapping remains open. - A separate diagnostic injected two distinct, defined fixture values. All 530 then crossed both conversions and reached an unbound scalar input, s17 in 505 records, s15 in 23, and s14 in 2. - Full verified record counts remain 851 PS, 12 CS, 2 MS, 0 VS and 0 GS. Across 988 matching profile/container outputs, 616 sources were identical and all remaining 372 pairs produced byte-identical DXIL with the same DXC. Pipeline and output totals carry forward the prior draws on the same binaries. The conversion fixtures above ran on both adapters this round. ## Integrated main comparison Compared main `075413d` and the integrated PR head `f4c566e` on all 26,503 records with the same profiles. Both lower 852 PS, 13 CS and 2 MS (867 total), with zero VS and GS. All 990 generated profile/container sources match byte-for-byte between them. The additional PS and CS relative to the earlier 865-record snapshot both compiled with DXC and were already accepted on main. No new draw or dispatch readback is claimed for these two. On the integrated head, the same 447/83 split remains. Both adapter CTests passed again with the rebuilt renderer and the main branch's `ps_6_2 -denorm preserve` pixel compiler configuration, including both wrong-rounding counterexamples. The LLVM 15 binary regression also passed again. AI-assisted contribution.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:00:29 +00:00
github manually merged commit f4c566e6a2 into gh-pr/545/base 2026-11-26 22:00:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.