From d5a6c0bce71ddb2a88d4ccba5f965ac4dc9cb65c Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Thu, 6 Aug 2026 16:30:01 -0700 Subject: [PATCH] Playground validation: fix undefined `renderImage` in the scriptToRun path `loadPlayground` declares its third parameter as `referenceImage`, but the `test.scriptToRun` branch passes `renderImage` to `processCurrentScene`. `renderImage` is not bound in that scope, so as soon as the scene script is evaluated the call throws `ReferenceError: renderImage is not defined`, the surrounding catch reports it, and the test fails. Every other call site in `loadPlayground` already passes `referenceImage`, and `processCurrentScene` forwards the argument straight to `evaluateScreenshot(test, screenshot, renderImage, ...)` as the reference image to compare against -- so `referenceImage` is the intended value. This was latent until now: the `scriptToRun` tests could never reach this line, because they wait on `request.onreadystatechange`, which the JsRuntimeHost XMLHttpRequest polyfill never invokes (it only dispatches handlers registered through `addEventListener`). Those tests therefore hung until the harness timeout rather than running, which is why they are currently excluded on every graphics API. With that polyfill gap fixed in JsRuntimeHost, the tests get this far and immediately hit the ReferenceError. With both fixed, Fog, Lines, Lens and Self shadowing pass; Polygon, GUI and Procedural textures now fail fast with actionable, unrelated errors instead of hanging. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 88569c10-a7ff-4373-9a58-afa9c68b8c09 --- Apps/Playground/Scripts/validation_native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apps/Playground/Scripts/validation_native.js b/Apps/Playground/Scripts/validation_native.js index 1553ce29a1..fbdbd00faf 100644 --- a/Apps/Playground/Scripts/validation_native.js +++ b/Apps/Playground/Scripts/validation_native.js @@ -493,7 +493,7 @@ setTimeout(function () { try { currentScene = eval(scriptCode); - processCurrentScene(test, renderImage, done, compareFunction); + processCurrentScene(test, referenceImage, done, compareFunction); } catch (e) { console.error(e);