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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

> **Stable line (2026)** — First maintained **stable** release **[v1.0.0](https://github.com/PurHur/php-compiler/releases/tag/v1.0.0)**; **v1.1.0** prep adds M5 fast-path stability, enum/property-hook parity, `preg_match` JIT, `spl_autoload*`, and php-in-PHP JIT helpers. Demo-ready VM + AOT for a **web-capable PHP subset**, reference examples **000–009**, and an experimental **self-host** path. Not full Zend PHP compatibility — see [what’s missing](https://purhur.github.io/php-compiler/docs/pages/missing-implementation.html).

**Snapshot (Jul 2026, `master` — v1.1.0 prep):** VM + AOT for shipped examples ✅ · examples web smoke ✅ · self-host spine **6518** / **6518** · **1555** builtins · M5 fast ✅ / strict 🚧 · M3/M4 emit = blob copy ([#21860](https://github.com/PurHur/php-compiler/issues/21860)) · VM probe ~**20ms**
**Snapshot (Jul 2026, `master` — v1.1.0 prep):** VM + AOT for shipped examples ✅ · examples web smoke ✅ · self-host spine **6519** / **6519** · **1555** builtins · M5 fast ✅ / strict 🚧 · M3/M4 emit = blob copy ([#21860](https://github.com/PurHur/php-compiler/issues/21860)) · VM probe ~**20ms**

---

Expand All @@ -23,7 +23,7 @@
| **AOT (`phpc build`)** | ✅ For curated subset | Standalone binaries for examples **000–009** and small CGI apps; not arbitrary Composer stacks |
| **JIT (`bin/jit.php`)** | 🚧 Partial | LLVM IR for many constructs; **MCJIT execute** still flaky ([#98](https://github.com/PurHur/php-compiler/issues/98)); EH scripts VM-fallback ([#2114](https://github.com/PurHur/php-compiler/issues/2114)) |
| **Language wave 3** | ✅ Closed batch | **12/12** language + **13/13** stdlib tracker items ([#1380](https://github.com/PurHur/php-compiler/issues/1380)); closures, try/catch, generators (VM), `parent::class`, backed enums (VM), intersection AOT checks |
| **Self-host north star** | 🚧 ~65% | M3/M4 emit paths are blob copies ([#21860](https://github.com/PurHur/php-compiler/issues/21860)); `--strict` red; spine **6518** / **6518**; vendor prelink **3/3** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
| **Self-host north star** | 🚧 ~65% | M3/M4 emit paths are blob copies ([#21860](https://github.com/PurHur/php-compiler/issues/21860)); `--strict` red; spine **6519** / **6519**; vendor prelink **3/3** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |

### What you can rely on today

Expand All @@ -40,7 +40,7 @@ Counts from `php script/bootstrap-spine-count.php` (literal `require_once` in `c
| Milestone | Status | What it means |
|-----------|--------|----------------|
| **M0–M1** | ✅ | `compiler_minimal` + compile-smoke bundles link and run natively |
| **M2** | ✅ **6518** / **6518** | Full Phase A inventory in spine smoke; native link + lint ✅ |
| **M2** | ✅ **6519** / **6519** | Full Phase A inventory in spine smoke; native link + lint ✅ |
| **M3** | 🚧 | HelloWorld probe output is a prelinked blob **COPY**, not a native emit ([#21860](https://github.com/PurHur/php-compiler/issues/21860)) |
| **M4** | 🚧 | ladder runs, but gen-1→gen-2 is a sidecar **COPY** ([#21860](https://github.com/PurHur/php-compiler/issues/21860)) — gen-0/gen-2/gen-3 being byte-identical follows from that, and is not fixpoint evidence |
| **M5** | 🚧 | `make north-star5-verify-fast` (daily) ✅; vendor **3/3** ✅; gen-0 sidecars refreshed; **`--strict` red at step 4a2** ([#21417](https://github.com/PurHur/php-compiler/issues/21417)) |
Expand Down Expand Up @@ -259,7 +259,7 @@ Full matrices (auto-generated): [`docs/capabilities.md`](docs/capabilities.md) (

**Self-host (experimental, not “stable app” scope)**

See [Current implementation status](#current-implementation-status-july-2026) for the full M0–M5 ladder. Summary: M0–M5 bootstrap gates ✅; spine **6518** / **6518**; M3 strict native + inventory argv ✅; M4 full `bootstrap-loop-probe` ✅; M5 **`north-star5-verify-fast`** (daily) ✅ — **`--strict` red at step 4a2** ([#21417](https://github.com/PurHur/php-compiler/issues/21417)) ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#8559](https://github.com/PurHur/php-compiler/issues/8559)). Recent: native spine bundle probe, fast VM execute smoke ([#2201](https://github.com/PurHur/php-compiler/issues/2201)), `GeneratorYieldSourceMarker` spine unit ([#10356](https://github.com/PurHur/php-compiler/pull/10356)).
See [Current implementation status](#current-implementation-status-july-2026) for the full M0–M5 ladder. Summary: M0–M5 bootstrap gates ✅; spine **6519** / **6519**; M3 strict native + inventory argv ✅; M4 full `bootstrap-loop-probe` ✅; M5 **`north-star5-verify-fast`** (daily) ✅ — **`--strict` red at step 4a2** ([#21417](https://github.com/PurHur/php-compiler/issues/21417)) ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#8559](https://github.com/PurHur/php-compiler/issues/8559)). Recent: native spine bundle probe, fast VM execute smoke ([#2201](https://github.com/PurHur/php-compiler/issues/2201)), `GeneratorYieldSourceMarker` spine unit ([#10356](https://github.com/PurHur/php-compiler/pull/10356)).

**What we do not target in v1.x**

Expand Down
88 changes: 44 additions & 44 deletions docs/bootstrap-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
| `ext/standard/JitStreamSocketPair.php` | 0 | 1 |
| `ext/standard/JitStreamSupports.php` | 0 | 1 |
| `ext/standard/JitStreamSupportsFeatureArg.php` | 0 | 1 |
| `ext/standard/JitStreamSyncKernel.php` | 0 | 3 |
| `ext/standard/JitStreamSyncKernel.php` | 0 | 2 |
| `ext/standard/JitStreamWrapperRegistry.php` | 0 | 1 |
| `ext/standard/JitStringConcat.php` | 0 | 1 |
| `ext/standard/JitStringIndex.php` | 0 | 1 |
Expand Down Expand Up @@ -5744,7 +5744,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
| `lib/TraitMethodFunctionStatic.php` | 0 | 4 |
| `lib/TryCatchElseSyntaxRejector.php` | 0 | 2 |
| `lib/TypedFunctionStaticSyntaxRejector.php` | 0 | 2 |
| `lib/VM.php` | 0 | 292 |
| `lib/VM.php` | 0 | 293 |
| `lib/VM/AbstractPropertyHookCheck.php` | 0 | 1 |
| `lib/VM/ArrayAccessDimension.php` | 0 | 3 |
| `lib/VM/ArraySpread.php` | 0 | 2 |
Expand Down Expand Up @@ -27493,9 +27493,8 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
### `ext/standard/JitStreamSyncKernel.php`

**Warnings** (review for bootstrap subset):
- new JIT (line 229)
- 9 class method(s)
- 3 closure(s)
- 2 closure(s)

### `ext/standard/JitStreamWrapperRegistry.php`

Expand Down Expand Up @@ -48046,47 +48045,48 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
- new VM\ClassProperty (line 16479)
- new Variable (line 16799)
- new CompileError (line 16817)
- new Variable (line 17022)
- new Variable (line 17024)
- new ClassEntry (line 17067)
- new Func\PHP (line 17074)
- new VM\ClassProperty (line 17169)
- new Func\PHP (line 17377)
- new Variable (line 17453)
- new Variable (line 17029)
- new Variable (line 17031)
- new ClassEntry (line 17074)
- new Func\PHP (line 17081)
- new VM\ClassProperty (line 17176)
- new Func\PHP (line 17384)
- new Variable (line 17460)
- new Variable (line 17466)
- new Variable (line 17503)
- new Variable (line 17532)
- new Variable (line 17720)
- new Variable (line 17766)
- new VM\ClassProperty (line 17831)
- new Error (line 17878)
- new Error (line 17913)
- new Error (line 17916)
- new Error (line 17919)
- new Error (line 17922)
- new ObjectEntry (line 17924)
- new Error (line 17937)
- new Error (line 17940)
- new Error (line 17943)
- new Error (line 17964)
- new ObjectEntry (line 17969)
- new Variable (line 17971)
- new Variable (line 17989)
- new Variable (line 18002)
- new Variable (line 18023)
- new Variable (line 18036)
- new Error (line 18166)
- new Error (line 18171)
- new VM\ObjectEntry (line 18175)
- new Variable (line 18319)
- new Variable (line 18337)
- new NoDiscardMetadata (line 18506)
- new Variable (line 18706)
- new Variable (line 18708)
- new CompileError (line 18736)
- new Variable (line 18839)
- 521 class method(s)
- new Variable (line 17467)
- new Variable (line 17473)
- new Variable (line 17510)
- new Variable (line 17539)
- new Variable (line 17727)
- new Variable (line 17773)
- new VM\ClassProperty (line 17838)
- new Error (line 17885)
- new Error (line 17920)
- new Error (line 17923)
- new Error (line 17926)
- new Error (line 17929)
- new ObjectEntry (line 17931)
- new Error (line 17944)
- new Error (line 17947)
- new Error (line 17950)
- new Error (line 17971)
- new ObjectEntry (line 17976)
- new Variable (line 17978)
- new Variable (line 17996)
- new Variable (line 18009)
- new Variable (line 18030)
- new Variable (line 18043)
- new Error (line 18173)
- new Error (line 18178)
- new VM\ObjectEntry (line 18182)
- new Variable (line 18326)
- new Variable (line 18344)
- new NoDiscardMetadata (line 18513)
- new Variable (line 18713)
- new Variable (line 18715)
- new CompileError (line 18743)
- new CompileError (line 18770)
- new Variable (line 18871)
- 522 class method(s)
- 25 closure(s)

### `lib/VM/AbstractPropertyHookCheck.php`
Expand Down
6 changes: 4 additions & 2 deletions docs/bootstrap-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@
"ext/gettext/ngettext.php",
"ext/gettext/textdomain.php",
"ext/gmp/GmpConstants.php",
"ext/gmp/GmpExtensionPolicy.php",
"ext/gmp/GmpFunction.php",
"ext/gmp/GmpToString.php",
"ext/gmp/Module.php",
Expand Down Expand Up @@ -895,6 +896,7 @@
"ext/inotify/inotify_rm_watch.php",
"ext/intl/BuiltinClasses.php",
"ext/intl/GraphemeStrSplitJitHelper.php",
"ext/intl/IcuDateFormat.php",
"ext/intl/IdnFunction.php",
"ext/intl/IntlClassMethod.php",
"ext/intl/IntlConstants.php",
Expand Down Expand Up @@ -6752,9 +6754,9 @@
"test/bootstrap-aot/lib_opcode/main.php"
],
"totals": {
"inventory_files": 6517,
"inventory_files": 6519,
"excluded": 1,
"eligible": 6516,
"eligible": 6518,
"aot_lint_targets": 113,
"aot_link_targets": 100,
"aot_link_lib_targets": 1
Expand Down
6 changes: 3 additions & 3 deletions docs/bootstrap-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

**Gen-0 without Zend:** `BOOTSTRAP_M5_NO_ZEND=1 make bootstrap-selfhost-link` installs `prelinked/bootstrap-gen0/bin-compile-aot` and links `compiler_minimal` without `php bin/compile.php` ([#3053](https://github.com/PurHur/php-compiler/issues/3053)). **M5 lib spine compile:** `BOOTSTRAP_NO_ZEND_FALLBACK=1 make bootstrap-selfhost-lib-spine-smoke` (default in link script) refuses host `php bin/compile.php` on the spine emit path ([#8716](https://github.com/PurHur/php-compiler/issues/8716)). **Contributor workflow:** [bootstrap-dev-workflow.md](bootstrap-dev-workflow.md) (tiered gen-1+ path, spine checklist, CI).

**Project north star:** The **compiler fully compiles itself** — native AOT from `lib/` (no `vendor/` at cold boot), then compiles PHP and rebuilds the next compiler revision without Zend. **M2 spine:** **6518** / **6518** Phase A inventory (`php script/bootstrap-spine-count.php`; `check-selfhost-spine-coverage-sync.php`). **M5 daily gate:** `make north-star5-verify-fast` (~1–2 min) ✅; **`--strict`** (~1h) pre-merge only. Committed `prelinked/bootstrap-gen0/` sidecars + vendor **3/3** cold boot. **Hot loop:** VM driver execute probe ~**20ms**; full spine relink only with `BOOTSTRAP_VM_DRIVER_EXECUTE_PROBE_FULL_LINK=1` ([#2201](https://github.com/PurHur/php-compiler/issues/2201)). **Living tracker:** [#1492](https://github.com/PurHur/php-compiler/issues/1492) (was [#1056](https://github.com/PurHur/php-compiler/issues/1056)) · **re-root doc:** [self-host-target.md](self-host-target.md) · **generation ladder:** [bootstrap-generations.md](bootstrap-generations.md) · **M5 fast path:** [bootstrap-m5-fast-path.md](bootstrap-m5-fast-path.md) · public status: [development-status § North star](https://purhur.github.io/php-compiler/development-status.html#north-star-self-host). Parent tracking: [#78](https://github.com/PurHur/php-compiler/issues/78) (roadmap), [#212](https://github.com/PurHur/php-compiler/issues/212) (closed umbrella).
**Project north star:** The **compiler fully compiles itself** — native AOT from `lib/` (no `vendor/` at cold boot), then compiles PHP and rebuilds the next compiler revision without Zend. **M2 spine:** **6519** / **6519** Phase A inventory (`php script/bootstrap-spine-count.php`; `check-selfhost-spine-coverage-sync.php`). **M5 daily gate:** `make north-star5-verify-fast` (~1–2 min) ✅; **`--strict`** (~1h) pre-merge only. Committed `prelinked/bootstrap-gen0/` sidecars + vendor **3/3** cold boot. **Hot loop:** VM driver execute probe ~**20ms**; full spine relink only with `BOOTSTRAP_VM_DRIVER_EXECUTE_PROBE_FULL_LINK=1` ([#2201](https://github.com/PurHur/php-compiler/issues/2201)). **Living tracker:** [#1492](https://github.com/PurHur/php-compiler/issues/1492) (was [#1056](https://github.com/PurHur/php-compiler/issues/1056)) · **re-root doc:** [self-host-target.md](self-host-target.md) · **generation ladder:** [bootstrap-generations.md](bootstrap-generations.md) · **M5 fast path:** [bootstrap-m5-fast-path.md](bootstrap-m5-fast-path.md) · public status: [development-status § North star](https://purhur.github.io/php-compiler/development-status.html#north-star-self-host). Parent tracking: [#78](https://github.com/PurHur/php-compiler/issues/78) (roadmap), [#212](https://github.com/PurHur/php-compiler/issues/212) (closed umbrella).

## Current gates

| Gate | Command | Status |
|------|---------|--------|
| Phase A inventory | `make bootstrap-inventory-check` | ✅ vm.php-path inventory; **0** source blockers; M2 ratio SSOT: `Phase A inventory files` row in `docs/bootstrap-inventory.md` (no ratio-deferred paths — [#2543](https://github.com/PurHur/php-compiler/issues/2543)); `lib/JIT/Builtin/StringPregMatch.php` and `lib/AOT/Linker.php` **included** in spine |
| Spine PHPCfg parse | `php script/bootstrap-spine-php-cfg-parse-check.php` (`--minimal` for M0 bundle) | ✅ no unsupported php-cfg expr/stmt on spine ([#2575](https://github.com/PurHur/php-compiler/issues/2575)); `BOOTSTRAP_SPINE_PHPCFG_PARSE_GATE=1` in `ci-fast.sh` |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` (with `script/php-env.sh`) | ✅ **6518/6518** top-level `lib/*.php` units ([#534](https://github.com/PurHur/php-compiler/pull/534)) |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` (with `script/php-env.sh`) | ✅ **6519/6519** 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` | ✅ **6518/6518** link targets OK |
| Phase C native run | `make bootstrap-aot-link` or `./script/bootstrap-aot-link.sh` | ✅ **6519/6519** link targets OK |
| Phase D `lib/` link | `make bootstrap-aot-link-lib` or `./script/bootstrap-aot-link-lib.sh` | ✅ `test/bootstrap-aot/lib_opcode/main.php` bundles `lib/OpCode.php` ([#540](https://github.com/PurHur/php-compiler/issues/540)) |
| Bundled `lib/Compiler.php` lint | `./script/bootstrap-selfhost-lint.sh` | ✅ `test/selfhost/compiler_minimal/main.php` + literal `require_once` units toward `bin/vm.php` (no `vendor/`) ([#559](https://github.com/PurHur/php-compiler/issues/559)) |
| Compiler compile smoke lint | `php bin/compile.php -l test/selfhost/compiler_compile_smoke/main.php` | ✅ `compiler_minimal` bundle + literal `require_once` of `test/bootstrap-aot/compiler_smoke.php` (named function CFG) |
Expand Down
Loading
Loading