Repository navigation
Self-host M5: gen-1 binary compiles bin/compile.php spine (full driver, not loop smoke slice) #2600
Copy link
Copy link
Closed
Labels
MOST IMPORTANTThis are the most important targetsThis are the most important targetsarea:compilerCompiler / CFG / JITCompiler / CFG / JITphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevEx
Description
Milestone
M5 — gen-1 native binary compiles the production bootstrap driver (parent #1492 / #1521)
Problem
M4 loop slice is green on master (2026-05-27 harness):
./script/docker-exec.sh -- bash -lc 'make bootstrap-loop-probe'
# bootstrap-loop-probe: M4 gen-1→gen-2 native slice OK (exit 0)That only compiles test/selfhost/bootstrap_loop_smoke/ → compiler smoke via compile_smoke_m3_emit_native_entry.php. It does not prove gen-1 can compile bin/compile.php / full spine for the next compiler revision.
First observed M5 failure (2026-05-27): native emit of bin/compile.php via helloworld emit helper:
helloworld_compile_smoke: parseAndCompile returned null (parser/CFG spine)
helloworld_compile_smoke: native emit failed at phase=parseAndCompile
Tracked in detail: #2633 (child issue).
Scope
| Path | Work |
|---|---|
bin/compile.php |
Gen-1 compile target (or documented spine slice toward full entry) |
test/selfhost/bootstrap_loop_smoke/compile_driver.php |
Extend dispatch toward bin/compile.php path |
script/bootstrap-loop-gen1-link.sh |
New env e.g. BOOTSTRAP_M5_GEN1_COMPILE_BIN_COMPILE=1 |
lib/Compiler.php, lib/JIT.php, spine bundle |
Lowering/stubs for full driver hot path (#2632 spine growth) |
lib/AOT/Linker.php |
M5 external-clang floor (#2514) |
Repro
# Green today (slice only):
./script/docker-exec.sh -- bash -lc 'make bootstrap-loop-probe'
# Fails today — native emit production driver:
./script/docker-exec.sh -- bash -lc '
source script/php-env.sh
BOOTSTRAP_M3_HELLOWORLD_STRICT=1 make bootstrap-selfhost-helloworld
PHP_COMPILER_M3_COMPILE_MODE=compile \
PHP_COMPILER_M3_SOURCE=bin/compile.php \
PHP_COMPILER_M3_OUT=/tmp/bin-compile-aot \
./build/selfhost-helloworld-emit
'
# parseAndCompile returned null — see #2633
# Not yet defined — add in PR:
./script/docker-exec.sh -- bash -lc '
source script/php-env.sh
BOOTSTRAP_M5_GEN1_COMPILE_BIN_COMPILE=1 \
BOOTSTRAP_M4_LINK_COMPILE_DRIVER=1 \
BOOTSTRAP_M4_RUNTIME_COMPILE=1 \
./script/bootstrap-loop-gen1-link.sh
'Done when
- Gen-1 native binary compiles
bin/compile.php(or documented equivalent) → gen-2 AOT without Zendphp bin/compile.php(Self-host M5: native emit bin/compile.php fails — parseAndCompile returned null #2633 green) - Gen-2 artifact compiles minimal external PHP from full inventory path
- Unblocks M5: Bootstrap driver — run compiled bin/compile.php instead of Zend php #1521 (compiled bootstrap driver replaces Zend loop)
Labels
self-host, bootstrap, IMPORTANT
Links
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
MOST IMPORTANTThis are the most important targetsThis are the most important targetsarea:compilerCompiler / CFG / JITCompiler / CFG / JITphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevEx
Activity
Merge pull request #2635 from PurHur/agent/issue-2600-bin-compile-con…
Merge pull request #2696 from PurHur/agent/issue-2600-runtime-selfhos…
PurHur commentedon May 27, 2026
Merged #2696 (partial #2600):
Still open: host AOT of `bin/compile.php` fails at `Runtime::standalone()` with LLVM module verification (`Terminator found in the middle of a basic block`). Sidecar `.m3_bin_compile_aot_blob` is not registered; `make bootstrap-selfhost-helloworld-compile-bin` with `PHP_COMPILER_M3_SOURCE=bin/compile.php` still reports `parseAndCompile returned null`.
Next slice: Runtime::standalone / production-driver spine lowering for honest bin/compile.php sidecar host-compile.
PurHur commentedon May 27, 2026
Backlog reprioritize (2026-05-27 harness)
M4 loop slice is green. First M5 compile-path failure is now isolated:
php bin/compile.php -o /tmp/out bin/compile.phpwithPHP_COMPILER_SELFHOST_AOT=1→ segfault 139;build/.m3_bin_compile_aot_blobmissing at emit-helper linklib/Compiler.phpsidecar path green (misleading partial progress)Implement #2697 before expanding gen-1 driver probes in this issue.
Fix bootstrap-aot compile when PHP_COMPILER_SELFHOST_AOT=0 is preset. (…