Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache verification in the LSP server #2331

Open
keyboardDrummer opened this issue Jun 30, 2022 · 1 comment
Open

Cache verification in the LSP server #2331

keyboardDrummer opened this issue Jun 30, 2022 · 1 comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) status: needs-approval Issue that needs approval from Dafny team members before moving to designed status: needs-expert Needs review by an expert on this part of the code

Comments

@keyboardDrummer
Copy link
Member

keyboardDrummer commented Jun 30, 2022

Boogie has an advanced caching mechanism that can prevent verification tasks that haven't changed from being verified again, but can also makes verification tasks easier to compute if only part of them has been previously changed.

These are known bugs in Boogie's caching mechanism:

There are also two architectural concerns:

  • Boogie's caching mechanism depends on checksums computed by Dafny, so there can be a difference between how Boogie computes the checksum and how it translates to Boogie. Ideally Boogie would compute these checksums so there's no chance of an error by the client. The reason it works like it currently does may be that the Dafny to Boogie translation used to unstable in the sense that it depended on source code location and on global counters, a problem which has now been resolved.
  • The dependency computation in Boogie may compute too many dependencies due to function references in axioms being bidirectional, leading to caching that is not granular.

Change

  • Test verification caching at the Dafny LSP server level. We should have tests for
    • Caching of an unchanged method, when an unrelated method has been added above it.
    • Caching behaviour of an unchanged method, where one of its dependencies has changed.
    • Caching of an unchanged method, where a dependent of that method's dependency has changed.
    • Caching of assertions that occur before other assertions in a statement block.
    • Caching of verification of branches such as if-then-else or match statement.
    • Caching over different types of verifiables, such as constants, datatype constructors with default values, subset types and iterators.
    • ... Try to come up with more :-)
  • Record limitations in the granularity of Boogie's caching
  • Resolve bugs in Dafny's and Boogie's verification caching

Not in scope

  • Parse or resolution caching
  • Computation of verification priority

Prerequisites

None

Enables

Implementation hints

Boogie caching mechanism is described in these two papers:

@keyboardDrummer keyboardDrummer added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) status: needs-expert Needs review by an expert on this part of the code status: needs-approval Issue that needs approval from Dafny team members before moving to designed labels Jun 30, 2022
@keyboardDrummer keyboardDrummer added this to the Project aware IDE milestone Jun 30, 2022
@keyboardDrummer keyboardDrummer changed the title Cache verification in the LSP server Add tests for verification caching in the LSP server Jul 4, 2022
@keyboardDrummer keyboardDrummer changed the title Add tests for verification caching in the LSP server Cache verification in the LSP server Jul 4, 2022
@cpitclaudel
Copy link
Member

As far as we're aware there are no issues with this caching mechanism, but we don't have LSP server tests that exercise the caching mechanism.

Unfortunately, we actually have identified a number of cases where the caching mechanism disagrees with the command line; see #1878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) status: needs-approval Issue that needs approval from Dafny team members before moving to designed status: needs-expert Needs review by an expert on this part of the code
Projects
None yet
Development

No branches or pull requests

2 participants