René's URL Explorer Experiment


Title: Fix native-width and canonical Unicode hashing by youknowdot · Pull Request #9844 · RustPython/RustPython · GitHub

Open Graph Title: Fix native-width and canonical Unicode hashing by youknowdot · Pull Request #9844 · RustPython/RustPython

X Title: Fix native-width and canonical Unicode hashing by youknowdot · Pull Request #9844 · RustPython/RustPython

Description: Summary Fix the related test_hash expected failures together, using CPython 3.15's platform-dependent hash rules rather than assuming a 64-bit Py_hash_t everywhere. Use native signed/unsigned hash types and the 31-bit or 61-bit numeric modulus. Keep SipHash24's algorithm output width at 64 bits in sys.hash_info. Select the 32-bit tuple hash constants and adapt the related slice, None, custom __hash__, contextvars, regex and C-API consumers. Hash strings as CPython's canonical native-endian one/two/four-byte Unicode representation, including lone surrogates. Keep Python ASCII strings on their existing raw-byte fast path. Rust str/WTF-8 dict lookup adapters use the same representation so equal keys retain equal hashes. Use unsigned dictionary perturbation rather than abs() of a signed hash, avoiding the minimum-hash overflow/nonterminating collision case. This retains RustPython's existing probe recurrence; it does not claim to reproduce CPython's exact probe sequence. Remove the now-covered 32-bit and UCS2 test_hash markers, extend existing hash unit tests for both widths, and add a minimum-hash collision regression to the existing snippet. CPython references: native hash types/modulus, buffer/SipHash conversion, Unicode storage hashing, tuple hashing, and slot_tp_hash. Validation Built CPython 3.15.0 with --with-hash-algorithm=siphash24 for like-for-like comparison. Its test_hash passes; a seed-42 differential covering strings, surrogates, bytes/memoryview, numeric/container/custom hashes matches RustPython. Final native release: test_hash test_long test_float test_tuple test_set test_dict test_slice: 967 tests run, 24 skipped, all seven modules successful. builtin_hash.py passes on both interpreters. Actual wasm32-wasip1 release build and Wasmtime execution: width 32 / hash_bits 64; upstream ASCII/long/UCS2 seed-0/42 vectors, integer, subnormal and tuple32 assertions pass, as do minimum-hash dict/set collisions and an oversized custom hash. Seven hash-related common unit tests also pass under Wasmtime (--no-default-features --features std). C-API: 149 passed, two ignored; C-API Clippy passes. Full snippet pytest was attempted: 494 passed, 21 failed. The six RustPython failures reproduce on unmodified main (sandbox socket/process restrictions, local OS behavior, unavailable _sqlite3); the other failures are CPython fixture/optional-module/environment failures. This is not an all-green full-snippet claim. Full workspace Rust tests completed on a serial retry: 1,564 passed, zero failed, 21 ignored (including doctests). The initial parallel compiler was SIGKILLed under memory pressure. Strict Clippy found pre-existing must_use_candidate warnings in unchanged entry-point code; this PR leaves that unrelated code alone. Standard workspace Clippy completed successfully, with those existing warnings. All configured commit hooks passed. Local performance check Same release build settings, unmodified main d9a9781bb versus this change, alternating ABBA twice, 20 repeats per workload. Median elapsed-time ratios (new/main): ASCII new-string hash 0.894, Unicode new-string hash 0.986, astral new-string hash 1.002, cached ASCII hash 0.958, integer dict insert/lookups 0.870, attribute lookup 0.980. These small local workloads are a smoke check, not a broad performance guarantee; canonical non-ASCII hashing necessarily replaces the old incorrect UTF-8-byte hash computation. CI note: the green Run benchmarks job currently skips its actual benchmark build/run steps; the base/head/CPython comparison is also skipped. Neither is counted as completed performance validation.

Open Graph Description: Summary Fix the related test_hash expected failures together, using CPython 3.15's platform-dependent hash rules rather than assuming a 64-bit Py_hash_t everywhere. Use native signed/unsigned ...

X Description: Summary Fix the related test_hash expected failures together, using CPython 3.15's platform-dependent hash rules rather than assuming a 64-bit Py_hash_t everywhere. Use native signed/unsig...

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

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:505e9f24-c632-583d-ff7b-45cb9afa0aa3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCEBE:157C65:2E77D67:3E00572:6B01DE51
html-safe-noncedb19ddb9edf1a1db5546df19c3225340e0e7f3eaf445a85c9a89fa27687b9159
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUJFOjE1N0M2NToyRTc3RDY3OjNFMDA1NzI6NkIwMURFNTEiLCJ2aXNpdG9yX2lkIjoiNTQzNTk4NTI1MzI5NjYyNzI4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb4d3b3452fb7e3c30ebc652e922e1e7e2fada7c3709e6e66c5d6d3427702219e
hovercard-subject-tagpull_request:5318340509
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/9844/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 Fix the related test_hash expected failures together, using CPython 3.15's platform-dependent hash rules rather than assuming a 64-bit Py_hash_t everywhere. Use native signed/unsigned ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9844/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9844%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%2F9844%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/9844/files
Reloadhttps://github.com/RustPython/RustPython/pull/9844/files
Reloadhttps://github.com/RustPython/RustPython/pull/9844/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/expected-next-20261115https://github.com/youknowdot/RustPython/tree/fix/expected-next-20261115
Conversation 3 https://github.com/RustPython/RustPython/pull/9844
Commits 1 https://github.com/RustPython/RustPython/pull/9844/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9844/checks
Files changed https://github.com/RustPython/RustPython/pull/9844/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9844/files
Fix native-width and canonical Unicode hashing https://github.com/RustPython/RustPython/pull/9844/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9844/files
478de26 Align native-width and Unicode hashes with CPython 3.15 youknowdot Nov 15, 2026 https://github.com/RustPython/RustPython/pull/9844/commits/478de266d248cc99e32c90b8609f72631ed02acb
Clear filters https://github.com/RustPython/RustPython/pull/9844/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9844/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9844/files
test_hash.py https://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
object.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-fe583114535c5e006ae5797e6bb26bf8ab5a13accf9ab4a0de27b2a99d34b63c
float_ops.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-db5a7b1448121cad70d180d9bf4ffab697b3faf07904d72367c3647910aff734
hash.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
contextvars.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-f84ab555f4981e3eb36060a768a77cf750b7221d2ab6c571d1c5115befe9e0cc
singletons.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-da96a72a3e5f233df52af1b53a4ccc5a4ced691641ac19538e845d507710ad4f
slice.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-b4a3a230abe3811c0323aca7ef63073e96941a76d8c7078a955e8ae7d1f0a364
str.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
dict_inner.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-aa3e0344e8fe84f229558c441057af178d20ee5bb19fda4bc01485a9a62bf99e
_sre.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-62bafdd789f1a10e570be6dbf27f34faa786ff709b0fadcad41dbad4ab206e06
slot.rs https://github.com/RustPython/RustPython/pull/9844/files#diff-1b5587c15bdfe9ff552fbc35e014eef20d6b7934fbb31b922cf35d87e8837b7b
builtin_hash.py https://github.com/RustPython/RustPython/pull/9844/files#diff-a94d631d7a8929c5e4626450a271fef90cea53b65ea74c4cca1f3baebc00c51d
Lib/test/test_hash.pyhttps://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
View file https://github.com/youknowdot/RustPython/blob/478de266d248cc99e32c90b8609f72631ed02acb/Lib/test/test_hash.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9844/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
https://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
https://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
https://github.com/RustPython/RustPython/pull/9844/files#diff-5a97e315222c53f1c10e45d9beb613aa294f0aee08f0dc99ad8d711922848605
crates/capi/src/object.rshttps://github.com/RustPython/RustPython/pull/9844/files#diff-fe583114535c5e006ae5797e6bb26bf8ab5a13accf9ab4a0de27b2a99d34b63c
View file https://github.com/youknowdot/RustPython/blob/478de266d248cc99e32c90b8609f72631ed02acb/crates/capi/src/object.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9844/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9844/files#diff-fe583114535c5e006ae5797e6bb26bf8ab5a13accf9ab4a0de27b2a99d34b63c
https://github.com/RustPython/RustPython/pull/9844/files#diff-fe583114535c5e006ae5797e6bb26bf8ab5a13accf9ab4a0de27b2a99d34b63c
crates/common/src/float_ops.rshttps://github.com/RustPython/RustPython/pull/9844/files#diff-db5a7b1448121cad70d180d9bf4ffab697b3faf07904d72367c3647910aff734
View file https://github.com/youknowdot/RustPython/blob/478de266d248cc99e32c90b8609f72631ed02acb/crates/common/src/float_ops.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9844/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9844/files#diff-db5a7b1448121cad70d180d9bf4ffab697b3faf07904d72367c3647910aff734
https://github.com/RustPython/RustPython/pull/9844/files#diff-db5a7b1448121cad70d180d9bf4ffab697b3faf07904d72367c3647910aff734
crates/common/src/hash.rshttps://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
View file https://github.com/youknowdot/RustPython/blob/478de266d248cc99e32c90b8609f72631ed02acb/crates/common/src/hash.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9844/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
https://github.com/RustPython/RustPython/pull/9844/files#diff-9ddaf584e7e730457c197b1c6d291512c588c427349c61bccf5492443262fb7b
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9844/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9844/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.