Abyss Vanish
ABYSS VANISH / DEVELOPMENT JOURNAL

The GPU Draws the Pages Now, and You Can Open Them

October 29–30: UI drawing moves into the shader library and a page's first frame goes from 674 ms to about 145 ms; three new agent-built pages you can play in your browser

In the last entry, three agents built web pages with the engine alone, and we filled the engine's gaps where they got stuck. These two days were about drawing fast: measuring showed that a page's first frame went almost entirely to drawing shapes into pictures on the CPU, so we moved what the GPU can do into the engine's shader library, one step at a time. Then three new agents built the three kinds of page again, and this time every page comes with a version you can use right in your browser.

Previous: Testing the Engine's UI with Award-Style Web Pages →

From drawing fast to opening the pages

This entry follows the development build as of October 30. The thread runs: find what is slow → hand it to the GPU → a stutter only a window shows → three new pages → into the browser. All three pages are fictional brands; every picture here was drawn by the engine headless (no window), with no retouching, and the versions you can open run the same engine.

Handing the drawing to the GPU

The heaviest page was the last round's shop page, Quire: 915 components and a 674 ms first frame. Measured, almost all of it went to drawing shapes, paths and brush strokes into pictures on the CPU, then uploading each one to the GPU.

How we worked
We handed five kinds of drawing to the screen's shader (ui.ash in the engine's shader library), in order: plain panels in one colour or a top-to-bottom fade, drawn by the shader as rounded boxes; turned components handed over upright and turned by the GPU; paths, brushes and panels whose style is a fill alone (up to eight colour stops, vertical, angled or radial), for which the CPU hands over only where the ink falls and the shader computes the colour; a blur on one colour, which blurs only that coverage; and finally that coverage stored as one byte a pixel.
What was hard
Every step was compared pixel by pixel against the CPU's own drawing (Metal and GL, at 1x and 2x), within one to three levels, and checked to fail when the step was taken out. On the way we caught an old hole: the cache did not record who a picture was drawn for, so a canvas that draws differently could be handed something it cannot draw.
What we did
Quire's first frame: 674 → 607 → 400 → 299 → 206 → about 145 ms. The whole window's memory went from 2.68 GB to 537 MB (the GPU's share from 1.67 GB to 299 MB). We measured frosted glass too: even with everything under it moving and blurred again every frame, a frame stays under 1 ms, so it stays as it is.
Still open
Effects such as outlines, shadows and glows, and text, are still composed on the CPU; the first time a page opens it is still drawn, only much faster.

A glide that stuttered

Trying the new build in a real window, a click on the navigation that glides the page to a section stuttered visibly.

How we worked
Measured headless first: about 1 ms a frame during the glide, nothing wrong to see. A headless test steps the picture frame by frame, so it never misses one.
What was hard
The problem was when a window asks for its next frame: only while something in the interface is animating. A page's scroll glide does not count as an animation, so the window stopped half way and moved on only when the mouse did.
What we did
A page that is gliding, still easing after the wheel, or fading its scroll bar now asks for the next frame itself, and stops asking when it comes to rest, so a still page costs nothing. Tried again: smooth.
Still open
Problems that happen only in a window are invisible to headless measurements; someone still has to play it.

Three new pages

The same brief and the same rules for three new agents: only the engine's UI documents, .abyss flows and MCP, no C and no window, then a score on the judges' weights. One thing was new in the brief: which kinds of drawing are now the GPU's, and cheap.

Carreg One's first screen: the slate turntable with pink and blue ink discs

Carreg One · immersive brand

A turntable cut from Welsh slate, the page told as side A of a record: scroll and the arm lowers, the slate comes apart layer by layer and the strobe settles at 33⅓, while two inks drift out of register with the pointer. Self-score 6.9 (design 7, usability 6, creativity 7.5, content 7).

Open in your browser

Carreg One's slate chapter: an isometric view of the turntable coming apart
Cuelight's first screen: red, green and blue stage lights adding up to white

Cuelight · creative portfolio

A four-person lighting studio in Glasgow. Three red, green and blue stage lights follow the pointer and add up to white where they meet; eight projects filter by discipline and open as a case view over the page, each with its cue sheet. Self-score 7.5 (design 7.5, usability 7, creativity 8.5, content 7).

Open in your browser

Cuelight's case view: a figure on stage and the cue sheet
The Vauclair Veilleur product page: chalk dial, options and Add to bag

Vauclair Veilleur · premium e-commerce

A field watch sold on its glow. Dial colour and size change all five views, the price and the reference; add to the bag, change and remove lines there; turn the lights off to see the lume, then how bright it is eight hours on. Self-score 7.6 (design 7.5, usability 7, creativity 8, content 8).

Open in your browser

The bag drawer: three lines, quantities and subtotal
The after-dark chapter: the dial eight hours on and the brightness curve

Desktop browsers (Chrome, Edge, Safari); about 4 MB on first load.

How we worked
Each agent took about 32 to 45 minutes and 110 to 150 tool calls, writing small programs that write the documents, compiling its own flow and checking 1x and 2x pictures with headless renders.
What was hard
All three used what was new in these two days: turning about a point of their own (a tonearm, stage lights, watch hands), additive and multiply blending (three lights adding up to white, two inks overprinting into violet), and a canvas colour.
What we did
First frames: Carreg 168 ms, Cuelight 145 ms, Vauclair 28 ms (mounting took another 134 ms); textures 55, 59 and 5 MB. Weighted self-scores 6.9, 7.5 and 7.6; the last round's best was 7.2.
Still open
All three are still vector illustration, with no photographs, and none has a field you can really type into yet.

The walls they still hit

We checked each agent's report against the code; these are the ones confirmed and worth fixing first.

How we worked
Blending and fading apply part by part: overlapping parts of one instance show through each other and blend with what is under them separately. To act as one layer, the instance has to be drawn into a canvas of its own first and composed after.
What was hard
Gradient panels still have a size limit: a plain panel has none, but a large panel with colour stops is refused past 4 Mpx at 2x, and one refused component keeps the whole page from appearing.
What we did
There is no atan2 (two agents each wrote an approximation); an ordinary function named on… is taken as an event handler (oneLine became the handler of an event called eLine); and a state's style overrides ui.fill.
Still open
These are the next batch; photographs and a real text field wait for larger features.

How the examples run in a browser

The three "open in your browser" links run the same program: the engine's app that opens a UI package on the desktop, compiled to WebAssembly and drawing with WebGL 2.

How we worked
Each page is the engine (1.8 MB), the page's documents and flow, and the engine's typefaces: 3.6 to 4.8 MB in all. A new packaging tool turns any UI package into a web page directory and records every file's sha256.
What was hard
Emscripten's default 64 KB stack was not enough, and all three pages ran out of memory bounds at once; the pages are a fixed 1440 × 900 canvas, cut off in a smaller window.
What we did
The stack is 8 MB now; in a smaller window the canvas is scaled down whole and centred, and pointer positions are mapped back to the canvas. Headless in Chromium and WebKit, all three draw as the native builds do, and the wheel and clicks on the navigation work.
Still open
Tested in desktop browsers only; phones, tablets and Firefox are untested, and the pages do not lay themselves out again for a screen.

Next

First the walls this round hit: blend and fade an instance as one layer, larger gradient panels, atan2, and ordinary functions named on… no longer taken as event handlers. Then the next round, and these web versions stay, so every round's results can be opened directly.

閱讀中文版All entries