Voltar para Documentação

Docs Técnicas

IR And Runtime

TREA has both AST runtime support and direct IR runtime support for the currently lowered executable subset.

O conteúdo abaixo vem das fontes técnicas do repositório e é prerenderizado no site para leitura direta por pessoas, crawlers e agentes.

TREA has both AST runtime support and direct IR runtime support for the currently lowered executable subset.

IR

Primary source:

text
crates/domain/atlas-trea/src/ir.rs

The canonical IR version is:

text
trea-ir-v1

Artifacts include ir_hash derived from canonical lowered IR.

The IR is responsible for:

  • preserving executable meaning in a canonical lowered form;
  • supporting stable artifact hashing;
  • making compiler and runtime behavior easier to inspect and compare.

Runtime

Primary source:

text
crates/domain/atlas-trea/src/runtime.rs

Execution returns:

  • effects plan;
  • return values;
  • runtime cost receipt.

On failure, storage is rolled back.

The runtime is responsible for:

  • evaluating expressions and statements;
  • mutating contract storage in memory;
  • producing events and accounting effects;
  • enforcing execution bounds for the supported runtime subset.

It is not responsible for final ledger admissibility.

Direct IR Runtime

Primary source:

text
crates/domain/atlas-trea/src/ir_runtime.rs

The direct IR runtime version is:

text
ir-runtime-v3

Execution Sequence

  1. source is parsed into AST;
  2. verified source is lowered into canonical IR for artifact construction;
  3. local execution runs through the current runtime path;
  4. execution produces an execution result;
  5. the ledger validates and commits that result separately.

Commit Boundary

A successful runtime execution means:

  • the contract ran within the supported runtime subset;
  • storage mutations and effects were produced deterministically.

It does not mean:

  • the posting route is allowed;
  • lifecycle state permits the call;
  • accepted version binding is valid for commit;
  • the ledger will persist the result.