Skip to content

Add native batched edit histograms - #6

Merged
mikessh merged 3 commits into
devfrom
feature/edit-histogram-batch
Oct 10, 2026
Merged

mikessh merged 3 commits into
devfrom
feature/edit-histogram-batch

Conversation

@mikessh

@mikessh mikessh commented Oct 10, 2026

Copy link
Copy Markdown
Member

Batch consumers needing only edit-count distributions currently receive every hit as a Python object. Add Index.edit_histogram_batch to 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.

mikessh and others added 2 commits October 10, 2026 08:19
Co-Authored-By: Codex <codex@openai.com>
Co-Authored-By: Codex <codex@openai.com>

Copilot AI 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.

🟡 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.

Comment thread src/index.cpp
Comment thread docs/api.rst Outdated
Comment thread src/_bindings.cpp
Comment thread src/_bindings.cpp Outdated
Co-Authored-By: Codex <codex@openai.com>

Copilot AI 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.

🟢 Approved

The implementation, bindings, documentation, validation, and tests are consistent with existing batch-search behavior.

1 open finding
3 resolved since last review

🧠 Review effort: Balanced

@mikessh
mikessh marked this pull request as ready for review October 10, 2026 09:38
@mikessh
mikessh merged commit 6956cf6 into dev Oct 10, 2026
10 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