onnxruntime
5dbaaf9d - Fix WebGPU shader: use bitcast for infinity instead of division by zero

Commit
23 hours ago
Fix WebGPU shader: use bitcast for infinity instead of division by zero Some WGSL shader validators reject constant division by zero (output_value_t(-1.0) / output_value_t(0.0)), causing 'Invalid ShaderModule' errors on Windows CI. Replace with bitcast from IEEE 754 bit patterns: bitcast<f32>(0xFF800000u) = -inf bitcast<f32>(0x7F800000u) = +inf bitcast<f32>() is always valid WGSL (u32→f32 reinterpretation). output_value_t() then converts f32 inf to f16 inf when the output type is half-precision (f16 has an infinity representation). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchu@microsoft.com>
Author
Committer
Parents
Loading