-
Notifications
You must be signed in to change notification settings - Fork 364
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
Separate flags for "compatible with univalence" and "compatible with Cubical Agda" #6049
Comments
I think |
Is the idea that inductive families would not be allowed unless this flag is used, or would the flag only affect the extra clauses? In the former case the flag should presumably also be required to use inductive families when |
Without the flag, we'd skip:
That is: without the flag, we have 2.6.2.2's status quo when it comes to indexed families in |
Something to keep in mind: #5448 |
Nisse 2022-08-31: The flag should be coinfective and turned on in the builtin modules. |
Here's a summary of our discussion on this topic on 2022-08-31 (@jespercockx @andreasabel @nad @UlfNorell) to make sure we're all on the same page (and to get user feedback, of course). First, background:
Side note: I'm calling the generated bits of code "cubical stuff" for short since the actual details of what needs to be generated are not relevant and are basically internal implementation details.
Originally we had a proposal (#5843) to stratify the flags like so:
These flags got conflated because of the fix for #5448: When cubical clauses aren't generated, Agda accidentally allows you to generate code that is invalid wrt erasure. To be explicit, in
the semantics of
Proposal: Let's split
Modules that are An immediate effect is that this re-breaks #5448, which will require a fix independent of cubical stuff. |
To clarify, is the intent that:
From this user's perspective, splitting Given this proposal, under what circumstances should I choose to use On the other side, if I'm using cubical agda and I want to import someone else's library who wrote it using I kind of feel like the ideal setup would be for Agda to check whenever importing a file from a |
You can add the |
There are a fair number of subtleties around elaboration of modules that could be loaded from Cubical Agda, particularly around indexed inductives — but, yes, also internal implementation details, as you mention. In the development version of Cubical Agda, indexed inductive types have "formal transport along indices" as an additional constructor†, in exactly the same way that higher inductive types have "formal homogeneous compositions". Correspondingly, pattern-matching definitions need to handle these extra clauses. The part about HITs and their extra clauses is already true in the released version, for what it's worth, but it's not observable by non- We can imagine making switches for all of the following:
Conflation of (1) and (2) leads to a couple infelicities:
Now, speaking hypothetically, there is another very good reason to separate (1) and (2): Issue #3750. If we, in the future, implement a variant of Cubical Agda that is either agnostic towards or enforces K (this could be as simple as "cubical agda, but don't let people use Treating (1) and (2) as one and the same means that, in this hypothetical future, users can't choose for their modules to be "agnostic towards implementation of K": Either you disable K (meaning your module would be loadable from Yet another hypothetical future change to Agda (which, to be clear, is even less likely to happen than † It's not a literal constructor but if you're knowledgeable enough about the implementation to tell the difference, please suspend your disbelief 🙂 |
I see and agree with the arguments for a |
I suggested the same, using different build trees for build with or without cubical stuff, to avoid overwriting previous build efforts when you switch between main files that do |
I currently use I think the main problem with the current setup is that generated code (related to Cubical Agda) can leak into error messages (even for people who do not use Cubical Agda). If we could implement a fix for issue #5448 that produced readable error messages, then I don't think there would be a strong need for @plt-amy, your latest proposal does not mention |
Would it be possible to do both? Include |
The option |
Theoretically, we'd also need a flag |
You can use |
Thanks. Is that the only place "most" options are documented? |
All options are documented at https://agda.readthedocs.io/en/v2.6.2.2/tools/command-line-options.html |
Except for some that aren't, like the extra flags that can be passed to |
Perhaps |
I agree, except that when I first introduced the flag some people complained VERY LOUDLY about even just having a light grey background for the offending clauses. |
No, some are missing, including at least
Regarding "most": One option is missing, |
@mikeshulman wrote:
Agda does not have conscious knowledge of the verbosity hierarchy. You can pass in anything with |
What is still open here seems to be @nad's planned changelog on performance: |
@nad wrote:
Nisse, are you still intending this? Otherwise, we can close this issue. |
I plan to do this just before the next release candidate, or just before the release. |
@nad If you still want to get this into the release I suggest you do it soon. |
Changes to the code can affect Agda's performance. I plan to do this once all such changes have landed. |
Now I got the following numbers:
|
The speedup in 2.6.3 is nice, but it's rather encouraging me to stick with |
That would mean that one cannot import the code from Cubical Agda. Could you use |
Here are some more statistics on time efficiency using In a 2020 MacBook Air M1:
In a 2017 Dell Latitude laptop with a core i5 Intel processor:
For the release candidate we used ghc 9.4.3, and for the current version we used ghc 8.10.7, in both setups (for historical reasons). |
Note that @martinescardo 's measurements use Nevertheless, the speedup is quite remarkable. |
In #5897, @plt-amy suggested that perhaps we should hide the support for indexed inductive types with --cubical behind a flag, since the current implementation is not yet complete and will possibly change in future releases. I think this is a good idea. What would be a good name for this flag?
--experimental-hcomp-for-indexed
?@Saizan @mortberg do you have an opinion on this? Is this feature already being used in the cubical library?
The text was updated successfully, but these errors were encountered: