feat(wdl-analysis)!: incremental analysis - #1101
Open
Serial-ATA wants to merge 24 commits into
Open
Conversation
Serial-ATA
force-pushed
the
incremental-analysis
branch
from
August 10, 2026 17:23
2f7be45 to
ae068c5
Compare
Serial-ATA
force-pushed
the
incremental-analysis
branch
9 times, most recently
from
August 13, 2026 17:45
3125f05 to
57c38c9
Compare
Serial-ATA
marked this pull request as ready for review
August 13, 2026 17:58
Serial-ATA
requested review from
adthrasher and
claymcleod
and removed request for
adthrasher
August 13, 2026 17:58
Serial-ATA
force-pushed
the
incremental-analysis
branch
3 times, most recently
from
August 21, 2026 16:27
27fae76 to
a7c471b
Compare
Previously, any analysis request on a document would:
1. Start from scratch
2. Unconditionally invalidate all dependents
That made working with the LSP in large workspaces heavier than necessary.
This adds a new per-document `AnalysisCache` that gets populated with all items and a graph of their dependencies on the first pass, then incrementally edited on any later analysis requests.
The cache works off two layers of hashes: `SignatureHash` (name+inputs+outputs) and `BodyHash` (any body statements)
In the local document, a difference in either hash will mark the item as dirty. For imports, only `SignatureHash` differences are significant.
For example:
```wdl
# greet.wdl
version 1.3
task say_hello {
input {
String name
}
command <<<
echo "Hello, ~{name}!"
>>>
output {
String greeting = read_string(stdout())
}
}
# main.wdl
version 1.3
import "greet.wdl"
# `do_say_hello` depends on the "greet.wdl" import
workflow do_say_hello {
call greet.say_hello { name = "John" }
}
```
Changing the signature of `greet.say_hello` would invalidate:
* `greet.say_hello`
* The `"greet.wdl"` import
* `main.do_say_hello`
However, changing the _body_ of `greet.say_hello` will only ever invalidate `greet.say_hello`.
Serial-ATA
force-pushed
the
incremental-analysis
branch
from
August 21, 2026 16:36
a7c471b to
427b36e
Compare
claymcleod
requested changes
Aug 21, 2026
claymcleod
left a comment
Member
There was a problem hiding this comment.
The thing I would most like to see added is a test that analyses a fixture cold, applies an edit sequence, and then asserts the result matches a fresh analysis of the same final text, because every defect I have commented on would have been caught by one and without it the design stays one unhashed field away from silent staleness. This also needs a rebase before it can land, since main has rewritten except_directive_valid.rs in the meantime.
# Conflicts: # crates/wdl-analysis/CHANGELOG.md # crates/wdl-analysis/src/validation.rs # crates/wdl-analysis/src/validation/known_rules.rs # crates/wdl-lint/src/rules/except_directive_valid.rs
# Conflicts: # crates/wdl-analysis/src/document.rs # crates/wdl-analysis/src/document/v1.rs # crates/wdl-engine/src/eval/v1/task.rs
Serial-ATA
force-pushed
the
incremental-analysis
branch
from
August 31, 2026 15:42
ef33052 to
be7870b
Compare
# Conflicts: # crates/wdl-analysis/src/document.rs # crates/wdl-analysis/src/document/v1.rs # crates/wdl-analysis/src/handlers/goto_definition.rs # crates/wdl-analysis/src/handlers/hover.rs
Since `{Struct,Enum}Ref` carry a clone of their definitions, but not the rest of the document, the LSP doc providers were returning nothing for their doc comments
No longer sharing the `analysis_diagnostics` from the document
Serial-ATA
force-pushed
the
incremental-analysis
branch
from
September 1, 2026 16:07
1d2b06e to
e82d3b6
Compare
# Conflicts: # crates/wdl-analysis/CHANGELOG.md # crates/wdl-analysis/src/document.rs
# Conflicts: # crates/wdl-analysis/src/graph.rs # crates/wdl-lsp/tests/requests/code_lens.rs
peterhuene
self-requested a review
September 10, 2026 01:18
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.
Previously, any analysis request on a document would:
That made working with the LSP in large workspaces heavier than necessary.
This adds a new per-document
AnalysisCachethat gets populated with all items and a graph of their dependencies on the first pass, then incrementally edited on any later analysis requests.The cache works off two layers of hashes:
SignatureHash(name+inputs+outputs) andBodyHash(any body statements)In the local document, a difference in either hash will mark the item as dirty. For imports, only
SignatureHashdifferences are significant.For example:
Changing the signature of
greet.say_hellowould invalidate:greet.say_hello"greet.wdl"importmain.do_say_helloHowever, changing the body of
greet.say_hellowill only ever invalidategreet.say_hello.Note that this is only incremental analysis. Each analysis request will still do a full validation pass.
Before submitting this PR, please make sure:
For external contributors:
For all contributors:
nextbranch in the sprocket.bio repository (when appropriate).For PRs containing lint rule changes:
RULES.md.crates/wdl-lint/tests/lintsthat covers everypossible diagnostic emitted for the rule within the file where the rule
is implemented.