{"slug": "show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda", "title": "Show HN: G6k-rs – lattice reduction framework for rust CPU,Metal,CUDA", "summary": "Oleksii Vasylenko released g6k-rs, a research-oriented Rust library for lattice reduction, enumeration, and sieving on CPUs, Apple Metal, and NVIDIA CUDA, available on GitHub. The library includes floating-point and arbitrary-precision reduction, exact invariant checks, deterministic examples, and optional GPU backends, but is experimental and not audited for production cryptographic use. The last locally observed default-platform run completed 1,813 tests with no failures.", "body_md": "`g6k-rs`\n\nis a research-oriented Rust library for lattice reduction,\nenumeration, and sieving on CPUs, Apple Metal, and NVIDIA CUDA.\n\nThe 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.\n\nThe quickest path uses only the portable floating-point feature set:\n\n```\ngit clone https://github.com/ovasylenko/g6k-rs.git\ncd g6k-rs\n./scripts/quickstart.sh\n```\n\nThe script runs a deterministic LLL/BKZ example and verifies its determinant invariant. The first build compiles dependencies and therefore takes longer than subsequent runs.\n\nAdd the crate to a Rust project with:\n\n```\n[dependencies]\ng6k-rs = \"0.1\"\njs\nuse g6k_rs::{LLLParams, LatticeBasis, lll_reduce};\n\nlet mut basis = LatticeBasis::from_rows(vec![\n    vec![1.0, 1.0],\n    vec![-1.0, 2.0],\n]);\nlll_reduce(&mut basis, &LLLParams::default()).unwrap();\n```\n\nThe default build enables arbitrary-precision support through the `mpz`\n\nfeature. Set `default-features = false`\n\nfor the floating-point API only.\n\n- Floating-point LLL, BKZ, deep insertion, slide reduction, and self-dual reduction.\n- Babai-style CVP, pruned enumeration, rerandomized enumeration, and pruning profile optimization.\n- BDGL, BGJ1, and HK3-style lattice sieves with deterministic CPU and parallel paths.\n- Arbitrary-precision lattice arithmetic and reduction through\n`rug`\n\n/GMP/MPFR. - Optional Metal and CUDA sieve, enumeration, and Seysen-conditioning paths.\n- Exact or independently recomputed checks for determinant preservation, coordinate reconstruction, integral output, and returned candidate norms.\n\nSee [the examples guide](/ovasylenko/g6k-rs/blob/main/docs/EXAMPLES.md) for task-oriented snippets and\n[project status](/ovasylenko/g6k-rs/blob/main/docs/STATUS.md) for maturity and limitations.\n\nThe name describes the project's goal: exploring a Rust implementation of the\nlattice-reduction and sieving problem space associated with the General Sieve\nKernel. It is not an official port, release, or drop-in replacement for\n[fplll/G6K](https://github.com/fplll/g6k).\n\n| Project | Primary interface | Focus |\n|---|---|---|\n`g6k-rs` |\nRust library | Rust APIs, exact checks, CPU/Metal/CUDA experiments |\n|\n\n[fplll](https://github.com/fplll/fplll)No claim is made that `g6k-rs`\n\nis faster, more complete, or a compatible\nreplacement. Read [PROVENANCE.md](/ovasylenko/g6k-rs/blob/main/docs/PROVENANCE.md) before redistributing or\nrelicensing the project.\n\n```\n# Portable floating-point build and tests\ncargo test --no-default-features\n\n# Default build, including arbitrary precision\ncargo test\n\n# Formatting and linting\ncargo fmt --check\ncargo clippy --all-targets -- -D warnings\n```\n\nThe 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.\n\n`metal-gpu`\n\n(macOS): Metal sieve kernels, GPU Seysen conditioning, and Metal-backed reduction entry points.`metal-fp16`\n\n: experimental half-precision database storage on top of`metal-gpu`\n\n.`cuda-gpu`\n\n(Linux/NVIDIA): CUDA sieve, enumeration, and Seysen kernels. The build requires`nvcc`\n\n; set`G6K_CUDA_ARCH`\n\nto the target architecture, such as`sm_89`\n\n.\n\nUse [the GPU testing guide](/ovasylenko/g6k-rs/blob/main/docs/TESTING_ON_GPU.md) for build and validation\ncommands. Hardware measurements and the rules for making performance claims\nlive in [BENCHMARKING.md](/ovasylenko/g6k-rs/blob/main/docs/BENCHMARKING.md).\n\n[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.\n\nLicensed under either the [Apache License 2.0](/ovasylenko/g6k-rs/blob/main/LICENSE-APACHE) or the\n[MIT License](/ovasylenko/g6k-rs/blob/main/LICENSE-MIT), at your option.\n\nMaintainer: [Oleksii Vasylenko](https://ovasylenko.com)\n(`hello@ovasylenko.com`\n\n).", "url": "https://wpnews.pro/news/show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda", "canonical_source": "https://github.com/ovasylenko/g6k-rs", "published_at": "2026-08-04 15:01:13+00:00", "updated_at": "2026-08-04 15:24:08.800677+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "ai-research", "ai-infrastructure", "developer-tools"], "entities": ["Oleksii Vasylenko", "g6k-rs", "Apple Metal", "NVIDIA CUDA", "fplll/G6K", "fplll", "Rust"], "alternates": {"html": "https://wpnews.pro/news/show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda", "markdown": "https://wpnews.pro/news/show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda.md", "text": "https://wpnews.pro/news/show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda.txt", "jsonld": "https://wpnews.pro/news/show-hn-g6k-rs-lattice-reduction-framework-for-rust-cpu-metal-cuda.jsonld"}}