[WebGPU] A render effect whose WGSL fails to compile never reaches onError: isReady() is true and every draw fails on an invalid pipeline
Maintainers usually reply within 1 day
@Popov72 is already working on this.
Since Dec 2, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- computer-graphics
Research direction
Start in Engines/webgpuEngine.pure.ts at _createPipelineStageDescriptor and _preparePipelineContextAsync, where the modules are created and the context is marked ready without reading getCompilationInfo(). Compare with the compute path in Engines/WebGPU/Extensions/engine.computeShader.pure.ts around line 410, which routes errors to ComputeEffect.onError. Done means a render effect with bad WGSL calls onError, getCompilationError() returns the messages, and isReady() stays false.
Written by the indexing model from the issue text.
Description
Repro
- Bug repro on playground (open with
?webgpu, read the console) - Expected result: an effect whose WGSL shader fails to compile calls
onErrorwith the compiler's messages,getCompilationError()returns them, and the effect never reports ready, the same as GLSL on WebGL2 andComputeEffecton WebGPU. - Current result on 9.37.2:
onErroris never called.executeWhenCompiledfires,isReady()istrue, andgetCompilationError()is"".- The fragment module's
getCompilationInfo()does reporterror: unresolved call target 'mixx'. - Drawing with the effect then fails on every frame with uncaptured
GPUValidationErrors:Error while parsing WGSL: :23:31 error: unresolved call target 'mixx', then[Invalid ShaderModule "fragment"],[Invalid RenderPipeline "RenderPipeline_bgra8unorm_depth24plus-stencil8_samples4_textureState0"]and[Invalid CommandBuffer …], 98 errors in 48 draws.
The playground builds an EffectWrapper whose WGSL fragment calls a function that does not exist (mixx). It passes onError, logs the state once executeWhenCompiled fires, reads getPipelineContext().stages.fragmentStage.module.getCompilationInfo(), then draws the effect with an EffectRenderer after each frame.
Where
Line numbers are from the 9.37.2 tag. master has the same code.
Engines/webgpuEngine.pure.ts:2289-2315_createPipelineStageDescriptorcreates the vertex and fragment modules withdevice.createShaderModuleand never reads theirgetCompilationInfo().Engines/webgpuEngine.pure.ts:2412-2452_preparePipelineContextAsyncsetsstagesand callsonReady().WebGPUPipelineContext.isReadyistrueas soon asstagesis set, so the effect is ready whether or not the modules compiled.Engines/WebGPU/Extensions/engine.computeShader.pure.ts:410readsgetCompilationInfo()for compute shaders and routes errors toComputeEffect.onError, since forum thread https://forum.babylonjs.com/t/48508. Render effects have no equivalent.
Suggested fix
In the WebGPU render path, read getCompilationInfo() of both modules before the pipeline context reports ready. When any message has type === "error", route it through Effect._processCompilationErrors, as the compute path does, so that onError, getCompilationError() and the fallbacks work as they do on WebGL2.
Impact
A shader error on WebGPU is silent at the API level: the effect is ready and the app draws with it, and the only signal is the device's uncaptured errors. In a render pass that feeds the rest of the frame, this blacks out the whole picture with no error the app can catch or report.
Workaround
After executeWhenCompiled, read effect.getPipelineContext().stages.vertexStage.module and .fragmentStage.module and await getCompilationInfo() on each. Treat the effect as failed when any message has type === "error".
Desktop (please complete the following information):
- OS: macOS 26.6.1, Mac mini (Apple M4), WebGPU adapter
apple/metal-3 - Browser: Chrome (WebGPU)
- Version: Chrome 158. Babylon.js 9.37.2 (playground)
Smartphone (please complete the following information):
- Not tested
Additional context
- WebGL2 is not affected: GLSL compile errors already reach
Effect.onError. - No existing issue, PR or forum thread found for render effects. PR #18955 ("Add on error on EffectWrapper") adds the
onErroroption toEffectWrapper, which this bug bypasses on WebGPU.
- Dominant language
- TypeScript
- Stars
- 26.6k
- Forks
- 3.8k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 112
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BabylonJS/Babylon.js
-
WebGPU: Geometry._invalidateVertexBuffers throws 'mesh.subMeshes is not iterable' for a mesh without sub-meshesPossibly taken @vladosskins178 claimed this 14 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
BabylonJS/Babylon.js#19188 ·
Maintainers usually reply within 1 day
-
WebGPU compressed cube readback feeds encoded blocks to diffuse irradiance calculationPossibly taken @yucheng-du claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 54/100
BabylonJS/Babylon.js#19278 ·
Maintainers usually reply within 1 day
-
Atmosphere: floating origin mode assumes the world origin is the planet centre (black sky in ground-level scenes)Possibly taken A pull request linked to this issue is open or already merged. Openin progress
Difficulty 4/5 3-5 days Newbie friendliness 48/100
BabylonJS/Babylon.js#19212 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
enhancement Gaussian Splatting native
Difficulty 4/5 3-5 days Newbie friendliness 43/100
BabylonJS/Babylon.js#19145 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
BabylonJS/Babylon.js#19131 ·
Maintainers usually reply within 1 day
All issues in BabylonJS/Babylon.js
Similar issues
-
Add: Alfa DramasOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
moq-dev/moq#10463 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
ardia-browser/ardia#6391 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
liberation-data/desk#68 ·
Maintainers usually reply within 1 day
-
usability
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
inmanta/web-console#8165 ·
Maintainers usually reply within 1 day