Commit Graph

7 Commits

Author SHA1 Message Date
Pooya Parsa
3538073b0f Add guest Vulkan on the page's WebGPU (kwvk): a Vulkan 1.2 ICD in the base (vk/icd, libvulkan_kw.so under the stock loader) sends commands over vsock port 1018 to a renderer in the SDK (createKernel({ vk }), js/core/vk*.ts) that implements them on a GPUDevice, with SPIR-V translated to WGSL by naga as wasm (vk/naga); Wayland, X11 and headless presentation by readback; the page's Guest Vulkan option, Environment row and vkcube, vkmark and GTK tiles; checks in test/vk 2026-11-24 07:23:03 +00:00
Pooya Parsa
2ce4c972ef guest: build the Alpine image from stock packages, without the kwemu rebuild 2026-11-19 17:07:49 +00:00
Pooya Parsa
97f8d9e5f1 guest: distroless base initramfs and separate Alpine and Debian erofs images
The bundle (unkernel.wasm) carries a small busybox initramfs that mounts a
distro image labelled kwroot under an overlay root, or starts the base shell
without one. guest/ replaces kernel/guest/: base/, distro/NAME/, shared lib/
and tools/. Images are laid out for their boot by a patched mkfs.erofs and a
recorded boot file list, with a prefetch hint in the image header. Debian
bakes its apt lists and cache, a set of everyday packages and a
command-not-found installer.
2026-11-19 14:46:13 +00:00
Pooya Parsa
20f9de7add kernel: build abitest into the test archive, and complete the build path's checks
alpine.sh builds kernel/guest/abitest.c (freestanding) beside kwtest and
kwbench, and the release workflow runs it on the UP kernel and on 2 CPUs.
Its SA_RESTART check waits for the parent's alarm with a sleep instead of
a busy loop, which the JIT finished before the alarm.

setup.sh checks xz and sha512sum (the package rebuild's toolchain and
source sums) and reports qemu-aarch64 (optional, zig build test's
comparison). build.sh's disk check also covers alpine-opt.sh, kw-path.sh
and the bwrap shim, which alpine-disk.sh now installs like the initramfs.
2026-11-19 00:12:48 +00:00
Pooya Parsa
0e1cd96b77 Build the SMP kernel and the bundle's SMP patch with kernel/build.sh
kernel/build.sh smp builds the SMP kernel (kw_defconfig + kw_smp.config,
kwemu with atomics) from the same tree into vendor/build/kernel-smp; all
builds both kernels, and every bundle refresh adds the UP-to-SMP patch
when the SMP kernel is the same build of the tree (KW_SMP=1 requires it,
KW_SMP=0 leaves it out). kernel stays the UP-only quick loop. The patch is
cached in kernel-smp/up.kwpatch. Fixed build stamps (user, host, a build
id hashed from the tree and kwemu sources, the tree's newest commit date)
make kernels and patch reproducible while every other build keeps its own
banner for snapshot matching. Configs are checked against their fragments
after a reconfigure. KW_BUILD, KOUT_SMP, KWEMU_SMP and LINUX_REPO make the
script runnable against another tree and output root.

bundle.mjs --smp refuses two kernels that are not the UP and SMP builds
of one tree (banner, KW_ABI_VERSION, wasm_cpu_start, memory type), with
--smp-optional to warn instead and --smp-patch to reuse a cached patch.
The release workflow builds both kernels, runs kwtest on 2 CPUs and the
kernel patch tests (unexercised).
2026-11-17 13:23:55 +00:00
Pooya Parsa
447d26f29d guest: rebuild busybox, zlib, openssl and apk-tools for kwemu
kernel/guest/alpine-opt.sh builds them from Alpine's own source,
patches and configuration (the aports commits the image's packages came
from), with gcc 16 at -O2 for rv64gc + Zba/Zbb/Zbs/Zicond, linked with
lld, against a sysroot of Alpine's packages (the image's musl). alpine.sh
and alpine-disk.sh swap the six files into the images.

Measured in the guest: shell scripts about 20% faster, exec 24%, apk
with both indexes 11%, sha1/sha512/chacha20 22-30%
(.agents/guest-packages.md).

The release workflow installs the host tools and caches the build output
under its own key; no existing cache key, path or hashed file changes.
setup.sh checks the new tools.
2026-11-16 11:50:47 +00:00
Pooya Parsa
26d08730cc Initial commit 2026-11-15 23:27:04 +00:00