René's URL Explorer Experiment


Title: Track Unpickler payload references during cyclic GC by youknowdot · Pull Request #9288 · RustPython/RustPython · GitHub

Open Graph Title: Track Unpickler payload references during cyclic GC by youknowdot · Pull Request #9288 · RustPython/RustPython

X Title: Track Unpickler payload references during cyclic GC by youknowdot · Pull Request #9288 · RustPython/RustPython

Description: Track Unpickler payload references during cyclic GC Summary Split the remaining Unpickler GC/lifetime closure from the Python 3.15 upgrade work. This changes crates/stdlib/src/pickle.rs (+68/-17) on main base bcfad3554 and appends two nonduplicative payload-cycle regressions to the existing extra_tests/snippets/stdlib_pickle.py (+41). It preserves the existing allocation/copy handling and private-name lookup. Traverse the owned read, readline, and peek slots, the buffer iterator, and every occupied memo slot, including sparse keys and repeated identities held by distinct strong slots. Traverse the memo proxy's reference to its Unpickler. Clear Unpickler outgoing references into the collector's deferred-drop vector and invalidate initialization state. On successful reinitialization, replace the old state/configuration and retire their references with the old memo after releasing the state lock. No Lib changes, new snippet files, Rust Python-behavior tests, collector changes, or CPython-only decorator changes are included. Bounded validation Source-bound candidate built with the main Ruff pin 9290a884; compiler/codegen/VM/stdlib/pylib/root were explicitly invalidated and actually recompiled. All tracked source hashes and symlink targets matched the reviewed source after building. Prior sealed binaries were preserved. An external review harness ran each mode in a separate fresh process, with a fixed 20-second deadline, 512 MiB sampled RSS, 6 GiB address-space limit, core dumps disabled, and resource reserve guards: Direct reference identities/multiplicity: candidate read/readline/peek/buffers/memo/proxy counts are 1/1/1/1/2/1. Main baseline reports 0/0/0/0/0/0. One tiny memo, stream, or buffers cycle through a memo proxy, tested separately with callback-free weakrefs and exactly three collections: candidate passes all three; main baseline fails their release assertions. Successful ordinary reinitialization replaces stream/memo/buffers, releases old holders after three collections, and loads a locally serialized three-integer list: candidate and baseline both pass. This observation does not prove lock-drop ordering; that conclusion comes from source review. Two existing canonical CPython 3.15.0 compatibility methods, test_priming_unpickler_memo and test_reusing_unpickler_objects, pass on baseline, candidate and CPython, two tests and zero skips each. Their unchanged methods and setup were AST-selected into an external harness with _pickle bindings and only io, _pickle, and unittest globals. No broad pickle test-module import or whole-suite execution occurred. There were no crashes, hangs, guard stops, automatic retries, or weakened assertions. Inputs were locally serialized ordinary values; no malformed streams, stress/OOM, native-memory probes, reentrant finalizers or concurrent mutation were tested. The existing pickle snippet now retains the stream and buffers cycle regressions. Canonical persistent-load reference-cycle and buffer-content tests do not cover these payload cycles. Only the new definitions and loop body were AST-selected and validated, one case per fresh guarded process: baseline fails both release assertions, while CPython and candidate pass both. The complete pre-existing snippet was not executed because its unrelated oversized-length cases are outside this local gate. Its required full pytest gate remains unrun. CPython 3.15.0 oracle qualification The pinned oracle does not pass every harness assertion. Its direct edge counts are 1/1/1/1/0/1, failing the two-slot memo assertion. A separately bounded memo.copy() observation returns an empty dict immediately after assignment on CPython, whereas main RustPython preserves keys 0 and 17 with both holder identities. Source inspection of pinned _pickle.c explains this: the dict memo setter writes values into the old memo, then cleans that memo and installs the newly allocated empty array. Consequently the oracle's memo-cycle pass is vacuous for the intended cycle. We preserve this discrepancy rather than weaken the Rust ownership invariant or claim full oracle parity. Oracle stream/buffers/reinit modes pass independently. Safety and scope qualifications Collector clear is invoked after world restart, under the existing exclusive-unreachable-object/deferred-drop contract. This patch inherits that contract and these tests do not prove it. It is not justified by stop-the-world alone. The derived memo proxy's clear remains a no-op. Clearing Unpickler outgoing edges breaks the reviewed cycles; this is not complete CPython proxy-clear parity. Deferred retirement applies to the successful __init__ path only. Failure-path locals can still drop under the state lock; no reentrant-finalizer claim is made. No hard API dependency on #8944 was found, but coordination on GC architecture and exclusivity assumptions remains necessary. Additional gates Passed under the same build resource guard: cargo check --locked --offline -p rustpython-stdlib --features threading (128s). cargo check --locked --offline -p rustpython-stdlib (non-threaded, default features; 54s). cargo clippy --locked --offline -p rustpython-stdlib --all-targets --features threading -- -D warnings (218s). prek run --files crates/stdlib/src/pickle.rs (4s; no source changes). All 3,631 source manifest entries matched after the native gates. The subsequently approved snippet-only addition is the sole manifest difference from the source-bound binary. Native source and sealed binary remain unchanged. Normal hooks were then rerun on both changed files and passed in 2s without rewrites; the two added cases were validated against that same sealed binary. The required broader workspace/CAPI runtime suites and release pickle-module command have not been run and are not waived. This bounded validation is not a collector/threading soundness proof. AI assistance: OpenAI assistant assisted with source review, implementation preparation and bounded validation.

Open Graph Description: Track Unpickler payload references during cyclic GC Summary Split the remaining Unpickler GC/lifetime closure from the Python 3.15 upgrade work. This changes crates/stdlib/src/pickle.rs (+68/-17) o...

X Description: Track Unpickler payload references during cyclic GC Summary Split the remaining Unpickler GC/lifetime closure from the Python 3.15 upgrade work. This changes crates/stdlib/src/pickle.rs (+68/-17) o...

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

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:c6f4c591-c683-d0c8-fcc1-2d5ba0400994
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB44A:14EB6E:14CA5A6:1B5CD14:6B01F3A8
html-safe-noncea4de09967f4c46b32cd8d6abf07e3800f5565202891336d11243cb2e86103ca7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDRBOjE0RUI2RToxNENBNUE2OjFCNUNEMTQ6NkIwMUYzQTgiLCJ2aXNpdG9yX2lkIjoiNzQ2NDkxNjk0MTk1NDc0MTE2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc09c673fe0f4affd990481c9599c485c0eaf470c41046c12da9320f84c2d3df7
hovercard-subject-tagpull_request:4958862993
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/9288/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:altTrack Unpickler payload references during cyclic GC Summary Split the remaining Unpickler GC/lifetime closure from the Python 3.15 upgrade work. This changes crates/stdlib/src/pickle.rs (+68/-17) o...
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/9288/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9288%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%2F9288%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/9288/files
Reloadhttps://github.com/RustPython/RustPython/pull/9288/files
Reloadhttps://github.com/RustPython/RustPython/pull/9288/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:split/unpickler-payload-gc-315https://github.com/youknowdot/RustPython/tree/split/unpickler-payload-gc-315
Conversation 5 https://github.com/RustPython/RustPython/pull/9288
Commits 1 https://github.com/RustPython/RustPython/pull/9288/commits
Checks 20 https://github.com/RustPython/RustPython/pull/9288/checks
Files changed https://github.com/RustPython/RustPython/pull/9288/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/files
Track Unpickler payload references during cyclic GC https://github.com/RustPython/RustPython/pull/9288/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9288/files
c9708f3 Track Unpickler payload references during cyclic GC youknowdot Oct 21, 2026 https://github.com/RustPython/RustPython/pull/9288/commits/c9708f3e457e60769ac6987e6c2b78d7535ae518
Clear filters https://github.com/RustPython/RustPython/pull/9288/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/files
pickle.rs https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
stdlib_pickle.py https://github.com/RustPython/RustPython/pull/9288/files#diff-74a7e756035bd389effb04dac1897417c899188b1561841be4938e09903c6a3a
crates/stdlib/src/pickle.rshttps://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
View file https://github.com/youknowdot/RustPython/blob/c9708f3e457e60769ac6987e6c2b78d7535ae518/crates/stdlib/src/pickle.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9288/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
https://github.com/RustPython/RustPython/pull/9288/files#diff-3029d63dd60cbab4abbf02b7ddea49000477dfb2399b94ec7d5c021428fbe641
extra_tests/snippets/stdlib_pickle.pyhttps://github.com/RustPython/RustPython/pull/9288/files#diff-74a7e756035bd389effb04dac1897417c899188b1561841be4938e09903c6a3a
View file https://github.com/youknowdot/RustPython/blob/c9708f3e457e60769ac6987e6c2b78d7535ae518/extra_tests/snippets/stdlib_pickle.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9288/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9288/files#diff-74a7e756035bd389effb04dac1897417c899188b1561841be4938e09903c6a3a
https://github.com/RustPython/RustPython/pull/9288/files#diff-74a7e756035bd389effb04dac1897417c899188b1561841be4938e09903c6a3a
chatgpt-codex-connectorhttps://github.com/apps/chatgpt-codex-connector
Oct 22, 2026https://github.com/RustPython/RustPython/pull/9288/files#r4343642736
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://camo.githubusercontent.com/a08bbb8a949f7033433a88444eeae385ff6a5e599d92f878fb05fa85707b7816/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50312d6f72616e67653f7374796c653d666c6174
AGENTS.md:L278-L282https://github.com/RustPython/RustPython/blob/c9708f3e457e60769ac6987e6c2b78d7535ae518/AGENTS.md#L278-L282
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/files
chatgpt-codex-connectorhttps://github.com/apps/chatgpt-codex-connector
Oct 22, 2026https://github.com/RustPython/RustPython/pull/9288/files#r4343642744
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://camo.githubusercontent.com/a08bbb8a949f7033433a88444eeae385ff6a5e599d92f878fb05fa85707b7816/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50312d6f72616e67653f7374796c653d666c6174
AGENTS.md:L35-L35https://github.com/RustPython/RustPython/blob/c9708f3e457e60769ac6987e6c2b78d7535ae518/AGENTS.md#L35-L35
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9288/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.