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
Files are needlessly rechecked #4959
Comments
Oh, interesting. After poking around a little, I think that the following happens:
I think that I get why Agda won't load interface files in top-level interaction mode. As I understand it, interface files only contain a subset of the information gathered during the type-check. In particular, they lack information required by the top-level interaction mode. But why doesn't Agda save interface files in top-level interaction mode? To speed up the type-check by skipping serialization and compression? In any case, it seems that the |
After reading the comments on PR #4652 it seems that the |
To address this issue, could The following test with current tlo@carol:~/agda/mine/test/interaction$ git diff
diff --git a/src/full/Agda/Interaction/Imports.hs b/src/full/Agda/Interaction/Imports.hs
index 9170b8851..324fb0737 100644
--- a/src/full/Agda/Interaction/Imports.hs
+++ b/src/full/Agda/Interaction/Imports.hs
@@ -1056,6 +1056,8 @@ createInterface file mname isMain msi =
return i
(_, MainInterface (TypeCheck TopLevelInteraction)) -> do
reportSLn "import.iface.create" 7 "We are in top-level interaction mode and want to retain private declarations, skipping writing interface file."
+ ifile <- toIFile file
+ _ <- writeInterface ifile i
return i
_ -> Bench.billTo [Bench.Serialization] $ do
reportSLn "import.iface.create" 7 "Actually calling writeInterface."
tlo@carol:~/agda/mine/test/interaction$ stack runghc Issue4959.hs agda
(agda2-status-action "")
(agda2-info-action "*Type-checking*" "" nil)
(agda2-highlight-clear)
(agda2-info-action "*Type-checking*" "Checking Issue4959-2 (/home/tlo/agda/mine/test/interaction/Issue4959-2.agda).\n" t)
(agda2-status-action "Checked")
(agda2-info-action "*All Done*" "" nil)
((last . 1) . (agda2-goals-action '()))
(agda2-status-action "")
(agda2-info-action "*Type-checking*" "" nil)
(agda2-highlight-clear)
(agda2-info-action "*Type-checking*" "Checking Issue4959-2 (/home/tlo/agda/mine/test/interaction/Issue4959-2.agda).\n" t)
(agda2-status-action "Checked")
(agda2-info-action "*All Done*" "" nil)
((last . 1) . (agda2-goals-action '()))
(agda2-status-action "")
(agda2-info-action "*Type-checking*" "" nil)
(agda2-highlight-clear)
(agda2-info-action "*Type-checking*" "Checking Issue4959 (/home/tlo/agda/mine/test/interaction/Issue4959.agda).\n" t)
(agda2-status-action "Checked")
(agda2-info-action "*All Done*" "" nil)
((last . 1) . (agda2-goals-action '()))
tlo@carol:~/agda/mine/test/interaction$ |
If work on this issue has stalled, then I suggest that we undo the fix of #4647. |
👍 on undoing the fix |
I spent some time this week on this issue, let's see if I can carve out more time. |
This commit unfixes #4647 by removing the `InteractionMode` (`TopLevelInteraction`/`RegularInteraction`) and the option to switch off the logic (which didn't fully work). For #4647 there is a simple workaround: add a hole to the file so that the interface is not serialize and thus the private definitions are not removed.
This commit unfixes #4647 by removing the `InteractionMode` (`TopLevelInteraction`/`RegularInteraction`) and the option to switch off the logic (which didn't fully work). For #4647 there is a simple workaround: add a hole to the file so that the interface is not serialize and thus the private definitions are not removed.
This commit unfixes #4647 by removing the `InteractionMode` (`TopLevelInteraction`/`RegularInteraction`) and the option to switch off the logic (which didn't fully work). For #4647 there is a simple workaround: add a hole to the file so that the interface is not serialize and thus the private definitions are not removed.
This commit unfixes #4647 by removing the `InteractionMode` (`TopLevelInteraction`/`RegularInteraction`) and the option to switch off the logic (which didn't fully work). For #4647 there is a simple workaround: add a hole to the file so that the interface is not serialize and thus the private definitions are not removed.
This commit unfixes #4647 by removing the `InteractionMode` (`TopLevelInteraction`/`RegularInteraction`) and the option to switch off the logic (which didn't fully work). For #4647 there is a simple workaround: add a hole to the file so that the interface is not serialize and thus the private definitions are not removed.
Sometimes when I've checked a file in Emacs and load another file, then the first file is checked again. This is a major performance regression. Today I managed to create a small test case:
Note that Agda 2.6.2-7d26757 typechecks
A.agda
, even though this file has already been typechecked.Bisection points towards 549f939 ("[ fixed #4647 ] top-level interaction: access to private decls."). The problem is still there if
--top-level-interaction-no-private
is used. @andreasabel, can you take a look at this?The text was updated successfully, but these errors were encountered: