irx.analysis.contract

irx.analysis.contract

Source: packages/irx/src/irx/analysis/contract.py

title: Public semantic contract for hosts and lowering.
summary: >-
  Encode the stable semantic-analysis phases, required metadata, host input
  constraints, and phase error boundaries that IRx guarantees before backend
  lowering begins.

Functions

get_semantic_contract() -> SemanticContract

title: Return the stable public semantic contract.
summary: >-
  Expose the semantic contract that hosts and backend lowering may rely on
  before code generation begins.
returns:
  type: SemanticContract

Classes

SemanticPhase

title: One stable semantic phase.
summary: >-
  Describe one externally-visible stage in the semantic pipeline and the
  guarantees it establishes for later lowering.
attributes:
  name:
    type: str
  entrypoints:
    type: tuple[str, Ellipsis]
  guarantees:
    type: tuple[str, Ellipsis]

PhaseErrorBoundary

title: One compiler-phase error boundary.
summary: >-
  Describe which category of failure belongs to which pipeline phase and
  how callers should interpret it.
attributes:
  phase:
    type: str
  raises:
    type: str
  surfaces:
    type: tuple[str, Ellipsis]
  summary:
    type: str

SemanticContract

title: Stable semantic contract exposed by IRx.
summary: >-
  Collect the semantic phases, metadata requirements, host input
  constraints, and error boundaries that analysis guarantees to lowering
  and host compilers.
attributes:
  stable_phases:
    type: tuple[SemanticPhase, Ellipsis]
  required_node_semantic_fields:
    type: tuple[str, Ellipsis]
  required_session_fields:
    type: tuple[str, Ellipsis]
  allowed_host_entrypoints:
    type: tuple[str, Ellipsis]
  allowed_host_inputs:
    type: tuple[str, Ellipsis]
  phase_error_boundaries:
    type: tuple[PhaseErrorBoundary, Ellipsis]