From 88b1ba5075aadb0a20b6d962eeed88b9a590b2cf Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:34:59 -0400 Subject: [PATCH] doc: a feature result has no boolean diagnostics any more The kernel's BooleanDiagnostics and capture_boolean_diagnostics are gone with truck: they reported the retries and fallbacks truck's booleans took (shifted operands, refined tolerances, a planar fallback), and SMLib's boolean has none. Model::evaluate ran every feature inside capture_boolean_diagnostics, warned with its summary and kept the report in FeatureResult, its cache entry and the saved model ("diagnostics"). The feature runs as it is, FeatureResult and CachedEval lose the field, and the saved model neither writes nor reads "diagnostics" (a model saved with it still opens: the key is not looked at). Callers outside doc that read FeatureResult::boolean_diagnostics change with it: engine's timeline.inspect reply here; engine's fuzz report and clearance/interference belong to the blends work. Not built: base in progress (kernel-smlib/no-truck 66ab6b7f does not build). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt --- crates/doc/src/eval.rs | 15 ++------------- crates/doc/src/model_cache.rs | 7 ------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/crates/doc/src/eval.rs b/crates/doc/src/eval.rs index aae795c78..576c7175c 100644 --- a/crates/doc/src/eval.rs +++ b/crates/doc/src/eval.rs @@ -986,7 +986,6 @@ pub struct EvalCache { struct CachedEval { error: Option, warning: Option, - boolean_diagnostics: kernel::BooleanDiagnostics, ms: f64, state: Arc, /// What the state costs, worked out once when it was stored (see @@ -1192,7 +1191,6 @@ pub struct FeatureResult { pub name: String, pub error: Option, pub warning: Option, - pub boolean_diagnostics: kernel::BooleanDiagnostics, pub ms: f64, pub skipped: bool, /// Not evaluated on the document's current inputs: a feature at or after a sketch shown live @@ -2122,7 +2120,6 @@ impl Model { name: f.name.clone(), error: None, warning: None, - boolean_diagnostics: Default::default(), ms: 0.0, skipped: true, stale: false, @@ -2158,7 +2155,6 @@ impl Model { name: f.name.clone(), error: c.error, warning: c.warning, - boolean_diagnostics: c.boolean_diagnostics, ms: c.ms, skipped: false, stale: false, @@ -2205,12 +2201,12 @@ impl Model { }; // A parameter with an error fails the features using it, with that error. let bad_param = param_names(f).into_iter().find_map(|n| self.param_errors.get(&n).map(|e| format!("parameter `{n}`: {e}"))); - let (r, mut boolean_diagnostics) = kernel::capture_boolean_diagnostics(|| match bad_param { + let r = match bad_param { Some(e) => Err(kernel::KernelError::Failed(e)), None => kernel::guard(&f.name, || { eval_feature(doc, &vals, f, &mut next, &mut warning).map_err(|e| kernel::KernelError::Failed(e.to_string())) }), - }); + }; if r.is_ok() { // Profiles picked by curves that no longer bound a profile exactly were found // by their best match: say which. @@ -2222,13 +2218,8 @@ impl Model { } } } - if let Some(note) = boolean_diagnostics.warning() { - append_warning(&mut warning, note); - } track_altered_sheets(&state, &mut next, f, &mut warning); note_join_apart(&state, &next, f, &mut warning); - } else { - boolean_diagnostics = Default::default(); } let ms = t0.elapsed().as_secs_f64() * 1000.0; let error = match r { @@ -2268,7 +2259,6 @@ impl Model { let e = CachedEval { error: error.clone(), warning: warning.clone(), - boolean_diagnostics: boolean_diagnostics.clone(), ms, bytes: state.added_bytes(&before), state: state.clone(), @@ -2286,7 +2276,6 @@ impl Model { name: f.name.clone(), error, warning, - boolean_diagnostics, ms, skipped: false, stale: false, diff --git a/crates/doc/src/model_cache.rs b/crates/doc/src/model_cache.rs index 2908b55ee..517cd6e62 100644 --- a/crates/doc/src/model_cache.rs +++ b/crates/doc/src/model_cache.rs @@ -239,9 +239,6 @@ impl Model { if let Some(w) = &r.warning { f["warning"] = json!(w); } - if r.boolean_diagnostics != kernel::BooleanDiagnostics::default() { - f["diagnostics"] = serde_json::to_value(&r.boolean_diagnostics).map_err(|e| kernel::KernelError::Invalid(e.to_string()))?; - } features.push(f); } let records = json!({ @@ -601,10 +598,6 @@ impl Model { name: f.name.clone(), error: None, warning: r.get("warning").map(|w| text(Some(w))).transpose()?, - boolean_diagnostics: match r.get("diagnostics") { - Some(d) => saved_diagnostics(d)?, - None => Default::default(), - }, ms, skipped: r.get("skipped").and_then(Json::as_bool).ok_or_else(|| bad("saved model: skipped"))?, stale: false,