Skip to main content

Pathfinder

Trait Pathfinder 

Source
pub trait Pathfinder: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn propose(
        &self,
        graph: &mut Graph,
        ctx: &OptimizationContext<'_>,
    ) -> Result<()>;
}
Expand description

A pathfinder ADDs candidate paths / branches to the graph. The PR-A4 deliberate-fork seed (PlacementForkPathfinder) is the first registered pathfinder; later pathfinders (fusion, algebraic, dtype-lowering under tolerance, layout fixups) implement the same trait and register the same way.

propose may append nodes and record Op::Branch decision points (via the fuel-graph A1 builders). It must never remove a path — that is an Optimizer’s job — and it returns Result so a build-time failure surfaces (never panic, per the working agreement).

Required Methods§

Source

fn name(&self) -> &'static str

Stable, human-readable name. Shows up in debug traces.

Source

fn propose( &self, graph: &mut Graph, ctx: &OptimizationContext<'_>, ) -> Result<()>

Add candidate paths to graph. ctx carries the ranked plan + dispatch order the measure stage produced.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§