{"record":{"id":"9fa009f105131619","repo":"pbakaus/impeccable","slug":"impeccable-shader-bitmap-decode-failed","errorCode":null,"errorMessage":"[impeccable] shader bitmap decode failed:","messagePattern":"\\[impeccable\\] shader bitmap decode failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"skill/scripts/live-browser.js","lineNumber":8402,"sourceCode":"      ]), gl.STATIC_DRAW);\n      const posLoc = gl.getAttribLocation(program, 'a_position');\n      const uvLoc = gl.getAttribLocation(program, 'a_uv');\n      gl.enableVertexAttribArray(posLoc);\n      gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 16, 0);\n      gl.enableVertexAttribArray(uvLoc);\n      gl.vertexAttribPointer(uvLoc, 2, gl.FLOAT, false, 16, 8);\n    } catch (err) {\n      console.warn('[impeccable] shader setup failed:', err);\n      canvas.remove();\n      return;\n    }\n\n    // Upload the screenshot as a texture\n    let bitmap;\n    try {\n      bitmap = await createImageBitmap(blob);\n    } catch (err) {\n      console.warn('[impeccable] shader bitmap decode failed:', err);\n      const lose = gl.getExtension?.('WEBGL_lose_context');\n      try { lose?.loseContext(); } catch {}\n      showShaderBitmapFallback(canvas, blob);\n      return;\n    }\n    texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmap);\n    if (bitmap.close) bitmap.close();\n\n    const uTime = gl.getUniformLocation(program, 'u_time');\n    const uRes = gl.getUniformLocation(program, 'u_resolution');\n    const uAccent = gl.getUniformLocation(program, 'u_accent');","sourceCodeStart":8384,"sourceCodeEnd":8420,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/live-browser.js#L8384-L8420","documentation":"After the shader overlay's GL setup succeeds, the captured screenshot blob is decoded with createImageBitmap before texture upload. If decoding rejects — empty/corrupt blob from a racing capture, decode OOM, browser quirk — the code logs 'shader bitmap decode failed:', force-loses the WebGL context via WEBGL_lose_context, and shows showShaderBitmapFallback: a static, non-GL rendering of the same image.","triggerScenarios":"The blob passed in is empty or truncated because capture raced DOM teardown (see the capture-failed path); image decode under memory pressure; browsers with partial createImageBitmap support for PNG blobs.","commonSituations":"See trigger scenarios.","solutions":["No action needed — the static fallback shows the same screenshot","If this recurs, chase the upstream capture path (a decode failure usually means the blob was never valid)","Retry the generate to get a fresh capture and a working animated overlay"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (!blob || blob.size === 0) { showShaderBitmapFallback(canvas, blob); return; } // skip decode for empty blobs","typeGuard":null,"tryCatchPattern":"try { bitmap = await createImageBitmap(blob); } catch (err) { console.warn(err); gl.getExtension?.('WEBGL_lose_context')?.loseContext(); showShaderBitmapFallback(canvas, blob); return; }","preventionTips":["Validate the blob exists and is non-empty before decoding","Investigate recurring decode failures upstream — they usually trace to a racing capture","Keep the static fallback path tested so degrade-to-image is always available"],"tags":["createimagebitmap","webgl","shader-overlay","image-decode"],"backgroundTag":"image-decode-failed","analyzedSha":"f88b2837a7d7c3182e46307bbbb091a1ed547571","analyzedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}