Skip to content

[compiler] New inference repros/fixes #33584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[compiler] New inference repros/fixes #33584

wants to merge 1 commit into from

Conversation

josephsavona
Copy link
Member

Adds a mechanism where if we can't determine a precise set of aliasing (data flow) effects for a function signature, to fall back to treating function expressions as general-purpose mutable values. Concretely:

  • InferMutationAliasingEffects has an optimization where if you're Apply-ing a specific, known function expression, that we use the inferred signature for that function. Now we only use this mode if we could infer a precise signature.
  • InferFunctionExpressionAliasingSignature now bails out if there is a phi with a backedge, since we weren't handling this case.

See the repro for this case: i confirmed that it was previously incorrect.

Also adds a repro for a case of an invalid array length, which exposes the fact that InferFunctionExpressionAliasingSignatures is accumulating aliases w/o reducing them in any way. A complex enough function expression can lead to the accumulated array of effects overflowing the max array size. Fix in the next PR.

Adds a mechanism where if we can't determine a precise set of aliasing (data flow) effects for a function signature, to fall back to treating function expressions as general-purpose mutable values. Concretely:

* `InferMutationAliasingEffects` has an optimization where if you're `Apply`-ing a specific, known function expression, that we use the inferred signature for that function. Now we only use this mode _if_ we could infer a precise signature.
* `InferFunctionExpressionAliasingSignature` now bails out if there is a phi with a backedge, since we weren't handling this case.

See the repro for this case: i confirmed that it was previously incorrect.

Also adds a repro for a case of an invalid array length, which exposes the fact that InferFunctionExpressionAliasingSignatures is accumulating aliases w/o reducing them in any way. A complex enough function expression can lead to the accumulated array of effects overflowing the max array size. Fix in the next PR.
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants