fhelium.ir._dependencies
Describe output-to-input element dependencies in an operation's coordinates.
DependencyKind
type alias View source
DependencyKind: TypeAlias = Literal['element', 'reindexed', 'mixing', 'unknown']ValueDependency
class View source
ValueDependency(result_index: int, operand_index: int, axes: Mapping[str, DependencyKind] = field(default_factory=dict))Describe one result's access to one operand along named logical axes.
element reads the corresponding position; reindexed reads a mapped position, including selection and broadcast; mixing may read multiple positions. Missing axes have unknown relationships. Axis names refer to coordinates at the operation's IR level, such as slot, coefficient, limb, or component. The coefficient axis is the last RNS payload dimension in both coefficient and NTT form.
Attributes
| Name | Type | Default/value |
|---|---|---|
result_index | int | |
operand_index | int | |
axes | Mapping[str, DependencyKind] | field(default_factory=dict) |
OperationDependencies
class View source
OperationDependencies(relations: tuple[ValueDependency, ...] = ())Collect partial element relationships between results and operands.
An omitted pair or axis is unknown. Descriptions bound possible reads; they need not enumerate the elements read for each numerical input.
Attributes
| Name | Type | Default/value |
|---|---|---|
relations | tuple[ValueDependency, ...] | () |
axes
method
def axes(result_index: int, operand_index: int) -> Mapping[str, DependencyKind]: ...Return known axis relationships for one result/operand pair.
kind
method
def kind(result_index: int, operand_index: int, axis: str) -> DependencyKind: ...Read one relationship, retaining unknown pairs and axes.
UNKNOWN
constant View source
UNKNOWN: DependencyKind = 'unknown'DependencyDescription
data View source
DependencyDescription: TypeAlias = OperationDependencies | Callable[[Operation], OperationDependencies] | Noneoperation_dependencies
function View source
def operation_dependencies(operation: Operation) -> OperationDependencies: ...Resolve the registered element relationships of a current IR instance.
value_state
function View source
def value_state(value: SSAValue, name: str) -> object: ...Read an available fact from an open value type.
string_fact
function View source
def string_fact(operation: Operation, name: str, *, operand: int=0, state_name: str | None=None) -> str | None: ...Read a represented attribute or an available operand-state fact.
operand_dependencies
function View source
def operand_dependencies(operation: Operation, operands: Sequence[int], axes: Mapping[str, DependencyKind]) -> OperationDependencies: ...Describe each result's relationship to the selected data operands.
region_dependencies
function View source
def region_dependencies(operation: Operation) -> OperationDependencies: ...Compose a single-block region's dataflow into outer relationships.
Block arguments correspond to outer operands and the terminator yields outer results. A missing relationship on a contributing path leaves that path unknown. Multiple paths with mapped reads conservatively mix.
identity_axes
function View source
def identity_axes(value: SSAValue) -> Mapping[str, DependencyKind]: ...Identify preserved coordinates from the represented value kind.
identity_dependencies
function View source
def identity_dependencies(operation: Operation) -> OperationDependencies: ...Describe a single-value storage cast preserving its coordinate type.
operand_relations
function View source
def operand_relations(operation: Operation, axes: Mapping[int, Mapping[str, DependencyKind]]) -> OperationDependencies: ...Describe each result against the selected operand relationships.