Skip to content

Support open bounds in static interval tree queries - #263

Closed
Aschenbath wants to merge 1 commit into
Yomguithereal:masterfrom
Aschenbath:codex/oss20e-20261122-mnemonist-open-intervals
Closed

Aschenbath wants to merge 1 commit into
Yomguithereal:masterfrom
Aschenbath:codex/oss20e-20261122-mnemonist-open-intervals

Conversation

@Aschenbath

Copy link
Copy Markdown

Add optional openBegin/openEnd query flags, retaining closed bounds by default. For overlap queries the selected convention applies to both indexed and query intervals. Empty open intervals do not match; getters continue to work. Add TypeScript options and a README example.

Fixes #227.

The tree still indexes closed endpoint bounds as a conservative search envelope, so changing query conventions does not require rebuilding the index. Traversal and result ordering are unchanged; only membership checks differ.

Validation: four new tests fail before implementation; the full suite passes with 569 tests and one existing pending test. Boundary/interior sample-set checks cover all four endpoint conventions and degenerate intervals. Full ESLint and a strict TypeScript smoke check pass.

A local Node 24 microbenchmark of 100,000 default point/overlap queries over 32,768 intervals measured medians of 37.07ms before and 39.70ms after (about 7% slower, seven measured alternating trials after warmup). This is one synthetic workload, not a general performance guarantee.

Prepared with OpenAI Codex assistance.

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.

Support open/closed intervals in StaticIntervalTree

2 participants