diff --git a/src/convergence.rs b/src/convergence.rs index 37d2136..153a5cc 100644 --- a/src/convergence.rs +++ b/src/convergence.rs @@ -38,7 +38,6 @@ pub struct ConvergenceReport { pub log_evidence: f64, pub converged: bool, pub per_iteration_time: SmallVec<[Duration; 32]>, - pub slices_skipped: usize, } #[cfg(test)] diff --git a/src/history.rs b/src/history.rs index fc7ae6b..7a2d82d 100644 --- a/src/history.rs +++ b/src/history.rs @@ -603,7 +603,6 @@ impl, O: Observer, K: Eq + Hash + Clone> History, O: Observer, K: Eq + Hash + Clone> History b.mu()); } + +/// Every field of `ConvergenceReport` must carry real information. +/// +/// `slices_skipped` was public, hardcoded to `0`, and reported a plausible +/// value for a feature that never existed — the same shape as the inert +/// `online` flag in #19. It was removed in #33. This pins the remaining fields +/// so the next always-constant member has to survive an assertion rather than +/// just a reviewer's attention. +#[test] +fn every_convergence_report_field_is_populated() { + let mut h = History::builder().build(); + + for time in 1..=6i64 { + h.record_winner(&"a", &"b", time).unwrap(); + } + + let report = h.converge().unwrap(); + + assert!( + report.iterations > 0, + "iterations is zero on a real converge" + ); + + assert!(report.converged, "fixture must converge"); + + assert!( + report.final_step.0.is_finite() && report.final_step.1.is_finite(), + "final_step is not finite: {:?}", + report.final_step + ); + + assert!( + report.log_evidence.is_finite() && report.log_evidence < 0.0, + "log_evidence is not a finite negative log probability: {}", + report.log_evidence + ); + + assert_eq!( + report.per_iteration_time.len(), + report.iterations, + "per_iteration_time must carry one duration per iteration" + ); +}