Skip to content

Self-host M4: bootstrap_loop gen-2 native emit — parseAndCompile returned null #2560

Closed

Description

@PurHur

Milestone

M4 — gen-2 native emit on bootstrap_loop_smoke (parent #1498 / #1492)

Problem

With native M4 flags, gen-1 link succeeds but gen-2 compile uses Zend fallback:

bootstrap-loop-gen1-link: gen-2 emit_path=zend (bin/compile.php) — native emit failed at phase=parseAndCompile
bootstrap-loop-gen1-link: OK emit_path=zend partial ... (gen-1 native compile blocked)

Same emit-TU spine failure as M3 runtime probe; blocks honest M4 loop before gen-1 can execute compiled bin/compile.php.

Scope

Area Path
Loop scaffold test/selfhost/bootstrap_loop_smoke/
Gen-1 link script/bootstrap-loop-gen1-link.sh
Gen-2 emit entry loop smoke emit helper + lib/JIT/BootstrapCompileSmokeM3Emit.php
JIT lib/JIT.php emit-TU path

Repro

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  BOOTSTRAP_M4_LINK_COMPILE_DRIVER=1 \
  BOOTSTRAP_M4_RUNTIME_COMPILE=1 \
  ./script/bootstrap-loop-gen1-link.sh
'
# gen-2: parseAndCompile returned null → emit_path=zend partial

Strict (refuses Zend):

BOOTSTRAP_M4_GEN2_STRICT=1 BOOTSTRAP_M4_LINK_COMPILE_DRIVER=1 \
  BOOTSTRAP_M4_RUNTIME_COMPILE=1 \
  ./script/bootstrap-loop-gen1-link.sh

Done when

Labels

self-host, bootstrap, IMPORTANT

Epic #1492 · #2551 (gen-1 execute) · #2075 · #2541

Activity

  1. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Superseded scope note (2026-05-26): With BOOTSTRAP_M4_RUNTIME_COMPILE=1, gen-2 parseAndCompile is no longer null — emit_path=native and compiler smoke stdout. Keep open only for default-off dry-run path; primary work moved to #2599 (runtime init) + #2598 (presenter env). Consider closing after #2599 lands.

  2. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Harness verification (2026-05-26 backlog-architect)

    Repro on master via ./script/docker-exec.sh (php-compiler:22.04-dev):

    make bootstrap-loop-probe          # exit 0 — M3 strict + M4 gen-2 native slice
    make bootstrap-loop-gen1-link      # emit_path=native; gen-2 stdout: compiler smoke
    BOOTSTRAP_M4_GEN2_STRICT=1 make bootstrap-loop-gen1-link  # native, no Zend fallback
    ./script/north-star4-verify.sh --strict  # OK

    Closing as fixed on master — remaining gaps tracked in #2611 (script defaults without Makefile env) and #2600 (gen-1 compiles bin/compile.php spine, not loop smoke slice only).

    Parent #1492 updated.

  3. PurHur commented on May 26, 2026

    @PurHur
    OwnerAuthor

    Verified green on master 2026-05-26; follow #2611 / #2600 for remaining M4/M5 scope.

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