René's URL Explorer Experiment


Title: Fix bytearray membership racing with resizing by youknowdot · Pull Request #9091 · RustPython/RustPython · GitHub

Open Graph Title: Fix bytearray membership racing with resizing by youknowdot · Pull Request #9091 · RustPython/RustPython

X Title: Fix bytearray membership racing with resizing by youknowdot · Pull Request #9091 · RustPython/RustPython

Description: Summary Avoid synthetic buffer exports when bytearray membership uses an exact bytes, int, or bool needle. These needles cannot run Python while being prepared, so the existing read lock is sufficient to serialize the search with resizing. This addresses the intermittent macOS test_free_threading_bytearray failure seen in #9063: one worker's b'\xdd' not in a temporarily exported a, making another worker's a[:] = c raise BufferError after c changed length. CPython protects its temporary export with an object critical section; the previous RustPython path exposed that temporary export to concurrent assignments. Generic index/buffer callbacks, subclasses, and real memoryview exports keep their existing protection. This is scoped to exact bytes/int/bool membership, not a general critical-section implementation. Add deterministic Python regression coverage in the existing builtin_bytearray.py snippet for membership results, integer range checks, self-containment, bytes-subclass index dispatch, reentrant callbacks, real exports, same-size mutation, and export cleanup. Lib is unchanged. Validation Initial fix (375501d6): Release build and strict workspace/all-targets plus separate CAPI/all-targets Clippy passed with -D warnings. The deterministic Python contract passed on RustPython and final CPython 3.15; the three selected upstream containment/reentrancy tests passed on RustPython. One bounded concurrent run passed on free-threading RustPython. The CPython reference run also passed, but that oracle has the GIL enabled. Workspace test-binary compilation (cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi --no-run) passed, producing 22 executables without running them. GitHub CI passed: 14 jobs passed, 2 configured skips; CodSpeed passed. Review follow-up (b373af16e): Exact builtin bool uses the callback-free integer path; regression coverage is consolidated into builtin_bytearray.py. Fresh release build and strict workspace/all-targets plus separate CAPI/all-targets Clippy passed with -D warnings. The isolated finite regression function, including True/False cases, passed once on the fresh RustPython binary and once on final CPython 3.15. The concurrent fixture and upstream selectors were not rerun for this follow-up. Its CI is tracked separately. Full local workspace runtime tests, the full snippets suite, and the full test_bytes module have not been run. Separate CAPI test-binary compilation has not been run. This is targeted local validation, not a claim that all local tests pass. The fixed concurrent fixture is retained as external evidence rather than a deadline-sensitive CI snippet. It has three workers, 512 rounds each, at most 16 KiB target storage, and an external process watchdog. A passing run is probabilistic evidence, not proof of absence of races. AI assistance Codex/OpenAI performed source diagnosis, implemented the patch and Python regression checks, independently reviewed the lock/callback contract, and ran the reported validation. The runtime did not expose an exact model version. Summary by CodeRabbit Bug Fixes Improved bytearray containment checks for byte strings, integers, and booleans, including correct handling of out-of-range integers. Preserved resizing restrictions while a memoryview or buffer operation is active, with resizing available again after the buffer is released.

Open Graph Description: Summary Avoid synthetic buffer exports when bytearray membership uses an exact bytes, int, or bool needle. These needles cannot run Python while being prepared, so the existing read lock is suffici...

X Description: Summary Avoid synthetic buffer exports when bytearray membership uses an exact bytes, int, or bool needle. These needles cannot run Python while being prepared, so the existing read lock is suffici...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9091

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1dc87a73-576f-3d1d-1c9d-194f7f1861a4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBB72:2DBB21:357EFB9:475CBDF:6B020928
html-safe-noncec9fe566e6de38a58d13319d2195c63fbab4b9ae075b1c2f01e8c4ce705db232b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjcyOjJEQkIyMTozNTdFRkI5OjQ3NUNCREY6NkIwMjA5MjgiLCJ2aXNpdG9yX2lkIjoiNDU3ODA2NDExNDI4NjQ2MzI3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8eb9adc600c9d563476afcb720201c0ec65ed07fecbbe2259938a057e55a23e8
hovercard-subject-tagpull_request:4838043768
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9091/files
twitter:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
og:image:altSummary Avoid synthetic buffer exports when bytearray membership uses an exact bytes, int, or bool needle. These needles cannot run Python while being prepared, so the existing read lock is suffici...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9091/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9091%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9091%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9091/files
Reloadhttps://github.com/RustPython/RustPython/pull/9091/files
Reloadhttps://github.com/RustPython/RustPython/pull/9091/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:fix-bytearray-internal-export-concurrencyhttps://github.com/youknowdot/RustPython/tree/fix-bytearray-internal-export-concurrency
Conversation 14 https://github.com/RustPython/RustPython/pull/9091
Commits 2 https://github.com/RustPython/RustPython/pull/9091/commits
Checks 19 https://github.com/RustPython/RustPython/pull/9091/checks
Files changed https://github.com/RustPython/RustPython/pull/9091/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
Fix bytearray membership racing with resizing https://github.com/RustPython/RustPython/pull/9091/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/9091/files
375501d Fix bytearray membership racing with resizing youknowdot Oct 13, 2026 https://github.com/RustPython/RustPython/pull/9091/commits/375501d63aab769bd57fcb10aa7e79ff25040917
b373af1 Handle bool needles and consolidate bytearray regression coverage youknowdot Oct 13, 2026 https://github.com/RustPython/RustPython/pull/9091/commits/b373af16ebe30b642d02272261a1c92b62e29147
Clear filters https://github.com/RustPython/RustPython/pull/9091/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
bytearray.rs https://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
builtin_bytearray.py https://github.com/RustPython/RustPython/pull/9091/files#diff-75a9ae9b0f5a55a46c1c1f573db7804fd2e108752b6a2e16a363c8a9614e120c
crates/vm/src/builtins/bytearray.rshttps://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
View file https://github.com/youknowdot/RustPython/blob/b373af16ebe30b642d02272261a1c92b62e29147/crates/vm/src/builtins/bytearray.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9091/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
https://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
https://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
chatgpt-codex-connectorhttps://github.com/apps/chatgpt-codex-connector
Oct 13, 2026https://github.com/RustPython/RustPython/pull/9091/files#r4254540515
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://camo.githubusercontent.com/a08bbb8a949f7033433a88444eeae385ff6a5e599d92f878fb05fa85707b7816/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50312d6f72616e67653f7374796c653d666c6174
AGENTS.md:L20-L23https://github.com/RustPython/RustPython/blob/375501d63aab769bd57fcb10aa7e79ff25040917/AGENTS.md#L20-L23
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
youknowonehttps://github.com/youknowone
Oct 13, 2026https://github.com/RustPython/RustPython/pull/9091/files#r4254788360
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
375501dhttps://github.com/RustPython/RustPython/commit/375501d63aab769bd57fcb10aa7e79ff25040917
b373af1https://github.com/RustPython/RustPython/commit/b373af16ebe30b642d02272261a1c92b62e29147
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
https://github.com/RustPython/RustPython/pull/9091/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
extra_tests/snippets/builtin_bytearray.pyhttps://github.com/RustPython/RustPython/pull/9091/files#diff-75a9ae9b0f5a55a46c1c1f573db7804fd2e108752b6a2e16a363c8a9614e120c
View file https://github.com/youknowdot/RustPython/blob/b373af16ebe30b642d02272261a1c92b62e29147/extra_tests/snippets/builtin_bytearray.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9091/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9091/files#diff-75a9ae9b0f5a55a46c1c1f573db7804fd2e108752b6a2e16a363c8a9614e120c
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9091/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.