shader: draw v_exp_f32_e64, v_log_f32_e64 and v_mac_f32_e64 in pixel_aot #723
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/729"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-22T23:21:24Z.
Change
Tests and documentation only.
tools/pixel_aot.pyis unchanged.pixel_aotalready accepts the VOP3 (e64) encodings ofv_exp_f32,v_log_f32andv_mac_f32, but no fixture translated them, so they were never drawn and did not count as covered. #340 (merged) drew the other accepted e64 forms and left the approximate ones out, because D3D allowsexp2andlog2a last-place error and a raw result has no single binary32 reference.One program now draws all three, and makes a bitwise comparison valid:
v_add_f32_e32,v_floor_f32_e32), which returns the same integer for any result within 0.5 of the true one. This checks the operation and its source modifiers, which are what e64 adds over e32, not last-place accuracy.v_mac_f32_e64is exact and is compared directly.A, B, C and D are constants s44 to s47. Two rows are drawn: (-3, -32, 0.25, 4097) and (-4, -8, 0.5, 4097).
v_exp_f32_e64 v12, -s44v_log_f32_e64 v13, |s45|v_mac_f32_e64 v14, -s44, |s45|onto Cv_mac_f32_e64 v15, -s47, -s47onto -16785408Negative controls: eight wrong references on the first row, each replacing one channel, must report
pixel_mismatch.The draws are registered as their own CTest entries,
pixel_aot_e64_approx_hardwareandpixel_aot_e64_approx_warp(tests/pixel_aot_check.py draw-e64-approx), each with its ownFORM_COVERAGE_RECORD, so nothing is added topixel_aot_hardware. That is 10 draws from one compile and one renderer launch. The program is added to the LLVM 15 round trip, the controls assert that the modifiers reachexp2,log2and the unfused helper and thatv_mac_f32_e64with an unwritten destination is refused,tests/form_coverage_check.pyasserts the three forms, anddocs/experiments.mdhas a paragraph (the sentence there saying the approximate exp and log e64 forms are not drawn is updated).This advances instruction-form coverage of the pixel translator by three forms on gfx1013 and two on gfx1030.
Verification
Update before opening: rebased onto
mainat121fdc3asd3e2239. On that commit I reran the LLVM 15 round trip,tests/form_coverage_check.pyand the fullpixel_aot_check.py drawrun on WARP (all pass); the hardware and ctest results below are from the commit named there.The full
ctestrun below was made at cdb6b0e (this change onmain787ace7). The branch was then rebased onto7c256c3(cb49062), which adds only #683 (README and 11 lines of static controls); the two new tests on both backends, the controls, the round trip,form_coverage_check.py,pso_readiness_check.pyanddocs_links_check.pywere rerun there and passed. Windows 10 Pro 22H2 (10.0.19045.6466), Windows SDK 10.0.26100.0 DXC, Debug build, debug layer enabled in every run.24 tests ran. 23 passed, 1 failed, 0 skipped.
pixel_aot_e64_approx_warppixel_aot_e64_approx_hardwarepixel_aot_*_warptestspixel_aot_*_hardwaretestspixel_aot_blend_scalar_hardwaremainon this machine and this change does not touch it.In both new tests the two right references report
max_absolute_error=0, every draw reportsdebug_errors=0 debug_warnings=0, and the 8 wrong references each reportmismatch.Other checks, all passed:
python -B tests/pixel_aot_check.py binary <llvm-mc> <llvm-objcopy> <LLVM-C.dll>with LLVM 15.0.7. LLVM 15 prints all ten instructions of the program exactly as written for-mcpu=gfx1013.python -B tests/pixel_aot_check.py(controls).AGENTS.md.Evidence and follow-up
Coverage, counted with
tools/form_coverage.pyfrom the records of the run above. The baseline is the union of the seven record-writing shader tests run on WARP from a clean copy of787ace7.mainat787ace7The forms added are exactly
v_exp_f32_e64,v_log_f32_e64andv_mac_f32_e64.v_mac_f32is not in the gfx1030 list, so that list gains two. None is removed.docs/coverage/dashboard.svgis not regenerated here.What this does not show: last-place accuracy of exp and log on any adapter, inputs outside these two rows (zero, negative arguments to log, infinities, NaN), and what the console computes. The e32 forms keep their existing draws.
Overlap with open pull requests: #340 is merged and does not contain these. The diffs of the open shader pull requests (38 read) were searched for the three form names on added lines; none adds them. This pull request appends one line to the
check_binaryfixture list, as every open shader pull request does, so a textual conflict there with whichever lands first is expected and trivial.AI-assisted (Claude Code). The Windows results were measured locally.
🤖 Generated with Claude Code