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

Panic on record declaration with unknown sort #5681

Closed
JasonGross opened this issue Dec 2, 2021 · 12 comments
Closed

Panic on record declaration with unknown sort #5681

JasonGross opened this issue Dec 2, 2021 · 12 comments
Assignees
Labels
internal-error Concerning internal errors of Agda regression in 2.6.2 Regression that first appeared in Agda 2.6.2 sorts Agda's sort system (see also piSort); univSort; Sort metas; Fibrancy
Milestone

Comments

@JasonGross
Copy link
Contributor

JasonGross commented Dec 2, 2021

On the code

module foo where
record bar : ? where

I get "Panic: uncaught pattern violation"

Seems distinct from #230 (is it related to #118 though?)

Agda version 2.6.2

@andreasabel andreasabel added internal-error Concerning internal errors of Agda status: already-fixed status: duplicate Duplicate issue (not in changelog) labels Dec 2, 2021
@andreasabel andreasabel added this to the 2.6.2.1 milestone Dec 2, 2021
@andreasabel
Copy link
Member

Thanks for reporting, @JasonGross !

On 2.6.2.1, you will get yellow:

?0 : univSort _2
Sort _2  [ at ... ]

I thought I knew which issue this was, but now cannot find it... (Still, my stomach says it is a duplicate.)

@L-TChen
Copy link
Member

L-TChen commented Dec 11, 2021

The same code but with the option --without-K still fails on 2.6.2.1.

{-# OPTIONS --without-K #-}

record foo : {!!} where

@L-TChen L-TChen reopened this Dec 11, 2021
@andreasabel andreasabel modified the milestones: 2.6.2.1, 2.6.3 Dec 11, 2021
@andreasabel andreasabel added sorts Agda's sort system (see also piSort); univSort; Sort metas; Fibrancy regression in 2.6.2 Regression that first appeared in Agda 2.6.2 and removed status: duplicate Duplicate issue (not in changelog) status: already-fixed labels Dec 11, 2021
@andreasabel
Copy link
Member

Works in 2.6.1:

$ agda-2.6.1 Issue5681.agda
Checking Issue5681.
Failed to solve the following constraints:
  Has bigger sort: _2
Unsolved metas at the following locations:
  ...
Unsolved interaction metas at the following locations:
  ...

@andreasabel
Copy link
Member

agda-bisect says: fee1fc7 is the first bad commit. Ping @nad.
Date: Fri Jun 4 10:55:31 2021 +0200
Fixed #5434.

@nad
Copy link
Contributor

nad commented Dec 12, 2021

I don't know too much about this code. I tried to fix a bug, and @Saizan approved the changes, so I merged the fix.

@andreasabel
Copy link
Member

@nad: If you do not accept responsibility, it is probably ok to revert the patch to fix the regression.
Or we could ignore the blocked and simply speculate either fibrant or non-fibrant for blocked sorts. For plain Agda, everything would be ok, but the experimental Cubical Agda might than malfunction if you leave the sort open with a meta-variable.

@nad
Copy link
Contributor

nad commented Dec 12, 2021

I don't know too much about the "non-fibrant types" feature. Is this feature integral for something in Cubical Agda (like the interval type), or could it be hidden behind a flag and treated as experimental?

I also don't know exactly what infrastructure we have for postponing things. Could isFibrant postpone whatever is currently going on if it encounters an uninstantiated meta-variable, or is more work required?

@andreasabel
Copy link
Member

Some postponed checks need to block unfolding of terms to avoid looping or ill-typed terms. I don't know the implications of isFibrant and whether some things need to be blocked until we know about fibrancy.

@nad
Copy link
Contributor

nad commented Dec 13, 2021

@Saizan, can you answer some of the questions above?

@nad
Copy link
Contributor

nad commented Dec 13, 2021

Discussion seems to be going on elsewhere (#5692).

@Saizan
Copy link
Contributor

Saizan commented Dec 13, 2021

To summarize:

  • we have non-fibrant types in --cubical/--erased-cubical, e.g. the Interval (also with just --two-level).
  • we do not need to block things to postpone this check, we would just need to make it into a new constraint.

@andreasabel
Copy link
Member

@Saizan: Do you think you can make a stab at this? Would be nice if this could be fixed for 2.6.2.2.

@jespercockx jespercockx self-assigned this Aug 22, 2022
jespercockx added a commit to jespercockx/agda that referenced this issue Aug 29, 2022
andreasabel added a commit to jespercockx/agda that referenced this issue Aug 29, 2022
…e Sort

This lets us traverse the blocking sort for metas etc.
TCM Bool was too higher-order...
andreasabel added a commit that referenced this issue Aug 29, 2022
This lets us traverse the blocking sort for metas etc.
TCM Bool was too higher-order...
@andreasabel andreasabel changed the title "Panic: uncaught pattern violation" on record with hole sort Panic on record declaration with unknown sort Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-error Concerning internal errors of Agda regression in 2.6.2 Regression that first appeared in Agda 2.6.2 sorts Agda's sort system (see also piSort); univSort; Sort metas; Fibrancy
Projects
None yet
Development

No branches or pull requests

6 participants