Tree-Mendous
Tree-Mendous provides exact half-open integer range sets: [start, end) includes
start and excludes end. Choose the stable RangeSet interface for payloads,
queries, and allocation; a specialized native API for atomic geometry batches;
50 process-local application engines; or explicitly experimental
multidimensional indexes.
Choose an API
| Need | Interface | Status | Important boundary |
|---|---|---|---|
| Add, discard, query, allocate, snapshot, or attach payloads | RangeSet via treemendous.create_range_set |
Stable | The canonical general-purpose API |
| Apply ordered geometry mutations as one native transaction | treemendous.exact_batch |
Stable, specialized | No payloads, allocation, or generic query API |
| Use a concrete scheduler, allocator, catalog, partitioner, or lease pool | treemendous.applications |
Stable application namespace | 50 process-local engines with scenario-specific contracts |
| Index identity-preserving 2D–4D boxes | treemendous.multidimensional |
Experimental | Process-local; not exported from the package root |
The task-oriented interface guide explains these boundaries in detail.
Install
Tree-Mendous supports CPython 3.11–3.13.
python -m pip install treemendous
RangeSet quickstart
This complete example reserves unavailable edges, atomically allocates the first two-unit slot, and checks the remaining capacity:
from treemendous import Span, create_range_set
ranges = create_range_set((0, 24), backend="py_boundary")
ranges.discard(Span(0, 9))
ranges.discard(Span(17, 24))
booking = ranges.allocate(2, not_before=9, not_after=17)
assert booking is not None
assert booking.span == Span(9, 11)
assert ranges.first_fit(2, not_before=11, not_after=17).span == Span(11, 13)
assert ranges.snapshot().total_free == 6
allocate returns None if no fit exists. Coordinates must be integers,
lengths must be positive, and mutations must stay inside the managed domain.
Payload behavior is selected with an explicit UniformPayloadPolicy,
JoinPayloadPolicy, or OrderedPayloadPolicy; see the
API guide.
Exact-batch quickstart
Use ExactBatchRangeSet when one ordered, geometry-only batch must either
publish completely or leave the prior snapshot visible:
from treemendous import Span
from treemendous.exact_batch import (
BatchMutation,
ExactBatchRangeSet,
MutationOpcode,
)
ranges = ExactBatchRangeSet((0, 64), initially_available=False)
results = ranges.mutate(
[
BatchMutation(MutationOpcode.ADD, 8, 20),
BatchMutation(MutationOpcode.DISCARD_REQUIRE_COVERED, 10, 14),
]
)
assert [result.changed for result in results] == [
(Span(8, 20),),
(Span(10, 14),),
]
assert ranges.snapshot().intervals[0].span == Span(8, 10)
Rows execute in input order. Per-instance limits bound operations, live
intervals, changed spans, packed-result bytes, and staging work. Exact batch is
not a RangeSet backend and is not integrated into the 50 application engines.
Read the exact-batch contract.
Performance
Performance depends on workload shape, state size, backend availability,
platform, and which wrapper or materialization layers are timed. Current local
Apple M5 Max/macOS 26.5.1/CPython 3.12.7 standard measurements put
cpp_boundary at about 0.30M–0.91M timed public operations per second across
six traces with 64–128 initial intervals. This is evidence for those traces,
not a universal throughput claim. Large snapshots and sorted-vector exact
batches can become
copy-bound.
The performance guide reports operation-level measurements, hosted 1.1.0 exact-batch evidence, timing boundaries, and the optimization roadmap. The benchmark methodology explains correctness checks and durable artifacts.
Applications and reusable patterns
The 50 concrete engines cover partitioning, scheduling, overlap catalogs, allocation, and numeric leasing. Each has its own factory, state model, and exclusions; names describing distributed work do not imply transport, consensus, or durable storage. Start with the application index or the application-pattern guide.
Two additional executable patterns demonstrate APIs outside the 50-engine registry:
- atomic port-pool reconciliation uses exact batch for geometry only; it has no lease identity, TTL, or fencing;
- spatiotemporal geofences
uses experimental, process-local
BoxIndex3D.
The registered radio-spectrum engine is the existing generic BoxIndex
integration: it wraps an experimental BoxIndex(2) inside its stable,
application-specific reservation contract. The Morton catalog instead uses
one-dimensional Morton candidate bands plus exact Cartesian filtering. The new
BoxIndex3D pattern is outside the registry, and exact batch is not integrated
into any of the 50 engines.
Backend maturity
Automatic selection considers only stable backends that are available, pass semantic probes, and satisfy requested capabilities. Selecting an unavailable or invalid backend raises a reasoned error.
| Backend ID | Runtime | Width | Maturity | Notes |
|---|---|---|---|---|
py_boundary |
Python/CPU | 64-bit | Stable | Core geometry |
py_avl_earliest |
Python/CPU | 64-bit | Stable | Core geometry |
py_summary |
Python/CPU | 64-bit | Stable | Best-fit + analytics |
py_treap |
Python/CPU | 64-bit | Stable | Random interval sampling |
py_boundary_summary |
Python/CPU | 64-bit | Stable | Best-fit + analytics |
cpp_boundary |
C++/CPU | 64-bit | Stable when built | Core geometry |
cpp_treap |
C++/CPU | 32-bit | Experimental | Not selectable |
cpp_boundary_summary |
C++/CPU | 32-bit | Experimental | Not selectable |
cpp_boundary_summary_optimized |
C++/CPU | 32-bit | Experimental | Not selectable |
gpu_boundary_summary |
CUDA/GPU | 32-bit | Experimental | Not selectable |
metal_boundary_summary |
Metal/GPU | 32-bit | Experimental | Not selectable |
See the backend catalog for discovery and qualification details.
Documentation
- Documentation index
- Getting started
- Choosing an interface
- Canonical API
- Performance
- Examples
- Release notes
Development
git clone https://github.com/josephjohncox/TreeMendous.git
cd TreeMendous
uv sync --all-extras
just check
just run-examples
Use just build for locally verified wheel and source artifacts. See
Contributing
and Releasing
for the complete quality and publication contracts.
BSD-3-Clause license.
Metadata
Release files for treemendous 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| treemendous-1.2.0.tar.gz | 742.8 kB | Details |
Built distributions (wheels)
Total release size: 11.3 MB
Release files / treemendous-1.2.0.tar.gz
| Download URL | treemendous-1.2.0.tar.gz |
|---|---|
| Size | 742.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ee78dd3daa88d70688f393be78c32238423372da0d26750c641d8d46f3bce95
|
|
BLAKE2b-256 checksum How to use checksums |
adc88f08f9b2fb93d3d609eeb6e77f3325471ffe374ea9732dc28299fc4eb3b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp313-cp313-win_amd64.whl
| Download URL | treemendous-1.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 812.0 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
24cabedaf7ccb6afac91dfa0522018a73269c57b47af39b4a371447e314c36c5
|
|
BLAKE2b-256 checksum How to use checksums |
eea59311ee59bcadd853ea9e331921045586cc85093e375d39b7f711b641eeac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | treemendous-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8aace178876e9ead9adf53d49bcdbb29c2f9bbbba9f838a91c9c9c0b7f57f40d
|
|
BLAKE2b-256 checksum How to use checksums |
85c758a7413ca4da40691de90dd4912654d7a855ec04a37b65250a55bb748262
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp313-cp313-macosx_12_0_universal2.whl
| Download URL | treemendous-1.2.0-cp313-cp313-macosx_12_0_universal2.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.13 macOS 12.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
e072c0a68a1c74b69dc066b15078534c602423d3dadb564913549dd247bc542a
|
|
BLAKE2b-256 checksum How to use checksums |
4423a920b82f3d5fa8e24449635a2a6eafe2be473828b7844e09ed1bc7aead31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp312-cp312-win_amd64.whl
| Download URL | treemendous-1.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 812.0 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9f0865fe9d6f36a5d6bf57b8425e2218559974b82ea32bd6f8cb916ce4841223
|
|
BLAKE2b-256 checksum How to use checksums |
1d6b5f197cfaca62f7f0133284206382f4e3147ac1954cae7163bfd3b8fbca96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | treemendous-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ea281736db6aa06c78202bbd669c825dbcb3372fcce23a5db1e561d847253bed
|
|
BLAKE2b-256 checksum How to use checksums |
9b0188aa4109f2cf3621b4cd1226e74a3eb641ae7f219e69f2c348719df68469
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp312-cp312-macosx_12_0_universal2.whl
| Download URL | treemendous-1.2.0-cp312-cp312-macosx_12_0_universal2.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.12 macOS 12.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
3a703df6755199e7eedc3f6bf330e5050d8e9347d3f6ca733a27619f9fcd4a2c
|
|
BLAKE2b-256 checksum How to use checksums |
4b65a57320f30749fda4c1246908e079314707c19c9cb163d1dd3d42da4d67a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp311-cp311-win_amd64.whl
| Download URL | treemendous-1.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 805.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a82fd5d34245a7fbc2a469cb3cca97a96e9060f65082acfeed34cd69deb705c6
|
|
BLAKE2b-256 checksum How to use checksums |
0b29b794954769fb8d6d8ef200dcf5978fd5da7c081bc84e73f3bf423ea9eb80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | treemendous-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
eac3026cc3e15ee2e583705d9f3ea544a8604cd4843f2247c388837fa52ca1a4
|
|
BLAKE2b-256 checksum How to use checksums |
1d18bdbbf7a481fac36c9a424893fba317ccab91028ed2fc683a15cb7dce8b38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / treemendous-1.2.0-cp311-cp311-macosx_12_0_universal2.whl
| Download URL | treemendous-1.2.0-cp311-cp311-macosx_12_0_universal2.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
50e71e3e72654b70ee9f33dbb5c1d6f54217872699140e8eb71150acc75162f8
|
|
BLAKE2b-256 checksum How to use checksums |
3a0e405e637410d520e91157e1fc84e2b2189f57189ef7cc3b98d35cf5a87cc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency log