Repository navigation
Conversation
Use a word-parallel Levenshtein filter and verify ambiguous survivors under exact insertion/deletion caps. Retain trie traversal for small radii and unsupported geometries. Co-Authored-By: Codex <codex@openai.com>
There was a problem hiding this comment.
🟢 Approved
The optimized path is narrowly guarded and comprehensively checked against existing search results; the remaining feedback concerns only diagnostic clarity.
1 open finding
What changed in this PR
Accelerates dense unit-edit histogram batches while preserving existing trie fallbacks and count semantics.
Changes:
- Adds word-parallel distance filtering with capped-edit verification.
- Integrates the fast path into histogram batching.
- Adds oracle, boundary, fallback, duplicate, and threading tests.
| File | Description |
|---|---|
src/index.cpp |
Dispatches eligible histogram queries to the fast path. |
src/count_unit.hpp |
Implements optimized unit-edit counting. |
tests/python/test_unit_histogram_fastpath.py |
Verifies equivalence and fallback behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (!length || length>63) throw std::invalid_argument("prototype pattern length must be 1..63"); | ||
| for (size_t i=0;i<length;++i) { | ||
| codes[i]=codec.encode(query[i]); | ||
| if (codes[i]==Codec::kInvalid) throw std::invalid_argument("invalid query symbol"); |
Member
Author
|
Superseded by the consolidated seqtree 1.1.0 release PR #13; its implementation and validation are retained there. |
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.

Dense unit-edit count balls spend most of their time walking trie states. Add a word-parallel distance filter with exact capped-edit verification to edit_histogram_batch; retain trie traversal at radii 1–2 and for unsupported scoring geometries. Counts, duplicate handling and exact exclusions are unchanged.
Validation: installed-API oracle tests (26 passed), synthetic capped-edit/UBSan checks, and identical count bins at radii 1–5 with one/four threads. A fresh 32-query/250,000-reference profile reduced radius-5 four-thread counting from 2.9685 s to 0.0715 s with comparable RSS.
Stacked on the histogram API PR #6. No package release is created.