turbo-tasks-backend: add TaskAccess (MaybeCreate/MustExist) to task lookups#96043
turbo-tasks-backend: add TaskAccess (MaybeCreate/MustExist) to task lookups#96043lukesandberg wants to merge 1 commit into
Conversation
…ookups Replace the implicit create-on-miss behavior of ExecuteContext::task with an explicit TaskAccess argument so every call site declares intent: - MaybeCreate: open-or-create (today's behavior) — creation and edge-follows. - MustExist: the task must already exist (resident or on disk); fabricating a blank for a nonexistent task is a bug. The existence check is debug-only for now (panics in debug, falls back to create in release) and will be promoted once the call-site classification is proven. lookup_data now reports DB-key presence and restore_task_data threads it through so a MustExist open can refuse to fabricate. task_pair also takes TaskAccess. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tests PassedCommit: ee0a2e0 |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Stats from current PRWarning No stats were collected for Webpack because its stats job did not complete (it failed, was cancelled, or timed out). The results below only cover the bundlers that finished. 🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (29 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsfailed to diffapp-route-ex..ntime.dev.jsDiff too large to display app-route-ex..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route.runtime.dev.jsDiff too large to display app-route.ru..time.prod.jsDiff too large to display pages-api-tu..ntime.dev.jsDiff too large to display pages-api-tu..time.prod.jsDiff too large to display pages-api.runtime.dev.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages-turbo...ntime.dev.jsDiff too large to display pages-turbo...time.prod.jsDiff too large to display pages.runtime.dev.jsDiff too large to display pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: ee0a2e0 |
| let task_id = chain.last().unwrap(); | ||
| let error = { | ||
| let task = ctx.task(*task_id, TaskDataCategory::Meta); | ||
| let task = ctx.task(*task_id, TaskDataCategory::Meta, TaskAccess::MaybeCreate); |
There was a problem hiding this comment.
this should be MustExist, we a recovering an error referencing a task id for a task that previously failed
|
|
||
| for (child_task_id, count) in children { | ||
| let task_description = ctx | ||
| .task(child_task_id, TaskDataCategory::Data) | ||
| .task( | ||
| child_task_id, | ||
| TaskDataCategory::Data, | ||
| TaskAccess::MaybeCreate, | ||
| ) |
There was a problem hiding this comment.
| let dependent = ctx.task( | ||
| dependent_task_id, | ||
| TaskDataCategory::All, | ||
| TaskAccess::MaybeCreate, |
There was a problem hiding this comment.
dependents must exist

Annotate each task access with an assertion whether or not we allow a task to be created