-
Notifications
You must be signed in to change notification settings - Fork 500
Force ambiguity for annotations in CEK #7189
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
Conversation
|
/benchmark lists it shouldn't differ really. core didn't change |
|
Click here to check the status of your benchmark. |
| forgetAnn :: forall ann uni fun. NTerm uni fun ann -> NTerm uni fun Any | ||
| forgetAnn = unsafeCoerce | ||
|
|
||
| rememberAnn :: forall ann uni fun. NTerm uni fun Any -> NTerm uni fun ann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unsafe
| Starting term -> pure $ Computing NoFrame Env.empty term | ||
| Computing ctx env term -> computeCek ctx env term | ||
| Starting term -> pure $ Computing NoFrame Env.empty (forgetAnn term) | ||
| Computing ctx env term -> computeCek ctx env (rememberAnn term) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only safe if Computing ... is constructed by cekTrans which is not ideal. Probably, it is possible to have some witness value to allow this conditionally
|
6775175 to
2c3fb0a
Compare
|
Comparing benchmark results of 'lists' on 'f0aca4d2d' (base) and '677517527' (PR) Results table
|
effectfully
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hate it.
| forgetAnn :: forall ann uni fun. NTerm uni fun ann -> NTerm uni fun Any | ||
| forgetAnn = unsafeCoerce | ||
|
|
||
| rememberAnn :: forall ann uni fun. NTerm uni fun Any -> NTerm uni fun ann | ||
| rememberAnn = unsafeCoerce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, I'm really uncomfortable about that. Let's discuss it during the tech meeting.
|
I agree. Also, less reason to pursue this as there's a proper way for #7188. Closing |
For Cek, we intentionally maintain ambiguity of the annotation type for performance reasons(I assume). This PR makes it so that this ambiguity is forcefully enforced by using
GHC.Exts.Anyas the annotation type. This reduces some noise on the types while also allowing construction of UPLC nodes within CEK in nicer way, which is what I needed for thisSteppableCek is a bit messy because its context can hold annotations, so it would require more coercsions.