Skip to content

fix(atlas): aggregator splits over-context chunks at embed time (#1518) - #10836

Merged
dezren39 merged 1 commit into
mainfrom
queue/17164-1518-context-split
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17164-1518-context-split

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

Follow-on to #10832 (task 17164, #1518), found by the live promotion run: the first entry, infra/dns/dns_config.yaml (31,264 bytes, one whole-file staged chunk), tokenizes to 10,413 tokens — past the model context of 8,192 — and atlas-embed refuses it loudly, by design ("the corpus pipeline tokenizes whole texts and a >8192-token input is an error"; chunking is the caller's job).

  • DocEmbedder gains token accounting: token_count (production: the model's own tokenizer via Embedder::tokenize) and max_input_tokens (default atlas_embed::MODEL_CONTEXT).
  • The aggregator now splits a staged chunk at embed time into context-fitting pieces: line-boundary accumulation measured by real token count, with a mid-line binary-search split for a single over-long line. Pieces partition the chunk text exactly, become separate shard chunks under the same source pointer with per-item ordinal chunk_idx, and carry their own content hashes.
  • New oracle test: a word-token embedder with a 3-token context promotes an 8-token staged chunk; the shard's pieces read back concatenated == the staged text, each within budget. All 4 aggregate tests pass; full cargo test -p atlas-core -p atlas-search green before the cherry-pick onto current main, aggregate suite re-verified after.
  • Also adds examples/retrieval_proof.rs (manual, in the live_smoke.rs precedent): embeds a semantic query with the production query embedder, fans out over a local shard dir, and prints hits with chunk text read back from the shard — the tool used for the Define code/config embeddings: unit, metadata, usage — and whether they share the prose embedding dump #1518 retrieval proof.

Refs #1518, #5669. Part of task 17164.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 17:07
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T17:07:32.836655Z
We couldn’t complete this review. Comment @codex review to try again.
754876c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f7d61c9-56ce-4721-8fa2-ed21a5471932
Commits

Reviewing files that changed from the base of the PR and between bbe8d38 and 754876c.

Files selected for processing: 4

  • pkgs/atlas-search/crates/atlas-core/examples/retrieval_proof.rs
  • pkgs/atlas-search/crates/atlas-core/src/aggregate.rs
  • pkgs/atlas-search/crates/atlas-core/src/embed.rs
  • pkgs/atlas-search/crates/atlas-core/tests/aggregate.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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