FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-133171: Re-enable JUMP_BACKWARD to free-threading build by corona10 · Pull Request #137800 · python/cpython · GitHub

Repository navigation

gh-133171: Re-enable JUMP_BACKWARD to free-threading build - #137800

Merged
corona10 merged 6 commits into
python:mainfrom
corona10:gh-133171-JUMP_BACKWARD
Sep 24, 2025
Merged

corona10 merged 6 commits into
python:mainfrom
corona10:gh-133171-JUMP_BACKWARD

Conversation

corona10 commented Aug 15, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

@savannahostrowski @diegorusso @Fidget-Spinner @brandtbucher

To the JIT team — I’m not sure who’s currently working on this, but it might be a good starting point to add JIT support. My next goal will be to make the tier-two instructions thread-safe.

Copy link
Copy Markdown
Member

I think we should start by running the tests in CI for JIT+FT current build and see what passes/fails before doing this

corona10 commented Aug 15, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

I think we should start by running the tests in CI for JIT+FT current build and see what passes/fails before doing this

We disabled FT + JIT build from #133179 do you think that we have to listing the current status?
Could we separate this task into making the tier 2 interpreter thread-safe (with optimizer disabled) and the optimizer thread-safe?

Copy link
Copy Markdown
Member

Could we separate this task into making the tier 2 interpreter thread-safe (with optimizer disabled) and the optimizer thread-safe?

This makes sense but actually the default build's JIT can't even run with the optimizer turned off! There's some segfaults when we turn off the optimizer lol.

Copy link
Copy Markdown
Member Author

This makes sense but actually the default build's JIT can't even run with the optimizer turned off! There's some segfaults when we turn off the optimizer lol.

How can I trigger this?

Copy link
Copy Markdown
Member

This makes sense but actually the default build's JIT can't even run with the optimizer turned off! There's some segfaults when we turn off the optimizer lol.

How can I trigger this?

Run the test suite with PYTHON_UOPS_OPTIMIZE=0 env var.

Copy link
Copy Markdown
Member Author

Run the test suite with PYTHON_UOPS_OPTIMIZE=0 env var.

Just for the record at default build:
PYTHON_UOPS_OPTIMIZE=0 ./python.exe -m test -j8

39 tests failed:
    test.test_asyncio.test_pep492
    test.test_multiprocessing_forkserver.test_processes
    test.test_multiprocessing_spawn.test_processes test_array test_bdb
    test_buffer test_code test_codecmaps_cn test_codecmaps_hk
    test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw
    test_collections test_complex test_datetime test_embed test_float
    test_htmlparser test_idle test_import test_json test_long
    test_math test_patma test_peepholer test_pickle test_pow
    test_random test_scope test_slice test_ssl test_struct
    test_sys_settrace test_tarfile test_threading test_time test_trace
    test_zipimport_support test_zoneinfo

This comment has been minimized.

Copy link
Copy Markdown
Member Author

Ah never mind, it need to be transformed tier 2 code first.

corona10 added a commit to corona10/cpython that referenced this pull request Aug 27, 2025
corona10 added a commit to corona10/cpython that referenced this pull request Aug 27, 2025
corona10 force-pushed the gh-133171-JUMP_BACKWARD branch from d855944 to d470ce9 Compare September 18, 2025 08:51

corona10 commented Sep 18, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

@Fidget-Spinner @brandtbucher I noticed that JIT x FT still doesn’t build even with the entire optimizer path disabled, so fix it temporarily. I’ve added a direct fallback to Tier 1; it’s slow, but fine for now. Let’s re-enable _PyOptimizer_Optimize step by step. To do that, we also need to re-enable CI (just for build testing)

corona10 requested a review from colesbury September 18, 2025 10:28

Copy link
Copy Markdown
Member Author

cc @savannahostrowski Once this PR is merged, others can start collaborating on the full FT x JIT work separately.

static inline int
PyStackRef_RefcountOnObject(_PyStackRef ref)
{
return (ref.bits & Py_TAG_REFCNT) == 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this implementation is fine, but I'm not 100% sure

Copy link
Copy Markdown
Member Author

If there are no major objections to this PR, I am going to merge this PR (maybe next week)

}

static inline int
PyStackRef_RefcountOnObject(_PyStackRef ref)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just personal interest, correct me if I'm wrong.

It seems we don;t call this function yet right? Is this prepared for a future hook?

This function seems be trigger at

  1. PyStackRef_XCLOSE
  2. PyStackRef_CLOSE_SPECIALIZED
  3. PyStackRef_CLOSE
  4. PyStackRef_DUP

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It seems we don;t call this function yet right? Is this prepared for a future hook?

Yeah correct, but we can't build if this function is not added. That's all at this moment.

corona10 merged commit c4f21d7 into python:main Sep 24, 2025
75 of 76 checks passed
corona10 deleted the gh-133171-JUMP_BACKWARD branch October 4, 2025 07:25
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL