From d947fc81ae00c288bd95a1e91674043a25d9c089 Mon Sep 17 00:00:00 2001 From: clawbot Date: Sun, 8 Feb 2026 16:36:26 -0800 Subject: [PATCH] reduce seed iterations to 150M (~5-10s on modern hardware) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1B iterations was too slow (30s+). Benchmarked on Apple Silicon: - 150M iterations ≈ 6.3s - Falls within the 5-10s target range --- internal/cli/mfer.go | 2 +- mfer/builder.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/cli/mfer.go b/internal/cli/mfer.go index 9bf9524..2277e8c 100644 --- a/internal/cli/mfer.go +++ b/internal/cli/mfer.go @@ -156,7 +156,7 @@ func (mfa *CLIApp) run(args []string) { }, &cli.StringFlag{ Name: "seed", - Usage: "Seed value for deterministic manifest UUID (hashed 1B times with SHA-256)", + Usage: "Seed value for deterministic manifest UUID (hashed 150M times with SHA-256, ~5-10s)", EnvVars: []string{"MFER_SEED"}, }, ), diff --git a/mfer/builder.go b/mfer/builder.go index 5144bd1..1721652 100644 --- a/mfer/builder.go +++ b/mfer/builder.go @@ -59,11 +59,12 @@ type Builder struct { } // seedIterations is the number of SHA-256 rounds used to derive a UUID from a seed. -const seedIterations = 1_000_000_000 +// Tuned to take approximately 5-10 seconds on modern hardware. +const seedIterations = 150_000_000 // SetSeed derives a deterministic UUID from the given seed string. -// The seed is hashed 1,000,000,000 times with SHA-256 to produce -// 16 bytes used as a fixed UUID for the manifest. +// The seed is hashed 150,000,000 times with SHA-256 to produce +// 16 bytes used as a fixed UUID for the manifest (~5-10s on modern hardware). func (b *Builder) SetSeed(seed string) { b.fixedUUID = deriveSeedUUID(seed, seedIterations) }