Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Oct 20:18

wg v0.3.0

wg is one local binary for code and text search. It has two routes:

  • Semantic ranking. wg QUERY [SCOPE] ranks code chunks with a hybrid
    BM25 and embedding scorer. --rank classic keeps the sgrep-compatible
    scorer.
  • Exact text and regex. A ripgrep flag such as -F, -e, -n, -l, -g,
    or --files runs the built-in ripgrep 15.1 engine.

One shared daemon keeps a live semantic index and a trigram text index for each
attached root. One watcher per root feeds both indexes. wg does not need rg
on PATH.

What's new in v0.3.0

  • Semantic scope. Pass a file or directory to search only that part of the
    attached root. A missing scope path acts as an empty scope.
  • Semantic file filters. Repeat --semantic-glob GLOB to include files.
    Prefix a pattern with ! to exclude it. Patterns without / match file
    names at any depth; patterns with / are root-relative. Windows also accepts
    native \ separators. Includes combine with OR; any exclude vetoes a match.
  • Explicit relevance cutoff. --min-score SCORE keeps chunks whose raw
    cosine similarity is at least SCORE. The value must be finite and in
    [-1, 1]. There is no default cutoff. If nothing passes, JSON output is []
    and the command returns exit 1.
  • Scope before ranking. Scope, globs, and cutoff filter eligible chunks
    before candidate selection, BM25 statistics, and score normalization. Scoped
    queries reuse the attached index.
  • Less duplicate context. Semantic results drop a same-file chunk when it
    overlaps an earlier result by at least half of the shorter span. Separate
    regions in one file stay eligible. Classic ranking keeps its old rule.
  • Clearer status. wg status distinguishes a pending lazy rescan from
    active work. Text counts separate persisted records (postings) from live
    files (indexed, files). A deleted file no longer stays in the live file
    count until a rebuild.
  • Calmer file-name boost. A single matched file-name word among several
    query words gets half the previous ratio. Whole-query symbol definitions keep
    their full boost.

--explain --json still shows coherence, symbol, stem, and optional
saturation. Relative and fused scores are ranking values, not confidence
values.

Install

Download the archive for your platform from GitHub Releases:

  • Linux x64: wg-0.3.0-linux-x64.tar.gz
  • Windows x64: wg-0.3.0-windows-x64.zip
  • macOS arm64: wg-0.3.0-macos-arm64.tar.gz
  • macOS x64: wg-0.3.0-macos-x64.tar.gz

Unpack it, enter the extracted directory, then run bin/wg on Linux or macOS,
or bin\wg.exe on Windows, or add bin/ to PATH. The macOS x64 archive is
built by cross-compilation on macos-14 and smoke-tested under Rosetta 2.

To build from source, use Rust 1.95 or newer and a C linker: cc on Linux and
macOS, or the MSVC build tools on Windows.

cargo install --locked --path . --bin wg
cargo install --locked --git https://github.com/holdfast-labs/wgrep wgrep --bin wg

The first wg up downloads about 56 MB of model and parser assets (about 65 MB
on disk). Later runs use the cache. The text route does not need the model or
rg.

On Windows, PowerShell may show the wg up progress line in red. It is progress
output, not an error.

Semantic examples

wg "where do incoming requests get validated" --top 10
wg "decodePacketV17" --top 5
wg "teacher logits distilled into the student" trainers --semantic-glob "*.py"
wg "double surface topology loss" --semantic-glob "*.py" --semantic-glob "!tools/**"
wg "packet framing" --min-score 0.4 --json

--min-score values depend on the model and queries. Choose a value for your
corpus. Do not treat semantic_relative or fused as confidence.

Highlights

The speed and quality numbers below come from the v0.1.0 and v0.2.0 campaigns.
The 0.3 scope and filter path was not part of those campaigns, and these values
were not re-measured for v0.3.0.

  • Warm semantic answers: 25.2 ms p50, against 565.7 ms for the sgrep CLI
    (22.4x). In classic mode, top-10 rows and scores matched pinned sgrep on
    5/5 queries.
  • Fresh code: one-file edit to first correct result, 99.2 ms p50, against
    21.8 s for sgrep (220x). sgrep has no watcher and rebuilds its index.
  • Many agents: 16 concurrent clients reached 140.9 queries/s, against 5.5
    for sgrep (25.4x), with zero errors.
  • Exact text, faster on selective terms: absent terms 5.4 ms vs 63.2 ms for
    rg 15.1 (11.7x); rare terms 6.0 ms vs 63.8 ms (10.6x). Common 50.0 vs
    83.7 ms; broad 111.5 vs 136.1 ms; case-insensitive 37.5 vs 75.7 ms. Output
    was byte-identical under --sort path.
  • Large trees: 13,332 files build in 18.4 s (386.2 MiB peak, 212.7 MiB
    steady). A 94,318-file Linux tree builds in 561.4 s (9m 21s), with 2,774.1
    MiB peak and 2,040.5 MiB steady RSS.

