GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-126204: Add a `sys._jit_enabled` helper by Eclips4 · Pull Request #126247 · python/cpython

Conversation

@Eclips4

@Eclips4 Eclips4 commented Oct 31, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Add a Py_JIT_ENABLED variable to pyconfig.h #126204

📚 Documentation preview 📚: https://cpython-previews--126247.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Eclips4 added 13 commits October 31, 2024 14:28
@Eclips4
Add Py_JIT_ENABLED variable to pyconfig.h
43740f7
@Eclips4
Changes for Windows build
65e6cfa
@Eclips4
fix typo
718b21e
@Eclips4
Another changes for Windows build
f4f1748
@Eclips4
Update _sysconfig.c
20d51dc
@Eclips4
Don't set Py_JIT_ENABLED to 1 if --enable-experimental-jit=no
a3e6dda
@Eclips4
Fixes for Windows build..
40c001c
@Eclips4
Set Py_JIT_ENABLED to 2 insetad of 'interpreter'
81994a9
@Eclips4
PyLong_FromInt -> PyLong_FromLong
1618433
@Eclips4
Fix typo in pyconfigs
1773d9e
@Eclips4
Add a NEWS entry
9a50db7
@Eclips4
Update documentation
4b4e212
@Eclips4
Fix typo
19ddff2
@Eclips4
Eclips4 requested a review from brandtbucher October 31, 2024 16:01
@Eclips4
Eclips4 requested review from a team, FFY00, corona10 and erlend-aasland as code owners October 31, 2024 16:01
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 31, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Oct 31, 2024
Add a Py_JIT_ENABLED variable to pyconfig.h #126204
Closed
@Eclips4
Eclips4 marked this pull request as draft October 31, 2024 16:02
@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 31, 2024
Eclips4 added 4 commits October 31, 2024 18:06
@Eclips4
Move NEWS entry
91b7a78
@Eclips4
Fix typo in path
e79e0df
@Eclips4
Fix doc formatting
759321b
@Eclips4
Fix configure
49e4fdc
@Eclips4
Eclips4 marked this pull request as ready for review October 31, 2024 16:49
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 31, 2024
zooba
zooba requested changes Oct 31, 2024
View reviewed changes

@zooba zooba left a comment

Copy link
Copy Markdown
Member

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'm not convinced that pyconfig.h is the right home for this - it seems like just pulling it from sysconfig is sufficient.

I'd rather not take the changes in the PC/PCbuild directories if we don't have to.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 31, 2024
Eclips4 added 5 commits November 5, 2024 05:09
@Eclips4
Revert other part of previous changes
c83ea49
@Eclips4
Merge branch 'main' into add-py-jit
1dec18a
@Eclips4
Add sys._jit_enabled
02d1f60
@Eclips4
Add a NEWS entry
a9c5b41
@Eclips4
Fix typo
5423c71
Eclips4
Eclips4 commented Nov 10, 2024
View reviewed changes
Comment thread Lib/test/test_embed.py
Comment on lines -1785 to -1788
# Temporarily enable ignore_stderr=True to ignore warnings on JIT builds
# See gh-126255 for more information
self.check_all_configs("test_initconfig_api", config, preconfig,
api=API_ISOLATED, ignore_stderr=True)

@Eclips4 Eclips4 Nov 10, 2024

Copy link
Copy Markdown
Member Author

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.

That's fun. Due to incorrect assumptions, where JIT is actually enabled or not, this hack is no longer needed. Just setting PYTHON_JIT=0 is enough here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Eclips4
Eclips4 requested a review from pablogsal November 10, 2024 03:24
@Eclips4
Eclips4 marked this pull request as ready for review November 10, 2024 03:24
@Eclips4
Eclips4 requested a review from ericsnowcurrently as a code owner November 10, 2024 03:24
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 10, 2024
@Eclips4 Eclips4 changed the title gh-126204: Add a Py_JIT_ENABLED variable to pyconfig.h gh-126204: Add a sys._jit_enabled helper Nov 10, 2024
picnixz
picnixz reviewed Nov 10, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2024-11-10-04-59-43.gh-issue-126204.ASKDL1.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Eclips4 and others added 2 commits November 10, 2024 17:26
@Eclips4 @picnixz
Apply suggestions from code review
49336ab
Co-authored-by: Bénédikt Tran <[email protected]>
@Eclips4
Add documentation for sys._jit_enabled and what's new entry.
67123ee
@Eclips4
Eclips4 requested a review from picnixz November 10, 2024 15:34
@Eclips4
availability only works for platforms :(
4ddcd62
picnixz
picnixz reviewed Nov 10, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/sys.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Eclips4 and others added 3 commits November 10, 2024 18:20
@Eclips4 @picnixz
Apply suggestions from code review
aa8f5bb
Co-authored-by: Bénédikt Tran <[email protected]>
@Eclips4
Align indentation
0b5bce8
@Eclips4
Remove unnecessary check
0ffcd9f
picnixz
picnixz reviewed Nov 10, 2024
View reviewed changes
Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4 @picnixz
Update Python/pylifecycle.c
b6c097b
Co-authored-by: Bénédikt Tran <[email protected]>
picnixz
picnixz reviewed Nov 10, 2024
View reviewed changes

@picnixz picnixz left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

A final nitpick. And a question: is there a lot of

_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
	Py_DECREF(optimizer);
	...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4 @picnixz
Update Python/sysmodule.c
b4dc9dc
Co-authored-by: Bénédikt Tran <[email protected]>
@Eclips4

Eclips4 commented Nov 11, 2024

Copy link
Copy Markdown
Member Author

A final nitpick. And a question: is there a lot of

_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
	Py_DECREF(optimizer);
	...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

In fact, there are only two uses of _Py_GetOptimizer. I'm not sure if we should remove this usage in this PR.

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Nov 11, 2024
View reviewed changes
Comment thread Python/pylifecycle.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4
Fix reference leak in error path
46a4a7f
@Eclips4
Eclips4 requested a review from zooba November 13, 2024 20:56
@Eclips4

Eclips4 commented Jan 30, 2025

Copy link
Copy Markdown
Member Author

Superseded by #129194

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4 Eclips4 closed this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@brandtbucher brandtbucher Awaiting requested review from brandtbucher
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland
@corona10 corona10 Awaiting requested review from corona10
@pablogsal pablogsal Awaiting requested review from pablogsal
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@zooba zooba Awaiting requested review from zooba

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Eclips4 @zooba @picnixz
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.