Skip to content

Fix: Avoid redundant recursion in simplifyCore - #3698

Open
Wu-Li wants to merge 1 commit into
josdejong:developfrom
Wu-Li:develop
Open

Wu-Li wants to merge 1 commit into
josdejong:developfrom
Wu-Li:develop

Conversation

@Wu-Li

@Wu-Li Wu-Li commented Sep 15, 2026

Copy link
Copy Markdown

Defer simplifying a trivial node's first child until its child count is known. Multi-child operators otherwise simplify their first subtree twice, causing exponential work on left-deep addition and multiplication trees.

Add traversal-count regression tests for both operators and preserve coverage of results, input expressions, single-child wrappers, and context.

Defer simplifying a trivial node's first child until its child count is
known. Multi-child operators otherwise simplify their first subtree twice,
causing exponential work on left-deep addition and multiplication trees.

Add traversal-count regression tests for both operators and preserve
coverage of results, input expressions, single-child wrappers, and context.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant