Commit Graph
20466 Commits
Author SHA1 Message Date
Joe Savona 83c03e3967 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-06 09:56:21 -07:00
Joe Savona 4bf905ff9b Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-06 09:56:20 -07:00
Joe Savona d4cb6d1947 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 22:12:52 -07:00
Joe Savona fdbcdcb04f Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 22:12:52 -07:00
Joe Savona 41e24fe57b Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 14:16:32 -07:00
Joe Savona ab7db629bc Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 14:16:31 -07:00
Joe Savona e917322a91 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 14:00:04 -07:00
Joe Savona 84e11acef3 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-05 14:00:03 -07:00
Joe Savona d5da1a2bcc Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-04 17:00:26 -07:00
Joe Savona 2b0985b17b Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-04 17:00:25 -07:00
Joe Savona e6766404ad Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-04 16:47:37 -07:00
Joe Savona 0de7a62d67 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-04 16:47:36 -07:00
Joe Savona 9df5fdc1cf Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 17:00:12 -07:00
Joe Savona b019457a24 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 17:00:11 -07:00
Joe Savona bdfb545e9c Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 11:33:16 -07:00
Joe Savona e0d27a112c Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 11:33:16 -07:00
Joe Savona 2d16132716 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 09:00:48 -07:00
Joe Savona 9841b263a1 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-03 09:00:48 -07:00
Joe Savona d992ed80c9 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-01 17:19:19 -07:00
Joe Savona 0cc7ce4bd4 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-06-01 17:19:18 -07:00
Joe Savona a73ebbde59 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 16:29:29 -07:00
Joe Savona 19b3694f7e Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 16:29:28 -07:00
Joe Savona ac00108330 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 15:56:53 -07:00
Joe Savona 7a77e78e4a Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 15:56:52 -07:00
Joe Savona c00f41b8e2 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 11:33:20 -07:00
Joe Savona 786d8bf2af Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-30 11:33:19 -07:00
Joe Savona 3f32fbc6a6 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-29 17:30:20 -07:00
Joe Savona 97e2e6ca77 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-29 17:30:20 -07:00
Joe Savona 8e1547b23a Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 22:27:14 -07:00
Joe Savona 905a787d26 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 22:27:13 -07:00
Joe Savona 2b5443e6d0 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 17:38:41 -07:00
Joe Savona 2b88127709 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 17:38:41 -07:00
Joe Savona 785b412743 Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 16:29:28 -07:00
Joe Savona 2dad41e7ba Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 16:29:27 -07:00
Joe Savona f9bb6067ab Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 15:42:36 -07:00
Joe Savona 94409c39f3 Update base for Update on "[compiler] Improve inference of function expression mutation/aliasing effects"
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-28 15:42:35 -07:00
Joe Savona e8d39119b1 [compiler] Improve inference of function expression mutation/aliasing effects
Distinguish the various forms of mutation, and do basic replaying of these effects when the function is created (imperfect, temporary).

[ghstack-poisoned]
2025-05-27 16:31:02 -07:00
Joe Savona ff14c671fd Update on "[compiler] Alternate pipeline for new mutability model"
This PR gets a first fixture working end-to-end with the new mutability and aliasing model. Key changes:

* Add a feature flag to enable the model. When enabled we no longer call InferReferenceEffects or InferMutableRanges, and instead use the new equivalents.
* Adds a pass that infers Place-specific effects based on mutable ranges and instruction effects. This is necessary to satisfy existing code that requires operand effects to be populated.
* Adds a pass that infers the outwardly-visible capturing/aliasing behavior of a function expression. The idea is that this can bubble up and be used in conjunction with the `Apply` effect to get precise inference of things like `array.map(() => { ... })`.

[ghstack-poisoned]
2025-05-27 16:31:00 -07:00
Joe Savona ca0f0e006d Update base for Update on "[compiler] Alternate pipeline for new mutability model"
This PR gets a first fixture working end-to-end with the new mutability and aliasing model. Key changes:

* Add a feature flag to enable the model. When enabled we no longer call InferReferenceEffects or InferMutableRanges, and instead use the new equivalents.
* Adds a pass that infers Place-specific effects based on mutable ranges and instruction effects. This is necessary to satisfy existing code that requires operand effects to be populated.
* Adds a pass that infers the outwardly-visible capturing/aliasing behavior of a function expression. The idea is that this can bubble up and be used in conjunction with the `Apply` effect to get precise inference of things like `array.map(() => { ... })`.

[ghstack-poisoned]
2025-05-27 16:30:59 -07:00
Joe Savona 05a8b6a717 [compiler] Alternate pipeline for new mutability model
This PR gets a first fixture working end-to-end with the new mutability and aliasing model. Key changes:

* Add a feature flag to enable the model. When enabled we no longer call InferReferenceEffects or InferMutableRanges, and instead use the new equivalents.
* Adds a pass that infers Place-specific effects based on mutable ranges and instruction effects. This is necessary to satisfy existing code that requires operand effects to be populated.
* Adds a pass that infers the outwardly-visible capturing/aliasing behavior of a function expression. The idea is that this can bubble up and be used in conjunction with the `Apply` effect to get precise inference of things like `array.map(() => { ... })`.

