[lts-active] turbo-tasks snapshot consistency fixes (#99644, #99732, #99649) (#100002)
## Summary Backports three snapshot-consistency fixes to `releases/lts/active`, in canary order: - #99644 turbo-tasks: bincode-encode copy-on-write snapshots instead of cloning - #99732 turbo-tasks: disable persisting after a failed snapshot - #99649 turbo-tasks: copy tasks on their first modification during a snapshot 16.4.0 can persist inconsistent task state when a mutation races a background snapshot. The main case is #99649. A task that is meta-dirty and data-clean when the snapshot starts, then writes data before meta, has its live (post-mutation) meta persisted. One example is an invalidated task that re-runs while an idle snapshot is writing. `children` and `parent_count` are both meta, so the cache on disk can list a child edge without the child's matching `parent_count`. `next dev` doesn't persist on shutdown, so the next session restores that state. When the parent later drops the edge, the server aborts with `parent_count underflow: decremented below the number of persistent parents`. We have one report of this from a 16.4.0 dev run. The cherry-picks apply without conflicts. The six touched files are identical to `canary` at #99649. ## Verification - `cargo test -p turbo-tasks-backend --lib` on this branch: 119 passed. This includes #99649's regression test `modify_other_category_first_during_snapshot_preserves_snapshot_meta` and #99732's `failed_persist_disables_persisting`. - Locally on macOS this needed `CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=cc` and `RUSTFLAGS` set to the repo's shared flags without `--icf=all`. The branch's pinned `nightly-2026-08-20` ships a `rust-lld` that can't read the current macOS SDK's `.tbd` files. This is unrelated to the change, and CI uses its normal config. <!-- NEXT_JS_LLM --> --------- Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com>
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment