Repository navigation
Fix incremental compiler registration and cache wall-clock performance - #13
Merged
dannote merged 4 commits intoAug 11, 2026
Merged
Conversation
Replace the costly fragment cache with source digests and cached clone results shared by the compiler and opt-in CLI analysis. Changed sources use normal full detection, while unchanged runs return the previous result without detection or cache rewrites. Verified with mix ci and PtcRunner's 578-file duplication scope.
andreasronge
force-pushed
the
agent/fix-incremental-compiler
branch
from
August 8, 2026 08:41
d7ef431 to
137bc5a
Compare
andreasronge
marked this pull request as ready for review
August 8, 2026 15:32
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.
Summary
compile.ex_dnaMix compiler task:noopwith cached diagnostics when compiler inputs are unchangedmix ex_dna --cacheso JSON/SARIF/HTML/console gates can use the same fast path with explicit paths--force-ex_dnaRoot cause
The compiler implementation lived at
ExDNA.Compiler, so Mix could not resolve the documented:ex_dnacompiler name toMix.Tasks.Compile.ExDna.After invoking the implementation directly, the old cache saved parsing but still deserialized and rewrote a large compressed AST/fragment term and reran global detection every time. On a real 578-file downstream gate, the cache grew to 49MB and made cold or changed runs slower than normal analysis.
This change treats the actual clone result as the reusable build artifact. Source digests make an unchanged result safe to reuse without depending on filesystem timestamp resolution. If anything changes, ExDNA runs its existing normal detector and replaces the small result cache.
Measured impact
PtcRunner's
lib/+test/duplication scope (578 files, 79 clone groups), macOS, Elixir 1.20.2, OTP 29:The resulting cache is 87KB. Clone counts and JSON clone groups match the uncached report.
For comparison, v1.5.4's standalone analysis was 12.8–15.7s, while its warm compiler path remained 10.4–10.7s on the smaller default
lib/scope.Validation
mix cimix help compile.ex_dnaCloses #12
Follow-up
A second, dependent performance PR is prepared on
agent/sharded-fragment-cache. It adds a compact, generation-bound fingerprint index so exact clone-neutral edits can skip full-project analysis, extending this PR beyond the unchanged warm-cache case. The isolated two-commit delta is available in the fork comparison.The follow-up is intentionally not opened against upstream
masteryet: doing so before this PR lands would duplicate this PR in its diff. It will be rebased and opened separately after this change is accepted. Its pinned candidate has already passed PtcRunner’s cold and warm ExDNA compatibility job in merged PtcRunner PR #1195.The same pinned candidate compatibility job subsequently passed on PtcRunner PR #1196 and PtcRunner PR #1192.