ADR-0004: Region Evidence vs Physical Placement

Status: accepted
Date: 2026-07-25

Context

Region parameters are required to prove lifetime, escape, ownership transfer, and safe bulk release. If a region ID also mandates an allocator, it leaks physical strategy into canonical semantics and blocks optimization.

Options considered

OptionBenefitCost
Region names physical arenaDirect loweringSemantic and allocator policy become coupled
No regions in CoreSmall kernelLifetime proof arrives too late
Logical region evidenceSafe and flexibleBackend needs a placement decision pass

Decision

Core regions are logical lifetime and ownership evidence only. A backend may select register, scalar replacement, stack, arena, region heap, or general heap while preserving identity and lifetime behavior.

Core-N0 v0.1 supports lexical regions, simple region parameters, explicit region scope, and no-escape checking. General region polymorphism is deferred.

Rationale

  • Proofs survive independent of allocator strategy.
  • Specialization can improve placement without changing semantics.
  • The same Core artifact can target hosted and freestanding runtimes.

Trade-offs

  • Allocation reports must show both logical region and physical strategy.
  • A separate checked lowering decision is required.

Consequences

No specification may claim that ρ means “stack” or “arena”. Physical placement changes require parity and lifetime evidence, not a Core schema change.

Revisit trigger

Introduce general region polymorphism only when inter-procedural workloads cannot be expressed without duplication or unsafe escape.