{"record":{"id":"b4ef12af82d4d2be","repo":"pbakaus/impeccable","slug":"impeccable-shader-setup-failed","errorCode":null,"errorMessage":"[impeccable] shader setup failed:","messagePattern":"\\[impeccable\\] shader setup failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"skill/scripts/live-browser.js","lineNumber":8860,"sourceCode":"  // teardown that landed inside that window found shaderState still null,\n  // returned, and then watched the construction publish itself over a session\n  // that had already left GENERATING, with no teardown left to run. That is\n  // the generating loader frozen over a page that already cycles (issue #719).\n  // Every teardown bumps this epoch; a construction abandons its own canvas as\n  // soon as it sees the epoch move.\n  let shaderEpoch = 0;\n\n  // The element's effective background tone, used as the uniform halftone\n  // ground so content dissolves into dots over it. Unlike resolveCanvasBackground\n  // (which returns null when the element paints its own bg), this always returns\n  // a usable color: the element's own background if any, else the nearest opaque\n  // ancestor, else the paper fallback.\n  // Rasterize any CSS color (oklch, color(), named, hex, rgb) through a 1x1\n  // canvas and read back the sRGB pixel. String-parsing computed colors is a\n  // trap: Chrome returns backgroundColor as oklch()/color() for oklch inputs,\n  // which a hex/rgb regex misses - every site token would fall back to white.\n  let colorParseCtx = null;\n  function cssColorToRgb01(str) {\n    if (!colorParseCtx) {\n      colorParseCtx = document.createElement('canvas').getContext('2d', { willReadFrequently: true });\n    }\n    // Clear first: the ctx is cached across calls, so a semi-transparent color\n    // would otherwise blend (source-over) with the previous call's leftover\n    // pixel, making the result depend on call history.\n    colorParseCtx.clearRect(0, 0, 1, 1);\n    colorParseCtx.fillStyle = '#000'; // invalid input leaves this default\n    colorParseCtx.fillStyle = str;\n    colorParseCtx.fillRect(0, 0, 1, 1);\n    const d = colorParseCtx.getImageData(0, 0, 1, 1).data;\n    return [d[0] / 255, d[1] / 255, d[2] / 255];\n  }\n  function resolvePaperRgb(el) {\n    let node = el;\n    while (node) {\n      const bg = getComputedStyle(node).backgroundColor;\n      if (!isTransparentColor(bg)) return cssColorToRgb01(bg);","sourceCodeStart":8842,"sourceCodeEnd":8878,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f2c7051853848826aac2f4646581d62a732155ad/skill/scripts/live-browser.js#L8842-L8878","documentation":"The WebGL shader overlay (the live visual shown while generating) compiles its program, allocates buffers, and wires attribute pointers inside one try block. Any throw — context creation failed, shader compile/link error, WebGL unavailable or context lost — logs 'shader setup failed:', removes the canvas, and returns: generation continues normally, just without the animated overlay.","triggerScenarios":"WebGL context lost (GPU reset, too many live contexts); hardware acceleration disabled or GPU blocklisted; shader compile failure after a browser/driver change; gl.getAttribLocation returning -1 leading to invalid vertex array state.","commonSituations":"Machines with GPU blocklists or virtualized GPUs; many tabs each holding WebGL contexts; users running with hardware acceleration off; remote-desktop sessions.","solutions":["Treat as cosmetic — the generate/steer flow completes without the overlay","Reload the page to obtain a fresh WebGL context; close GPU-heavy tabs","Enable hardware acceleration in browser settings if overlays matter"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const gl = canvas.getContext('webgl');\nif (!gl) { canvas.remove(); return; } // skip overlay entirely when WebGL is unavailable","typeGuard":null,"tryCatchPattern":"try { /* program + buffer + attribute setup */ } catch (err) { console.warn('shader setup failed:', err); canvas.remove(); return; } // generation proceeds without the overlay","preventionTips":["Treat the shader overlay as strictly optional; never gate the generate flow on it","Release GL contexts when overlays are dismissed to avoid context exhaustion","Test pages with hardware acceleration disabled to confirm the no-GL path"],"tags":["webgl","shader-overlay","gpu","cosmetic-degradation"],"backgroundTag":"webgl-context-failed","analyzedSha":"f2c7051853848826aac2f4646581d62a732155ad","analyzedAt":"2026-08-18T04:58:36.608Z","contentChangedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}