Skip to content

Self-host M3: compile-driver real lowering symbol batch tracker #1768

@PurHur

Description

@PurHur

Problem

M3 compile-driver native emit still falls back to Zend (emit_path=zend partial) because lib/JIT.php only real-lowers a hand-maintained allowlist (isM3CompileDriverRealLoweringName(), m3CompileDriverSpineDenyNames()). Each new symbol can link yet return null at execute until init/parse spine is real (#2566, #2568).

SSOT files

Piece Path
Allowlist / deny lib/JIT.phpisM3CompileDriverRealLoweringName(), m3CompileDriverSpineDenyNames(), compileRuntime*M3Native()
Snapshot guard docs/m3-allowlist-snapshot.txt#1905 / M3_ALLOWLIST_SYNC_GATE=1
Emit entries test/bootstrap-aot/*_m3_emit_native_entry.php
Init bridge lib/JIT/RuntimeEmitTuInit.php, lib/JIT/BootstrapCompileSmokeM3Emit.php
Stub policy lib/JIT/SelfHostBuiltinPolicy.php — retirement tracked in #1520
Playbook docs/bootstrap-m5-fast-path.md

Ordered batches (May 2026 harness status)

Batch A — Runtime bootstrap (ctor, initVmContext, parse pipeline)  ❌ BLOCKED
  Owner: #2568 (initParsePipeline/initCompiler/loadCoreModules)
  Gate:  BOOTSTRAP_M3_RUNTIME_COMPILE=1 ./script/bootstrap-selfhost-runtime-compile-smoke.sh
  Today: parseAndCompile returned null (link OK)

Batch B — Parse bridge (parseAndCompile / parseAndCompileEmitSmoke native)  ❌ BLOCKED
  Owner: #2566
  Gate:  same as Batch A + compile-smoke probe
  TU ladder: #2559 → #2561 → #2567

Batch C — Compiler::compileCfg* hot paths + stub retirement (#1520)  📋
  Gate:  COMPILER_DRIVER_SMOKE_GATE=1 make bootstrap-selfhost-compiler-driver-smoke

Batch D — Emit-TU execute gate  📋 (after A+B)
  Gate:  ./script/bootstrap-m3-emit-tu-execute.sh (#2552 reopened)

Batch E — Native bin/compile.php execute → #2466 (after Batch D + #2540 if needed)

After each batch:

php script/check-m3-allowlist-snapshot.php
BOOTSTRAP_M3_RUNTIME_COMPILE=1 ./script/bootstrap-selfhost-runtime-compile-smoke.sh
BOOTSTRAP_M3_HELLOWORLD_STRICT=1 ./script/bootstrap-selfhost-helloworld-probe.sh

Prerequisites

Acceptance criteria

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    MOST IMPORTANTThis are the most important targetsenhancementNew feature or requestphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions