Milestone
M5 — production bootstrap driver native emit (parent #1492 / #2600 / #1521)
Problem
M3 strict ladder and M4 loop slice are green on harness 2026-05-27, but gen-1 cannot native-emit bin/compile.php via ./build/selfhost-helloworld-compile:
helloworld_compile_smoke: parseAndCompile returned null (parser/CFG spine)
helloworld_compile_smoke: native emit failed at phase=parseAndCompile
Root cause (link-time): emit-helper link registers M3 sidecars in lib/JIT.php::registerM3EmitTuSidecarFromPath(). lib/Compiler.php sidecar is present; bin/compile.php sidecar is missing:
./script/docker-exec.sh -- bash -lc '
./script/bootstrap-selfhost-helloworld-compile-bin.sh >/dev/null
ls -la build/.m3_compiler_php_aot_blob build/.m3_bin_compile_aot_blob
'
# .m3_compiler_php_aot_blob: ~176 KiB
# .m3_bin_compile_aot_blob: MISSING
Sidecar host-compile subprocess segfaults:
./script/docker-exec.sh -- bash -lc '
source script/php-env.sh
export PHP_COMPILER_SELFHOST_AOT=1
unset PHP_COMPILER_EMIT_HELPER_LINK PHP_COMPILER_M3_EMIT_TU
php bin/compile.php -o /tmp/bin-compile-sidecar bin/compile.php
echo exit:$?
'
# exit:139 (Segmentation fault) — no output binary
Without the sidecar, native BootstrapCompileSmokeM3Emit falls through to real compileEmitSmoke and returns null for driver-scale CFG.
Scope
| Path |
Work |
lib/JIT.php |
registerM3EmitTuSidecarFromPath() — surface sidecar failure (stderr) instead of silent skip |
lib/JIT/M3EmitTuTrivialEchoAot.php |
BIN_COMPILE_SIDECAR_REL registration |
bin/compile.php |
First LLVM/JIT crash site under PHP_COMPILER_SELFHOST_AOT=1 full AOT link |
lib/JIT/BootstrapCompileSmokeM3Emit.php |
Native bridge when sidecar absent (real lowering vs honest error) |
lib/Web/LiteralIncludeDiscovery.php, lib/Web/SourceBundler.php |
Likely hot path in bin/compile.php vs lib/Compiler.php |
Repro
# M5 driver emit (fails today):
./script/docker-exec.sh -- bash -lc '
export PHP_COMPILER_M3_SOURCE=/compiler/bin/compile.php
export PHP_COMPILER_M3_OUT=/compiler/build/compile-php-aot
./script/bootstrap-selfhost-helloworld-compile-bin.sh
'
# Sidecar segfault (link-time blocker):
./script/docker-exec.sh -- bash -lc '
source script/php-env.sh
export PHP_COMPILER_SELFHOST_AOT=1
php bin/compile.php -o /tmp/out bin/compile.php; echo exit:$?
'
Contrast (green): PHP_COMPILER_M3_SOURCE=lib/Compiler.php via same script → compile OK.
Done when
Labels
self-host, bootstrap, IMPORTANT
Links
#2600 · #1521 · #2540 · #2633 (closed — symptom moved to sidecar root cause) · #1492
Milestone
M5 — production bootstrap driver native emit (parent #1492 / #2600 / #1521)
Problem
M3 strict ladder and M4 loop slice are green on harness 2026-05-27, but gen-1 cannot native-emit
bin/compile.phpvia./build/selfhost-helloworld-compile:Root cause (link-time): emit-helper link registers M3 sidecars in
lib/JIT.php::registerM3EmitTuSidecarFromPath().lib/Compiler.phpsidecar is present;bin/compile.phpsidecar is missing:Sidecar host-compile subprocess segfaults:
Without the sidecar, native
BootstrapCompileSmokeM3Emitfalls through to realcompileEmitSmokeand returns null for driver-scale CFG.Scope
lib/JIT.phpregisterM3EmitTuSidecarFromPath()— surface sidecar failure (stderr) instead of silent skiplib/JIT/M3EmitTuTrivialEchoAot.phpBIN_COMPILE_SIDECAR_RELregistrationbin/compile.phpPHP_COMPILER_SELFHOST_AOT=1full AOT linklib/JIT/BootstrapCompileSmokeM3Emit.phplib/Web/LiteralIncludeDiscovery.php,lib/Web/SourceBundler.phpbin/compile.phpvslib/Compiler.phpRepro
Contrast (green):
PHP_COMPILER_M3_SOURCE=lib/Compiler.phpvia same script →compile OK.Done when
php bin/compile.php -o /tmp/out bin/compile.phpwithPHP_COMPILER_SELFHOST_AOT=1exits 0 and writes executable (no segfault)./script/bootstrap-selfhost-helloworld-compile-bin.sh,build/.m3_bin_compile_aot_blobexists./build/selfhost-helloworld-compilewithPHP_COMPILER_M3_SOURCE=bin/compile.phplogshelloworld_compile_smoke: compile OKLabels
self-host,bootstrap,IMPORTANTLinks
#2600 · #1521 · #2540 · #2633 (closed — symptom moved to sidecar root cause) · #1492