cpython
cpython copied to clipboard
gh-118750: Asymptotically faster `int(string)`
Adding new, but unsued, _dec_str_to_int_inner()
, + discussion.
- Issue: gh-118750
Skip news?
Skip news?
Premature, I think. It's possible that a later version may become actively used.
We only need a news entry for user facing changes. When the faster integer conversion is eventually implemented, you'll be credited.
Yes, I understand that. I'm saying that it's possible this will become a "user-facing" change soon. I already have a newer version (not yet checked in) that's much better. Mucking with labels is, IMO, a minor waste of time at this point.
Sorry, I'm just trying to help. I thought you didn't mean in the near future.
No problem! Things change: I originally thought this was far from being ready, but that's been changing rapidly.
A cute mystery: I noticed that converting a string representing an int a little smaller than a power of 256 took about 3x longer than one a little larger than that power. Turns out there's "a reason" for that: in the latter case, the n
inner()
sees is frequently 0, so it cuts back to a mere 8 digits of precision to compute the integer quotient. In the former case, n
is usually chock full o' 1 bits, so the precision is only cut in half.
only have some questions about possible rounding errors. It may be that the code works for relatively small numbers (millions of digits), but fails for every millionth of qudrillion-digit numbers, for which we cannot realistically test
The underlying error analysis doesn't care how many bytes are needed. FP error analysis is all about what happens at the low-order digits, and it doesn't matter to that how many digits precede them.
Nevertheless, the latest code punts if the number of bytes needed requires at least 43 bits to express, but that's to guard against a horrid msth.log()
implementation. Strings longer than about 21 trillion digits will be rejected. That, to my eyes, will never be "a real" limitation.
I do not understand your last change, but I think that ValueError is better than AssertionError. Or maybe OverflowError or RuntimeError are more suitable?
ValueError
is off base, and ditto OverflowError
: the user did nothing "wrong". The user had nothing to do with this. RuntimeError
would make sense - but since I expect it will never happen, it's hard to get motivated for more code churn :wink:.
I meant the error raised for more than 43-bit w
.
I meant the error raised for more than 43-bit
w
.
You said "ValueError is better than AssertionError", so I looked for asserts :wink:.
RuntimeError
is right out. That's for internal Python errors in a release build. I followed the pattern established here:
>>> x = int("9" * 100000)
Traceback (most recent call last):
...
ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 100000 digits; use sys.set_int_max_str_digits() to increase the limit
So people passing strings "too long" to convert expect ValueError
now.
I do not understand your last change
In any "reasonable" libm
, len(s) * _LOG_10_BASE_256
will vary from the infinitely precise result by no more than, say, 15 ULP. Modern versions by far less than that. A sloppy libm
may be off by 5 ULP in log(10)
, and another 5 in log(256)
; then modern HW is off by no more than 0.5 ULP each in the division and multiply.
15 ULP means the last 4 bits of the product may be trash (which may indirectly propagate to higher-order bits via rounding propagation). If the integer part of the product takes at least 43 bits, that + 4 trash bits adds to at least 47 bits, leaving no more than 53-47 = 6 "good" fraction bits in an IEEE double. Which is still plenty for the computation to be reliable (off by no more than 1 after truncating).
The test is catering to the possibility of truly horrid libm
's, far worse than any I know about.
Nobody is going to pass 21-trillion digit strings anyway.
FYI, on Windows, the result of math.log(10, 256)
is 0.63 ULP away from the infinitely precise result.
And the best possible result differs in the last bit, from which it follows it's 1 - 0.63 = 0.37 ULP from the infinitely precise result.
In any case, I changed the code to use the best possible result.
Thanks for the good questions, @serhiy-storchaka! You provoked me into a far deeper understanding of the fine points than I was willing to settle for.
I have nothing else here significant in mind. Various tests continue to run; e.g., so far I've been unable to provoke a more-than-1-correction case at GUARD=3
(which analysis said would be good enough regardless of input size).
BTW, after repairing (again!) the reciprocal approximations, I see it need a correction in fewer than 1 in 200 thousand cases now. The correction step is relatively cheap, so I'd be happy if it triggered more often. Which could happen if the default GUARD
was reduced (it's still 8). But "why bother?" has ruled that internal debate so far.
So that's the kind of pointless pondering I've been reduced to 🤣
Is there anything known about the complexity of the new method?
All methods inherit the asymptotics of bigint multiplication. The current method is throttled by CPython's Karatsuba multiplication. The exponent is log2(3)
, due to that Karatsuba cleverly expresses a product as a combination of 3 half-width products. Double the input sizes, and schoolbook *
takes 4 times longer; Karatsuba only 3x.
decimal
implements Karatsuba too, but has a much fancier scheme beyond that. based on the Number Theoretic Transform (Google for NTT). It's related to Fourier transforms. I don't know any details about this specific implementation, so can't give its asymptotics. Implementations are all over the map. "Naive NTT" is quadratic time, but the most sophisticated versions claim to be O(n log n)
. From timing and some knowledge of its author, I'm sure this implementation is quite good indeed.
Anyone want to do work for some easy glory? :wink:.
I'm pretty much burned out on this, but there is what appears to be a high-value path left to pursue: as noted at the end of the comments, after changing to split on ceiling(w/2)
, nothing in any of the proofs depends on the output base (256) anymore.
So, for example, we could change the output base to 256**2
, or 256**3
, or ... Very little code needs to change (about 4 lines). I just tried output base 256**256
with no problems.
It doesn't change the asymptotics, but starts yielding speedups at lower values. For example, on my box is starts getting faster at about 2M digits (base 256**256
) instead of at 3.3M (base 256
). That's a big improvement. It comes from making the recursion tree shallower - the entire input is effectively pulled apart at each level.
Note: if you try this, the test that the function complains if passed an absurdly large input will appear to hang - comment it out for now.
It comes from making the recursion tree shallower
Or not 😦 . That's why I'm burning out - every step raises more questions.
What may actually be going on: I didn't reduce BYTELIM
in my quick experiment. So CPython's int(str)
was used to convert much longer strings than intended by inner()
. But those can be big enough to use the existing Karatsuba int(str)
, much faster than CPython's native int(str)
.
Whatever, I'm too weary of fighting with this to nail it. So it's up to you :smile:.
:robot: New build scheduled with the buildbot fleet by @tim-one for commit 6c634c713801ccae7f70cd031caf85428b17d50b :robot:
If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.
:warning::warning::warning: Buildbot failure :warning::warning::warning:
Hi! The buildbot wasm32-wasi Non-Debug 3.x has failed when building commit ecd8664f11298a1a4f7428363c55ad2904c9f279.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1374/builds/1165) and take a look at the build logs.
- Check if the failure is related to this commit (ecd8664f11298a1a4f7428363c55ad2904c9f279) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/all/#builders/1374/builds/1165
Failed tests:
- test_int
Summary of the results of the build (if available):
==
Click to see traceback logs
remote: Enumerating objects: 20, done.
remote: Counting objects: 5% (1/20)
remote: Counting objects: 10% (2/20)
remote: Counting objects: 15% (3/20)
remote: Counting objects: 20% (4/20)
remote: Counting objects: 25% (5/20)
remote: Counting objects: 30% (6/20)
remote: Counting objects: 35% (7/20)
remote: Counting objects: 40% (8/20)
remote: Counting objects: 45% (9/20)
remote: Counting objects: 50% (10/20)
remote: Counting objects: 55% (11/20)
remote: Counting objects: 60% (12/20)
remote: Counting objects: 65% (13/20)
remote: Counting objects: 70% (14/20)
remote: Counting objects: 75% (15/20)
remote: Counting objects: 80% (16/20)
remote: Counting objects: 85% (17/20)
remote: Counting objects: 90% (18/20)
remote: Counting objects: 95% (19/20)
remote: Counting objects: 100% (20/20)
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 9% (1/11)
remote: Compressing objects: 18% (2/11)
remote: Compressing objects: 27% (3/11)
remote: Compressing objects: 36% (4/11)
remote: Compressing objects: 45% (5/11)
remote: Compressing objects: 54% (6/11)
remote: Compressing objects: 63% (7/11)
remote: Compressing objects: 72% (8/11)
remote: Compressing objects: 81% (9/11)
remote: Compressing objects: 90% (10/11)
remote: Compressing objects: 100% (11/11)
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 8), reused 1 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'ecd8664f11298a1a4f7428363c55ad2904c9f279'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at ecd8664f11 gh-118750: Asymptotically faster `int(string)` (#118751)
Switched to and reset branch 'main'
configure: WARNING: no system libmpdecimal found; unable to build _decimal
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: no system libmpdecimal found; unable to build _decimal
../../Python/import.c:1620:1: warning: unused function 'is_core_module' [-Wunused-function]
1620 | is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
| ^~~~~~~~~~~~~~
1 warning generated.
../../Python/pystate.c:1135:1: warning: unused function 'check_interpreter_whence' [-Wunused-function]
1135 | check_interpreter_whence(long whence)
| ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
130 | # define htole32(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
43 | #define htole32(x) (uint32_t)(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
131 | # define le32toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
44 | #define le32toh(x) (uint32_t)(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
132 | # define htobe32(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
37 | #define htobe32(x) __bswap32(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
138 | # define be32toh(x) (htobe32((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
38 | #define be32toh(x) __bswap32(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
140 | # define htole64(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
45 | #define htole64(x) (uint64_t)(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
141 | # define le64toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
46 | #define le64toh(x) (uint64_t)(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
142 | # define htobe64(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
39 | #define htobe64(x) __bswap64(x)
| ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
149 | # define be64toh(x) (htobe64((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
40 | #define be64toh(x) __bswap64(x)
| ^
8 warnings generated.
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
130 | # define htole32(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
43 | #define htole32(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
131 | # define le32toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
44 | #define le32toh(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
132 | # define htobe32(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
37 | #define htobe32(x) __bswap32(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
138 | # define be32toh(x) (htobe32((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
38 | #define be32toh(x) __bswap32(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
140 | # define htole64(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
45 | #define htole64(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
141 | # define le64toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
46 | #define le64toh(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
142 | # define htobe64(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
39 | #define htobe64(x) __bswap64(x)
| ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
149 | # define be64toh(x) (htobe64((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
40 | #define be64toh(x) __bswap64(x)
| ^
8 warnings generated.
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
130 | # define htole32(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
43 | #define htole32(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
131 | # define le32toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
44 | #define le32toh(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
132 | # define htobe32(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
37 | #define htobe32(x) __bswap32(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
138 | # define be32toh(x) (htobe32((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
38 | #define be32toh(x) __bswap32(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
140 | # define htole64(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
45 | #define htole64(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
141 | # define le64toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
46 | #define le64toh(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
142 | # define htobe64(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
39 | #define htobe64(x) __bswap64(x)
| ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
149 | # define be64toh(x) (htobe64((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
40 | #define be64toh(x) __bswap64(x)
| ^
8 warnings generated.
../../Modules/expat/xmlparse.c:7839:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
7838 | " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%d, xmlparse.c:%d) %*s\"",
| ~~~~~~~~~~~~~~~~~~~~~~~~
7839 | bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
| ^~~~~~~~~
1 warning generated.
../../Modules/_testinternalcapi/test_critical_sections.c:142:1: warning: unused function 'thread_critical_sections' [-Wunused-function]
142 | thread_critical_sections(void *arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
../../Modules/posixmodule.c:7847:1: warning: unused function 'warn_about_fork_with_threads' [-Wunused-function]
7847 | warn_about_fork_with_threads(const char* name)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
cat: pybuilddir.txt: No such file or directory
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
130 | # define htole32(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
43 | #define htole32(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
131 | # define le32toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
44 | #define le32toh(x) (uint32_t)(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
132 | # define htobe32(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
37 | #define htobe32(x) __bswap32(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
138 | # define be32toh(x) (htobe32((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
38 | #define be32toh(x) __bswap32(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
140 | # define htole64(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
45 | #define htole64(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
141 | # define le64toh(x) (x)
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
46 | #define le64toh(x) (uint64_t)(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
142 | # define htobe64(x) \
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
39 | #define htobe64(x) __bswap64(x)
| ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
149 | # define be64toh(x) (htobe64((x)))
| ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
40 | #define be64toh(x) __bswap64(x)
| ^
8 warnings generated.
Kill <WorkerThread #2 running test=test_int pid=3260082 time=25 min> process group
make: *** [Makefile:2206: buildbottest] Error 2
Cannot open file '/home/buildbot/buildarea/3.x.bcannon-wasi.wasi.nondebug/build/build/build_oot/host/test-results.xml' for upload
:warning::warning::warning: Buildbot failure :warning::warning::warning:
Hi! The buildbot iOS ARM64 Simulator 3.x has failed when building commit ecd8664f11298a1a4f7428363c55ad2904c9f279.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1380/builds/342) and take a look at the build logs.
- Check if the failure is related to this commit (ecd8664f11298a1a4f7428363c55ad2904c9f279) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/all/#builders/1380/builds/342
Summary of the results of the build (if available):
Click to see traceback logs
remote: Enumerating objects: 20, done.
remote: Counting objects: 5% (1/20)
remote: Counting objects: 10% (2/20)
remote: Counting objects: 15% (3/20)
remote: Counting objects: 20% (4/20)
remote: Counting objects: 25% (5/20)
remote: Counting objects: 30% (6/20)
remote: Counting objects: 35% (7/20)
remote: Counting objects: 40% (8/20)
remote: Counting objects: 45% (9/20)
remote: Counting objects: 50% (10/20)
remote: Counting objects: 55% (11/20)
remote: Counting objects: 60% (12/20)
remote: Counting objects: 65% (13/20)
remote: Counting objects: 70% (14/20)
remote: Counting objects: 75% (15/20)
remote: Counting objects: 80% (16/20)
remote: Counting objects: 85% (17/20)
remote: Counting objects: 90% (18/20)
remote: Counting objects: 95% (19/20)
remote: Counting objects: 100% (20/20)
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 9% (1/11)
remote: Compressing objects: 18% (2/11)
remote: Compressing objects: 27% (3/11)
remote: Compressing objects: 36% (4/11)
remote: Compressing objects: 45% (5/11)
remote: Compressing objects: 54% (6/11)
remote: Compressing objects: 63% (7/11)
remote: Compressing objects: 72% (8/11)
remote: Compressing objects: 81% (9/11)
remote: Compressing objects: 90% (10/11)
remote: Compressing objects: 100% (11/11)
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 8), reused 0 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'ecd8664f11298a1a4f7428363c55ad2904c9f279'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at ecd8664f11 gh-118750: Asymptotically faster `int(string)` (#118751)
Switched to and reset branch 'main'
configure: WARNING: no system libmpdecimal found; unable to build _decimal
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
../../Python/import.c:1620:1: warning: unused function 'is_core_module' [-Wunused-function]
is_core_module(PyInterpreterState *interp, PyObject *name, PyObject *path)
^
1 warning generated.
../../Python/pystate.c:1135:1: warning: unused function 'check_interpreter_whence' [-Wunused-function]
check_interpreter_whence(long whence)
^
1 warning generated.
configure: WARNING: no system libmpdecimal found; unable to build _decimal
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
../../Modules/_sqlite/connection.c:1307:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 12.0.0
SQLITE_API int sqlite3_create_window_function(
^
../../Modules/_sqlite/connection.c:1307:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/_sqlite/connection.c:1315:14: warning: 'sqlite3_create_window_function' is only available on iOS 13.0 or newer [-Wunguarded-availability-new]
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/include/sqlite3.h:5533:16: note: 'sqlite3_create_window_function' has been marked as being introduced in iOS 13.0 here, but the deployment target is iOS 12.0.0
SQLITE_API int sqlite3_create_window_function(
^
../../Modules/_sqlite/connection.c:1315:14: note: enclose 'sqlite3_create_window_function' in a __builtin_available check to silence this warning
rc = sqlite3_create_window_function(self->db, name, num_params, flags,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:5F7D319D-935D-4CEE-9B0F-D3FF2CA2B94F, OS:17.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:5F7D319D-935D-4CEE-9B0F-D3FF2CA2B94F, OS:17.4, name:iPhone SE (3rd generation) }
make: *** [testios] Terminated: 15
** BUILD INTERRUPTED **
Dear Lord, buildbots can be annoying :wink:.
It's hard to be sure of things digging through the mountains of text files they save. Best guess is the failing boxes do not build the C _decimal
module, so mostly (always?) time out running test_int
. I took my best guess at that and changed the tests most likely to time out then to not run at all unless _decimal
is available, and checked that in.
But most of the buildbots that failed are just sitting there, apparently doing nothing, and trying to "force" a new run just says the request is queued - but not running it.
Just 3 of these buildbots appeared to wake up and actually run again after that commit. Their tests all passed.
So my best guess is that the problem is fixed. But no way yet to be sure.