RC, Regions, And Optional GC Decision
0x0 uses ownership plus regions as the default memory semantics for native
runtime profiles. Heap allocation is not the semantic foundation. The compiler
must prefer static, stack, region, arena, ownership, or precise reference-count
semantics when the program shape proves those domains are safe.
Run:
make memory-semantics-decision-check
make native-memory-control-check
make native-memory-control-check runs make memory-semantics-decision-check
before the broader native memory-control evidence. That makes the memory model
decision a prerequisite for runtime profile claims.
Decision
The production decision is:
- ownership plus regions are the default;
- precise RC is used for explicitly shared heap graphs;
- retain/release reuse is allowed only with acyclic alias proof;
- region and arena values must not outlive their release point;
- optional GC is feature-gated and never a default collector;
- freestanding, bare-metal, no-allocation, arena, manual, and ownership
profiles reject implicit GC;
- host buffers, FFI values, closures, actors, remote actors, Live values, app
runtime values, and ABI values have explicit ownership or root policy.
Evidence Files
memory-semantics/profile-policy.tsvdefines memory semantics per runtime
profile.
memory-semantics/retention-policy.tsvdefines ownership drops, precise RC,
retain/release reuse, region release, arena reset, optional GC, and host
roots.
memory-semantics/region-policy.tsvdefines compiler, parser, request,
transaction, actor mailbox, and bare-metal region scopes.
memory-semantics/gc-policy.tsvdefines no-GC defaults and optional
regional GC policy.
memory-semantics/boundary-policy.tsvdefines ABI, host-buffer, closure,
actor, remote-actor, Live, app-runtime, and FFI memory boundaries.
memory-semantics/diagnostics.tsvdefines stable diagnostics.memory-semantics/verification-cases.tsvrecords positive and negative
fixtures.
release/memory-semantics-decision.tsvrecords the profile-level decision.release/memory-semantics-stress-report.tsvrecords shared graph, cycle,
region, root, actor, optional GC, and shutdown stress evidence.
release/memory-semantics-diagnostics-report.tsvrecords negative
diagnostics.
perf/memory-semantics-benchmarks.tsvrecords RSS, pause, throughput, and
leak budgets.
compat/memory-semantics-contract.tsvrecords release ownership and gate
wiring.
tools/memory-semantics-check.pyvalidates the evidence and fixtures.
Optional GC
GC is optional. It is not enabled by default for any profile. A release that
uses GC must opt in through the hosted or optional-gc profile, include target
support, record barrier and metadata policy, and pass pause, throughput, leak,
and shutdown evidence.
Unsupported GC target combinations fail with:
MEMORY_SEMANTICS_GC_TARGET
Implicit default GC fails with:
MEMORY_SEMANTICS_GC_DEFAULT
RC And Regions
Shared heap graphs use precise retain and release insertion. The retain and
release counts must balance, and cycles require cycle detection, explicit
breaks, or optional regional tracing.
Region and arena values release as groups. A value that outlives the release
point must move to a valid longer-lived domain or be rejected.
Diagnostics
The memory-semantics gate uses stable diagnostics:
MEMORY_SEMANTICS_GC_DEFAULT
MEMORY_SEMANTICS_GC_TARGET
MEMORY_SEMANTICS_RC_BALANCE
MEMORY_SEMANTICS_OWNERSHIP
MEMORY_SEMANTICS_CYCLE
MEMORY_SEMANTICS_REGION
MEMORY_SEMANTICS_ROOT
MEMORY_SEMANTICS_ACTOR
MEMORY_SEMANTICS_REMOTE_ACTOR
MEMORY_SEMANTICS_ABI
MEMORY_SEMANTICS_CLOSURE
MEMORY_SEMANTICS_REUSE
MEMORY_SEMANTICS_SHUTDOWN
Documentation Impact
Memory semantics, RC insertion, retain/release reuse, cycle policy, region
release, optional GC, host roots, actor mailbox retention, ABI ownership, or
shutdown behavior changes must update this page, the source-owned
memory-semantics evidence, release notes, and the public reference index in the
same change.