diff --git a/README.md b/README.md index b122973317e..38a498c9beb 100755 --- a/README.md +++ b/README.md @@ -115,9 +115,9 @@ Also: `phpc doctor` (env probe), `phpc validate-manifest`, `phpc cgi`. See `./ph | [003-MiniWebApp](examples/003-MiniWebApp/) | ✅ `phpc serve` ([#539](https://github.com/PurHur/php-compiler/issues/539)) | ✅ `phpc build --project` ([#752](https://github.com/PurHur/php-compiler/issues/752)) | ✅ native execute ([#764](https://github.com/PurHur/php-compiler/issues/764); [#1044](https://github.com/PurHur/php-compiler/issues/1044)) | ✅ deploy smoke ([#676](https://github.com/PurHur/php-compiler/issues/676), [#1530](https://github.com/PurHur/php-compiler/issues/1530)) | | [005-SessionsWeb](examples/005-SessionsWeb/) | ✅ `phpc serve` + session smoke ([#1881](https://github.com/PurHur/php-compiler/issues/1881), [#1887](https://github.com/PurHur/php-compiler/issues/1887)) | ✅ `phpc build` ([#1946](https://github.com/PurHur/php-compiler/issues/1946)) | ✅ AOT execute (`SESSIONS_WEB_AOT_SMOKE_GATE=1`, [#1891](https://github.com/PurHur/php-compiler/issues/1891)) | ✅ deploy smoke opt-in ([#1893](https://github.com/PurHur/php-compiler/issues/1893)) | | [006-FileUploadWeb](examples/006-FileUploadWeb/) | ✅ `phpc serve` + multipart smoke ([#1999](https://github.com/PurHur/php-compiler/issues/1999), [#2009](https://github.com/PurHur/php-compiler/issues/2009)) | ✅ `phpc build` ([#2011](https://github.com/PurHur/php-compiler/issues/2011)) | ✅ AOT execute (`FILE_UPLOAD_WEB_AOT_SMOKE_GATE=1` default, [#2012](https://github.com/PurHur/php-compiler/issues/2012)) | — | -| [007-ThrowsWeb](examples/007-ThrowsWeb/) | ✅ `phpc serve` + caught invalid POST ([#2076](https://github.com/PurHur/php-compiler/issues/2076); VM smoke `THROWS_WEB_SMOKE_GATE=1` default, [#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)) | 📋 deferred ([#2101](https://github.com/PurHur/php-compiler/issues/2101)) | 📋 deferred ([#2101](https://github.com/PurHur/php-compiler/issues/2101)) | — | +| [007-ThrowsWeb](examples/007-ThrowsWeb/) | ✅ `phpc serve` + caught invalid POST ([#2076](https://github.com/PurHur/php-compiler/issues/2076); VM smoke `THROWS_WEB_SMOKE_GATE=1` default, [#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)) | ✅ `THROWSWEB_AOT_LINK_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | ✅ `THROWSWEB_AOT_SMOKE_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | — | -`make examples-aot-smoke` links and executes 000–004 when LLVM is ready (003 execute green — [#764](https://github.com/PurHur/php-compiler/issues/764)); **006-FileUploadWeb** multipart execute when `FILE_UPLOAD_WEB_AOT_SMOKE_GATE=1` (default — [#2012](https://github.com/PurHur/php-compiler/issues/2012), [#2013](https://github.com/PurHur/php-compiler/issues/2013)). **007-ThrowsWeb** AOT link/execute when `THROWSWEB_AOT_*_GATE=1` (opt-in — [#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2104](https://github.com/PurHur/php-compiler/issues/2104)). **005-SessionsWeb** VM/session curls: `make examples-web-smoke` ([#1887](https://github.com/PurHur/php-compiler/issues/1887)). **007-ThrowsWeb** five-minute presenter curls: [docs/GETTING-STARTED.md §5b](docs/GETTING-STARTED.md) ([#2158](https://github.com/PurHur/php-compiler/issues/2158)). Per-example commands: [examples/README.md](examples/README.md). +`make examples-aot-smoke` links and executes 000–004 when LLVM is ready (003 execute green — [#764](https://github.com/PurHur/php-compiler/issues/764)); **006-FileUploadWeb** multipart execute when `FILE_UPLOAD_WEB_AOT_SMOKE_GATE=1` (default — [#2012](https://github.com/PurHur/php-compiler/issues/2012), [#2013](https://github.com/PurHur/php-compiler/issues/2013)). **007-ThrowsWeb** AOT link/execute when `THROWSWEB_AOT_*_GATE=1` (default — [#2135](https://github.com/PurHur/php-compiler/issues/2135), [#2101](https://github.com/PurHur/php-compiler/issues/2101)). **005-SessionsWeb** VM/session curls: `make examples-web-smoke` ([#1887](https://github.com/PurHur/php-compiler/issues/1887)). **007-ThrowsWeb** five-minute presenter curls: [docs/GETTING-STARTED.md §5b](docs/GETTING-STARTED.md) ([#2158](https://github.com/PurHur/php-compiler/issues/2158)). Per-example commands: [examples/README.md](examples/README.md). ### Capabilities diff --git a/docs/GETTING-STARTED.md b/docs/GETTING-STARTED.md index 61ece65f83d..b83b9ca7d0b 100644 --- a/docs/GETTING-STARTED.md +++ b/docs/GETTING-STARTED.md @@ -91,7 +91,7 @@ curl -s -F 'doc=@examples/006-FileUploadWeb/README.md' http://127.0.0.1:8080/exa curl -sf -X POST -d 'email=bad' http://127.0.0.1:8080/example.php | grep -i invalid ``` -**Talking point:** Caught exceptions in a web form without Zend PHP at dev time — same `throw` / `catch` path as production CGI. Automated curls: `make examples-throws-smoke` ([#2141](https://github.com/PurHur/php-compiler/issues/2141), [#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)). Gate ladder: `./phpc doctor --gates | grep -i throws` ([#2102](https://github.com/PurHur/php-compiler/issues/2102)). Native AOT link/execute for user-defined `ValidationError` is deferred ([#2157](https://github.com/PurHur/php-compiler/issues/2157); opt-in `THROWSWEB_AOT_*_GATE` — [#2101](https://github.com/PurHur/php-compiler/issues/2101)) — see [examples/007-ThrowsWeb/README.md](../examples/007-ThrowsWeb/README.md) and ROADMAP [#78](https://github.com/PurHur/php-compiler/issues/78). +**Talking point:** Caught exceptions in a web form without Zend PHP at dev time — same `throw` / `catch` path as production CGI. Automated curls: `make examples-throws-smoke` ([#2141](https://github.com/PurHur/php-compiler/issues/2141), [#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)). Gate ladder: `./phpc doctor --gates | grep -i throws` ([#2102](https://github.com/PurHur/php-compiler/issues/2102)). Native AOT link/execute for user-defined `ValidationError` is green ([#2157](https://github.com/PurHur/php-compiler/issues/2157); `THROWSWEB_AOT_*_GATE=1` default — [#2135](https://github.com/PurHur/php-compiler/issues/2135), [#2101](https://github.com/PurHur/php-compiler/issues/2101)) — see [examples/007-ThrowsWeb/README.md](../examples/007-ThrowsWeb/README.md) and ROADMAP [#78](https://github.com/PurHur/php-compiler/issues/78). ### 6. (Optional) Self-host smoke diff --git a/docs/capabilities-syntax.md b/docs/capabilities-syntax.md index 4b5667fa167..85a4307166b 100644 --- a/docs/capabilities-syntax.md +++ b/docs/capabilities-syntax.md @@ -100,9 +100,9 @@ ROADMAP Phase 4/5: [#78](https://github.com/PurHur/php-compiler/issues/78), trac | Construct | VM | JIT | AOT | Issue | Notes | |-----------|:--:|:---:|:---:|-------|-------| -| `007-ThrowsWeb` reference app | yes | yes | partial | [#2076](https://github.com/PurHur/php-compiler/issues/2076) | #2076 VM serve + caught invalid POST (THROWS_WEB_SMOKE_GATE default #2125); AOT deferred #2101/#2104 | -| `throw` / `catch` on invalid POST (web serve) | yes | yes | partial | [#195](https://github.com/PurHur/php-compiler/issues/195) | #195 throw lowering; #57 catch; #2084 compliance PHPT pack | -| AOT project link (`phpc build --project`) | n/a | n/a | partial | [#2101](https://github.com/PurHur/php-compiler/issues/2101) | ExamplesCompileTest 007 link; opt-in THROWSWEB_AOT_LINK_GATE (#2101) | -| AOT CGI execute (caught throw probe) | n/a | n/a | partial | [#2104](https://github.com/PurHur/php-compiler/issues/2104) | examples-aot-smoke 007 slice; opt-in THROWSWEB_AOT_SMOKE_GATE (#2104) | +| `007-ThrowsWeb` reference app | yes | yes | yes | [#2076](https://github.com/PurHur/php-compiler/issues/2076) | #2076 VM serve + caught invalid POST (THROWS_WEB_SMOKE_GATE default #2125); AOT link/execute default #2135 | +| `throw` / `catch` on invalid POST (web serve) | yes | yes | yes | [#195](https://github.com/PurHur/php-compiler/issues/195) | #195 throw lowering; #57 catch; #2084 compliance PHPT pack; user empty class AOT #2157 | +| AOT project link (`phpc build --project`) | n/a | n/a | yes | [#2101](https://github.com/PurHur/php-compiler/issues/2101) | ExamplesCompileTest 007 link; THROWSWEB_AOT_LINK_GATE default-on (#2135) | +| AOT CGI execute (caught throw probe) | n/a | n/a | yes | [#2104](https://github.com/PurHur/php-compiler/issues/2104) | examples-aot-smoke 007 slice; THROWSWEB_AOT_SMOKE_GATE default-on (#2135) | -_Throws rows are curated from ROADMAP issue state; `throw` [#195](https://github.com/PurHur/php-compiler/issues/195); `try`/`catch` [#57](https://github.com/PurHur/php-compiler/issues/57); overlay [#2084](https://github.com/PurHur/php-compiler/issues/2084). Opt-in ci-local gates: `THROWS_WEB_SMOKE_GATE` (VM serve default-on #2125), `THROWSWEB_AOT_LINK_GATE`, `THROWSWEB_AOT_SMOKE_GATE`._ +_Throws rows are curated from ROADMAP issue state; `throw` [#195](https://github.com/PurHur/php-compiler/issues/195); `try`/`catch` [#57](https://github.com/PurHur/php-compiler/issues/57); overlay [#2084](https://github.com/PurHur/php-compiler/issues/2084). ci-local gates: `THROWS_WEB_SMOKE_GATE` (VM serve default-on #2125), `THROWSWEB_AOT_LINK_GATE` / `THROWSWEB_AOT_SMOKE_GATE` (AOT default-on #2135; set `0` to skip)._ diff --git a/docs/local-ci-matrix.md b/docs/local-ci-matrix.md index 62e97eab1da..9b16ebdeabf 100644 --- a/docs/local-ci-matrix.md +++ b/docs/local-ci-matrix.md @@ -218,15 +218,15 @@ 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; execute default-on blocked on **#2157** (follow-up **#2135**). 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 default-on ([#2135](https://github.com/PurHur/php-compiler/issues/2135), [#2157](https://github.com/PurHur/php-compiler/issues/2157)). 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** ✅. +**`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 **#2135** after **#2157** ✅. | Stage | Variable | Default | When enabled | |-------|----------|---------|--------------| | VM throw/catch | `THROWS_WEB_SMOKE_GATE` | `1` | `make examples-throws-smoke` · `ci-fast.sh` ([#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)) | -| AOT link | `THROWSWEB_AOT_LINK_GATE` | `0` | `./script/ci-local.sh --filter test007ThrowsWebAotLink` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2143](https://github.com/PurHur/php-compiler/issues/2143)) | -| AOT execute | `THROWSWEB_AOT_SMOKE_GATE` | `0` | `ThrowsWebAotExecuteTest` or `EXAMPLES_AOT_SMOKE_ONLY=007 ./script/examples-aot-smoke.sh` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2104](https://github.com/PurHur/php-compiler/issues/2104)) | +| AOT link | `THROWSWEB_AOT_LINK_GATE` | `1` | `./script/ci-local.sh --filter test007ThrowsWebAotLink` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)); set `0` to skip during iteration | +| AOT execute | `THROWSWEB_AOT_SMOKE_GATE` | `1` | `ThrowsWebAotExecuteTest` or `EXAMPLES_AOT_SMOKE_ONLY=007 ./script/examples-aot-smoke.sh` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | ```bash ./phpc doctor --gates | grep -E 'THROWS|007-ThrowsWeb' diff --git a/docs/pages/development-status.md b/docs/pages/development-status.md index 3eb99f0d2f0..9739d76afa1 100644 --- a/docs/pages/development-status.md +++ b/docs/pages/development-status.md @@ -104,7 +104,7 @@ The `examples/` tree (**000–007**) is kept for **VM + AOT regression testing** | [003-MiniWebApp](https://github.com/PurHur/php-compiler/tree/master/examples/003-MiniWebApp) | Multi-file web app (router, templates, CGI superglobals) | Default-on gates: lint, VM, AOT link/execute ([#472](https://github.com/PurHur/php-compiler/issues/472)) | | [005-SessionsWeb](https://github.com/PurHur/php-compiler/tree/master/examples/005-SessionsWeb) | Session/cookie smoke | Opt-in `SESSIONS_WEB_*` gates | | [006-FileUploadWeb](https://github.com/PurHur/php-compiler/tree/master/examples/006-FileUploadWeb) | Multipart upload smoke | Opt-in `FILE_UPLOAD_WEB_*` gates | -| [007-ThrowsWeb](https://github.com/PurHur/php-compiler/tree/master/examples/007-ThrowsWeb) | `throw` / `catch` on invalid POST ([#2076](https://github.com/PurHur/php-compiler/issues/2076)) | VM `THROWS_WEB_SMOKE_GATE=1` default ([#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)); AOT opt-in `THROWSWEB_*` ([#2101](https://github.com/PurHur/php-compiler/issues/2101)) | +| [007-ThrowsWeb](https://github.com/PurHur/php-compiler/tree/master/examples/007-ThrowsWeb) | `throw` / `catch` on invalid POST ([#2076](https://github.com/PurHur/php-compiler/issues/2076)) | VM `THROWS_WEB_SMOKE_GATE=1` default ([#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)); AOT `THROWSWEB_*_GATE=1` default ([#2135](https://github.com/PurHur/php-compiler/issues/2135)) | **Verify (optional):** `./phpc doctor --gates`, `make miniwebapp-gates`, or `make north-star1-verify` (legacy name — example regression bundle, not a north star). Details: [miniwebapp-gates.md](https://github.com/PurHur/php-compiler/blob/master/docs/miniwebapp-gates.md) (repo only). Historical tracker [#1044](https://github.com/PurHur/php-compiler/issues/1044) is closed; do not open new “north star web app” issues. @@ -217,7 +217,7 @@ GitHub issues use labels `phase-0:Foundation` … `phase-5:reference-app`. Deliv | 003-MiniWebApp | ✅ | ✅ | ✅ ([#764](https://github.com/PurHur/php-compiler/issues/764), [#676](https://github.com/PurHur/php-compiler/issues/676)) | Primary web integration test | | 005-SessionsWeb | ✅ `phpc serve` + `SESSIONS_WEB_SMOKE_GATE=1` ([#1887](https://github.com/PurHur/php-compiler/issues/1887)) | ✅ `SESSIONS_WEB_AOT_LINK_GATE=1` ([#1946](https://github.com/PurHur/php-compiler/issues/1946)) | ✅ opt-in `SESSIONS_WEB_AOT_SMOKE_GATE=1` ([#1891](https://github.com/PurHur/php-compiler/issues/1891), [#1923](https://github.com/PurHur/php-compiler/issues/1923)) | Deploy smoke opt-in `SESSIONS_WEB_DEPLOY_SMOKE_GATE=1` ([#1893](https://github.com/PurHur/php-compiler/issues/1893)); default-on tracked in [#1954](https://github.com/PurHur/php-compiler/issues/1954) / [#1967](https://github.com/PurHur/php-compiler/issues/1967) | | 006-FileUploadWeb | ✅ `phpc serve` + `FILE_UPLOAD_WEB_SMOKE_GATE=1` ([#2009](https://github.com/PurHur/php-compiler/issues/2009)) | ✅ `FILE_UPLOAD_WEB_AOT_LINK_GATE=1` ([#2011](https://github.com/PurHur/php-compiler/issues/2011)) | ✅ `FILE_UPLOAD_WEB_AOT_SMOKE_GATE=1` ([#2012](https://github.com/PurHur/php-compiler/issues/2012)) | Deploy smoke opt-in `FILE_UPLOAD_WEB_DEPLOY_SMOKE_GATE=1` ([#2038](https://github.com/PurHur/php-compiler/issues/2038)); default-on tracked in [#2042](https://github.com/PurHur/php-compiler/issues/2042) | -| 007-ThrowsWeb | ✅ `phpc serve` + `THROWS_WEB_SMOKE_GATE=1` ([#2076](https://github.com/PurHur/php-compiler/issues/2076), [#2093](https://github.com/PurHur/php-compiler/issues/2093)) | 📋 opt-in `THROWSWEB_AOT_LINK_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101)) | 📋 opt-in `THROWSWEB_AOT_SMOKE_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2104](https://github.com/PurHur/php-compiler/issues/2104)) | `make examples-throws-smoke` ([#2141](https://github.com/PurHur/php-compiler/issues/2141)); deploy smoke tracked in [#2124](https://github.com/PurHur/php-compiler/issues/2124) | +| 007-ThrowsWeb | ✅ `phpc serve` + `THROWS_WEB_SMOKE_GATE=1` ([#2076](https://github.com/PurHur/php-compiler/issues/2076), [#2093](https://github.com/PurHur/php-compiler/issues/2093)) | ✅ `THROWSWEB_AOT_LINK_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | ✅ `THROWSWEB_AOT_SMOKE_GATE=1` ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | `make examples-throws-smoke` ([#2141](https://github.com/PurHur/php-compiler/issues/2141)); deploy smoke tracked in [#2124](https://github.com/PurHur/php-compiler/issues/2124) | Commands: `./phpc run`, `./phpc build`, `./phpc serve`, `make examples-aot-smoke` (see [README](https://github.com/PurHur/php-compiler/blob/master/README.md) and [examples/README.md](https://github.com/PurHur/php-compiler/blob/master/examples/README.md)). diff --git a/examples/007-ThrowsWeb/README.md b/examples/007-ThrowsWeb/README.md index e045e9e1360..e355c7e41a4 100644 --- a/examples/007-ThrowsWeb/README.md +++ b/examples/007-ThrowsWeb/README.md @@ -17,7 +17,8 @@ curl -sf -X POST -d 'email=bad' http://127.0.0.1:8080/example.php | grep -i inva |-------|-------| | VM `phpc run` | ✅ GET — empty state | | VM `phpc serve` | ✅ caught invalid POST (`THROWS_WEB_SMOKE_GATE=1` default, [#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)) | -| JIT / AOT | 📋 deferred — [#2101](https://github.com/PurHur/php-compiler/issues/2101) / [#2104](https://github.com/PurHur/php-compiler/issues/2104) | +| AOT `phpc build` + execute | ✅ caught invalid POST ([#2157](https://github.com/PurHur/php-compiler/issues/2157), [#2135](https://github.com/PurHur/php-compiler/issues/2135)) | +| JIT | 📋 deferred — [#2167](https://github.com/PurHur/php-compiler/issues/2167) | ## CI gates @@ -30,8 +31,10 @@ Defaults from `script/ci-defaults.env`: | Stage | Gate | Default | Command | |-------|------|---------|---------| | VM serve | `THROWS_WEB_SMOKE_GATE` | `1` | `make examples-throws-smoke` · `ci-fast.sh` ([#2125](https://github.com/PurHur/php-compiler/issues/2125)) | +| AOT link | `THROWSWEB_AOT_LINK_GATE` | `1` | `./script/ci-local.sh --filter test007ThrowsWebAotLink` ([#2135](https://github.com/PurHur/php-compiler/issues/2135)) | +| AOT execute | `THROWSWEB_AOT_SMOKE_GATE` | `1` | `ThrowsWebAotExecuteTest` · `EXAMPLES_AOT_SMOKE_ONLY=007 make examples-aot-smoke` ([#2135](https://github.com/PurHur/php-compiler/issues/2135)) | -Opt-out for doc-only iteration: `THROWS_WEB_SMOKE_GATE=0 ./script/ci-fast.sh` +Opt-out for doc-only iteration: `THROWS_WEB_SMOKE_GATE=0 THROWSWEB_AOT_LINK_GATE=0 THROWSWEB_AOT_SMOKE_GATE=0 ./script/ci-fast.sh` ## Benchmark row diff --git a/examples/README.md b/examples/README.md index 07f06eebbc4..4f584c1438b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -49,7 +49,7 @@ Legacy entrypoints still work: `php bin/vm.php`, `php bin/jit.php`, `php bin/com | [004-ApiJson](004-ApiJson/) | ✅ `./phpc run` | ✅ `bin/jit.php` | ✅ `phpc build` | JSON + `http_response_code` — [#270](https://github.com/PurHur/php-compiler/issues/270), [#61](https://github.com/PurHur/php-compiler/issues/61) | | [005-SessionsWeb](005-SessionsWeb/) | ✅ `./phpc run` / `phpc serve` | ✅ `session_start` JIT ([#1882](https://github.com/PurHur/php-compiler/issues/1882)) | ✅ `phpc build` link ([#1946](https://github.com/PurHur/php-compiler/issues/1946)); execute [#1891](https://github.com/PurHur/php-compiler/issues/1891); deploy smoke opt-in ([#1893](https://github.com/PurHur/php-compiler/issues/1893)) | `$_SESSION` flash across requests — [#1881](https://github.com/PurHur/php-compiler/issues/1881) | | [006-FileUploadWeb](006-FileUploadWeb/) | ✅ `./phpc run` / `phpc serve` | ✅ nested `$_FILES` JIT ([#87](https://github.com/PurHur/php-compiler/issues/87)) | ✅ `phpc build` link ([#2011](https://github.com/PurHur/php-compiler/issues/2011)); execute default-on ([#2012](https://github.com/PurHur/php-compiler/issues/2012)) | `multipart/form-data` + `$_FILES['doc']` — [#1999](https://github.com/PurHur/php-compiler/issues/1999) | -| [007-ThrowsWeb](007-ThrowsWeb/) | ✅ `./phpc run` / `phpc serve` | 📋 deferred | 📋 deferred | `throw` / `catch` on invalid POST — [#2076](https://github.com/PurHur/php-compiler/issues/2076); VM smoke `THROWS_WEB_SMOKE_GATE=1` default ([#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)) | +| [007-ThrowsWeb](007-ThrowsWeb/) | ✅ `./phpc run` / `phpc serve` | 📋 deferred | ✅ `phpc build` + CGI execute | `throw` / `catch` on invalid POST — [#2076](https://github.com/PurHur/php-compiler/issues/2076); VM smoke `THROWS_WEB_SMOKE_GATE=1` default ([#2093](https://github.com/PurHur/php-compiler/issues/2093), [#2125](https://github.com/PurHur/php-compiler/issues/2125)); AOT `THROWSWEB_AOT_*_GATE=1` default ([#2135](https://github.com/PurHur/php-compiler/issues/2135)) | | [003-MiniWebApp](003-MiniWebApp/) | ✅ `phpc serve` | partial | ✅ `phpc build --project` | PATH_INFO — [#489](https://github.com/PurHur/php-compiler/issues/489), runtime [#539](https://github.com/PurHur/php-compiler/issues/539); AOT link ✅ ([#752](https://github.com/PurHur/php-compiler/issues/752)); native execute ✅ ([#764](https://github.com/PurHur/php-compiler/issues/764) closed) | ### 000-HelloWorld @@ -148,7 +148,7 @@ POST email validation with `throw` / `catch` ([#2076](https://github.com/PurHur/ curl -sf -X POST -d 'email=bad' http://127.0.0.1:8080/example.php | grep -i invalid ``` -VM serve curls: `make examples-throws-smoke` or `make examples-web-smoke` (`THROWS_WEB_SMOKE_GATE=1` default — [#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)). Presenter copy-paste: [docs/GETTING-STARTED.md](../docs/GETTING-STARTED.md) § 5b ([#2158](https://github.com/PurHur/php-compiler/issues/2158)). JIT/AOT deferred ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2157](https://github.com/PurHur/php-compiler/issues/2157)). Init scaffold: `./phpc init --profile throwsweb my-app` ([#2092](https://github.com/PurHur/php-compiler/issues/2092)); template parity: [#2086](https://github.com/PurHur/php-compiler/issues/2086) (`INIT_THROWSWEB_PARITY_GATE=1` default in `ci-fast`, [#2127](https://github.com/PurHur/php-compiler/issues/2127)). +VM serve curls: `make examples-throws-smoke` or `make examples-web-smoke` (`THROWS_WEB_SMOKE_GATE=1` default — [#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)). Presenter copy-paste: [docs/GETTING-STARTED.md](../docs/GETTING-STARTED.md) § 5b ([#2158](https://github.com/PurHur/php-compiler/issues/2158)). AOT link/execute: default `THROWSWEB_AOT_*_GATE=1` ([#2135](https://github.com/PurHur/php-compiler/issues/2135), [#2157](https://github.com/PurHur/php-compiler/issues/2157)); JIT deferred ([#2167](https://github.com/PurHur/php-compiler/issues/2167)). Init scaffold: `./phpc init --profile throwsweb my-app` ([#2092](https://github.com/PurHur/php-compiler/issues/2092)); template parity: [#2086](https://github.com/PurHur/php-compiler/issues/2086) (`INIT_THROWSWEB_PARITY_GATE=1` default in `ci-fast`, [#2127](https://github.com/PurHur/php-compiler/issues/2127)). ### 002-StaticWeb @@ -231,7 +231,7 @@ For **005-SessionsWeb**, the benchmark row is omitted until `phpc lint --all exa For **006-FileUploadWeb**, the benchmark row is omitted until `phpc lint --all examples/006-FileUploadWeb` passes unless `BENCH_FILEUPLOADWEB=1` ([#2027](https://github.com/PurHur/php-compiler/issues/2027)). VM/JIT/native columns use a multipart POST CGI overlay (same body as `FileUploadWebAotExecuteTest`). AOT columns time `phpc build --project` and a multipart upload probe on `.phpc/bin/app` when LLVM is ready ([#2011](https://github.com/PurHur/php-compiler/issues/2011), [#2012](https://github.com/PurHur/php-compiler/issues/2012)); use `BENCH_FILEUPLOADWEB_AOT=1 ./script/rebuild-examples.php` to force AOT columns on harness regen. -For **007-ThrowsWeb**, the benchmark row is omitted until `phpc lint --all examples/007-ThrowsWeb` passes unless `BENCH_THROWSWEB=1` ([#2113](https://github.com/PurHur/php-compiler/issues/2113)). VM/JIT/native columns use a POST `email=bad` CGI overlay (caught invalid path, same as `examples-web-smoke.sh --throws-only`). AOT columns are deferred ([#2101](https://github.com/PurHur/php-compiler/issues/2101), [#2104](https://github.com/PurHur/php-compiler/issues/2104)). +For **007-ThrowsWeb**, the benchmark row is omitted until `phpc lint --all examples/007-ThrowsWeb` passes unless `BENCH_THROWSWEB=1` ([#2113](https://github.com/PurHur/php-compiler/issues/2113)). VM/JIT/native columns use a POST `email=bad` CGI overlay (caught invalid path, same as `examples-web-smoke.sh --throws-only`). AOT columns run when `BENCH_THROWSWEB=1` and `THROWSWEB_AOT_SMOKE_GATE=1` (default — [#2135](https://github.com/PurHur/php-compiler/issues/2135)). diff --git a/lib/Doctor.php b/lib/Doctor.php index b0918c1cb7c..126b83463d7 100644 --- a/lib/Doctor.php +++ b/lib/Doctor.php @@ -571,8 +571,8 @@ private static function printThrowsWebSection(string $repoRoot): void $defaults = self::readCiDefaultsEnv($repoRoot); $smokeDefault = $defaults['THROWS_WEB_SMOKE_GATE'] ?? '0'; - $linkDefault = $defaults['THROWSWEB_AOT_LINK_GATE'] ?? '0'; - $aotDefault = $defaults['THROWSWEB_AOT_SMOKE_GATE'] ?? '0'; + $linkDefault = $defaults['THROWSWEB_AOT_LINK_GATE'] ?? '1'; + $aotDefault = $defaults['THROWSWEB_AOT_SMOKE_GATE'] ?? '1'; $smokeOn = self::gateEnabled('THROWS_WEB_SMOKE_GATE', $smokeDefault); $linkOn = self::gateEnabled('THROWSWEB_AOT_LINK_GATE', $linkDefault); @@ -621,12 +621,9 @@ private static function printThrowsWebSection(string $repoRoot): void ); $aotStatus = $aotOn && $llvmReady ? '✅' : '📋'; $aotExecuteNote = $llvmReady - ? ($aotOn ? '#2101' : '#2101 · opt-in until #2157 AOT throw/catch green; default-on follow-up #2135') + ? ($aotOn ? '#2101 · default-on #2135' : '#2101 · set THROWSWEB_AOT_SMOKE_GATE=1') : '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/script/capability-syntax-lib.php b/script/capability-syntax-lib.php index 3c65de5f689..1de908cddc7 100644 --- a/script/capability-syntax-lib.php +++ b/script/capability-syntax-lib.php @@ -978,35 +978,35 @@ function throwsWebNorthStarDefinitions(): array 'construct' => '`007-ThrowsWeb` reference app', 'vm' => 'yes', 'jit' => 'yes', - 'aot' => 'partial', + 'aot' => 'yes', 'issue' => 2076, 'notes' => [ - '#2076 VM serve + caught invalid POST (THROWS_WEB_SMOKE_GATE default #2125); AOT deferred #2101/#2104', + '#2076 VM serve + caught invalid POST (THROWS_WEB_SMOKE_GATE default #2125); AOT link/execute default #2135', ], ], [ 'construct' => '`throw` / `catch` on invalid POST (web serve)', 'vm' => 'yes', 'jit' => 'yes', - 'aot' => 'partial', + 'aot' => 'yes', 'issue' => 195, - 'notes' => ['#195 throw lowering; #57 catch; #2084 compliance PHPT pack'], + 'notes' => ['#195 throw lowering; #57 catch; #2084 compliance PHPT pack; user empty class AOT #2157'], ], [ 'construct' => 'AOT project link (`phpc build --project`)', 'vm' => 'n/a', 'jit' => 'n/a', - 'aot' => 'partial', + 'aot' => 'yes', 'issue' => 2101, - 'notes' => ['ExamplesCompileTest 007 link; opt-in THROWSWEB_AOT_LINK_GATE (#2101)'], + 'notes' => ['ExamplesCompileTest 007 link; THROWSWEB_AOT_LINK_GATE default-on (#2135)'], ], [ 'construct' => 'AOT CGI execute (caught throw probe)', 'vm' => 'n/a', 'jit' => 'n/a', - 'aot' => 'partial', + 'aot' => 'yes', 'issue' => 2104, - 'notes' => ['examples-aot-smoke 007 slice; opt-in THROWSWEB_AOT_SMOKE_GATE (#2104)'], + 'notes' => ['examples-aot-smoke 007 slice; THROWSWEB_AOT_SMOKE_GATE default-on (#2135)'], ], ]; } @@ -1044,8 +1044,8 @@ function renderThrowsWebNorthStarMarkdown(array $rows): string $lines[] = ''; $lines[] = '_Throws rows are curated from ROADMAP issue state; `throw` [#195](' . CAPABILITY_ISSUE_URL_BASE . '195); `try`/`catch` [#57](' . CAPABILITY_ISSUE_URL_BASE . '57); overlay [#2084](' . CAPABILITY_ISSUE_URL_BASE - . '2084). Opt-in ci-local gates: `THROWS_WEB_SMOKE_GATE` (VM serve default-on #2125), ' - . '`THROWSWEB_AOT_LINK_GATE`, `THROWSWEB_AOT_SMOKE_GATE`._'; + . '2084). ci-local gates: `THROWS_WEB_SMOKE_GATE` (VM serve default-on #2125), ' + . '`THROWSWEB_AOT_LINK_GATE` / `THROWSWEB_AOT_SMOKE_GATE` (AOT default-on #2135; set `0` to skip)._'; $lines[] = ''; return implode("\n", $lines); diff --git a/script/check-capabilities-throws-sync.php b/script/check-capabilities-throws-sync.php index fc912c4596b..b4ec959b777 100644 --- a/script/check-capabilities-throws-sync.php +++ b/script/check-capabilities-throws-sync.php @@ -47,17 +47,17 @@ } if (!preg_match( - '/\|\s*`007-ThrowsWeb` reference app\s*\|\s*yes\s*\|\s*yes\s*\|\s*partial\s*\|/i', + '/\|\s*`007-ThrowsWeb` reference app\s*\|\s*yes\s*\|\s*yes\s*\|\s*yes\s*\|/i', $syntaxBody )) { - $errors[] = 'docs/capabilities-syntax.md: 007-ThrowsWeb reference app must show VM yes, JIT yes, AOT partial (#2103)'; + $errors[] = 'docs/capabilities-syntax.md: 007-ThrowsWeb reference app must show VM yes, JIT yes, AOT yes (#2135)'; } if (!preg_match( - '/\|\s*`throw` \/ `catch` on invalid POST \(web serve\)\s*\|\s*yes\s*\|\s*yes\s*\|\s*partial\s*\|/i', + '/\|\s*`throw` \/ `catch` on invalid POST \(web serve\)\s*\|\s*yes\s*\|\s*yes\s*\|\s*yes\s*\|/i', $syntaxBody )) { - $errors[] = 'docs/capabilities-syntax.md: missing caught throw POST row with honest AOT partial (#2103)'; + $errors[] = 'docs/capabilities-syntax.md: missing caught throw POST row with AOT yes (#2135)'; } if (!str_contains($syntaxBody, 'THROWS_WEB_SMOKE_GATE') diff --git a/script/ci-common.sh b/script/ci-common.sh index 15952fd30f8..eea0a79eb8d 100644 --- a/script/ci-common.sh +++ b/script/ci-common.sh @@ -761,7 +761,7 @@ ci_run_deploy_smoke() { # 005 link: ExamplesCompileTest::test005SessionsWebAotLink when SESSIONS_WEB_AOT_LINK_GATE=1 (#1946). ci_run_aot_link_phpunit() { local -a aot_link_args=(--group aot-link --exclude-group serve --exclude-group miniwebapp-aot-execute --exclude-group miniwebapp-aot-serve --exclude-group sessionsweb-aot-execute --exclude-group fileuploadweb-aot-execute --exclude-group throwsweb-aot-execute) - echo "PHPUnit: AOT link (@group aot-link; SESSIONS_WEB_AOT_LINK_GATE=${SESSIONS_WEB_AOT_LINK_GATE:-0}, FILE_UPLOAD_WEB_AOT_LINK_GATE=${FILE_UPLOAD_WEB_AOT_LINK_GATE:-0}, THROWSWEB_AOT_LINK_GATE=${THROWSWEB_AOT_LINK_GATE:-0})..." + echo "PHPUnit: AOT link (@group aot-link; SESSIONS_WEB_AOT_LINK_GATE=${SESSIONS_WEB_AOT_LINK_GATE:-0}, FILE_UPLOAD_WEB_AOT_LINK_GATE=${FILE_UPLOAD_WEB_AOT_LINK_GATE:-0}, THROWSWEB_AOT_LINK_GATE=${THROWSWEB_AOT_LINK_GATE:-1})..." ci_run_phpunit "${aot_link_args[@]}" "$@" } @@ -778,9 +778,9 @@ ci_run_file_upload_web_aot_execute() { ci_run_phpunit --group fileuploadweb-aot-execute "$@" } -# 007-ThrowsWeb AOT binary CLI execute (issue #2101); opt-in THROWSWEB_AOT_SMOKE_GATE=1. +# 007-ThrowsWeb AOT binary CLI execute (issue #2101); default THROWSWEB_AOT_SMOKE_GATE=1 (#2135). ci_run_throws_web_aot_execute() { - if [[ "${THROWSWEB_AOT_SMOKE_GATE:-0}" != "1" ]]; then + if [[ "${THROWSWEB_AOT_SMOKE_GATE:-1}" != "1" ]]; then return 0 fi if ! ci_llvm_ready; then diff --git a/script/ci-defaults.env b/script/ci-defaults.env index c6e13500235..34517f31eee 100755 --- a/script/ci-defaults.env +++ b/script/ci-defaults.env @@ -26,8 +26,8 @@ export SESSIONS_WEB_DEPLOY_SMOKE_GATE="${SESSIONS_WEB_DEPLOY_SMOKE_GATE:-0}" # export FILE_UPLOAD_WEB_DEPLOY_SMOKE_GATE="${FILE_UPLOAD_WEB_DEPLOY_SMOKE_GATE:-0}" # opt-in (#2028); 006 deploy + PHPC_DEPLOY_ROOT multipart upload export FILE_UPLOAD_WEB_SMOKE_GATE="${FILE_UPLOAD_WEB_SMOKE_GATE:-1}" # default on (#2009); 006 multipart curl via examples-web-smoke export THROWS_WEB_SMOKE_GATE="${THROWS_WEB_SMOKE_GATE:-1}" # default-on (#2125); 007-ThrowsWeb caught invalid POST curls (#2076, #2093) -export THROWSWEB_AOT_LINK_GATE="${THROWSWEB_AOT_LINK_GATE:-0}" # opt-in (#2101); 007 native link when throw/catch AOT green -export THROWSWEB_AOT_SMOKE_GATE="${THROWSWEB_AOT_SMOKE_GATE:-0}" # opt-in (#2101); 007 AOT CGI invalid POST execute +export THROWSWEB_AOT_LINK_GATE="${THROWSWEB_AOT_LINK_GATE:-1}" # default on (#2135, #2101); set 0 to skip 007 link during iteration +export THROWSWEB_AOT_SMOKE_GATE="${THROWSWEB_AOT_SMOKE_GATE:-1}" # default on (#2135, #2101); 007 AOT CGI invalid POST execute export FILE_UPLOAD_WEB_AOT_LINK_GATE="${FILE_UPLOAD_WEB_AOT_LINK_GATE:-1}" # default on (#2011); set 0 to skip 006 link during iteration export FILE_UPLOAD_WEB_AOT_SMOKE_GATE="${FILE_UPLOAD_WEB_AOT_SMOKE_GATE:-1}" # default on (#2012); 006 AOT CGI multipart execute export BOOTSTRAP_SELFHOST_PROBE_UPDATE="${BOOTSTRAP_SELFHOST_PROBE_UPDATE:-0}" diff --git a/script/examples-aot-smoke.sh b/script/examples-aot-smoke.sh index 4ac06dd1b44..f98427664c4 100755 --- a/script/examples-aot-smoke.sh +++ b/script/examples-aot-smoke.sh @@ -330,7 +330,7 @@ smoke_006_fileuploadweb() { # 007-ThrowsWeb project AOT + caught invalid POST CGI (#2101, #2104). smoke_007_throwsweb() { - if [[ "${THROWSWEB_AOT_SMOKE_GATE:-0}" != "1" ]]; then + if [[ "${THROWSWEB_AOT_SMOKE_GATE:-1}" != "1" ]]; then echo "examples-aot-smoke: 007-ThrowsWeb: skip (THROWSWEB_AOT_SMOKE_GATE=0)" return 0 fi diff --git a/test/unit/CiScriptsTest.php b/test/unit/CiScriptsTest.php index ce9f0f4a89e..4762d905c9f 100644 --- a/test/unit/CiScriptsTest.php +++ b/test/unit/CiScriptsTest.php @@ -260,7 +260,7 @@ public function testCiLocalExcludesThrowsWebAotExecuteUnlessGateOn(): void $this->assertStringContainsString('ci_run_throws_web_aot_execute', $body); $this->assertStringContainsString('--exclude-group throwsweb-aot-execute', $body); $this->assertStringContainsString('--group throwsweb-aot-execute', $body); - $this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE:-0}', $body); + $this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE:-1}', $body); } public function testCiLocalRunsThrowsWebAotLinkBeforeExecute(): void @@ -1439,11 +1439,11 @@ public function testLocalCiMatrixDocumentsThrowsWebGates(): void $this->assertStringContainsString('#2157', $doc); } - public function testCiDefaultsEnvDefinesThrowsWebAotGatesOff(): void + public function testCiDefaultsEnvDefinesThrowsWebAotGatesOn(): void { $defaults = (string) file_get_contents(dirname(__DIR__, 2).'/script/ci-defaults.env'); - $this->assertStringContainsString('THROWSWEB_AOT_LINK_GATE="${THROWSWEB_AOT_LINK_GATE:-0}"', $defaults); - $this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE="${THROWSWEB_AOT_SMOKE_GATE:-0}"', $defaults); + $this->assertStringContainsString('THROWSWEB_AOT_LINK_GATE="${THROWSWEB_AOT_LINK_GATE:-1}"', $defaults); + $this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE="${THROWSWEB_AOT_SMOKE_GATE:-1}"', $defaults); } public function testCiFastRunsMiniWebAppVmCliGateByDefault(): void