Skip to content

Self-host M3: lib/Runtime.php native compile batch (parser front-door after #2216) #2294

Description

@PurHur

Problem

#2216 probes native compile of lib/Compiler.php as a single unit. Self-host M3 needs the parser/runtime front-door compiled honestly next: lib/Runtime.php wires nikic/php-parser, php-cfg traversers, and new Compiler() — the path every bin/vm.php invocation uses.

Today inventory shows heavy new * warnings in lib/Runtime.php but 0 blockers; emit still uses Zend fallback in M3/M4 smokes.

Goal

First multi-construct M3 batch after unit probe green:

  1. Native AOT emit (or documented partial) for lib/Runtime.php + minimal require_once closure (no full 611 tree)
  2. BOOTSTRAP_RUNTIME_COMPILE_SMOKE=1 script or PHPUnit probe: compiled artifact can parse+compile a trivial <?php echo 1;
  3. Update docs/self-host-target.md M3 row with honest vs Zend emit
  4. Triage output from Tooling: bootstrap-inventory-triage.php — top CFG gaps across 611 files #2254 ranks remaining blockers in this file

Implementation hints

Piece Path Notes
Probe script/bootstrap-selfhost-runtime-compile-smoke.sh Mirror bootstrap-selfhost-compile-smoke-probe.sh
Bundle test/selfhost/ or docs/bootstrap-profile.json Smallest require_once closure for Runtime
Compiler gaps #58, #101, #145, #2273, #2286 Class methods, extends, unset, static locals
Inventory php script/bootstrap-inventory.php Before/after warning count for lib/Runtime.php

Suggested order

  1. Run ./phpc doctor --selfhost + Tooling: bootstrap-inventory-triage.php — top CFG gaps across 611 files #2254 triage on lib/Runtime.php only
  2. Close CFG gaps ranked in Self-host: Unknown Stmt Type lowering batch tracker (post-#2254 triage) #2276 batches scoped to this file
  3. Land probe script before flipping CI: BOOTSTRAP_M3_COMPILE_SMOKE_STRICT_GATE opt-in in ci-local after #1937 #1968 strict gates

Acceptance criteria

BOOTSTRAP_RUNTIME_COMPILE_SMOKE=1 ./script/bootstrap-selfhost-runtime-compile-smoke.sh
php script/bootstrap-inventory.php --check

Harness:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && BOOTSTRAP_RUNTIME_COMPILE_SMOKE=1 ./script/bootstrap-selfhost-runtime-compile-smoke.sh'

Verification (local / Docker only)

No GitHub Actions (#394 ✅). Full gate: make test-harness after probe lands.

Dependencies

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions