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

Replace experimental interface primitives with proper LF primitives #12678

Merged
merged 14 commits into from
Feb 3, 2022

Conversation

akrmn
Copy link
Contributor

@akrmn akrmn commented Jan 31, 2022

DA-GHC PR: digital-asset/ghc#100

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description
  • If you mean to change the status of a component, please make sure you keep the Component Status page up to date.

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@akrmn akrmn force-pushed the interface-primitives branch 2 times, most recently from 6068a69 to edc4e85 Compare February 1, 2022 17:19
@akrmn akrmn force-pushed the interface-primitives branch 2 times, most recently from d561695 to 6934849 Compare February 2, 2022 11:07
@akrmn akrmn requested review from cocreature and remyhaemmerle-da and removed request for cocreature February 2, 2022 11:08
@akrmn akrmn marked this pull request as ready for review February 2, 2022 11:09
@akrmn akrmn force-pushed the interface-primitives branch 3 times, most recently from fac8858 to 5e086ca Compare February 2, 2022 11:58
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! One comment on the names (sorry for bikeshedding that), looks good otherwise.

I think as a next step (fine with me to have that in a separate PR) we should test this thoroughly. Specifically we need at least the following tests:

  1. First, you probably need to extend the Daml-LF parser to support these primitives so you can actually write steps
  2. Test that the decoder rejects these in older LF versions and accepts them in 1.dev.
  3. Add tests for the Daml-LF typchecker
  4. Add SBuiltin tests for the corresponding builtins.

Probably missed something but @remyhaemmerle-da can surely remind us of that.

@akrmn akrmn force-pushed the interface-primitives branch 2 times, most recently from a22bb1a to 939a498 Compare February 2, 2022 15:10
SBInterfaceTemplateTypeRep(ifaceId)(compile(env, body))
case ESignatoryInterface(ifaceId, body @ _) =>
val arg = compile(env, body)
SBSignatoryInterface(ifaceId)(arg, arg)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should do the trick so SBResolveVirtual gets the argument twice, but I'm not quite sure. Could you please tell me if this makes sense? @remyhaemmerle-da @sofiafaro-da @cocreature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me. We may want to see if passing the argument twice is really the best way to address this (for these an for other primitives) but definitely not in this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good enough for the MVP.

@akrmn akrmn force-pushed the interface-primitives branch from 746180c to 35f8872 Compare February 3, 2022 09:31
Copy link
Contributor

@sofiafaro-da sofiafaro-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@akrmn
Copy link
Contributor Author

akrmn commented Feb 3, 2022

now that this is green, I'll

  • merge the DA-GHC PR
  • update compile.yml here
  • wait for da_ghc_lib
  • update bazel-haskell-deps
  • wait for tests
  • merge this PR

@akrmn akrmn force-pushed the interface-primitives branch from 00bac8a to af3ad07 Compare February 3, 2022 12:26
@akrmn akrmn enabled auto-merge (squash) February 3, 2022 13:19
@akrmn akrmn merged commit 3ce272b into main Feb 3, 2022
@akrmn akrmn deleted the interface-primitives branch February 3, 2022 13:36
remyhaemmerle-da added a commit that referenced this pull request Feb 7, 2022
from 130 to 125, reason the test is currently flaky (It fails around 20% of the time).

Surprisingly, #12678 seems to have increase the stack usage for the type checker.

CHANGELOG_BEGIN
CHANGELOG_END
@akrmn akrmn mentioned this pull request Feb 7, 2022
11 tasks
@akrmn akrmn linked an issue Feb 9, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn experimental interface primitives into proper LF primitives
4 participants