Skip to content

Releases: Owen718/snapgrep

Release list

snapgrep v0.1.0

Choose a tag to compare

@Owen718 Owen718 released this 14 Aug 07:27

An in-process trigram index that makes code search in Pi, oh-my-pi, and DeepSeek Harness dramatically faster than ripgrep — with results that are byte-for-byte identical.

No sidecar process. No daemon. One native addon loaded inside the agent process.

Install

curl -fsSL https://raw.githubusercontent.com/Owen718/snapgrep/main/install.sh | sh

Detects your platform, downloads only the addon that machine can run (~1.2 MB), and installs into ~/.pi/agent/extensions. Nothing is compiled and no daemon is started.

Prefer to do it by hand, or want one copy for every machine? snapgrep-extension-all-platforms.tar.gz carries all five addons and picks the right one at load time:

curl -L https://github.com/Owen718/snapgrep/releases/download/v0.1.0/snapgrep-extension-all-platforms.tar.gz | tar xz
mkdir -p ~/.pi/agent/extensions && mv pi-fast-grep ~/.pi/agent/extensions/

For oh-my-pi the same directory works unmodified. For DeepSeek Harness see the install guide; it mounts as a plugin rather than a copied directory.

Platforms

Platform Addon
macOS Apple Silicon pi-fast-grep-kernel.darwin-arm64.node
macOS Intel pi-fast-grep-kernel.darwin-x64.node
Linux x64 (glibc) pi-fast-grep-kernel.linux-x64-gnu.node
Linux arm64 (glibc) pi-fast-grep-kernel.linux-arm64-gnu.node
Windows x64 pi-fast-grep-kernel.win32-x64-msvc.node

Download the whole archive, or a single .node if you are assembling your own layout. Alpine/musl is not built yet.

What to expect

Speedup comes from not reading files, so it tracks how many files ripgrep would otherwise open. Measured on Linux, single core, a 20 MB / 5,001-file repository:

Scenario snapgrep ripgrep Speedup
Every file matches 6.98 ms 18.5 ms 2.6×
300 files match 0.22 ms 14.1 ms 63.5×
One file matches 0.006 ms 14.2 ms 2458×

When everything matches there is nothing to skip, and 2.6× is all the index can win. Most real agent searches — a symbol name in a few dozen to a few hundred files — land in the middle.

Correctness

Every result is checked against ripgrep on the same snapshot with the same flags: missing = 0 && extra = 0, plus identical ordering, byte offsets, context lines, and truncation. 24 of 24 benchmark queries match exactly.

Anything the index cannot serve correctly runs a full ripgrep search instead of returning a partial answer, and reports why in the result metadata. A workspace that is not a clean Git tree falls back the same way: correct, just not accelerated.

Known limitations

  • The Windows addon is built but not yet covered by the native test suite. The kernel fails to open an index parent directory under a path containing an 8.3 short name (C:\Users\RUNNER~1\...). macOS and Linux run the full native suite in CI on the platform that built them.
  • Four of the twenty-four benchmark queries fall back to ripgrep: they depend on ripgrep's binary-file and NUL-byte output semantics, which have not been replicated yet.
  • Alpine/musl builds are not produced.