Repository navigation
core: compute changeset diffs from metadata instead of full-content g… - #13615
Conversation
When rename detection is triggered by any added and removed file, this path also copies every modified file into Concrete example and control flowSuppose the changeset contains: The delta walk produces: The addition and removal set beforePaths := slices.Clone(modified) // large.db
afterPaths := slices.Clone(modified) // large.dbThe actual rename candidates are then appended. Consequently, the temporary trees contain:
The modified file cannot participate in rename pairing because it exists at the same path on both sides. For Suggested possible fixes
var beforePaths, afterPaths []string
if materializeModified {
beforePaths = slices.Clone(modified)
afterPaths = slices.Clone(modified)
}
if detectRenames {
beforePaths = append(beforePaths, delta.removedFiles...)
afterPaths = append(afterPaths, delta.addedFiles...)
}This would make
|
…it diffs Changeset.computePaths, diffStats, and isEmpty ran `git diff --no-index` over both fully mounted trees, reading every byte of before and after even for a one-file change. On large directories this floods the engine cgroup with gigabytes of page cache and dirty pages per query, showing up as an engine memory spike that can leave the host unresponsive. Compute the delta with a stat-based double walk instead (fsdiff): files backed by the same inode are unchanged, metadata-suspect files are verified by content comparison, and the new CompareInodeThenContent mode closes the same-size/same-mtime stat collision hole. git still provides rename pairing and numstat, but scoped to materialized copies of only the changed files, making the whole path O(changed files) instead of O(tree). Falls back to the full-tree git diff on any error. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Marcos Nils <[email protected]>
Rename detection only needs the added/removed candidates, so stage modified files only when numstat needs their content. Give IsEmpty a dedicated delta path that never stages files or invokes git: added or removed files prove non-emptiness, and modified candidates verify with an early exit. Signed-off-by: Marcos Nils <[email protected]>
e0a591c to
274c658
Compare
Since #13615 the metadata delta path sorts added/removed/modified paths while the git-based fallback does not, so the order a caller observes silently depends on which implementation ran for a given mount. The fallback's rename expansion also collects paths from map iteration, so its order was never fully deterministic to begin with. Sort the fallback's outputs exactly like the delta path and update the one exact-order expectation in the integration suite; every other path assertion already uses ElementsMatch/Contains. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
#13615) Signed-off-by: Marcos Nils <[email protected]>
Since #13615 the metadata delta path sorts added/removed/modified paths while the git-based fallback does not, so the order a caller observes silently depends on which implementation ran for a given mount. The fallback's rename expansion also collects paths from map iteration, so its order was never fully deterministic to begin with. Sort the fallback's outputs exactly like the delta path and update the one exact-order expectation in the integration suite; every other path assertion already uses ElementsMatch/Contains. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
#13615) Signed-off-by: Marcos Nils <[email protected]>
Since dagger#13615 the metadata delta path sorts added/removed/modified paths while the git-based fallback does not, so the order a caller observes silently depends on which implementation ran for a given mount. The fallback's rename expansion also collects paths from map iteration, so its order was never fully deterministic to begin with. Sort the fallback's outputs exactly like the delta path and update the one exact-order expectation in the integration suite; every other path assertion already uses ElementsMatch/Contains. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]> (cherry picked from commit 8de657a)
Since #13615 the metadata delta path sorts added/removed/modified paths while the git-based fallback does not, so the order a caller observes silently depends on which implementation ran for a given mount. The fallback's rename expansion also collects paths from map iteration, so its order was never fully deterministic to begin with. Sort the fallback's outputs exactly like the delta path and update the one exact-order expectation in the integration suite; every other path assertion already uses ElementsMatch/Contains. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]> (cherry picked from commit 8de657a)
dagger 0.21.8 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## v0.21.8 - 2026-07-29 ### Changed - Changeset diffs are now computed from filesystem metadata instead of full-content comparison, significantly speeding up diff computation for large directories. by @marcosnils in dagger/dagger#13615 ### Fixed - Dockerfile build layer caching so unrelated build-context changes no longer bust the cache: `COPY`-ed directories now get a content-based cache identity, re-keying downstream steps only when copied content actually changes. by @marcosnils in dagger/dagger#13765 - The `--x-release` CLI re-exec so `_EXPERIMENTAL_DAGGER_RUNNER_HOST` is preserved (with a warning) instead of being stripped, and clarified its startup message to avoid implying it runs from any build. by @tiborvass in dagger/dagger#13752 - Silent SDK sessions no longer retain frontend telemetry in memory while Cloud and OTLP export remain enabled. `DAGGER_SILENT` is now honored as the equivalent of `--silent`. by @sipsma in dagger/dagger#13762 ### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </pre> <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.8">https://github.com/dagger/dagger/releases/tag/v0.21.8</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!15378
…it diffs
Changeset.computePaths, diffStats, and isEmpty ran
git diff --no-indexover both fully mounted trees, reading every byte of before and after even for a one-file change. On large directories this floods the engine cgroup with gigabytes of page cache and dirty pages per query, showing up as an engine memory spike that can leave the host unresponsive.Compute the delta with a stat-based double walk instead (fsdiff): files backed by the same inode are unchanged, metadata-suspect files are verified by content comparison, and the new CompareInodeThenContent mode closes the same-size/same-mtime stat collision hole. git still provides rename pairing and numstat, but scoped to materialized copies of only the changed files, making the whole path O(changed files) instead of O(tree). Falls back to the full-tree git diff on any error.