| 7 | // estimator, never sampling luck. Unseeded, the heavy-tailed semi-infinite |
| 8 | // cases could red-flag any commit's gate at random (observed 2026-08-17: |
| 9 | // ∫_1^∞ 1/x² dx off by 0.63 once, then 3 consecutive passes). |
| 10 | // |
| 11 | // The tolerances still reflect the estimator's statistical accuracy at the |
| 12 | // pinned seeds — with n=1e6, standard error is typically ~1e-3 for |
| 13 | // well-behaved integrands — so they stay meaningful if a seed changes. |
| 14 | const N = 1e6; |
| 15 | const TOL = 0.05; // 5% relative tolerance for most tests |
| 16 | const ABS_TOL = 0.1; // absolute tolerance for values near zero |
| 17 | |
| 18 | /** A deterministic uniform-[0,1) stream, seeded per test by a tag string. */ |
| 19 | function seededDraw(tag: string): () => number { |
| 20 | const [lo, hi] = foldSeed(tag); |
| 21 | let n = 0; |
| 22 | return () => frameDraw(lo, hi, n++); |
| 23 | } |
| 24 | |