0x0LearnReferenceLibraries0x0.jmp0x1b.com

Compiler And Memory Optimization Roadmap

This roadmap turns deep-research-report(5).html into implementable 0x0 work.

The report's central recommendation is a layered performance strategy: make the

default compiler incremental, cached, and parallel; make serious release builds

profile-guided and layout-aware; make allocation local, region-friendly, and

measurable; and keep expensive search, ML, and superoptimization off the hot

compile path until validation proves they are safe.

This roadmap is additive. It does not replace existing native performance,

runtime, ABI, package, or release gates. A milestone is done only when the

implementation, tests, diagnostics, release evidence, documentation, ADR/RFC

records, and public support status agree.

Research Summary

The dossier prioritizes these improvements for 0x0:

release builds;

machine code;

hooks, and NUMA-aware optional backends;

evidence;

remark reporting before aggressive optimization ships;

validated lanes.

Non-Goals

without validation and performance gates.

GC as generic defaults on targets that cannot prove support.

reproducibility, and regression gates also pass.

Standing Rules

and explainable.

or research lanes.

relevant validation gates.

and RSS evidence.

model, executable-memory policy, and fallback behavior.

Milestone 0: Research Baseline And Performance Ledger

Status: done.

Goal: turn the dossier into source-owned evidence and define what is already

implemented, what is planned, and what is intentionally deferred.

Submilestones:

0x0 files, missing implementation, owner, target milestone, and gate.

resolver, typed/effect IR, native IR, object emission, linker, static site

tools, package resolver, and app build paths.

runtime allocations, ABI v1 layouts, host buffers, app runtime buffers, and

generated artifacts.

single-file edit rebuild time, peak RSS, cache hit ratio, object size, link

time, binary size, startup time, and selected runtime counters.

validates the ledger and baseline schema without running heavy builds.

Acceptance:

perf/compiler-memory-research-ledger.tsv.

implemented.

perf/compiler-performance-surfaces.tsv and

perf/runtime-memory-surfaces.tsv.

budget policy in perf/compiler-memory-baseline-metrics.tsv.

Milestone 1: Query Engine And Incremental Compilation

Status: done.

Goal: make compiler work demand-driven, memoized, dependency-tracked, and

reusable across normal developer edits.

Submilestones:

signatures, imports, type/effect results, HIR, MIR, native IR, object output,

diagnostics, and documentation extraction.

and query dependency edges.

explicitly marked always-evaluate operations.

non-deterministic providers, dependency cycles, and invalidated cache roots.

edits, signature changes, package changes, and diagnostic-only changes.

Acceptance:

work where dependencies are green, as recorded in

compiler-query/incremental-scenarios.tsv.

release/compiler-query-graph-report.tsv report.

query was red.

purity, dependency cycles, red/green consistency, cache roots, diagnostics,

and incremental scenarios.

Milestone 2: Content-Addressed Storage And Build Artifact Cache

Status: open.

Goal: store compiler and toolchain outputs by content so rebuilds, package

resolution, profile reuse, and release verification share one deterministic

artifact model.

Submilestones:

native IR, object files, profile summaries, link order files, API docs, and

generated package metadata.

and schema migration.

object emission, and linker inputs.

and rollback tests.

Acceptance:

Milestone 3: Multi-Level Typed SSA Pipeline

Status: done.

Goal: split the compiler pipeline into clear IR levels that preserve semantic

facts early and bind target details late.

Submilestones:

hotness, and source-span metadata.

calls.

allocation, frame layout, branch forms, relocations, and object metadata.

level.

frontend decisions.

Acceptance:

boundary.

transition evidence.

lowering boundaries, dump manifests, verifier reports, backend transition

rows, and negative diagnostics.

Milestone 4: Fast Linker And Developer Build Loop

Status: done.

Goal: make edit-build-run fast before adding heavier optimization tiers.

Submilestones:

apps, and static site artifacts.

planning, archive index reads, and output writing where the current linker can

support it.

link order state from CAS.

symbol diagnostics.

package edits, and app edits.

Acceptance:

planning stages, incremental reuse, deterministic output hashes, stable

diagnostics, compatibility rows, and fixture failures.

native linker toolchain evidence check.

Milestone 5: PGO, Thin Summary Optimization, And Profile Plumbing

Status: done.

Goal: make the serious AOT optimization path profile-guided without slowing the

default developer path.

Submilestones:

probabilities, indirect-call targets, hot/cold blocks, startup windows, and

temporal order.

are available.

candidates, devirtualization candidates, and code size budgets.

promotion, branch layout, and hot/cold placement.

source diagnostics.

Acceptance:

evidence.

generation, deterministic merge, hosted sample intake, Thin summary rows,

profile-guided optimization decisions, stable diagnostics, performance

evidence, compatibility rows, and negative fixtures.

native post-link evidence check.

Milestone 6: Post-Link Layout Optimization

Status: done.

