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

chore: Split out the finishing tactic aspect of simp_mem into mem_omega [2/?] #231

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

bollu
Copy link
Collaborator

@bollu bollu commented Oct 10, 2024

This helps control how aggressive simp_mem is, since simp_mem now no longer closes memory goals, but rather expects the user to manually invoke mem_omega when necessary. Another impact of this change is that we split mem_omega into two tactics: mem_omega that does not expose pairwiseSeparate goals, and mem_omega!, which does. This also helps control the performance of mem_omega, and hopefully, this ensures that the user is careful before exposing a full O(n^2) set of constraints to the user.


I was hoping that we would see a major performance difference. We do see some evidence for improvement in the Experiments/MemoryAliasing.lean (the numbers are extremely consistent across runs:

### Old timings
lake build Proofs.Experiments.MemoryAliasing  2.86s user 0.34s system 92% cpu 3.466 total

### New timings
lake build Proofs.Experiments.MemoryAliasing  2.76s user 0.33s system 92% cpu 3.332 total

However, on the much larger Memcpy.lean, these types of considerations seem to just not matter:

### Old timings
lake build Proofs.Experiments.Memcpy.MemCpyVCG  31.79s user 0.81s system 99% cpu 32.878 total

### New timings
lake build Proofs.Experiments.Memcpy.MemCpyVCG  32.79s user 0.80s system 99% cpu 33.870 total

This is a tad disappointing, but such is life. Onward to the next refactor. This is stacked on top of #230

We also change mem_omega to be less agressive by default,
and only exploiting PairwiseSeparate hypotheses if asked to by
the user with mem_omega!.
Copy link
Collaborator

@shigoel shigoel left a comment

Choose a reason for hiding this comment

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

Also edit the PR blurb to document that this makes the pairwiseSeparate goals to be not unfolded by default, and adds a convenient API for the user to expose the pairs that need to be exposed for the current goal.

…ga [2/?]

This helps control how aggressive simp_mem is.

I was hoping that we would see a major performance difference. We do see some evidence for improvement in the `Experiments/MemoryAliasing.lean` (the numbers are extremely consistent across runs:

```
lake build Proofs.Experiments.MemoryAliasing  2.86s user 0.34s system 92% cpu 3.466 total

lake build Proofs.Experiments.MemoryAliasing  2.76s user 0.33s system 92% cpu 3.332 total
```

---

However, on the much larger `Memcpy.lean`, these types of considerations seem to just not matter:

```
lake build Proofs.Experiments.Memcpy.MemCpyVCG  31.79s user 0.81s system 99% cpu 32.878 total

lake build Proofs.Experiments.Memcpy.MemCpyVCG  32.79s user 0.80s system 99% cpu 33.870 total
```

This is a tad disappointing, but such is life. Onward to the next refactor. This is stacked on top of #230
@shigoel shigoel merged commit 25fffe0 into main Oct 29, 2024
5 checks passed
@shigoel shigoel deleted the simp-mem-mem-omega-2 branch October 29, 2024 16:53
shigoel pushed a commit that referenced this pull request Oct 30, 2024
### Description:

This allows us to gradually convert all our tactics to `MetaM`,
which provides the correct level to discipline to make sure
that bugs like #154 don't
happen anymore.
Also, as a mild bonus, one hopes that eliminating `evalTactic` makes
stuff a bit faster,
but I would not hold my breath on this.

Stacked on #231 

### Testing:

What tests have been run? Did `make all` succeed for your changes? Was
conformance testing successful on an Aarch64 machine?

### License:

By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.
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.

2 participants