Skip to content

chore(spike): keep the embedding and vector-layout spikes as a record - #759

Merged
ajianaz merged 4 commits into
developfrom
chore/spike-vector-layout
Nov 16, 2026
Merged

ajianaz merged 4 commits into
developfrom
chore/spike-vector-layout

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the two throwaway spikes under spikes/ as a record of the evidence behind the merged decisions. Neither is part of the cora build (each is a standalone crate with its own [workspace]).

  • spikes/potion-code/: local code embeddings measured against cora's earlier backends on 1,639 queries (hand-written questions and doc comments of this repository, 8 other Rust crates and the Python standard library), including potion-code-16M-v2 through model2vec-rs. Results in RESULTS.md.
  • spikes/vector-layout/: one global vector file for all projects against one file per project, on 176 real projects (127,400 functions): quality at several --limit values, speed, load time and memory. Raw results in results/.

Why

These spikes decided the default embedding model (#749, #755) and the per-project vector layout (#752). Keeping the harness and the raw numbers lets the claims in those PRs and in docs/code-intelligence.md be reproduced or challenged later. Refs #746.

Testing

  • No source under src/ changes; the root crate builds and tests as before (CI).
  • Each spike builds on its own (cargo run --release inside its directory, see its README); the results files are the outputs of those runs.

Generated by Claude Code

Throwaway crate outside the cora build that embeds this repository's functions
with the static code embedding potion-code-16M-v2 and reports load time,
throughput, CPU time and memory, plus a few retrieval samples. The results and
caveats are in its README; nothing in cora itself changes.
…746)

Extends the potion-code-16M-v2 spike into a measured comparison: an offline
harness scores bm25, cora's hashing and pretrained backends, potion-code
v1/v2, general potion models and int8 variants, alone and fused with bm25 by
reciprocal rank fusion, on 4 sets (39 hand-written questions and 400 doc
comments on this repository, 600 doc comments on 8 Rust crates, 600 docstrings
from the Python stdlib) plus keyword-style variants, over both name+signature
documents (what cora indexes) and whole bodies. Results carry bootstrap
intervals and paired differences; cost is measured per backend; the real
cora brain is scored on the same queries as a cross-check.

potion-code-v2 is a net gain on every set; cora's current vectors at half weight
are neutral to harmful outside this repository. A transformer model could not
be tested because the sandbox blocks its download; a probe crate is included.
Nothing in cora itself changes.
…ject (#746)

Measures, on 176 real projects (127,400 functions embedded with the real
potion-code-16M-v2 model and cora's own usearch and vecq settings), whether the
shared vector index hurts retrieval and what a per-project vecq layout would
gain. The shared file loses up to 29% of MRR and returns no candidate for up to
a quarter of the queries when many projects share it, never frees the vectors of
deleted symbols, and costs 149 MB of memory in every process; one vecq file per
project matches the exact ceiling, is 4.3x smaller, and loads about 300 to 400x
faster and re-indexes 6 to 9x faster. Nothing in cora itself changes.
…t zero

Found by Cora Review on the pull request.

Refs #746.
@ajianaz
ajianaz merged commit 4e407b9 into develop Nov 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant