Results of the early spikes from the implementation plan’s “First steps”. Each spike is a
binary under spikes/ that prints a Markdown report, so the same command can be rerun on
the Mac, in QEMU and on the Pi and the tables compared. All three binaries ship in the
device images, and make pi-report HOST=... runs B, C and D on a board in one go.
| Spike | Question | Status |
|---|---|---|
| A | wgpu to KMS in QEMU (lavapipe dumb-buffer copy, virgl GLES) | Done (lavapipe copy path), in a stock VM and in the idealos image; virgl not available in Homebrew QEMU |
| B | wgpu to KMS on the Pi 4 (V3DV with dmabuf import) | Blocked: needs a Pi (the image is built) |
| C | Loro plus SQLite: writes, JSON copy, FTS5, at 10,000 docs | Mac done; Pi pending |
| D | Memory and startup of 8 rquickjs app processes | Mac done; Pi pending |
| E | Servo on aarch64, rendering offscreen | Not started: hours of build time (disk is no longer the blocker) |
| F | Gmail OAuth sign-in and one mailbox sync | Not started: needs a Google Cloud OAuth client |
Unless a section says otherwise, numbers are from an Apple M3 on macOS, release build. Expect the Pi 4 (Cortex-A72 at 1.8 GHz, SD card or USB SSD) to be roughly 5–10× slower on CPU-bound rows and much slower on fsync-bound ones. The Pi numbers are the ones that decide things; these only show the design is sound and the benchmark works.
tools/spike-kms [--buffers 2|3] [--frames N] [--windows N] (or make spike-kms).
Setup. The spike runs in a small Lima VM (idealos-spike.yaml), not in a Buildroot image:
virtio-gpu-pci display;The guest sees the same virtio_gpu DRM device the idealos QEMU image will see. That
answers the spike without the Buildroot build (see “Disk space” below).
What kms-probe does:
/dev/dri/card0, finds the connected connector, its preferred mode and a CRTC.Bgra8UnormSrgb offscreen texture, then reads it back.XRGB8888 dumb buffer (the same bytes on little-endian).screendump
(qmp-screendump.ts). That proves the pixels reached
the display, not just a buffer.
Display: virtio_gpu, Virtual-1 at 1280×800, 75 Hz (13.3 ms per vblank). 600 frames per run.
| Stage | 2 buffers p50 / p99 | 3 buffers p50 / p99 |
|---|---|---|
| Render + GPU readback (lavapipe) | 9.9 / 16.0 ms | 9.9 / 12.3 ms |
| Copy into dumb buffer | 0.96 / 1.27 ms | 0.96 / 1.20 ms |
| Wait for page flip | 2.4 / 17.2 ms | 2.4 / 3.7 ms |
| Whole frame | 13.5 / 30.3 ms | 13.4 / 14.5 ms |
| Frame rate | 66.5 fps | 74.6 fps (vsync-locked) |
Setting up the wgpu device on lavapipe takes 20–40 ms.
Offscreen target used here is the
same code that renders screenshots.virtio-gpu-pci but no
virtio-gpu-gl device, because it isn’t built with virglrenderer. GPU acceleration
in the QEMU target would need UTM’s QEMU build or a custom one. lavapipe is fast
enough for development, so this can wait.tools/spike-kms
rsyncs the repo into the guest instead, as the build VM scripts already do.kms-probe ships in every image. These numbers come from running it on the
Buildroot 2026.08.2 image (kernel 6.12.58, Mesa 26.1.8, LLVM 22.1.8, lavapipe),
three buffers, before the compositor’s KMS backend took over the display (its
display code is now shared with the probe, and make smoke-qemu checks the
compositor instead):
| Stage | p50 | p99 |
|---|---|---|
| Render + GPU readback | 10.9 ms | 14.0 ms |
| Copy into dumb buffer | 1.0 ms | 1.7 ms |
| Wait for page flip | 0.0 ms | 0.0 ms |
| Whole frame | 12.0 ms | 15.2 ms |