These values come from one campaign on one Debian 13 VPS with 4 vCPU, 7.8 GiB
RAM, and no swap. They are single runs, not percentiles over many machines.
Warm semantic latency is a five-query mixture, not a per-query percentile. The
sgrep freshness row has 6 samples; the wg row has 30. The text index only
removes files that cannot match. The sgrep CLI pays process start and rebuilds
after changes. Do not read these numbers as a specification for your machine.

Service commands

  • wg up --json includes pid in every reply: a new build, a joined build, and
    an already attached root.
  • wg up checks the path before it starts the daemon. A missing path or a file
    fails with not a directory.
  • wg down is idempotent. With no daemon it exits 0 and prints
    No wg service is running. The JSON reply is {"ok":true,"running":false}.
  • wg status with no daemon exits 2 and prints
    wg: no wg service is running for this cache; run wg up first.
  • wg status shows rescan pending, rescanning, or rebuilding for the text
    index. A pending rescan alone does not mean watcher trust failed.
  • The model is fixed at wg up. A mismatch error names the attached model and
    says: run wg down, then wg up --model <m>.
  • On Windows, human-readable output removes the \\?\ prefix from paths. JSON
    keeps the canonical path.
  • A failed build is retried by the next single wg up.

Supported platforms

  • Linux x64
  • Windows x64
  • macOS arm64 (Apple Silicon). Tested on macos-14 in CI.
  • macOS x64 (Intel). Built by cross-compilation on macos-14 and smoke-tested
    under Rosetta 2 in CI.

macOS has no benchmark numbers; all benchmarks are Linux. On macOS the cache
lives in ~/.cache/wgrep, not ~/Library/Caches.

Known limits

  • Semantic results are ranked, not exhaustive. Use -F or -e when you need
    every match.
  • There is no default semantic relevance cutoff. A safe default needs
    calibration across models and query sets.
  • The text index only removes impossible files. Common terms still scan much of
    the tree.
  • Text-route commands in scripts need an explicit path. With no path, rg reads
    piped stdin and can wait for EOF. Add -n when you need line numbers.
  • Memory favors wg only at five roots, and the margin is small. Five attached
    13.3k-file roots used 902.9 MiB RSS, against 1,034.1 MiB for five warm sgrep
    processes: 12.7% less. This is not a general multi-repo win. At one root wg
    used 282.6 MiB against 249.2 MiB (1.13x more); at three roots 606.9 MiB
    against 499.8 MiB (1.21x more). wg stays below the sgrep per-process peak
    sum at three and five roots. The sgrep number is the sum of live processes,
    not a resident server. Mapped vector and chunk-text pages count in RSS after a
    query touches them, until the kernel reclaims them.
  • A kernel-size tree takes 561.4 s (9m 21s) to attach on a 4-vCPU VPS with
    7.8 GiB RAM, with 2,774.1 MiB peak and 2,040.5 MiB steady RSS.
  • One daemon holds up to 32 attached roots.
  • Semantic paths and arguments must be UTF-8. The text route passes non-UTF-8
    arguments to the engine; index pruning falls back to a full scan.
  • Current Windows performance was not measured with the launch harness.

Checksums

The release workflow generates SHA256SUMS for the Linux, Windows, and macOS
archives and attaches it to the release.

ade8a9acb95e5e2a42bcc9dabe3b269effba9c304a954478eb70dc45b08d0bb3  ./wg-0.3.0-linux-x64.tar.gz
5704a8ad30b6c60da6b0232a266a4aab52199c140999d43cac8b4fb1068510c0  ./wg-0.3.0-macos-arm64.tar.gz
d5b7a8a2be06f41a40201bb70ce318e647146666bc4b30472e61e679f0703e98  ./wg-0.3.0-macos-x64.tar.gz
8486f3c0bfab0c17aad26b74c43f85dd0659834b82b7317a51efb6a2e0d81664  ./wg-0.3.0-windows-x64.zip

Credits

  • sgrep: semantic ranking (classic mode). MIT.
  • Semble: design ideas for the symbol, file-stem and coherence signals. MIT.
  • ripgrep 15.1: text engine and walker. MIT or Unlicense.
  • notify: filesystem watcher. CC0.
  • minishlab/potion-code-16M-v2: embedding model. MIT. Downloaded at runtime.

See NOTICE for details and LICENSE for the main license.