Repository navigation
shader: lower v_ldexp_f32 in the direct compute path - #3057
Conversation
|
Thanks for adding the |
|
I tested the single Windows 11 foreach ($preset in 'release', 'dev') {
cmake --build --preset $preset --target compile_dxil native_store_replay
ctest --preset $preset --no-tests=error -j 1 -R '^native_(ldexp|absdiff|perm_lerp|cvt_pk16)_(controls|hardware)$' -V
}Both presets passed 8/8 without skips. As an independent Release check, I replayed 192 input/exponent pairs across 24 dispatches and compared all 49,536 readback words against |
Exact binary32 scaling after pixel_aot.py's ldexp32 with integer bit operations only: zero, Inf and NaN unchanged, denormal inputs normalized, denormal results rounded to nearest even, S1 clamped to [-512, 512] and an integer saturate for clamp. Modifiers on S1/S2, a src2 field, omod, op_sel, SDWA and DPP are refused. Fixes R0Y00#3013 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60c05ad to
35b43fa
Compare
|
@R0Y00 Replayed just the single Thanks @RonLogic for the independent RTX 4070 and 192-case Re-verified locally on
AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
Reviewed 35b43fac integrated with main 2a4bbff5 (tree 2974b781d9a265c74a68df1d282c5053456a5b5d). The retargeted diff contains only the four v_ldexp_f32 files. The lowering bounds shifts even on discarded lanes, retains special values without clamp, and rounds subnormal results using the retained significand bit. Built compile_dxil native_store_replay and ran ctest --test-dir <build> --no-tests=error -j 1 -V -R '^native_(ldexp|absdiff|perm_lerp|cvt_pk16)_(controls|hardware)$' in Debug and Release /O2. Both passed 8/8 with zero skips, and v_ldexp_f32 matched all 2,064 words on RTX. The compile and incorrect-reference controls passed. Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, SDK DXC 10.0.26100, native replay debug layer off. The native fixture requires wave32 and has no local WARP coverage.
Change
src/gfx1013_direct_compute.inllowersv_ldexp_f32in the direct C++ compute path using integer bit operations only, matchingtools/pixel_aot.py'sldexp32. Fixes #3013.2^S1; zero, Inf and NaN (with payload) pass unchanged; denormalS0normalized via five conditional shifts (16, 8, 4, 2, 1);S1clamped to[-512, 512]; overflow to signed Inf; subnormal results rounded to nearest even;clampsaturates with integer comparisons (NaN/ negative /-0->+0,>= 1.0->1.0, denormals preserved).abs/negonS0handled via bit operations;abs/negonS1/S2, nonzerosrc2,omod,op_sel, SDWA and DPP are refused.tests/native_ldexp_check.py,tests/cmake/native_ldexp.cmake,docs/experiments/native-direct-ldexp.md.Verification
Commit
60c05adfonupstream/cpp-migrationa0f67731, Windows 10.0.26100,devpreset:cmake --build --preset dev --target compile_dxil native_store_replay: ok.ctest --preset dev --no-tests=error -R '^native_ldexp_' -V:native_ldexp_controlspassed (1.13 s);native_ldexp_hardwareskipped (exit 77 — default adapter does not report shader model 6.6 with wave32, so readback is unmeasured).python -B tests/docs_links_check.py: passed (66 Markdown files and 581 links).AI-assisted.