From 9a7fb85bc5373a3035b7f0f8e2ca8b8793cf7ebf Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Thu, 11 Dec 2025 18:09:58 +0000 Subject: [PATCH] wip Signed-off-by: Joe Isaacs --- vortex-array/src/optimizer/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vortex-array/src/optimizer/mod.rs b/vortex-array/src/optimizer/mod.rs index 20620d7f6c5..27d868d3d41 100644 --- a/vortex-array/src/optimizer/mod.rs +++ b/vortex-array/src/optimizer/mod.rs @@ -56,6 +56,20 @@ impl ArrayOptimizer { return Ok(array.clone()); } + // // Apply reduction rules to the current array until no more rules apply. + if let Some(new_array) = opt.apply_reduce_rules(&array)? { + // Start over + return inner(opt, &new_array, iterations - 1); + } + // + // // Apply parent reduction rules to each child in the context of the current array. + for (idx, child) in array.children().iter().enumerate() { + if let Some(new_array) = opt.apply_parent_rules(child, &array, idx)? { + // If the parent was replaced, then we start over with the new parent + return inner(opt, &new_array, iterations - 1); + } + } + // TODO(ngates): we should reduce first on the way down? let new_children: Vec<_> = array .children()