Skip to content

fix(query): cheaper exact-flat retain + deadline backstop - #539

Merged
ScriptedAlchemy merged 3 commits into
codex/tracedecay-total-redesign-planfrom
td/query-timeout-perf
Aug 19, 2026
Merged

fix(query): cheaper exact-flat retain + deadline backstop#539
ScriptedAlchemy merged 3 commits into
codex/tracedecay-total-redesign-planfrom
td/query-timeout-perf

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restacked onto fa9c6318 (merge of fix(privacy): close the remaining Codex P1 gaps after #522 merged #537). Query crate work plus the forced SemanticVectorReadPort examine adapt in usecases so the trait change compiles.
  • Exact-flat still visits for coverage, but does less work: score without cloning, materialize candidate/evidence only for retained heap rows. Isolated proof: 4 eligible / cap 2 → 2 materializations.
  • Omitted deadline_micros falls back to crate 5s (semantic) / 30s (lexical projection build). A set request/profile RetrievalBudget.deadline_micros wins (Plan 20, same bar as feat(automation): Plan 26 typed BudgetExceeded backoff for session_evidence_budget_exhausted #538).
  • BudgetExceeded stays Partial, never a complete empty success. Semantic 5s does not take down exact/lexical/graph (required lanes stay exact+lexical).
  • Full-scan deadlines: store examine runs before every inspected row, including excluded ones; lexical projection/fuzzy/n-gram build checkpoints the same deadline.

Test plan

  • cargo test -p tracedecay-query --lib retrieval::semantic::tests (28 passed)
  • cargo test -p tracedecay-query --lib retrieval::lexical (20 passed)
  • cargo test -p tracedecay-query --lib retrieval::tests::composition (16 passed, including semantic_budget_exceeded_does_not_take_down_exact_lexical_or_graph)
  • CI

Does not reopen #532. Do not merge until CI is green.

Exact-flat scans and first-query lexical projection stays O(store); a missing caller deadline no longer leaves those paths unbounded.
@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review August 19, 2026 23:28
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ce0b96c

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e32b35160

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tracedecay-query/src/retrieval/lexical/projection.rs
Comment thread crates/tracedecay-query/src/retrieval/semantic.rs
Score every visited row, but clone candidate/evidence only for the cap that the heap keeps. Isolated test: 4 examined, 2 materialized.
@ScriptedAlchemy ScriptedAlchemy changed the title fix(query): bound omitted semantic and lexical deadlines fix(query): cheaper exact-flat retain + deadline backstop Aug 19, 2026
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