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 docs/pages/development-status.md
Original file line number Diff line number Diff line change
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)): 12/13 closed; `debug_backtrace` ([#1378](https://github.com/PurHur/php-compiler/issues/1378)) in [#1404](https://github.com/PurHur/php-compiler/pull/1404) |
| **Web AOT** (build, deploy) | ~65% | Project link ✅; home-route execute ✅; PATH_INFO / layout chain 🚧 |
| **Reference app** (MiniWebApp) | ~55% | VM ✅; AOT link ✅; AOT execute **partial** |
| **Self-host** (North Star 2, M0–M5) | ~59% | M0–M1 ✅; M2 spine **343/584**; 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) | ~61% | M0–M1 ✅; M2 spine **358/584**; 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 @@ -197,7 +197,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 (**584** files) | 🚧 **343** / 584 units (~59%; [#1056](https://github.com/PurHur/php-compiler/issues/1056), [#1497](https://github.com/PurHur/php-compiler/issues/1497)) |
| **M2 — Lib spine growth** | `compiler_lib_spine_smoke` bundle toward full `bin/vm.php` inventory (**584** files) | 🚧 **358** / 584 units (~61%; [#1056](https://github.com/PurHur/php-compiler/issues/1056), [#1497](https://github.com/PurHur/php-compiler/issues/1497)) |
| **M3 — Native compiles PHP** | Self-hosted bundle links; HelloWorld AOT **runs** natively; **emit still uses Zend** `bin/compile.php` fallback | 🚧 partial ([#1056](https://github.com/PurHur/php-compiler/issues/1056)) |
| **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** ([#1056](https://github.com/PurHur/php-compiler/issues/1056)) |
Expand All @@ -207,7 +207,7 @@ 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) | **343** | vm.php-path lib/ + ext/standard growth bundle |
| `compiler_lib_spine_smoke` (M2) | **358** | vm.php-path lib/ + ext/standard growth bundle |
| Top-level `lib/*.php` | **14** | Per-file AOT lint ✅ |
| Full vm.php inventory | **569** | Phase A inventory (`php script/bootstrap-inventory.php`) |

Expand Down Expand Up @@ -242,7 +242,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` (**343** units) |
| M2 spine native link | `BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke` | ✅ `compiler_lib_spine_smoke bundle OK` (**358** 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
8 changes: 4 additions & 4 deletions docs/self-host-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ That is **M5**. Everything below is the honest path from today’s bootstrap to
| Layer | Today | Target |
|-------|-------|--------|
| **Bootstrap driver** | Zend runs `php bin/compile.php` | Compiled `bin/compile.php` |
| **Bundle size** | **328** spine units + **109** minimal = **437** curated `require_once` | ~**584** inventory files |
| **Inventory coverage** | **~53%** of vm.php path in spine smoke | **100%** |
| **Bundle size** | **358** curated `require_once` in spine smoke (108 minimal overlap + **250** M2-only) | ~**584** inventory files |
| **Inventory coverage** | **~61%** of vm.php path in spine smoke | **100%** |
| **HelloWorld** | Native **run** ✅; **emit** still Zend fallback | Native compile + emit |
| **Bootstrap loop (M4)** | Not started | Native rebuilds next compiler revision |
| **Vendor** | `composer install` + patches on host | Prelinked artifacts only |
Expand All @@ -60,7 +60,7 @@ That is **M5**. Everything below is the honest path from today’s bootstrap to
|-----------|----------------|--------|-----|
| **M0** | AOT can link a **small** honest `lib/` subset | ✅ | 100% |
| **M1** | Bundle is **compiler-shaped** (lint + compile-smoke) | ✅ | 100% |
| **M2** | Spine grows toward full `bin/vm.php` inventory | 🚧 **328/584** units | **~57%** |
| **M2** | Spine grows toward full `bin/vm.php` inventory | 🚧 **358/584** units | **~61%** |
| **M3** | Self-host binary **compiles external PHP** (HelloWorld) without Zend emit | 🚧 partial | **~45%** |
| **M4** | Self-host binary **rebuilds** the next compiler tree | ⬜ | 0% |
| **M5** | Full self-host; Zend retired from loop | ⬜ north star | 0% |
Expand Down Expand Up @@ -113,7 +113,7 @@ Parallel batches ([#1419](https://github.com/PurHur/php-compiler/issues/1419)) g
| Entry | Units | Role |
|-------|------:|------|
| `test/selfhost/compiler_minimal/main.php` | **109** | M0 core |
| `test/selfhost/compiler_lib_spine_smoke/main.php` | **343** | M2 growth ([#1497](https://github.com/PurHur/php-compiler/issues/1497) wave 2 batch 3) |
| `test/selfhost/compiler_lib_spine_smoke/main.php` | **358** | M2 growth ([#1497](https://github.com/PurHur/php-compiler/issues/1497) wave 2 batch 4) |
| `test/selfhost/compiler_helloworld_smoke/` | — | M3 probe + compile driver |
| `test/selfhost/bootstrap_loop_smoke/` | — | M4 scaffold (gen-1→gen-2 loop probe; [#1498](https://github.com/PurHur/php-compiler/issues/1498)) |

Expand Down
15 changes: 15 additions & 0 deletions test/selfhost/compiler_lib_spine_smoke/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,21 @@
require_once __DIR__.'/../../../ext/standard/array_merge.php';
require_once __DIR__.'/../../../ext/standard/array_map.php';
require_once __DIR__.'/../../../ext/standard/array_intersect.php';
require_once __DIR__.'/../../../ext/standard/array_push.php';
require_once __DIR__.'/../../../ext/standard/array_product.php';
require_once __DIR__.'/../../../ext/standard/array_replace.php';
require_once __DIR__.'/../../../ext/standard/array_reverse.php';
require_once __DIR__.'/../../../ext/standard/array_slice.php';
require_once __DIR__.'/../../../ext/standard/array_splice.php';
require_once __DIR__.'/../../../ext/standard/array_sum.php';
require_once __DIR__.'/../../../ext/standard/array_unique.php';
require_once __DIR__.'/../../../ext/standard/array_unshift.php';
require_once __DIR__.'/../../../ext/standard/array_values.php';
require_once __DIR__.'/../../../ext/standard/atan2.php';
require_once __DIR__.'/../../../ext/standard/base64_decode.php';
require_once __DIR__.'/../../../ext/standard/base64_encode.php';
require_once __DIR__.'/../../../ext/standard/basename.php';
require_once __DIR__.'/../../../ext/standard/bindec.php';
require_once __DIR__.'/../../../ext/standard/floatval.php';
require_once __DIR__.'/../../../ext/standard/hex2bin.php';
require_once __DIR__.'/../../../ext/standard/addslashes.php';
Expand Down
17 changes: 16 additions & 1 deletion test/unit/BootstrapSelfhostBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ final class BootstrapSelfhostBundleTest extends TestCase
'ext/standard/array_key_exists.php',
'ext/standard/array_keys.php',
'ext/standard/array_intersect.php',
'ext/standard/array_push.php',
'ext/standard/array_product.php',
'ext/standard/array_replace.php',
'ext/standard/array_reverse.php',
'ext/standard/array_slice.php',
'ext/standard/array_splice.php',
'ext/standard/array_sum.php',
'ext/standard/array_unique.php',
'ext/standard/array_unshift.php',
'ext/standard/array_values.php',
'ext/standard/atan2.php',
'ext/standard/base64_decode.php',
'ext/standard/base64_encode.php',
'ext/standard/basename.php',
'ext/standard/bindec.php',
];

public static function setUpBeforeClass(): void
Expand All @@ -265,7 +280,7 @@ public function testCompilerLibSpineSmokeBundleUnitCountAndKeyUnits(): void
$this->assertFileExists($entry);
$contents = (string) file_get_contents($entry);
$count = substr_count($contents, 'require_once __DIR__');
$this->assertSame(343, $count, '108 compiler_minimal units + 235 M2 spine units (#1497 wave 2 batch 3); preg/array_combine wrappers skipped (AOT __value__* docblocks); Vm* deferred #1467');
$this->assertSame(358, $count, '108 compiler_minimal units + 250 M2 spine units (#1497 wave 2 batch 4); array_pop/shift/search + preg/array_combine wrappers skipped (AOT types); Vm* deferred #1467');
foreach (self::LIB_SPINE_SMOKE_NEW_UNITS as $unit) {
$this->assertStringContainsString(
"require_once __DIR__.'/../../../{$unit}';",
Expand Down