affaan-m/ECC · error

seed count exceeds 10000

Error message

seed count exceeds 10000

What it means

`evaluate_paired` runs a paired evaluation over an explicit list of u64 seeds, producing one `PairedSample` per seed. The library caps the seed list at 10,000 entries to bound memory and runtime of the evaluation. Passing more than 10,000 seeds causes this bail before any evaluation runs.

Solutions

  1. Trim or sample the seed list to at most 10,000 entries before calling `evaluate_paired`
  2. Split the evaluation into chunks of <= 10,000 seeds and aggregate the resulting `PairedSample` vectors
  3. Generate seeds deterministically with a smaller count, e.g. `(0..10_000).collect()`

Example fix

// before
let seeds: Vec<u64> = (0..50_000).collect();
let samples = evaluate_paired(&evaluator, &seeds)?;
// after
let seeds: Vec<u64> = (0..10_000).collect();
let samples = evaluate_paired(&evaluator, &seeds)?;
// or chunk:
for chunk in all_seeds.chunks(10_000) {
    samples.extend(evaluate_paired(&evaluator, chunk)?);
}
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_seed_count_ok(seeds: &[u64]) -> Result<(), String> {
    if seeds.len() > 10_000 {
        return Err(format!("{} seeds exceeds the 10,000 limit", seeds.len()));
    }
    Ok(())
}

Type guard

fn is_valid_seed_slice(seeds: &[u64]) -> bool {
    !seeds.is_empty() && seeds.len() <= 10_000
}

Try / catch

match evaluate_paired(&evaluator, &seeds) {
    Ok(samples) => samples,
    Err(e) if e.to_string().contains("exceeds 10000") => {
        // chunk and retry, or report sizing problem
        eprintln!("seed list too large: {e}");
        Vec::new()
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling `evaluate_paired` with a `&[u64]` slice whose length exceeds 10_000, e.g. generating seeds via `(0..n).collect()` with n > 10000 or loading a large seed file.

Common situations: Sweep-style benchmarking scripts that auto-generate thousands of seeds; users pasting an entire seed registry instead of sampling a subset; reproducing a full CI seed matrix locally.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/66f1a78fd0758730. Report an issue: GitHub.

Appendix: source

Thrown at ecc2/src/harness_eval.rs:470

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PairedSample {
    pub seed: u64,
    pub candidate_score: f64,
    pub baseline_score: f64,
}

pub fn evaluate_paired(
    evaluator: &mut dyn Evaluator,
    candidate_id: &str,
    baseline_id: &str,
    seeds: &[u64],
) -> Result<Vec<PairedSample>> {
    if seeds.is_empty() {
        bail!("at least one explicit seed is required");
    }
    if seeds.len() > 10_000 {
        bail!("seed count exceeds 10000");
    }
    if seeds.iter().copied().collect::<BTreeSet<_>>().len() != seeds.len() {
        bail!("seeds must be unique");
    }
    seeds
        .iter()
        .map(|seed| {
            Ok(PairedSample {
                seed: *seed,
                candidate_score: evaluator.evaluate(candidate_id, *seed)?,
                baseline_score: evaluator.evaluate(baseline_id, *seed)?,
            })
        })
        .collect()
}

#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct PromotionPolicy {

View on GitHub (pinned to 8321021c54)