Title: Align cleanup bytecode layout with CPython by youknowone · Pull Request #7935 · RustPython/RustPython · GitHub
Open Graph Title: Align cleanup bytecode layout with CPython by youknowone · Pull Request #7935 · RustPython/RustPython
X Title: Align cleanup bytecode layout with CPython by youknowone · Pull Request #7935 · RustPython/RustPython
Description: Summary Align exception, finally, and with cleanup bytecode layout with CPython 3.14 compiler behavior for issue youknowone#32. This updates shared codegen/CFG assembly behavior rather than editing Lib/, using the local CPython compiler sources as reference: Python/codegen.c for try/finally, with, while, break/continue, and named-except cleanup layout Python/flowgraph.c for late CFG cleanup and load-fast borrow behavior Python/assemble.c for jump offset fixed-point behavior around EXTENDED_ARG Validation cargo fmt --check cargo test -p rustpython-codegen --lib cargo build --release -p rustpython cargo clippy -p rustpython-codegen --lib git diff --check scripts/compare_bytecode.py with release RustPython for the issue #32 grouped scope: multiprocessing/forkserver.py test/test_compile.py test/test_faulthandler.py test/test_hashlib.py test/test_importlib/extension/test_loader.py test/test_poplib.py test/test_socket.py test/test_sys_settrace.py test/test_unittest/testmock/testsealable.py All grouped-scope compare reports are at 0 differences. Summary by CodeRabbit Refactor Improved compiler control-flow and bytecode layout generation for complex constructs (match OR-patterns, try/finally, infinite-loop patterns, multi-with), with better NOP/location preservation and more consistent jump/epilogue ordering to match reference behavior. Tests Added extensive tests covering bytecode/layout edge cases (NOP preservation, location overrides, jump/return epilogues, and various try/while/match interactions).
Open Graph Description: Summary Align exception, finally, and with cleanup bytecode layout with CPython 3.14 compiler behavior for issue youknowone#32. This updates shared codegen/CFG assembly behavior rather than editing...
X Description: Summary Align exception, finally, and with cleanup bytecode layout with CPython 3.14 compiler behavior for issue youknowone#32. This updates shared codegen/CFG assembly behavior rather than editing...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7935
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b33e2c35-5695-bb2c-06bc-182f53f5ea74 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D93C:138FF:13F342D:1ABA0F6:6A5B85C2 |
| html-safe-nonce | 95e8b18e0538fcc5740bb1e165f9ec727b1a9700e32986feb74cab8072ede3c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTNDOjEzOEZGOjEzRjM0MkQ6MUFCQTBGNjo2QTVCODVDMiIsInZpc2l0b3JfaWQiOiI2NzQ2NTExNjM1MDg2MjgwMTMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6b82384851bcb4aea1664ab11192fb045114e0c11b7ec208e7570ecdba9d9abc |
| hovercard-subject-tag | pull_request:3715662539 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7935/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | Summary Align exception, finally, and with cleanup bytecode layout with CPython 3.14 compiler behavior for issue youknowone#32. This updates shared codegen/CFG assembly behavior rather than editing... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width