Skip to content

1bit OS: the engine as a bootable USB image (os/mini) - #56

Merged
bong-water-water-bong merged 4 commits into
mainfrom
1bit-os
Sep 25, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
1bit-os

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The 1bit engine as its own OS: boot a Strix Halo machine from a USB stick, run from RAM, never touch the internal disk. The few-minutes version: no distro, no package builds, assembled from the built engine.

  • os/mini/mkimage.sh <out> <engine build> (no root): the running kernel; only the modules the stack loads (GPU, NPU, RTL8125, MT7925, USB storage; 58 files); only the firmware those chips load (GC 11.5.1, SDMA 6.1.1, PSP/SMU 14.0.1, VPE 6.1.1, DCN 3.5.1, the NPU's 17f0_11, network: 32 files, 3.6 MB); BusyBox; Mesa RADV; XRT + the XDNA plugin; 1bit and its Vulkan llama-server, each with exactly the libraries it links. Output: 1bit-os.efi (kernel + command line + initramfs, ~100 MB) and 1bit-os.img (EFI partition + 1BIT-DATA for models). About 30 s.
  • os/mini/init: mounts, loads the drivers, DHCP on Ethernet, mounts 1BIT-DATA from the stick, a shell; the GPU gets the same 120 GiB memory limits as the development machine. 1bit.check on the command line checks the userspace, prints PASS/FAIL and powers off.
  • os/build/: an Alpine build environment kept for later (musl); the current image uses glibc, as the stack is built today.

Tested: boots in QEMU (KVM) with 1bit.check → 1BIT-OS CHECK PASS (engine, llama-server, XRT plugin, NPU firmware, modules). Not yet booted on the Strix Halo hardware, hence draft.

Next (in os/README.md): HRX, Lemonade and SSH in the image, Mesa without LLVM (−130 MB), everything pinned and bumped.

🤖 Generated with Claude Code

mkimage.sh assembles one EFI file (kernel + initramfs, ~100 MB) and a USB image with a data
partition for models, from the built engine: only the modules, firmware (32 files, 3.6 MB)
and shared libraries the stack uses; BusyBox init; runs from RAM, never mounts the internal
disk. Boots in QEMU with 1bit.check: engine, llama-server, XRT plugin, NPU firmware PASS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@context7

context7 Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit c48930a

… two boot fixes

- Dropbear SSH, key logins only (keys and host key on the stick's 1BIT-DATA/ssh).
- 1bit serve at boot when /data/1bit.conf names a model (1bit.conf.example on the stick).
- os/mini/vmtest.sh: boots 1bit-os.img through OVMF from a USB xHCI stick in QEMU/KVM,
  then SSH and a chat request to 1bit serve (lavapipe in test images only).
- Fixes the VM test found: PATH lacked /usr/bin and /usr/sbin (SSH never started), and
  sd_mod was missing (a USB stick never became a disk, so 1BIT-DATA was never mounted).
- virtio drivers, so 1bit OS runs in VMs; the data partition wait polls up to 20 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong
bong-water-water-bong marked this pull request as ready for review September 25, 2026 02:40
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) September 25, 2026 02:40
@bong-water-water-bong
bong-water-water-bong merged commit 1071418 into main Sep 25, 2026
2 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit-os branch September 25, 2026 02:42
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VM test passes (os/mini/vmtest.sh on Strix Halo): OVMF UEFI boots 1bit-os.img from a USB xHCI stick in QEMU/KVM; SSH (key login) up after ~9 s; 1BIT-DATA mounted with the model; 1bit serve started at boot from 1bit.conf answered a chat request ("Paris.") on Vulkan (lavapipe in the VM). The test found and fixed five real boot bugs: PATH without /usr/bin and /usr/sbin (SSH never started), sd_mod missing (the stick never became a disk), files owned by the builder's uid and group-writable dirs (Dropbear refused keys), and virtio drivers for VMs. Still to do: a boot on the Strix Halo hardware itself.

bong-water-water-bong added a commit that referenced this pull request Sep 25, 2026
#56 merged before these landed on its branch:
- sd_mod: a USB stick never became a disk, so 1BIT-DATA (models, SSH keys, 1bit.conf) was
  never mounted.
- The initramfs is packed with every file owned by root and nothing group/world-writable,
  /root 700: Dropbear refused key logins before.
- vmtest.sh: lavapipe listed for llama.cpp, a 4096-token context and 16 GB in the VM, and the
  chat request retried (1bit serve answers /v1/models before its backend is ready).
VMTEST PASS: UEFI boot from the USB image, SSH in ~9 s, 1bit serve answered.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Oct 1, 2026
* Flash-Next MTP: draft from part of the vocabulary (tools/mtp_draft_vocab.py)

Qwen3.8-Flash-Next's MTP head computes logits over all 248,320 tokens per drafted token, which
is the model's 644 MiB Q8_0 output matrix read three times per decode step. The draft only
proposes and the model checks every token, so the head can be cut to the tokens it is likely to
propose.

- tools/mtp_draft_vocab.py writes such a head from Unsloth's shared MTP head and the target's
  output rows: blk.<L>.nextn.shared_head_head (K rows) + d2t (I64) + onebit.draft_vocab.
- config/draft-vocab/qwen38-en-code-65536.txt is dime-online's 65,536-id English + code list
  (qwen3.8-Flash-DGX-UltraFast, Apache-2.0), credited in NOTICE with its own notice text;
  exempt from our header in tools/copyright.py, since it is their work.
- third_party/llama.cpp-vulkan cecf3ee -> fd16437 (fork #56): the qwen4exp MTP graph runs the
  K-row head and scatters its logits back to the full vocabulary.
- tests/mtp_draft_vocab_test.py (CI): rows, d2t and every other tensor and key checked on a
  made-up target and head; bad inputs refused.
- docs/serve.md: usage and numbers; docs/vulkan.md: the carried commit.

Strix Halo, Vulkan, UD-Q4_K_XL, greedy, draft length 3, rounds 2-3 of 3: code 47.8 -> 52.1
tok/s, prose 38.6 -> 42.2, 768-token code 45.8 -> 48.3, the same acceptance; French 46.4 ->
39.6 (its tokens are outside the list).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* registry: record llama.cpp-vulkan at fd16437

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Oct 1, 2026
…bad d2t ids (llama.cpp #57) (#272)

#269 pinned llama.cpp #56 (Flash-Next MTP drafting from part of the
vocabulary) before its d2t ids were validated: set_rows scatters the draft
logits to those ids, so an id outside the vocabulary or a repeated one could
write outside the logits row. #57 reads the ids at load and refuses the file.
Registry: pin line only (--check-pins ok).

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant