pub struct TosaAnalysis<'a> { /* private fields */ }Expand description
Compact provider-neutral overlay used by lowering and specialization code.
The plan owns only bounded indexes and bookkeeping. Names, tensor metadata, shape metadata, and constant payloads remain borrowed from the verified model.
Implementations§
Source§impl<'a> TosaAnalysis<'a>
impl<'a> TosaAnalysis<'a>
pub fn build(model: &Model<'a>, target: Target) -> Result<Self, AnalysisError>
pub fn build_with_options( model: &Model<'a>, target: Target, options: AnalysisOptions, ) -> Result<Self, AnalysisError>
pub const fn target(&self) -> Target
Sourcepub fn serialized_constant(&self, id: ValueId) -> Option<&'a [u8]>
pub fn serialized_constant(&self, id: ValueId) -> Option<&'a [u8]>
Serialized bytes for a CONST/CONST_SHAPE value, including external constant storage.
pub fn regions(&self) -> &[AnalyzedRegion<'a>]
pub fn blocks(&self) -> &[AnalyzedBlock<'a>]
pub fn values(&self) -> &[AnalyzedValue<'a>]
pub fn operators(&self) -> &[AnalyzedOperator<'a>]
pub fn conditions(&self) -> &[RuntimeCondition<'a>]
Sourcepub fn proves_constant_index_bounds(
&self,
condition: &RuntimeCondition<'_>,
) -> bool
pub fn proves_constant_index_bounds( &self, condition: &RuntimeCondition<'_>, ) -> bool
Prove an index bound by inspecting every serialized INT32 constant index. Runtime tensors, non-index conditions and out-of-range constants are not proven.
Sourcepub fn proves_byte_lookup_bounds(
&self,
condition: &RuntimeCondition<'_>,
) -> bool
pub fn proves_byte_lookup_bounds( &self, condition: &RuntimeCondition<'_>, ) -> bool
Prove an index check for the exact byte-lookup idiom CAST(INT8 -> INT32) + 128.
The signed byte widens exactly into [-128, 127]; adding 128 cannot overflow and yields [0, 255]. No tensor contents, names, or external promises are trusted. This deliberately proves no arbitrary gather/scatter index or other runtime condition.