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
| Option | Benefit | Cost |
|---|---|---|
| Region names physical arena | Direct lowering | Semantic and allocator policy become coupled |
| No regions in Core | Small kernel | Lifetime proof arrives too late |
| Logical region evidence | Safe and flexible | Backend 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.