{"record":{"id":"66f1a78fd0758730","repo":"affaan-m/ECC","slug":"seed-count-exceeds-10000","errorCode":null,"errorMessage":"seed count exceeds 10000","messagePattern":"seed count exceeds 10000","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":470,"sourceCode":"\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]\npub struct PairedSample {\n    pub seed: u64,\n    pub candidate_score: f64,\n    pub baseline_score: f64,\n}\n\npub fn evaluate_paired(\n    evaluator: &mut dyn Evaluator,\n    candidate_id: &str,\n    baseline_id: &str,\n    seeds: &[u64],\n) -> Result<Vec<PairedSample>> {\n    if seeds.is_empty() {\n        bail!(\"at least one explicit seed is required\");\n    }\n    if seeds.len() > 10_000 {\n        bail!(\"seed count exceeds 10000\");\n    }\n    if seeds.iter().copied().collect::<BTreeSet<_>>().len() != seeds.len() {\n        bail!(\"seeds must be unique\");\n    }\n    seeds\n        .iter()\n        .map(|seed| {\n            Ok(PairedSample {\n                seed: *seed,\n                candidate_score: evaluator.evaluate(candidate_id, *seed)?,\n                baseline_score: evaluator.evaluate(baseline_id, *seed)?,\n            })\n        })\n        .collect()\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]\npub struct PromotionPolicy {","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/harness_eval.rs#L452-L488","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Trim or sample the seed list to at most 10,000 entries before calling `evaluate_paired`","Split the evaluation into chunks of <= 10,000 seeds and aggregate the resulting `PairedSample` vectors","Generate seeds deterministically with a smaller count, e.g. `(0..10_000).collect()`"],"exampleFix":"// before\nlet seeds: Vec<u64> = (0..50_000).collect();\nlet samples = evaluate_paired(&evaluator, &seeds)?;\n// after\nlet seeds: Vec<u64> = (0..10_000).collect();\nlet samples = evaluate_paired(&evaluator, &seeds)?;\n// or chunk:\nfor chunk in all_seeds.chunks(10_000) {\n    samples.extend(evaluate_paired(&evaluator, chunk)?);\n}","handlingStrategy":"validation","validationCode":"fn ensure_seed_count_ok(seeds: &[u64]) -> Result<(), String> {\n    if seeds.len() > 10_000 {\n        return Err(format!(\"{} seeds exceeds the 10,000 limit\", seeds.len()));\n    }\n    Ok(())\n}","typeGuard":"fn is_valid_seed_slice(seeds: &[u64]) -> bool {\n    !seeds.is_empty() && seeds.len() <= 10_000\n}","tryCatchPattern":"match evaluate_paired(&evaluator, &seeds) {\n    Ok(samples) => samples,\n    Err(e) if e.to_string().contains(\"exceeds 10000\") => {\n        // chunk and retry, or report sizing problem\n        eprintln!(\"seed list too large: {e}\");\n        Vec::new()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Cap seed generation at the source (e.g. `(0..10_000).take(10_000)`)","Chunk large seed sweeps with `slice::chunks(10_000)` before evaluation","Log seed-list size before invoking the evaluator"],"tags":["validation","seeds","argument-count"],"backgroundTag":"value-out-of-range","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}