affaan-m/ECC · error
at least one explicit seed is required
Error message
at least one explicit seed is required
What it means
evaluate_paired runs the evaluator on a candidate and baseline over an explicit list of seeds for paired comparison. This error is thrown when the seeds slice is empty, since a paired statistical comparison requires at least one explicit seed to sample. The library refuses to invent default seeds.
Solutions
- Pass a non-empty seed list, e.g. &[1, 2, 3, ...], with at least one u64 seed.
- If seeds come from config, provide a default seed set when the config value is missing or empty.
- Validate seeds before calling: bail early in your own code if seeds.is_empty().
- Check the code path that builds the seeds vector to see why it produced zero entries.
Example fix
// before
let seeds: Vec<u64> = config.seeds.clone(); // empty if unset
let samples = evaluate_paired(&mut eval, "cand", "base", &seeds)?; // bails
// after
let seeds: Vec<u64> = if config.seeds.is_empty() { vec![1, 2, 3, 4, 5] } else { config.seeds.clone() };
assert!(!seeds.is_empty());
let samples = evaluate_paired(&mut eval, "cand", "base", &seeds)?; Defensive patterns
Strategy: validation
Validate before calling
if seeds.is_empty() {
return Err("at least one explicit seed is required");
}
if seeds.len() > 10_000 {
return Err("seed count exceeds 10000");
} Prevention
- Provide a default seed list when config/env seeds are absent.
- Validate seed count and uniqueness before calling evaluate_paired.
- Check CLI/config parsing paths so an unset seed option surfaces as an explicit config error, not an empty vec.
When it happens
Trigger: Calling evaluate_paired(evaluator, candidate_id, baseline_id, &[]) with an empty seeds array, typically because the seed list was built from an empty config collection or a failed parse.
Common situations: Seeds loaded from a config/env var that is unset or empty; a filter accidentally removing all seeds; CLI flag for seeds not provided so the vec stays empty; refactoring that dropped the default seed list.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- At least one guided harness must be selected
- at least one non-empty
- at least one placement is required
- At least one video is required
- commit message cannot be empty
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/7f859db42a4dfb3c.
Report an issue: GitHub.
Appendix: source
Thrown at ecc2/src/harness_eval.rs:467
Ok(self.health_ok)
}
}
#[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()
}View on GitHub (pinned to 8321021c54)