Open jimblandy opened 2 months ago
cc @sagudev
const_assert
works for:
const one = 1.0;
const_assert one == 1.0;
and for:
const_assert 1 == 1.0;
Now if we have:
fn f() -> i32 {
const one = 1;
if (one == 1.0) {
return 42;
} else {
return 35;
}
}
it compiles to:
fn f() -> i32 {
if false {
return 42i;
} else {
return 35i;
}
}
so I think something is wrong with evaler (specifically how it handles abstract types - I think it's #4400).
The problem is that abstractint is to eagerly converted to i32, then in binary_op
we return result of I32(1) == AbstractFloat(1.0)
WGSL says constants can have abstract types. I don't think Naga implements that.
WGSL says constants can have abstract types. I don't think Naga implements that.
Indeed, we try to concertize value:
I think this ought to pass validation, but it fails:
When I run this on 50b71287c, I get:
This seems to cause WebGPU CTS failures: