Skip to content

Split-TU: fast-exit after SPINE_CHUNK AOT emit (#36155) - #36234

Merged
PurHur merged 1 commit into
masterfrom
fix/spine-chunk-aot-fast-exit-36155
Sep 1, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/spine-chunk-aot-fast-exit-36155

Conversation

@PurHur

@PurHur PurHur commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend AotEmitFastExit::exitAfterSuccessfulSelfhostEmit() to honor PHP_COMPILER_SPINE_CHUNK=1, not only test/selfhost/ paths and PHP_COMPILER_SELFHOST_AOT=1.
  • Belt-and-suspenders in bin/compile.php: call fast-exit after successful emit when ExternalMethodBind::spineChunkMode() is on.
  • Add unit assertions in SelfhostAotFastExitTest.

Why: Spine split-TU hub/consumer chunks (script/spine-chunk-probe.sh, bootstrap-gen0-chunk-emit.sh) compile build/micro/chunk/*.php with SPINE_CHUNK=1. bin/compile.php treats those as user-script AOT and clears SELFHOST_AOT, so LLVM teardown after a successful -o link could spin 15+ min (#31726) even though the binary was already runnable. This blocked Phase B/C hub manifest export timing out at 600–900s wall (compile + hang).

Not in scope: Core hub JIT compile of spine-chunk-core-requires.txt still exceeds 10 min on this host — separate compile-time work, not post-emit hang.

Closes #36155 (follow-up slice).

Test plan

./script/phpunit.sh --filter SelfhostAotFastExitTest
# OK (9 tests, 27 assertions)

make dev-verify-fast
# OK (72s) — aot-smoke 8/8, VM differential tier-0 15/15

./script/docker-exec.sh -- bash -lc 'echo "<?php echo 1;" > /tmp/tiny.php && env PHP_COMPILER_SPINE_CHUNK=1 php bin/compile.php -o /tmp/tiny.bin /tmp/tiny.php'
# EXIT:0 ~6s, /tmp/tiny.bin non-empty

Made with Cursor

Spine hub/consumer chunk compiles set PHP_COMPILER_SPINE_CHUNK=1 but
bin/compile.php classifies build/micro/chunk paths as user-script AOT
and clears SELFHOST_AOT, so post-emit LLVM teardown could spin 15+ min
after -o was already linked (#31726). Extend AotEmitFastExit and the
compile.php belt-and-suspenders path to treat SPINE_CHUNK like self-host
emit success.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit efb52c2 into master Sep 1, 2026
1 check passed
@PurHur
PurHur deleted the fix/spine-chunk-aot-fast-exit-36155 branch September 1, 2026 19:38
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.

Incremental chunked gen-0: checkpointed emit, cross-chunk binding, parallel spine build

1 participant