Commit ec8e295
test: Stop asserting exact equality on sqrt results
sqrtAB compared Math.sqrt(a*b) against whole numbers with deepEqual, so
it failed on headless-gl with 7.000000476837158 for sqrt(49.0).
That value is 1 ULP above 7.0, and GLSL ES allows sqrt up to 2 ULP of
error — it is not in the correctly-rounded set with + - * /. So the
driver is conforming and the assertion was asking for a guarantee
gpu.js cannot make. Confirmed the arithmetic itself is fine: a*b returns
exactly 49, and sqrt of a literal 49 folds to exactly 7; only the
runtime sqrt carries the ULP.
Compare within 2 ULP of the expected magnitude instead, which is still
tight enough to catch a genuinely wrong result. macOS suite goes 12 -> 9
failures; the remaining 9 are the signed-right-shift and Infinity
encoding families.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b0dedd2 commit ec8e295
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| |||
0 commit comments