[micromega] Switch from Big_int to ZArith.#8743
Conversation
2a2f144 to
1294956
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Take care of Nix if you want on the way. |
|
is it ok with everybody if we add a new dependency (gmp)? |
Note that we are just replacing dependencies by others. I would much prefer depending on ZArith + GMP than on Num. |
|
Num was not the home cooked stuff by Valerie Menissier? gmp seems a bigger chunk |
|
Here's what the This is a legacy library. It used to be part of the core OCaml distribution (in otherlibs/num) but is now distributed separately. New applications that need arbitrary-precision arithmetic should use the Zarith library (https://github.com/ocaml/Zarith) instead of the Num library, and older applications that already use Num are encouraged to switch to Zarith. Zarith delivers much better performance than Num and has a nicer API. |
|
@thery has a point in that the transition won't be fully pain-free. Also, I am not sure about the dependency of the frontend on |
|
Performance will be interesting, please add to the CI / Bench cool devs in that regard. |
|
If the motivation is micromega, I am not sure it will make much difference but I can be wrong. |
This comment has been minimized.
This comment has been minimized.
|
I am looking into it.
It does not seem so. Disabling caches does not solve the problem... |
|
Ok one worrying failure: |
|
Gonna run a CI with #13002 added and without the debug code so we can bench and also get a complete CI. |
|
For perennial, the problem is: so likely some silly typo again. |
|
Ok, this seems finally ready for review and bench. Note that the issue in ocaml/Zarith#58 created some problems in testing, but none in practice; anyways we've added a workaround. Debug code lives in https://github.com/ejgallego/coq/tree/zarith%2Bdebug |
|
There is still a problem with the .csdp.cache of the test-suite? |
|
I don't remember how this is handled.
Is it supposed to be already there or regenerated?
It should be already there, named: `test-suite/.csdp.cache.test-suite`
|
|
The test suite is actually failing due to out of memory! It worked in my machine. Maybe some |
@fajb I updated that file, things were working fine in my machine, but indeed the memory consumption is strange as our test suite has noticed. Bench is over by the way: No significative change IMO. |
|
@ejgallego the bench looks good. |
Should we worry that the memory footprint of |
If not reproducible likely not; I don't know how to trigger a bench for 2 development only now tho. |
|
@ejgallego No idea. I have never looked at memory consumption. |
Thanks, I've launched the CI.
Indeed it seems the OOM could maybe a problem with the csdp cache? Let see what the re-run says. |
We still link num in `coqc` , that will be removed in a separate step. Co-authored-by: Vincent Laporte <Vincent.Laporte@fondation-inria.fr>
- merlin.in : added zarith - test-suite/Makefile remove .csdp.cache on make clean updated .csdp.cache.test-suite
In particular, behavior of `Z.gcd` and `Z.lcm` has been fixed in 1.10, see ocaml/Zarith#58
|
@fajb I think we are close to a fixpoint here, would you like to assign? |
|
@ejgallego fixpoint, eventually! I'll merge as soon as the CI passes. |
Failure on coq_tools is spurious [failing everywhere] and not related to this PR. |
|
@ejgallego well done. |
|
Thanks @fajb ! |
We replace micromega use of Num by Zarith.