The Experiments That Failed (and Why They Are Worth Keeping)
Five of the 35 experiments in this lab were rejected. Day 7 walks through each: what it promised, how it was measured, why it failed, and what the failure taught. A rejected experiment with its numbers is the cheapest result you will ever get.
Why failures belong in the record
Commits record what stayed. Nothing records the ideas that were tried, measured and thrown away, so six weeks later someone tries them again. In this lab every experiment, kept or not, got an entry with its hypothesis, method, numbers and reason (Day 10 shows the ledger). Five of them were rejected:
| id | idea | why it was rejected |
|---|---|---|
| EXP-008 | Skia backdrop in clipped 1 024-unit tiles | up to 881 differing colour channels at tile seams |
| EXP-010 | composite the web backdrop group with will-change | paint 6.26 s → 6.46 s: no effect |
| EXP-011 | display:none on actor roots for culling | broke scrollIntoView and edge hit tests |
| EXP-030 | particle canvas sized to the particles' box | commit time unchanged: the cost was not pixels |
| EXP-032 | each transform written as one composed matrix() | a 45 % micro-benchmark win; no change in the real frame |
Correct-looking but wrong pixels (EXP-008)
Clipping the backdrop into tiles is the textbook approach. It failed a pixel-parity check: an anti-aliased edge that crosses a seam is drawn half in each tile, each half clipped, and the blend differs from drawing it once. The kept design (Day 2) uses unclipped chunks in paint order instead. Lesson: an optimisation that changes how something is drawn needs a parity check, and the check needs a threshold of zero.
A browser hint that did nothing (EXP-010)
will-change: transform on the backdrop group was meant to give it its own compositor layer, so moving objects would not repaint it. A trace said paint went from 6.26 s to 6.46 s, within noise. Children of an SVG cannot be promoted to their own layer like HTML elements. Day 8 solves the real problem with a structural change. Lesson: test the hint before believing it.
Correct for the screen, wrong for the system (EXP-011)
Culling whole actor roots cut paint from 2.3 s to 1.6 s, but total time did not change, and it broke two things other code relied on: hosts calling scrollIntoView on far objects, and hit tests at the screen edge. The kept variant (Day 4) culls the drawing and keeps the root. Lesson: a fast change that breaks a contract is not a fix.
The cost was not where it looked (EXP-030)
A trace showed that hiding the particle canvas cut a low-end market drag's compositor commit from 2.2 s to 0.4 s. The obvious fix was to shrink the canvas to the box the particles actually occupy, and it was built carefully, with pixel parity over 160 random particle fields.
Interleaved traces said commit did not move (1.94/2.41 s → 1.88/1.79 s), and the bench was a wash (dropped-frame sum 672 → 670). A follow-up drawing particles at half rate was also flat. A CSS ablation finally explained it:
low-end market drag, compositor commit
canvas visible 2 149 ms
canvas display:none 366 ms
canvas visibility:hidden 393 ms
canvas opacity:0 435 ms
canvas CSS-shrunk to 1 px 2 255 ms (same bitmap, smaller box: no change)
The cost belonged to a visible canvas layer on this VM's software compositor, not to its area or update rate. A phone with a GPU composites a canvas without that copy. Both changes were reverted. Day 9 uses exactly this knowledge to decide where a canvas renderer should run.
The micro-benchmark that lied (EXP-032)
After Day 8, setAttribute was the top native cost of a frame, mostly transform strings (about 26 per frame). A micro-benchmark (30 nodes, 300 frames, 6× CPU) showed one composed matrix(a b c d e f) string costing about 45 % less to write and parse than a six-step transform list.
It was built properly: the composition in JS, every input rounded exactly like the old strings (without that, a rigged object far along a wide world moved by about 50 units), and a parity script using the browser itself as the oracle over 40 000 random poses. In the real stage, interleaved traces showed no change (drag rAF 3.93/3.88 s → 4.08/3.79 s). Writing transforms was not what the frame was waiting on. Lesson: a micro-benchmark measures the micro; only the real frame decides.
Design principles at work
- Falsifiable claims. Each experiment states its hypothesis in a form a measurement can refute ("commit will drop with the canvas area"). That is what made five rejections possible instead of five vague "seems fine" merges.
- Reversibility. Every experiment lands as its own commit with its own test or parity check, so reverting one is cheap and leaves the others standing.
- Single source of truth for decisions. The reason lives in the ledger entry, next to the numbers, not in a chat thread.
Key takeaways
- Record rejections with their numbers; they are the cheapest results you will ever get.
- Parity checks for renderer changes: threshold zero, or explain every differing pixel.
- Distinguish the environment from the product: a GPU-less VM made one cost look huge.
- Micro-benchmarks suggest; only the real frame decides.