Qwen3-0.6B inference (12 KB), bare-metal bootable OS (22 KB), and from-scratch Mini-GPT trainer with live Braille TUI (32 KB) in 100% pure x86-64 NASM assembly. Zero C, zero libc, zero dependencies.
"""Generate deterministic fixtures and run compiled Track A forward/embedding callbacks."""
import json
import subprocess
import tempfile
from pathlib import Path
import numpy as np
from fixed_point import embed,forward,load
def check(folder):
rng=np.random.default_rng(748)
w=load(folder/"ebpf_jev_model.bin")
rows=[]
for i in range(500):
# Each block of five has an independent initial state and four dependent steps.
phase=i%5
h=(np.zeros(32,np.int8) if i%10==0 else rng.integers(-128,128,32,dtype=np.int8)) if phase==0 else nxt
s=rng.integers(-128,128,16,dtype=np.int8)
name=("", "x", "abc", "Z"*64,"dummy_secret.env","/fixture/bin/python", "q"*83)[i%7]
if i==0:
s[:]=0
if i%11==1:
s[:]=127
elif i%11==2:
s[:]=-128
x=np.r_[s,embed(w,name)]
nxt,logit,score=forward(w,x,h)
rows.append(dict(sequence=i//5,step=phase,name=name,x=x.tolist(),h=h.tolist(),
h_next=nxt.tolist(),logit=logit.tolist(),scores=score.tolist()))
(folder/"parity_vectors.json").write_text(json.dumps(rows,separators=(",",":")))
def c(a):
return "{"+",".join(map(str,a))+"}"
(folder/"parity_vectors.h").write_text(
'#pragma once\n#include <stdint.h>\n#define JEV_PARITY_COUNT 500\n'
'struct jev_vector {char name[65]; int8_t x[32],h[32],h_next[32],logit[4]; uint8_t scores[4];};\n'
'static const struct jev_vector jev_vectors[JEV_PARITY_COUNT]={\n'+
",\n".join("{"+json.dumps(r["name"][:64])+","+",".join(c(r[k]) for k in
("x","h","h_next","logit","scores"))+"}" for r in rows)+"\n};\n")
with tempfile.TemporaryDirectory(dir=folder) as tmp:
exe=Path(tmp)/"parity"
subprocess.run(["cc","-std=gnu11","-O2","-I",str(folder),str(Path(__file__).with_name("verify.c")),
"-o",str(exe)],check=True)
subprocess.run([str(exe),str(folder/"ebpf_jev_model.bin")],check=True)
return {"matched":500,"sequences":100,"steps_each":5,
"saturated_hidden":sum(127 in r["h_next"] for r in rows),
"saturated_logit":sum(any(l in (-128,127) for l in r["logit"]) for r in rows)}