RequirementMachine: Relax assertions in verifyRewriteSystem() [5.7] #59935
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes rdar://problem/94746399.
The strict assertions here are always true for non-simplified rules, but the old minimal conformances algorithm relied on them being true even for simplified rules, which was hard to guarantee. These invariants were established by extra logic in the completion procedure. Unfortunately, someone found a counter-example. Luckily, everything works in that specific example.
Note that we already did this once (#59557). This relaxes the verify assert further.
On the main branch I reworked the minimal conformances algorithm to not look at rewrite loops at all, in PR #59861 and #59900, and the weird logic in the completion procedure is now gone there.
However on 5.7 I'm keeping everything the same as before, just relaxing the assertion. If this causes any more problems we can cherry pick the rework of minimal conformances to 5.7, but I'd rather not do that at this point since it's a larger change.