cuscan
cuscan 0.1.0 provides non-parametric UMAP dimensionality reduction and HDBSCAN clustering in Rust and Python. UMAP defaults to recursive initialization (host graph coarsening with Adam layouts at coarse levels) followed by an Adam layout, with umap-learn 0.6-style random or spectral initialization and rescaling, compatibility SGD, and momentum layouts also available; it does not implement all 0.6 features or promise bit parity. 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.
UMAP fit defaults to init="auto", which resolves to recursive initialization for every optimizer, including compatibility: host graph coarsening with CPU or CUDA Adam layouts at coarse levels. Rescaling defaults to init_rescale="isotropic" with init_scale_factor=1.0; "per_axis" and "graph_edge" are also available. init="spectral" and init="random" remain available. Python accepts recursive_coarsening_ratio (2, 3, or 4) and recursive_init_kwds with base_init_threshold, n_embedding_epochs, hub_selection, or anchor_sample_size. These controls do not affect transform initialization. cuscan does not promise bit parity with umap-learn; see Standard UMAP.
UMAP defaults to optimizer="adam", so a default model also transforms with Adam. Pass optimizer="compatibility", init="spectral" to get the previous defaults (classic SGD after spectral initialization). "adam" and "momentum" use source-only modern layouts for fit and transform. When the fitted reference row count (after unique=True) exceeds negative_selection_range (default 200000), layouts with more than 1024 source rows draw negatives from per-epoch random-projection windows; smaller layouts, including small transform batches, sample globally with scale 1. exclude_graph_neighbors=False controls whether graph neighbors are excluded from negatives. negative_sample_scale_adaptation_samples=128 adapts the scale during Adam fits only (0 disables); momentum and transform keep the initial scale. negative_sample_scale=None resolves the automatic scale; an explicit finite nonnegative scale is used as given (0 stays 0). Saved models retain these fit-time settings. Measured quality and performance results, and the items still open, are recorded in the Standard UMAP notes and the Phase 5 and Phase 6 gap reports; full-seed quality is not claimed. Known limitation: transform quality trails upstream umap-learn; closing that gap is Phase 7 work (see the Phase 6 gap report, item N4).
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.
UMAP uses strict schema version 5 and rejects older UMAP files; retrain and save them in the new format. HDBSCAN predictor files remain version 1. 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
- McInnes, Healy and Melville, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction (2018).
- Campello, Moulavi and Sander, Density-Based Clustering Based on Hierarchical Density Estimates (2013).
- The external comparison reference is fast_hdbscan, pinned to
fast-hdbscan==0.3.2; it is distinct from cuscan. - Burn and CubeCL by Tracel AI provide the tensor and compute frameworks used by this project.
- Historical predecessor: Eugene Hauptmann, fast-umap: UMAP in Rust (v1.6.0).
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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cuscan-0.1.4.tar.gz | 3.4 MB | With provenance | Details for cuscan-0.1.4.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cuscan-0.1.4-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details for cuscan-0.1.4-cp312-abi3-win_amd64.whl |
| cuscan-0.1.4-cp312-abi3-manylinux_2_34_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ x86-64 | Details for cuscan-0.1.4-cp312-abi3-manylinux_2_34_x86_64.whl |
Total release size: 98.5 MB
Release files / cuscan-0.1.4.tar.gz
| Download URL | cuscan-0.1.4.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c0d1b5c15fb1486b376c56ac941d233a7618516923e67a2335ceebfc5ded3d0
|
|
BLAKE2b-256 checksum How to use checksums |
06254b5f1eb3916881ddb1a78f15e7f5f9ac77b5c66f17d67fa61404320897e3
|
| 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 Dec 1, 2026.
Transparency logRelease files / cuscan-0.1.4-cp312-abi3-win_amd64.whl
| Download URL | cuscan-0.1.4-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 43.9 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a346832d9f0ec374ba3e27edaae0e66dac9a2bd8c00dd5b1fbfc278730b310b0
|
|
BLAKE2b-256 checksum How to use checksums |
0d475aa2dbfa6370de3790d7d12ee092f3804b84665d9b353ea9c57e0fb8107f
|
| 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 Dec 1, 2026.
Transparency logRelease files / cuscan-0.1.4-cp312-abi3-manylinux_2_34_x86_64.whl
| Download URL | cuscan-0.1.4-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 |
61b72906e8e2f6626488675fc6b52f47f847d0fdb7c32fb8fc6a310f268fa2a0
|
|
BLAKE2b-256 checksum How to use checksums |
f94078d2ee2752c37933d131ec86c883caad92f3e0878a6ffc2950bea2cc124e
|
| 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 Dec 1, 2026.
Transparency logSecurity for cuscan 0.1.4
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.
Attestation for cuscan-0.1.4.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 Dec 1, 2026.
Transparency logA 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.