src/fb.rs

changeset 91
47d495348e38
parent 89
8d1c959432c8
child 93
8f1e57821d76
--- a/src/fb.rs	Tue Aug 04 19:24:55 2026 -0500
+++ b/src/fb.rs	Tue Aug 04 19:41:34 2026 -0500
@@ -113,9 +113,12 @@
     }
 }
 
-pub(crate) fn prune_with_stats<F: Float, const N: usize>(μ: &mut RNDM<N, F>) -> usize {
+pub(crate) fn prune_with_stats<F: Float, const N: usize>(
+    μ: &mut RNDM<N, F>,
+    until: usize,
+) -> usize {
     let n_before_prune = μ.len();
-    μ.prune();
+    μ.prune_until(until);
     debug_assert!(μ.len() <= n_before_prune);
     n_before_prune - μ.len()
 }
@@ -218,7 +221,9 @@
                     &reg,
                     Some(|μ̃: &RNDM<N, F>| f.apply(μ̃) + reg.apply(μ̃)),
                 );
-                stats.pruned += prune_with_stats(&mut μ);
+
+                // Prune. Do not prune new insertions on first round.
+                stats.pruned += prune_with_stats(&mut μ, μ_base_len);
 
                 if config.random_insertions {
                     if let Some(x) = domain.random_point() {
@@ -240,7 +245,8 @@
         };
 
         if did_merge.is_none() {
-            stats.pruned += prune_with_stats(&mut μ);
+            // Prune. Do not prune new insertions on first round.
+            stats.pruned += prune_with_stats(&mut μ, μ_base_len);
         }
 
         let iter = state.iteration();

mercurial