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

"printer interrupted" in goal window #806

Open
Alizter opened this issue Jul 14, 2024 · 5 comments
Open

"printer interrupted" in goal window #806

Alizter opened this issue Jul 14, 2024 · 5 comments
Labels
kind: bug Something isn't working

Comments

@Alizter
Copy link
Collaborator

Alizter commented Jul 14, 2024

When working on heavy terms such as those found in Coq-HoTT's theories/Algebra/AbGroups/TensorProduct.v the coq-lsp printer gets interrupted a lot leading to such scenes:

image

Not sure what is better to do here.

@Alizter Alizter added the kind: bug Something isn't working label Jul 14, 2024
@ejgallego
Copy link
Owner

I guess the current workaround is just to wait for the printer to finish printing. The printer will be only interrupted if the client does a new request.

Possible strategies to mitigate this could be:

  • make Coq printing less expensive
  • using OCaml 5.3 we could finally put printing in its own domain, so no more interrupting needed!
  • we could disable interruptions for printing, however that means that coq-lsp can get stuck with a large term and users won't be able to interrupt it

@ejgallego
Copy link
Owner

make Coq printing less expensive

We don't track stats for printing precisely yet, do you know how long do these terms take to print?

Likely it is worth submitting a kind: performance bug to Coq itself, I think there are many super-linear behaviors on Coq printing as of today that could be affecting you.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 14, 2024

We don't track stats for printing precisely yet, do you know how long do these terms take to print?

They can vary wildly. Some of the terms in the file I mentioned have terms that take 16GB of ram to print and can take 10 minutes or so. I am currently trying to improve performance in this file, but I don't have a lot of understanding why Coq is taking so long. The terms mostly consist of projections of chunky terms. If I manually unfold then I can get an efficient print, but Coq's simpl or cbn gets stuck trying to unfold useless stuff.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 14, 2024

By the way the files in question are currently in this PR: HoTT/Coq-HoTT#2021

@ejgallego
Copy link
Owner

We don't track stats for printing precisely yet, do you know how long do these terms take to print?

They can vary wildly. Some of the terms in the file I mentioned have terms that take 16GB of ram to print and can take 10 minutes or so. I am currently trying to improve performance in this file, but I don't have a lot of understanding why Coq is taking so long.

Likely many super-linear (like O(n^3) or even worse) factors in printing. Just with the info you posted you can open an upstream bug and hope Coq devs have a look into it (I think they will).

This has been a problem for a long time and you can find bugs about slow printing in the bug tracker (and people complaining when we made printing non-interruptible due to this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants