Skip to content

simplify: query* (5 passes) - #1902

Merged
ScriptedAlchemy merged 6 commits into
masterfrom
cursor/query-simplify-passes-3c09
Sep 21, 2026
Merged

ScriptedAlchemy merged 6 commits into
masterfrom
cursor/query-simplify-passes-3c09

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Five behavior-preserving simplification passes over tracedecay-query, tracedecay-temporal-query, and tracedecay-search-eval.
  • Shared lexical row scoring, candidate binding, and byte n-gram packing. Ranking cap/score plumbing and worst-first heap keys collapsed to one implementation. Controlled cursor/composer parse batches share one digest loop.
  • Net 7 files, +425 / -663.

Motivation

The two lexical projections (in-memory search-eval adapter and the artifact reader) and the temporal ranker had copied score and identity plumbing. Dead duplication, not a behavior change.

Passes

  1. simplify(pass-1/5): share lexical row scoring — one score_lexical_row for whole-term, fuzzy, phrase, proximity, and echo penalty. Callers only supply term frequency and BM25 inputs. Dropped the artifact scorer's never-failing Result.
  2. simplify(pass-2/5): share lexical candidate binding — one lexical_lane_candidate / lexical_lane_binding for projected chunks and artifact rows.
  3. simplify(pass-3/5): share byte n-gram packing — one pack_byte_ngram and packed_query_ngrams for the artifact builder and the in-memory postings.
  4. simplify(pass-4/5): collapse ranking score plumbing — diversity caps walk one counter array, missing metadata fills through one helper, tier scores use min.
  5. simplify(pass-5/5): share digests and rank keys — cursor and composer parse batches share the digest loop; lexical and exact winner heaps share a key-only Keyed order.

Changes

  • crates/tracedecay-query/src/retrieval/lexical/projection.rs and the in-memory / artifact readers and postings.
  • crates/tracedecay-temporal-query/src/ranking.rs
  • crates/tracedecay-search-eval/src/controlled_workloads.rs

Test plan

  • cargo test -p tracedecay-query --features search-eval --lib retrieval::lexical:: — 117 passed, 0 failed, 1 ignored
  • cargo test -p tracedecay-temporal-query --lib ranking:: — 16 passed, including diversity caps and bounded scores
  • cargo test -p tracedecay-search-eval --lib controlled_workloads:: — 7 passed, 1 ignored
  • cargo check for tracedecay-query (search-eval + tests), tracedecay-temporal-query, and tracedecay-search-eval
  • cargo nextest run --workspace --no-fail-fast not run
  • cargo clippy not run

Checklist

  • CHANGELOG.md updated — not a user-facing contract change
  • No secrets, credentials, or .env files included
  • No breaking changes
Open in Web Open in Cursor 

cursoragent and others added 5 commits September 20, 2026 18:43
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 80717d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit 4aa1e15 into master Sep 21, 2026
22 of 26 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.

2 participants