Repository navigation
Add native batched edit histograms - #6
Merged
Merged
Conversation
Co-Authored-By: Codex <codex@openai.com>
Co-Authored-By: Codex <codex@openai.com>
There was a problem hiding this comment.
🟡 Changes recommended
Thread handling is inconsistent with existing batch APIs, and the public API documentation needs correction.
4 open findings
What changed in this PR
Adds native batched edit-count histograms without materializing Python Hit objects.
Changes:
- Adds C++ and Python histogram APIs with parallel worker reuse.
- Adds equivalence and validation tests.
- Documents the API and bumps the version to 1.0.3.
| File | Description |
|---|---|
src/index.cpp |
Implements histogram aggregation. |
src/_bindings.cpp |
Exposes the Python API. |
include/seqtree/seqtree.hpp |
Declares the C++ API. |
tests/python/test_edit_histogram.py |
Tests counts, threading, and validation. |
docs/api.rst |
Documents histogram usage. |
pyproject.toml |
Bumps the package version. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Codex <codex@openai.com>
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.


Batch consumers needing only edit-count distributions currently receive every hit as a Python object. Add
Index.edit_histogram_batchto reduce the existing search results into exact total-edit bins using reusable worker scratch, preserving duplicate references and optional zero-edit exclusion. Require an explicit positive total-edit cap and uncapped seqtm/auto all-hit mode. Version this API as 1.0.3 so downstream packages can declare its requirement.Validation: 24 focused tests cover equivalence to search_batch, indels, duplicates, empty inputs, thread equality and rejected incomplete-count modes; Sphinx builds with warnings treated as errors. A bounded comparison confirms exact histogram equality. This change reduces result materialization; native search traversal is unchanged.