Skip to content

Test 15-bit digit case for PyLong's in CI? #138336

Description

@skirpichev

Feature or enhancement

Proposal:

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 ;-)

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

Activity

  1. added
    infraCI, GitHub Actions, buildbots, Dependabot, etc.
    on Sep 1, 2025
  2. 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
  3. added a commit that references this issue on Sep 4, 2025
  4. vstinner commented on Sep 4, 2025

    @vstinner
    Member

    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?

  5. skirpichev commented on Sep 4, 2025

    @skirpichev
    MemberAuthor

    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?

  6. skirpichev commented on Sep 7, 2025

    @skirpichev
    MemberAuthor

    It looks for me, that merged #30497 rather contradicts to outcome of discussion in #89732.

    CC @mdickinson, @markshannon

  7. vstinner commented on Sep 8, 2025

    @vstinner
    Member

    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.

  8. self-assigned this
    on Sep 12, 2025
  9. gpshead commented on Sep 14, 2025

    @gpshead
    Member

    A buildbot with --enable-big-digits=15 would 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.

  10. skirpichev commented on Sep 15, 2025

    @skirpichev
    MemberAuthor

    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.

  11. skirpichev commented on Oct 1, 2025

    @skirpichev
    MemberAuthor

    @vstinner do you agree with moving this to buildmaster-config?

  12. vstinner commented on Oct 1, 2025

    @vstinner
    Member

    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?

  13. skirpichev commented on Oct 3, 2025

    @skirpichev
    MemberAuthor

    Well, there are two opinions:

    1. "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
    2. "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.)

  14. vstinner commented on Oct 3, 2025

    @vstinner
    Member

    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 -m32 to 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.

  15. gpshead commented on Oct 3, 2025

    @gpshead
    Member

    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.

  16. vstinner commented on Oct 14, 2025

    @vstinner
    Member

    "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

    @gpshead: What do you think of using --enable-big-digits=15 on your 32-bit buildbot builder?

  17. skirpichev commented on Dec 13, 2025

    @skirpichev
    MemberAuthor

    It seems no one liked new CI job proposal. So, I'm closing this in favor of python/buildmaster-config#649.

  18. removed their assignment
    on Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCI, GitHub Actions, buildbots, Dependabot, etc.testsTests in the Lib/test dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions