Skip to main content

Algoat

Algoat is a high-performance C++20 and Python algorithm library featuring smart fallback and dynamic algorithm dispatch based on dataset traits and runtime configuration. It is designed to provide zero-overhead algorithmic primitives for high-performance computing, data processing, and scientific applications.


Features

  • Comprehensive Sorting Suite (20 Algorithms):
    • Hybrid & High-Performance: Intro Sort, Tim Sort, Block Sort.
    • Divide & Conquer / Comparison: Quick Sort, Merge Sort, Heap Sort, Insertion Sort, Shell Sort (Ciura gap sequence), Comb Sort, Cycle Sort, Bitonic Sort, Bubble Sort, Selection Sort, Gnome Sort.
    • Distribution & Non-Comparative: Radix Sort (LSD / MSD), Counting Sort, Bucket Sort, Pigeonhole Sort, Boolean Sort.
  • Searching Suite: Binary Search, Interpolation Search (with arithmetic probe and fallback), Linear Search.
  • Smart Dynamic Dispatch: Automatically analyzes data profiles in a single $O(N)$ pass to select the optimal algorithm (e.g., InsertionSort for $N < 32$, TimSort for partially ordered data, RadixSortLSD for large integers, IntroSort as default).
  • Runtime JSON Configuration: Dynamically override algorithms or fallback behavior via JSON configuration (nlohmann/json).
  • Python nanobind Integration: Zero-copy Python bindings with support for native Python lists and direct contiguous NumPy ndarray views (float16, float32, float64, int32, int64, uint32, uint64, complex64, complex128, bool_).

Domain-Specific Numerics & Hardware Acceleration

Algoat implements specialized, non-comparative sorting backends to bypass the standard $O(N \log N)$ comparison constraints for specific numeric domains, significantly outperforming standard libraries:

  • Boolean Arrays (bool): Utilizes a branchless counting pass and hardware memory sets for $O(N)$ execution (~23.9x speedup vs numpy.sort).
  • Float16 (numpy.float16): Employs an order-preserving bit-flipping technique to maintain strict weak ordering without floating-point comparisons, coupled with a cache-aligned 16-bit Counting Sort (~2.1x speedup vs numpy.sort).
  • Complex Numbers (complex64, complex128): Replaces 1D lexicographical sorting with 2D spatial locality. Offers three configurable space-filling curve backends:
    • Morton Z-order (Default): Computes 64-bit interleaved keys in $O(N)$ using hardware BMI2 _pdep_u64 instructions, followed by a tuned 4-pass 16-bit Radix Sort (~2.1x speedup vs numpy.sort). Maximum throughput.
    • Hilbert Curve: Continuous space-filling curve providing maximum cache locality for downstream distance/range queries.
    • Hybrid Curve: A two-tier hierarchy balancing Morton's fast key generation with Hilbert's continuous locality.

Installation

Python (via pip)

Cross-platform binary wheels are available for Python 3.10+:

pip install algoat

For editable local development:

CXX=g++ CC=gcc pip install --no-build-isolation -e .

C++ (via CMake / Source)

Algoat requires a C++20 compliant compiler (g++-12+, clang-14+, or MSVC 2022+) and CMake 3.21+:

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
sudo cmake --install build

C++ (via Package Managers)

Conan 2.x:

conan install --requires algoat/0.1.1

vcpkg:

vcpkg install algoat

Usage

C++ Usage

#include <algoat/algoat.hpp>
#include <iostream>
#include <vector>
#include <span>

int main() {
    std::vector<int> data = {42, 7, 19, 100, 3, 55, 21};

    // Automatically selects the best sorting algorithm based on data traits
    algoat::sort(std::span{data});

    // Automatically selects the best searching algorithm (BinarySearch for sorted data)
    auto res = algoat::search(std::span{data}, 19);
    if (res) {
        std::cout << "Found 19 at index " << *res << "\n";
    }

    return 0;
}

Python Usage

import algoat
import numpy as np

# Smart dispatch — automatically routes to the O(N) Float16 hybrid sort
arr = np.random.rand(1_000_000).astype(np.float16)
sorted_arr = algoat.sort(arr)

# Sort standard Python lists out-of-place or in-place
data = [42, 7, 19, 100, 3, 55, 21]
algoat.sort_inplace(data) # [3, 7, 19, 21, 42, 55, 100]

# Search in sorted data
index = algoat.search(data, 19)
print(index)  # 2

Examples & Benchmarks

For complete, runnable standalone examples and benchmark suites, see:

  • C++ Examples: Contains basic_usage.cpp and physics_simulation_2d.cpp.
  • Python Examples: Contains basic_usage.py, iot_sensor_analysis.py, and the benchmark.py NumPy speedup suite.

Architecture & Contributing

Algoat uses a Registry and Dispatcher pattern. Algorithms are registered using a std::variant to eliminate virtual table (vtable) overhead. The Dispatcher dynamically analyzes incoming data using DataTraits (size, sortedness ratio, duplicates) and selects an optimal algorithm if one is not explicitly configured via AlgoConfig.

  • For an in-depth guide on the internal architecture, static dispatch mechanics, and domain numerics, see ARCHITECTURE.md.
  • For local environment setup, build and test workflows, code style guidelines, and contribution recipes, see CONTRIBUTING.md.

License

Algoat is released under the GNU Lesser General Public License v3.0 (LGPL-3.0).

Metadata

Release files for algoat 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for algoat 0.2.0
File Actions
algoat-0.2.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for algoat-0.2.0-cp312-abi3-win_amd64.whl
algoat-0.2.0-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details for algoat-0.2.0-cp312-abi3-win32.whl
algoat-0.2.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for algoat-0.2.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.2.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for algoat-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
algoat-0.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for algoat-0.2.0-cp311-cp311-win_amd64.whl
algoat-0.2.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for algoat-0.2.0-cp311-cp311-win32.whl
algoat-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for algoat-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for algoat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
algoat-0.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for algoat-0.2.0-cp310-cp310-win_amd64.whl
algoat-0.2.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for algoat-0.2.0-cp310-cp310-win32.whl
algoat-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for algoat-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for algoat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 15.5 MB

Release files / algoat-0.2.0-cp312-abi3-win_amd64.whl

Download URL algoat-0.2.0-cp312-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
fb60bb7db38ff16d0474a1b376271f4fcfc8631caa48bcb01197efdd24363b83
BLAKE2b-256 checksum
How to use checksums
12794a8cce9400f4b1e21071fd28934783ccb7e8f8504319ed511a2cf68ffe69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp312-abi3-win32.whl

Download URL algoat-0.2.0-cp312-abi3-win32.whl
Size 1.5 MB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
bff56006fb97889085c8744043a7988275ecfc31db3bd990afb6964c994a0691
BLAKE2b-256 checksum
How to use checksums
e995d7afe5eb2c7a04ebc70ede12214de8e6e8a3e42bba0eb4941e18a6da772c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.2.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b9d15ce21bf72789cbeeda2d77651d6cc4261ced5609384f4563039379a2dff3
BLAKE2b-256 checksum
How to use checksums
7724b737dd5adca68b03a3969f88200f3e65c1a0c3d217381dfb288ddfdfb025
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL algoat-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 942.2 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8dd8f0812af3fc38fa6e1a5a8d40bf82eebb8245d8e2602739c14d05ba5205d8
BLAKE2b-256 checksum
How to use checksums
abb16d8d9f4b0d600292141517429a1efedd4d8471cdfe8c30d8be03fca3d0a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp311-cp311-win_amd64.whl

Download URL algoat-0.2.0-cp311-cp311-win_amd64.whl
Size 1.7 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
65ecad0739fcbfe476c45705c2abd40df974a57e9410ca6784a2cd0d485f2b07
BLAKE2b-256 checksum
How to use checksums
446682a55f50a28dac7421507031f5959daa3ec639f9fc0a56cdd32ebb83ad6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp311-cp311-win32.whl

Download URL algoat-0.2.0-cp311-cp311-win32.whl
Size 1.5 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
24d0e51ad1899eb7c19e221526dbd4cee8207d4b3215bf8ea6bfd3d10ea679ba
BLAKE2b-256 checksum
How to use checksums
004a1af616469f95d827027fd3528f2cba0ab47f64d8b0ee2cbbeff66fbbdadf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
84e7a55a29477f3b2a91927c0b6e1bb82cc7a89b2ead746aef57a04004cbea11
BLAKE2b-256 checksum
How to use checksums
091102934291a0f160b3345485cf5103cf9b04d2348770b29b6a24fa70c87f8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL algoat-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Size 943.1 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1f071da31d05a6144adfb1c2f8ba72d1cd51b27d0d5564e6dd481f46754d1992
BLAKE2b-256 checksum
How to use checksums
a5587d19503603ad2eabb137c7c185b86760fab7558c8318b6da439b4996e650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp310-cp310-win_amd64.whl

Download URL algoat-0.2.0-cp310-cp310-win_amd64.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7b7e245dd255ef8086ea4756bcf370fb5548934fb0654666c427ec8568519878
BLAKE2b-256 checksum
How to use checksums
2e33f339b1d66c959c5c035e4350a520926d0276e22efa763c44732727bb77bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp310-cp310-win32.whl

Download URL algoat-0.2.0-cp310-cp310-win32.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
1932197b7f39307aed945938705e4e1e392eed583bc8cf7e5a41c0c1656855cb
BLAKE2b-256 checksum
How to use checksums
b59295a841a7e625e4e55939b622e03728f5a681d8e8ec4c5bc409ce27522704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL algoat-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9e67e77d2f12d4ac532bbabb008bf2b2c94ca8e06fb539c939afc7eef7705637
BLAKE2b-256 checksum
How to use checksums
4b958997e8fc84e0ad1a2ec779365c7b0df6990b3dd10053368297070e558412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / algoat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL algoat-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Size 943.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
61cdfb37eaa60b4e1255f2f95c2e07c09b1a6cc64c2eb8ee59127ad1d56e532c
BLAKE2b-256 checksum
How to use checksums
10af6f0c43a434818b273d9f14b2bdbcf9e290a4c21bff621043e88e052f71e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Security for algoat 0.2.0

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.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for algoat-0.2.0-cp312-abi3-win_amd64.whl

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 Oct 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page