Skip to content

Rust: Replace recursion through forall with ranked recursion#21679

Draft
hvitved wants to merge 3 commits intogithub:mainfrom
hvitved:rust/type-inference-forall-checks
Draft

Rust: Replace recursion through forall with ranked recursion#21679
hvitved wants to merge 3 commits intogithub:mainfrom
hvitved:rust/type-inference-forall-checks

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented Apr 9, 2026

A recent QA run showed a timeout on mimuw-distributed-systems-group/cmemu. The problematic predicate was hasNoCompatibleTargetNoBorrowToIndex, where we do recursion through forall via the inlined predicate hasNoCompatibleNonBlanketTargetCheck. This PR applies the standard trick of replacing such recursion with ranked recursion, and since the original check already happened inside such (another) ranked recursion, it means we are now doing two levels ranked recursion (see QL doc on the newly introduced NoCompatibleTarget module).

I also noted that in the original hasNoCompatibleTargetSharedBorrow check we were calling hasNoCompatibleNonBlanketLikeTargetCheck, which should have been hasNoCompatibleTargetCheck (just like in hasNoCompatibleTargetNoBorrow), so this has been fixed as well.

The second commit is an unrelated improvement to how we check blanket constraints.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Apr 9, 2026
@hvitved hvitved force-pushed the rust/type-inference-forall-checks branch from 27f8658 to 5c6c3c0 Compare April 9, 2026 11:55
@hvitved hvitved force-pushed the rust/type-inference-forall-checks branch 4 times, most recently from 1888e7a to ad0a58f Compare April 9, 2026 18:35
@hvitved hvitved force-pushed the rust/type-inference-forall-checks branch from ad0a58f to e7930fe Compare April 10, 2026 08:19
@hvitved hvitved force-pushed the rust/type-inference-forall-checks branch from e7930fe to 27f7f74 Compare April 10, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants