Skip to content

SuperInstance/eisenstein-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

eisenstein-bench

CLI benchmark suite for Eisenstein hexagonal arithmetic.

Compares E12 exact integer arithmetic vs IEEE 754 float drift for hexagonal lattice operations.

Install

cargo install --git https://github.com/SuperInstance/eisenstein-bench

Commands

eisenstein-bench drift [--rotations N]    — Rotate N times, compare E12 vs float drift
eisenstein-bench disk [--radius N]        — Benchmark HexDisk iteration at radius N
eisenstein-bench snap [--iterations N]    — Benchmark angle snapping throughput
eisenstein-bench norm [--iterations N]    — Benchmark norm vs float hypot
eisenstein-bench full [--json]            — Run all, print summary table

Defaults

Parameter Default
--rotations 10,000
--radius 1,000
--iterations 100,000

Example Output

$ eisenstein-bench full
┌────────────────┬──────────────┬──────────────────────────────────────────┐
│ Benchmark      │ Time         │ Detail                                   │
├────────────────┼──────────────┼──────────────────────────────────────────┤
│ drift (rotate) │          0µs │ 10,000 rotations of (5,0)                │
│ drift (float)  │         19µs │ drift: 0.000000000000002                 │
│ disk           │        5.5ms │ radius=1,000, 3,003,001 pts              │
│ snap           │       32.6ms │ 100,000 calls                            │
│ norm           │        110µs │ 100,000 calls, sum=1,092,277,422         │
└────────────────┴──────────────┴──────────────────────────────────────────┘
  drift (rotate) — ✅ ZERO DRIFT
  drift (float) — drift: 0.000000000000002
  disk — 3,003,001 pts in 5.5ms
  snap — 326 ns/call
  norm — 1 ns/call

Why E12?

Eisenstein integers (a + bω where ω = e^(2πi/3)) provide exact arithmetic on the hexagonal lattice. No floating-point drift, ever. The norm a²-ab+b² is always an integer, and all D6 symmetry operations are exact.

Float rotation accumulates error with each operation. E12 does not.

License

MIT

About

CLI benchmark suite for Eisenstein hexagonal arithmetic

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages