perf: dep_graph: stop collecting edges in the green marking walk [-1.70% incr-unchanged] - #58
Draft
xmakro wants to merge 1 commit into
Draft
Conversation
xmakro
marked this pull request as draft
July 28, 2026 11:01
xmakro
force-pushed
the
perf/dep-graph-skip-edge-collection
branch
from
August 5, 2026 07:06
2cf8195 to
06d36cd
Compare
xmakro
changed the base branch from
perf/dep-graph-append-only
to
perf/carry-unchanged-nodes
August 5, 2026 07:07
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Based on the parent branch
perf/carry-unchanged-nodes, where dep-graph indices hold still across sessions and an unchanged node's record is re-emitted from the previous file.Marking a node green walks its previous dependencies and, on the way, copies each dependency's current index into a scratch buffer. That buffer exists for one reason: to hand the encoder an edge list for the node it is about to write.
The encoder no longer reads it. A promoted record comes out of the previous file as it stands, edges included. The one remaining reader is the debugging graph behind
-Zquery-dep-graph, and it can take the edges off the previous graph instead: every target of a promoted node is green, and a green node keeps its previous index, so the current edge list is the previous one unchanged.So the walk stops collecting. This removes a store per edge from the hottest incremental path, along with the per-node edge frame and its drop, the per-worker buffer behind it, and the edge list threaded through promotion.
Local A/B against the parent branch, six primary crates,
instructions:u, jemalloc preloaded, both sides built from an identicalbootstrap.toml:43 of 81 cells improved by at least 0.25%, 0 regressed. Best cells: cargo debug incr-unchanged -2.22%, syn debug incr-unchanged -1.97%, regex-automata debug incr-unchanged -1.91%.
Validation, with debug assertions and overflow checks armed:
tests/incremental178 passed and 0 failed, of which the 93 tests that pass-Zquery-dep-graphexercise the reconstructed edge lists. Sixteen generations of churn and deletion stress in each of four modes (default,-Zincremental-verify-ich,-Zthreads=8, and both together) came back clean, including the warning-replay oracle, and a multi-generation-Zquery-dep-graphbuild is clean as well.