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-113464: Add a warning when building the JIT by brandtbucher · Pull Request #118481 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented May 1, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

PEP 744 makes a bunch of promises once "the JIT builds successfully without displaying warnings to the user". We don't currently do that... so we should.

This PR adds a small banner during JIT builds reminding the user that JIT support for their platform is still experimental, and asking them to report any bugs. This banner is on by default, but can be disabled per-target as they become stable.

This PR also includes a few mostly-cosmetic changes to appease mypy, black, and pylint. They're in separate commits, so they're easier to review.

  • Issue: JIT Compilation #113464

Sorry, something went wrong.

Uh oh!

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

All reactions
brandtbucher added 2 commits May 1, 2024 09:35
@brandtbucher
Warn when building the JIT for an experimental platform
30c64db
@brandtbucher
Linting, type-checking, and formatting
b97473f
@brandtbucher brandtbucher added skip news build The build process and cross-build labels May 1, 2024
@brandtbucher brandtbucher self-assigned this May 1, 2024
@bedevere-app bedevere-app Bot added the awaiting core review label May 1, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 1, 2024
JIT Compilation #113464
Closed
@brandtbucher

brandtbucher commented May 1, 2024

Copy link
Copy Markdown
Member Author
==========================================================
JIT support for x86_64-pc-linux-gnu is still experimental!
         Please report any issues you encounter.          
==========================================================
All reactions

Sorry, something went wrong.

Uh oh!

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

savannahostrowski
savannahostrowski approved these changes May 1, 2024
View reviewed changes

@savannahostrowski savannahostrowski 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.

LGTM! Though, I do wonder if it's worth adding commit rules or similar to catch formatting issues? Would be nice to just have this tackled automagically?

Sorry, something went wrong.

Uh oh!

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

All reactions
@brandtbucher

brandtbucher commented May 1, 2024

Copy link
Copy Markdown
Member Author

Though, I do wonder if it's worth adding commit rules or similar to catch formatting issues? Would be nice to just have this tackled automagically?

Agreed.

There's already a mypy job that runs over these files as part of CI. It was easy to add since it already existed for other parts of the codebase. Adding black and pylint would mean actually doing some work and adding new jobs, which I wasn't up for at the time (plus they tend to be more "style" than "correctness", so they feel less important).

savannahostrowski 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.

@hugovk

hugovk commented May 1, 2024

Copy link
Copy Markdown
Member

Adding black and pylint would mean actually doing some work and adding new jobs, which I wasn't up for at the time

They can be added in .pre-commit-config.yaml. Make sure to set files: so it only runs on JIT code.

We can add Black to pre-commit (after the Ruff config) like:

  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 24.4.2
    hooks:
      - id: black
    files: TODO

We can run pylint via the existing Ruff by selecting the PL rules in a local .ruff.toml in the JIT directory, then add that to the pre-commit config. You can compare the Lib/test and Argument Clinic ones which also have their own .ruff.toml.

(cc @AlexWaygood FYI)

(plus they tend to be more "style" than "correctness", so they feel less important)

(Yeah, I usually only run pylint occasionally and don't in CI because it's quite noisy, but if you've resolved them and want to maintain that, I recommend doing it this way.)

brandtbucher, savannahostrowski, and AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

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

@savannahostrowski

savannahostrowski commented May 1, 2024

Copy link
Copy Markdown
Member

@brandtbucher If you think that'd be nice, I can take a look at adding a job to do this in .pre-commit-config.yaml for JIT files.

brandtbucher 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.

@brandtbucher

brandtbucher commented May 1, 2024

Copy link
Copy Markdown
Member Author

That would be great, yeah. I'm not picky about the set of rules itself, so if the defaults pass then we can just use those.

savannahostrowski reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@savannahostrowski savannahostrowski mentioned this pull request May 1, 2024
Add linting job to .pre-commit-config.yaml for JIT files #118487
Closed
@brandtbucher
brandtbucher enabled auto-merge (squash) May 1, 2024 20:01
@brandtbucher
brandtbucher disabled auto-merge May 1, 2024 20:48
@brandtbucher
brandtbucher enabled auto-merge (squash) May 1, 2024 20:50
@brandtbucher
brandtbucher merged commit 424438b into python:main May 1, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label May 1, 2024
@gvanrossum

gvanrossum commented May 1, 2024

Copy link
Copy Markdown
Member

This banner is printed even when using --enable-experimental-jit=interpreter. That seems wrong?

All reactions

Sorry, something went wrong.

Uh oh!

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

@brandtbucher

brandtbucher commented May 1, 2024

Copy link
Copy Markdown
Member Author

Hm. This script should only be part of the Makefile if we're actually building the JIT. It looks like jit_stencils.h is currently generated if the option is anything other than no currently.

So we should update configure.ac to only build the JIT if the option is yes or yes-off.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented May 1, 2024

Copy link
Copy Markdown
Member

Hm. This script should only be part of the Makefile if we're actually building the JIT. It looks like jit_stencils.h is currently generated if the option is anything other than no currently.

So we should update configure.ac to only build the JIT if the option is yes or yes-off.

Yeah, I'm on it.

All reactions

Sorry, something went wrong.

Uh oh!

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

@brandtbucher

brandtbucher commented May 1, 2024

Copy link
Copy Markdown
Member Author

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@brandtbucher @SonicField
pythonGH-113464: Display a warning when building the JIT (pythonGH-11…
8d6eeda
…8481)
@brandtbucher brandtbucher added the topic-JIT label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@savannahostrowski savannahostrowski savannahostrowski approved these changes

Uh oh!

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

Assignees

@brandtbucher brandtbucher

Labels

build The build process and cross-build skip news topic-JIT

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.

4 participants

@brandtbucher @hugovk @savannahostrowski @gvanrossum
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.