Module validate

Module validate 

Source
Expand description

Bytecode program validation: structural checks, address validation, and stack-type simulation.

Validation runs in layers:

  • Structural (always): operand bounds, arity limits, instruction ordering
  • Architecture (when arch spec provided): address validity
  • Stack simulation (when enabled): type checking via abstract interpretation

Enums§

ValidationError

Functions§

simulate_stack
Simulate the type-level stack through the instruction stream. Collects type errors and stack underflow errors. If an ArchSpec is provided, also validates lane groups at Move instructions.
validate_addresses
Validate addresses in the program against an architecture specification. Checks each constant location, lane, and zone instruction to ensure the encoded address refers to valid entries in the arch spec.
validate_arch_constraints
Validate all architecture-dependent constraints (addresses + capabilities).
validate_capabilities
Validate device capability constraints against the program.
validate_structure
Run structural validation on a program. Returns collected errors.