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

Merged
R0Y00 merged 2 commits from upstream-pr/545 into main 2026-11-22 10:38:10 +00:00
R0Y00 commented 2026-11-22 10:28:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T10:28:13Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6541293149 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/545). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T10:28:13Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:43:37 +00:00
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!539
No description provided.