# Show HN: G6k-rs – lattice reduction framework for rust CPU,Metal,CUDA

> Source: <https://github.com/ovasylenko/g6k-rs>
> Published: 2026-08-04 15:01:13+00:00

`g6k-rs`

is a research-oriented Rust library for lattice reduction,
enumeration, and sieving on CPUs, Apple Metal, and NVIDIA CUDA.

The crate includes floating-point and arbitrary-precision reduction, exact invariant checks, deterministic examples, and optional GPU backends. It is an experimental implementation: APIs may change, and it has not been audited for use in production cryptographic systems.

The quickest path uses only the portable floating-point feature set:

```
git clone https://github.com/ovasylenko/g6k-rs.git
cd g6k-rs
./scripts/quickstart.sh
```

The script runs a deterministic LLL/BKZ example and verifies its determinant invariant. The first build compiles dependencies and therefore takes longer than subsequent runs.

Add the crate to a Rust project with:

```
[dependencies]
g6k-rs = "0.1"
js
use g6k_rs::{LLLParams, LatticeBasis, lll_reduce};

let mut basis = LatticeBasis::from_rows(vec![
    vec![1.0, 1.0],
    vec![-1.0, 2.0],
]);
lll_reduce(&mut basis, &LLLParams::default()).unwrap();
```

The default build enables arbitrary-precision support through the `mpz`

feature. Set `default-features = false`

for the floating-point API only.

- Floating-point LLL, BKZ, deep insertion, slide reduction, and self-dual reduction.
- Babai-style CVP, pruned enumeration, rerandomized enumeration, and pruning profile optimization.
- BDGL, BGJ1, and HK3-style lattice sieves with deterministic CPU and parallel paths.
- Arbitrary-precision lattice arithmetic and reduction through
`rug`

/GMP/MPFR. - Optional Metal and CUDA sieve, enumeration, and Seysen-conditioning paths.
- Exact or independently recomputed checks for determinant preservation, coordinate reconstruction, integral output, and returned candidate norms.

See [the examples guide](/ovasylenko/g6k-rs/blob/main/docs/EXAMPLES.md) for task-oriented snippets and
[project status](/ovasylenko/g6k-rs/blob/main/docs/STATUS.md) for maturity and limitations.

The name describes the project's goal: exploring a Rust implementation of the
lattice-reduction and sieving problem space associated with the General Sieve
Kernel. It is not an official port, release, or drop-in replacement for
[fplll/G6K](https://github.com/fplll/g6k).

| Project | Primary interface | Focus |
|---|---|---|
`g6k-rs` |
Rust library | Rust APIs, exact checks, CPU/Metal/CUDA experiments |
|

[fplll](https://github.com/fplll/fplll)No claim is made that `g6k-rs`

is faster, more complete, or a compatible
replacement. Read [PROVENANCE.md](/ovasylenko/g6k-rs/blob/main/docs/PROVENANCE.md) before redistributing or
relicensing the project.

```
# Portable floating-point build and tests
cargo test --no-default-features

# Default build, including arbitrary precision
cargo test

# Formatting and linting
cargo fmt --check
cargo clippy --all-targets -- -D warnings
```

The last locally observed default-platform run completed 1,813 tests with no failures; ignored tests include slow probes and hardware-dependent paths. That number is a development reference, not a substitute for the current CI result. GPU tests require the corresponding feature, toolchain, and device.

`metal-gpu`

(macOS): Metal sieve kernels, GPU Seysen conditioning, and Metal-backed reduction entry points.`metal-fp16`

: experimental half-precision database storage on top of`metal-gpu`

.`cuda-gpu`

(Linux/NVIDIA): CUDA sieve, enumeration, and Seysen kernels. The build requires`nvcc`

; set`G6K_CUDA_ARCH`

to the target architecture, such as`sm_89`

.

Use [the GPU testing guide](/ovasylenko/g6k-rs/blob/main/docs/TESTING_ON_GPU.md) for build and validation
commands. Hardware measurements and the rules for making performance claims
live in [BENCHMARKING.md](/ovasylenko/g6k-rs/blob/main/docs/BENCHMARKING.md).

[Examples](/ovasylenko/g6k-rs/blob/main/docs/EXAMPLES.md)— how to use each major workflow.[Status and limitations](/ovasylenko/g6k-rs/blob/main/docs/STATUS.md)— what is stable, experimental, or hardware-dependent.[Benchmarking](/ovasylenko/g6k-rs/blob/main/docs/BENCHMARKING.md)— reproducible commands and historical measurements.[Provenance](/ovasylenko/g6k-rs/blob/main/docs/PROVENANCE.md)— independent-authorship statement, research sources, and contribution policy.[Algorithm and paper map](/ovasylenko/g6k-rs/blob/main/docs/LATTICE_REDUCTION_2026_PAPERS.md)— fidelity notes for research modules.[Contributing](/ovasylenko/g6k-rs/blob/main/CONTRIBUTING.md)— required checks and evidence standards.

Licensed under either the [Apache License 2.0](/ovasylenko/g6k-rs/blob/main/LICENSE-APACHE) or the
[MIT License](/ovasylenko/g6k-rs/blob/main/LICENSE-MIT), at your option.

Maintainer: [Oleksii Vasylenko](https://ovasylenko.com)
(`hello@ovasylenko.com`

).
