Skip to content

Resolve get rec idx

ResolveGetRecIdx dataclass

ResolveGetRecIdx(measure_id_frame: MeasureIDFrame)

Bases: RewriteRule

Replace GetRecIdxFromMeasurement / GetRecIdxFromPredicate with computed constants.

After MeasureIDAnalysis has produced RecId lattice elements for each helper statement, this rewrite reads RecId.idx (the final stim record index) and creates a py.Constant to replace all uses. The helper statement becomes unused and is cleaned up by DCE.