<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/factor, branch master</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=master</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2026-02-25T14:52:57Z</updated>
<entry>
<title>tests: factor,numfmt: verify embedded NUL handling</title>
<updated>2026-02-25T14:52:57Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2026-02-25T14:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f06beebd340311ce8771d9b1f7f2b4416c5c01d8'/>
<id>urn:sha1:f06beebd340311ce8771d9b1f7f2b4416c5c01d8</id>
<content type='text'>
* tests/factor/factor.pl: Verify that embedded NULs
on stdin terminate the _number_.
* tests/numfmt/numfmt.p: Verify that embedded NULs
on stdin terminate the _line_.
https://github.com/coreutils/coreutils/pull/196
</content>
</entry>
<entry>
<title>maint: run 'make update-copyright'</title>
<updated>2026-01-01T18:56:16Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2026-01-01T18:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=73d3a49f45770c45808e4fdab35ae4fe248a3cd9'/>
<id>urn:sha1:73d3a49f45770c45808e4fdab35ae4fe248a3cd9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: factor: add suggested large prime tests</title>
<updated>2025-10-02T16:22:28Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-10-02T16:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1b12425f6742a8a911fab647d161ffad2ed41c7b'/>
<id>urn:sha1:1b12425f6742a8a911fab647d161ffad2ed41c7b</id>
<content type='text'>
* tests/factor/create-test.sh: Add 2 new large primes from:
https://github.com/coreutils/coreutils/issues/65
* tests/local.mk: Reference the 2 new generated tests.
</content>
</entry>
<entry>
<title>factor: don’t prove primality</title>
<updated>2025-07-10T00:12:40Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-06-21T18:41:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5037ce930c243e6fc06f5b879daece31d4628da4'/>
<id>urn:sha1:5037ce930c243e6fc06f5b879daece31d4628da4</id>
<content type='text'>
Suggested for consideration by Torbjörn Granlund in:
https://lists.gnu.org/r/coreutils/2025-01/msg00000.html
* src/factor.c (PROVE_PRIMALITY): Now defaults to false.
(mp_prime_p): Help the compiler by telling it mpz_prob_prime_p
returns nonnegative.
* tests/factor/create-test.sh (bigprime): Test 2^400 - 593,
since that’s now practical.
* tests/local.mk (factor_tests): Add new test.
</content>
</entry>
<entry>
<title>factor: switch from mp to single when doable</title>
<updated>2025-07-10T00:12:39Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-06-04T17:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=831623ba6683d8a8254b0ebcb1ee98191729a190'/>
<id>urn:sha1:831623ba6683d8a8254b0ebcb1ee98191729a190</id>
<content type='text'>
This significantly improves performance when a number exceeds
2**(W_TYPE_SIZE - 1) and is the product of a prime less than
FIRST_OMITTED_PRIME and another prime less than 2**(W_TYPE_SIZE - 1).
On my platform, for example, it doubled the speed of factoring
4999 * (2**128 - 159).
* src/factor.c (mp_size, mp_finish_in_single): New functions.
(mp_factor_using_division, mp_factor_using_pollard_rho):
Finish using single precision when possible.
* tests/factor/factor.pl (lt-5000-times-128-bit): New test.
</content>
</entry>
<entry>
<title>factor: fix test case name</title>
<updated>2025-07-10T00:12:39Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-05-20T21:15:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=badc24c30cc7ab440335270765810ee1f1970727'/>
<id>urn:sha1:badc24c30cc7ab440335270765810ee1f1970727</id>
<content type='text'>
* tests/factor/factor.pl (bug-gmp-plus_2_sup_127_plus_1):
Rename from bug-gmp-plus_2_sup_128_plus_1, so that
it accurately reflects the test case.
</content>
</entry>
<entry>
<title>factor: fix bug with 128-bit uintmax_t</title>
<updated>2025-05-18T04:49:22Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-05-18T04:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=fe51b33859d2e7286425d6d5600288ce9ae43bd1'/>
<id>urn:sha1:fe51b33859d2e7286425d6d5600288ce9ae43bd1</id>
<content type='text'>
On so-far-only-theoretical platforms with 128-bit uintmax_t,
'factor' would misbehave by not factoring enough.
Work around the bug (at a performance cost)
and document the issue.  I hope someone with
more time and expertise can fix the performance cost
that this introduces.
To reproduce the correctness bug, build with
'gcc -DUSE_INT128 -DEXHIBIT_INT128_BUG';
'make check' should fail due to the new test case.
* src/factor.c (USE_INT128): New macro.
(wide_uint, wide_int, W_TYPE_SIZE, WIDE_UINT_MAX):
Define to proper values if USE_INT128.
(prime_p) [!EXHIBIT_INT128_BUG]: Work around bug
with 128-bit wide_uint, at some performance cost.
* tests/factor/factor.pl (bug-with-128-bit-uintmax_t):
New test.
</content>
</entry>
<entry>
<title>maint: tests: remove duplicate uses of 'my' in Perl</title>
<updated>2025-01-20T15:45:03Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2025-01-20T05:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=91d5a512365726b89868b7113d9df5cbe6cab270'/>
<id>urn:sha1:91d5a512365726b89868b7113d9df5cbe6cab270</id>
<content type='text'>
* tests/env/env-S.pl (cf): Remove uses of 'my' after the variable has
been declared.
* tests/factor/factor.pl (t): Likewise.
* tests/misc/fold.pl (prog): Remove duplicate assignment.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2025-01-01T09:33:08Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-01-01T09:14:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=28b176085f04a6227d7fadd28a129b5cb02dfbf5'/>
<id>urn:sha1:28b176085f04a6227d7fadd28a129b5cb02dfbf5</id>
<content type='text'>
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>factor: port to platforms</title>
<updated>2024-09-28T00:42:58Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-09-25T22:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5867465510d023ece420e9921fc1034e3abd6455'/>
<id>urn:sha1:5867465510d023ece420e9921fc1034e3abd6455</id>
<content type='text'>
* src/factor.c (mod2): Work even if cntd &lt;= cnta.  The old version
of the code assumed that shifts by N had unspecified behavior
unless 0 &lt;= N &lt; wordsize.  Although this assumption is portable to
all known practical platforms, the C standard says these shifts
have undefined behavior and some pedantic platforms check this.
* tests/factor/create-test.sh:
* tests/local.mk (factor_tests): New test t37.
</content>
</entry>
</feed>
