Skip to content

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.

5.4 KB
Raw Blame

eBPF-Jev KVM testbed

From the project root (05-ebpf-jev/), run testbed/run_vm.sh verify. QEMU uses KVM, two virtual CPUs, 3 GiB of memory, a disposable disk snapshot and a serial console. Guest networking is limited to loopback. A writable 9p share exposes this project to the trusted guest at /work. Run one testbed instance at a time because builds and test outputs use this share.

The project sources compile inside the Debian trixie guest. The kernel BTF header comes from the booted guest. Make builds the BPF object, libbpf skeleton, warden, and C parity checker. Full verification uses the trained packs and parity vectors under ml/out. Run bash testbed/build.sh to build the disposable root image with Docker, signed Debian packages and initramfs-tools. Building requires sudo for preserving ownership during export and ext4 image creation.

Interactive split-screen demo

From the project root, run testbed/start_demo_vm.sh. The left tmux pane is the monitored guest shell. The right pane is a second guest serial terminal running the curses HUD. A private tmux socket in runs/ links the two consoles. QEMU has no network device. Both UDP endpoints bind guest loopback. Each approved packet is counted at the receiver and echoed.

Use the four commands printed in the shell. Ctrl-b z zooms a pane, Ctrl-b o switches panes and Ctrl-b d detaches. In the HUD, use Up/Down or Page Up/Page Down to scroll and End to resume following. Run testbed/connect_demo.sh to reattach and testbed/stop_demo_vm.sh to request guest teardown. Start also accepts --detached. Host dependencies are QEMU/KVM, tmux, flock, Python 3 and the built guest image. No SSH port or guest network setup is needed.

The feed shows registered file opens, inherited protected state across fork and exec, and connections to the two test listeners. The JSON stream also records ordinary forks and execs. Each scored event includes the exact 32 signed input features. Warden registers config files with class 40 and protected files with class 85 by device and inode. Unregistered opens leave task memory intact. The task_alloc hook copies task storage and measures its duration. An optional sched_process_fork tracepoint publishes those measurements once the child's PID has been assigned. The memory panel contains the 32 bytes observed in the selected task. Score bars retain the most recent test connection. The generations displayed come from successful map installations. Script 4 republishes the original coefficients with generation 2.

Run python3 testbed/verify_demo.py with the demo stopped to drive a fresh guest through all four scripts and capture the actual 120-column HUD. The per-run directory contains events.jsonl, counters.json, verifier.txt, parity.txt, warden.log, hud.txt and verification.json. The latest snapshot is runs/tui_demo_snapshot.txt. Verification returns nonzero for any failed acceptance check.

The original training startup sequences always executed a new binary after the protected read and omitted the nonstandard-port bucket. The guest performs the read and connection in the same interpreter. The aligned pack trains on both same-process and child workflows across all four port buckets, with matched approved and unapproved endpoints. Thresholds and the protected-to-unapproved enforcement floor retain their original settings. The offline model-only and floor-inclusive rates are reported separately in ml/out/eval_report.md.

For this alignment, the CPU environment is envs/train-cpu (Python 3.12, CPU PyTorch 2.15.0 and NumPy 2.5.5). From the project root, regenerate examples with envs/train-cpu/bin/python ml/generate_dataset.py. To reproduce the deployed pack, run CUDA_VISIBLE_DEVICES="" envs/train-cpu/bin/python ml/train_and_eval.py --align-from runs/20261128T112121Z-4a836337/baseline/ml/out --output runs/reproduced-model. The measured before/after vectors and the file-filter ablation are in runs/20261128T112121Z-4a836337/diagnosis.json.

Warden registers the protected inode and classifies 127.0.0.1:19998 as approved by default. The learned score threshold still applies. Pass --cgroup PATH and --allow-port PORT to change the monitored cgroup and approved loopback port. The HUD columns show PID, command, event type, four unsigned byte scores, elapsed hook time and action. The four scores are exfiltration, evasion chain, benign workflow and uncertainty in that order. During operation, src/warden --reload-weights /path/to/pack.bin installs a new generation. Active-slot publication uses an atomic store after copying the inactive pack. A shared reader counter protects an overlapping inference from slot reuse. The control socket is in the guest's root-only /run/jev directory.

Benchmark results cover 10,000 repeated UDP connect calls to an approved loopback address per comparator. The uninstrumented mode-zero and unattached runs measure syscall baselines. All five instrumented measurements include event accounting and use the same workload. Hook time ends just before ring-buffer submission. Userspace syscall timing includes return to the caller. Percentile deltas are differences between run percentiles. The separate enforcement test uses TCP listeners and packet capture. Event rows in enforcement_smoke.json contain PID, PPID, command, event type, four scores, action, hook nanoseconds, generation and inherited taint. Actions 0, 1 and 2 encode ALLOW, DENY and ABSTAIN_DENY respectively.