pub(crate) fn rewrite_bool_to_float(src: &str) -> StringExpand description
HLSL coerces bool → float silently (float mask = uv.x > 0.5; yields
0.0/1.0). WGSL refuses with the type of 'mask' is expected to be 'f32'; but got 'bool' (or cannot convert elements of vec3<bool> to f32 for vector comparisons). One of the largest comp failure
clusters in the corpus.
Strategy: walk LocalDecl/Assign whose target type resolves to
f32 / vec_n<f32>; when the RHS is a comparison or short-circuit
boolean, wrap it in select(0.0, 1.0, <cond>) (or select(vec3<f32>(0.0), vec3<f32>(1.0), <cond>) for vector). Stays conservative: only fires when
both the target type and the RHS top-level operator are unambiguous.