[ghstack-poisoned]
2025-05-27 14:23:38 -07:00
Joe Savona 58e449ee0e [compiler] Add HIRFunction.returns: Place
[ghstack-poisoned]
2025-05-27 14:23:33 -07:00
Joe Savona 61bd21cd18 Update on "[compiler] Foundation of new mutability and aliasing (alternate take)"
Alternate take at a new mutability and alising model, aiming to replace `InferReferenceEffects` and `InferMutableRanges`. My initial passes at this were more complicated than necessary, and I've iterated to refine and distill this down to the core concepts. There are two effects that track information flow: `capture` and `alias`:

* Given distinct values A and B. After capture A -> B, mutate(B) does *not* modify A. This more precisely captures the semantic of the previous `Store` effect. As an example, `array.push(item)` has the effect `capture item -> array` and `mutate(array)`. The array is modified, not the item.
* Given distinct values A and B. After alias A -> B, mutate(B) *does* modify A. This is because B now refers to the same value as A.
* Given distinct values A and B, after *either* capture A -> B *or* alias A -> B, transitiveMutate(B) counts as a mutation of A. Transitive mutation is the default, and places that previously used `Store` will use non-transitive mutate effects instead.

Conceptually "capture A -> B" means that a reference to A was "captured" (or stored) within A, but there is not a directly aliasing. Whereas "alias A -> B" means literal value aliasing.

The idea is that our previous sequential fixpoint loops in InferMutableRanges can instead work by first looking at transitive mutations, then look at non-transitive mutations. And aliasing groups can be built purely based on the `alias` effect.

Lots more to do here but the structure is coming together.

[ghstack-poisoned]
2025-05-27 14:23:31 -07:00
Joe Savona 3e67c7e39f Update base for Update on "[compiler] Foundation of new mutability and aliasing (alternate take)"
Alternate take at a new mutability and alising model, aiming to replace `InferReferenceEffects` and `InferMutableRanges`. My initial passes at this were more complicated than necessary, and I've iterated to refine and distill this down to the core concepts. There are two effects that track information flow: `capture` and `alias`:

* Given distinct values A and B. After capture A -> B, mutate(B) does *not* modify A. This more precisely captures the semantic of the previous `Store` effect. As an example, `array.push(item)` has the effect `capture item -> array` and `mutate(array)`. The array is modified, not the item.
* Given distinct values A and B. After alias A -> B, mutate(B) *does* modify A. This is because B now refers to the same value as A.
* Given distinct values A and B, after *either* capture A -> B *or* alias A -> B, transitiveMutate(B) counts as a mutation of A. Transitive mutation is the default, and places that previously used `Store` will use non-transitive mutate effects instead.

Conceptually "capture A -> B" means that a reference to A was "captured" (or stored) within A, but there is not a directly aliasing. Whereas "alias A -> B" means literal value aliasing.

The idea is that our previous sequential fixpoint loops in InferMutableRanges can instead work by first looking at transitive mutations, then look at non-transitive mutations. And aliasing groups can be built purely based on the `alias` effect.

Lots more to do here but the structure is coming together.

[ghstack-poisoned]
2025-05-27 14:23:31 -07:00
Joe Savona 6cc26518f3 Update on "[compiler] Foundation of new mutability and aliasing (alternate take)"
Alternate take at a new mutability and alising model, aiming to replace `InferReferenceEffects` and `InferMutableRanges`. My initial passes at this were more complicated than necessary, and I've iterated to refine and distill this down to the core concepts. There are two effects that track information flow: `capture` and `alias`:

* Given distinct values A and B. After capture A -> B, mutate(B) does *not* modify A. This more precisely captures the semantic of the previous `Store` effect. As an example, `array.push(item)` has the effect `capture item -> array` and `mutate(array)`. The array is modified, not the item.
* Given distinct values A and B. After alias A -> B, mutate(B) *does* modify A. This is because B now refers to the same value as A.
* Given distinct values A and B, after *either* capture A -> B *or* alias A -> B, transitiveMutate(B) counts as a mutation of A. Transitive mutation is the default, and places that previously used `Store` will use non-transitive mutate effects instead.

Conceptually "capture A -> B" means that a reference to A was "captured" (or stored) within A, but there is not a directly aliasing. Whereas "alias A -> B" means literal value aliasing.

The idea is that our previous sequential fixpoint loops in InferMutableRanges can instead work by first looking at transitive mutations, then look at non-transitive mutations. And aliasing groups can be built purely based on the `alias` effect.

Lots more to do here but the structure is coming together.

[ghstack-poisoned]
2025-05-23 16:58:18 -07:00
Joe Savona 79a13a29c5 Update base for Update on "[compiler] Foundation of new mutability and aliasing (alternate take)"
Alternate take at a new mutability and alising model, aiming to replace `InferReferenceEffects` and `InferMutableRanges`. My initial passes at this were more complicated than necessary, and I've iterated to refine and distill this down to the core concepts. There are two effects that track information flow: `capture` and `alias`:

