experiment · evergreen

AST chunks vs. plain windows

Same repo, same questions: one question of recall, MRR +0.09 — almost all of it symbol ranking.

What does syntax-aware chunking actually buy? We indexed the same repo twice — once with tree-sitter units, once with blank-line windows of the same size — and ran the same 42 questions.

ChunkerRecall@8MRREN proseTR prosesymbol R / MRR
tree-sitter units0.7860.6900.842 / 0.7440.684 / 0.5701.0 / 1.0
blank-line windows0.7620.5980.895 / 0.7370.632 / 0.5180.75 / 0.32

Reading it honestly

  • Recall moved by one question. MRR moved by 0.09 — and almost all of it is symbol queries (0.32 → 1.0) plus the Turkish slice.
  • On English prose the plain windows were equal or better.
  • So AST chunking does not find more. It puts the right piece on top and knows its name. That is worth having; it is not a 20-point lever.

The literature agrees

The cAST paper reports +1 to +4 points over same-size line windows. An independent controlled replication found ≈ 0, and a third found the fixed windows slightly ahead. Naive function-per-chunk is reliably worse (−4 to −6 pp) — the value sits in merging small siblings and capping size, not in the syntactic boundary itself. Reranking and LLM-written context move retrieval 3–10× more.

#ablation #chunking #cast

See this note on the whiteboard →