Generating a skull
Engineering log · 27 July 2026 · sovereign stack, no third-party geometry shipped
An attempt to generate a human skull procedurally, measured against a real scanned one. This page is written to be read against the pictures and the millimetres, not against gate results — the gates were green throughout while the output was poor, which is the main thing the day taught.
The number
8 mm mean surface error against the reference skull, worst 48 mm, with 297‰ of sampled points more than 10 mm out, over 24,464 samples.
For scale: published craniofacial surgical prediction runs 1.0–1.5 mm, and scan-free body fitting reaches 2.4 mm. 8 mm is a long way from either. It is recorded here because it is the first honest measure of shape this program has had — everything before it measured size or counted triangles.
How the metric works, and why it was free
The generated skull is a signed distance field, so for any point in space it already answers
“how far is this from my surface”. Evaluating it at every vertex of the reference mesh makes
|d| the error at that point, in millimetres — no registration search, no
closest-triangle hunt. The frame transform is derived from the reference’s own bounding box with
z negated, because it is authored facing −z and ours faces
+z. Without that correction the score would compare our face to the back of its skull.
| Dimension | Generated | Reference | Delta |
|---|---|---|---|
| width | 152 mm | 150 mm | +2 |
| height | 204 mm | 207 mm | −3 |
| depth | 210 mm | 215 mm | −5 |
The bounding box matches to 5 mm while the surface is 8 mm off. That gap is the whole lesson: a bounding box cannot see shape.
The reference
Three representations tried
1 — Lofted tubes
Seven lofted ring-tubes. Its gate passed 6/6 — counts, dimorphism, determinism — and none of the teeth drew the thing. The vault spanned the whole skull height, so every facial bone sat geometrically inside it and only the zygomatic end-caps emerged. It read as a plain egg.
Two further passes of moving tubes closer gained almost nothing, and that was the signal: a skull is not a set of tubes. It is one fused shell with holes cut in it, and tubes can be neither fused nor holed.
2 — Implicit field
Bone primitives combined by union, orbits and nasal aperture subtracted as real openings, polygonised by surface nets. One continuous shell with sockets — a genuine step.
3 — Authored in millimetres, fitted
Bugs, all of which produced plausible output rather than errors
| Defect | How it presented |
|---|---|
| Builds silently stale | The build script piped the compiler through tail, so the pipeline’s exit status was tail’s zero. Compile failures were masked and the previous ELF was copied over the top. Several rounds of edits never ran, and the unchanged render was misread as “that change doesn’t matter”. |
| Local toolchain emitted no ELF | Reported success and produced only the .s assembly. Fixed by building on the NAS over the sovereign API instead. |
| No mesh viewer existed | The program emitted .nxmesh files for weeks with no way to open one. This is how a skull that renders as an egg held a green gate. |
| Header size hardcoded | It is 16 + nlayer×24; the reference has one layer and a 40-byte header, so triangles were read 48 bytes off — a tidy 2×2×2 box of garbage. |
| Normal scale wrong by 4× | surface_nets writes gradient normals at 4096, not Q14 16384. Lighting collapsed and the surface went dark and mottled. |
| Depth sign inverted | The “front” view rendered the back of the skull, and looked plausible enough to nearly accept. |
| Distance-field precision | |q/r²| truncated to zero for small offsets on a large axis, quantising the field into concentric rings. |
| Grid clipping and asymmetry | Truncating cell division covered only 144 mm of a 260 mm span; ceiling division then put the surplus entirely on one side and clipped the mandible. |
What is built
All of it on the NAS through the sovereign API — mint, ship, /api/build,
/api/promote with .prev banked. No local toolchain, no /tmp.
The dual-copy guard refused one build outright, catching a divergent source that a shell build would
have silently mis-resolved.
nx_skullsdf— generates the skull, prints its own bounding box against the reference every run, and scores itself in millimetres via thefitverbnx_meshview— the mesh viewer that did not exist this morning; three views, one shared scale, any layer, any mesh
The rule the day produced, twice over: a rising gate count is not permission to ship, and a representation that cannot express the target will not get there by tuning. Render it, measure it, and check the build actually ran.