Skip to content

Pi-Bolt 0.5.0 (Pi 1.0.0)

Choose a tag to compare

@opensec-intelligence opensec-intelligence released this 03 Oct 06:17
· 2546 commits to pi-bolt since this release

Pi-Bolt 0.5.0 speeds up more kinds of hot loops, makes streaming a large tool call cheap, fixes a long-string bug in compiled code and two crashes, and is the most heavily tested release so far. It runs Pi 1.0.0.

Faster

  • Large tool calls stream without a stall. Pi re-parsed all of a tool call's arguments each time a few more bytes arrived, so a model writing a big file spent time quadratic in its size. A 280 KB write took 53 s of CPU on stock Bun (107 s on Pi-Bolt 0.4.0); it now takes 0.15 s. Arguments under 1 KB are still parsed on every delta, larger ones once they have grown by an eighth, and the final arguments are parsed exactly as before. This applies to the Anthropic, OpenAI (chat and responses) and Bedrock providers.
  • Module and closure variables in loops. A loop bound or operand held in a module-level variable (i < N) is compiled as the value the program writes to it, behind a check: 8x faster for i < N (13.8 → 1.7 ms).
  • Closures that read a captured constant: 1.5x. A captured variable written before it is read is known by its type.
  • Methods shared by a few classes. A method call in a loop whose name up to six functions define is compiled in with a check for each: 1.2x for two classes, 1.9x for methods of object literals.
  • % of numbers that are integers at run time is done in integers.
  • try/catch in loops: 1.2–2.5x, from the two above.
  • Typed arrays in loops: 1.3–1.6x.

Pi's own startup, headless and interactive speed are unchanged: these are for plugins and user code.

Fixed

  • endsWith() on long strings. In compiled code outside loops, s.endsWith(literal) gave the wrong answer for strings of 65,535 characters or more. Pi's command-output tail showed it (one line too few and a stray empty line on long outputs). In 0.4.0 too.
  • Errors formatted during a garbage collection crashed Pi when a plugin's errors were collected (0.4.0 segfaulted in every run of the reproducer). Compiled code that changes an object's shape now also tells the garbage collector.
  • pi install npm:... without npm installed now works: the compiled binary installs, updates and removes packages itself.
  • The compiler no longer stops while building a program that adds two integers beyond 32 bits (a constant it took for an address), which could break builds with plugins. In 0.4.0 too.

Tested

Before release, each of the three builds was checked with:

  • 32 Pi processes at once doing heavy tool work (megabytes of output, a 1 MB file, 3,000 files, Unicode and binary files, failing tools, timeouts): every tool result and every request sent to the model byte-identical to stock Bun's.
  • 600 prompts in one process: no failures, and the floor of memory within 20 MB from start to end.
  • Cut connections, HTTP 500/429, malformed streams, SIGINT/SIGTERM during a tool, closed stdout: clean exits, no crashes.
  • 32,000 randomly generated programs compiled ahead of time and compared with the bytecode engine (the last 10,000 on this release's compiler, every one the same), all 95 built-ins with fast paths on edge-case inputs, the engine tests under continuous garbage collection, and JavaScriptCore's own stress tests.
  • 17 private plugins installed from npm into each build with a real model turn, and a live provider turn with a streamed 18 KB write.
  • The installer (fresh, upgrade from 0.4.0, without xz, a corrupted download), npm and bun installs, and the baseline build on an emulated CPU without AVX.

Install

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

or pi-bolt update from 0.4.0, or npm install -g pi-bolt, or bun add -g pi-bolt.

Asset For
pi-bolt-linux-x64.tar.xz / .tar.gz Recommended. CPUs with AVX2 (Intel Haswell 2013+, AMD Zen+).
pi-bolt-linux-x64-baseline.tar.xz / .tar.gz Any x86-64 CPU.
pi-bolt-linux-x64-jit.tar.xz / .tar.gz JIT also on, for plugins loaded at run time.
pi-bolt-runtime-linux-x64.tar.gz The Pi-Bolt Bun runtime, for compiling plugins in.

Linux x86-64 with glibc 2.17 or later.