gh-145064: fix JIT tracing for non-function frames#145078
Closed
aviralgarg05 wants to merge 1 commit intopython:mainfrom
Closed
gh-145064: fix JIT tracing for non-function frames#145078aviralgarg05 wants to merge 1 commit intopython:mainfrom
aviralgarg05 wants to merge 1 commit intopython:mainfrom
Conversation
Member
|
Did you use an LLM to generate this? That's fine if so, but please look at the devguide on this https://devguide.python.org/getting-started/generative-ai/ I don't know which model you're using, but the test is wrong, and the explanation is wrong, and the fix is also probably wrong. Sorry but I'm closing this issue to not waste reviewer time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
co != NULLassertion failure in*_Py_uop_frame_new#145064 JIT:co != NULLassertion failure in*_Py_uop_frame_new#145064 where tracing could start from non-function frames (for example init-cleanup shim frames), which could lead to invalid assumptions about function/code availability./Users/aviralgarg/Everything/cpython/Python/optimizer.c:initial_state.funconly whenframe->f_funcobjis a realPyFunctionObject.initial_state.code(always required) instead of assuminginitial_state.funcis always present./Users/aviralgarg/Everything/cpython/Python/optimizer_analysis.c:initial_state.codedirectly when creating the abstract frame.frame->funcoptional and null-safe./Users/aviralgarg/Everything/cpython/Lib/test/test_capi/test_opt.py:test_145064./Users/aviralgarg/Everything/cpython/Misc/NEWS.d/next/Core_and_Builtins/2026-02-21-18-10-00.gh-issue-145064.p8Nq2v.rstTesting Logs
Local build and checks
/tmp/cpython-build-145064make -j8(successful)make patchcheck(completed; local output also noted expected environment state and prompted about test/refleak confirmation)Targeted regression tests
./python.exe -m test -j1 -v test_capi.test_opt --match test_145064OK(run repeatedly, all passes)Related JIT regression tests
./python.exe -m test -j1 -v test_capi.test_opt --match test_143026→OK./python.exe -m test -j1 -v test_capi.test_opt --match test_143092→OK./python.exe -m test -j1 -v test_capi.test_opt --match test_143183→OK./python.exe -m test -j1 -v test_capi.test_opt --match test_143358→OK./python.exe -m test -j1 -v test_capi.test_opt --match test_144068_daemon_thread_jit_cleanup→OK./python.exe -m test -j1 -v test_optimizer→OKReproduction-command stress validation (issue command)
PYTHON_JIT=1 ./python.exe -m mypy --no-incremental --strict -c "pass"PASS batch=1,PASS batch=2,PASS batch=3PASS:25CI status observed after push
gh-145064-jit-co-null-uop-frame29faba9f94Lintworkflow:successJITworkflow: in progress during observation (no failures reported at the time)