STEMSA

PARI2.0

A modified build of PARI/GP 2.19.1, the system we use for the computations on this site. It includes an overhaul of the p-adic BSD routines, and the slowest step can run on a GPU through OpenCL.

Download coming soonGNU GPL v2 or later

PARI 2.0 is STEMSA’s name for this modified build of PARI/GP 2.19.1. It is licensed under the GNU GPL. It is not affiliated with or endorsed by the PARI Group.

Download

News: [2026-11-22] Download coming soon. The first public build will include the p-adic BSD overhaul, of which the ellpadicbsd auto-twist fix is one example, and OpenCL GPU support. The files will be posted here when validation is finished.

News: [2026-11-22] PARI 2.0 is free under the GNU GPL v2 or later and will ship with the complete corresponding source.

What changed

PARI 2.0 is a larger overhaul of the p-adic BSD work in stock PARI/GP 2.19.1, together with OpenCL support so the slowest step can run on a GPU. The two items below are concrete examples, not a complete list of the changes.

Fix

ellpadicbsd auto-twist

Stock PARI replaces \(E\) by a minimal-conductor quadratic twist when \(D\) is omitted, which made the Sha-side leftover 2 or 4 times too large on some curves with \(16\mid N\). We no longer auto-twist; a user-supplied \(D\) is unchanged. Details and calibration.

File: src/basemath/ellpadic.c.

GPU

OpenCL offload of mspadicinit

dual_act and moments_act run on an OpenCL device. Buffers stay on the GPU, moment-matrix work is batched, and tables are reused. If there is no usable device, or the startup self-test fails, the original CPU code runs.

How the work is split

One GPU worker takes the heavy (curve, prime) pairs and CPU workers take the light ones. Memory limits follow the RAM that is free at the time, so a batch does not run the machine out of memory.

curve 960j1, p = 7
? E = ellinit([0,-1,0,4,-30]);
? ellpadicbsd(E, 7, 5)
stock PARI 2.19.1 : [0, 4 + O(7^5)]   \\ wrong, should be 1
PARI 2.0         : [0, 1 + O(7^5)]

The official source is at pari.math.u-bordeaux.fr.

Checks

The following curves match stock PARI bit-for-bit: 389a1, 997b1, 1431a1, 1873a1, 1028a1 and 1034a1.

Speed: Measured numbers are coming. We will publish like-for-like figures here once we have a set we trust.

Roadmap

The next step is to run the same GPU path on NVIDIA, AMD, and Intel hardware, and then to offer the work upstream to the PARI Group.

License notice

PARI/GP is copyright © The PARI Group and is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 or (at your option) any later version. Our modifications will be released under the same license. The programs come with no warranty, to the extent permitted by law.

  • Source. When the build is published it will be accompanied by the complete corresponding source, under the same license, on this page.
  • Name and affiliation. “PARI 2.0” is STEMSA’s own name for this modified build of PARI/GP 2.19.1. It is not affiliated with or endorsed by the PARI Group, and the number does not denote an upstream release; please do not report problems with it to the PARI developers without first reproducing them on stock PARI. The original is at pari.math.u-bordeaux.fr.