[pull] canary from vercel:canary#1052
Merged
Merged
Conversation
…93876) ### What? Introduces a new `Recomputation` priority in `TaskPriority` that schedules recomputed tasks (tasks re-run because their output or cell wasn't available when read) ahead of all invalidation phases. Also documents every `TaskExecutionReason` variant and removes the unused `Local` variant. ### Why? When a task is recomputed because a downstream consumer needed its output/cell, that recomputation should run before lower-priority invalidations so the consumer can make progress. Previously these recomputations were scheduled with `Initial` priority, which placed them alongside fresh work and behind ongoing invalidation phases, hurting latency for the task actually being awaited. Care is needed so the new priority doesn't spread virally: any invalidation triggered during a `Recomputation` task must not itself be tagged `Recomputation`, otherwise the priority would leak across the graph and break ordering. The change therefore resets the priority to `Initial` for invalidations triggered from a recomputation context. ### How? - `turbo-tasks/src/manager.rs`: Add `TaskPriority::Recomputation` variant, ordered before `Invalidation`. Update `Display` and `update` impls. - `turbo-tasks-backend/src/backend/mod.rs`: Schedule output-not-available and cell-not-available recomputations with `TaskPriority::Recomputation` instead of `Initial`. - `turbo-tasks-backend/src/backend/operation/invalidate.rs`: When `make_task_dirty_internal` runs under a parent task with `Recomputation` priority, downgrade the propagated priority to `Initial` so the recomputation marker does not spread. Also tighten the "already dirty" branch so a stored `Initial` priority is always replaced by a more specific parent priority. - `turbo-tasks/src/task_execution_reason.rs`: Document each variant and drop the unused `Local` variant (and its `as_str` arm). Closes NEXT- <!-- NEXT_JS_LLM_PR -->
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )