A compositor is a liar.
It takes a description of what you want and hands you back a picture that is not that description. Every windowing system ever shipped is a machine for producing that lie at speed.
The only honest compositor is one that can be caught.
I. Nine Surfaces
BradOS has an operating system in it. The operating system has an interface. The interface has a compositor — the thing that owns the screen, decides what covers what, and hands you pixels.
None of that had ever produced a pixel.
It does now. SHIPPED, as of this week: one C file, libc and libm, no
dependencies, built with -Wall -Wextra -Werror. It renders a 360 × 720 frame
containing nine surfaces and then argues with itself about whether that frame
is correct.
Nine surfaces is a confession, not a boast. A real phone screen has dozens. I started with nine because nine is a number I can hold in my head and check with my eyes.
II. No Typed Value In The Middle
Here is the part I actually care about, and it is not the rasterizer.
The colours and metrics in that frame are not written in the C file. They are read from the generated design system — a canonical token source, 193 tokens compiled into 237 properties, across two themes: dark-matter and light-matter, the second one the last piece of a design decision that had been waiting on me for weeks.
So the chain under test is:
tokens → generator → platform representation → pixels
There is no hand-typed value in the middle. Change a token, regenerate, and the pixels change. If a designer moves the brand gold, the frame follows, because the frame never knew what gold was — it read it. Change the theme, and the same frame re-renders in the other one, because the theme is a token set and the compositor has never met a colour.
This is the part I refuse to give up. Every UI codebase I have ever seen has a colour literal somewhere in a drawing routine, and that literal is a promise nobody made. I have seen the day it arrives: the corpus moved, the generated preview went stale, and the gate that checks it refused the build rather than quietly repairing it. Facts, then the builds that quote them, then the gates. That order is not decoration. It is the reason a design system survives contact with a deadline.
III. Five Checks, Five Passes
The program checks five things and exits non-zero if any of them fails.
| What it proves | Result | |
|---|---|---|
| Damage is conservative | A damaged region, recomposited over the existing frame, is pixel-for-pixel identical to a full repaint | PASS |
| Occlusion saves work | A surface fully covered by one opaque surface above it is never rasterized | PASS — 31,488 px skipped |
| The canvas is the token | A corner pixel equals the background token exactly | PASS |
| The brand is the token | The identity hairline pixel equals the brand accent token | PASS |
| The card is the token | A card pixel equals the elevated surface token | PASS |
Read that table again. Four of the five checks are not about geometry. They say: this pixel is that value. The renderer is not allowed to invent a colour, and it is not allowed to be approximately right.
The first check is the load-bearing one. A compositor whose damage path disagrees with its full path corrupts frames — and it would do so only on the one device with the bad driver, on the one day a user is watching.
IV. Three Bugs It Found In Itself
I did not find these by reading the code. The checks found them. That is the entire argument for having checks, and it is why I wrote them before I trusted anything.
One. The compositing order was inverted. The rasterizer walked the surface tree top-down and painted as it went, so the canvas — the bottom surface — got painted last, over everything. The frame came out as a rectangle of background colour. And here is the part that should worry every engineer who has ever written a test: the "canvas pixel equals the background token" check passed anyway. It passed vacuously — the pixel was the background colour, because the entire screen was the background colour. The hairline check is what caught it.
Two. Occlusion used a bounding-box union. A surface was skipped if it fell inside the bounding box of the opaque rectangles, which silently skipped a visible card and a partly covered slider track. The fix is a stricter rule: a surface is skipped only when one opaque rectangle fully contains it. The rule is deliberately conservative, because a compositor that culls something visible is worse than one that culls nothing.
Three. The border band condition was inverted. A signed distance field is negative inside a shape, so the condition meant to select the edge band selected the entire interior. The card rendered as a border-coloured rectangle. Caught by the check that says a card pixel must equal the elevated surface token.
Three bugs. All three found by the checks, none found by reading.
A reference implementation that hides its own bugs is not a reference. It is a press release.
V. What The Numbers Do Not Claim
Full repaint: 20.2 ms. One damaged region: 3.0 ms.
Read the first number honestly. It is over a 60 Hz budget, and it should be. The reference rasterizer paints the whole canvas — 259,200 pixels — with a per-pixel float signed-distance test, no tiling, no SIMD, no early-out. It is a measurement of the reference path, not a claim about the product path. The product path is the GPU path.
What the two numbers do prove is that the frame clock is real, and that the damage path costs 6.7× less than a full repaint — which is the entire argument for damage tracking existing at all.
The open decision underneath this is D-19: whether the CPU path is a first-class supported path or an emergency fallback. First-class doubles the rendering work and doubles the equivalence testing. Fallback means the Nano SKU looks different.
It decides whether BradOS is one product or two. DESIGNED, not decided, and
I am not going to pretend otherwise.
VI. What This Is Not
Not the product compositor. It has no GPU path, no material passes, no input, no security model, no scheduler. It does not render text — a real text stack is a separate layer and a separate decision. It has never been compared against a panel. The tree is nine surfaces; a real screen has dozens.
And the machine problem, because it is part of the receipt: this tree only configures with the exact flags CI uses, and on the ARM box I work on, the first cold configure always fails while every attempt after it succeeds. So the reference implementation had to be builtable on the machine at hand — because a reference implementation that cannot be built is a document wearing a compile error.
Which is the doctrine, applied without ceremony: build the cone, borrow the ocean. The compositor is cone. Codecs and browser engines are ocean. Nobody has ever won an argument with the ocean by rewriting it.
VII. The Next Three Slices
| Step | What | Needs |
|---|---|---|
| 1 | The reference compositor renders a frame and checks itself | done |
| 2 | The frame-time harness as a permanent gate | done — it runs in the local gate chain, and a skipped gate is never reported as a passed gate |
| 3 | The CPU path on BradISA, rendering into SPMP | The kernel's memory model |
| 4 | The display path on real hardware | A panel — the Tang Nano 9K board |
Step 3 is where it becomes a product. Step 1 is where it became a fact.
The receipts live on the live workbench — the stream, the paths, and the build that produced the frame:
https://brad-devices.github.io/now/
The frame above is the one that was checked. Not a mock-up of it.
The architecture is sound. The execution has caught up.
— The Architect Kisumu, Kenya
