shader: lower VOP3 binary64 frexp in pixel AOT #3674
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3674
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3672"
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?
@lambirou on GitHub · 2026-11-30 23:46 UTC · original
lambirou:shader/frexp-f64-pixel→main· +557 −0 · 7 files · 4 commits · openProblem
The gfx1013 and gfx1030 form lists still report
VOP3 v_frexp_exp_i32_f64_e64andVOP3 v_frexp_mant_f64_e64as unobserved. PR #3636 already merged the direct-compute lowering and itstests/native_frexp_f64_check.py; this change adapts that exact bit semantics to thepixel_aotpath instead of duplicating the work. I checked the open PR list and found no PR covering the two pixel forms.Change
tools/pixel_aot.pylowers the VOP3_e64spellings ofv_frexp_exp_i32_f64andv_frexp_mant_f64with two uint-only helpers. They transcribe the direct-compute keep rule, the 1022 bias and the six-step subnormal normalizer; the generated DXIL contains nodouble,i64orfcmp.tests/pixel_aot_check.py controls-frexp-f64covers signed zero, Inf/NaN payloads, normals at several exponents, the smallest normals, every normalizer step, the 2097151/2097152 k=32 boundary, MAX_SUB, DBL_MAX, readers, the two maximum destinations and every refusal. Eleven model mutations must differ from the canonical table.tests/pixel_aot_check.py draw-frexp-f64compares the exact exponent and mantissa words on the integer target and checks four helper mutations: unbiased exponent, lost normalizer shift, modified zero mantissa and swapped source words.docs/experiments/pixel-frexp-f64.md.Verification
python -B tests/pixel_aot_check.py controls-frexp-f64: passed.max_absolute_error=0.tests/form_coverage_check.py: passed.tests/rdna2_tools_check.py: passed (161 tests, 19 capability skips).tests/run_checks_parallel_check.pyandtests/docs_links_check.py: passed.cmake --preset devandcmake --build --preset dev: configured and built on MSVC 19.44.ctest --preset dev --no-tests=error -R '^pixel_aot_frexp_f64_' -V: 3/3 passed (controls, WARP, hardware).Coverage delta
Each form adds one gfx1013 row and one gfx1030 row. Against the records present in the workspace, the covered totals move from 1480 to 1482 for gfx1013 and from 1471 to 1473 for gfx1030; the new rows are exactly
VOP3 v_frexp_exp_i32_f64_e64andVOP3 v_frexp_mant_f64_e64.tests/form_coverage_check.pynow pins both rows ingfx1013.tsvandrdna2.tsvand checks that adding the two fixtures to a baseline of other f64 programs adds exactly those rows.Limits
The draw runs are desktop-adapter evidence for the lowering, not console gfx1013/gfx1030 measurements. The VOP1
_e32spellings remain outside this change. The host has no D3D12 debug layer, so debug-layer validation is unavailable here.AI-assisted (OpenAI Codex).
ebff56d1dcto1d4c603120@Alexofbulgaria on GitHub · 2026-12-01 01:26 UTC · original
Retested current head
a7cfdcb7b0633f1e7545d16f4430a74572dbfd14on Windows26300.10075with a clean Release build (MSVC19.44.35230.0, DXC1.9.2602.17). All threepixel_aot_frexp_f64_*checks passed.32.0.101.917510.0.26100.10068The D3D12 debug layer was active during both renderer replays, with zero errors and warnings across 98 checks per backend. Both backends passed the bit-exact exponent and mantissa draws and detected the four expected negative-control mismatches. The repository form coverage check also passed.
@lambirou on GitHub · 2026-12-01 03:11 UTC · original · reviewed
Reviewed
a7cfdcb7by reading the diff and runningpython -B tests/pixel_aot_check.py controls-frexp-f64.Verdict: approve. The two helpers transcribe the direct-compute model, the guards match the pixel binary64 readers, and the controls pin the special values and normalization boundaries. The controls pass locally.
frexp_exp64returns 0 for zero, infinity and NaN;exponent - 1022for normals; and(53 - steps) - 1074for subnormals. The six steps and the2097152k=32 threshold match the direct-compute lowering.frexp_mant64preserves zero/Inf/NaN words, keeps the sign and the0x3FE00000exponent for normals, and uses the normalized word for subnormals. The largeFREXP64_VALUEStable is cross-checked againstmath.frexp, so the model is not its own only reference.Tests:
controls-frexp-f64passes. The WARP/hardware draws are outside theprfilter, so they remain the author's desktop evidence, as the body says; the translation-time model itself is exercised by the controls.github-bot referenced this pull request2026-12-01 04:44:54 +00:00
@Leyukaka on GitHub · 2026-12-01 15:19 UTC · original · reviewed
All 88 inputs in
FREXP64_VALUESstill produce the correct mantissa if the low-to-high carry is removed from any one of the 8-, 4- or 2-bit normalization steps. Could you add these subnormal inputs to the existing CPU and GPU table? Each distinguishes the corresponding missing carry.0x00001000fedcba980x3fe000fedcba98000x00010000fedcba980x3fe0000fedcba9800x00040000fedcba980x3fe00003fb72ea60In
tests/cmake/pixel_frexp_f64.cmake, both draw tests also invokeINTAKE_PYTHON. Please includeEXISTS "${INTAKE_PYTHON}"in their registration guard so a configure with DXC and no intake interpreter does not register unlaunchable tests.@lambirou on GitHub · 2026-12-02 14:46 UTC · original · reviewed
Follow-up after Leyukaka's carry note on
a7cfdcb7.Verdict: comment. The three proposed subnormal inputs are worth adding: each one crosses a different normalization shift, so a missing low-to-high carry in the 8-, 4- or 2-bit step would otherwise still pass all 88 existing values. Add the three rows to
FREXP64_VALUESand to the draw table; the CPU model and the exact-word draw should both use them.tests/cmake/pixel_frexp_f64.cmake, the draw registrations guard onTARGET offscreen_check AND EXISTS "${DXC_EXECUTABLE}"but not onEXISTS "${INTAKE_PYTHON}", unlike the controls block. A configure with DXC but no intake interpreter registers tests that cannot launch. Add the sameINTAKE_PYTHONguard.This keeps the approval conditional on the added boundary rows; no production-code change is required.
a7cfdcb7b0tob00bea16fc@R0Y00 on GitHub · 2026-12-02 19:17 UTC · original · requested changes
Independent Windows/MSVC Debug
ctest --preset dev --no-tests=error -V -j 1 -R '^pixel_aot_frexp_f64_(controls|warp|hardware)$'passed 3/3 on Windows 11 build 26300, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The current merge still lacks the three subnormal inputs from Leyukaka's review and still registers the GPU Python tests without checkingINTAKE_PYTHONexists. Please add the 8-, 4-, and 2-bit carry cases to both the CPU and draw inputs, and add the interpreter guard to the GPU registration.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.