Query: GMP completeness testing

Torbjorn Granlund tg at gmplib.org
Mon Jun 28 11:29:17 CEST 2010

Brad Chamberlain <bradc at cray.com> writes:

  I am part of a team at Cray Inc. that is developing a new parallel
  programming language called Chapel.  One of our goals is to support
  interoperability with existing languages to avoid rewriting existing
  libraries.  By requests from our user community, we have identified
  GMP as one of the first external libraries to try and support via
  interoperability.  As of a few hours ago, we have a Chapel port of the
  gmp-chudnovsky.c program up and running by describing the relevant GMP
  types and functions using our extern capability.  (Chapel currently
  takes a source-to-C compilation approach, so interoperating with C is
  easier than most languages).
Nice project!  The source-to-C approach is just intermediate, meaning
that you plan to go directly to assembly at some point?

  As a next step, we'd like to flesh out this prototype to cover all GMP
  types and functions, not just those used by gmp-chudnovsky.  Given the
  effort required to convert any given test written in C into Chapel and
  the sheer number of tests in your source tree, I was curious if there
  are any individual tests that cover the full breadth of the interface,
  presumably without testing any single routine in as many permutations
  as one would ultimately want.  Porting such a test would give us some
  degree of confidence that we at least had covered the complete API.
It is my belief that testing a GMP build requires all the present tests.
These tests exist mainly to catch cmpiler bugs, but also of course make
sure the developers don't mess up.

Having said that, I strongly doubt that testing a language interface to
GMP requires the same kind of testing.  It seems unlikely that there
will be bugs is such an interface affecting subtle numerical properties;
the interface to function f will either work completely, or fail

I cannot see how a particular test written in C would be a good test for
your interface.  Shouldn't you write some rudimentary tests in Chapel,
exercising all your newly written interfaces?

  More generally, I'm curious how the other language efforts that have
  provided GMP interfaces (as itemized in your manual) have dealt with
  completeness/correctness testing in case there are lessons learned
  there that would be helpful to us.

Alas, about this I now nothing.
  Thanks very much for any pointers and information.  And thanks for
  creating such an interesting and useful open source package.
Thanks!  Please consider supporting the GMP project!


More information about the gmp-discuss mailing list