Compiler: compile scaling slice 1 — producer/index caches (#36224 partial) - #36336
Merged
Merged
Conversation
…roducers (#36224 partial) Slice 1 toward flat compile scaling: memoize precedingInlineCallArgProducersBeforeCfgOp and cfg call-index lookups; index only new cfg children instead of re-walking the full block tree on every producer lookup. Adds script/compile-scaling-probe.php for the issue repro. Def-use fast path deferred — prototype changes EXEC_RETURN slot ordinals. Co-authored-by: Cursor <cursoragent@cursor.com>
Build one spl_object_id→index map per cfg block (incremental on child growth) and route ~100 call-site lookups through cfgCallOpIndexInChildren instead of repeated array_search / foreach scans. Scaling probe (Docker): 50 stmt 3.4s, 100 stmt 19.8s, 200 stmt 126s — still ~n^2.6; done-when (<5s @ 200) needs def-use ARG_SEND fast path next. Verified: make dev-verify-fast OK, make north-star5-verify-fast OK. Co-authored-by: Cursor <cursoragent@cursor.com>
Memoize producer-index sync via a block-count + child-count fingerprint so findCfgProducerExprForOperand does not re-walk every seen block when the CFG shape is unchanged. Def-use ARG_SEND fast path prototyped but not landed — opcode md5 diverges on FUNCCALL_EXEC_RETURN slot ordinals (same blocker as slice 1); next slice must wire through ensureDeferredSibling ordinals. Verified: make dev-verify-fast OK (aot-smoke 9/9, tier-0 diff 15/15). Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/issue-36224-compile-superquadratic
branch
from
September 2, 2026 13:08
c0a259e to
7f9c0c7
Compare
Owner
Author
Verification (implementer-worker-lane-b, rebased onto master
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partial progress on #36224 (super-quadratic
Compiler::compileon repeated call statements):precedingInlineCallArgProducersBeforeCfgOp()per call-op (110 call sites; was re-scanning cfg siblings on every invocation).array_search) per call-op.indexCfgProducerBlockTree()— index only newly appended cfg children instead of re-walking the full tree when child count grows during compile.script/compile-scaling-probe.phpfor the issue repro (50/100/200stmt harness).Def-use fast path (
PHP_COMPILER_CALLARG_DEFUSE=1) was prototyped but reverted — it changesFUNCCALL_EXEC_RETURNslot ordinals (md5 mismatch on nestedstr_pad(implode(array_map(...)))) withoutensureDeferredSiblingInlineCallArgProducersCompiled. Needs slice 2 wired to sibling EXEC_RETURN ordinals before staging.Scaling (Docker
php-compiler:22.04-dev,Compiler::compileonly)Still ~n^2.6 — done-when (<5s @ 200 stmts) not met. Next slice: def-use ARG_SEND wired through existing sibling EXEC_RETURN ordinals + skip legacy matcher chain when indexed.
Test plan
Not run: full differential sweep (142/142), opcode corpus md5 gate (≥100 files) — no opcode output change intended on this slice.
Closes #36224 when follow-up lands scaling target; this PR is partial — do not merge until 200-stmt probe <5s or issue owner accepts phased delivery.
Made with Cursor