Title: compression.zstd: non-determinist with zstd_dict · Issue #150583 · python/cpython · GitHub
Open Graph Title: compression.zstd: non-determinist with zstd_dict · Issue #150583 · python/cpython
X Title: compression.zstd: non-determinist with zstd_dict · Issue #150583 · python/cpython
Description: Bug report Bug description: It seems that in some cases, compressing with compress(... , zstd_dict=ZstdDict(...).as_digested_dict) is not deterministic, even when the parameters are the same. Initially reported at Rogdham/pyzstd#66. Repr...
Open Graph Description: Bug report Bug description: It seems that in some cases, compressing with compress(... , zstd_dict=ZstdDict(...).as_digested_dict) is not deterministic, even when the parameters are the same. Initi...
X Description: Bug report Bug description: It seems that in some cases, compressing with compress(... , zstd_dict=ZstdDict(...).as_digested_dict) is not deterministic, even when the parameters are the same. Initi...
Opengraph URL: https://github.com/python/cpython/issues/150583
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"compression.zstd: non-determinist with zstd_dict","articleBody":"# Bug report\n\n### Bug description:\n\nIt seems that in some cases, compressing with `compress(... , zstd_dict=ZstdDict(...).as_digested_dict)` is not deterministic, even when the parameters are the same.\n\nInitially reported at https://github.com/Rogdham/pyzstd/issues/66.\n\n### Reproducer\n\nThe following should print `1` but prints `2` most of the times.\n\nNote: the issue seems somewhat less frequent on free-threaded builds.\n\n```python\nfrom compression import zstd\n\nDICT = b\"7\\xa40\\xec/\u003c\\xabJ\\t\\x10\\x10\\xdf033\\xb3w\\n3\\xf1x\u003c\\x1e\\x8f\\xc7\\xe3\\xf1x\u003c\\xcf\\xf3\\xbc\\xf7\\xd4BAAAAAAAAAAAAAAAAAAAAAAAAA\\xa1P(\\x14\\n\\x85B\\xa1P(\\x14\\n\\x85\\xa2(\\x8a\\xa2(J)}t\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xe1\\xf1x\u003c\\x1e\\x8f\\xc7\\xe3\\xf1x\\x9e\\xe7y\\xef\\x01\\x01\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x08\\x00\\x00\\x00helloworld test data sample foo bar baz hello w\"\nDATA = b\"hello world test\"\n\nZSTD_DICT = zstd.ZstdDict(DICT).as_digested_dict\n\nvalues = {\n zstd.compress(DATA, zstd_dict=ZSTD_DICT)\n for _ in range(100_000)\n}\nprint(len(values))\n```\n\n### CPython versions tested on:\n\n3.14, 3.15, CPython main branch,\n\n### Operating systems tested on:\n\nLinux\n\n---\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-150586\n* gh-153883\n* gh-153884\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/Rogdham","@type":"Person","name":"Rogdham"},"datePublished":"2026-05-29T17:36:57Z","url":"https://github.com/python/cpython/issues/150583"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9a36f4a1-8a16-000a-cb4a-64fb6b1b771b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E232:3FBB89:250ACF:31FDB6:6AECC4DD |
| html-safe-nonce | 8616323d9412c64fade9398ea6831a7edc15cf66075dadf41f26c9d20d9ddee4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjMyOjNGQkI4OToyNTBBQ0Y6MzFGREI2OjZBRUNDNEREIiwidmlzaXRvcl9pZCI6IjcyOTM3ODcyNjg1NzkxMTYyNTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 94f9e55db7e052c7bcb2a6b8fe75958853036c97a709416ed6033db55616716a |
| hovercard-subject-tag | issue:4550429491 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/150583/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4027412c279883dfc31ed1e98e05f86a0d305c5b6997458e9be14fbef33f5edb/python/cpython/issues/150583 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4027412c279883dfc31ed1e98e05f86a0d305c5b6997458e9be14fbef33f5edb/python/cpython/issues/150583 |
| og:image:alt | Bug report Bug description: It seems that in some cases, compressing with compress(... , zstd_dict=ZstdDict(...).as_digested_dict) is not deterministic, even when the parameters are the same. Initi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Rogdham |
| hostname | github.com |
| expected-hostname | github.com |
| None | dc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db139f0bf57b59bf9a8c4abb0849924d6c6ca559 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width