From dbd244d41245a872e9b7c3c0213377e655d41c86 Mon Sep 17 00:00:00 2001 From: PurHur Date: Mon, 25 May 2026 22:35:53 +0000 Subject: [PATCH] CI: audit THROWSWEB AOT link gate llvm-tail wiring (#2178). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document ci-local link→execute order, add Doctor #2157 blocker notes, and assert ci_run_aot_link_phpunit precedes ThrowsWeb AOT execute in tests. Co-authored-by: Cursor --- docs/local-ci-matrix.md | 4 +++- lib/Doctor.php | 7 +++++-- test/unit/CiScriptsTest.php | 14 ++++++++++++++ test/unit/PhpcDoctorTest.php | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/local-ci-matrix.md b/docs/local-ci-matrix.md index 07f06618951..62e97eab1da 100644 --- a/docs/local-ci-matrix.md +++ b/docs/local-ci-matrix.md @@ -218,7 +218,9 @@ FILE_UPLOAD_WEB_DEPLOY_SMOKE_GATE=1 ./script/deploy-smoke.sh --example 006 ## 007-ThrowsWeb gates ([#2076](https://github.com/PurHur/php-compiler/issues/2076), [#2093](https://github.com/PurHur/php-compiler/issues/2093)) -Progressive ladder (VM throw/catch → AOT link → AOT execute). VM smoke default-on ([#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)); AOT gates opt-in until **#195** / **#57** / **#2101** land. Copy-paste ladder: `./phpc doctor --gates` (**#2102**). +Progressive ladder (VM throw/catch → AOT link → AOT execute). VM smoke default-on ([#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)); AOT gates opt-in until **#195** / **#57** / **#2101** land; execute default-on blocked on **#2157** (follow-up **#2135**). Copy-paste ladder: `./phpc doctor --gates` (**#2102**). + +**`ci-local.sh` llvm tail** (mirror **006** link → execute): `ci_run_aot_link_phpunit` (`@group aot-link`, honors `THROWSWEB_AOT_LINK_GATE`) runs before `ci_run_throws_web_aot_execute` (`@group throwsweb-aot-execute`, honors `THROWSWEB_AOT_SMOKE_GATE`) — audit **#2178**; default-on flip **#2135** after **#2157** ✅. | Stage | Variable | Default | When enabled | |-------|----------|---------|--------------| diff --git a/lib/Doctor.php b/lib/Doctor.php index fb76c4aa32f..b0918c1cb7c 100644 --- a/lib/Doctor.php +++ b/lib/Doctor.php @@ -606,7 +606,7 @@ private static function printThrowsWebSection(string $repoRoot): void $smokeDefault, $smokeOn, false, - 'make examples-throws-smoke · ci-fast/ci-local when THROWS_WEB_SMOKE_GATE=1 default (#2125)', + 'make examples-throws-smoke · examples-web-smoke.sh --throws-only · ci-fast (#2125)', '#2093' ); self::printSessionsWebGateRow( @@ -621,9 +621,12 @@ private static function printThrowsWebSection(string $repoRoot): void ); $aotStatus = $aotOn && $llvmReady ? '✅' : '📋'; $aotExecuteNote = $llvmReady - ? ($aotOn ? '#2101' : '#2101 · opt-in until throw/catch AOT green') + ? ($aotOn ? '#2101' : '#2101 · opt-in until #2157 AOT throw/catch green; default-on follow-up #2135') : 'LLVM required; #2101 when gate=1'; fwrite(STDOUT, " [{$aotStatus}] Stage 3 AOT execute — THROWSWEB_AOT_SMOKE_GATE default {$aotDefault} ({$aotExecuteNote})\n"); + if (!$aotOn && $llvmReady) { + fwrite(STDOUT, " Blocker: #2157 user-class ValidationError AOT execute before #2135 default flip\n"); + } fwrite(STDOUT, " PHPUnit: ./script/ci-local.sh --filter ThrowsWebAotExecuteTest\n"); fwrite(STDOUT, " Shell: THROWSWEB_AOT_SMOKE_GATE=1 EXAMPLES_AOT_SMOKE_ONLY=007 ./script/examples-aot-smoke.sh (#2104)\n"); diff --git a/test/unit/CiScriptsTest.php b/test/unit/CiScriptsTest.php index 7210f17bc91..ce9f0f4a89e 100644 --- a/test/unit/CiScriptsTest.php +++ b/test/unit/CiScriptsTest.php @@ -263,6 +263,16 @@ public function testCiLocalExcludesThrowsWebAotExecuteUnlessGateOn(): void $this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE:-0}', $body); } + public function testCiLocalRunsThrowsWebAotLinkBeforeExecute(): void + { + $local = (string) file_get_contents(dirname(__DIR__, 2).'/script/ci-local.sh'); + $linkPos = strpos($local, 'ci_run_aot_link_phpunit'); + $executePos = strpos($local, 'ci_run_throws_web_aot_execute'); + $this->assertNotFalse($linkPos, 'ci-local.sh must call ci_run_aot_link_phpunit'); + $this->assertNotFalse($executePos, 'ci-local.sh must call ci_run_throws_web_aot_execute'); + $this->assertLessThan($executePos, $linkPos, 'AOT link must run before ThrowsWeb AOT execute (#2178)'); + } + public function testCiFastHonorsMiniWebAppServeGate(): void { $fast = dirname(__DIR__, 2).'/script/ci-fast.sh'; @@ -1423,6 +1433,10 @@ public function testLocalCiMatrixDocumentsThrowsWebGates(): void $this->assertStringContainsString('test007ThrowsWebAotLink', $doc); $this->assertStringContainsString('ThrowsWebAotExecuteTest', $doc); $this->assertStringContainsString('#2102', $doc); + $this->assertStringContainsString('ci_run_aot_link_phpunit', $doc); + $this->assertStringContainsString('ci_run_throws_web_aot_execute', $doc); + $this->assertStringContainsString('#2178', $doc); + $this->assertStringContainsString('#2157', $doc); } public function testCiDefaultsEnvDefinesThrowsWebAotGatesOff(): void diff --git a/test/unit/PhpcDoctorTest.php b/test/unit/PhpcDoctorTest.php index efc1be58a73..e790614700f 100644 --- a/test/unit/PhpcDoctorTest.php +++ b/test/unit/PhpcDoctorTest.php @@ -184,6 +184,8 @@ public function testDoctorGatesPrintsMiniWebAppLadder(): void $this->assertStringContainsString('test007ThrowsWebAotLink', $result['stdout']); $this->assertStringContainsString('ThrowsWebAotExecuteTest', $result['stdout']); $this->assertStringContainsString('examples/007-ThrowsWeb/README.md', $result['stdout']); + $this->assertStringContainsString('#2157', $result['stdout']); + $this->assertStringContainsString('#2135', $result['stdout']); } /**