Commit Graph

87 Commits

Author SHA1 Message Date
Pooya Parsa
d382f7fa9b js: add a pure-JS Tailscale network device (work in progress)
The guest joins a tailnet from Node or the page: ts2021 control over
WebSocket, DERP relays, WireGuard and the packet filter in JS, loaded as
a separate chunk only when the option is used. SDK net option, CLI
--tailscale* flags and a page panel. Relay only; exit nodes, IPv6 and
real peer traffic are not covered yet.
2026-11-28 22:06:18 +00:00
Pooya Parsa
bc6e5ba6a0 net: forward the guest's pings to an optional backend ping hook 2026-11-27 23:44:46 +00:00
Néstor
34761073e0 js: carry the guest's UDP through the direct and Wisp backends (#47) 2026-11-28 00:12:57 +01:00
Pooya Parsa
30aa355637 js: keep 9p fids consistent across removes and renames 2026-11-27 23:11:06 +00:00
Pablo
30d35d0a80 js: hard links on host file systems (Fs.link, 9p Tlink) (#46)
* js: hard links on host file systems: Fs gets an optional link(target, path), which the 9p server calls for Tlink of a regular file (it answered EPERM always); nodeFs makes them with fs.link, refusing a source that is not a regular file and undoing a link whose new name is not the file it lstat'ed (Darwin's link(2) follows a symlink, which would name a file outside the directory); MemoryFs still answers EPERM, as do a directory, a symlink and a read-only mount, and a fid restored without its file answers ESTALE; package managers that put a file in place with a link (uv's lock and cache, cargo, pnpm's store) work on a nodeFs mount and on tabc's volumes; tests in 9p.test.ts and api.test.ts (ln in the guest, one inode on the host)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* js: nodeFs runs a hard link alone, so the guest cannot rename, remove or symlink a source or a name into place during it (on Darwin, link(2) follows a symlink); link uses the bigint lstat; a restore leaves a file stale that was open under a removed name even when a hard link still names it (documented); the api hard-link test uses its own directory (below scratch it broke the vm.mount() test's listing) and no longer checks a directory link, which the guest's VFS refuses before 9p; the 9p test removes its directories and checks that a link and a rename do not overlap

* js: nodeFs's hard link checks that every directory on both its paths is a directory, not a symlink (ESTALE), and its lock is per host directory with waits and holds bounded to 10 s (EAGAIN), so a hung rename no longer stalls links and renames of every mount; tests for both, the Tlink test's title says EROFS, the api test unmounts in t.after; Fs.link says the target's type may have changed since the walk

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-27 23:25:41 +01:00
Pooya Parsa
d80c033106 net: drop the default Wisp server from the SDK
The SDK named the project's Wisp server (DEFAULT_WISP_SERVERS), and the
Node entry sent Origin: http://localhost to pass that server's allow
list (NODE_WISP_HEADERS). The server accepts only the page's origins,
so both are gone: wispBackend() takes the caller's server, and Node
sends handshake headers only when `headers` asks for them. The page
keeps wss://wisp.unkernel.dev:6680/ as its own default (web/src/net.ts).

The live Wisp test takes its server from UNKERNEL_TEST_WISP.
2026-11-27 22:24:02 +00:00
Pooya Parsa
287e41464f net: document Wisp's limits, add a lookup option, move to wisp.unkernel.dev
The README and the SDK docs now say what a guest sees over Wisp: no
half-close (a client that waits for the server to see end of file
hangs), placeholder addresses for every name, no connect
acknowledgement. wispBackend() takes a `lookup` resolver for real
addresses, and its fake address table now evicts the least recently
used name instead of wrapping. The default server is
wss://wisp.unkernel.dev:6680/.

The live Wisp test waited for its marker anywhere in the screen, so the
shell's echo of the command satisfied it; it now waits for the marker at
the start of a line.

Refs #44
2026-11-27 22:15:52 +00:00
Pooya Parsa
87fcbbf991 wasi: close preview 1 gaps: sockets, wasi-threads, guest clocks and CPU time, fd_allocate
Sockets: sock_accept, sock_recv, sock_send and sock_shutdown on sockets the program inherited, with socket file types, poll and non-blocking; KWWASI_TCPLISTEN=ADDR:PORT[,...] opens listening TCP sockets at descriptors 4, 5, ... (exit 126 when one is already open); a write to a socket whose peer went away is EPIPE, not SIGPIPE.

Threads: modules that import wasi.thread-spawn and a shared env.memory run on the shared path, each wasm thread with a worker, a channel and a kwwasi connection of its own (a kwwasi pthread sharing the process's descriptors), so a thread blocked on stdin holds up no other; proc_exit or a trap in any thread ends the program; the message path refuses such a module with exit 126.

Clocks: realtime and monotonic follow the guest's (kwwasi sends both readings at START, no request per call); the CPU clocks are the worker's CPU time on Node, the process clock covering every thread through worker.cpuUsage(); unknown clock ids are EINVAL and the resolution is the timer's measured step.

Files: fd_allocate; fd_fdstat_set_flags refuses a sync flag change with ENOTSUP; more Linux errnos mapped; KWWASI_CWD=cwd resolves every path without a leading "/" from the cwd, with no guessing.

A wasm64 module is refused with exit 126, and a sleep on the message path no longer ends a fraction of a millisecond early. The kwwasi protocol is version 3. test/wasi-binfmt.ts runs its guest commands as root and covers the above.
2026-11-27 12:53:50 +00:00
Pooya Parsa
cec0a49f5d vk: make a wgpu app's graphics pipelines for the negative viewport height it draws with: the ICD sends the app's engine name in the hello, and for wgpu-hal the host translates vertex stages without the y flip and builds that variant in vkCreateGraphicsPipelines (it was built in the first submit, after an unused flipped one); the other orientation is a variant at draw time, logged once per connection with the engine's name; the host check draws both ways after destroying the shader modules and runs its SPIR-V suite with the toolchain's glslc 2026-11-25 14:31:55 +00:00
Pooya Parsa
1f0648d812 va: guest VA-API on the browser's WebCodecs (kwva): a libva driver in the base's kw layer sends each picture over vsock to a VideoDecoder or VideoEncoder on the page (createKernel({ va }), on by default on Debian, ?va=0); it decodes VP9, H.264, AV1 and HEVC (HEVC not yet run in a browser), encodes VP9, reads pictures back as exact NV12, exports surfaces as dmabufs of virtio-gpu resources and draws a decoded VideoFrame into a BGRX surface on the GPU (mpv --hwdec=vaapi --vo=dmabuf-wayland: 1080p H.264 at 30 fps on an M4 Pro) 2026-11-25 13:09:05 +00:00
Pooya Parsa
75694e278f kernel: optimize the lowered kernel with Binaryen -O2 (about 4% smaller, Debian shell commands about 3.5% faster in Node) and build kwemu with bulk memory, sign-ext, nontrapping-fptoint and mutable globals, which the kernel's C objects already need 2026-11-24 22:09:38 +00:00
Pooya Parsa
7d74d40f94 vk: run llama.cpp's quantized models: the translator keeps barriers in uniform control flow past invocation-dependent continues, reads num_workgroups and workgroup_id without naga's private copy, runs workgroups wider than the device's limit as virtual invocations and lowers subgroup builtins of shaders without subgroup operations; a compute pipeline WebGPU refuses as read_write is made with its read-only buffers kept; the subgroup size is agreed in the hello (32, KWVK_SUBGROUP_SIZE: Qwen2.5 0.5B Q4_K_M 75 to 22 ms a token on an M4 Pro); timestamp queries resolve once at the read and never go backwards 2026-11-24 21:21:48 +00:00
Pooya Parsa
6e71333536 vk: pin glslc (shaderc v2026.4, built from source by vk/glslc.sh) and the SPIR-V headers for test/vk/guest/build-llama.sh, which cross-builds against the pinned Vulkan headers 2026-11-24 21:21:48 +00:00
Pooya Parsa
5a4ba76d79 js: export the page's Web Audio sink as createAudioOut() from unkernel/web (#17)
web/src/audio.ts becomes js/web/audio.ts. It creates no AudioContext
before the page has had a gesture, holds the latest 10 s of what plays
until then (a clip that has ended plays whole, a stream joins live), and
has state, onChange, muted, resume() and close() for a page's control.
test/audio.test.ts runs the worklet and the sink without a browser.

Closes #17
2026-11-24 20:41:32 +00:00
Pooya Parsa
c5ec8fdd97 gl: keep textures that WebGL refuses off used sampler units, so that such a draw lands (#27)
virglrenderer patch 0020: on a WebGL host a used sampler unit holds no texture rather than one attached to the draw framebuffer or of another base type than its sampler. unkernel-check.mjs --drm gains step t (test/gpu/feedback.c).
2026-11-24 18:56:21 +00:00
Pooya Parsa
0da40f0a35 gl: let a WebGL error drop one call instead of putting the guest's context in error (#27)
virglrenderer builds with -Dcheck-gl-errors=false and patch 0019: a host GL error is logged and counted (stats.glErrors) and the context goes on; GL_OUT_OF_MEMORY stays fatal.
2026-11-24 18:12:50 +00:00
João Lucas
6901f8a225 js: allocate an SMP kernel's memory once, shared, at a boot and a restore, so that memoryFallbackMiB applies to it (#10)
An SMP kernel imports a shared memory, which the JS API does not show.
boot() assumed an unshared one, allocated it, got a LinkError and
allocated again, shared. It now guesses the sharing from the atomics
feature in the module's target_features section, as moduleIsMemory64()
does for the memory type; the retry stays for a wrong guess (a module
with atomics on an unshared memory).

memoryFallbackMiB only applied to the unshared allocation: where the
shared one then failed, boot was rejected with the LinkError and no
fallback was tried. It now applies to the shared allocation.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-25 01:30:03 +09:00
Pooya Parsa
bc8ac778da js: send worker-mode sound through a shared PCM ring and reuse one MessageChannel for yields (#18, #19)
With shared memory, the worker's PCM goes to the owner through a
single-producer, single-consumer SharedArrayBuffer ring (sound-ring.ts)
instead of a message per chunk: the owner drains it into the sink's
onChunk on coalesced "sound-wake" messages, or hands it to the new
SoundSink.onRing for a reader of the sink's own (an AudioWorklet).
State changes are records in the ring as well as messages, numbered
alike, so a sink sees states and PCM in the kernel's order however late
the messages are. The delay the kernel reports is the sink's answer plus
the frames still in the ring, reset with each stream. A full ring drops
the newest PCM, which the owner logs. shared: false keeps the
"sound-chunk" and "sound-queued" messages.

yieldToEventLoop() without setImmediate (browsers) reuses one
MessageChannel, with one message, so one task, per waiting yield.

Idle waits of 1 to 4 ms also wait on a timed Atomics.waitAsync where a
SharedArrayBuffer exists: browsers raise a nested setTimeout below 4 ms
to 4 ms (about 5 ms between wakes in Chrome and Safari workers, against
2.5 ms, measured 2026-11-24).

Co-authored-by: Adam Meghji <566793+adammeghji@users.noreply.github.com>
2026-11-24 15:41:39 +00:00
Panda Wu
1a2b6ca095 guest: reset signals in kwtty login before it starts the shell (#7)
kwtty login execs the login shell with the signal dispositions it was
started with, unlike login(1). Debian's kw-init, a bash script, starts
it as a background command, which a non-interactive bash runs with
SIGINT and SIGQUIT ignored, so the shell and every program it ran
inherited that, and Ctrl-C could not stop programs such as sleep or
python3 -m http.server.

Reset every signal to its default and unblock them all, as kwtty serve
already does for its sessions, and check the console's SigIgn on every
image. The Alpine image was not affected, since busybox init resets
signals for the programs it starts.
2026-11-25 00:15:46 +09:00
Pooya Parsa
e615c1a0bf vk: flush only the mapped ranges a submit can touch and signal fences at submit when nothing is read back (Qwen2.5 0.5B decode overhead 1588 to 41 ms per token without GPU work), a 4 GiB device-only heap apart from the host-visible one (KWVK_HEAP_MB) and maxMemoryAllocationSize from WebGPU's limits, uniform and push-constant blocks WGSL cannot lay out repacked as vec4<u32> words so Firefox and Safari take ggml's rope shaders, division by a constant zero rewritten, validation with WebGPU's capabilities only, the adapter in the device name with the words Ollama reads as Metal, CUDA or ROCm spelled apart (KWVK_DEVICE_NAME); web: Ollama and fx (local model) ask which model (SmolLM2 with a tool template, Qwen2.5 1.5B, Llama 3.2 1B, Qwen3.5 0.8B added), TEMP and THINK options (fx at temperature 0, thinking off), a free-space check before a model download, the server restarted when GPU discovery times out 2026-11-24 14:09:09 +00:00
Pooya Parsa
17781fa30a vk: present Wayland windows without copying (wland 0.1.0-261124-3c987e5 external buffers: the ICD names each swapchain image to the compositor and the page resolves it from the WebGPU texture; readback stays the fallback and for X11), track descriptor writes that spill over bindings and read back only the ranges the GPU wrote (device-local and host-visible memory types only), take a read-only marking from a buffer's members in the translator; web: Vulkan in the resource monitor, no guest Vulkan where WebGPU has no adapter, llama.cpp and D3D12 (vkd3d) gears and triangle apps, the Agents folder renamed AI 2026-11-24 10:45:38 +00:00
Pooya Parsa
85fb2c4e1c vk: fail loudly instead of giving wrong results: pipeline creation waits for the host and returns a Vulkan error when the shader or pipeline is refused, a failed submit, write or unencodable command loses the device, the ICD prints each error on stderr, and capabilities the host cannot honour are refused or no longer advertised; check it in test/vk (vk-loud, host cases) 2026-11-24 08:38:43 +00:00
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
4e5855569f js: share snapshot memories of 2 GiB or more instead of transferring them, so a 2 GiB machine can suspend and resume in Chrome, which neither allocates nor posts a plain ArrayBuffer that large 2026-11-22 23:28:58 +00:00
Pooya Parsa
b347874391 web: rewrite the page as a desktop 2026-11-22 23:19:14 +00:00
Pooya Parsa
47a0202a64 guest, js: one program for the guest tools, and a Debian boot read from the image's front: kwbox (/usr/bin/kwbox, guest/src/kwbox.c) links kwtty, kw9p, kwvsock, kwshm, kwwasi, kwcmd and vtest-bridge into one static binary, called as kwbox tty|9p|vsock|shm|wasi|cmd|vtest (the per-tool paths are gone but binfmt's interpreter /usr/lib/kw/kwwasi; any other name it is called by is a host command, and kwbox is a reserved command name); /init sends an image or upper whose init still runs /usr/bin/kwtty to the base shell or safe mode; the traced boot that lays out an image is the page's (kwshm, kw.gl=1 kw.wayland=1), so wlandr is in Debian's boot set; HttpBase's background tier waits for the first read of the image before its quiet second (an image opened while its kernel loads fetched it during the boot) 2026-11-22 16:11:20 +00:00
Pooya Parsa
827dfa04d8 web: WebSockets in the guest preview: the service worker puts the shim /vm-ws.js into the HTML documents it relays, whose WebSocket reaches the guest (ws://localhost:<port>, /vm/<id>/<port>/, root-relative paths) through the page over a BroadcastChannel, where websocketOver() (js/core/ws.ts, RFC 6455 over vm.connect()) runs it, with credits, a socket cap and Web Locks for teardown; a preview document's root-relative requests are relayed to its port, so a Vite dev server's client and HMR work 2026-11-22 15:22:51 +00:00
Pooya Parsa
2abdc598e2 guest, kernel: boot faster and carry less in the base: /init looks for the data disk and the distro image on kwblk's disks only (wd*) and the kernel has no RAM disks (CONFIG_BLK_DEV_RAM off: probing brd's 16 took about 130 ms a boot); /init and rc read files with the shell instead of head; DHCP runs in the background (net background, net wait: the console's shell starts before the lease, kwtty serve and Debian's services with start links wait for it); the bundle stores the initrd uncompressed; wlandr moves from the base to the Debian image (wland says so where there is none); the checkout's CLI turns on Node's compile cache before it loads the SDK 2026-11-22 14:46:21 +00:00
Pooya Parsa
ef3486551a gl: a new renderer after a lost WebGL context, and no renderer for 2D clients: after a loss the guest's next new GL context (or vtest client) builds a fresh renderer, so GL programs started after it work without a page reload (those running at the loss fail every command until restarted; vm.gl.status lost, losses, renewals); a dumb-buffer KMS client's context commands are held and answered without loading the renderer, and reach it before the first command that needs GL; checks for display resize, multisampling, context loss and Chromium's GPU path 2026-11-22 12:17:33 +00:00
Pooya Parsa
9d9581a1f1 gl: multisampling on WebGL2 (virglrenderer patch 17): multisample resources become multisample renderbuffers on a host without multisample textures, so Mesa offers 4 samples, ANGLE in the guest's Chromium gets its ES 3.0 context and Chromium composites and runs WebGL on the GPU (it exited its GPU process and fell back to software); the chromium hook names Mesa's EGL packages where they are missing 2026-11-22 12:17:33 +00:00
Pooya Parsa
c04c59b67b js, web: a display size change reaches the guest's DRM mode: updateDisplaySize() on a running machine (inline and worker mode) raises virtio-gpu's display event when the fitted size differs from what the driver read, so the guest gets a hotplug with the new preferred mode (64 to 4095 a side, the EDID's pixel clock kept); the page calls it 300 ms after the stage's size last changed; X has no udev to hear the hotplug, so the X demo follows it with xrandr 2026-11-22 12:17:33 +00:00
Pooya Parsa
349572cfaa web: build the page against a local wland package (KW_WLAND_PKG, into web/.wland-local/output; page-check --output runs against it) without touching node_modules, and an opt-in Firefox case for the Wayland check (page-check --firefox, debian-disk --firefox): firefox-esr takes pointer and keyboard input once wland sends seat events to every pointer and keyboard a client created 2026-11-22 10:16:55 +00:00
Pooya Parsa
d4c9b459f7 js, web: default memory 2 GiB on desktops and Node and 512 MiB on phones, fallback sizes from 1024, 2 and 4 GiB on the page's slider, and a sparse copy of a snapshot on its way to a worker 2026-11-22 09:48:43 +00:00
Pooya Parsa
bcaa48d1d4 web: a Wayland desktop: unmodified Wayland apps in the guest show as windows in the page through wland (npm wland, its relay /usr/lib/kw/wlandr pinned in the base): the page listens on vsock port 1023 and loads wland on the relay's first connection, client buffers are read in place through kwshm, GL clients' dmabufs are shown by virtio-gpu resource without readback (--dmabuf virtgpu, vm.gl.gpu.image()), and the clipboard is bridged; the guest's wland CMD starts the relay and sets the Wayland session (XDG_SESSION_TYPE and the toolkit variables, /etc/profile.d/kw-wayland.sh; Debian's chromium through /etc/chromium.d), and with a relay that has --link-on-demand the page's kw.wayland=1 starts it at boot, so GUI apps need no prefix; launcher tiles foot and GL windows, test/wland/page-check.mjs 2026-11-22 09:39:13 +00:00
Pooya Parsa
57249c59e9 js: in worker mode, read guest shm in place and stop waiting for the kernel's yield: where the kernel's memory is shared with the owner thread (an SMP kernel on the shared transport) ShmFile.readSync() and views() work there as inline (Shm.inPlace; the worker waits for the owner's pin before the guest frees an export's pages), and on one CPU shm reads and the owner's vsock packets to the guest go through rings in the shared control block, served at the kernel's next clock read (about 0.6 ms instead of up to 20 ms) 2026-11-22 09:38:58 +00:00
Pooya Parsa
cdb3ddc467 gl: window images and WebGL2 fixes in the renderer: vm.gl.gpu.image() gives a resource as an ImageBitmap with alpha, without readback (kw_vgpu_blit; the context now has alpha and presentation writes it opaque), for a page compositor showing guest dmabufs by resource id; snapshots are refused only while a 3D resource exists or a context has submitted commands, and a restored device recreates an idle context; a failed 3D command records its reason (stats.lastError), a lost WebGL context fails every command at once, and the blit clears the GL errors it leaves; virglrenderer patches 14 to 16: border clamp maps to edge clamp, vertex inputs and colour outputs are typed on WebGL2 (Firefox's WebRender draws with integer attributes: its context went into error and its window stayed transparent), integer colour buffers are cleared with glClearBuffer 2026-11-22 09:38:49 +00:00
Pooya Parsa
c391ff6140 Merge branch 'main' into webgl 2026-11-21 22:58:24 +00:00
Pooya Parsa
84d70b9b83 gl: load the renderer on the guest's first GL use (the device advertises virgl's capsets from fixed sizes; gl.eager, ?glload=eager load before boot) and turn guest GL on by default for Debian in the page, with the virtio-gpu device (?gpu=0: the vtest link only); the kw layer ships /etc/X11/kw-kms.conf (modesetting with glamor on /dev/dri/card0) and sets the vtest variables only without the device; virtio-gpu waits up to 30 s, killably, for a capset; a suspend while a program uses the GPU is refused at once with a message 2026-11-21 22:57:45 +00:00
Pooya Parsa
4d20370925 Give the guest /dev/dri: kwvirtio, a virtio transport over host imports, with the stock virtio_gpu driver (createKernel({ gpu }), --gpu); the SDK's device model shows dumb-buffer scanouts on the host display and, with gl, runs virgl 3D on the page's renderer through virglrenderer's API (patch 13), presents a KMS scanout from the renderer's texture without readback and gives host code a resource's texture (vm.gl.gpu.texture); the kernel leaves out I2C, the HDMI infoframe library, the panel bridge and NET_DEVMEM (four generic switches) and backports the virtio-gpu damage-clip fix 2026-11-21 20:27:49 +00:00
Pooya Parsa
199211ae8f gl: answer Mesa's busy waits ahead of the GPU (at most one per client, never after a readback of the same resource), mark a query's result pending when the guest asks for it (virglrenderer patch 12), and count parks, readbacks, GL and upload time per frame (vm.gl.stats.renderer, the page's Guest GL row); ?glwait=strict or gl.strictWaits restores vtest's waits 2026-11-21 18:43:31 +00:00
Pooya Parsa
ea9ddc296f web: offer guest GL (?gl=1, Options, Debian only): the page serves the renderer, passes kw.gl=1 so that the guest's shells use virgl (profile.d/kw-gl.sh), and names the WebGL2 renderer in the Environment tab, warning of a software one; release.yml attaches virgl.mjs and virgl.wasm 2026-11-21 18:12:27 +00:00
Pooya Parsa
ff792f6121 gl: guest GL in unkernel behind createKernel({ gl }): the SDK loads the wasm renderer from dist (virgl.mjs, virgl.wasm), listens on vsock port 1019 and starts the vtest forwarder shipped in the base's kw layer; a prepared Debian disk and an end-to-end check in headless Chromium (eglinfo, frame checksums, glmark2 against llvmpipe) 2026-11-21 17:38:25 +00:00
Pooya Parsa
e26f9711fc gl: run virglrenderer on one WebGL2 context for guest GL, checked headless on the host: a patch series on virglrenderer 1.3.0 (single GL context mode, GLES 3.0 and WebGL2 fixes, emscripten build, shared-server fixes), the wasm module and its GL shim, a vtest bridge that terminates memfds (WebSocket for the test page, byte stream for the guest), and a check suite of unmodified Mesa clients against the native and the wasm renderer 2026-11-21 16:06:54 +00:00
Pooya Parsa
fa255306ec Fetch a distro image's warm set in the background and read ahead for sequential readers: the Debian image lays out what apt and dpkg read after the prompt (guest/distro/debian/warm-files, traced like boot-files, no fragments) right after the boot set, and its distro header (now 136 bytes) names that range, which HttpBase fetches in 4 MiB pieces once the boot is quiet (not with Save-Data); HttpBase streams every range per chunk and, after a miss next to chunks it has, fetches 1 MiB ahead, doubling to 4 MiB while the reader keeps up (readAhead). With 100 ms of added latency apt-cache show bash takes 1.0 s after a quiet prompt (3.3 s typed at once) instead of 8.1 s 2026-11-21 14:32:21 +00:00
Pooya Parsa
fe8c977333 test: add app-bench (Node, Bun and Claude Code timings of several bundles on the profile disk, with --stats counters and per-variant guest variables); kwemu: count freed modules by reason in the stats build (Jx.free_why, the CLI's [kwemu-free] line); record the 2026-11-21 findings in the agent docs: the tenured ring and the slot pool are stacked limits, a 512K ring with 4096 slots is no faster, and a shared op store keyed by physical page is rejected 2026-11-21 14:13:01 +00:00
Pooya Parsa
8988cfda61 test: run kwtest's SMP checks in the SMP snapshot test only where the bundle's initramfs has kwtest, which a release bundle (KW_RELEASE=1) leaves out 2026-11-21 12:29:00 +00:00
Pooya Parsa
5ecad7404a profile: take an executable segment's size in memory when naming an offset, so that separate debug files, whose segments are cut short in the file, give names 2026-11-20 19:00:48 +00:00
Pooya Parsa
bcf1782092 Name the file and offset of each profile sample, so that the same code adds up across processes, and symbolize sites from a copy of the guest root (--profile-root, symbolizeProfile) 2026-11-20 18:02:53 +00:00
Pooya Parsa
ccf57e51a9 Add a guest pc sampling profiler driven from the host: time samples through a profile IRQ bit set by a sampler thread (SMP kernel) and instruction samples through the budget, per-CPU rings in the kernel, the tier and the block before each stop from kwemu, and --profile in the CLI 2026-11-20 16:38:47 +00:00
Pooya Parsa
18cbbe2a3e js: hold the kernel at its snapshot point for a commit and an optional hold, so that it stops only once the snapshot is stored and else goes on; answer every snapshot before the worker's exit; record detachable terminal sessions in a snapshot and attach to them after a restore 2026-11-20 12:04:45 +00:00