Rendering costs about the same as in the Ubuntu VM. The flip wait is zero because QEMU
with -display none completes page flips immediately instead of on vblank, so the
~80 fps here is the render-bound rate, not a refresh rate. Use the Ubuntu VM (which has a
VNC display) or real hardware to measure vsync pacing.
Getting the image to build and boot took these fixes, none of which a static review of the defconfigs would have caught:
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12). Without it,
Buildroot assumed 2.6 headers, so glibc was ruled out, the toolchain fell back to
uClibc, and Rust and the idealos package were dropped. lavapipe also needs
BR2_PACKAGE_MESA3D_LLVM, and eudev needs BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV.
make check-defconfigs now fails on any dropped or renamed option.SWRAST driver became SOFTPIPE/LLVMPIPE;
the old name stops the build. The image uses llvmpipe.certs/extract-cert, which needs host
OpenSSL (BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL).--offline. idealos-userspace.mk runs cargo vendor
in a pre-build hook.findfs, so /data never mounted; the Vulkan
loader (libvulkan.so.1) was missing, so wgpu could never have found lavapipe (this
affects the Pi image too); and the custom inittab didn’t set the hostname.The first full build took about 2.5 hours in the build VM (6 vCPUs, 10 GiB), most of it LLVM, which is built twice (for the host and the target). The build output is about 31 GB in the VM, plus 2 GB of downloads. A 16 GiB VM on a 24 GiB Mac pushed macOS into swap, which comes out of free disk, so the VM is now 10 GiB.
make spike-db (or db-bench --docs N --updates N --body-bytes N --db PATH --keep).
What it does: it follows M3’s write path (store.rs).
Each email is a Loro document. One SQLite transaction (WAL mode, synchronous=NORMAL) writes:
doc_state);doc_json);An edit loads the doc, changes it, appends only the incremental Loro update to changes,
and rewrites the JSON and FTS rows. Compaction folds the update log back into a snapshot.
At the end, every JSON copy is checked against its rebuilt Loro doc.
The corpus is 10,000 synthetic emails with ~2 KB bodies and a fixed seed.
| Operation | p50 | p99 | Throughput |
|---|---|---|---|
| Insert (Loro doc + snapshot + JSON + FTS, 1 txn each) | 0.117 ms | 2.5 ms | 5,200/s |
| Update (load, edit, log update, rewrite JSON + FTS) | 0.120 ms | 4.3 ms | 5,150/s |
| Load doc from snapshot + updates | 0.019 ms | 0.046 ms | 47,000/s |
| Compact one doc | 0.071 ms | 0.087 ms | 13,900/s |
| Query (10,000 docs) | Rows | Median |
|---|---|---|
| Inbox: unread, label INBOX, newest 50, no index | 50 | 18.8 ms |
Same, with a (type, json_extract(date)) expression index |
50 | 0.21 ms |
| From one sender with one label (full scan) | 120 | 16.6 ms |
| FTS5: one rare word | 50 | 0.12 ms |
| FTS5: two common words, top 50 by bm25 rank | 50 | 7.0 ms |
Other results:
json_extract scan of 10,000 docs takes
about 18 ms here, and probably 100–200 ms on the Pi. That’s too slow to re-run on
every commit. With an expression index, the same query takes 0.2 ms.
osctl db query --explain.dbd should run checkpoints off the request path.json_each has a hidden column named json. Inside a
json_each(json, ...) subquery, a bare json silently binds to that column, so every
filter matched nothing. The query compiler must always qualify columns (doc_json.json).
A regression test now checks the SQL queries against an in-memory filter.make spike-js (or js-bench --processes N --rows N --bundle-kb N --updates N).
What it does:
signal and effect;set op, batched into one commit frame per flush;protocol crate. That proves
the JS side and the compositor’s types agree.| Process | Ready in | RSS | QuickJS heap |
|---|---|---|---|
| Empty runtime (baseline) | 5.7 ms | 2.4 MiB | 93 KiB |
| App, 500 live labels, 100 KB bundle (each of 8) | 8–17 ms | 7.4 MiB | 1,287 KiB |
Other results:
set op, and 100,000
updates came to 6 MB of commit JSON.set op. A list that changes 1,000 rows sends about
60 KB. That’s fine over a Unix socket. If profiling ever points at it, a binary
encoding for scene ops can come later.VmRSS. Proportional set size (Pss in
/proc/PID/smaps_rollup) would give a truer per-app number when 8 apps share the
same app-host binary.tools/deploy-to-pi) and rerun them.app-host in M4.