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.

DimensionGeneratedReferenceDelta
width152 mm150 mm+2
height204 mm207 mm−3
depth210 mm215 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 views of a real scanned human skull
BodyParts3D, 171,248 scanned triangles — “BodyParts3D, © The Database Center for Life Science licensed under CC Attribution 4.0 International”. Cranial sutures, a zygomatic arch with real air beneath it, genuine temporal depth. Used strictly as a ruler; no part of it is shipped.

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.

Skull as separate lofted tubes, parts detached
Vault corrected to the braincase so the face hangs off its front. The bones emerge — as separate objects: nasal bones floating clear, the arch a rod through nothing, the mandible a detached cylinder.

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

Current generated skull, three views
Current state, 106,612 triangles. Authoring every dimension in real millimetres against the reference brought all three axes within 5 mm. The shape did not follow — the mandible reads as a detached loop and the cranium and face as separate masses.

Bugs, all of which produced plausible output rather than errors

DefectHow it presented
Builds silently staleThe 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 ELFReported success and produced only the .s assembly. Fixed by building on the NAS over the sovereign API instead.
No mesh viewer existedThe 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 hardcodedIt 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 invertedThe “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 asymmetryTruncating 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.

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.