Status: Accepted (2026-11-30). Amends 0102 (interned paint) and the NodeColumns contract of 0024.
Fill, stroke style and corner radius are interned (ADR 0024): each node stores a small index, and doc.cols exposes the tables as fillTable, strokeColor, strokeWidth and radiusTable. Three readers use them:
Commands.setColor), which keep the channel not being changed: alpha when a colour is picked, RGB when only the opacity changes.The tables are InternTables that start at 16 entries and reallocate their arrays as they grow (x1.5). doc.cols took its views in refreshCols(), which ran only when the node columns were allocated or grown. A table that grew afterwards left cols pointing at the old array. Every index past the old capacity then read 0, which is a transparent fill and no stroke. Freed and reused slots kept the old values, so some nodes showed another node’s stroke.
Doc.decode allocated the columns first and interned the paint afterwards. So on any page with more than 15 distinct fills or stroke styles, the shapes whose values were interned later rendered empty after a reload. This was reported on 2026-11-30. On a page with an agent-drawn screen (about 30 alpha fills and 25 stroke styles), the dev panel’s 2M random shapes were all transparent after reopening the page. Selection outlines still drew, because the outline pass ignores paint. On a page with only the random shapes, the 16th palette colour (1/16 of the shapes) vanished and many strokes were wrong. Server renders were correct throughout, because the SVG/PNG path reads the tables directly.InternTable gets an onGrow hook, called after its arrays are replaced. Doc sets it on fills, strokes and radii to refreshPaint(), which re-points the four views; refreshCols() calls it too. So doc.cols always holds the tables’ current arrays. Readers keep reading cols.fillTable[...] and must not cache those arrays across edits, which is the rule they already follow for every other column.
cols (get fillTable() { return doc.fills.a }): always right, but an accessor call on the engine’s per-node derivation path (emit reads paint for every instance) and in the selection summary loop. Rejected: the hook costs nothing per read.if (cols.fillTable !== fills.a) refresh()): needs the check at every intern site (SET, block columns, decode). Each new site is a chance to forget it. Rejected for the single hook at the source.node packages/doc/bench/run.ts --only memory,apply, interleaved 5 rounds: apply 100K SETs 8.0 / 8.1 ms, 5M-shape apply and encode within 1.5%. Bytes per node are identical (47.13 / 43.21 B).packages/doc/test/paint-views.test.ts (decode, a generated page after a many-colour screen, in-session SET growth, one CREATE_BULK block) and the engine test “reloaded snapshot: instances keep their fills and strokes” (packages/engine/test/derive.test.ts). Both failed before the fix.