From e2f21bed6e77e5e027b11cbe8bfba55b7d2eb4cb Mon Sep 17 00:00:00 2001 From: bsheedy-work Date: Tue, 2 Apr 2024 17:16:28 -0700 Subject: [PATCH 1/2] Add epsilon to float comparison Adds an epsilon when comparing float values in conformance/extensions/webgl-depth-texture.html. As-is, it is possible for tests to fail with output such as: At 2,0, expected within [0.2,0.6], was 0.600 FAIL At 2,0, expected within [0.2,0.6], was 0.600 --- sdk/tests/conformance/extensions/webgl-depth-texture.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tests/conformance/extensions/webgl-depth-texture.html b/sdk/tests/conformance/extensions/webgl-depth-texture.html index f2318cc1d3..8768a52cd3 100644 --- a/sdk/tests/conformance/extensions/webgl-depth-texture.html +++ b/sdk/tests/conformance/extensions/webgl-depth-texture.html @@ -349,7 +349,7 @@ const eMax = expectedMax[t]; let func = testPassed; const text = `At ${xx},${yy}, expected within [${eMin},${eMax}], was ${was.toFixed(3)}` - if (was <= eMin || was >= eMax) { + if (was <= eMin - eps || was >= eMax + eps) { func = testFailed; } func(text); From 7b5814521ecd6775a08177c404a75342449b5f5a Mon Sep 17 00:00:00 2001 From: bsheedy-work Date: Tue, 2 Apr 2024 17:41:37 -0700 Subject: [PATCH 2/2] Uniformly apply epsilon Removes the epsilon value added to certain parts of the expected min/max values in conformance/extensions/webgl-depth-texture.html, instead using only the epsilon applied when actually comparing values. --- .../conformance/extensions/webgl-depth-texture.html | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sdk/tests/conformance/extensions/webgl-depth-texture.html b/sdk/tests/conformance/extensions/webgl-depth-texture.html index 8768a52cd3..6ad2f5876d 100644 --- a/sdk/tests/conformance/extensions/webgl-depth-texture.html +++ b/sdk/tests/conformance/extensions/webgl-depth-texture.html @@ -323,21 +323,18 @@ d01, d01, d11, d11 ]; expectedMax = expectedMin.slice(); - - expectedMin = expectedMin.map(x => x - eps); - expectedMax = expectedMax.map(x => x + eps); } else { expectedMin = [ - d00-eps, d00, d00, d10-eps, d00, d00, d00, d10, d00, d00, d00, d10, - d01-eps, d01, d01, d11-eps, + d00, d00, d00, d10, + d01, d01, d01, d11, ]; expectedMax = [ - d00+eps, d10, d10, d10+eps, + d00, d10, d10, d10, + d01, d11, d11, d11, d01, d11, d11, d11, d01, d11, d11, d11, - d01+eps, d11, d11, d11+eps, ]; }