From 79799feca1a417fedeae53942807eaeebfdfdfe4 Mon Sep 17 00:00:00 2001 From: dietrich ayala Date: Tue, 22 Sep 2026 15:15:36 +0200 Subject: [PATCH] Float generation loop: seed the regression set from every fixture, so a candidate wrong in one respect loses what another fixture gets right --- .../src/bin/float_generation_loop.rs | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/crates/generation/src/bin/float_generation_loop.rs b/crates/generation/src/bin/float_generation_loop.rs index 139405c6..03a7cdda 100644 --- a/crates/generation/src/bin/float_generation_loop.rs +++ b/crates/generation/src/bin/float_generation_loop.rs @@ -10,8 +10,9 @@ //! Unlike every other seam's own generation-loop binary, this one never admits anything: //! `specs/floats-bfc.md` is explicit that a correct float implementation is not written //! by hand before every model batch has failed, so there is no `correct` fixture here to -//! admit, only `baseline` (seeds the regression set) and two deliberately wrong candidates -//! this binary proves the gate rejects. +//! admit, only `baseline` and two deliberately wrong candidates this binary proves the +//! gate rejects. All three seed the regression set (the comment at the seeding site +//! says why the baseline alone is not enough here). use anyhow::{bail, Result}; use generation::candidate_crate; @@ -43,16 +44,29 @@ fn main() -> Result<()> { let regression_set_path = repo_root.join("corpus/float-regression-set.json"); let report_out = repo_root.join("corpus/candidates/float-report.json"); - // Seeded from the shipped (deliberately wrong) baseline's own passing cases -- - // nothing has been admitted for this seam yet, so there is no prior admitted - // candidate to seed from instead (unlike every other seam's own loop, which seeds - // from a rule that predates the seam's own extraction). - let baseline_passing: Vec = passing_case_ids(resolve_baseline as FloatResolver, &cases); + // Seeded from every case any hand-written fixture passes -- the shipped (deliberately + // wrong) baseline's own and the two seeded-wrong candidates' -- not the baseline's + // alone, the way `bin/absolute_generation_loop.rs` seeds. Each seeded-wrong fixture + // is wrong in one respect and right in the others, so the union is the set of cases + // known to be achievable, and a candidate wrong in any one of those respects loses + // some of it. Seeding from the baseline alone cannot reject a fixture that merely + // ignores `clear`: the baseline ignores `clear` too, so that fixture strictly + // improves on it and a no-loss gate has nothing to catch it on + // (`docs/model-first-cost.md` -> "Batch scores and token totals", floats). if !regression_set_path.exists() { - write_regression_set(®ression_set_path, &baseline_passing)?; + let ungated = run_candidates(&binary, &cache_dir, None, &report_out)?; + let mut seed: Vec = passing_case_ids(resolve_baseline as FloatResolver, &cases); + for candidate in &ungated.candidates { + for id in &candidate.passed_case_ids { + if !seed.contains(id) { + seed.push(id.clone()); + } + } + } + write_regression_set(®ression_set_path, &seed)?; println!( - "seeded the permanent regression set with {} case(s) baseline already passes", - baseline_passing.len() + "seeded the permanent regression set with {} case(s) at least one fixture already passes", + seed.len() ); } -- 2.54.0