Function sequant::eval::well_formed¶
Defined in File ordered_schedule.hpp
Function Documentation¶
-
inline bool sequant::eval::well_formed(OrderedSchedule const &sched)¶
Structural sanity check on
sched(no sequencer logic):every
BuildStep::value_idis <sched.num_values;ordinals are unique among same-axis (
IndexSpace::base_key()) sibling blocks within a parent;every
ScopeBlock::outputsvalue_id is <sched.num_values;single-producer (SSA-like), with the multi-level escape chain allowed: no value_id is built (
BuildStep) more than once; a built value_id may also escape only through its own chain — every block listing it inoutputseither holds itsBuildStepor is an ancestor of the block that does (a member materialized across a forced loop split is built at its production site for its in-nest readers and escapes from that same site outward; seebuild_ordered_schedule'smixed-pass rule) — and any other combination of build and escape sites is duplicate production; and a value_id may escape (outputs) at more than one block only when those blocks lie on a single root-to-node nesting path (distinct depths, each shallower one an ancestor of the deepest) — the inner-sum / outer-scatter escape chain ofbuild_ordered_schedule. Escapes in unrelated (sibling) blocks, or two escapes at one depth, are rejected as duplicate production.
Note
This checks single-producer (no duplicate production) but not completeness (no value_id gaps — that every id in
[0, num_values)is produced somewhere). Completeness holds by construction ofbuild_ordered_scheduleand is covered by its own test, so a caller cannot readwell_formedas a guarantee that every value_id is present.