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

Port to MathComp 2 #16

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Port to MathComp 2 #16

merged 3 commits into from
Oct 17, 2023

Conversation

pi8027
Copy link
Collaborator

@pi8027 pi8027 commented Sep 27, 2023

No description provided.

@proux01
Copy link
Contributor

proux01 commented Sep 27, 2023

Apparently, the github action is missing something like opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev

@pi8027
Copy link
Collaborator Author

pi8027 commented Sep 27, 2023

I locally tested my patch with MathComp 2.0. So I'm ok with fixing that part of CI after the release of Algebra Tactics.

However, I still have to make it compatible with MathComp dev (2.1).

@pi8027
Copy link
Collaborator Author

pi8027 commented Sep 27, 2023

If I do:

Set Printing All.
Check 10%:~R.

I get:

@intmul _ (GRing.one _) (@GRing.natmul _ (GRing.one _) (S (S (S (S (S (S (S (S (S (S O)))))))))))

Is this intentional? It just looks ridiculous to me...

@proux01
Copy link
Contributor

proux01 commented Sep 27, 2023

That's indeed a bug:

About intmul.
(* Arguments intmul [R] (x n)%ring_scope *)

It should be Arguments intmul [R] x%ring_scope n%int_scope

@proux01
Copy link
Contributor

proux01 commented Sep 27, 2023

If you have only non negative constants, just use 10%:R which is way less buggy.

@pi8027
Copy link
Collaborator Author

pi8027 commented Sep 27, 2023

If you have only non negative constants, just use 10%:R which is way less buggy.

Well, but replacing intmul with natmul in an existing large proof may invite another issue.

@pi8027
Copy link
Collaborator Author

pi8027 commented Sep 27, 2023

Anyway I did a minimal fix.

@proux01
Copy link
Contributor

proux01 commented Sep 27, 2023

10%Z%:~R is a bit ugly but should work

@proux01
Copy link
Contributor

proux01 commented Sep 28, 2023

@pi8027 I have a fix there: math-comp/math-comp#1086 but it may require an overlay for Apery (I don't know since Apery is not in mathcomp's CI currently). So I suggest the following course of action:

  1. merge this
  2. then I can reintroduce Apery in mathcomp's CI
  3. I can merge Fix the scope of arguments of intmul math-comp/math-comp#1086 (potentially after an overlay here)

Let me know if that's ok for you or if you would prefer to go the other way round (i.e., merge math-comp/math-comp#1086 then adapt the current PR)

@pi8027 pi8027 force-pushed the hierarchy-builder branch 2 times, most recently from 1a8386c to 42b1a4c Compare September 29, 2023 13:21
@pi8027 pi8027 force-pushed the hierarchy-builder branch 4 times, most recently from 0c7782c to 5d201fa Compare October 14, 2023 11:53
@pi8027 pi8027 marked this pull request as ready for review October 14, 2023 11:53
@pi8027 pi8027 changed the title [WIP] Port to MathComp 2 Port to MathComp 2 Oct 14, 2023
@pi8027
Copy link
Collaborator Author

pi8027 commented Oct 14, 2023

Regarding number notations, I think we should do a performance comparison (timed diff) of apery before/after the introduction of number notations. Commit e40179eb4e8452250741f4ead570ea9dc2ec77e3 should work with MathComp 1.12 to 1.17, and would be suited for this benchmarking.

@pi8027
Copy link
Collaborator Author

pi8027 commented Oct 14, 2023

Also, the build of Apery took about 5 minutes in CI before this PR (before MC2): https://github.com/coq-community/apery/actions/runs/6509030922/job/17679609794
However, now it takes about 10 minutes here. It might just be a global issue of HB/MC2 but it is quite concerning to me. (I think Assia spent a lot of time optimizing the compilation of Apery.)

@proux01
Copy link
Contributor

proux01 commented Oct 16, 2023

Regarding number notations, I think we should do a performance comparison (timed diff) of apery before/after the introduction of number notations. Commit e40179eb4e8452250741f4ead570ea9dc2ec77e3 should work with MathComp 1.12 to 1.17, and would be suited for this benchmarking.

Being just a notation, I'm not expecting any significant performance impact, but sure, feel free to benchmark (I recommend using make -j1 TIMED=1 to have reasonnably reproducible results).

Also, the build of Apery took about 5 minutes in CI before this PR (before MC2): https://github.com/coq-community/apery/actions/runs/6509030922/job/17679609794 However, now it takes about 10 minutes here. It might just be a global issue of HB/MC2 but it is quite concerning to me. (I think Assia spent a lot of time optimizing the compilation of Apery.)

A factor 2 is along the lines of what we currently observe on both mathcomp itself and analysis: math-comp/hierarchy-builder#391 You can use the TIMED and TIMING options of coq_makefile https://coq.inria.fr/doc/V8.18.0/refman/practical-tools/utilities.html#timing-targets-and-performance-testing to find out if some lines are particular bottlenecks.

@pi8027
Copy link
Collaborator Author

pi8027 commented Oct 16, 2023

Being just a notation, I'm not expecting any significant performance impact.

I think that turning 1 *~ Posz n into 1 *~ (1 *+ n) can be a source of noticeable slow down.

Unfortunately, I have been delaying many things because of Algebra Tactics. I cannot spend more time on this kind of maintenance work right now.

@proux01
Copy link
Contributor

proux01 commented Oct 16, 2023

@pi8027 should we merge? this seems ready as far as I can see.

@pi8027 pi8027 mentioned this pull request Oct 17, 2023
@pi8027 pi8027 merged commit a68c107 into master Oct 17, 2023
7 checks passed
@pi8027 pi8027 deleted the hierarchy-builder branch October 17, 2023 13:09
proux01 added a commit to proux01/math-comp that referenced this pull request Oct 17, 2023
proux01 added a commit to proux01/math-comp that referenced this pull request Oct 18, 2023
proux01 added a commit to proux01/math-comp that referenced this pull request Nov 21, 2023
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