shader: lower ceil and mul:4/div:2 omod in dispatch translator #1384
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1391"
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 tedin7 on 2026-11-24T10:18:19Z.
What
tools/ffx_dispatch_aot.py:v_ceil_f32joins the float table (ceil({0}), one source), for the e32 and e64 spellings, with the same clamp handling asv_floor_f32.mul:4(4.0*(expr)) anddiv:2(0.5*(expr)) are accepted next tomul:2on the float ops. They are VOP3-only, so an e32 spelling with them is refused (ValueError).mul:2on an e32 spelling stays accepted as before. An omod together withclampis still refused in both orders, and so is any other omod text.tests/ffx_dispatch_aot_check.py: seven new LLVM-assembled forms with tabulated expected words (math.ceil, exact power-of-two scaling), twelve mutation controls, new refusal controls. The two old checks that expectedmul:4/div:2onv_mul_f32_e64to be refused now check acceptance.docs/experiments.md: new short section.Why
On origin/main
v_ceil_f32failed with a KeyError andmul:4/div:2failed withUnsupported float modifier, so a dispatch program using them could not be lowered.The hardware output modifier flushes denormals and quiets NaN differently from a plain multiply. The translation, like the existing
mul:2, is a plain multiply: exact for normal results, denormal and NaN-payload behaviour is not modelled. Fixtures avoid both, and avoid ceil inputs in (-1, 0) (result -0.0).Tested
Windows (not run here):
ffx_float_math_warpis the one that runs the new rows through the generated HLSL on WARP; it compares exact words.Linux (ran):
python3 -B tests/ffx_dispatch_aot_check.py llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.sopasses.alugive identical results or errors, except 832 that are explained (new ceil, new mul:4/div:2).py_compile,tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check. All row HLSL lines lower for the readback path.Not run: DXC, WARP, and LLVM 15 (
llvm-mc-15is not installed here).v_ceil_f32and themul:4/div:2omods exist in LLVM 15, and no new syntax is used.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T10:22:40Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
54838ce6:--preset dev):ctest --preset dev -R '^ffx_float_math_warp$' --no-tests=error --output-on-failure— 1/1 passed (1.18s)/O2(--preset release):ctest --preset release -R '^ffx_float_math_warp$' --no-tests=error --output-on-failure— 1/1 passed (1.18s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T10:22:53Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
54838ceℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-24T11:20:37Z.
Tested on Windows 11 26200, MSVC 19.42, RTX 4070 Ti (driver 621.35) at
54838ce. The filter^ffx_floatmath(warp|hardware)$matched no tests. The registered name isffx_float_math_warp, and it passed. No hardware test is registered, so I ran the same readback on the 4070 Ti. ceil, mul:4 and div:2 matched, but it failed on an older fract row:v_fract_f32_e32input 0xb0800000 gave 0x3f800000, expected 0x3f7fffff.AI-Assisted