* Given distinct values A and B. After capture A -> B, mutate(B) does *not* modify A. This more precisely captures the semantic of the previous `Store` effect. As an example, `array.push(item)` has the effect `capture item -> array` and `mutate(array)`. The array is modified, not the item.
* Given distinct values A and B. After alias A -> B, mutate(B) *does* modify A. This is because B now refers to the same value as A.
* Given distinct values A and B, after *either* capture A -> B *or* alias A -> B, transitiveMutate(B) counts as a mutation of A. Transitive mutation is the default, and places that previously used `Store` will use non-transitive mutate effects instead.

Conceptually "capture A -> B" means that a reference to A was "captured" (or stored) within A, but there is not a directly aliasing. Whereas "alias A -> B" means literal value aliasing.

The idea is that our previous sequential fixpoint loops in InferMutableRanges can instead work by first looking at transitive mutations, then look at non-transitive mutations. And aliasing groups can be built purely based on the `alias` effect.

Lots more to do here but the structure is coming together.

[ghstack-poisoned]
2025-05-23 16:58:17 -07:00
Joe Savona 80ae4e96ae [compiler] Foundation of new mutability and aliasing (alternate take)
Alternate take at a new mutability and alising model, aiming to replace `InferReferenceEffects` and `InferMutableRanges`. My initial passes at this were more complicated than necessary, and I've iterated to refine and distill this down to the core concepts. There are two effects that track information flow: `capture` and `alias`:

* Given distinct values A and B. After capture A -> B, mutate(B) does *not* modify A. This more precisely captures the semantic of the previous `Store` effect. As an example, `array.push(item)` has the effect `capture item -> array` and `mutate(array)`. The array is modified, not the item.
* Given distinct values A and B. After alias A -> B, mutate(B) *does* modify A. This is because B now refers to the same value as A.
* Given distinct values A and B, after *either* capture A -> B *or* alias A -> B, transitiveMutate(B) counts as a mutation of A.

Conceptually "capture A -> B" means that a reference to A was "captured" (or stored) within A, but there is not a directly aliasing. Whereas "alias A -> B" means literal value aliasing.

The idea is that our previous sequential fixpoint loops in InferMutableRanges can instead work by first looking at transitive mutations, then look at non-transitive mutations. And aliasing groups can be built purely based on the `alias` effect.

Lots more to do here but the structure is coming together.

[ghstack-poisoned]
2025-05-22 16:57:29 -07:00
Joe Savona f5cd556ffa Update on "[compiler] Repro for imprecise memo due to closure capturing changes"
Syncing this stack internally there is a small percentage of files that lose memoization, generally for callbacks. The repro here tries to get at the core pattern, where a parameter escapes into a mutable return value. This makes the callback appear mutable, and means that calls like array.map aren't able to optimize as well — even if the array itself is transitively immutable.

The challenge is that we can't really distinguish between just capturing and true mutation right now — AnalyzeFunctions kind of has to pick one, and consider both a mutation.

[ghstack-poisoned]
2025-05-22 16:57:27 -07:00
Joe Savona 0c7e645dd3 Update base for Update on "[compiler] Repro for imprecise memo due to closure capturing changes"
Syncing this stack internally there is a small percentage of files that lose memoization, generally for callbacks. The repro here tries to get at the core pattern, where a parameter escapes into a mutable return value. This makes the callback appear mutable, and means that calls like array.map aren't able to optimize as well — even if the array itself is transitively immutable.

The challenge is that we can't really distinguish between just capturing and true mutation right now — AnalyzeFunctions kind of has to pick one, and consider both a mutation.

[ghstack-poisoned]
2025-05-22 16:57:26 -07:00
5dc1b212c3 [Fizz] Support basic SuspenseList forwards/backwards revealOrder (#33306)
Basically we track a `SuspenseListRow` on the task. These keep track of
"pending tasks" that block the row. A row is blocked by:

- First itself completing rendering.
- A previous row completing.
- Any tasks inside the row and before the Suspense boundary inside the
row. This is mainly because we don't yet know if we'll discover more
SuspenseBoundaries.
- Previous row's SuspenseBoundaries completing.

If a boundary might get outlined, then we can't consider it completed
until we have written it because it determined whether other future
boundaries in the row can finish.

This is just handling basic semantics. Features not supported yet that
need follow ups later:

- CSS dependencies of previous rows should be added as dependencies of
future row's suspense boundary. Because otherwise if the client is
blocked on CSS then a previous row could be blocked but the server
doesn't know it.
- I need a second pass on nested SuspenseList semantics.
- `revealOrder="together"`
- `tail="hidden"`/`tail="collapsed"`. This needs some new runtime
semantics to the Fizz runtime and to allow the hydration to handle
missing rows in the HTML. This should also be future compatible with
AsyncIterable where we don't know how many rows upfront.
- Need to double check resuming semantics.

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
2025-05-19 15:16:42 -04:00
Jan KassensandGitHub a3abf5f2f8 [eslint-plugin-react-hooks] add experimental_autoDependenciesHooks option (#33294) 2025-05-19 15:08:30 -04:00