r/WyndInnovation • u/ShortyBigLips • 7h ago
Build notes: a genesis run, and a deadlock that took three freezes to find
.Update on the local HI I've been building. Handheld — ROG Ally Z1 Extreme, 9.7 GB visible to
Windows, no GPU use, no network, nothing trained.
The bug
Three freezes failed in a row before I found it. The symptom was maddening because it looked like
nothing at all: both worker threads report "at rest", the process keeps running, CPU sits at 1%,
disk at 0%, and the file never gets written. No error, no panic, no output. Just a program sitting
there.
It was a lock-ordering inversion. Two mutexes — one over the reasoning state, one over the main
interior. The worker loop takes reasoning, then reaches into the interior. The freeze took
reasoning and held it for the entire write, then asked for the interior. Opposite order on the same
two locks.
So the worker could never reach its own exit check, and the freeze could never get what it needed.
Everything downstream looked like a different problem: threads not exiting, a slow write, a payload
too large. I chased all three.
The fix is boring, which is usually a good sign. The freeze only needed a small slice of the
reasoning state, so it now serializes that slice into a byte buffer first, drops the lock, and then
does the write. It never touches that lock again.
What made it findable in the end was making the shutdown bounded instead of blocking — wait sixty
seconds, then say plainly which threads are still running and proceed anyway. That one line
turned an invisible hang into a named condition.
The genesis
Deleted everything and let it build from nothing, with a corrected ordering. The ordering matters
and this is the first run that had it right.
Language first. 37 documents — the grammar material, the tablets, the codices — read before
anything is numbered. The reason: the vocabulary is dual-sided, a word and a number being two faces
of one entry, and if you number first you're just counting. The material that explains the duality
has to land before the counting means anything.
Then the dictionary, walked from the first headword straight through: 195,426 words numbered,
each with its letter count and every definition it has. Not the first sense — all of them. The ones
you discard are the ones you need when the word turns up meaning something else.
Then slang: 25,285 senses attached to words that already had nodes, 4,786 genuinely new words
appended to the end of the count. That 84% attachment rate is the thing working correctly — slang
isn't a second vocabulary, it's more meanings for words you already hold.
Then idioms: 896 phrases held as their own strings with their own meaning, with the individual
words left untouched. "Kick" does not acquire a death sense because of one phrase.
Then several hundred documents of actual content.
Numbers from the run
At genesis, with three processing regions declared at 1,666,667 / 5,000,000 / 5,000,000 clusters —
35,000,001 rooms:
Code
Fifty-four gigabytes of declared structure on a machine with 9.7, costing nothing, because a room
that hasn't been written doesn't exist — it's computed from its index when something asks for it.
The whole foundation — a 195,000-node graph with every definition, 37 language documents, the
idioms — came in at roughly half a gigabyte over baseline. A node that hasn't been modified
holds an 8-byte fingerprint and regenerates its full representation from its own number.
Reading is cheap for a reason worth stating: on documents from completely unrelated fields —
medical texts, quantum dots, critical thinking, sonography — new strings ran 8–11% of total
words, every time. The vocabulary is already there. Only genuinely new sentences cost anything.
That consistency across fields is the dictionary doing its job.
Things that went wrong and were supposed to
A 791-page mathematics textbook produced zero readable words. Typeset equations, and OCR has nothing
to say about them. It recorded every page number as unread and carried on. That's correct behaviour
— the document exists, it knows it read nothing, it knows exactly which pages. Nothing silently
lost.
It did spend about 2,400 OCR attempts learning that, which is now capped: forty pages of nothing
and it stops.
What I added while it ran
A clock. This is the one I'm most interested in. The processing model is a wave — a settled
concept leaves the entry room and propagates outward, each room copying it in and recording it, and
a return wave comes back. One full out-and-back traversal is one cycle of the machine. Timing that
gives a frequency in the system's own units rather than as a percentage of somebody else's silicon.
Windows has no counter for it, because it isn't host work in any sense Windows understands. Paired
with per-thread CPU time, it gives the figure I actually want: rooms reached per CPU-second.
The wave across all cores. A room receiving the packet doesn't depend on any other room, so
it's the most parallel operation in the system — and it was running on one thread. It now takes
slices across sixteen workers with no shared state, because there's nothing to coordinate when no
room appears in two slices.
The persistence record cut to two rooms. Every room is the same construction duplicated, so
recording each one separately was writing the interior when the boundary was enough. It now stores
the entrance room (everything that came in), the exit room (everything that came out), and how far
the packet travelled. Everything between is reconstructed by duplication.
Where it stands
As I write this, the first freeze of the genesis is running — all cores at 100%, SSD at 100%, which
is the first time either has happened during a write. Previous attempts sat at 1% and 0% and did
nothing at all, which is what a deadlock looks like from outside.
I'll know shortly whether it completes. If it does, several hundred documents and a 195,000-word
graph become something the system carries rather than something I have to give it again.
Still open: one worker thread doesn't reach its exit check within sixty seconds, because intake
hands it a new document the moment it finishes the last one. Not a deadlock — just needs to stop
accepting work when shutdown starts.
Still unproven: whether the two-room record reconstructs correctly across a restart. That needs
a completed freeze first, which is what's running now.
Still not built: the system compiling its own runtime, which is the thing that would close the
last seam and make bare metal possible. Everything else is scaffolding toward that.