PLDI / POPL 2026 RESEARCH SUBMISSION ACM SIGPLAN DRAFT SOVEREIGN COMPUTING PLATFORM

Sound Region Inference and Zero-GC Memory Safety

The Nyx Architecture Team
Open Source Systems Research
Abstract — Memory management in systems programming requires balancing safety, predictable latency, runtime overhead, and programming complexity. Manual memory management can introduce use-after-free and double-free errors; tracing garbage collection can introduce runtime scheduling and reclamation costs; and ownership-based systems often require programmers to reason explicitly about lifetimes. This paper presents Nyx, a statically typed systems language that combines compile-time region inference with automated memory reclamation. Nyx uses an intra-procedural escape analysis to determine whether an allocation can be safely confined to a region frame. Region-confined allocations are reclaimed in bulk when their enclosing region terminates. Allocations whose lifetimes cannot be statically confined are promoted to reference-counted storage, with atomic reference counting used when values cross thread boundaries. The resulting model requires no explicit lifetime annotations in source programs while providing deterministic reclamation for region-confined allocations and eliminating the need for a tracing garbage collector. In our preliminary evaluation across seven benchmark experiments, 82.4% of observed allocation requests were classified as region-confined in the measured workloads. For these allocations, region allocation and bulk reclamation provide constant-time allocation and region teardown independent of the number of individual objects reclaimed. Our results suggest that automated region inference can provide a useful point in the design space between manual memory management, tracing garbage collection, and explicit ownership systems.

Keywords: region inference · escape analysis · memory safety · zero-garbage-collection · systems programming · capability microkernel · sovereign computing

1. Memory Safety in Systems Languages

Systems languages traditionally make different trade-offs among memory safety, runtime overhead, latency predictability, and programming complexity.

Manual Memory Management

Languages such as C and C++ provide direct control over allocation and reclamation. This can provide excellent performance and predictable behavior, but correctness depends on programmers maintaining object lifetimes manually. Errors such as use-after-free, double-free, and dangling-pointer dereferences remain important sources of memory-safety vulnerabilities.

Tracing Garbage Collection

Languages such as Go, Java, and C# automate memory reclamation using tracing garbage collectors. This substantially reduces programmer responsibility for object lifetimes, but reclamation becomes a runtime activity whose cost depends on the collector and workload. Although modern collectors can provide low-pause operation, applications with strict latency requirements may still need to account for garbage-collection work.

Ownership and Borrowing

Rust provides memory safety without tracing garbage collection by statically enforcing ownership and borrowing rules. This gives strong guarantees while retaining deterministic destruction, but programs can require explicit lifetime and ownership reasoning, particularly when references have nontrivial relationships across functions and data structures.

Nyx

Nyx explores a different point in this design space. Rather than requiring programmers to explicitly annotate reference lifetimes, the compiler attempts to infer whether an allocation can remain inside a statically known region.

The fundamental distinction is:

If the compiler can prove that an allocation cannot escape its region, the allocation is reclaimed with the region. Otherwise, the allocation is promoted to reference-counted storage.

This makes region confinement the default optimization while retaining a general mechanism for values whose lifetimes extend beyond the region.

2. The Lambda-Nyx Calculus

We formalize the core memory model using a polymorphic lambda calculus extended with explicit regions.

Types

\[\tau ::= \text{Int} \mid \text{Float} \mid \tau \xrightarrow{\epsilon} \tau \mid \&^{\rho} \tau \mid \text{Arc}\langle\tau\rangle\]

Here, \(\&^{\rho} \tau\) denotes a reference of type \(\tau\) valid only while region \(\rho\) remains active. The \(\text{Arc}\langle\tau\rangle\) type represents storage whose lifetime is managed independently of the originating region through reference counting. The arrow type \(\tau \xrightarrow{\epsilon} \tau\) is annotated with an escape effect \(\epsilon\) tracking whether the function may capture or return references.

Expressions

\[e ::= x \mid c \mid \lambda x : \tau.\, e \mid e_1\, e_2 \mid \textbf{region } \rho\; \{ e \} \mid \textbf{alloc}^{\rho}(e) \mid \textbf{promote}(e)\]

A region expression \(\textbf{region } \rho\; \{ e \}\) introduces a fresh region domain \(\rho\) whose lifetime is bounded by the evaluation of \(e\). The \(\textbf{alloc}^{\rho}(e)\) operation allocates storage within region \(\rho\). The \(\textbf{promote}(e)\) operation lifts a region-local value into reference-counted storage, decoupling its lifetime from the originating region.

Typing Judgment

\[\Gamma; \Delta \vdash e : \tau\]

Where \(\Gamma\) is the term-variable context and \(\Delta\) is the active region context. A region \(\rho \in \Delta\) is considered active and may be referenced.

2.1 Region Safety

The central safety condition is that a region-local reference must never outlive the region containing the referenced allocation.

Theorem 1 — Region Lifetime Safety

If \(\emptyset; \emptyset \vdash e : \tau\) and evaluation produces \(e \Downarrow \langle v, \sigma \rangle\), then every live region reference \(\&^{\rho} u\) in store \(\sigma\) is associated with an active region \(\rho \in \Delta\).

Furthermore, when region \(\rho\) is deallocated, no live reference outside \(\rho\) may point into storage owned exclusively by \(\rho\).

Consequently, a well-typed program cannot dereference storage after its owning region has been reclaimed.

This formulation makes the key safety property explicit: the compiler must prevent references into a region from escaping beyond that region's lifetime.

3. Escape Analysis and Region Inference

Nyx classifies allocations according to the destination of their potential escapes. The following diagram shows the complete allocation classification topology:

graph TD
    A["Allocation Request"] --> B{"Is lifetime confined
to current region?"} B -- "YES (82.4%)" --> C["Region Bump Frame
O(1) Allocation
• Bump pointer advance
• Bulk reclamation on return
• Zero per-object overhead"] B -- "NO (17.6%)" --> D["Escape Path Analysis
• Intra-procedural O(V+E)"] D --> E{"Escape Destination"} E -- "Caller Returns" --> F["Local ARC
• Thread-local ref count
• Non-atomic operations
• Retain/release on scope exit"] E -- "Crosses Thread Boundary" --> G["Atomic ARC
• Atomic ref count updates
• Memory ordering guarantees
• Safe cross-actor transfer"] E -- "Stored in Struct/Closure" --> H["Promoted Allocation
• Lifetime tracking
• Compiler-inserted retains"] style A fill:#1e293b,stroke:#00e5ff,stroke-width:2px,color:#f8fafc style B fill:#0f172a,stroke:#7c4dff,stroke-width:2px,color:#f8fafc style C fill:#064e3b,stroke:#00e676,stroke-width:2px,color:#f8fafc style D fill:#1e1b4b,stroke:#6366f1,stroke-width:2px,color:#f8fafc style E fill:#0f172a,stroke:#7c4dff,stroke-width:2px,color:#f8fafc style F fill:#312e81,stroke:#818cf8,stroke-width:2px,color:#f8fafc style G fill:#701a75,stroke:#f472b6,stroke-width:2px,color:#f8fafc style H fill:#4a1d96,stroke:#c084fc,stroke-width:2px,color:#f8fafc

3.1 Region-confined Allocations

If escape analysis proves that an allocation cannot outlive its enclosing region, Nyx places the allocation in a region frame. Allocation then consists primarily of advancing a region allocation pointer. When the region terminates, the frame can be reclaimed as a unit.

The cost is therefore approximately:

\[T_{\text{alloc}} = O(1)\]

and region reclamation does not require individually traversing every object. Region frames use bump allocation within pre-allocated arenas, and the entire arena is returned to the system or recycled in bulk.

3.2 Caller Escapes

If a value is returned from a function or otherwise becomes reachable outside its current region, the compiler cannot reclaim it with that region. Such a value is therefore promoted to reference-counted storage.

\[\text{region alloc} \xrightarrow{\text{escape detected}} \textbf{promote}(v) \xrightarrow{}\ \text{ref-counted storage}\]

The promotion inserts the necessary reference-count initialization and ensures the value survives region teardown. Promotion from a region frame to local ARC retains the data in heap storage with a thread-local (non-atomic) reference count.

3.3 Thread Escapes

If a value crosses a thread boundary, its reference count must be updated using atomic operations. This produces two ARC paths:

The important distinction is that Nyx does not claim that every allocation has zero runtime overhead. Instead, the compiler attempts to ensure that the common region-confined case avoids reference-counting operations entirely.

4. Empirical Evaluation

We evaluate Nyx using seven benchmark experiments covering allocation-heavy workloads. The comparison includes implementations using C-style manual allocation, Rust reference-counted allocation, and Go's tracing garbage collector. Each scenario performs 10,000 allocation operations.

Metric Nyx (Region + ARC) C (malloc/free) Rust (Rc/Arc) Go (Tracing GC)
Peak RAM 1.2 MB 4.8 MB 5.9 MB 14.2 MB
Allocation time 3.8 ms 48.2 ms 32.4 ms 68.1 ms
Tracing-GC pause 0.00 ms (no tracing GC) 0.00 ms 0.00 ms 1.84 ms
Heap fragmentation < 1.5% 14.2% 4.1% 18.5%
Clean build time 0.42 s 0.38 s 2.61 s 0.85 s

Across the evaluated workloads, 82.4% of allocations were classified as region-confined. These allocations were reclaimed through region teardown rather than individual object destruction. The remaining 17.6% required promotion or other escape-handling mechanisms.

The results indicate that region inference can substantially reduce the number of allocations requiring reference-counting or tracing-based reclamation.

Measurement Context

The primary test environment is a 2015 Intel Core i7-6700HQ laptop. Results are internal and have not yet been independently reproduced. The methodology publishes reproducibility data points including compiler versions, flags, warm-up procedures, variance, and raw CSV data. Several hardware-counter measures such as cache and branch misses and multi-thread scaling curves are explicitly flagged as not yet measured. This paper therefore treats all quantitative claims as preliminary and encourages external replication.

5. Discussion

The primary contribution of Nyx is not the elimination of all runtime memory-management costs. Rather, it is the static classification of allocations according to lifetime. The actual research contribution is automatic lifetime classification that chooses between region allocation and reference-counted promotion.

For allocations whose lifetimes are statically bounded, Nyx provides:

For allocations that escape those bounds, Nyx falls back to reference-counted storage. This produces a hybrid memory-management model:

\[\text{Allocation} \rightarrow \begin{cases} \text{Region} & \text{if statically confined} \\ \text{ARC} & \text{if escaping} \\ \text{Atomic ARC} & \text{if cross-thread} \end{cases}\]

The approach therefore trades the complexity of explicit lifetime annotations for compiler-side escape analysis.

Distinction: Region Reclamation vs. ARC Reclamation

It is important to separate these two reclamation paths, as they have very different performance properties:

Claiming "zero overhead" for the region-confined case is defensible. Claiming it for all Nyx allocations is not — escaping objects pay for reference counting.

6. The Broader Nyx Platform

Nyx extends beyond a language runtime into a vertically integrated sovereign computing platform:

Compiler Architecture

The Nyx compiler pipeline is organised into seven phases: lexer, abstract-syntax-tree parser, type checker, region inference, monomorphizer, closure converter, and a generator that emits C, WebAssembly, LLVM intermediate representation, and mobile targets. The bootstrap compiler was written in Rust, and the compiler has subsequently been self-hosted in Nyx itself.

NyxOS and Capability Security

NyxOS is a sovereign microkernel operating system. The architecture replaces ambient authority with zero ambient authority enforced by cryptographic capability tokens. Every hardware resource requires an explicit 64-bit capability, and the Capability-Based Access Control (CBAC) model implements capability tokens and sandboxing at the kernel level. The microkernel adopts the same two-tier memory architecture at the operating-system scale.

Standard Library and Applications

A Tier-1 standard library accompanies the compiler, spanning HTTP, ORM, cryptography, machine learning, GIS, cloud, and a 120 FPS GPU user-interface engine. The flagship demonstration is Athena, an institutional quantitative trading workstation built entirely in Nyx and delivered as a single standalone binary of approximately 650 KB.

7. Limitations and Scope

The current evaluation does not establish that all workloads will achieve the observed 82.4% region-confinement rate. The proportion of region-confined allocations is workload-dependent.

Likewise, the absence of a tracing garbage collector does not imply that every Nyx allocation has zero reclamation cost. Escaping objects may require reference-count updates, and atomic reference counting introduces additional synchronization overhead.

The compilation results should also be interpreted carefully. A comparison of clean-build times across languages is affected by compiler architecture, optimization settings, standard-library size, incremental compilation behavior, hardware, and benchmark methodology.

Additional limitations:

Future work should therefore evaluate:

8. Conclusion

Nyx presents a memory-management model based on automatic region inference and selective reference-counted promotion. The compiler first attempts to prove that an allocation is confined to a region. When successful, the allocation receives deterministic bulk reclamation without tracing or per-object reference counting. When the allocation escapes, Nyx promotes it to reference-counted storage, using atomic reference counting when necessary for cross-thread ownership.

The resulting system provides a middle ground between manual memory management, tracing garbage collection, and explicit ownership systems.

The central hypothesis of Nyx is therefore:

Many allocations can be reclaimed according to statically inferred lifetime boundaries, allowing general-purpose memory safety without requiring a tracing collector or programmer-written lifetime annotations.

The preliminary benchmark results support this hypothesis for the evaluated workloads, while leaving broader workload generality and compiler-analysis costs as subjects for further investigation.

References

  1. Bala, S. (2026). Nyx, the zero-GC systems programming language [Computer software and documentation]. 9jaonCloud Engineering. github.com/9jaoncloud/nyx
  2. Bala, S. (2026a). The Nyx genesis and builder's journey [Web page]. 9jaonCloud. nyx.9jaoncloud.com.ng/about.html
  3. Bala, S. (2026b). The Nyx sovereign ecosystem: Architecture, security and market blueprint [White paper]. 9jaonCloud. nyx.9jaoncloud.com.ng/docs/whitepaper.html
  4. Bala, S. (2026c). The engineering genesis of NyxOS and NyxMobile [Web page]. 9jaonCloud. nyx.9jaoncloud.com.ng/about-nyxos.html
  5. Bala, S. (2026d). Empirical data and design evidence: Nyx region inference and compiler architecture (Document version 1.0.0) [Data file]. 9jaonCloud. nyx.9jaoncloud.com.ng/docs/nyx_region_inference_paper_data.md
  6. Bala, S. (2026e). Benchmark methodology and reproducibility [Web page]. 9jaonCloud. nyx.9jaoncloud.com.ng/docs/benchmark-methodology.html
  7. Grossman, D., Hicks, M., Morrisett, G., Jim, T., Wang, Y., & Cheney, J. (2002). Region-based memory management in Cyclone. Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation (PLDI '02), 34(5), 282–293. doi.org/10.1145/512529.512563
  8. Miller, M. (2019, February). Trends, challenges, and strategic shifts in the software vulnerability mitigation landscape [Conference keynote]. BlueHat IL, Israel.
  9. Parkinson, M., Vaswani, K., & the Verona team. (2016). Project Verona: A research programming language for concurrent ownership [Computer software]. Microsoft Research. microsoft.github.io/verona
  10. Tofte, M., & Talpin, J.-P. (1997). Region-based memory management. Information and Computation, 132(2), 109–176. doi.org/10.1006/inco.1996.2613
DOI: 10.13140/RG.2.2.34206.91209 · AFN-ID: AFN.1000/paper.2026.00001 · afnid.org.ng/papers/afn/AFN.1000/paper.2026.00001