Repository navigation
Test 15-bit digit case for PyLong's in CI? #138336
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Sep 1, 2025 - addedinfraCI, GitHub Actions, buildbots, Dependabot, etc.CI, GitHub Actions, buildbots, Dependabot, etc.
on Sep 1, 2025 - changed the title
[-]Test 15-bit digit case for PyLong's with regular CI tests?[/-][+]Test 15-bit digit case for PyLong's in CI?[/+]on Sep 1, 2025 It seems, all CI jobs run tests with --enable-big-digits=30 configure option (i.e. default). Other possible case (=15 bits) is not tested. Maybe there is some build bot, but it's not obvious which one ;-)
Maybe it's not worth it to waste CI resources on testing a configuration which is used by nobody.
From prior discussion in #89732 it seems that 15-bit case does make sense for 32-bit machines, but it's not the situation right now: 30-bit is unconditional default.
That's something else. Do you want to use 15-bit digit on 32-bit machines?
Maybe it's not worth it to waste CI resources on testing a configuration which is used by nobody.
If so, why keep this configuration supported at all?
Do you want to use 15-bit digit on 32-bit machines?
Personally I have no 32-bit machines around :-) (Well, not something that I can back to life quickly...)
Maybe nowadays this case is exotic enough to drop it?Personally I have no 32-bit machines around :-)
python.org still provides 32-bit installer for Python on Windows, even if 64-bit is now recommended.
A buildbot with
--enable-big-digits=15would be a good idea.While 15-bit digits could still be useful on non-x86 32-bit platforms that lack a 64-bit multiply accumulator such as 32-bit raspbian aarch32 userland, 32-bit raspbian does not build their python that way (it uses the default 30bit ints; i just checked the distro's 3.11 sys.int_info on my buildbot). It is still worth keeping support for fewer digits around so long as things like #101291 might desire to have less than 30 on 32-bit platforms in the future though.
Well, if we are sure that GH action is not a suitable choice, probably this issue should be moved to python/buildmaster-config repo.
One possible option with GH actions - conditionally skip new job, if change doesn't affect pre-selected files (longobject.c, some headers, marshal.c, perhaps something else like this).
32-bit raspbian does not build their python that way
I would guess, that after #30497 - downstreams just silently use 30-bit config. At least, I haven't found any counter-examples.
If 15-bit digits are useful - defaults should be rather system-dependent, not hard-wired.
Reacted by Gregory P. Smith@vstinner do you agree with moving this to buildmaster-config?
You can open a new issue in the buildmaster-config repo to propose the idea. But should we consider changing the default option for 32-bit systems?
Well, there are two opinions:
- "digits should be 30 bits on 64 machines and 15 bits on 32 bit machines" (c) @markshannon // see Drop support for 15-bit PyLong digits? #89732 (comment) for arguments in deps
- "15-bit digits could still be useful on non-x86 32-bit platforms that lack a 64-bit multiply accumulator such as 32-bit raspbian aarch32" (c) @gpshead
With (1) - we will definitely have 15-digits case tested in GH CI. With (2) - I don't see an appropriate platform among GH CI runners and this issue definitely make sense just for buildbots...
Maybe I should open a thread in https://discuss.python.org/c/core-dev/23 ?
PS: I would rather revive original idea of Mark (#89732). The GNU GMP case shows it's possible to live without such complications (IIUIC, "nails" option just not working for most platforms at all.)
Benchmarks would help to take a decision. What's the difference between 15-bit and 30-bit integers on a 32-bit machine?
I don't have access to 32-bit machines. Sometimes I build Python using
gcc -m32to build it in 32-bit mode on my 64-bit machine. But I don't think that it would be a good idea to run benchmarks on a 64-bit machine.should we consider changing the default option for 32-bit systems?
not at this point. the few who care have the choice via the configure option. good enough.
FYI - on x86_64/amd64 machines compiling with -m32 and testing will not be representative, 32-bit x86 has a 64bit multiplier unit (two 32bit registers as input -> a pair of 32bit registers as output). other 32-bit architectures that tend not to have that where the performance can suffer.
It seems no one liked new CI job proposal. So, I'm closing this in favor of python/buildmaster-config#649.
Reacted by Gregory P. Smith
Feature or enhancement
Proposal:
It seems, all CI jobs run tests with
--enable-big-digits=30configure option (i.e. default). Other possible case (=15 bits) is not tested. Maybe there is some build bot, but it's not obvious which one ;-)See #30306 (comment) Nowadays I don't see Gentoo bots and it seems that "Github Actions: Test / Windows (x86)" is using 30-bit digits, e.g. https://github.com/python/cpython/actions/runs/17363314372/job/49286316737. See #138496 (tests actions and build bots)
From prior discussion in #89732 it seems that 15-bit case does make sense for 32-bit machines, but it's not the situation right now: 30-bit is unconditional default.
Lets at least test this case in Github Actions, if it's supported!
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs