From fe9d2aff3fb76148f3467dc661ec4cb7d37b0122 Mon Sep 17 00:00:00 2001 From: Brian Hursey Date: Sat, 28 Nov 2026 14:35:30 +0000 Subject: [PATCH] Name the clipped channels in the Ctrl clipping overlay again. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0c113e7 packed clipping into two alpha states (shadow / highlight), so the finish pass could only paint white even though the legend still promised red, green, blue and yellow. The grade pass now writes a 4-bit code (R/G/B + shadow) into alpha and the overlay paints the channels it actually lost: red for one, yellow for two, white for all three. The render check renders the overlay so this cannot regress silently. 🤖 Generated with Codebuff Co-Authored-By: Codebuff --- README.md | 14 ++++++---- scripts/render-check.mjs | 60 ++++++++++++++++++++++++++++++++++++---- src/gl/renderer.ts | 42 ++++++++++++++++++++-------- 3 files changed, 94 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b16c124..bcbb27f 100644 --- a/README.md +++ b/README.md @@ -992,12 +992,14 @@ Conventions worth knowing before changing code: There are no server integration tests; the API is exercised through the UI. -`npm run check:render` covers the one thing the unit suite cannot: real GPU upload -orientation. It encodes a two-tone 16-bit sidecar with the server's own encoder, serves -it beside the matching JPEG proxy and measures the rows that reach a WebGL2 texture in -headless Chrome. If the sidecar ever lands upside down against the proxy again, it fails -with the measured row values. It needs Chrome (`CHROME_PATH` overrides discovery) and -skips with a notice when none is installed. +`npm run check:render` covers the one thing the unit suite cannot: what a shader does to +real GPU pixels. It encodes a 16-bit sidecar with the server's own encoder, serves it +beside the matching JPEG proxy and measures the rows that reach a WebGL2 texture in +headless Chrome. Then it renders that image through the real `Renderer` with the Ctrl +clipping preview on, so the overlay has to paint red for one clipped channel and yellow +for two instead of collapsing to white. It fails on either regression, printing the +measured values, needs Chrome (`CHROME_PATH` overrides discovery) and skips with a notice +when none is installed. --- diff --git a/scripts/render-check.mjs b/scripts/render-check.mjs index e3d46de..be66101 100644 --- a/scripts/render-check.mjs +++ b/scripts/render-check.mjs @@ -58,14 +58,18 @@ function spawnSyncOk(bin) { }); } -/** Three horizontal bands, so any vertical reversal changes every row band. */ +/** + * Three horizontal bands. The first clips only red, the second clips red and + * green (the yellow warning) and the third clips nothing, so the same image + * also proves the clipping overlay still names the channels. + */ function buildSource() { const rgb16 = new Uint16Array(W * H * 3); const rgb8 = new Uint8Array(W * H * 3); const bands = [ - [0.86, 0.22, 0.16], - [0.24, 0.70, 0.28], - [0.16, 0.26, 0.88], + [1.0, 0.55, 0.08], + [1.0, 1.0, 0.08], + [0.24, 0.28, 0.35], ]; for (let y = 0; y < H; y++) { const band = bands[Math.min(bands.length - 1, Math.floor((y / H) * bands.length))]; @@ -85,6 +89,8 @@ const PAGE_HTML = `
boot