From c072b0314b9db7d56ef90a437f8bd43a3cf7a1ac Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Thu, 18 Sep 2025 11:51:26 -0300 Subject: [PATCH] fix shrinking --- simulator/generation/plan.rs | 2 +- simulator/shrink/plan.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/simulator/generation/plan.rs b/simulator/generation/plan.rs index 2189c21e2..5dde1d11e 100644 --- a/simulator/generation/plan.rs +++ b/simulator/generation/plan.rs @@ -30,7 +30,7 @@ use super::property::{Property, remaining}; pub(crate) type ResultSet = Result>>; -#[derive(Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub(crate) struct InteractionPlan { pub(crate) plan: Vec, } diff --git a/simulator/shrink/plan.rs b/simulator/shrink/plan.rs index 35a5eea84..143c1d0d6 100644 --- a/simulator/shrink/plan.rs +++ b/simulator/shrink/plan.rs @@ -1,5 +1,3 @@ -use indexmap::IndexSet; - use crate::{ SandboxedResult, SimulatorEnv, generation::{ @@ -19,13 +17,14 @@ impl InteractionPlan { // - Shrink to multiple values by removing random interactions // - Shrink properties by removing their extensions, or shrinking their values let mut plan = self.clone(); - // let failing_property = &self.plan[failing_execution.interaction_index]; - let mut depending_tables = IndexSet::new(); let all_interactions = self.interactions_list_with_secondary_index(); - // Index of the parent property where the interaction originated from let secondary_interactions_index = all_interactions[failing_execution.interaction_index].0; + // Index of the parent property where the interaction originated from + let failing_property = &self.plan[secondary_interactions_index]; + let mut depending_tables = failing_property.dependencies(); + { let mut idx = failing_execution.interaction_index; loop {