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. Computes 64-bit Morton Z-order 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).

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

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.1.1
File Actions
algoat-0.1.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for algoat-0.1.1-cp312-abi3-win_amd64.whl
algoat-0.1.1-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details for algoat-0.1.1-cp312-abi3-win32.whl
algoat-0.1.1-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.1.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for algoat-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
algoat-0.1.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for algoat-0.1.1-cp311-cp311-win_amd64.whl
algoat-0.1.1-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for algoat-0.1.1-cp311-cp311-win32.whl
algoat-0.1.1-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.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for algoat-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
algoat-0.1.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for algoat-0.1.1-cp310-cp310-win_amd64.whl
algoat-0.1.1-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for algoat-0.1.1-cp310-cp310-win32.whl
algoat-0.1.1-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.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
algoat-0.1.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for algoat-0.1.1-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 12.9 MB

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

Download URL algoat-0.1.1-cp312-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c2bb88c7e427ba898abc3def212de0a92572631abbd07a949be9eea6839a7bf7
BLAKE2b-256 checksum
How to use checksums
f08cdf1a01fdd8ad3b19b3a3b188d1bd7e7240026ac0fac99e28c27605b7c983
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp312-abi3-win32.whl
Size 1.2 MB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
2938eb0344e52aab8e4972340d41e9baf027c516fbd0b27c51d51364eb382179
BLAKE2b-256 checksum
How to use checksums
18225d724f73395b3503bfe57f2c9b8367a6d10eca05bd979ac2272c38d6e4b8
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 897.7 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d9172de94ce38c09fc0f5676c95a06379bd191198fdc8c1d05acd602e0437b98
BLAKE2b-256 checksum
How to use checksums
03d2eefa5e4d1f9e7712faf9597d5a7ef178b98945676ffcf83d6b73fd5e4c81
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
Size 860.9 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4ec8440d47f80a91d34943a4bcff4aab9bb51330840e52ca25e017ff53aea8a2
BLAKE2b-256 checksum
How to use checksums
c320def94245daf5ed4531245309166c14750c6e06b06f210d61dc24b7870593
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp311-cp311-win_amd64.whl
Size 1.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
44265fc83dcb301c3fe3a46f7da8dd2aa6a7f4a9f5161319cb67bffef8f3cc5c
BLAKE2b-256 checksum
How to use checksums
052c6be0049e4aa969bc539e2ac46b729889034544dd20bf2d4117f287a55a33
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp311-cp311-win32.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
97f4157e166c00a0204556b4f1287c95c6d8f133ff0dfb4805409396f02e0ca4
BLAKE2b-256 checksum
How to use checksums
389f6b94c2263284e73dcd3a6c410dcf8ef23de48d3d94af2ce2ec040701ab5c
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 898.5 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c07368487e2c1aa30157a561328066eeab12f3f242c4025312188006b1259226
BLAKE2b-256 checksum
How to use checksums
ab4c892da00fe08daadb4c6b0b27b763c0b814ee95fb0106f3383fa5af496215
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Size 861.8 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5320bd1550d01b01cca28af1b46100ceba4e79db59b63f587b0cba664b55ebdf
BLAKE2b-256 checksum
How to use checksums
45ff9382027325f403b57b8fb4b862a488ac2b3da4aa98babb7a6fccd15b13df
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp310-cp310-win_amd64.whl
Size 1.3 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b734c36cfff86ceab3dcb3375f830285b9c0fc73edb1ca71c625b6f51bc6a564
BLAKE2b-256 checksum
How to use checksums
2f114c2c2d72c616de420c4559743bbb21cbbec7d7ac10d44327e6e14f0ab6aa
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp310-cp310-win32.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
d8b1fe8bcf1d4a23cfd425ba54e4d6d9d33b94828dd7e981e6abbc71450e1c80
BLAKE2b-256 checksum
How to use checksums
82504c6cc7ccef406fd022867325293f5c5933312cfd90db73712a165617da92
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 898.8 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
118d3d43354a503b7d8a71345c1339587db0967f61e31495604b7d0820700a92
BLAKE2b-256 checksum
How to use checksums
6b0d1a276578db6d4378aff7bc7a98ecd39e5ac126b6b71d5e0906584602babd
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 Sep 3, 2026.

Transparency log

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

Download URL algoat-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Size 862.0 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c0f0fa48f4787f3f9f1c6ffe383afa2159a9144f1d633aa013be62b485fb8848
BLAKE2b-256 checksum
How to use checksums
cb02e905b568e710563f77e2c9567e15af6b8a598cdbee3da5cb39cb3a44458f
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 Sep 3, 2026.

Transparency log

Security for algoat 0.1.1

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.1.1-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 Sep 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