Skip to content

Self-host M3: bootstrap-m3-emit-tu-execute.sh green (emit helper run, no Zend) #2552

Closed

Description

@PurHur

Milestone

M3 — narrow execute gate for emit-helper TU (parent #1492 / #1937)

Problem

script/bootstrap-m3-emit-tu-execute.sh exists but is not a default bootstrap step. Failures surface only inside larger probes (bootstrap-selfhost-*-probe.sh).

May 2026 status: emit-helper link is green for all three TUs; execute fails uniformly at:

parseAndCompile returned null (parser/CFG spine)
native emit failed at phase=parseAndCompile

Root fix: #2566 (parse bridge) + #2568 (init pipeline stubs). This issue owns wiring the script as a fast bisect gate once spine is green.

Scope

Path Change
script/bootstrap-m3-emit-tu-execute.sh Harness-safe execute gate; clear exit codes + phase= hints
test/bootstrap-aot/runtime_m3_emit_native_entry.php Default entry (smallest TU)
Makefile make bootstrap-m3-emit-tu-execute target
docs/bootstrap-selfhost.md Gate table row next to HelloWorld probe

Repro (fails today)

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  export PHP_COMPILER_SELFHOST_AOT=1
  BOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 \
  BOOTSTRAP_M3_COMPILE_DRIVER_REAL_LOWERING=1 \
  BOOTSTRAP_M3_RUNTIME_COMPILE=1 \
  ./script/bootstrap-m3-emit-tu-execute.sh
'
# Today: parseAndCompile returned null → blocked on #2566 / #2568

Done when

  • Script exits 0 and prints success marker when emit TU compiles trivial fixture to disk (runtime_compile_smoke_m3_emit: compile OK)
  • Fails closed with phase= / NEXT_LOWER hints (no silent Zend fallback)
  • Documented in docs/bootstrap-selfhost.md gate table
  • Optional: default-on in bootstrap-wave-check.sh --with-m3-emit-execute after green

Labels

suggested: self-host, bootstrap

Epic #1492 · Root #2566 · Init #2568 · TU ladder #2559 · #2561 · #2567 · Downstream #2540

Activity

  1. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Implementation-ready spec (backlog-architect, May 2026 harness)

    Gate name: bootstrap-m3-emit-tu-execute (not default in wave-check; wire after green)

    Current failure (master, Docker):

    Repro (execute-only after link):

    ./script/docker-exec.sh -- bash -lc '
      source script/php-env.sh
      BOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 BOOTSTRAP_M3_RUNTIME_COMPILE=1 \
      PHP_COMPILER_EMIT_HELPER_LINK=1 \
      ./script/bootstrap-m3-emit-tu-execute.sh
    '

    Files:

    Path Role
    script/bootstrap-m3-emit-tu-execute.sh Exit 0/1/2 contract; assert stdout needles
    test/bootstrap-aot/runtime_m3_emit_native_entry.php Default ENTRY for bisect
    test/bootstrap-aot/compile_smoke_m3_emit_native_entry.php Mid TU
    test/bootstrap-aot/helloworld_m3_emit_native_entry.php Full TU

    Done when: script exits 0 on harness for runtime TU first, then compile_smoke, then helloworld (no Zend).

  2. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Spine wiring landed in #2562: RuntimeEmitTuInit, bootstrap-m3-emit-tu-execute M3 compile-driver link, restored Runtime.php module pre-lower from #2557. Emit helper links; execute still blocked at native parseAndCompile (parser spine) — tracks #2442.

  3. added a commit that references this issue on May 26, 2026
  4. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Reopened: emit-helper link is green on master, but script/bootstrap-m3-emit-tu-execute.sh still fails at phase=parseAndCompile (null Block). Update gate to bisect #2566 / #2568 before #2540 execute segfault. See #1492 M3 ladder.

  5. reopened this on May 26, 2026
  6. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Closed (backlog-architect 2026-05-26): ./script/bootstrap-m3-emit-tu-execute.sh is green on master in php-compiler:22.04-dev — bootstrap-m3-emit-tu-execute: OK … m3-emit-tu-aot stdout: 1. Remaining work is default-on in wave-check/CI (#2494) and Makefile doc row if missing; root parse/init tracked under #2599 if emit-TU regresses without env flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions