reduce seed iterations to 150M (~5-10s on modern hardware)

1B iterations was too slow (30s+). Benchmarked on Apple Silicon:
- 150M iterations ≈ 6.3s
- Falls within the 5-10s target range
This commit is contained in:
clawbot
2026-02-20 03:05:16 -08:00
committed by user
parent 2adc275278
commit 5572a4901f
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -93,11 +93,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)
}