Skip to content

RequirementMachine: Wire up protocol requirement signature minimization #39629

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

Merged
merged 8 commits into from
Oct 10, 2021

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Oct 7, 2021

This is controlled by the new -requirement-machine-protocol-signatures=(on|off|verify) flag, which is just like -requirement-machine=(on|off|verify) for queries.

It's still rather incomplete:

  • verify mode is not implemented yet.
  • layout, superclass and concrete type requirements are not supported.
  • associated type merging is not supported.
  • no redundancy or conflict diagnostics.

Indeed for now, it's only good for testing the homotopy reduction and generating conformances algorithms. Stay tuned!

std::sort() will sometimes compare an element with itself (?)
so remove the assert here. Duplicate conformance requirements
should be already caught by checkGenericSignature() anyway.
When using the requirement machine to build protocol signatures,
we can't get the protocol's dependencies by looking at the
conformance requirements in it's requirement signature, because
we haven't computed the requirement signature yet.

Instead, get the dependencies via the recently-added
getStructuralRequirements() request.
@slavapestov slavapestov force-pushed the rqm-protocol-signatures branch from 952f121 to 16e1fdd Compare October 8, 2021 23:39
There are three settings, on, off and verify. Not hooked up quite yet.
…minimizing protocol signatures

Also while plumbing this through, don't record homotopy generators
unless we're minimizing a protocol signature, since they're not
used for anything else yet.
@slavapestov slavapestov force-pushed the rqm-protocol-signatures branch from 16e1fdd to 8ab330a Compare October 9, 2021 23:11
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov marked this pull request as ready for review October 9, 2021 23:12
@slavapestov slavapestov merged commit 5fd48a0 into swiftlang:main Oct 10, 2021
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.

1 participant