Skip to main content

cuscan

cuscan 0.1.0 provides non-parametric UMAP dimensionality reduction and HDBSCAN clustering in Rust and Python. UMAP follows umap-learn 0.5.12 semantics. The implementation uses Burn and CubeCL for CPU and CUDA execution.

Local build

The documented local target is Linux x86-64, including WSL2. Python 3.12+, uv and Maturin are required. rust-toolchain.toml pins nightly-2026-08-08 (rustc 1a98b1e13), and the x86-64 Linux Cargo configuration requires /usr/sbin/clang and mold and enables nightly flags. From the repository root:

uv sync
uv run maturin develop --release

Use uv run --no-sync for subsequent scripts or tests so syncing does not replace the locally built extension. The CubeCL LLVM bundle/build/JIT path can require network access, cache space and LLVM support. CPU and CUDA are both compiled; CUDA execution requires a working NVIDIA runtime and device. Compilation alone does not initialize CUDA.

Wheel validation

The lowest validated Linux x86-64 wheel baseline is manylinux 2.34. The manylinux 2.28 image fails to build because tracel-llvm-23.1.0-4's llvm-config requires GLIBC 2.32, 2.33 and 2.34.

Python

import numpy as np
from cuscan import HDBSCAN, UMAP

X = np.random.default_rng(42).normal(size=(100, 10)).astype(np.float32)
mapper = UMAP(n_neighbors=15, random_state=42, backend="cpu")
embedding = mapper.fit_transform(X)
projected = mapper.transform(X[:5])

clusterer = HDBSCAN(min_cluster_size=5, backend="cpu").fit(X)
labels = clusterer.labels_
new_labels, strengths = clusterer.approximate_predict(X[:5])

Both estimators accept backend="auto", "cpu", or "cuda". Auto prefers a discovered usable CUDA device and selects CPU only when CUDA is unavailable. Explicit choices are strict; execution errors do not trigger fallback.

Fitted-model serialization

Install the optional HDF5 dependencies locally with uv sync --extra serialization, then rebuild with uv run maturin develop --release. The extra supplies h5py and hdf5plugin; ordinary fitting does not require them.

mapper.save("umap.h5")
restored = UMAP.load("umap.h5", backend="cpu")
projected = restored.transform(X[:5])

predictor = clusterer.to_predictor()
predictor.save("predictor.h5")

UMAP saves fitted state; HDBSCAN serialization is for HDBSCANPredictor, not the fitted estimator or its fit outputs. Load a predictor with HDBSCANPredictor.load(path, backend="auto", device_index=0). Backend and device are chosen at load time. save refuses to overwrite by default; overwrite=True explicitly replaces a file. Publication flushes a same-directory temporary file and commits atomically. On POSIX, a post-commit directory-sync failure reports uncertain durability. Windows flushes file data but does not guarantee directory-entry durability across a crash.

Files use a versioned HDF5 schema and lossless Blosc2 Zstandard compression, not pickle. External HDF5 readers need the Blosc2 filter plugin (ID 32026). Files contain training data or geometry and derived model state; protect them like the original data. Schema validation and compression do not authenticate files. Rust does not provide an HDF5 persistence API. Serialized numeric state does not guarantee identical execution across hardware, software versions or backends.

The cuscan_fitted_model format rejects older model files; retrain and save them in the new format. There are no compatibility aliases for prior imports, crates or environment variables.

Rust

The workspace exposes the umap and hdbscan facades. Build and test them locally:

cargo build --release -p umap -p hdbscan
cargo test -p umap
cargo test -p hdbscan

See development and analysis for Rust API examples, detailed backend behavior, profiling, comparisons, serialization benchmarks and testing guidance. Historical benchmark measurements there are not cuscan rebenchmarks.

The CI and release guidance describes the intended ci-ok gate, local act, independent CUDA validation, trusted publishing and the maintainer's settings checklist.

Releases use one reviewed Release Please PR and a shared Cargo/Python version. Squash PRs with Conventional Commit titles (feat:, fix:, or feat!: for a breaking change). Before 1.0, breaking changes bump minor. Merging the release PR creates the public GitHub release first; PyPI artifacts arrive only after the separate cold-build publishing workflow succeeds. A GitHub release alone is not proof of publication. See the activation checklist.

Unmodified engineering reports are retained under archive/engineering/; its index.json maps original paths to archived files and records their content hashes. Their commands, identities and source paths describe historical revisions, not the current checkout.

References and acknowledgements

License

The project is declared MIT; see LICENSE for the retained legal notice. THIRD_PARTY_NOTICES contains scoped upstream notices and provenance limitations. Upstream provenance and bundled-native notices require review separately from the project's maintainer identity; see migration_provenance.json for unresolved questions.

Metadata

Release files for cuscan 0.1.1

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

Source distribution (sdist)

Source distribution for cuscan 0.1.1
File Size Uploaded Provenance Actions
cuscan-0.1.1.tar.gz 2.2 MB With provenance Details for cuscan-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cuscan 0.1.1
File Interpreter ABI Platform Actions
cuscan-0.1.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for cuscan-0.1.1-cp312-abi3-win_amd64.whl
cuscan-0.1.1-cp312-abi3-manylinux_2_34_x86_64.whl CPython 3.12 abi3 Linux glibc 2.34+ x86-64 Details for cuscan-0.1.1-cp312-abi3-manylinux_2_34_x86_64.whl

Total release size: 97.2 MB

Release files / cuscan-0.1.1.tar.gz

Download URL cuscan-0.1.1.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
0f8830697dee4e94513ccc7764038424210a54f0e8a5dca63d0b215dddef4b40
BLAKE2b-256 checksum
How to use checksums
84a409a1848f158f8edca48592d067a98638a04aa2e74615a23fc9268424b85a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

Transparency log

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

Download URL cuscan-0.1.1-cp312-abi3-win_amd64.whl
Size 43.8 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e09dac615896f346fc3c61132d165841cb2d41760e6f940d449c40e792c74d49
BLAKE2b-256 checksum
How to use checksums
30aa79442b0d19fe30fedc9810b387784bc0423da71aa664c747f8fedaeaafb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

Transparency log

Release files / cuscan-0.1.1-cp312-abi3-manylinux_2_34_x86_64.whl

Download URL cuscan-0.1.1-cp312-abi3-manylinux_2_34_x86_64.whl
Size 51.2 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
d8466509a9321e8d08fca0011124b2e9def8b98a49cace3b6003e175e549d19e
BLAKE2b-256 checksum
How to use checksums
950d9cbf3c5a07a83da073c8b0304339f2473cb9496764be77ed7ea8a3863b2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

Transparency log

Security for cuscan 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 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for cuscan-0.1.1.tar.gz

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 Nov 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