shader: lower binary16 VOP1 reciprocal and square root #3558

Manually merged
github merged 9 commits from github-bot/gh-3556 into gh-pr/3556/base 2026-11-30 09:03:43 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-11-30 05:15 UTC · original
lambirou:shader/f16-vop1 → main · +915 −63 · 13 files · 9 commits · merged 2026-11-30 09:00 UTC

Part of the VOP1 f16 slice. Stacked on #3551; rebase after it lands.

This adds the plain binary16 VOP1 forms of v_rcp_f16 and v_sqrt_f16, in e32 and e64 spellings (four reference rows):

  • Widen the low half exactly, evaluate 1.0f / x or sqrt(x) in binary32, then narrow with the existing integer nearest-even conversion.
  • Keep the static result proof with f16_rcp_sqrt_result: binary32 rounding is applied before binary16 narrowing, so the result is not double-rounded; rcp(±0) gives ±infinity, sqrt(-0) keeps -0, and a negative square root has no modelled NaN payload.
  • The same guards as the other plain f16 VOP1 ops: finite proven source, half_denorm=preserve, destination 0..255, no outstanding sample. Modifiers, clamp, op_sel, DPP and SDWA stay refused.

Tests

  • pixel_aot_f16_rcp_sqrt_hardware passed on the AMD RX 9060 XT (driver 32.0.32029.2010), 6.76 s.
  • pixel_aot_f16_rcp_sqrt_warp passed on WARP, 5.46 s.
  • Negative controls: rcp/sqrt swapped and high-half source read report pixel_mismatch; an unproven source is refused.
  • tests/form_coverage_check.py passes, including the new check_f16_rcp_sqrt_forms; the scanner/translator agreement tests pass.
  • The targeted JUnit records all four forms: v_rcp_f16_e32/e64 and v_sqrt_f16_e32/e64.

Expected full table after both this and #3551: 1,546/1,968 gfx1013 and 1,537/1,863 gfx1030.

Limits

No console measurement. The high half of the destination is not observed. The NaN payload of a negative sqrt and special values beyond rcp infinities are not modelled. DPP, SDWA, v_rsq_f16 and the five other VOP1 f16 ops remain out of scope.

The branch is based on #3551, itself based on red main 44a3ad5a; #3544 fixes the pre-existing startup_triage_run failure that can turn the Linux check red.

AI-assisted.

**@⁠lambirou** on GitHub · 2026-11-30 05:15 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3556) `lambirou:shader/f16-vop1` → `main` · +915 −63 · 13 files · 9 commits · merged 2026-11-30 09:00 UTC Part of the VOP1 f16 slice. Stacked on #3551; rebase after it lands. This adds the plain binary16 VOP1 forms of `v_rcp_f16` and `v_sqrt_f16`, in e32 and e64 spellings (four reference rows): - Widen the low half exactly, evaluate `1.0f / x` or `sqrt(x)` in binary32, then narrow with the existing integer nearest-even conversion. - Keep the static result proof with `f16_rcp_sqrt_result`: binary32 rounding is applied before binary16 narrowing, so the result is not double-rounded; `rcp(±0)` gives ±infinity, `sqrt(-0)` keeps -0, and a negative square root has no modelled NaN payload. - The same guards as the other plain f16 VOP1 ops: finite proven source, `half_denorm=preserve`, destination 0..255, no outstanding sample. Modifiers, clamp, op_sel, DPP and SDWA stay refused. ## Tests - `pixel_aot_f16_rcp_sqrt_hardware` passed on the AMD RX 9060 XT (driver 32.0.32029.2010), 6.76 s. - `pixel_aot_f16_rcp_sqrt_warp` passed on WARP, 5.46 s. - Negative controls: rcp/sqrt swapped and high-half source read report `pixel_mismatch`; an unproven source is refused. - `tests/form_coverage_check.py` passes, including the new `check_f16_rcp_sqrt_forms`; the scanner/translator agreement tests pass. - The targeted JUnit records all four forms: `v_rcp_f16_e32/e64` and `v_sqrt_f16_e32/e64`. Expected full table after both this and #3551: 1,546/1,968 gfx1013 and 1,537/1,863 gfx1030. ## Limits No console measurement. The high half of the destination is not observed. The NaN payload of a negative `sqrt` and special values beyond `rcp` infinities are not modelled. DPP, SDWA, `v_rsq_f16` and the five other VOP1 f16 ops remain out of scope. The branch is based on #3551, itself based on red `main` 44a3ad5a; #3544 fixes the pre-existing `startup_triage_run` failure that can turn the Linux check red. AI-assisted.
Lower the 62 v_cmpx_*_sdwa forms of gfx1013/rdna2 in the pixel translator,
reusing the existing v_cmpx EXEC region opener. VOPC SDWA has no destination:
the comparison writes EXEC, so the non-SDWA path is unchanged.

Add draw-cmpx-sdwa (warp/hardware), the static controls and the coverage
assertions, and teach the scanner the new spellings.

Tests: draw-cmpx-sdwa warp/hardware, draw-cmpx-regions warp,
draw-sdwa-cmp warp, form_coverage_check, rdna2_tools_check.
Coverage: 62 of 62 forms in each reference; 1542/1968 gfx1013 and
1533/1863 gfx1030 in the 194-entry WARP replay.
Add v_rcp_f16 and v_sqrt_f16 to the plain pixel VOP1 path in e32 and e64, matching the direct compute binary32 operation and binary16 narrowing. Cover finite-source proofs, mode and modifier refusals, exact and rounded values, chains, readers, scanner agreement, and form coverage.

Refs #839
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 05:15:14 +00:00
case6 of startup_resource_retire_title releases the newer wrapper and calls settle() without waiting for the queues. Every release signals a release-time fence on each registered queue, and settle() only resubmits the drain list, so a fence that has not completed leaves both wrappers retained and the stage fails with retained=131072/2 against 65536/1. Sync the direct and gated queues before settle(), as #3457 did for startup_resource_retire. The expectation is unchanged.

Refs #3507
github-bot changed target branch from main to gh-pr/3556/base 2026-11-30 09:03:42 +00:00
github manually merged commit 9af0e3e85f into gh-pr/3556/base 2026-11-30 09:03:43 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.