Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-105481: add pseudo-instructions to the cases DSL #105506

Merged
merged 11 commits into from
Jun 11, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Jun 8, 2023

@iritkatriel
Copy link
Member Author

I'll look into adding unit tests for the generator.

@iritkatriel
Copy link
Member Author

I'll look into adding unit tests for the generator.

Actually the test are not running anymore, right? (I mean the ones in Tools/cases_generator/test_generator.py).

@gvanrossum
Copy link
Member

Actually the test are not running anymore, right? (I mean the ones in Tools/cases_generator/test_generator.py).

Sadly those must be run manually (since they use pytest) and I have neglected to do so, so they are broken. I've filed gh-105540 for that.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

A great start. I suppose before you land this you are going to make it so that the new metadata is actually used? Or will that be a separate PR?

Python/bytecodes.c Outdated Show resolved Hide resolved
Tools/cases_generator/parser.py Show resolved Hide resolved
Tools/cases_generator/generate_cases.py Show resolved Hide resolved
Tools/cases_generator/generate_cases.py Outdated Show resolved Hide resolved
Tools/cases_generator/generate_cases.py Show resolved Hide resolved
Tools/cases_generator/generate_cases.py Show resolved Hide resolved
Tools/cases_generator/generate_cases.py Show resolved Hide resolved
@gvanrossum
Copy link
Member

I guess still waiting for the pseudo PR?

@iritkatriel
Copy link
Member Author

I’m not sure where we would use the metadata for pseudo instructions. It probably makes sense to add assertions in the places where we map them to real instructions, that the metadata is the same. I’ll have a look tomorrow (or so).

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Sorry, I was confusing this PR with gh-105482. That one uses the metadata. This one LGTM!

@iritkatriel iritkatriel merged commit 58f5227 into python:main Jun 11, 2023
@bedevere-bot
Copy link

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

Hi! The buildbot wasm32-wasi 3.x has failed when building commit 58f5227.

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/1046/builds/2267) and take a look at the build logs.
  4. Check if the failure is related to this commit (58f5227) 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/1046/builds/2267

Failed tests:

  • test_userstring

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

== Tests result: FAILURE ==

317 tests OK.

10 slowest tests:

  • test_hashlib: 1 min 22 sec
  • test_math: 1 min 12 sec
  • test_unparse: 31.5 sec
  • test_tokenize: 28.4 sec
  • test_capi: 23.6 sec
  • test_fstring: 16.8 sec
  • test_unicodedata: 16.8 sec
  • test_pickle: 14.0 sec
  • test_decimal: 13.9 sec
  • test_tarfile: 13.2 sec

1 test failed:
test_userstring

129 tests skipped:
test.test_asyncio.test_base_events
test.test_asyncio.test_buffered_proto
test.test_asyncio.test_context
test.test_asyncio.test_eager_task_factory
test.test_asyncio.test_events test.test_asyncio.test_futures
test.test_asyncio.test_futures2 test.test_asyncio.test_locks
test.test_asyncio.test_pep492
test.test_asyncio.test_proactor_events
test.test_asyncio.test_protocols test.test_asyncio.test_queues
test.test_asyncio.test_runners
test.test_asyncio.test_selector_events
test.test_asyncio.test_sendfile test.test_asyncio.test_server
test.test_asyncio.test_sock_lowlevel test.test_asyncio.test_ssl
test.test_asyncio.test_sslproto test.test_asyncio.test_streams
test.test_asyncio.test_subprocess
test.test_asyncio.test_taskgroups test.test_asyncio.test_tasks
test.test_asyncio.test_threads test.test_asyncio.test_timeouts
test.test_asyncio.test_transports
test.test_asyncio.test_unix_events test.test_asyncio.test_waitfor
test.test_asyncio.test_windows_events
test.test_asyncio.test_windows_utils test__xxinterpchannels
test__xxsubinterpreters test_asyncgen test_bz2 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_gzip test_httplib
test_httpservers test_idle test_imaplib test_interpreters
test_ioctl test_kqueue test_launcher test_lzma test_mailbox
test_mmap test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_openpty test_pdb
test_perf_profiler test_perfmaps test_poll test_poplib test_pty
test_pwd test_queue test_readline test_regrtest test_repl
test_resource test_select test_selectors test_smtplib test_smtpnet
test_socket test_socketserver test_sqlite3 test_ssl
test_stable_abi_ctypes test_startfile test_subprocess
test_sys_settrace test_syslog test_tcl test_thread
test_threadedtempfile test_threading test_threading_local
test_tkinter test_tools test_ttk test_ttk_textonly test_turtle
test_urllib test_urllib2 test_urllib2_localnet test_urllib2net
test_urllib_response 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_zlib
test_zoneinfo
0:05:20 load avg: 3.41
0:05:20 load avg: 3.41 Re-running failed tests is not supported with --python host runner option.

Total duration: 5 min 20 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/Lib/test/string_tests.py", line 335, in test_find_periodic_pattern
    self.checkequal(reference_find(p, text),
  File "/Lib/test/test_userstring.py", line 24, in checkequal
    self.assertEqual(
AssertionError: -1 != 0

@bedevere-bot
Copy link

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

Hi! The buildbot ARM Raspbian 3.x has failed when building commit 58f5227.

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/424/builds/4187) and take a look at the build logs.
  4. Check if the failure is related to this commit (58f5227) 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/424/builds/4187

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

== Tests result: ENV CHANGED ==

427 tests OK.

10 slowest tests:

  • test_venv: 10 min 36 sec
  • test_largefile: 8 min 43 sec
  • test_compileall: 7 min 55 sec
  • test_math: 5 min 2 sec
  • test_multiprocessing_spawn: 4 min 23 sec
  • test_runpy: 3 min 50 sec
  • test_subprocess: 3 min 37 sec
  • test_concurrent_futures: 3 min 16 sec
  • test_zipfile: 3 min 9 sec
  • test_sqlite3: 2 min 49 sec

1 test altered the execution environment:
test_concurrent_futures

19 tests skipped:
test.test_asyncio.test_windows_events
test.test_asyncio.test_windows_utils test_devpoll test_idle
test_ioctl test_kqueue test_launcher test_perf_profiler
test_startfile test_tcl test_tkinter test_ttk test_ttk_textonly
test_turtle test_winconsoleio test_winreg test_winsound test_wmi
test_zipfile64

Total duration: 38 min 31 sec

Click to see traceback logs
remote: Enumerating objects: 25, done.        
remote: Counting objects:   4% (1/25)        
remote: Counting objects:   8% (2/25)        
remote: Counting objects:  12% (3/25)        
remote: Counting objects:  16% (4/25)        
remote: Counting objects:  20% (5/25)        
remote: Counting objects:  24% (6/25)        
remote: Counting objects:  28% (7/25)        
remote: Counting objects:  32% (8/25)        
remote: Counting objects:  36% (9/25)        
remote: Counting objects:  40% (10/25)        
remote: Counting objects:  44% (11/25)        
remote: Counting objects:  48% (12/25)        
remote: Counting objects:  52% (13/25)        
remote: Counting objects:  56% (14/25)        
remote: Counting objects:  60% (15/25)        
remote: Counting objects:  64% (16/25)        
remote: Counting objects:  68% (17/25)        
remote: Counting objects:  72% (18/25)        
remote: Counting objects:  76% (19/25)        
remote: Counting objects:  80% (20/25)        
remote: Counting objects:  84% (21/25)        
remote: Counting objects:  88% (22/25)        
remote: Counting objects:  92% (23/25)        
remote: Counting objects:  96% (24/25)        
remote: Counting objects: 100% (25/25)        
remote: Counting objects: 100% (25/25), done.        
remote: Compressing objects:  12% (1/8)        
remote: Compressing objects:  25% (2/8)        
remote: Compressing objects:  37% (3/8)        
remote: Compressing objects:  50% (4/8)        
remote: Compressing objects:  62% (5/8)        
remote: Compressing objects:  75% (6/8)        
remote: Compressing objects:  87% (7/8)        
remote: Compressing objects: 100% (8/8)        
remote: Compressing objects: 100% (8/8), done.        
remote: Total 13 (delta 12), reused 6 (delta 5), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to '58f5227d7cdff803609a0bda6882997b3a5ec4bf'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 58f5227d7c gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)
Switched to and reset branch 'main'

In file included from ./Include/Python.h:44,
                 from ./Python/sysmodule.c:17:
./Python/sysmodule.c: In function ‘_PySys_UpdateConfig’:
./Include/object.h:692:9: warning: ‘value’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  692 |         _Py_Dealloc(op);
      |         ^~~~~~~~~~~~~~~
./Python/sysmodule.c:3378:22: note: ‘value’ was declared here
 3378 |     PyObject *name, *value;
      |                      ^~~~~
./Modules/_testcapi/heaptype_relative.c: In function ‘make_sized_heaptypes’:
./Modules/_testcapi/heaptype_relative.c:62:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   62 |                            (unsigned long long)data_ptr,
      |                            ^

make: *** [Makefile:2003: buildbottest] Error 3

@gvanrossum
Copy link
Member

I found some bugs, here are fixes:
4291adf

@iritkatriel iritkatriel deleted the pseudo branch July 25, 2023 18:02
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.

3 participants