Skip to content

Front end: the Simplifier use-chain default flip (#23070) never applied to already-patched trees — the grep guard skips the updated patch, so dev boxes and helper-cache emitters still run the legacy O(phis×blocks) walk (re-#36225) (script/apply-patches.sh:560, patches/php-cfg-simplifier-use-chain.patch) #36250

Description

@PurHur

Category

Foundation: · compiler throughput + patch mechanism · child of #36188 · respin of #36225 (closed by PR #36242, whose summary states "Use-chain is already the compile default via patches/php-cfg-simplifier-use-chain.patch on master" — true only for trees patched after 2026-07-25)

Problem

Verified on the maintainer's tree at master 4eed6a2785 after a fresh script/apply-patches.sh run today:

  • patches/php-cfg-simplifier-use-chain.patch (updated ac1ac79e0d 2026-07-25, Perf: default PHPCFG Simplifier to use-chain path (#23056) #23070) makes use-chain the default with PHPCFG_SIMPLIFIER_LEGACY=1 as opt-out.
  • The vendored vendor/ircmaxell/php-cfg/lib/PHPCfg/Visitor/Simplifier.php:209 still reads if ('1' !== getenv('PHPCFG_SIMPLIFIER_USECHAIN'))legacy by default; grep -c "getenv('PHPCFG_SIMPLIFIER_LEGACY')" on it → 0.
  • Cause: script/apply-patches.sh:560-562 treats the patch as applied when replaceVariablesByCfgWalk is present — a marker introduced by the July 5 version of the same patch (Speed up inventory lint: opt-in fast frontend patches + parallel cached bin/lint.php (#16077) #16394). Every tree patched between July 5 and July 25 (dev boxes, worktrees, the helper-cache emitter, the gen-0 refresh boxes) keeps the old code forever; only fresh composer install trees (CI) get the flip. Two different compilers by history.
  • Measured cost on this tree: preprocessor on lib/Block.php 2,792 ms (legacy) vs 152 ms (use-chain) — 18x; the July 25 gen-0 OOM profile had 57 % of samples in the legacy walk on the very day the flip "landed".

PHP implementation target

Done when

  • On a tree patched before 2026-07-25, script/apply-patches.sh updates Simplifier.php to the use-chain default; php bin/vm.php -l lib/Block.php ≥ 30 % faster on this box
  • A unit test asserts the vendored file matches the patch's post-image for this and every other patch (or --verify-pristine covers all 183)
  • SimplifierUseChainOpcodeEquivalenceTest (fixed in Foundation: fix vacuous Simplifier use-chain equivalence test (#36225) #36242) green with the default flipped

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 / JITbugSomething isn't workingimplementation-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