pub trait Optimizer: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn prune(
&self,
graph: &mut Graph,
ctx: &OptimizationContext<'_>,
) -> Result<()>;
}Expand description
An optimizer MERGEs / DISCARDs paths. The PR-B2 per-device
Pareto frontier is applied per-node inside
compile_plan; the registered
FrontierConvergenceOptimizer is its in-graph counterpart that
runs after each pathfinder to collapse duplicate (forward-identical)
arms and enforce the optimizer invariants.
prune runs after each Pathfinder::propose (lock-step), so
the working set never explodes-then-extracts. It must honor the
optimizer invariants: never strand the last (device, backend) path,
and never mutate a node in ctx.cycle_guard.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".