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

Significant proof checking refactoring #46

Merged
merged 33 commits into from
Nov 6, 2024
Merged

Conversation

K-dizzled
Copy link
Collaborator

The version increment is minor, yet the changes are significant. The main focus of this release was to improve interaction with the coq-lsp server. We now completely got rid of temporary files in the extension part of CoqPilot. This was done thanks to ejgallego and his improvements in coq-lsp. Now checking of proofs is done via the proof/goals request via command parameter, which is much more reliable and faster. Now a single lsp server is created for the plugin until being explicitly closed, and it tracks changes in the file. If you are using coq-lsp plugin itself, it will help you to always keep track of whether file is checked or not. When CoqPilot is ran on a completely checked file, it will not bring any significant overhead apart from requests to the Completion Services.

K-dizzled and others added 26 commits July 29, 2024 16:05
Refactored CoqLspClient and CoqProofChecker to use getGoals pretac to
check proofs instead of manually modifying the file.

ToDo: Get rid of temporary files at all, request completion only on the
current document. At least in the plugin iteslf (not in benchmarks)
Reference issue: JBRes-1857
Now it doesn't have a responsibility to manage opening/closing files,
the outer class calling it should be responsible for it. As we have
different scenarios of communication with LSP from Plugin/Becnhmark,
this is still in development. Get rid of Aux files.
Now it depends on the particular chosen Ranker. It is computed iff. ranker requires unwrapped notations.
…bort

Sketch aborting the completion generation through `AbortSignal`
@K-dizzled K-dizzled changed the base branch from main to v2.3.1-dev October 27, 2024 23:54
@K-dizzled K-dizzled changed the title Significant proof checking refoctoring Significant proof checking refactoring Oct 27, 2024
Copy link
Collaborator

@GlebSolovev GlebSolovev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, great work with nice decisions on code structuring!

Also, the whole love of all Coq-s 🐥, Pilot-s 🧑‍✈️ and especially me 🐲 for you, Andrei, for writing the tests for the new coq-lsp implementation ❤️

I left some comments on improving the code and making it a bit clearer, but in general everything is super solid and shiny 🌟

args.preparedProofs
);

await coqLspClient.closeTextDocument(fileUri);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure we are on the same page: am I right that in the correct implementation this closeTextDocument should be called in the finally case, while checkProofs should be wrapped into try one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understood the question( Well, in general, I guess the answer to your question is yes. The promised returned by method checkProofs could be rejected, yet, other errors shall not be thrown.

closeDocument ideally should happen in some wrapper over the coqProofChecker. Btw, would be neat to do smth like:

withOpenAuxFile: 
    ...

const sourceFileUri = Uri.fromPath(filePath);
await coqLspClient.openTextDocument(sourceFileUri);
const abortController = new AbortController();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another note on modifying the benchmarks, not the best way: new abortController shouldn't be created here, there is already one present at the top of the system, it just needed to be passed here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do that but gave up on executeOnParentProcessCall as I didn't undertand the dependencies going on in the code. I left an TODO for you to do that 👉👈

src/test/coqLsp/coqLspCommandInGoalsReq.test.ts Outdated Show resolved Hide resolved
src/test/coqLsp/coqLspCommandInGoalsReq.test.ts Outdated Show resolved Hide resolved
src/test/coqLsp/coqLspCommandInGoalsReq.test.ts Outdated Show resolved Hide resolved
src/test/coqLsp/coqLspCommandInGoalsReq.test.ts Outdated Show resolved Hide resolved
src/test/core/completionGenerator.test.ts Show resolved Hide resolved
@K-dizzled K-dizzled merged commit 75c46d3 into v2.4.0-dev Nov 6, 2024
3 checks passed
@K-dizzled K-dizzled deleted the core-lsp-rework branch November 6, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants