Skip to content

Self-host M3: lower emit-TU spine before bridge - #2526

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-2442-emit-tu-bridge-order
May 26, 2026
Merged

Self-host M3: lower emit-TU spine before bridge#2526
PurHur merged 1 commit into
masterfrom
agent/issue-2442-emit-tu-bridge-order

Conversation

@PurHur

@PurHur PurHur commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register PHPCompiler\Compiler::compileEmitSmoke native decl during M3 emit-TU spine pre-lowering.
  • Flush pending lowering (runQueue) before emitting the M3 emit-TU native {main} bridge, avoiding binding to null-returning stubs.

Why

Emit-TU binaries were executing the native bridge against stubbed Runtime/Compiler symbols, producing parseAndCompile returned null and forcing emit_path=zend partial in self-host probes.

This matches the root cause described in #2442 (sub-issue #2512).

Verification (Docker)

./script/docker-exec.sh -- bash -lc '
  composer install --no-interaction --prefer-dist --ignore-platform-reqs >/dev/null \
  && ./script/apply-patches.sh >/dev/null \
  && source script/php-env.sh \
  && BOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 \
     BOOTSTRAP_M3_COMPILE_DRIVER_REAL_LOWERING=1 \
     BOOTSTRAP_M3_RUNTIME_COMPILE=1 \
     ./script/bootstrap-selfhost-helloworld-probe.sh
'

Made with Cursor

Ensure Compiler::compileEmitSmoke native decl is registered and flush pending lowering before emitting the native emit-TU main bridge, avoiding stubs that return null during self-host emit probes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 78d5629 into master May 26, 2026
@PurHur
PurHur deleted the agent/issue-2442-emit-tu-bridge-order branch June 3, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant