pub struct PcurveFitLedger {
pub fits: u64,
pub unmet: u64,
pub sample_ceiling: u64,
pub round_budget: u64,
pub stalled: u64,
pub span_floor: u64,
pub worst_unmet_residual: f64,
pub raised: u64,
pub raise_declined: u64,
pub worst_off_surface: f64,
}Expand description
Per-operation tally of pcurve fits and how many missed their floor.
build_pcurve_on_surface and its marched twin are called from some forty
sites, most of which have no diagnostics record to write into. Rather than
thread one through every layer, an operation that returns
KernelDiagnostics opens a PcurveFitScope; every fit made on that
thread while the scope is open is tallied here, and closing the scope hands
the tally back for PcurveFitLedger::report_into. This is the shape the
boolean’s CONFORMANCE_REPAIRS counter already uses. With no scope open,
recording is a no-op.
Scopes nest: CLOSING a child folds it into its parent, so an offset shell sees the fits of the booleans it ran. A scope that is DROPPED without being closed is discarded, not folded — a boolean attempt that refused (and may be retried under perturbation) must not leave its fits on the caller’s tally.
Thread-local by construction: a fit made on a rayon worker (the parallel
feature’s STEP body import) is not seen by a scope on the calling thread. No
diagnostics-returning operation builds pcurves off-thread today.
Fields§
§fits: u64Fits recorded, exact affine ones included.
unmet: u64Fits whose returned curve did not reach its floor.
sample_ceiling: u64Unmet fits that stopped at a sample ceiling.
round_budget: u64Unmet fits that spent every refinement round.
stalled: u64Unmet fits that could insert nothing.
span_floor: u64Unmet fits whose remaining over-floor spans were all below the loop’s 1e-3 span floor.
worst_unmet_residual: f64Largest residual among the unmet fits; zero when there are none.
raised: u64Fits that re-entered refinement with [PCURVE_RAISED_SAMPLES], met or
not.
raise_declined: u64Unmet ceiling exits that were NOT raised because the residual is already within the floor of the edge curve’s own gap from the surface.
worst_off_surface: f64Largest PcurveFitReport::off_surface over every fit.
Implementations§
Source§impl PcurveFitLedger
impl PcurveFitLedger
Sourcepub fn report_into(&self, diagnostics: &mut KernelDiagnostics)
pub fn report_into(&self, diagnostics: &mut KernelDiagnostics)
Write the tally into an operation’s diagnostics: the pcurve.*
counters and measurements always, plus one pcurve.unmet_floor event at
DiagnosticSeverity::Degraded when any fit missed its floor. Degraded,
not Error: the result is still the kernel’s best construction and stays
shippable, but it no longer claims the accuracy its floor states.