Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Presenter script and troubleshooting: [`docs/GETTING-STARTED.md`](docs/GETTING-S
| **003-MiniWebApp** VM + AOT link | ✅ |
| **003** AOT execute (home, hello, PATH_INFO, contact) | ✅ native execute ([#764](https://github.com/PurHur/php-compiler/issues/764) closed; close tracker [#1044](https://github.com/PurHur/php-compiler/issues/1044)) |
| Self-host **M0–M1** | ✅ |
| Self-host **M2** spine | 🚧 **584** / 588 units ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
| Self-host **M2** spine | 🚧 **589** / 593 units ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
| Full Zend PHP compatibility | ❌ — subset only (matrices in `docs/`, not on status site) |

MiniWebApp gates: [docs/miniwebapp-gates.md](docs/miniwebapp-gates.md) ([#472](https://github.com/PurHur/php-compiler/issues/472)). Presenter verify: `make north-star1-verify` ([#1845](https://github.com/PurHur/php-compiler/issues/1845)). Docker image: `php-compiler:22.04-dev`.
Expand Down Expand Up @@ -141,7 +141,7 @@ Matrix details: [docs/local-ci-matrix.md](docs/local-ci-matrix.md).
|-----------|----------------|--------|
| **M0 — Bundled subset runs** | ~**109** literal `require_once` units in `test/selfhost/compiler_minimal/main.php` compile+link under AOT; native binary prints `compiler_minimal bundle OK` | ✅ ([#557](https://github.com/PurHur/php-compiler/issues/557), [#913](https://github.com/PurHur/php-compiler/issues/913)) |
| **M1 — Compiler-shaped bundle** | Same bundle **lints** as one translation unit; **compile-smoke** links a tiny fixture and runs AOT echo (`compiler smoke`); driver smoke bundles `bin/compile.php`-adjacent units | ✅ ([#1025](https://github.com/PurHur/php-compiler/issues/1025)) |
| **M2 — Full top-level `lib/` + spine** | All **14** top-level `lib/*.php` lint ✅; **`compiler_lib_spine_smoke`** (**584** / **588** inventory units) native link ✅; grow toward full `bin/vm.php` path | 🚧 ~99% of inventory |
| **M2 — Full top-level `lib/` + spine** | All **14** top-level `lib/*.php` lint ✅; **`compiler_lib_spine_smoke`** (**589** / **593** inventory units) native link ✅; grow toward full `bin/vm.php` path | 🚧 ~99% of inventory |
| **M3 — Native compiles PHP** | Self-host bundle links; HelloWorld AOT **runs** natively; **compile emit still Zend fallback** | 🚧 partial |
| **M4 — Bootstrap loop** | Native toolchain rebuilds the **next** compiler sources | ⬜ |
| **M5 — Full self-host** | Real `bin/vm.php` / `bin/compile.php` on full inventory; **no Zend bootstrap** | ⬜ **north star** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
Expand Down Expand Up @@ -186,7 +186,7 @@ On harness hosts with an empty bind-mount, use `./script/docker-ci-local.sh` or

| Gate | Command | Status |
|------|---------|--------|
| Phase A inventory | `php script/bootstrap-inventory.php --check` | ✅ **588** files; **0** blockers |
| Phase A inventory | `php script/bootstrap-inventory.php --check` | ✅ **593** files; **0** blockers |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` | ✅ **14** top-level `lib/*.php` ([#534](https://github.com/PurHur/php-compiler/pull/534)) |
| Phase B fixture lint | `php script/bootstrap-aot-lint.php` | ✅ **83** procedural targets |
| Phase C native link | `make bootstrap-aot-link` | ✅ **71/71** link targets OK |
Expand Down
2 changes: 1 addition & 1 deletion docs/bootstrap-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Regenerate: `php script/bootstrap-inventory.php`

| Metric | Count |
|--------|------:|
| PHP files on vm.php path | 588 |
| PHP files on vm.php path | 593 |
| Source constructs flagged (blockers) | 0 |
| Source constructs flagged (warnings) | 1541 |

Expand Down
4 changes: 2 additions & 2 deletions docs/bootstrap-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

| Gate | Command | Status |
|------|---------|--------|
| Phase A inventory | `php script/bootstrap-inventory.php --check` | ✅ **588** files on `bin/vm.php` path; **0** source blockers (excluded paths: `lib/AOT/Linker.php`, `lib/JIT/Builtin/StringPregMatch.php`; `lib/VM/HashTable.php` bundled via `ArrayIterator`) |
| Phase A inventory | `php script/bootstrap-inventory.php --check` | ✅ **593** files on `bin/vm.php` path; **0** source blockers (excluded paths: `lib/AOT/Linker.php`, `lib/JIT/Builtin/StringPregMatch.php`; `lib/VM/HashTable.php` bundled via `ArrayIterator`) |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` (with `script/php-env.sh`) | ✅ **14/14** top-level `lib/*.php` units ([#534](https://github.com/PurHur/php-compiler/pull/534)) |
| Phase B fixture lint | `php script/bootstrap-aot-lint.php` | ✅ **13** procedural targets under `test/bootstrap-aot/` + `examples/000-HelloWorld` |
| Phase C native run | `make bootstrap-aot-link` or `./script/bootstrap-aot-link.sh` | ✅ **71/71** link targets OK |
Expand All @@ -20,7 +20,7 @@
| Self-host probe in full CI | `./script/ci-local.sh` (LLVM tail) | ✅ default-on when LLVM 9 present; `BOOTSTRAP_SELFHOST_PROBE_GATE=0` to skip ([#829](https://github.com/PurHur/php-compiler/issues/829)) |
| Wave gate in full CI | `./script/ci-local.sh` (LLVM tail) | ✅ default-on when LLVM 9 present; `BOOTSTRAP_WAVE_CHECK=0` to skip; `./script/bootstrap-wave-check.sh --fail-fast` |
| Self-host native link | `./script/bootstrap-selfhost-link.sh` | ✅ `build/selfhost` prints `compiler_minimal bundle OK` ([#557](https://github.com/PurHur/php-compiler/issues/557), [#913](https://github.com/PurHur/php-compiler/issues/913)) |
| M2 lib spine smoke lint | `php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php` | ✅ **584** units ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#1419](https://github.com/PurHur/php-compiler/issues/1419)
| M2 lib spine smoke lint | `php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php` | ✅ **589** units ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#1419](https://github.com/PurHur/php-compiler/issues/1419)
| M2 lib spine smoke native run | `./script/bootstrap-selfhost-lib-spine-smoke-link.sh` or `BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke` | ✅ `build/selfhost-lib-spine-smoke` prints `compiler_lib_spine_smoke bundle OK` |
| M2 lib spine VM `-r` smoke | `./script/bootstrap-selfhost-lib-spine-vm-smoke.sh` or `BOOTSTRAP_LIB_SPINE_VM_SMOKE=1 make bootstrap-selfhost-lib-spine-vm-smoke` | ✅ same binary + `PHP_COMPILER_VM_SPINE_SMOKE=1` prints `vm-spine-ok` ([#1846](https://github.com/PurHur/php-compiler/issues/1846); CI opt-in `BOOTSTRAP_LIB_SPINE_VM_SMOKE_GATE=1`) |
| M3 HelloWorld self-host probe lint | `php bin/compile.php -l test/selfhost/compiler_helloworld_smoke/main.php` | ✅ `compiler_compile_smoke` spine + `helloworld_compile_smoke` driver (linkable) |
Expand Down
10 changes: 5 additions & 5 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ Auto-generated by `script/capability-matrix.php`. Do not edit by hand.
| `mkdir` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `nl2br` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `number_format` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `ob_end_flush` | yes | no | no | standard | doc: VM only; not implemented for JIT in this compiler build |
| `ob_get_clean` | yes | no | no | standard | doc: VM only; not implemented for JIT in this compiler build |
| `ob_get_level` | yes | no | no | standard | doc: VM only; not implemented for JIT in this compiler build |
| `ob_start` | yes | no | no | standard | doc: VM only; not implemented for JIT in this compiler build |
| `ob_end_flush` | yes | no | no | standard | not implemented for JIT in this compiler build (#118) |
| `ob_get_clean` | yes | no | no | standard | not implemented for JIT in this compiler build (#118) |
| `ob_get_level` | yes | no | no | standard | not implemented for JIT in this compiler build (#118) |
| `ob_start` | yes | no | no | standard | not implemented for JIT in this compiler build (#118) |
| `octdec` | yes | yes | yes | standard | |
| `ord` | yes | yes | yes | standard | |
| `pack` | yes | yes | yes | standard | JIT PHPT |
Expand Down Expand Up @@ -234,7 +234,7 @@ Auto-generated by `script/capability-matrix.php`. Do not edit by hand.
| `strchr` | yes | yes | yes | standard | |
| `strcmp` | yes | yes | yes | standard | |
| `strcspn` | yes | yes | yes | standard | AOT PHPT |
| `stream_context_create` | yes | yes | no | standard | zero-arg empty context; options deferred (#1377, #1056) |
| `stream_context_create` | yes | yes | yes | standard | JIT PHPT |
| `strip_tags` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `stripos` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `stripslashes` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
Expand Down
16 changes: 8 additions & 8 deletions docs/pages/development-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permalink: /development-status.html
| **Overall progress** | ~**50%** toward web-capable + self-hosting compiler (indicative) |
| **Wave 3 (May 2026)** | Language **10/13** · Stdlib **12/13** ([#1380](https://github.com/PurHur/php-compiler/issues/1380)) |
| **North Star 1** | **Achieved** — reference web app VM + AOT execute + default-on CI gates ([#1044](https://github.com/PurHur/php-compiler/issues/1044) closed); follow-ups [#1750](https://github.com/PurHur/php-compiler/issues/1750), [#587](https://github.com/PurHur/php-compiler/issues/587), [#445](https://github.com/PurHur/php-compiler/issues/445), [#173](https://github.com/PurHur/php-compiler/issues/173) |
| **North Star 2** | Self-compile — M0–M1 ✅ · M2 spine **584/588** · M5 ⬜ ([#1492](https://github.com/PurHur/php-compiler/issues/1492)
| **North Star 2** | Self-compile — M0–M1 ✅ · M2 spine **589/593** · M5 ⬜ ([#1492](https://github.com/PurHur/php-compiler/issues/1492)
| **Not Zend parity** | Subset compiler (not full Zend PHP) |

[← Visual overview](index.html) · [Repository](https://github.com/PurHur/php-compiler)
Expand Down Expand Up @@ -51,7 +51,7 @@ Indicative composite toward a **web-capable, self-hosting** compiler (not line-c
| **Stdlib** | ~58% | Wave-3 batch ([#1367](https://github.com/PurHur/php-compiler/issues/1367)–[#1379](https://github.com/PurHur/php-compiler/issues/1379)): **13/13** closed on master |
| **Web AOT** (build, deploy) | ~70% | Project link ✅; CLI execute ✅; HTTP serve-aot / layout-edge bisect 🚧 |
| **Reference app** (MiniWebApp) | ~90% | North Star 1 **achieved** — VM + AOT execute + default-on gates; optional bisect [#1750](https://github.com/PurHur/php-compiler/issues/1750) |
| **Self-host** (North Star 2, M0–M5) | ~99% | M0–M1 ✅; M2 spine **584/588**; M3 partial (native run ✅, Zend emit); M4–M5 ⬜ — [self-host-target.md](https://github.com/PurHur/php-compiler/blob/master/docs/self-host-target.md
| **Self-host** (North Star 2, M0–M5) | ~99% | M0–M1 ✅; M2 spine **589/593**; M3 partial (native run ✅, Zend emit); M4–M5 ⬜ — [self-host-target.md](https://github.com/PurHur/php-compiler/blob/master/docs/self-host-target.md

**Overall (indicative): ~52%** toward the stated north stars below.

Expand Down Expand Up @@ -179,7 +179,7 @@ The **compiler fully compiles itself** — the stretch goal behind every bootstr
- Self-hosted binary runs **real** `bin/compile.php` / `bin/vm.php` driver paths (not stub-only `echo` demos)
- Self-hosted binary compiles **`examples/000-HelloWorld`** without Zend
- Self-hosted binary compiles the **next** compiler revision — **bootstrap loop closed**
- Honest AOT bundle toward the full `bin/vm.php` inventory (**588** files), with `PHP_COMPILER_SELFHOST_AOT` stub surface **shrinking** as lowering lands
- Honest AOT bundle toward the full `bin/vm.php` inventory (**593** files), with `PHP_COMPILER_SELFHOST_AOT` stub surface **shrinking** as lowering lands

This is **North Star 2**. It is **orthogonal** to [North Star 1 (web app)](#north-star-1-web-app) — user-facing web apps vs. the compiler eating its own `lib/` tree.

Expand All @@ -204,7 +204,7 @@ Zend PHP still runs `bin/compile.php` during bootstrap. The output is a **curate
|-----------|---------|--------|
| **M0 — Bundled subset runs** | ~109 literal `require_once` units in `test/selfhost/compiler_minimal/main.php` → `build/selfhost` prints `compiler_minimal bundle OK` | ✅ [#557](https://github.com/PurHur/php-compiler/issues/557), [#913](https://github.com/PurHur/php-compiler/issues/913) |
| **M1 — Compiler-shaped bundle** | Bundled `Compiler.php` AOT lint; compile-smoke native link + AOT echo (`compiler smoke`); driver smoke toward `bin/compile.php` | ✅ [#1025](https://github.com/PurHur/php-compiler/issues/1025), [#1095](https://github.com/PurHur/php-compiler/issues/1095) |
| **M2 — Lib spine growth** | `compiler_lib_spine_smoke` bundle toward full `bin/vm.php` inventory (**588** files) | 🚧 **584** / 588 units (~99%; [#1492](https://github.com/PurHur/php-compiler/issues/1492)
| **M2 — Lib spine growth** | `compiler_lib_spine_smoke` bundle toward full `bin/vm.php` inventory (**593** files) | 🚧 **589** / 593 units (~99%; [#1492](https://github.com/PurHur/php-compiler/issues/1492)
| **M3 — Native compiles PHP** | Self-hosted bundle links; HelloWorld AOT **runs** natively; **emit still uses Zend** `bin/compile.php` fallback | 🚧 partial ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
| **M4 — Bootstrap loop** | Native toolchain rebuilds the **next** compiler sources (same tree, new revision) | ⬜ |
| **M5 — Full self-host** | Real `bin/vm.php` / `bin/compile.php` path on full inventory; **no Zend bootstrap** | ⬜ **north star** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
Expand All @@ -214,9 +214,9 @@ Zend PHP still runs `bin/compile.php` during bootstrap. The output is a **curate
| Set | ~Files | Notes |
|-----|--------|-------|
| `compiler_minimal` bundle (M0) | **109** | Literal `require_once` closure |
| `compiler_lib_spine_smoke` (M2) | **584** | vm.php-path lib/ + ext/standard growth bundl
| `compiler_lib_spine_smoke` (M2) | **589** | vm.php-path lib/ + ext/standard growth bundl
| Top-level `lib/*.php` | **14** | Per-file AOT lint ✅ |
| Full vm.php inventory | **588** | Phase A inventory (`php script/bootstrap-inventory.php`) |
| Full vm.php inventory | **593** | Phase A inventory (`php script/bootstrap-inventory.php`) |

**M2 → M5 gap:** ~**152** inventory files still outside the honest native bundle; plus native compile driver (`parseAndCompile` emit, [#1402](https://github.com/PurHur/php-compiler/issues/1402)); vendor prelink ([#1416](https://github.com/PurHur/php-compiler/issues/1416)).

Expand All @@ -233,7 +233,7 @@ Details: [self-host-target.md](https://github.com/PurHur/php-compiler/blob/maste

| Phase | Command / doc | Status |
|-------|---------------|--------|
| **A — Inventory** | `php script/bootstrap-inventory.php --check` | ✅ **588** files; 0 source blockers |
| **A — Inventory** | `php script/bootstrap-inventory.php --check` | ✅ **593** files; 0 source blockers |
| **B — AOT lint** | `lib/*.php`, `test/bootstrap-aot/`, selfhost bundles | ✅ (requires `script/apply-patches.sh` locally) |
| **C — Native fixtures** | `make bootstrap-aot-link` | ✅ **71/71** bootstrap-aot link targets OK |
| **D — `lib/` in bundle** | `lib/OpCode.php` etc. | ✅ [#540](https://github.com/PurHur/php-compiler/issues/540) |
Expand All @@ -249,7 +249,7 @@ Details: [self-host-target.md](https://github.com/PurHur/php-compiler/blob/maste
| Native link + run | `./script/bootstrap-selfhost-link.sh` | ✅ M0 |
| Compile smoke link | `make bootstrap-selfhost-compile-smoke` | ✅ M1 |
| Compile smoke AOT echo | `make bootstrap-selfhost-compile-smoke-run` | ✅ M1 |
| M2 spine native link | `BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke` | ✅ `compiler_lib_spine_smoke bundle OK` (**584** units
| M2 spine native link | `BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke` | ✅ `compiler_lib_spine_smoke bundle OK` (**589** units
| M3 HelloWorld probe | `make bootstrap-selfhost-helloworld` | 🚧 partial — native **run** ✅; emit Zend fallback |
| Wave gate | `./script/bootstrap-wave-check.sh` | ✅ locally / Docker; GHA workflow disabled |
| Next includes probe | `php script/bootstrap-selfhost-next-includes.php` | 🚧 bundle growth |
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap-wave3.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Regenerate capability truth: `php script/capability-matrix.php`, `php script/cap

Related merges outside this wave: `goto` ([#1228](https://github.com/PurHur/php-compiler/issues/1228) / [#1333](https://github.com/PurHur/php-compiler/pull/1333)), anonymous classes ([#1233](https://github.com/PurHur/php-compiler/issues/1233) / [#1386](https://github.com/PurHur/php-compiler/pull/1386)).

**M2 spine:** **584** / **588** inventory (`compiler_lib_spine_smoke` native link ✅; [#1492](https://github.com/PurHur/php-compiler/issues/1492), M2 batches [#1419](https://github.com/PurHur/php-compiler/issues/1419), [#1497](https://github.com/PurHur/php-compiler/issues/1497)). Target doc: [self-host-target.md](self-host-target.m
**M2 spine:** **589** / **593** inventory (`compiler_lib_spine_smoke` native link ✅; [#1492](https://github.com/PurHur/php-compiler/issues/1492), M2 batches [#1419](https://github.com/PurHur/php-compiler/issues/1419), [#1497](https://github.com/PurHur/php-compiler/issues/1497)). Target doc: [self-host-target.md](self-host-target.m

## Language (#1354–#1366)

Expand Down
Loading