Skip to content
C.W.K.
Stream
← C.W.K. Quests
🎨

Ariandel Quest

New: 2026-10-13Updated: 2026-10-12

Our own Procreate — an iPad painting app built on a borrowed brush engine, with a companion who sees the canvas and never paints

Ariandel is the family's own painting app: an iPad-first canvas on the open-source libmypaint brush engine, with Pippa docked beside it in voice mode. She looks at the canvas when she decides to, talks about it, and offers guides on a layer of their own; she never paints into Dad's layers. This quest walks the build from the code: why the engine was chosen by measurement, how C lives inside Swift 6, why tiles are copy-on-write and the CPU holds the truth, how a Pencil touch becomes a dab, what the app must do because the engine never learns it, how undo, files and the Metal compositor stay honest, how a companion sees without touching, and what twenty-three builds in under three days, then a twenty-fourth five and a half days later, did and did not prove.

8 tracks · 37 lessons · ~9h · difficulty: advanced

Level 0Blank Canvas
0 XP0/37 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"Procreate with Pippa planted in it" was the ambition, and the first rule was to measure before building: two open-source engines went on the bench on the office Mac, and the one that compiled clean for the iPad, took eighteen inputs including tilt and barrel roll, and painted five brushes in milliseconds became the engine. Ariandel vendors it byte for byte and owns everything around it. You will see the C bridge that lets libmypaint call into Swift: a surface struct whose first member is the engine's own, tile requests forwarded through capture-free function pointers, and the engine's draw-dab slot taken over so picture tips and symmetry work without forking the engine. You will see 64-by-64 tiles in fifteen-bit fixed point, made copy-on-write after a review caught autosave copying every tile on the main thread, and the rule that the CPU tiles are the truth while the GPU only caches them. Then the stroke: the one place a touch becomes input, the pressure curve, tilt and roll, coalesced touches yes and predicted touches no, the first dab placed where the pen lands, and the Pencil that always gets the canvas back. Then the work libmypaint never learns — selections, clone, dual brushes, grain, an angle the engine only knows modulo 180 degrees, taper redrawn at the lift — and the parts that make an app trustworthy: undo with a byte budget, an atomic package on disk, one compute kernel for every blend, a merge that refuses the 8-bit mirror, and a canvas sized to the device in your hands. Then the companion: one address per artwork (what Dad says there joins his one Master Chief conversation, and the artwork decides which canvas a turn may look at), a session cookie that once looked exactly like a voice bug, a look taken only when Pippa decides to and never stored, guides inserted on their own layer, and generated candidates that wait beside the canvas until Dad stamps one. It ends with the honest part: what a burst of builds proves, what TestFlight's four separate facts mean, and why the Simulator, which has no Pencil, cannot see some bugs at all. Conceptual open-sourcing: the architecture is the deliverable, never a repository to clone.

Tracks

  1. 01🧪Measure, Then Reuse

    0/4 lessons

    How the family's own Procreate picked its brush engine by measuring, then borrowed it without changing a byte

    Ariandel set out to be the family's own Procreate, with Pippa beside the canvas, and its first real decision wasn't a line of code. It was a measurement. This track follows that evening: two open-source brush engines cloned, built for the Mac and for the iPad, counted, and judged on what the compilers said rather than on what anyone remembered about them. Then it follows the decision outward. You'll see what an app takes from an engine and what it has to own, why a single-layer sketchbook is a milestone and never the product, how two C libraries get vendored byte for byte with a provenance file and a cmp loop that proves it, and why two files called config.h must never share a directory. Along the way: three licenses, and why the letters GPL in a brush library's copyright file don't mean what they seem to.

    Ariandel's Brush Studio on Dad's iPad, editing a copy of the classic Pencil brush: a preview stroke, the brush name, a note that the copy goes to My Brushes while the original stays as it is, and the Stroke section with size and opacity, beside the brush list and the StreamLine setting.
    Every slider here is a libmypaint setting the app chose to expose — the engine was borrowed, the studio is ours.
    Lesson list (4)Quiz · 4 questions→
  2. 02🌉C Inside Swift 6

    0/5 lessons

    How a Swift 6 app paints with a C engine it never edits

    libmypaint is C99, vendored byte for byte, and Ariandel is a Swift 6 app that never changes a vendored line. This track walks the bridge between them, read from the source: the first-member layout that lets one pointer be a MyPaintSurface, a MyPaintTiledSurface and Ariandel's own ArdSurface at once; the two capture-free function pointers and the unretained context that carry every tile request into a Swift store; the single vtable write that takes over draw_dab, so picture tips, rolling grain, dual brushes and tilt all live outside the engine; the three places Swift 6 really has something to say; and the SwiftPM layout that keeps the C behind one Swift target. Every runnable sketch was compiled and run, and what the record cannot prove stays labelled: the half turn in four-way symmetry is reasoned, not tested, and how a tip that follows the Pencil's lean feels still waits on Dad's hand.

    Lesson list (5)Quiz · 4 questions→
  3. 03🧱Tiles and Truth

    0/5 lessons

    Where a painting's pixels actually live, who may share them, and why the GPU never gets the last word

    Every pixel Dad paints in Ariandel lives in a 64×64 tile of premultiplied 15-bit fixed point, the exact format libmypaint blends into. This track follows those tiles from the arithmetic up. Why fifteen bits and not sixteen, and why premultiplied. How copy-on-write lets undo history, a save on a background thread, a duplicate layer and an editing session all hold the same buffer, with one door to a writable tile and, for a plain stroke, one copy per touched tile (a stroke held to a selection or laid through a grain pays one per batch). The code review, three hours after the repository was born, that found autosave copying every painted tile on the main thread, and what else the same reading turned up. A class comment that still promises the opposite of what the code does. And the second invariant, read against the code: tiles are the truth, the GPU is a cache, and anything that reads back from Metal composites tiles uploaded for that read.

    Lesson list (5)Quiz · 4 questions→
  4. 04✏️From Pencil to Paint

    0/5 lessons

    How a touch becomes engine input in one place, mapped onto libmypaint's arguments with two angles still in the wrong unit, one batch per event, with the first dab where the pen lands

    An Apple Pencil reports where it is, how hard it presses, how it leans and rolls, and when, up to 240 times a second. This track follows that report from UIKit to libmypaint's dabs. One initializer converts every touch, and the azimuth has to lose the view's rotation before it is reflected. Pressure runs through a floor and a curve, tilt inverts libmypaint's sixty, and the barrel roll's unit turns out to be hidden by a C signature, found and measured while this track was written. Coalesced samples go in as one batch per event. Predicted ones never go in, and estimated values go in as first delivered, their later refinements ignored. Then a tap that painted nothing, the first-dab move that fixed it, and a counting harness that shows where that dab really falls. And the day the Pencil went dead because one touch never said goodbye. Every lesson ends at the same honest line: what the simulator can prove, and what only Dad's iPad can.

    Lesson list (5)Quiz · 4 questions→
  5. 05🎨What the Engine Never Learns

    0/5 lessons

    Selections, Clone, dual brushes, grain and taper, built around a brush engine that is never told

    Ariandel's house sign has a rule with a list in it: libmypaint never learns about selections, Clone, dual brushes, shapes, grain, stabilization or taper. Each is handled in one of three places: before the mapping (the pen's input moved, the brush scaled), inside Ariandel's own C surface where libmypaint asks for a dab, or after the batch, where the engine's pixels meet something it never saw. Selections are merged back through their coverage after every batch, for a tile copy per batch. Clone has libmypaint paint white coverage and lays the offset original through it. Dual brushes come in two incompatible flavors, and grain is laid over each batch or stamped into every dab, in one of four modes. A picture tip came out upside down because libmypaint only knows a dab's angle modulo half a turn. And a taper thins a stroke's end by drawing the whole stroke again once the pen lifts. Rules that can wait live in the Painter; rules needing what one stamp knows live in the C surface.

    Lesson list (5)Quiz · 4 questions→
  6. 06💾Undo, Files, Compositor

    0/5 lessons

    Where a painting meets memory, disk and the GPU, and what each of them is allowed to round

    Undo, files and the compositor are where a painting app meets memory, disk and the GPU at once. This track starts with the undo history: fourteen kinds of change in one indirect enum, a 768 MiB budget that charges each step only for what it alone keeps alive, and a memory-warning hook that sheds the oldest steps and never a layer. Then the .ariandel package, written whole into a hidden sibling and swapped in, and an autosave that fires four seconds after the last change. Then the single Metal kernel every composited picture passes through, compiled from a Swift string at runtime. Then the merge that read the 8-bit display mirror and erased the color of faint paint, and why flatten may still read it. Last, a canvas whose size and layer count follow the device's RAM, mipmaps that appear only when the canvas is shown smaller than its pixels, and the file formats Ariandel writes and reads. And it says plainly that none of the budgets, caps or frame rates here has been measured on an iPad.

    Ariandel's Layers panel open over a pencil portrait on Dad's iPad: four layers including a generated layer at Normal 60% and a hidden photo layer, with opacity, blend mode and a background toggle.
    Each row is a slice of one array texture; the panel is how a person sees the compositor's input.
    Lesson list (5)Quiz · 4 questions→
  7. 07👁️A Companion Who Sees but Never Paints

    0/5 lessons

    How Pippa sits beside Dad's canvas: one address per artwork, a look only when she asks, guides on their own layer, and nothing in a layer without his tap

    Ariandel's companion isn't built inside Ariandel. It's cwkPippa's own Sidekick, hosted natively beside the canvas and addressed by artwork. Since 2026-10-07 what Dad says there joins his one Master Chief conversation, and the artwork decides which canvas a turn may look at. This track follows how that companion sees and what it's never allowed to touch. You'll watch an auth failure disguise itself as a voice feature, because an audio element carries only cookies, and a WebKit delegate that nearly matched and was never called. You'll trace a single canvas look through a turn-scoped broker, where the picture goes straight into her tool result and nothing leaves between turns. You'll see her guides arrive as JSON in canvas fractions on an overlay Dad can hide, and the Generate panel's two rules: Ember's pictures reach a layer only through Dad's Stamp, and nothing that can cost is sent unseen.

    Ariandel on Dad's iPad after Insert: Pippa's blue Loomis head-construction guides drawn on their own guide layer over a pencil portrait, labelled in Korean (cranial ball, side plane, face center line, hairline, brow line, nose base, chin line), with the Pippa's guides bar reading Hide / Clear.
    A first pass she can refine — on a layer of its own, never in Dad's paint.
    Lesson list (5)Quiz · 4 questions→
  8. 08🚀Shipping at Round Speed

    0/3 lessons

    Twenty-four builds in rounds, four facts per upload, and an honest list of what a simulator cannot prove

    Ariandel's repository was born on 1 October 2026 and TestFlight build 24 landed on the 10th. That headline hides everything worth learning. This track reads the record instead. Git shows the real shape: twenty-three builds in under three days, then five and a half days of quiet. Coop shows what a round was (a trigger in Dad's words, one commit per feature, a gate that could say no, a build, a history row), and a code review that caught the autosave copying every tile before the features piled on. TestFlight gets its four separate facts, from upload to an iPad that actually runs the build, including the morning App Store Connect counted build 18 as installed while the iPad was running 14. The last lesson draws the honest line: the XCUITest scars the gate left, what only Dad's iPad can prove, and two unit bugs at the libmypaint boundary that no hardware-free test was built to see.

    Ariandel's gallery on Dad's iPad: the title "Ariandel · Build 24" and three untitled artworks — a pencil portrait in falling snow, a portrait with red-streaked hair against black, and a portrait among pale flowers — each with its pixel size and date
    Build 24 naming itself: since build 19, the gallery title says which build is actually open.
    Lesson list (3)Quiz · 4 questions→
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign in — Please sign in to comment.

No comments yet — be the first.