Skip to content

Self-host M5: fix M3 emit sidecar LLVM verify for cli_driver/bin/compile (#3023)#3177

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-3023-try-catch-dispatch
May 30, 2026
Merged

Self-host M5: fix M3 emit sidecar LLVM verify for cli_driver/bin/compile (#3023)#3177
PurHur merged 2 commits into
masterfrom
agent/issue-3023-try-catch-dispatch

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 29, 2026

Summary

  • Fixes invalid PHI predecessors in BootstrapCompileSmokeM3Emit::emitRuntimeParseAndCompileDefault() — the tail merge block is reached via afterRecordBb, not compileBb, which caused LLVM module verify failures during bin/compile.php sidecar host-compile.
  • Emits native stub bodies for M3-bridge-only Runtime diagnostic helpers (peekLastParseFailure, noteParseCompileNullForScript) so inventory argv sidecars link without undefined symbols.
  • Registers diagnostic Runtime spine methods on inventory emit driver paths (belt-and-suspenders with stubs).

Try/catch cross-function dispatch BB isolation was already fixed in #3012 (TryCatchState::reset() per queued CFG function + TryCatchHelper::dispatchBbFor() parent check); TryCatchJitCompileTest::testTryCatchModulesVerify covers the repro.

php-src reference

N/A (bootstrap LLVM emit / self-host path).

Test plan

  • ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter TryCatchJitCompileTest'
  • ./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-driver-smoke' — stages 0–5 green, no sidecar exit 255
  • Inventory argv: php bin/compile.php -o build/bin-compile-aot bin/compile.php with BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1

Closes #3023

Made with Cursor

PurHur and others added 2 commits May 29, 2026 14:56
Correct parse-and-compile tail phi predecessors and emit diagnostic
Runtime spine stubs so bin/compile.php inventory sidecars link cleanly;
try/catch dispatch cross-function isolation remains covered by #3012.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep #3023 tail phi fix (compileBb via afterRecord, not direct).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 7d68ab0 into master May 30, 2026
@PurHur PurHur deleted the agent/issue-3023-try-catch-dispatch branch May 30, 2026 05: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.

Self-host M5: cli_driver m3 sidecar LLVM verify — try_catch_dispatch cross-function basic block

1 participant