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-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths by hoodmane · Pull Request #99461 · python/cpython

Conversation

@hoodmane

@hoodmane hoodmane commented Nov 14, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

@tiran

Would appreciate a backport to 3.11.X. This code has been moved from ceval.c to bytecodes.c since the 3.11.X branch so it doesn't backport cleanly, but I have another patch available for 3.11. If someone tells me how I can make a separate backport PR.

  • Issue: Optimized code paths in ceval / bytecodes need call trampolines for Emscripten #99460

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added the awaiting review label Nov 14, 2022
@bedevere-bot bedevere-bot mentioned this pull request Nov 14, 2022
Optimized code paths in ceval / bytecodes need call trampolines for Emscripten #99460
Closed
@erlend-aasland
erlend-aasland requested review from gvanrossum and markshannon November 14, 2022 10:10
@sobolevn

sobolevn commented Nov 14, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

@hoodmane you can always do manual backports using https://pypi.org/project/cherry_picker/ :)

P.S. looks like you need to run make regen-cases to fix the CI.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented Nov 14, 2022

Copy link
Copy Markdown
Member

The backport can be done manually, just start the PR subject with [3.11] (the rest should be the same).

And yes, please re-run regen-cases and commit Python/generated_cases.c.h.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane
Add trampoline calls to the optimized METH_O and METH_NOARGS call pat…
844b63e
…hs in bytecodes.c
@hoodmane
hoodmane force-pushed the ceval-emscripten-trampolines branch from 2d1cf73 to 844b63e Compare November 14, 2022 21:30
@hoodmane

hoodmane commented Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

Okay updated generated_cases as requested. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane hoodmane mentioned this pull request Nov 15, 2022
Python3.11 pyodide/pyodide#3252
Merged
13 of 15 tasks
gvanrossum
gvanrossum approved these changes Nov 15, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Nov 15, 2022
@gvanrossum gvanrossum added the skip news label Nov 15, 2022
@gvanrossum
gvanrossum merged commit 86a49e0 into python:main Nov 15, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 15, 2022
@bedevere-bot

bedevere-bot commented Nov 15, 2022

Copy link
Copy Markdown

GH-99514 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane

hoodmane commented Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane
hoodmane deleted the ceval-emscripten-trampolines branch November 15, 2022 18:18
@bedevere-bot

bedevere-bot commented Nov 15, 2022

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-emscripten node (pthreads) 3.x has failed when building commit 86a49e0.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1050/builds/845) and take a look at the build logs.
  4. Check if the failure is related to this commit (86a49e0) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1050/builds/845

Failed tests:

  • test___all__

Failed subtests:

  • test_all - test.test___all__.AllTest.test_all

Summary of the results of the build (if available):

== Tests result: FAILURE ==

338 tests OK.

10 slowest tests:

  • test_tokenize: 1 min 3 sec
  • test_unparse: 51.4 sec
  • test_io: 46.1 sec
  • test_lib2to3: 43.2 sec
  • test_capi: 37.0 sec
  • test_unicodedata: 26.9 sec
  • test_zipfile: 24.0 sec
  • test_decimal: 19.4 sec
  • test_pathlib: 17.1 sec
  • test_statistics: 16.5 sec

1 test failed:
test___all__

94 tests skipped:
test__xxsubinterpreters test_asyncgen test_asyncio
test_check_c_globals test_clinic test_cmd_line
test_concurrent_futures test_contextlib_async test_ctypes
test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_doctest
test_docxmlrpc test_dtrace test_embed test_epoll test_faulthandler
test_fcntl test_file_eintr test_fork1 test_ftplib test_gdb
test_grp test_httplib test_httpservers test_idle test_imaplib
test_interpreters test_ioctl test_kqueue test_launcher test_lzma
test_mmap test_msilib test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_nis test_openpty test_ossaudiodev
test_pdb test_peg_generator test_perf_profiler test_poll
test_poplib test_pty test_pwd test_readline test_regrtest
test_repl test_resource test_select test_selectors test_smtplib
test_smtpnet test_socket test_socketserver test_spwd test_ssl
test_stable_abi_ctypes test_startfile test_subprocess
test_sys_settrace test_syslog test_tcl test_telnetlib test_tix
test_tkinter test_tools test_ttk test_ttk_textonly test_turtle
test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet
test_venv test_wait3 test_wait4 test_webbrowser test_winconsoleio
test_winreg test_winsound test_wmi test_wsgiref test_xmlrpc
test_xmlrpc_net test_xxlimited test_zipfile64
test_zipimport_support test_zoneinfo
0:21:14 load avg: 8.20
0:21:14 load avg: 8.20 Re-running failed tests is not supported with --python host runner option.

Total duration: 21 min 14 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test___all__.py", line 129, in test_all
    self.check_all(modname)
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test___all__.py", line 43, in check_all
    with warnings_helper.check_warnings(
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/support/warnings_helper.py", line 185, in _filterwarnings
    raise AssertionError("unhandled warning %s" % reraise[0])
AssertionError: unhandled warning {message : SyntaxWarning("invalid escape sequence '\\('"), category : 'SyntaxWarning', filename : '/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test_enum.py', lineno : 1481, line : None}
All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented Nov 15, 2022

Copy link
Copy Markdown
Member

@hoodmane Do you understand the buildbot failure? It seems related to this PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane

hoodmane commented Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

It looks unrelated to me? It's hard for me to tell but it doesn't look like the -DPY_CALL_TRAMPOLINE compile flag was passed so the trampolines shouldn't be active and hence this change should look like a no-op to that build:

checking LDSHARED... $(CC) -shared
checking BLDSHARED flags... $(CC) -shared
checking CCSHARED... -fPIC
checking LINKFORSHARED... -Xlinker -export-dynamic
checking CFLAGSFORSHARED... 

I think if the trampolines were enabled we would see -DPY_CALL_TRAMPOLINE in one of these places. Is there a place I can see exactly the build bot did?

All reactions

Sorry, something went wrong.

Uh oh!

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

@sobolevn sobolevn mentioned this pull request Nov 15, 2022
Buildbot failure: unhandled warning in test_enum.py #99518
Closed
@sobolevn

sobolevn commented Nov 15, 2022

Copy link
Copy Markdown
Member

I've created #99519 to fix it.

gvanrossum reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@hoodmane

hoodmane commented Nov 16, 2022

Copy link
Copy Markdown
Contributor Author

Thanks @sobolevn! (I'm glad I didn't have to figure out what was going on...)

sobolevn reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

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

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Nov 16, 2022
@CuriousLearner
Merge branch 'main' into fix-issue21914
abd206e
* main: (8272 commits)
  Update Windows readme.txt to clarify Visual Studio required versions (pythonGH-99522)
  pythongh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (python#99461)
  pythongh-92647: [Enum] use final status to determine lookup or create (pythonGH-99500)
  pythongh-81057: Move Globals in Core Code to _PyRuntimeState (pythongh-99496)
  Post 3.12.0a2
  pythongh-99300: Use Py_NewRef() in Python/Python-ast.c (python#99499)
  pythongh-93649: Split pytime and datetime tests from _testcapimodule.c (python#99494)
  pythongh-99370: fix test_zippath_from_non_installed_posix (pythonGH-99483)
  pythonGH-99205: remove `_static` field from `PyThreadState` and `PyInterpreterState` (pythonGH-99385)
  pythongh-81057: Move the Remaining Import State Globals to _PyRuntimeState (pythongh-99488)
  pythongh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (pythonGH-99373)
  pythongh-93649: Split getargs tests from _testcapimodule.c (python#99346)
  pythongh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (pythongh-99487)
  pythonGH-98219: reduce sleep time in `asyncio` subprocess test (python#99464)
  pythonGH-99388: add `loop_factory` parameter to `asyncio.run` (python#99462)
  pythongh-99300: Use Py_NewRef() in PC/ directory (python#99479)
  pythongh-99300: Use Py_NewRef() in Doc/ directory  (python#99480)
  pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99473)
  pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99469)
  pythongh-99370: Calculate zip path from prefix when in a venv (pythonGH-99371)
  ...
@bedevere-bot

bedevere-bot commented Nov 16, 2022

Copy link
Copy Markdown

GH-99514 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

gvanrossum pushed a commit that referenced this pull request Nov 16, 2022
@hoodmane
[3.11] GH-99460: Emscripten trampolines on optimized METH_O and METH_…
a06fb51
…NOARGS code paths (gh-99461) (#99514)

Manual backport of GH-99461.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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

@hoodmane @sobolevn @gvanrossum @bedevere-bot
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.