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

[micromega] fix efficiency regression #11263

Merged
merged 1 commit into from Dec 18, 2019
Merged

Conversation

fajb
Copy link
Contributor

@fajb fajb commented Dec 9, 2019

PR #9725 fixes completness bugs introduces some inefficiency. The
current PR intends to fix the inefficiency while retaining
completness. The fix removes a pre-processing step and instead relies
on a more elaborate proof format introducing positivity constraints on
the fly.

Solve bootstrapping issues: RMicromega <-> Rbase <-> lia.

Fixes #11063 and fixes #11242

@fajb fajb requested review from herbelin and a team as code owners December 9, 2019 15:36
@Zimmi48 Zimmi48 added kind: fix This fixes a bug or incorrect documentation. kind: performance Improvements to performance and efficiency. labels Dec 9, 2019
@Zimmi48 Zimmi48 modified the milestone: 8.11.0 Dec 9, 2019
@Zimmi48 Zimmi48 removed the request for review from a team December 9, 2019 15:56
@fajb fajb added the needs: benchmarking Performance testing is required. label Dec 9, 2019
@fajb
Copy link
Contributor Author

fajb commented Dec 9, 2019

@maximedenes , here is the efficiency fix separated from the rest of PR #11047 .

@fajb fajb mentioned this pull request Dec 11, 2019
@maximedenes
Copy link
Member

@maximedenes , here is the efficiency fix separated from the rest of PR #11047 .

Thanks a lot, launching a bench!

@maximedenes
Copy link
Member

@maximedenes
Copy link
Member

I am rather confident it solves the performance issue.

The numbers look very good, but they don't seem immediately related to the slowdown seen after #11263: some developments are still slower (flocq, coqutil, coquelicot), while some others which were not impacted are now faster (fiat-core).

So I'm wondering a bit if this is fixing the introduced performance regression, or just applying another, independent optimization.

@maximedenes maximedenes removed the needs: benchmarking Performance testing is required. label Dec 12, 2019
@maximedenes maximedenes self-assigned this Dec 12, 2019
@maximedenes maximedenes added this to the 8.11.0 milestone Dec 12, 2019
Copy link
Member

@maximedenes maximedenes left a comment

Choose a reason for hiding this comment

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

Numbers look good, and I checked that indeed the two reported issues are fixed, so looks good to me!

@maximedenes maximedenes added the needs: changelog entry This should be documented in doc/changelog. label Dec 12, 2019
@maximedenes
Copy link
Member

@fajb would you mind adding a changelog entry? Then I can merge it. Thanks a lot for your work!

@fajb
Copy link
Contributor Author

fajb commented Dec 12, 2019

@maximedenes , I have also modified the standard library to avoid a bootstrapping cycle.
This may impact developments that do not use lia. E.g., a library such Rfunctions and a few others do not load the micromega plugin anymore.

PS: I have just rebased adding a changelog.

@maximedenes
Copy link
Member

It seems that the changelog entry fails to compile. It does not seem to follow the standard model.

@maximedenes
Copy link
Member

I wonder why the pkg:nix job fails here (it says the command line is too long). @coq/ci-maintainers is it a known failure?

@fajb
Copy link
Contributor Author

fajb commented Dec 12, 2019

fixed changelog.

@@ -22,6 +23,9 @@ type t (** The type of vectors or equivalently linear expressions.
Moreover, the representation is spare and variables with a zero coefficient
are not represented.
*)
type t
Copy link
Member

Choose a reason for hiding this comment

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

Why are two aliased types defined here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because otherwise, t gets shadowed in the module Bound module (end of vect.mli)

@Zimmi48
Copy link
Member

Zimmi48 commented Dec 13, 2019

I wonder why the pkg:nix job fails here (it says the command line is too long). @coq/ci-maintainers is it a known failure?

The problem is that we have reached a limit in the number of stdlib files (this PR adds a new one). #9185 suffered from the same problem and @SkySkimmer fixed it there with commit b4c6277. Such commit could also be cherry-picked in this PR to make the CI pass. @SkySkimmer it would be good to submit as an independent PR that can be merged ASAP too.

@SkySkimmer
Copy link
Contributor

OK see #11283

@fajb fajb requested review from a team as code owners December 13, 2019 15:50
@ejgallego
Copy link
Member

Ok this should be ready for review [last commit]

plugins/micromega/ZMicromega.v Outdated Show resolved Hide resolved
plugins/micromega/simplex.ml Outdated Show resolved Hide resolved
plugins/micromega/simplex.ml Outdated Show resolved Hide resolved
@maximedenes maximedenes added part: micromega The lia, nia, lra, nra and psatz tactics. Also the legacy omega tactic. and removed needs: changelog entry This should be documented in doc/changelog. labels Dec 13, 2019
@maximedenes
Copy link
Member

When I rebase the last commit on top of master, there are conflicts (with the reformatting). I thought we were precisely trying to avoid that, not sure what happened, @ejgallego @Zimmi48 ?

@Zimmi48
Copy link
Member

Zimmi48 commented Dec 14, 2019

If the rebase is done with -i to drop the commits that are already present in master, the only conflicting file is plugins/micromega/micromega.ml, which should be extracted by running the command present in plugins/micromega/MExtraction.v and where ocamlformat should not be applied.

@ejgallego
Copy link
Member

Should be fixed now; should we mark micromega.ml as a promoted file tho?

@ejgallego
Copy link
Member

Re-launching a bench to ensure we didn't mess with anything essential in the rebases:

https://ci.inria.fr/coq/job/benchmark-part-of-the-branch/822/

@Zimmi48
Copy link
Member

Zimmi48 commented Dec 15, 2019

Should be fixed now; should we mark micromega.ml as a promoted file tho?

In the current situation, it isn't exactly one as the extraction command is commented out. Maybe we can reconsider this when we move entirely to Dune and the Dune support for Coq extraction has progressed.

@SkySkimmer SkySkimmer removed the request for review from a team December 16, 2019 09:37
@fajb
Copy link
Contributor Author

fajb commented Dec 16, 2019

@maximedenes I have just rebased (after removing the dead code you mentioned)

PR coq#9725 fixes completness bugs introduces some inefficiency. The
current PR intends to fix the inefficiency while retaining
completness. The fix removes a pre-processing step and instead relies
on a more elaborate proof format introducing positivity constraints on
the fly.

Solve bootstrapping issues: RMicromega <-> Rbase <-> lia.

Fixes coq#11063 and fixes coq#11242 and fixes coq#11270
@maximedenes
Copy link
Member

@coq/ci-maintainers what are these failing complexity tests? Are they new? They don't seem related to lia, are they?

@SkySkimmer
Copy link
Contributor

The open pretyper PR is also having complexity failure, I don't know why though

@maximedenes
Copy link
Member

@coq/ci-maintainers should I ignore the CI failures here?

@maximedenes
Copy link
Member

ping @herbelin (who maintains these complexity tests IIUC)

@maximedenes
Copy link
Member

I'll ignore what looks like a spurious failure and merge.

@coqbot coqbot added this to Request 8.11.0 inclusion in Coq 8.11 Dec 18, 2019
maximedenes added a commit that referenced this pull request Dec 18, 2019
@maximedenes maximedenes merged commit 7d961a9 into coq:master Dec 18, 2019
ppedrot added a commit to ppedrot/coq that referenced this pull request Dec 18, 2019
@coqbot coqbot moved this from Request 8.11.0 inclusion to Shipped in 8.10.0 in Coq 8.11 Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: fix This fixes a bug or incorrect documentation. kind: performance Improvements to performance and efficiency. part: micromega The lia, nia, lra, nra and psatz tactics. Also the legacy omega tactic.
Projects
No open projects
Coq 8.11
  
Shipped in 8.11.0
Development

Successfully merging this pull request may close these issues.

lia performance regression Major lia and Qed performance regression in 8.10.1
5 participants