-
Notifications
You must be signed in to change notification settings - Fork 88
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
experiment for #188 and #429 -- insert show after error in silent mode #467
base: master
Are you sure you want to change the base?
Conversation
See #468 for measuring the difference between silent and non-silent processing. |
@Matafou @cpitclaudel Do you have an opinion here? Shall we make delayed response/goal processing more complicated or simply switch to non-silent? |
I will have a look very soon. Thanks for working on this. |
Thanks Hendriks! My experiments on the silent stuff date back to more than a decade, maybe two. It was mostly dependent on the size of goals (times the number of tactics processed). Do your tests use big goals (say one page long)? The fact that coq was displaying the goal after each tactic was a serious bottleneck when goals were big. But again this was in the 2000's I think, so maybe this is negligible now. Other protocols have all switched to silent mode: never show goals unless a "Show" is issued by the ide. It seems the most reasonable to me. |
Concretely, what does silent processing do now that goal printing isn't automatic anymore? |
@Matafou: Maybe my goals are not so long. In one of the tested files I see about 1400 goals printed, maximum size 88 lines, average 41, and about 700 goals more than 41 lines. Do you have a big file with longer goals? @cpitclaudel: I am not sure I understand your question. Silent processing issues |
I thought recent Coq versions printed a lot less when processing, but it seems I was wrong about this. |
@cpitclaudel what you guessed is not true currently, but I think we wan tto switch to it (unless async comes to maturity meanwhile).
... without triggering your Show again. I remember having a hard time with this one. This is where pg generic mechanism makes things a bit difficult.
...and we are inside a proof. |
The approach of this PR is to submit a Show command after the error to update the goals buffer while keeping the error message somehow visible. A completely different approach would be to remember the last successful command and, in case of an error, retract to before that command and execute the last successful and the failing command again (of course not silent). I have the impression that this alternative approach would be simpler. Or do I oversee something? |
If the last successful command takes long this may feel frustrating. |
Maybe, but note that this does not happen during interactive development, because there you are asserting single commands and do not switch to silent. Do you have a lot of long running commands? And what does long mean? |
It is quite common to have a single command taking several seconds.
P.
Le lun. 13 avr. 2020 à 14:39, hendriktews <[email protected]> a
écrit :
… If the last successful command takes long this may feel frustrating.
Maybe, but note that this does not happen during interactive development,
because there you are asserting single commands and do not switch to
silent. Do you have a lot of long running commands? And what does long mean?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#467 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFSL2QSX4ICBVLPRSKTDYDRMMBXFANCNFSM4LGJJVRA>
.
|
Actually it is generally more frequent during proof development, while e.g. type classes have not yet been fine tuned for your purpose. |
@Matafou : I would like to repeat to ensure I understand: When fine tuning type classes, you assert bigger chunks (so Coq is switch to silent), in these chunks one command is likely to fail and the command before the failing one takes several seconds to process. Right? |
Yes. Actually even after fine tuning type classes some single commands still take a long time to process. |
Maybe the simplest is to store the error message and re-insert it afterward?
Maybe this is not so important: issuing a superfluous Show is probably not a problem? |
@hendriktews I am playing with your version and it seems to work quite well.
At first glance this seems to work already, doesn't it?
This is not so important: making one spurious Show is OK imho if it does not reset the response buffer. Actually it is the occasion to add a few other missing "Show": Currently when pg has a bunch of commands to process it Set Silent, plays all commands except the last one, then unset silent, then plays the last command. |
Hi,
From the discussion in the PR I conclude that my suggestions for
running non-silent or to backtrack on error do not get much
support. If you prefer the approach of this PR, this is also fine
with me.
Pierre Courtieu <[email protected]> writes:
@hendriktews I am playing with your version and it seems to work quite well.
OK, I deleted the "do not merge" in the PR title.
* keep the error message visible and only update the goals buffer in the background
At first glance this seems to work already, doesn't it?
* only insert this show command when the error is hit in silent mode or when the previous
command was just unset silent.
This is not so important: making one spurious Show is OK imho if it does not reset the response
buffer.
Then let's postpone these points.
If you want to build on the changes here, then please merge or
add other commits to this PR. With proof-add-to-priority-queue
you can add stuff to the front of proof-action-list. In cases
where proof-action-list is cleared (eg., because of an error) you
can also use proof-add-to-priority-queue to generally add stuff
to proof-action-list. What we currently don't have, is a function
that permits to add stuff at the end of proof-action-list when
you are inside the process filter. proof-add-to-queue does this,
but I believe it does not work at certain points inside the
process filter.
Instead of participating here, I would devote my time on
polishing the prooftree support.
Hendrik
|
OK I will try to make something from your PR. I never did this before, do I just push directly on your branch? |
Yes, you can just add hendrik's repo as another remote:
and checkout/push as usually:
(given GitHub knows this branch from hendrik is a "PR source branch", you will automatically have write rights for this remote branch) |
OK thanks. Line 1138 in ea62543
So maybe we should adapt this part instead. Still studying things. |
proof-state-change-pre-hook happens earlier than proof-state-change-hook, i.e. before proof-done-advancing. This should be used to register information in the currently processed span before proof-done-advancing classifies it. Historically PG design was to gather these information during proof-done-advancing (or in its hook called at the end) by just looking at the command statement. But it is often useful to look at the output (messages and/or prompt) to gather more accurate information. Some of this information may be needed DURING proof-done-advancing. Hence this early hook.
new, generic interface for priority action items, see proof-priority-action-list and proof-add-to-priority-queue, for asynchronously adding commands to the head of proof-action-list
This should work correctly now.
|
Or wait for our switch to "always silent, always ask for Show", where we will always send a Show after a command in proof mode. |
by the way @erikmd @CyrilAnac my previous force-push had a spurious debug message left in the code and it made the CI test fail apparently, which is fine, but when going to the log page (https://github.com/ProofGeneral/PG/runs/714045321?check_suite_focus=true) I had a serious bug in my browser due (I guess) to a very long log. This made the diagnostic a bit painful. Do you think this fixable? |
I can't see the log either (I only see
|
I forced pushed a commit and it solved the problem, if I have time I will try to understand why the test took so long. It cannot be just because of the message (one word), can it? |
maybe the issue was some kind of infinite loop (which would explain the 6h+ build time?) adding zillions of copies of the word at stake? but I didn't have a look on the code you mention so I don't know exactly |
In any case, if you note somewhere the SHA1 of the commit at stake, we'll be able to try reproducing the issue with the |
I will. But I think I know the problem. There was indeed a loop in some cases in Hendrik's first try, and my force push did not fix it yet. |
Most of these tests currently fail because of different instances of ProofGeneral#568, see also ProofGeneral#429, ProofGeneral#467.
Most of these tests currently fail because of different instances of ProofGeneral#568, see also ProofGeneral#429, ProofGeneral#467, ProofGeneral#103.
Most of these tests currently fail because of different instances of ProofGeneral#568, see also ProofGeneral#429, ProofGeneral#467, ProofGeneral#103.
Most of these tests currently fail because of different instances of ProofGeneral#568, see also ProofGeneral#429, ProofGeneral#467, ProofGeneral#103.
This is my first partial take on issue #188 and Pierre's example in PR #429
This PR reliably inserts a show command after an error. The following points still need to be solved:
This can be done, but would require some new features and additional state in delayed goals/response processing (proof-shell-handle-delayed-output). However, I would question if this makes sense, because I don't see an advantage when running silent. For my biggest files, which take about 11 seconds to process interactively (≈3000 lines), the speedup of silent processing is less then 5%, just a fraction of a second.