"Note that due to WGSL's short-circuiting rules, the call to schlick_fresnel won't evaluate if cannot_refract is true, skipping the computation at angles of total internal reflection. "
This is perfectly fine and will work forever
But this line is doing a lot
is_specular = cannot_refract || schlick_fresnel(ref_ratio, cos_theta) > rand_f32();
consider splitting into multiple if statements.