You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
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
Guard by the new behaviour, not the old marker: patch_already_applied for this patch must require getenv('PHPCFG_SIMPLIFIER_LEGACY') in the file; same review for every guard that predates a patch update (git log -- patches/X.patch newer than the guard line).
Re-run make helper-runtime-prelink-refresh after fixing the tree — the committed units may have been emitted by a legacy-Simplifier compiler (order-sensitive phi operand types, per the patch's own comment).
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)
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
4eed6a2785after a freshscript/apply-patches.shrun today:patches/php-cfg-simplifier-use-chain.patch(updatedac1ac79e0d2026-07-25, Perf: default PHPCFG Simplifier to use-chain path (#23056) #23070) makes use-chain the default withPHPCFG_SIMPLIFIER_LEGACY=1as opt-out.vendor/ircmaxell/php-cfg/lib/PHPCfg/Visitor/Simplifier.php:209still readsif ('1' !== getenv('PHPCFG_SIMPLIFIER_USECHAIN'))→ legacy by default;grep -c "getenv('PHPCFG_SIMPLIFIER_LEGACY')"on it → 0.script/apply-patches.sh:560-562treats the patch as applied whenreplaceVariablesByCfgWalkis 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 freshcomposer installtrees (CI) get the flip. Two different compilers by history.lib/Block.php2,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
patch_already_appliedfor this patch must requiregetenv('PHPCFG_SIMPLIFIER_LEGACY')in the file; same review for every guard that predates a patch update (git log -- patches/X.patchnewer than the guard line).apply-patches.sh --verify-pristine(PR Fix php-llvm-structgep-assert.patch drift blocking CI (#36209) #36233) extended to all patches (see Foundation: patches/ are no longer the source of truth — apply-patches.sh is 7,508 lines with 85 overlay functions and 412 grep guards, 92 of 183 patches neither apply nor reverse cleanly; fork php-cfg/php-types and keep patches only for php-llvm (patches/, script/apply-patches.sh) #36229 for the fork direction).make helper-runtime-prelink-refreshafter fixing the tree — the committed units may have been emitted by a legacy-Simplifier compiler (order-sensitive phi operand types, per the patch's own comment).Done when
script/apply-patches.shupdatesSimplifier.phpto the use-chain default;php bin/vm.php -l lib/Block.php≥ 30 % faster on this box--verify-pristinecovers all 183)SimplifierUseChainOpcodeEquivalenceTest(fixed in Foundation: fix vacuous Simplifier use-chain equivalence test (#36225) #36242) green with the default flipped