Skip to content

Self-host: Unsupported expression CFG batch tracker (post-#2254 triage) #2301

Description

@PurHur

Category

bootstrap

Milestone

M3/M5 — CFG expression lowering backlog (parent #1492 / stmt sibling #2276)

Problem

lib/Compiler.php ends compileExpr() with:

throw new \LogicException("Unsupported expression: " . $expr->getType());

docs/bootstrap-inventory.md lists Unsupported expression: among recurring CFG warnings. #2276 tracks Unknown Stmt Type: batches; this issue tracks expression kinds from triage.

May 2026 harness note: static lint sweep is currently clean:

./script/docker-exec.sh -- bash -lc './phpc lint --bootstrap-inventory --check'
# 0 unsupported / 701 scanned

./script/docker-exec.sh -- bash -lc 'php script/bootstrap-inventory-triage.php --top 10'
# (no CFG gaps when lint is clean)

The live M3 blocker is native Runtime parse spine at execute time (#2566), not static unsupported expressions. Reprioritize this tracker after emit-TU ladder green unless a new triage run surfaces expression kinds blocking a specific inventory file.

php-src reference

  • Zend/zend_compile.c — zend_compile_expr() switch over zend_ast kinds
  • Zend/zend_ast.c — expression AST node catalog (reference when mapping php-cfg Expr_* gaps)

Repro (refresh batch table)

./script/docker-exec.sh -- bash -lc 'php script/bootstrap-inventory-triage.php --top 30 | grep -i "Unsupported expression" || true'
./script/docker-exec.sh -- bash -lc './phpc lint --bootstrap-inventory --json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(list(d.get(\"unsupported\",{}).keys())[:15])" || true'

When a spine file regresses, capture one failing path:

./script/docker-exec.sh -- bash -lc './phpc lint --bootstrap-inventory path/to/file.php 2>&1 | head -20'

Scope

Module Path
Expression lowering lib/Compiler.php — compileExpr()
Triage script/bootstrap-inventory-triage.php
Lint SSOT ./phpc lint --bootstrap-inventory
Patches patches/ + script/apply-patches.sh for php-cfg gaps

Batch table (living — edit when inventory regresses)

Expr kind (php-cfg) Example spine symptom Child issue Status
(baseline May 2026) 0 unsupported expr — ✅ clean
Expr_Throw in ?? coalesce throw #3462 📋 filed
(add rows from triage) open per-class when ≥3 files

Rule: Do not implement lowering in this umbrella — open focused child issues per Expr_* when a batch blocks ≥3 inventory files or M3 link.

Done when

Verification

./script/docker-exec.sh -- bash -lc 'php script/bootstrap-inventory.php --check'
./script/docker-exec.sh -- bash -lc 'php script/bootstrap-inventory-triage.php --top 20'

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

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions