Skip to content

Pi-Bolt 0.7.3

Choose a tag to compare

@Kushalkhemka Kushalkhemka released this 10 Oct 07:03
· 481 commits to pi-bolt since this release

Pi-Bolt 0.7.3 runs Pi 1.1.0. It uses less CPU and memory than 0.7.2 in long sessions and with large tool output, starts
much faster from disk on macOS, and fixes a memory leak that took a real session to 59 GB.

Fixes

  • A command with very large output no longer fills memory. The bash tool (and ! commands) wrote the full output to its
    file through an asynchronous stream without waiting for it: when a command printed faster than the stream drained, the rest
    queued in memory, and each write that completed spent longer the longer the queue was. A three-day session reached 59 GB and
    a core at 100%. The output file is now written as the output arrives, so the command waits while the disk is busy; it stops
    at 1 GiB with a note, and a full disk no longer costs the model the output and exit code it already has.
  • From upstream Bun and WebKit ahead of their release: fetch no longer aborts the process when a TLS 1.2 server renegotiates;
    an FTL compiler fix for wrong NaNs (JIT builds); Linux reads OS randomness with getrandom(2).

Faster, lighter

Measured against 0.7.2, both installed from their release archives (medians; docs/BENCHMARKS.md):

macOS 0.7.2 macOS 0.7.3 Linux 0.7.2 Linux 0.7.3
pi -p with pi-bin not in memory (after a restart or update) 177 ms 64 ms
32 MB of command output, a line at a time: CPU 2.0 s 0.26 s 5.1 s 1.7 s
... peak memory 104 MB 56 MB 202 MB 128 MB
Long session: CPU per prompt (prompt 70 / 50) 73 ms 63 ms 252 ms 231 ms
Interactive session, 5 prompts: CPU 131 ms 125 ms 345 ms 326 ms
... peak footprint / peak memory 51 MB 46 MB 172 MB 154 MB
pi -p: CPU 30 ms 30 ms 97 ms 90 ms
... peak footprint / peak memory 32 MB 29 MB 144 MB 127 MB
Streaming a reply in tmux: CPU 592 ms 565 ms 408 ms 363 ms
pi --version: peak memory 30 MB 30 MB 80 MB 66 MB
One RPC session of hundreds of prompts: floor of memory flat +5 MB per 100 prompts flat

Where it comes from:

  • Pi: no work that grows with the whole history or output on every step: the session path is kept between requests
    instead of walked from the root (5-8 times per tool turn); a tool call is drawn again only when its arguments change; streamed
    tool arguments are parsed as they grow, not in full on every delta (Pi Messages, Mistral, the agent proxy, grammar tools);
    read, truncation, grep, edit, JSONL, MCP stdio and Anthropic's event stream go over their input once; pastes and the
    editor's undo no longer copy everything on each keystroke; ! command output keeps only what can be shown; the context is
    not copied for every request when no extension handles it.
  • Engine: fs.WriteStream writes queued data together with writev as Node does (800,000 queued lines: 10 s -> 0.3 s);
    stream queues compact in amortized constant time; mimalloc from upstream, which no longer wakes its scavenger thread on every
    turn of the event loop, with freed memory given back once 25 ms old; threads waiting for work give back their free memory;
    on Linux a collection every 5 s instead of every second while Pi waits, and the runtime's code laid out in the order Pi runs
    it.
  • macOS launcher: reads ahead, all at once, the parts of pi-bin a start needs (pi-bin.hot, recorded at build time).

For extension authors

  • BashExecutionComponent.getOutput() returns the end of a ! command's output, at most its last 200,000 characters, not all
    of it: the component no longer keeps a command's whole output in memory.

Install

curl -fsSL https://pi-bolt.opensec.in/install.sh | sh

or pi-bolt update, or npm install -g pi-bolt. The installer detects Linux or macOS by itself.

Asset For
pi-bolt-linux-x64.tar.xz / .tar.gz Recommended on Linux. CPUs with AVX2 (Intel Haswell 2013+, AMD Zen+).
pi-bolt-linux-x64-baseline.tar.xz / .tar.gz Any x86-64 CPU with SSE4.2.
pi-bolt-linux-x64-jit.tar.xz / .tar.gz JIT also on, for plugins loaded at run time.
pi-bolt-darwin-arm64.tar.xz / .tar.gz macOS. Macs with Apple silicon, macOS 13 or later.
pi-bolt-darwin-arm64-jit.tar.xz / .tar.gz macOS, JIT also on.
pi-bolt-runtime-linux-x64.tar.gz, pi-bolt-runtime-darwin-arm64.tar.gz The Pi-Bolt Bun runtime, for compiling plugins in.

Linux x86-64 with glibc 2.17 or later; macOS 13 or later on Apple silicon.