Goal: improve final binary layout after ordinary PGO and summary optimization.

Submilestones:

BOLT-like binary rewriting, or a 0x0-native ordering-file path.

the object format supports it.

startup page faults, and cold-start time where supported.

reliable sampled profiles.

Acceptance:

work.

metrics.

block-level metadata, generated and consumed order files, before/after

metrics, fallback policy, stable diagnostics, release reports, compatibility

rows, and negative fixtures.

make post-link-layout-check before the native post-link evidence check.

Milestone 7: Allocator Fast Paths And Page Backend

Status: done.

Goal: replace generic allocation behavior with a production allocator strategy

that keeps common paths local and cheap.

Submilestones:

realtime, test-fixture, and compiler-internal.

slow-path span refill.

fail-closed overflow behavior.

server targets.

allocation, fragmentation, large objects, exhaustion, and shutdown cleanup.

Acceptance:

points.

local free lists, local ownership, remote-free batching, transfer caches,

central page/span management, hugepage and NUMA hooks, stress reports,

diagnostics, compatibility rows, performance budgets, and negative fixtures.

before the native memory-control evidence check.

Milestone 8: Stack, Region, Arena, And Escape Promotion

Status: done.

Goal: make heap allocation the fallback by promoting short-lived and

non-escaping values to cheaper lifetime domains.

Submilestones:

actor, host-buffer, and FFI escape categories.

scope, transaction scope, and app runtime scope.

stack or region promotion.

promote.

Acceptance:

behavioral drift.

domains, scalar replacement, stack promotion, region and arena scopes,

dynamic heapification policy, stable diagnostics, release reports,

compatibility rows, performance budgets, and negative fixtures.

the broader escape-analysis evidence.

Milestone 9: RC, Regions, And Optional GC Decision

Status: done.

Goal: choose and implement the long-term managed memory semantics for 0x0

instead of mixing ad hoc conventions.

Submilestones:

precise reference counting with reuse, optional tracing GC, or target-specific

profiles.

analysis, cycle policy, diagnostics, and stress tests.

barrier, metadata, pointer, and target support policy.

actors, remote actors, Live values, and app runtime values.

Acceptance:

retain/release insertion policy, RC reuse, region and arena release, optional

GC target policy, ABI and host boundaries, actor mailbox retention, stable

diagnostics, stress reports, performance budgets, compatibility rows, and

negative fixtures.

before the broader native memory-control evidence.

Milestone 10: Copy-And-Patch Baseline JIT

Status: open.

Goal: add a fast hosted JIT tier only where 0x0 runtime use cases need immediate

native code generation.

Submilestones:

need with latency or throughput evidence.

safepoints, deopt metadata, executable-memory policy, and code-cache layout.

interpreter or VM-shaped runtime.

behavior, and code cache reclamation.

mismatch, executable-memory denial, and invalid branch targets.

Acceptance:

runtime latency, and correctness evidence.

Milestone 11: Validation, Sanitizers, And Miscompilation Defense

Status: open.

Goal: make aggressive optimization safe enough to ship.

Submilestones:

rewrites.

uninitialized reads, data races, undefined behavior, and aliasing

assumptions where the target supports them.

object/linker, and WASM-shaped paths where applicable.

expected cost impact.

memory, binary size, or runtime.

Acceptance:

release-risk exception.

validation result.

builds.

Milestone 12: Benchmarking, Profiling, And Performance Budgets

Status: open.

Goal: make performance claims reproducible and tied to workloads users care

about.

Submilestones:

speed, link time, compiler RSS, binary size, startup time, runtime throughput,

app latency, and allocator behavior.

quality, and pass timings.

release-note requirements.

Acceptance:

command.

Milestone 13: ML-Guided Heuristics

Status: open.

Goal: use ML only for narrow, replaceable, measured decisions where hand-tuned

heuristics are weak.

Submilestones:

allocation eviction, branch probability fallback, or layout policy tuning.

pressure, loop depth, and target features.

hand-written heuristics.

compiler binary.

benchmark outcome.

Acceptance:

Milestone 14: Equality Saturation And Superoptimization Research Lane

Status: open.

Goal: use expensive search only for narrow, validated optimization discovery.

Submilestones:

peepholes, vectorization candidates, or DSL fragments.

deterministic limits.

and benchmark checks before promotion.

with ADR/RFC evidence.

Acceptance:

performance evidence.

Milestone 15: Production Release Integration

Status: open.

Goal: make compiler and memory optimization a normal, auditable part of release

readiness.

Submilestones:

optimized AOT profile path, allocator, memory semantics, validation, and

performance budgets.

or research-only status.

allocator reports, validation reports, benchmark results, and rollback

controls.

AOT builds, profile-guided builds, post-link optimization, JIT, and research

lanes.

gates after all implementation milestones are done.

Acceptance:

artifacts and public support status.

Completion Signal

This roadmap is complete when:

non-default unless a release enables them;

research-only capabilities.