-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit #142455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e files in Tools/jit The order of filenames provided by os.walk is filesystem-dependent. Different filesystems return the files in a different order, hence invalidating the digest. Keeping everything sorted makes the digest deterministic. Fixes python#142454
Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst
Outdated
Show resolved
Hide resolved
…4.cqUxzQ.rst Co-authored-by: Ken Jin <kenjin4096@gmail.com>
diegorusso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change makes sense, LGTM. Thanks a lot!
Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst
Outdated
Show resolved
Hide resolved
savannahostrowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change makes sense but it sounded like you only started seeing this issue in 3.15.0a2 in the issue. @hroncok Can you confirm that this worked as expected in 3.15.0a1?
|
I guess this needs to be back ported to 3.14 as well (as specified in the original issue) |
|
Ah, I missed that and was confused by the wording "we have found out that the digest in JIT stencils in 3.15.0a2 differs." Sounded like this was a new issue. The reason I was asking is because I think this bug existing from the very beginning, in 3.13 as well. I bisected and this appears to have always been the case. |
|
Indeed, this is not new in 3.15.0a2. Sorry for the confusing wording. 3.15.0a2 only happens to be the first version we have attempted to build in this build system while asserting the prebuilt stencils match the just built ones. This bug appears to have existed from the very beginning of the _compute_digest function. |
|
Thanks for catching this issue and opening the fix, @hroncok! |
|
Thanks @hroncok for the PR, and @savannahostrowski for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @hroncok and @savannahostrowski, I could not cleanly backport this to |
|
Sorry, @hroncok and @savannahostrowski, I could not cleanly backport this to |
|
Should I open a backport PR? |
|
If you'd like to do it, feel free. Otherwise, I'm happy to handle it! |
|
I am happy to do it but the conflict is because of #138131, which seems safe to backport as well. WDYT? |
|
I think so. I'm kind of surprised that wasn't backported originally, given that the original bug report was for 3.14. I think we could also backport that fix first and then retrigger the backport for this PR, if we want clearer separation of concerns. |
|
I don't have the right to request backports via the labels, but if done in order, it should no longer conflict. |
|
Thanks @hroncok for the PR, and @savannahostrowski for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @hroncok for the PR, and @savannahostrowski for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…e files in Tools/jit (pythonGH-142455) (cherry picked from commit bcf90de) Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
…e files in Tools/jit (pythonGH-142455) (cherry picked from commit bcf90de) Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
|
GH-142484 is a backport of this pull request to the 3.13 branch. |
|
GH-142485 is a backport of this pull request to the 3.14 branch. |
|
Thanks. |
The order of filenames provided by os.walk is filesystem-dependent.
Different filesystems return the files in a different order, hence invalidating the digest.
Keeping everything sorted makes the digest deterministic.
Fixes #142454