Repository navigation
Atlas step 1: atlas-embed embedder parity spike — Gate A (#5351) - #5367
Merged
Merged
Conversation
Create the pkgs/atlas-search/ skeleton (workspace + rust-toolchain pin on the pkgs/id pattern) with the atlas-embed crate only: - Snowflake arctic-embed-m-v2.0 embedder: dynamically-loaded ONNX Runtime (ort load-dynamic, never downloaded at build/run time), the model's own tokenizer.json (SentencePiece Unigram, Metaspace) via the tokenizers crate with the shipped 512 truncation default explicitly disabled (model context 8192, loud error beyond), CLS pooling, full-768 f32 output, documents prompt-free. - Batching replicates the production corpus pipeline (~/atlas/v3/embed_onnx.py): right-pad with token id 0, attention mask 0. The fork sidecar's pad id 1 is bit-identical on this fp32 graph (fixture diagnostic, max delta 0.0 on every probe), so the corpus pipeline's semantics are the ones recorded. - The L2 norm replicates NumPy's pairwise summation order — the reference does vecs / np.linalg.norm(vecs, axis=1) and Gate A grants no tolerance for a differently-ordered accumulation. Gate A: fixtures/embed-probes.json records token ids + f32-bit vectors (single and one fixed mixed batch) from the Python pipeline for 11 probes — the five opencode#1554 spike texts, an empty string, the three Atlas gate chunks (6359/15202/39430, by corpus id; text not copied, it is personal corpus content), a 711-token corpus chunk (chunk 2, proves no silent truncation), and a query-shaped sentence in document mode. Generated by the recorded, rerunnable fixtures/gen_fixtures.py. Result (laptop, pinned 1.99.0 toolchain): token ids equal on every text probe; vectors bit-identical (max delta 0.0, 0 bit diffs) single and batched, debug and release. Model: HF rev 95c2741480856aa9666782eb4afe11959938017f, onnx/model.onnx sha256 c0c53d7f49a2db60761b92b7bbf5be87a7b3cf5d92dbbd7f1b5028bd5a40aa39, tokenizer.json sha256 f1cc44ad7faaeec47241864835473fd5403f2da94673f3f764a77ebcb0a803ec, against onnxruntime 1.31.1 (the venv's libonnxruntime, dynamically loaded — the spike environment; the hermetic nix closure is step 5's gate, #5355). Nix packaging (flake.nix/default.nix) intentionally lands in step 5; this step is the parity spike only.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the Atlas binary+service epic (#5350), per the design of record (
doc/2026-11-04T08-07-13Z_design_atlas_binary_service/§4/§5). Implements #5351.What lands
pkgs/atlas-search/skeleton: Cargo workspace +rust-toolchain.tomlpin (1.99.0, pkgs/id pattern), with theatlas-embedcrate only. No CLI, no serve mode, no nix packaging (step 5).atlas-embed: dynamically-loaded ONNX Runtime (ort2.0.0-rc.15,load-dynamic— nothing downloaded at build or run time), the model's owntokenizer.json(SentencePiece Unigram, Metaspace) viatokenizers0.22, shipped 512-token truncation default explicitly disabled (context 8192, loud error beyond), CLS pooling, full-768 f32, documents prompt-free. Lazy init is left to callers (explicitEmbedder::load).fixtures/embed-probes.json(token ids + f32-bit vectors, single and one fixed mixed batch) from the production Python corpus pipeline (~/atlas/v3/embed_onnx.pyreplicated exactly byfixtures/gen_fixtures.py). 11 probes: the five opencode#1554 spike texts, an empty string, the Atlas gate chunks 6359/15202/39430 (referenced by corpus id — their text is personal corpus content and is not copied into the repo), a 711-token corpus chunk (id 2, proves no silent truncation), and a query-shaped sentence in document mode.Gate A — PASSED, bit-identical
Run on the laptop (never the sandbox), pinned 1.99.0 toolchain, debug and release:
Unit tests pass; clippy clean (0 warnings); fmt clean. The gate test is
#[ignore]d (it needs the model + runtime lib) with the exact invocation in its docs, so ordinary CI compiles everything and the gate runs as a laptop ceremony.Findings worth carrying forward
np.zeros), the fork's sidecar with id 1; the generator's diagnostic shows max delta 0.0 between them on every probe (the int8 graph was the padding-sensitive one). The crate replicates the corpus pipeline's 0.l2_normalizereplicates NumPy's pairwise summation (the reference isvecs / np.linalg.norm(...)). It hit 0.0 with the faithful replica in place.ortrc.15 needs&mut selfforSession::run— serve mode (step 4) must wrap the embedder in a mutex or use one session per worker; there is no shared-&selfrun in this version.libonnxruntime.so.1.31.1dynamically loaded and an x86-64 libstdc++/libz onLD_LIBRARY_PATH— NOT the hermetic nix closure; that is step 5's (Atlas step 5: nix packaging (pkgs/atlas-search) + amd deploy #5355) gate.RUSTC_WRAPPER=under the pinned rustup 1.99.0 toolchain (PATH clippy-driver otherwise shadows from the nix profile).Model pin used
Snowflake/snowflake-arctic-embed-m-v2.0@ HF rev95c2741480856aa9666782eb4afe11959938017f(the laptop's existing snapshot; deploy-time provisioning is Q1/step 5)onnx/model.onnxsha256c0c53d7f49a2db60761b92b7bbf5be87a7b3cf5d92dbbd7f1b5028bd5a40aa39tokenizer.jsonsha256f1cc44ad7faaeec47241864835473fd5403f2da94673f3f764a77ebcb0a803ecOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.