Skip to content

Epic: architecture rearrangement — TU-based pipeline, differential gates, generated maintenance (docs/architecture-review-2026-07.md) #16075

Description

@PurHur

Category

architecture · epic

Summary

Full review in docs/architecture-review-2026-07.md (PR #16072). One-line thesis: the constraint is no longer feature coverage — it is IR correctness discipline, redundant lowering (47% of every build), and maintenance drag.

Target architecture

Everything after the opcode layer becomes a translation unit with an ABI manifest and its own llvm.global_ctors entry: script TU + cached helper TUs + prelinked runtime, linked with plain ld semantics. Every artifact class gets a VM-differential gate. Docs/counters are generated, never hand-edited.

Sequenced plan

  1. ✅ AOT build+execute+VM-differential smoke in fast gate (PR Gates: AOT build+execute+VM-differential smoke in the fast gate (#16010 prevention) #16072) — kills the Regression: every phpc build fails module verification since #15866 — GC bridge miscasts + helper PHP bodies dragging broken lowerings into all builds (lib/JIT/Builtin/GcCollectCyclesRuntime.php) #16010 class
  2. ✅ spine-sync.sh one-command maintenance (PR Gates: AOT build+execute+VM-differential smoke in the fast gate (#16010 prevention) #16072)
  3. Fix four Regression: user-script AOT builds broken for core string builtins — preg_match capture assign, explode CRLF, str_contains, substr negative length (bin/compile.php) #15642 builtins → flip smoke tier 2 to enforced
  4. Helper ABI registry + per-TU ctors — unblocks AOT: split user-script builds into cached runtime TU + script TU — ~50% of every phpc build re-lowers identical JitHelpers (lib/Runtime.php) #15889 (design + prototype in PR AOT: split-compilation helper-runtime cache — experimental scaffold (#15889) #16022)
  5. Complete split compilation: cached helper TUs, parallel emit (measured: hello 3.0→1.9 s, project 5.3→2.2 s)
  6. Typed scalar fast paths (AOT perf: native fibo ~6× slower than Zend 8.2 — boxed call/arith overhead in generated code (lib/JIT.php) #15907 — native fibo is 5.8× slower than Zend today; the 2020 table shows 10× faster is achievable) + bench deltas in gate
  7. VM 1M-iteration ceiling + loud fatals (VM: 1M-iteration loops exit 255 silently after ~30 s — benchmarks/ compute suite cannot run on the VM (bin/vm.php) #15906)
  8. Spine footnotes → one generated include; benchmark rows regenerated from probe results
  9. Gen-0 behavioral-staleness warning (tree-hash stamp)
  10. Honest gen-3 without sidecar recovery (Gen-1+ #1: Honest full-spine native compile without gen-0 sidecar fallback #15597/Gen-1+ #7: Honest compile CI gate (fail loop probe on sidecar recovery) #15603)

End state

Sub-second rebuilds, native ≥ Zend on compute, and a gate system that structurally cannot ship a broken compiler.

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

    MOST IMPORTANTThis are the most important targetsarea:compilerCompiler / CFG / JITenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions