sharedbox 0.6.0__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/ci.yaml +5 -5
  2. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/ops.yaml +21 -3
  3. {sharedbox-0.6.0 → sharedbox-0.7.0}/CHANGELOG.md +84 -0
  4. {sharedbox-0.6.0 → sharedbox-0.7.0}/CLAUDE.md +8 -7
  5. {sharedbox-0.6.0 → sharedbox-0.7.0}/CMakeLists.txt +5 -0
  6. {sharedbox-0.6.0 → sharedbox-0.7.0}/PKG-INFO +1 -1
  7. sharedbox-0.7.0/benchmarks/test_bench_box.py +440 -0
  8. sharedbox-0.7.0/docs/examples/store_a_large_list.py +81 -0
  9. sharedbox-0.7.0/docs/examples/store_a_large_set_or_dict.py +107 -0
  10. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/store_arrays.py +35 -0
  11. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/store_collections.py +1 -1
  12. sharedbox-0.7.0/docs/examples/store_numpy_numbers.py +82 -0
  13. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/store_text_and_bytes.py +2 -2
  14. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/field-types.md +24 -0
  15. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/how-a-box-is-stored.md +1 -1
  16. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/accept-a-box-in-c.md +5 -3
  17. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/commits-and-prs.md +13 -3
  18. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/index.md +2 -0
  19. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/send-items-through-a-stream.md +6 -0
  20. sharedbox-0.7.0/docs/how-to/store-a-large-list.md +152 -0
  21. sharedbox-0.7.0/docs/how-to/store-a-large-set-or-dict.md +235 -0
  22. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/store-arrays.md +32 -2
  23. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/store-collections.md +9 -1
  24. sharedbox-0.7.0/docs/how-to/store-numpy-numbers.md +107 -0
  25. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/store-text-and-bytes.md +7 -1
  26. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/box.md +18 -0
  27. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/segment-layout.md +72 -22
  28. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/box.hpp +2 -2
  29. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/core.hpp +108 -6
  30. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/sharedbox_c.cpp +34 -0
  31. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/sharedbox_c.h +5 -0
  32. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/stream.hpp +2 -2
  33. {sharedbox-0.6.0 → sharedbox-0.7.0}/pyproject.toml +3 -0
  34. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/__init__.py +4 -0
  35. sharedbox-0.7.0/src/sharedbox/_bounded.py +354 -0
  36. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_box.py +9 -3
  37. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_layout.py +58 -19
  38. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/codec.cpp +35 -18
  39. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/codec.hpp +56 -0
  40. sharedbox-0.7.0/src/sharedbox/_native/collection.cpp +662 -0
  41. sharedbox-0.7.0/src/sharedbox/_native/collection.hpp +226 -0
  42. sharedbox-0.7.0/src/sharedbox/_native/dict.cpp +386 -0
  43. sharedbox-0.7.0/src/sharedbox/_native/dict.hpp +88 -0
  44. sharedbox-0.7.0/src/sharedbox/_native/keys.cpp +369 -0
  45. sharedbox-0.7.0/src/sharedbox/_native/keys.hpp +130 -0
  46. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/module.cpp +390 -37
  47. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/scalars.cpp +253 -41
  48. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/scalars.hpp +13 -5
  49. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/segment.cpp +18 -12
  50. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/segment.hpp +3 -7
  51. sharedbox-0.7.0/src/sharedbox/_native/set.cpp +335 -0
  52. sharedbox-0.7.0/src/sharedbox/_native/set.hpp +87 -0
  53. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/stream.cpp +20 -12
  54. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/types.cpp +304 -65
  55. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/types.hpp +88 -4
  56. sharedbox-0.7.0/src/sharedbox/_native.pyi +1259 -0
  57. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_refs.py +6 -1
  58. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_stream.py +32 -9
  59. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_types.py +436 -56
  60. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_version.py +3 -3
  61. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/ops.py +282 -3
  62. {sharedbox-0.6.0 → sharedbox-0.7.0}/stubtest-allowlist.txt +17 -0
  63. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/consumer/consumer.c +4 -0
  64. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_c_smoke.c +8 -0
  65. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_c_smoke_box.cpp +4 -5
  66. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_layout3.cpp +5 -4
  67. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_mapping.cpp +8 -8
  68. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_stream_layout.cpp +13 -1
  69. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_types.cpp +64 -0
  70. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_values.cpp +30 -0
  71. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/crossproc.py +20 -0
  72. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/forged_open.py +10 -1
  73. sharedbox-0.7.0/tests/test_bounded_dict.py +728 -0
  74. sharedbox-0.7.0/tests/test_bounded_list.py +944 -0
  75. sharedbox-0.7.0/tests/test_bounded_set.py +873 -0
  76. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_capsule.py +29 -0
  77. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_doc_examples.py +5 -2
  78. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_fields.py +48 -0
  79. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_layout.py +36 -0
  80. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_segment.py +4 -4
  81. sharedbox-0.7.0/tests/test_properties_bounded.py +286 -0
  82. sharedbox-0.7.0/tests/test_properties_bounded_dict.py +250 -0
  83. sharedbox-0.7.0/tests/test_properties_bounded_set.py +249 -0
  84. sharedbox-0.7.0/tests/test_properties_numpy.py +99 -0
  85. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream.py +50 -1
  86. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_arrays.py +32 -3
  87. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_collections.py +43 -0
  88. sharedbox-0.7.0/tests/test_types_numpy.py +456 -0
  89. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_records.py +101 -5
  90. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_records_attrs.py +18 -0
  91. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_unions.py +14 -0
  92. sharedbox-0.7.0/tests/type_checks/bounded_types.py +36 -0
  93. {sharedbox-0.6.0 → sharedbox-0.7.0}/zensical.toml +3 -0
  94. sharedbox-0.6.0/benchmarks/test_bench_box.py +0 -98
  95. sharedbox-0.6.0/src/sharedbox/_native.pyi +0 -535
  96. {sharedbox-0.6.0 → sharedbox-0.7.0}/.clang-format +0 -0
  97. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/dependabot.yml +0 -0
  98. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/pull_request_template.md +0 -0
  99. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/check-changelog.yaml +0 -0
  100. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/check-docs.yaml +0 -0
  101. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/codspeed.yml +0 -0
  102. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/contention.yaml +0 -0
  103. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/prepare-release.yaml +0 -0
  104. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/publish-docs.yaml +0 -0
  105. {sharedbox-0.6.0 → sharedbox-0.7.0}/.github/workflows/streams.yaml +0 -0
  106. {sharedbox-0.6.0 → sharedbox-0.7.0}/.gitignore +0 -0
  107. {sharedbox-0.6.0 → sharedbox-0.7.0}/LICENSE +0 -0
  108. {sharedbox-0.6.0 → sharedbox-0.7.0}/README.md +0 -0
  109. {sharedbox-0.6.0 → sharedbox-0.7.0}/benchmarks/test_bench_stream.py +0 -0
  110. {sharedbox-0.6.0 → sharedbox-0.7.0}/changelog.d/.gitkeep +0 -0
  111. {sharedbox-0.6.0 → sharedbox-0.7.0}/cmake/sharedbox-config.cmake +0 -0
  112. {sharedbox-0.6.0 → sharedbox-0.7.0}/cmake/sharedbox-require-cxx.cmake +0 -0
  113. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/assets/benchmarks/ops.json +0 -0
  114. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/assets/benchmarks/roundtrip.json +0 -0
  115. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/assets/benchmarks/stream-matrix.json +0 -0
  116. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/assets/benchmarks/stream-throughput.json +0 -0
  117. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/diagrams/style.d2 +0 -0
  118. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/change_several_fields_at_once.py +0 -0
  119. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/clean_up_segments.py +0 -0
  120. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/follow_a_whole_reference_graph.py +0 -0
  121. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/name_a_box.py +0 -0
  122. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/send_a_box_to_another_process.py +0 -0
  123. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/send_items_through_a_stream.py +0 -0
  124. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/set_defaults_and_check_values.py +0 -0
  125. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/examples/store_records.py +0 -0
  126. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/checking-a-process-is-alive.md +0 -0
  127. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/closing-and-lifetime.md +0 -0
  128. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/glossary.md +0 -0
  129. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/how-the-module-is-built.md +0 -0
  130. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/index.md +0 -0
  131. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/limits.md +0 -0
  132. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/performance.md +0 -0
  133. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/reading-and-writing.md +0 -0
  134. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/references.md +0 -0
  135. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/waiting-for-changes.md +0 -0
  136. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/explanation/when-to-use-sharedbox.md +0 -0
  137. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/accept-a-box-in-cpp.md +0 -0
  138. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/ai-contribution-policy.md +0 -0
  139. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/build-docs.md +0 -0
  140. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/change-several-fields-at-once.md +0 -0
  141. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/clean-up-segments.md +0 -0
  142. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/contribute.md +0 -0
  143. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/follow-a-whole-reference-graph.md +0 -0
  144. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/install-sharedbox.md +0 -0
  145. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/make-a-release.md +0 -0
  146. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/name-a-box.md +0 -0
  147. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/open-a-box-from-a-program.md +0 -0
  148. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/run-benchmarks.md +0 -0
  149. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/run-commit-checks.md +0 -0
  150. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/run-tests.md +0 -0
  151. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/send-a-box-to-another-process.md +0 -0
  152. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/set-defaults-and-check-values.md +0 -0
  153. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/set-up-development.md +0 -0
  154. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/store-records.md +0 -0
  155. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/how-to/write-docs.md +0 -0
  156. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/index.md +0 -0
  157. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/javascripts/charts.js +0 -0
  158. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/arrays.md +0 -0
  159. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/errors.md +0 -0
  160. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/events.md +0 -0
  161. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/index.md +0 -0
  162. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/library-authors.md +0 -0
  163. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/references.md +0 -0
  164. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/api/streams.md +0 -0
  165. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/changelog.md +0 -0
  166. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/cpp-and-c-api.md +0 -0
  167. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/reference/index.md +0 -0
  168. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/tutorials/index.md +0 -0
  169. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/tutorials/mailbox.py +0 -0
  170. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/tutorials/react-to-changes.md +0 -0
  171. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/tutorials/refer-to-another-box.md +0 -0
  172. {sharedbox-0.6.0 → sharedbox-0.7.0}/docs/tutorials/share-a-record.md +0 -0
  173. {sharedbox-0.6.0 → sharedbox-0.7.0}/include/sharedbox/sharedbox.hpp +0 -0
  174. {sharedbox-0.6.0 → sharedbox-0.7.0}/includes/abbreviations.md +0 -0
  175. {sharedbox-0.6.0 → sharedbox-0.7.0}/prek.toml +0 -0
  176. {sharedbox-0.6.0 → sharedbox-0.7.0}/scripts/check_xrefs.py +0 -0
  177. {sharedbox-0.6.0 → sharedbox-0.7.0}/scripts/release_notes.py +0 -0
  178. {sharedbox-0.6.0 → sharedbox-0.7.0}/scripts/stream_compare.py +0 -0
  179. {sharedbox-0.6.0 → sharedbox-0.7.0}/scripts/vscode_setup.py +0 -0
  180. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_arrays.py +0 -0
  181. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_events.py +0 -0
  182. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_follow.py +0 -0
  183. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/_native/stream.hpp +0 -0
  184. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/__init__.py +0 -0
  185. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/__main__.py +0 -0
  186. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/_app.py +0 -0
  187. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/cli.py +0 -0
  188. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/contention.py +0 -0
  189. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/plot.py +0 -0
  190. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/roundtrip.py +0 -0
  191. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/size.py +0 -0
  192. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/size_diff.py +0 -0
  193. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/benchmarks/stream.py +0 -0
  194. {sharedbox-0.6.0 → sharedbox-0.7.0}/src/sharedbox/py.typed +0 -0
  195. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/conftest.py +0 -0
  196. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/CMakeLists.txt +0 -0
  197. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/bench_stream.cpp +0 -0
  198. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/compile_fail.cpp +0 -0
  199. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/consumer/CMakeLists.txt +0 -0
  200. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/table_builder.hpp +0 -0
  201. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_atomics.cpp +0 -0
  202. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_core_alone.cpp +0 -0
  203. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_fork.cpp +0 -0
  204. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_lock.cpp +0 -0
  205. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_result.cpp +0 -0
  206. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_slots.cpp +0 -0
  207. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_small_shm.cpp +0 -0
  208. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_stream.cpp +0 -0
  209. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_wait.cpp +0 -0
  210. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_windows_h.cpp +0 -0
  211. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/test_write_in_place.cpp +0 -0
  212. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/cpp/unique.hpp +0 -0
  213. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/forged_types.py +0 -0
  214. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/os_names.py +0 -0
  215. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/refs_future.py +0 -0
  216. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/streamproc.py +0 -0
  217. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/stress_helpers.py +0 -0
  218. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_contention.py +0 -0
  219. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_crashes.py +0 -0
  220. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_follow.py +0 -0
  221. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_lock_timeout.py +0 -0
  222. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_memory.py +0 -0
  223. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_read_into.py +0 -0
  224. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_waiters.py +0 -0
  225. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/stress/test_stress_watchers.py +0 -0
  226. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_benchbox_all.py +0 -0
  227. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_benchbox_contention.py +0 -0
  228. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_benchbox_plot.py +0 -0
  229. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_benchbox_roundtrip.py +0 -0
  230. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_benchbox_stream.py +0 -0
  231. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_box.py +0 -0
  232. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_box_sync_async.py +0 -0
  233. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_doc_tutorials.py +0 -0
  234. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_events_async.py +0 -0
  235. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_events_bytes.py +0 -0
  236. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_events_future.py +0 -0
  237. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_events_signals.py +0 -0
  238. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_events_sync.py +0 -0
  239. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_exit.py +0 -0
  240. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_follow.py +0 -0
  241. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_fork.py +0 -0
  242. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_codec.py +0 -0
  243. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_liveness.py +0 -0
  244. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_stream.py +0 -0
  245. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_types.py +0 -0
  246. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_wait.py +0 -0
  247. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_native_waiters.py +0 -0
  248. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_codec.py +0 -0
  249. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_forged.py +0 -0
  250. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_layout.py +0 -0
  251. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_stateful.py +0 -0
  252. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_stream.py +0 -0
  253. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_properties_types.py +0 -0
  254. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_read_into.py +0 -0
  255. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_refs.py +0 -0
  256. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_refs_lazy.py +0 -0
  257. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream_async.py +0 -0
  258. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream_events.py +0 -0
  259. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream_fork.py +0 -0
  260. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream_processes.py +0 -0
  261. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_stream_writing.py +0 -0
  262. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_arrays_bfloat16.py +0 -0
  263. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_arrays_torch.py +0 -0
  264. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_choices.py +0 -0
  265. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_records_msgspec.py +0 -0
  266. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_types_scalars.py +0 -0
  267. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_value_reuse.py +0 -0
  268. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/test_writing.py +0 -0
  269. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/type_checks/array_types.py +0 -0
  270. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/type_checks/box_types.py +0 -0
  271. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/type_checks/events_types.py +0 -0
  272. {sharedbox-0.6.0 → sharedbox-0.7.0}/tests/type_checks/stream_types.py +0 -0
  273. {sharedbox-0.6.0 → sharedbox-0.7.0}/uv.lock +0 -0
@@ -114,11 +114,11 @@ jobs:
114
114
  ref: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}
115
115
 
116
116
  - name: Build wheels
117
- uses: pypa/cibuildwheel@v4.3.2
117
+ uses: pypa/cibuildwheel@v4.3.4
118
118
  env:
119
119
  CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform_id }}
120
120
  CIBW_CONTAINER_ENGINE: "docker; create_args: --shm-size=1g"
121
- CIBW_TEST_REQUIRES: pytest hypothesis numpy
121
+ CIBW_TEST_REQUIRES: pytest hypothesis numpy attrs
122
122
  CIBW_TEST_COMMAND: pytest {project}/tests
123
123
  with:
124
124
  package-dir: .
@@ -212,11 +212,11 @@ jobs:
212
212
  shell: bash
213
213
  run: |
214
214
  uv venv --python 3.12 .stress
215
- uv pip install --python .stress wheelhouse/*.whl pytest hypothesis
215
+ uv pip install --python .stress wheelhouse/*.whl pytest hypothesis numpy attrs
216
216
  python=.stress/bin/python
217
217
  [ -x "$python" ] || python=.stress/Scripts/python.exe
218
218
  "$python" -m pytest -m stress -q -p no:cacheprovider
219
- "$python" -m pytest tests/test_properties_codec.py tests/test_properties_layout.py tests/test_properties_forged.py tests/test_properties_stateful.py -q -p no:cacheprovider --hypothesis-profile=thorough
219
+ "$python" -m pytest tests/test_properties_*.py -q -p no:cacheprovider --hypothesis-profile=thorough
220
220
 
221
221
  - uses: actions/upload-artifact@v7
222
222
  if: always()
@@ -246,7 +246,7 @@ jobs:
246
246
  - uses: actions/checkout@v7
247
247
  with:
248
248
  fetch-depth: 0
249
- ref: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}
249
+ ref: ${{ github.event.release.tag_name }}
250
250
 
251
251
  - name: Check the changelog has a section for a final release
252
252
  env:
@@ -8,6 +8,7 @@ on:
8
8
  - src/sharedbox/_native/**
9
9
  - src/sharedbox/benchmarks/ops.py
10
10
  - .github/workflows/ops.yaml
11
+ - CMakeLists.txt
11
12
  workflow_dispatch:
12
13
 
13
14
  permissions:
@@ -41,13 +42,28 @@ jobs:
41
42
 
42
43
  - name: Run benchbox ops, alternating base and head
43
44
  shell: bash
45
+ env:
46
+ # The 64k set and dict rows nearly double the job, so a pull request skips them.
47
+ SIZES: ${{ github.event_name == 'pull_request' && '[!6]*' || '*' }}
44
48
  run: |
45
49
  mkdir results
50
+ step=0
51
+ total=18 # 3 rounds x 2 sides x (int, record), plus list, set and dict once per side
46
52
  for round in 1 2 3; do
47
53
  for side in base head; do
48
- for rows in int record; do
54
+ for rows in int record list set dict; do
55
+ case "$rows" in list|set|dict) [ "$round" != 1 ] && continue ;; esac # not gated, one round is enough
56
+ step=$((step + 1))
57
+ echo "::group::[$step/$total] round $round, $side, $rows rows"
58
+ case "$rows" in
59
+ list) pattern="*list*/*" ;;
60
+ set) pattern="*set$SIZES/*" ;;
61
+ dict) pattern="*dict$SIZES/*" ;;
62
+ *) pattern="*$rows/SharedBox" ;;
63
+ esac
49
64
  (cd "$side" && uv run --no-sync benchbox ops --fast \
50
- --filter "*$rows/SharedBox" --json "../results/$side-$round-$rows.json")
65
+ --filter "$pattern" --json "../results/$side-$round-$rows.json")
66
+ echo "::endgroup::"
51
67
  done
52
68
  done
53
69
  done
@@ -69,7 +85,9 @@ jobs:
69
85
  side = path.name.split("-")[0]
70
86
  for bench in pyperf.BenchmarkSuite.load(str(path)).get_benchmarks():
71
87
  means.setdefault((bench.get_name(), side), []).append(bench.mean())
72
- print("### benchbox ops on Windows cp311, median of three rounds")
88
+ print("### benchbox ops on Windows cp311, median of three rounds, list, set and dict rows one round")
89
+ print()
90
+ print("A pull request skips the 64k set and dict rows; start the workflow by hand for them.")
73
91
  print()
74
92
  print(machine())
75
93
  print()
@@ -9,6 +9,90 @@ Dates are marked as `DD-MM-YYYY`
9
9
 
10
10
  <!-- towncrier release notes start -->
11
11
 
12
+ ## [0.7.0](https://github.com/jacopoabramo/sharedbox/releases/tag/v0.7.0) - 28-10-2026
13
+
14
+ ### Added
15
+
16
+ - `np.int8`, `np.int16`, `np.int32`, `np.uint8`, `np.uint16`, `np.uint32`,
17
+ `np.uint64`, `np.float16`, `np.float32`, `np.complex64` and `np.datetime64`
18
+ as field types, record members, collection elements and stream items,
19
+ stored at their own width as kinds 13 to 23 of box layout 3.1 and stream
20
+ layout 1.1. A field reads back as its numpy type, and a value that does not
21
+ fit the width raises `OverflowError`. A `np.datetime64` field stores
22
+ nanoseconds since 1970. ([#66](https://github.com/jacopoabramo/sharedbox/pull/66))
23
+ - `sbx_read_float16`, `sbx_write_float16`, `sbx_read_float32` and
24
+ `sbx_write_float32` in `sharedbox_c.h`. ([#66](https://github.com/jacopoabramo/sharedbox/pull/66))
25
+ - An array annotated `X | None` as a field, record member or stream item,
26
+ holding `None` or an array of its sizes, as in
27
+ `scan: npt.NDArray[np.uint8] | None = field(default=None, shape=(32, 32))`.
28
+ `receive_into` does not fill one. ([#67](https://github.com/jacopoabramo/sharedbox/pull/67))
29
+ - `field(capacity=...)`: the capacity of a box field of text, bytes,
30
+ `bytearray`, `Decimal` or a collection, as in
31
+ `samples: list[float] = field(capacity=16)`. ([#68](https://github.com/jacopoabramo/sharedbox/pull/68))
32
+ - An array member of a dataclass or attrs record takes its sizes from
33
+ `metadata={"shape": (32, 32)}` on its field. ([#68](https://github.com/jacopoabramo/sharedbox/pull/68))
34
+ - `BoundedList[T]`: a list value that keeps the stored bytes of a list field,
35
+ as in `samples: Annotated[BoundedList[float], Capacity(65536)]`. It takes
36
+ every element type `list[T]` takes and is stored as `list[T]` is. A read
37
+ copies the bytes without decoding an element, a write of a `BoundedList` of
38
+ the field's element type copies them back, indexing decodes or encodes one
39
+ element, and a change past the capacity raises `ValueError`. Subclasses,
40
+ generic or with a fixed element type, can be declared in its place. ([#73](https://github.com/jacopoabramo/sharedbox/pull/73))
41
+ - `BoundedSet[T]`: a set value that keeps the stored bytes of a set field,
42
+ as in `seen: Annotated[BoundedSet[int], Capacity(65536)]`. It is stored as
43
+ `set[T]` is. A read copies the bytes without decoding an element, a write
44
+ of a `BoundedSet` of the field's element type copies them back, and `in`,
45
+ `add` and `remove` encode one key and compare stored bytes, through an
46
+ index after 64 lookups in a set of more than 8 elements. The set operators take any set and return a
47
+ `BoundedSet` of the same class and capacity, the comparisons take any set,
48
+ and a change past the capacity raises `ValueError`. A declaration raises
49
+ `TypeError` for an element type whose equal values could be stored
50
+ differently, such as `Decimal` or `int | float`. Subclasses, generic or
51
+ with a fixed element type, can be declared in its place. ([#77](https://github.com/jacopoabramo/sharedbox/pull/77))
52
+ - `BoundedDict[K, V]`: a dict value that keeps the stored bytes of a dict
53
+ field, as in `weights: Annotated[BoundedDict[int, float], Capacity(4096)]`.
54
+ It is stored as `dict[K, V]` is. A read copies the bytes without decoding
55
+ an item, a write of a `BoundedDict` of the field's key and value types
56
+ copies them back, and `d[key]`, `get` and `in` encode one key and compare
57
+ stored bytes, through an index after 64 lookups in a dict of more than 8
58
+ keys. It keeps insertion order, `|` takes any mapping and returns a
59
+ `BoundedDict` of the same class and capacity, and a change past the
60
+ capacity raises `ValueError`. Keys follow the rules of `BoundedSet`
61
+ elements, and values can be of any type a `dict` field holds. Subclasses,
62
+ generic or with fixed key and value types, can be declared in its place. ([#82](https://github.com/jacopoabramo/sharedbox/pull/82))
63
+ - `BoundedList` of `int`, `float`, `bool`, `complex` or NumPy integer, float,
64
+ complex or `bool_` elements supports the buffer protocol: `np.asarray(value)`
65
+ and `memoryview(value)` share its elements without decoding them, read only
66
+ for `bool` and `bool_`, and a change of length raises `BufferError` while
67
+ such a view exists. ([#85](https://github.com/jacopoabramo/sharedbox/pull/85))
68
+
69
+ ### Changed
70
+
71
+ - Reading a `list`, `tuple`, `set`, `frozenset` or `dict` field allocates and
72
+ copies less, and reading a record whose class takes every member by position
73
+ no longer builds a dict of keyword arguments. ([#65](https://github.com/jacopoabramo/sharedbox/pull/65))
74
+ - A union stores a number through its first member of the same kind of
75
+ number, so `np.int64(5)` written to `float | int` reads back as `5`. ([#66](https://github.com/jacopoabramo/sharedbox/pull/66))
76
+ - `int`, `float`, `complex` and `bool` fields take numpy's integer, floating,
77
+ complex and bool scalars, and read back the Python type. `np.int64`,
78
+ `np.float64`, `np.complex128` and `np.bool_` fields read back as those types
79
+ and hash as `int`, `float`, `complex` and `bool`. ([#66](https://github.com/jacopoabramo/sharedbox/pull/66))
80
+ - The extension is compiled for speed instead of size. Writing a `list`, `set`
81
+ or `dict` field, and reading, indexing or looking up a `BoundedList` or
82
+ `BoundedSet`, take less time. The wheels are about 75 KB larger on Linux and
83
+ 17 KB larger on Windows. ([#79](https://github.com/jacopoabramo/sharedbox/pull/79))
84
+
85
+ ### Fixed
86
+
87
+ - A `list`, `set` or `dict` whose slots end short of its alignment, such as
88
+ `Annotated[list[Color], Capacity(3)]` for an `Enum` `Color`, is accepted;
89
+ its size is rounded up to the alignment. `sharedbox` 0.6 refuses a segment
90
+ that holds one. ([#66](https://github.com/jacopoabramo/sharedbox/pull/66))
91
+ - A `TypeError` about the sizes of an array member of a dataclass or attrs
92
+ record names its metadata shape, as in `metadata shape (3)`, instead of
93
+ `field(shape=...)`. ([#70](https://github.com/jacopoabramo/sharedbox/pull/70))
94
+
95
+
12
96
  ## [0.6.0](https://github.com/jacopoabramo/sharedbox/releases/tag/v0.6.0) - 24-10-2026
13
97
 
14
98
  ### Added
@@ -14,8 +14,8 @@ the layout and the native module converts values.
14
14
  sharedbox/
15
15
  |-- include/sharedbox/
16
16
  | |-- core.hpp what every segment kind uses: result and error, liveness, names, mappings, the open step, waiter slots, the type codec
17
- | |-- box.hpp box layout 3.0 and its protocols: create, publish, open, lock, read, write, capsule handle
18
- | |-- stream.hpp stream layout 1.0: create, open, the sender, readers, the gate, dead ends
17
+ | |-- box.hpp box layout 3.1 and its protocols: create, publish, open, lock, read, write, capsule handle
18
+ | |-- stream.hpp stream layout 1.1: create, open, the sender, readers, the gate, dead ends
19
19
  | |-- sharedbox.hpp includes every kind; the header consumers include
20
20
  | |-- sharedbox_c.h minimal C interface: sbx_open, sbx_import, sbx_read, sbx_write, sbx_schema_hash, sbx_release, sbx_field_desc, typed sbx_read_* and sbx_write_*
21
21
  | `-- sharedbox_c.cpp its implementation, compiled by the consumer (CMake target sharedbox::c)
@@ -53,7 +53,7 @@ sharedbox/
53
53
  | | checks every value of an update before any is written,
54
54
  | | with_record reads the whole record at once
55
55
  | |-- types.{hpp,cpp} Types: conversions of kinds above 5, arrays
56
- | |-- scalars.{hpp,cpp} kinds 6 to 12, the datetime C API on full-API builds
56
+ | |-- scalars.{hpp,cpp} kinds 6 to 23, the datetime C API on full-API builds
57
57
  | |-- segment.{hpp,cpp} Segment: a sharedbox::handle plus error messages and the lifetime lock
58
58
  | `-- stream.{hpp,cpp} Stream, Sender and Reader: the Python binding of a stream and its errors
59
59
  |-- tests/ pytest; many tests spawn processes
@@ -91,7 +91,7 @@ sharedbox/
91
91
  | |-- examples/ one script per how-to guide, included by the guide
92
92
  | |-- javascripts/charts.js draws each div of class sbx-chart from a plotly figure JSON file
93
93
  | |-- assets/benchmarks/ the figure JSON files of the performance page, from benchbox plot
94
- | `-- reference/segment-layout.md core 1.0, box layout 3.0, names and protocols
94
+ | `-- reference/segment-layout.md core 1.0, box layout 3.1, names and protocols
95
95
  |-- includes/abbreviations.md acronym tooltips appended to every page
96
96
  |-- zensical.toml site configuration and navigation
97
97
  |-- .github/workflows/ci.yaml lint, docs check, C++ tests, cibuildwheel wheels, tests, stress,
@@ -135,11 +135,11 @@ class's identity (the `identity` class keyword, by default
135
135
  always asks for a new name and raises `SegmentExistsError` if it is taken.
136
136
 
137
137
  Every segment starts with the same 64-byte line, whatever its kind. Core
138
- version 1.0, box layout 3.0, from offset 0:
138
+ version 1.0, box layout 3.1, from offset 0:
139
139
 
140
140
  - Common line 0, written once at creation: `magic` (`SBX_BOX_` for a box,
141
141
  `SBX_STRM` for a stream), `core_major` 1, `core_minor` 0, `kind_major` 3,
142
- `kind_minor` 0, `schema_hash`, `create_id`, `creator_start`,
142
+ `kind_minor` 1, `schema_hash`, `create_id`, `creator_start`,
143
143
  `creator_pidns`, `creator_pid`, `waiter_slots`, `size`.
144
144
  - Box line 1, at offset 64: `seq` (sequence lock; the generation is
145
145
  `seq >> 1`, there is no generation field), `writer_pid`, `wake_word`,
@@ -155,7 +155,8 @@ version 1.0, box layout 3.0, from offset 0:
155
155
  `asleep_on`: the offset of the count the slot's current wait added 1 to,
156
156
  which freeing a dead owner's slot takes back), then the description
157
157
  table of `types_size` bytes. Kinds are 0 to 5, 6 to 12 (fixed-size
158
- scalars) and 64 to 74 (described types).
158
+ scalars), 13 to 23 (fixed-width numbers and `datetime64`) and 64 to 74
159
+ (described types).
159
160
  - The record, at a multiple of 64. The mapping size is rounded up to 4 KiB.
160
161
  `record + record_size <= 2**32 - 4096`.
161
162
 
@@ -41,11 +41,16 @@ nanobind_add_module(_native
41
41
  STABLE_ABI
42
42
  FREE_THREADED
43
43
  LTO
44
+ NOMINSIZE
44
45
  NB_DOMAIN sharedbox
45
46
  src/sharedbox/_native/codec.cpp
47
+ src/sharedbox/_native/collection.cpp
48
+ src/sharedbox/_native/dict.cpp
49
+ src/sharedbox/_native/keys.cpp
46
50
  src/sharedbox/_native/module.cpp
47
51
  src/sharedbox/_native/scalars.cpp
48
52
  src/sharedbox/_native/segment.cpp
53
+ src/sharedbox/_native/set.cpp
49
54
  src/sharedbox/_native/stream.cpp
50
55
  src/sharedbox/_native/types.cpp)
51
56
  target_link_libraries(_native PRIVATE sharedbox::headers)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sharedbox
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Python containers using shared memory.
5
5
  Author-Email: Jacopo Abramo <jacopo.abramo@gmail.com>
6
6
  License-Expression: Apache-2.0