Skip to main content

validate

Function validate 

Source
pub fn validate<F>(
    plan: &ActivationPlan,
    graph: &Graph,
    view_map: &ViewMap,
    size_oracle: F,
    options: &PlanOptions,
) -> Result<(), ValidateError>
where F: Fn(ValueId) -> Option<usize>,
Expand description

Validate a plan against the graph, using size_oracle to check slot capacities. Enforces:

  1. No overlap sharing — two owners with overlapping live intervals never share a slot (the core safety invariant).
  2. Coverage & capacity — every owner has a slot that exists and is large enough; a graph output’s slot is never reused after its def (implied by (1), since an output’s interval overlaps everything after its def).
  3. View folding — every zero-copy view’s last use falls within its source owner’s live interval (the source outlives the alias).