Reproducible g6k-rs LLL Benchmark
Compare two LLL settings on one fixed basis, with raw timings, input rows, basis quality, and exact lattice checks.
On an Apple M3 Max with 36 GB of memory, we ran the CPU implementation on a fixed 16-dimensional integer basis. The source commit and dependency lockfile are pinned. The basis uses rows and is upper triangular with exactly known covolume 746,496,000.
Measured results
| δ | η | Median (µs) | First squared norm | Swaps | Size reductions |
|---|---|---|---|---|---|
| 0.75 | 0.501 | 11.79 | 4 | 230 | 3108 |
| 0.99 | 0.501 | 15.54 | 4 | 326 | 3912 |
Each setting has 10 warm-up runs and 31 timed runs. The timing covers the reduction call alone. A fresh copy of the input is prepared before each run. Both settings pass the library’s reduced-basis check. Exact integer membership and determinant checks verify that the result generates the original lattice.
This measures a single synthetic basis. Timing depends on the hardware and workload. Compare the first-vector norm and the full row-length profile in the results before generalizing about output quality.
Compare LLL and BKZ on the same basis
Both fplll 5.5.0 runs start from the 16-dimensional basis above, with δ = 0.99. BKZ includes its initial LLL step and uses block size 8. The median is over 31 fresh runs after three warm-ups on arm64 macOS 26.3.1. These times include process launch, input, and output, so small differences give little evidence about the reducers’ computation times.
| Reducer | Median (ms) | First-vector norm | Gram–Schmidt norms, in basis order |
|---|---|---|---|
| LLL | 51.849 | 2 | 2, 3.3166, 3.4902, 3.9304, 3.5411, 3.4035, 3.474, 3.4641, 3.5136, 3.5678, 3.7659, 4.4202, 4.1921, 4.038, 3.9013, 4.1045 |
| BKZ-8 | 52.059 | 2 | 2, 3.3166, 3.4902, 3.5848, 3.7507, 3.6443, 3.5395, 3.2869, 3.5136, 3.5678, 3.7659, 4.4202, 4.1921, 4.038, 3.9013, 4.1045 |
The first-vector lengths agree while several middle Gram–Schmidt lengths differ. Exact row membership and squared covolume checks confirm both outputs generate the input lattice. LLL gives an approximation guarantee for the first vector. BKZ applies local reduction conditions to projected blocks. The measured profile and timings describe this basis and these settings. LLL guarantees · BKZ block conditions.
To repeat the comparison, install fplll, save the Python runner next to the basis fixture, and run python lll-bkz-comparison.py. Download the measured output.
Reproduce the run
- Check out the measured g6k-rs commit.
- Copy the lockfile to
Cargo.lockand the Rust benchmark toexamples/lattices_reference_benchmark.rs. - Run the command below and compare the integer checks, basis quality, and timings with the original machine-readable results.
cargo run --locked --release --no-default-features --example lattices_reference_benchmarkSee the LLL quality guarantees for the mathematical bounds and the algorithm map for when a stronger reducer is useful.