omnimalloc 0.5.0__tar.gz → 0.6.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 (230) hide show
  1. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.gitignore +4 -0
  2. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/CMakeLists.txt +6 -6
  3. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/PKG-INFO +8 -8
  4. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/README.md +7 -7
  5. omnimalloc-0.6.0/examples/01_basic.py +26 -0
  6. omnimalloc-0.6.0/examples/02_plotting.py +29 -0
  7. omnimalloc-0.6.0/examples/03_allocators.py +43 -0
  8. omnimalloc-0.6.0/examples/04_sources.py +39 -0
  9. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/examples/05_benchmark.py +12 -12
  10. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/pyproject.toml +4 -2
  11. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/benchmark_allocation.py +5 -4
  12. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/benchmark_pressure.py +70 -75
  13. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/generate_readme_assets.py +73 -73
  14. omnimalloc-0.6.0/scripts/stress_omni.py +292 -0
  15. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/best_fit.cpp +4 -14
  16. omnimalloc-0.6.0/src/cpp/allocators/best_fit.hpp +20 -0
  17. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/first_fit.cpp +32 -144
  18. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/first_fit.hpp +25 -48
  19. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/local_search.cpp +6 -7
  20. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/local_search.hpp +5 -6
  21. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/omni.cpp +4 -15
  22. omnimalloc-0.6.0/src/cpp/allocators/omni.hpp +25 -0
  23. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/simulated_annealing.cpp +11 -13
  24. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/simulated_annealing.hpp +13 -19
  25. omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.cpp → omnimalloc-0.6.0/src/cpp/allocators/supermalloc.cpp +46 -25
  26. omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.hpp → omnimalloc-0.6.0/src/cpp/allocators/supermalloc.hpp +24 -20
  27. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/tabu_search.cpp +10 -11
  28. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/tabu_search.hpp +12 -19
  29. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/telamalloc.cpp +17 -16
  30. omnimalloc-0.6.0/src/cpp/allocators/telamalloc.hpp +46 -0
  31. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/antichain.cpp +15 -12
  32. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/antichain.hpp +13 -9
  33. omnimalloc-0.5.0/src/cpp/primitives/clock_rows.hpp → omnimalloc-0.6.0/src/cpp/analysis/clock.hpp +17 -4
  34. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/closure.cpp +32 -22
  35. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/closure.hpp +14 -10
  36. omnimalloc-0.6.0/src/cpp/analysis/conflicts.cpp +164 -0
  37. omnimalloc-0.6.0/src/cpp/analysis/conflicts.hpp +57 -0
  38. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/linearize.cpp +7 -5
  39. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/linearize.hpp +7 -16
  40. {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/placement.cpp +14 -69
  41. omnimalloc-0.6.0/src/cpp/analysis/placement.hpp +22 -0
  42. omnimalloc-0.6.0/src/cpp/bindings.cpp +244 -0
  43. omnimalloc-0.5.0/src/cpp/allocators/defaults.hpp → omnimalloc-0.6.0/src/cpp/common/deadline.hpp +17 -10
  44. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/allocation.cpp +5 -9
  45. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/allocation.hpp +42 -30
  46. omnimalloc-0.6.0/src/cpp/primitives/allocation_kind.hpp +47 -0
  47. omnimalloc-0.6.0/src/python/omnimalloc/__init__.py +24 -0
  48. omnimalloc-0.6.0/src/python/omnimalloc/_allocate.py +39 -0
  49. omnimalloc-0.6.0/src/python/omnimalloc/_cpp.pyi +137 -0
  50. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/__init__.py +1 -18
  51. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/base.py +13 -10
  52. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/best_fit.py +2 -2
  53. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/genetic.py +34 -34
  54. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/greedy.py +13 -8
  55. omnimalloc-0.6.0/src/python/omnimalloc/allocators/greedy_base.py +94 -0
  56. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/hillclimb.py +25 -23
  57. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/minimalloc.py +15 -12
  58. omnimalloc-0.6.0/src/python/omnimalloc/allocators/omni.py +31 -0
  59. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/random.py +6 -5
  60. omnimalloc-0.6.0/src/python/omnimalloc/allocators/simulated_annealing.py +63 -0
  61. omnimalloc-0.6.0/src/python/omnimalloc/allocators/supermalloc.py +171 -0
  62. omnimalloc-0.6.0/src/python/omnimalloc/allocators/tabu_search.py +61 -0
  63. omnimalloc-0.6.0/src/python/omnimalloc/allocators/telamalloc.py +59 -0
  64. omnimalloc-0.6.0/src/python/omnimalloc/allocators/utils.py +15 -0
  65. omnimalloc-0.6.0/src/python/omnimalloc/analysis/__init__.py +17 -0
  66. omnimalloc-0.6.0/src/python/omnimalloc/analysis/_conflicts.py +46 -0
  67. omnimalloc-0.6.0/src/python/omnimalloc/analysis/_pressure.py +131 -0
  68. omnimalloc-0.5.0/src/python/omnimalloc/primitives/vector_clock.py → omnimalloc-0.6.0/src/python/omnimalloc/analysis/clock.py +4 -2
  69. omnimalloc-0.6.0/src/python/omnimalloc/analysis/linearize.py +34 -0
  70. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/__init__.py +2 -2
  71. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/benchmark.py +7 -7
  72. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/model.py +13 -6
  73. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/onnx.py +8 -6
  74. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/export.py +2 -2
  75. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/result.py +2 -4
  76. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/visualize.py +14 -26
  77. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/__init__.py +1 -3
  78. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/base.py +6 -0
  79. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/concurrent_tiling.py +4 -3
  80. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/generator.py +15 -14
  81. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/minimalloc.py +3 -60
  82. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/pinwheel.py +5 -3
  83. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/sync_patterns.py +4 -3
  84. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/tiling.py +5 -3
  85. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/utils.py +1 -11
  86. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/__init__.py +0 -1
  87. omnimalloc-0.6.0/src/python/omnimalloc/common/constants.py +35 -0
  88. omnimalloc-0.6.0/src/python/omnimalloc/common/deadline.py +36 -0
  89. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/optional.py +1 -5
  90. omnimalloc-0.6.0/src/python/omnimalloc/common/parallel.py +20 -0
  91. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/registry.py +22 -3
  92. omnimalloc-0.6.0/src/python/omnimalloc/common/validation.py +15 -0
  93. omnimalloc-0.6.0/src/python/omnimalloc/io.py +104 -0
  94. omnimalloc-0.6.0/src/python/omnimalloc/primitives/__init__.py +12 -0
  95. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/allocation.py +2 -2
  96. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/memory.py +11 -19
  97. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/pool.py +7 -10
  98. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/utils.py +3 -1
  99. omnimalloc-0.6.0/src/python/omnimalloc/validate.py +93 -0
  100. omnimalloc-0.6.0/src/python/omnimalloc/visualize.py +603 -0
  101. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/conftest.py +9 -0
  102. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_allocators_on_sources.py +40 -41
  103. omnimalloc-0.6.0/tests/integration/test_omni_torture.py +460 -0
  104. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_supermalloc.py +11 -10
  105. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_best_fit.py +10 -10
  106. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_genetic.py +11 -11
  107. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_greedy.py +75 -66
  108. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_hillclimb.py +10 -10
  109. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_minimalloc.py +5 -5
  110. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_omni.py +18 -17
  111. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_random.py +5 -6
  112. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_simulated_annealing.py +26 -25
  113. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_supermalloc.py +46 -22
  114. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_tabu_search.py +34 -19
  115. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_telamalloc.py +22 -25
  116. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_vector_time.py +41 -46
  117. omnimalloc-0.6.0/tests/unit/analysis/test_conflicts.py +154 -0
  118. {omnimalloc-0.5.0/tests/unit → omnimalloc-0.6.0/tests/unit/analysis}/test_linearize.py +24 -5
  119. {omnimalloc-0.5.0/tests/unit/primitives → omnimalloc-0.6.0/tests/unit/analysis}/test_pressure.py +133 -85
  120. {omnimalloc-0.5.0/tests/unit → omnimalloc-0.6.0/tests/unit/analysis}/test_vector_conflict_properties.py +18 -19
  121. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/converters/test_model.py +131 -106
  122. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/converters/test_onnx.py +18 -18
  123. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_campaign.py +5 -5
  124. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_export.py +3 -3
  125. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_report.py +7 -7
  126. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_result.py +7 -6
  127. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_visualize.py +26 -2
  128. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_base.py +10 -10
  129. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_concurrent_tiling.py +6 -6
  130. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_generator.py +9 -9
  131. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_huggingface.py +3 -3
  132. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_minimalloc.py +3 -4
  133. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_pinwheel.py +6 -6
  134. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_sync_patterns.py +6 -6
  135. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_tiling.py +6 -6
  136. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/test_benchmark.py +2 -2
  137. omnimalloc-0.6.0/tests/unit/common/test_deadline.py +64 -0
  138. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/common/test_registry.py +50 -17
  139. omnimalloc-0.6.0/tests/unit/primitives/__init__.py +3 -0
  140. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_allocation.py +32 -30
  141. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_allocation_vector.py +12 -12
  142. omnimalloc-0.6.0/tests/unit/primitives/test_allocationkind.py +37 -0
  143. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_memory.py +29 -88
  144. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_pool.py +0 -24
  145. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_system.py +7 -7
  146. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/test_allocate.py +32 -34
  147. omnimalloc-0.6.0/tests/unit/test_io.py +182 -0
  148. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/test_validate.py +47 -90
  149. omnimalloc-0.6.0/tests/unit/test_visualize.py +582 -0
  150. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/uv.lock +24 -0
  151. omnimalloc-0.5.0/examples/01_basic.py +0 -26
  152. omnimalloc-0.5.0/examples/02_plotting.py +0 -29
  153. omnimalloc-0.5.0/examples/03_allocators.py +0 -51
  154. omnimalloc-0.5.0/examples/04_sources.py +0 -42
  155. omnimalloc-0.5.0/src/cpp/allocators/best_fit.hpp +0 -35
  156. omnimalloc-0.5.0/src/cpp/allocators/greedy.cpp +0 -27
  157. omnimalloc-0.5.0/src/cpp/allocators/greedy.hpp +0 -31
  158. omnimalloc-0.5.0/src/cpp/allocators/omni.hpp +0 -35
  159. omnimalloc-0.5.0/src/cpp/allocators/telamalloc.hpp +0 -53
  160. omnimalloc-0.5.0/src/cpp/bindings.cpp +0 -284
  161. omnimalloc-0.5.0/src/cpp/primitives/buffer_kind.hpp +0 -46
  162. omnimalloc-0.5.0/src/cpp/primitives/placement.hpp +0 -24
  163. omnimalloc-0.5.0/src/python/omnimalloc/__init__.py +0 -35
  164. omnimalloc-0.5.0/src/python/omnimalloc/_cpp.pyi +0 -310
  165. omnimalloc-0.5.0/src/python/omnimalloc/allocate.py +0 -41
  166. omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_base.py +0 -114
  167. omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_cpp.py +0 -87
  168. omnimalloc-0.5.0/src/python/omnimalloc/allocators/omni.py +0 -23
  169. omnimalloc-0.5.0/src/python/omnimalloc/allocators/simulated_annealing.py +0 -71
  170. omnimalloc-0.5.0/src/python/omnimalloc/allocators/supermalloc.py +0 -175
  171. omnimalloc-0.5.0/src/python/omnimalloc/allocators/tabu_search.py +0 -69
  172. omnimalloc-0.5.0/src/python/omnimalloc/allocators/telamalloc.py +0 -65
  173. omnimalloc-0.5.0/src/python/omnimalloc/allocators/utils.py +0 -25
  174. omnimalloc-0.5.0/src/python/omnimalloc/common/units.py +0 -18
  175. omnimalloc-0.5.0/src/python/omnimalloc/dump.py +0 -87
  176. omnimalloc-0.5.0/src/python/omnimalloc/primitives/__init__.py +0 -23
  177. omnimalloc-0.5.0/src/python/omnimalloc/primitives/linearize.py +0 -24
  178. omnimalloc-0.5.0/src/python/omnimalloc/primitives/pressure.py +0 -126
  179. omnimalloc-0.5.0/src/python/omnimalloc/validate.py +0 -111
  180. omnimalloc-0.5.0/src/python/omnimalloc/visualize.py +0 -451
  181. omnimalloc-0.5.0/tests/unit/allocators/test_greedy_cpp.py +0 -402
  182. omnimalloc-0.5.0/tests/unit/primitives/test_bufferkind.py +0 -37
  183. omnimalloc-0.5.0/tests/unit/test_dump.py +0 -143
  184. omnimalloc-0.5.0/tests/unit/test_visualize.py +0 -380
  185. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.clang-format +0 -0
  186. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.clang-tidy +0 -0
  187. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.pre-commit-config.yaml +0 -0
  188. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.python-version +0 -0
  189. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/LICENSE +0 -0
  190. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/allocation_dark.svg +0 -0
  191. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/allocation_light.svg +0 -0
  192. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/hero_dark.svg +0 -0
  193. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/hero_light.svg +0 -0
  194. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/quality_dark.svg +0 -0
  195. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/quality_light.svg +0 -0
  196. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/scaling_dark.svg +0 -0
  197. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/scaling_light.svg +0 -0
  198. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/examples/README.md +0 -0
  199. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/common/parallel.hpp +0 -0
  200. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/hash_utils.hpp +0 -0
  201. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/id_type.hpp +0 -0
  202. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/naive.py +0 -0
  203. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/__init__.py +0 -0
  204. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/__init__.py +0 -0
  205. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/campaign.py +0 -0
  206. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/report.py +0 -0
  207. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/utils.py +0 -0
  208. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/huggingface.py +0 -0
  209. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/tiling_base.py +0 -0
  210. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/timer.py +0 -0
  211. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/utils.py +0 -0
  212. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/directories.py +0 -0
  213. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/system.py +0 -0
  214. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/py.typed +0 -0
  215. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/__init__.py +0 -0
  216. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/__init__.py +0 -0
  217. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_examples.py +0 -0
  218. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_notebooks.py +0 -0
  219. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/__init__.py +0 -0
  220. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/__init__.py +0 -0
  221. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_naive.py +0 -0
  222. {omnimalloc-0.5.0/tests/unit/benchmark → omnimalloc-0.6.0/tests/unit/analysis}/__init__.py +0 -0
  223. {omnimalloc-0.5.0/tests/unit/benchmark/converters → omnimalloc-0.6.0/tests/unit/benchmark}/__init__.py +0 -0
  224. {omnimalloc-0.5.0/tests/unit/benchmark/results → omnimalloc-0.6.0/tests/unit/benchmark/converters}/__init__.py +0 -0
  225. {omnimalloc-0.5.0/tests/unit/benchmark/sources → omnimalloc-0.6.0/tests/unit/benchmark/results}/__init__.py +0 -0
  226. {omnimalloc-0.5.0/tests/unit/common → omnimalloc-0.6.0/tests/unit/benchmark/sources}/__init__.py +0 -0
  227. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/test_timer.py +0 -0
  228. {omnimalloc-0.5.0/tests/unit/primitives → omnimalloc-0.6.0/tests/unit/common}/__init__.py +0 -0
  229. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/common/test_directories.py +0 -0
  230. {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_utils.py +0 -0
@@ -53,6 +53,10 @@ htmlcov/
53
53
  *.gcov.json.gz
54
54
  **/artifacts/
55
55
 
56
+ # Benchmark script outputs (scripts/*.py --out)
57
+ benchmark_results_*/
58
+ stress_results_*/
59
+
56
60
  # OS
57
61
  .DS_Store
58
62
  Thumbs.db
@@ -42,18 +42,18 @@ nanobind_add_module(
42
42
  NOMINSIZE
43
43
  src/cpp/allocators/best_fit.cpp
44
44
  src/cpp/allocators/first_fit.cpp
45
- src/cpp/allocators/greedy.cpp
46
45
  src/cpp/allocators/local_search.cpp
47
46
  src/cpp/allocators/omni.cpp
48
47
  src/cpp/allocators/simulated_annealing.cpp
49
- src/cpp/allocators/supermalloc/partition.cpp
48
+ src/cpp/allocators/supermalloc.cpp
50
49
  src/cpp/allocators/tabu_search.cpp
51
50
  src/cpp/allocators/telamalloc.cpp
51
+ src/cpp/analysis/antichain.cpp
52
+ src/cpp/analysis/closure.cpp
53
+ src/cpp/analysis/conflicts.cpp
54
+ src/cpp/analysis/linearize.cpp
55
+ src/cpp/analysis/placement.cpp
52
56
  src/cpp/primitives/allocation.cpp
53
- src/cpp/primitives/antichain.cpp
54
- src/cpp/primitives/closure.cpp
55
- src/cpp/primitives/linearize.cpp
56
- src/cpp/primitives/placement.cpp
57
57
  src/cpp/bindings.cpp)
58
58
 
59
59
  target_include_directories(_cpp PRIVATE src/cpp)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: omnimalloc
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Your one-stop shop for static memory allocation.
5
5
  Keywords: memory,allocation,allocator,static-allocation
6
6
  Author-Email: Fabian Peddinghaus <fabianpedd@gmail.com>
@@ -274,15 +274,15 @@ pip install git+https://github.com/fpedd/omnimalloc.git
274
274
  ## Usage
275
275
 
276
276
  ```python
277
- from omnimalloc import Allocation, Pool, run_allocation
277
+ import omnimalloc as om
278
278
 
279
- pool = Pool(id="pool", allocations=(
280
- Allocation(id=0, size=64, start=0, end=10),
281
- Allocation(id=1, size=64, start=12, end=20),
282
- Allocation(id=2, size=32, start=5, end=15),
279
+ pool = om.Pool(id="pool", allocations=(
280
+ om.Allocation(id=0, size=64, start=0, end=10),
281
+ om.Allocation(id=1, size=64, start=12, end=20),
282
+ om.Allocation(id=2, size=32, start=5, end=15),
283
283
  ))
284
284
 
285
- pool = run_allocation(pool, allocator="supermalloc_allocator", validate=True)
285
+ pool = om.allocate(pool, allocator="supermalloc", validate=True)
286
286
 
287
287
  print(pool.size) # 96
288
288
  print([alloc.offset for alloc in pool.allocations]) # [0, 0, 64]
@@ -335,4 +335,4 @@ uv run pre-commit run --all-files
335
335
 
336
336
  ## License
337
337
 
338
- Copyright 2025 Fabian Peddinghaus. Licensed under Apache 2.0 License. See [LICENSE](LICENSE) for details.
338
+ Copyright 2025-2026 Fabian Peddinghaus. Licensed under Apache 2.0 License. See [LICENSE](LICENSE) for details.
@@ -38,15 +38,15 @@ pip install git+https://github.com/fpedd/omnimalloc.git
38
38
  ## Usage
39
39
 
40
40
  ```python
41
- from omnimalloc import Allocation, Pool, run_allocation
41
+ import omnimalloc as om
42
42
 
43
- pool = Pool(id="pool", allocations=(
44
- Allocation(id=0, size=64, start=0, end=10),
45
- Allocation(id=1, size=64, start=12, end=20),
46
- Allocation(id=2, size=32, start=5, end=15),
43
+ pool = om.Pool(id="pool", allocations=(
44
+ om.Allocation(id=0, size=64, start=0, end=10),
45
+ om.Allocation(id=1, size=64, start=12, end=20),
46
+ om.Allocation(id=2, size=32, start=5, end=15),
47
47
  ))
48
48
 
49
- pool = run_allocation(pool, allocator="supermalloc_allocator", validate=True)
49
+ pool = om.allocate(pool, allocator="supermalloc", validate=True)
50
50
 
51
51
  print(pool.size) # 96
52
52
  print([alloc.offset for alloc in pool.allocations]) # [0, 0, 64]
@@ -99,4 +99,4 @@ uv run pre-commit run --all-files
99
99
 
100
100
  ## License
101
101
 
102
- Copyright 2025 Fabian Peddinghaus. Licensed under Apache 2.0 License. See [LICENSE](LICENSE) for details.
102
+ Copyright 2025-2026 Fabian Peddinghaus. Licensed under Apache 2.0 License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,26 @@
1
+ #
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+
5
+ import omnimalloc as om
6
+
7
+
8
+ def main() -> None:
9
+ # Define allocations with temporal bounds
10
+ alloc_0 = om.Allocation(id="alloc_0", size=5, start=0, end=10)
11
+ alloc_1 = om.Allocation(id="alloc_1", size=5, start=12, end=20)
12
+ alloc_2 = om.Allocation(id="alloc_2", size=4, start=5, end=15)
13
+ alloc_3 = om.Allocation(id="alloc_3", size=5, start=15, end=23)
14
+
15
+ # Create pool and allocate
16
+ pool = om.Pool(id="pool_0", allocations=(alloc_0, alloc_1, alloc_2, alloc_3))
17
+ pool = om.allocate(pool, validate=True)
18
+
19
+ # View results
20
+ print(f"Pool {pool.id!r} size: {pool.size}")
21
+ for alloc in pool.allocations:
22
+ print(f" {alloc.id!r} offset: {alloc.offset}")
23
+
24
+
25
+ if __name__ == "__main__":
26
+ main()
@@ -0,0 +1,29 @@
1
+ #
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+
5
+ import omnimalloc as om
6
+
7
+
8
+ def main() -> None:
9
+ # Define allocations with temporal bounds
10
+ alloc_0 = om.Allocation(id="alloc_0", size=5, start=0, end=10)
11
+ alloc_1 = om.Allocation(id="alloc_1", size=5, start=12, end=20)
12
+ alloc_2 = om.Allocation(id="alloc_2", size=4, start=5, end=15)
13
+ alloc_3 = om.Allocation(id="alloc_3", size=5, start=15, end=23)
14
+
15
+ # Create pool and allocate
16
+ pool = om.Pool(id="pool_0", allocations=(alloc_0, alloc_1, alloc_2, alloc_3))
17
+ pool = om.allocate(pool, validate=True)
18
+
19
+ # View results
20
+ print(f"Pool {pool.id!r} size: {pool.size}")
21
+ for alloc in pool.allocations:
22
+ print(f" {alloc.id!r} offset: {alloc.offset}")
23
+
24
+ # Visualize (requires matplotlib)
25
+ om.plot_allocation(pool, "allocation.pdf")
26
+
27
+
28
+ if __name__ == "__main__":
29
+ main()
@@ -0,0 +1,43 @@
1
+ #
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+
5
+ from pathlib import Path
6
+
7
+ import omnimalloc as om
8
+ from omnimalloc.allocators import DEFAULT_ALLOCATOR, available_allocators
9
+ from omnimalloc.allocators.minimalloc import HAS_MINIMALLOC
10
+
11
+
12
+ def main() -> None:
13
+ example_dir = Path("03_example_output")
14
+
15
+ # Define allocations with temporal bounds
16
+ alloc_0 = om.Allocation(id="alloc_0", size=5, start=0, end=10)
17
+ alloc_1 = om.Allocation(id="alloc_1", size=5, start=12, end=20)
18
+ alloc_2 = om.Allocation(id="alloc_2", size=4, start=5, end=15)
19
+ alloc_3 = om.Allocation(id="alloc_3", size=5, start=15, end=23)
20
+
21
+ # Create pool and allocate
22
+ pool = om.Pool(id="pool_0", allocations=(alloc_0, alloc_1, alloc_2, alloc_3))
23
+
24
+ # Get and run the default allocator
25
+ print(f"Running allocation with default allocator: {DEFAULT_ALLOCATOR}")
26
+ pool = om.allocate(pool, allocator=DEFAULT_ALLOCATOR, validate=True)
27
+ print(f"Pool {pool.id!r} size: {pool.size}")
28
+ om.plot_allocation(pool, example_dir / f"{DEFAULT_ALLOCATOR}_default.pdf")
29
+
30
+ # Run allocation with all available allocators
31
+ for allocator_name in available_allocators():
32
+ # minimalloc is an optional dependency that only builds on some platforms
33
+ if "minimalloc" in allocator_name and not HAS_MINIMALLOC:
34
+ print(f"Skipping unavailable allocator: {allocator_name}")
35
+ continue
36
+ print(f"Running allocation with allocator: {allocator_name}")
37
+ pool = om.allocate(pool, allocator_name, validate=True)
38
+ print(f"Pool {pool.id!r} size: {pool.size}")
39
+ om.plot_allocation(pool, example_dir / f"{allocator_name}.pdf")
40
+
41
+
42
+ if __name__ == "__main__":
43
+ main()
@@ -0,0 +1,39 @@
1
+ #
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+
5
+ from pathlib import Path
6
+
7
+ import omnimalloc as om
8
+ from omnimalloc.benchmark.sources import (
9
+ DEFAULT_SOURCE,
10
+ BaseSource,
11
+ available_sources,
12
+ )
13
+
14
+
15
+ def allocate_and_plot(source: BaseSource, output: Path) -> None:
16
+ pool = source.get_pool()
17
+ pool = om.allocate(pool, validate=True)
18
+ print(f"Pool {pool.id!r} size: {pool.size}")
19
+ om.plot_allocation(pool, output)
20
+
21
+
22
+ def main() -> None:
23
+ example_dir = Path("04_example_output")
24
+
25
+ # Get and use the default source
26
+ default_source = BaseSource.get(DEFAULT_SOURCE)()
27
+ print(f"Using default source: {DEFAULT_SOURCE}")
28
+ allocate_and_plot(
29
+ default_source, example_dir / f"source_{DEFAULT_SOURCE}_default.pdf"
30
+ )
31
+
32
+ for source_name in available_sources():
33
+ source = BaseSource.get(source_name)()
34
+ print(f"Using source: {source_name}")
35
+ allocate_and_plot(source, example_dir / f"source_{source_name}.pdf")
36
+
37
+
38
+ if __name__ == "__main__":
39
+ main()
@@ -17,25 +17,25 @@ def main() -> None:
17
17
 
18
18
  # Define allocators, sources, and variants to benchmark
19
19
  allocators = (
20
- "greedy_by_size_allocator",
21
- "greedy_by_size_allocator_cpp",
22
- "greedy_by_all_allocator_cpp",
23
- "best_fit_allocator",
24
- "telamalloc_allocator",
20
+ "greedy_by_size",
21
+ "greedy_by_all",
22
+ "omni",
23
+ "best_fit",
24
+ "telamalloc",
25
25
  )
26
26
  # minimalloc is an optional dependency that only builds on some platforms
27
27
  if HAS_MINIMALLOC:
28
- allocators += ("minimalloc_allocator",)
28
+ allocators += ("minimalloc",)
29
29
  sources = (
30
- "random_source",
31
- "minimalloc_source",
32
- "huggingface_source",
30
+ "random",
31
+ "minimalloc",
32
+ "huggingface",
33
33
  )
34
34
  # Counts for the parameterizable source, "first 5" for the fixed ones
35
35
  variants = {
36
- "random_source": (10, 50, 100, 250, 500),
37
- "minimalloc_source": 5,
38
- "huggingface_source": 5,
36
+ "random": (10, 50, 100, 250, 500),
37
+ "minimalloc": 5,
38
+ "huggingface": 5,
39
39
  }
40
40
 
41
41
  # Run benchmark campaign
@@ -54,13 +54,14 @@ dev = [
54
54
  "pre-commit>=4.0.0",
55
55
  "pytest>=8.0",
56
56
  "pytest-cov>=7.0.0",
57
+ "pytest-xdist>=3.6.0",
57
58
  "ruff>=0.14.0",
58
59
  "ty>=0.0.1a26",
59
60
  ]
60
61
 
61
62
  [tool.scikit-build]
62
63
  wheel.packages = ["src/python/omnimalloc"]
63
- cmake.build-type = "Release" # TODO(fpedd): Cross-check with CMakeLists.txt
64
+ cmake.build-type = "Release" # TODO(fpedd): Cross-check with CMakeLists.txt
64
65
  build-dir = "build/{wheel_tag}"
65
66
  sdist.include = ["src/cpp/**"]
66
67
  sdist.exclude = [".github", "notebooks", "external"]
@@ -137,7 +138,8 @@ ignore = [
137
138
 
138
139
  [tool.pytest.ini_options]
139
140
  testpaths = ["tests"]
140
- addopts = ["--import-mode=importlib"]
141
+ addopts = ["--import-mode=importlib", "-m", "not slow"]
142
+ markers = ["slow: exhaustive stress grids (deselected by default)"]
141
143
  log_cli = true
142
144
  log_cli_level = "INFO"
143
145
  log_cli_format = "%(asctime)s [%(levelname)s] %(message)s (%(filename)s:%(lineno)d)"
@@ -48,10 +48,11 @@ NUM_SYNCS = (0, 64, 1_024)
48
48
  # fall back to peak-bound sanity checks on larger instances
49
49
  VALIDATE_LIMIT = 2_000
50
50
  ALLOCATORS = (
51
- "greedy_by_all_allocator_cpp",
52
- "greedy_allocator_cpp",
53
- "best_fit_allocator",
54
- "naive_allocator",
51
+ "omni",
52
+ "greedy_by_all",
53
+ "greedy",
54
+ "best_fit",
55
+ "naive",
55
56
  )
56
57
 
57
58
  SURFACE = "#fcfcfb"
@@ -3,34 +3,34 @@
3
3
  #
4
4
  """Benchmark exact pressure lower bounds on vector-clock workloads.
5
5
 
6
- Compares the shipping ``get_pressure`` (linearize then sweep, else the exact
7
- antichain) against the two exact C++ methods:
6
+ Compares the shipping ``pressure`` (linearize then sweep, else the exact
7
+ antichain, under the default work budget) against the two exact C++ methods:
8
8
 
9
- - ``get_antichain_pressure``: max-weight antichain (weighted Dilworth via
10
- min flow), the tightest sound lower bound on any placement's peak and the
11
- reference every ratio is measured against
12
- - ``get_closure_pressure``: realizable peak via join-closure enumeration;
9
+ - ``pressure(work_budget=None)``: unbudgeted max-weight antichain
10
+ (weighted Dilworth via min flow), the tightest sound lower bound on any
11
+ placement's peak and the reference every ratio is measured against
12
+ - ``closure_pressure``: realizable peak via join-closure enumeration;
13
13
  instances whose closure exceeds ``--closure-cap`` are reported as capped
14
- and excluded from the means
14
+ and excluded from the means. Instances where ``pressure`` exceeds its
15
+ default work budget are reported the same way
15
16
 
16
17
  and their per-allocation counterparts (dashed in the figures; ratios are
17
18
  means over the per-allocation pinned antichain):
18
19
 
19
- - ``get_per_allocation_pressure``: pinned antichain per distinct lifetime
20
- - ``get_per_allocation_closure_pressure``: realizable peak per allocation
21
- - ``get_per_allocation_placement_pressure``: placement-certified bound read
22
- off an untimed ``OmniAllocator`` placement, plain and ``clique_cap`` forms
20
+ - ``pressure_per_allocation``: pinned antichain per distinct lifetime
21
+ - ``closure_pressure_per_allocation``: realizable peak per allocation
22
+ - ``placement_pressure_per_allocation``: placement-certified bound read
23
+ off an untimed ``OmniAllocator`` placement
23
24
 
24
25
  Each sample also places the workload with ``OmniAllocator`` and reports its
25
26
  peak over the antichain bound, so a ratio of 1.000 certifies the placement
26
- optimal. Every sample cross-checks the bound order — globally ``get_pressure``
27
+ optimal. Every sample cross-checks the bound order — globally ``pressure``
27
28
  equal to the antichain, closure at or below it, omni peak at or above it,
28
29
  antichain at or below the tiling optimum; per allocation closure <= pinned
29
- antichain <= clique-capped <= plain placement, with each per-allocation max
30
- matching its global counterpart and the plain placement max matching the
31
- placement's peak — so the sweep doubles as a torture pass for the exact
32
- primitives. Any method whose single run exceeds ``--budget`` seconds is
33
- dropped for the rest of the sweep.
30
+ antichain <= placement, with each per-allocation max matching its global
31
+ counterpart and the placement max matching the placement's peak — so the
32
+ sweep doubles as a torture pass for the exact primitives. Any method whose
33
+ single run exceeds ``--budget`` seconds is dropped for the rest of the sweep.
34
34
 
35
35
  uv run python scripts/benchmark_pressure.py --out benchmark_results_pressure
36
36
  """
@@ -45,17 +45,17 @@ from typing import TYPE_CHECKING, Any
45
45
 
46
46
  import matplotlib.pyplot as plt
47
47
  from omnimalloc import OmniAllocator
48
+ from omnimalloc.analysis import (
49
+ closure_pressure,
50
+ closure_pressure_per_allocation,
51
+ placement_pressure,
52
+ placement_pressure_per_allocation,
53
+ pressure,
54
+ pressure_per_allocation,
55
+ )
48
56
  from omnimalloc.benchmark.sources.concurrent_tiling import ConcurrentTilingSource
49
57
  from omnimalloc.benchmark.sources.sync_patterns import SYNC_PATTERNS, SyncPatternSource
50
58
  from omnimalloc.benchmark.timer import Timer
51
- from omnimalloc.primitives import (
52
- get_antichain_pressure,
53
- get_closure_pressure,
54
- get_per_allocation_closure_pressure,
55
- get_per_allocation_placement_pressure,
56
- get_per_allocation_pressure,
57
- )
58
- from omnimalloc.primitives.pressure import get_pressure
59
59
 
60
60
  if TYPE_CHECKING:
61
61
  from collections.abc import Callable
@@ -69,17 +69,16 @@ if TYPE_CHECKING:
69
69
 
70
70
  SIZES = (100, 300, 1_000, 3_000, 10_000)
71
71
  NUM_SYNCS = (0, 64, 1_024)
72
- REFERENCE = "get_antichain_pressure"
73
- PER_ALLOCATION_REFERENCE = "get_per_allocation_pressure"
72
+ REFERENCE = "pressure(work_budget=None)"
73
+ PER_ALLOCATION_REFERENCE = "pressure_per_allocation"
74
74
  METHODS = (
75
- "get_pressure",
75
+ "pressure",
76
76
  REFERENCE,
77
- "get_closure_pressure",
78
- "omni_allocator",
77
+ "closure_pressure",
78
+ "omni",
79
79
  PER_ALLOCATION_REFERENCE,
80
- "get_per_allocation_closure_pressure",
81
- "get_per_allocation_placement_pressure",
82
- "placement_clique_cap",
80
+ "closure_pressure_per_allocation",
81
+ "placement_pressure_per_allocation",
83
82
  )
84
83
  DEFAULT_CLOSURE_CAP = 1 << 16
85
84
 
@@ -90,31 +89,24 @@ INK_MUTED = "#898781"
90
89
  GRID = "#e1e0d9"
91
90
  AXIS = "#c3c2b7"
92
91
  COLORS = {
93
- "get_pressure": "#2a78d6",
94
- "get_antichain_pressure": "#1baf7a",
95
- "get_closure_pressure": "#eda100",
96
- "omni_allocator": "#4a3aa7",
97
- "get_per_allocation_pressure": "#1baf7a",
98
- "get_per_allocation_closure_pressure": "#eda100",
99
- "get_per_allocation_placement_pressure": "#4a3aa7",
100
- "placement_clique_cap": "#4a3aa7",
92
+ "pressure": "#2a78d6",
93
+ REFERENCE: "#1baf7a",
94
+ "closure_pressure": "#eda100",
95
+ "omni": "#4a3aa7",
96
+ "pressure_per_allocation": "#1baf7a",
97
+ "closure_pressure_per_allocation": "#eda100",
98
+ "placement_pressure_per_allocation": "#4a3aa7",
101
99
  }
102
100
  # Per-allocation variants share their global counterpart's color, dashed
103
101
  LINESTYLES = {
104
- "get_per_allocation_pressure": "--",
105
- "get_per_allocation_closure_pressure": "--",
106
- "get_per_allocation_placement_pressure": "--",
107
- "placement_clique_cap": ":",
102
+ "pressure_per_allocation": "--",
103
+ "closure_pressure_per_allocation": "--",
104
+ "placement_pressure_per_allocation": "--",
108
105
  }
109
106
 
110
107
  Sample = dict[str, Any]
111
108
 
112
109
 
113
- def _peak(placed: tuple[Allocation, ...]) -> int:
114
- heights = [alloc.height for alloc in placed if alloc.height is not None]
115
- return max(heights, default=0)
116
-
117
-
118
110
  def _capped(
119
111
  query: Callable[..., Any], allocations: tuple[Allocation, ...], cap: int
120
112
  ) -> Value:
@@ -125,6 +117,14 @@ def _capped(
125
117
  return None
126
118
 
127
119
 
120
+ def _budgeted(allocations: tuple[Allocation, ...]) -> Value:
121
+ """None instead of raising when pressure exceeds its work budget."""
122
+ try:
123
+ return pressure(allocations)
124
+ except RuntimeError:
125
+ return None
126
+
127
+
128
128
  def _sample_runners(
129
129
  allocations: tuple[Allocation, ...],
130
130
  placed: tuple[Allocation, ...],
@@ -132,21 +132,18 @@ def _sample_runners(
132
132
  args: argparse.Namespace,
133
133
  ) -> dict[str, Runner]:
134
134
  return {
135
- "get_pressure": lambda: get_pressure(allocations),
136
- REFERENCE: lambda: get_antichain_pressure(allocations),
137
- "get_closure_pressure": lambda: _capped(
138
- get_closure_pressure, allocations, args.closure_cap
139
- ),
140
- "omni_allocator": lambda: _peak(allocator.allocate(allocations)),
141
- PER_ALLOCATION_REFERENCE: lambda: get_per_allocation_pressure(allocations),
142
- "get_per_allocation_closure_pressure": lambda: _capped(
143
- get_per_allocation_closure_pressure, allocations, args.closure_cap
135
+ "pressure": lambda: _budgeted(allocations),
136
+ REFERENCE: lambda: pressure(allocations, work_budget=None),
137
+ "closure_pressure": lambda: _capped(
138
+ closure_pressure, allocations, args.closure_cap
144
139
  ),
145
- "get_per_allocation_placement_pressure": lambda: (
146
- get_per_allocation_placement_pressure(placed)
140
+ "omni": lambda: placement_pressure(allocator.allocate(allocations)),
141
+ PER_ALLOCATION_REFERENCE: lambda: pressure_per_allocation(allocations),
142
+ "closure_pressure_per_allocation": lambda: _capped(
143
+ closure_pressure_per_allocation, allocations, args.closure_cap
147
144
  ),
148
- "placement_clique_cap": lambda: (
149
- get_per_allocation_placement_pressure(placed, clique_cap=True)
145
+ "placement_pressure_per_allocation": lambda: (
146
+ placement_pressure_per_allocation(placed)
150
147
  ),
151
148
  }
152
149
 
@@ -199,9 +196,9 @@ def _finish_sample(
199
196
  reference = values.get(REFERENCE)
200
197
  if not reference:
201
198
  return sample
202
- assert values.get("get_pressure", reference) == reference
203
- assert values.get("get_closure_pressure", 0) <= reference
204
- assert values.get("omni_allocator", reference) >= reference
199
+ assert values.get("pressure", reference) == reference
200
+ assert values.get("closure_pressure", 0) <= reference
201
+ assert values.get("omni", reference) >= reference
205
202
  assert optimum is None or reference <= optimum
206
203
  _check_per_allocation(values, reference, placed)
207
204
  sample["ratios"] = _ratios(values, reference)
@@ -213,20 +210,18 @@ def _check_per_allocation(
213
210
  ) -> None:
214
211
  """Per-allocation identities: maxima match globals, bounds are ordered."""
215
212
  per_alloc = values.get(PER_ALLOCATION_REFERENCE)
216
- closure = values.get("get_per_allocation_closure_pressure")
217
- placement = values.get("get_per_allocation_placement_pressure")
218
- clique = values.get("placement_clique_cap")
213
+ closure = values.get("closure_pressure_per_allocation")
214
+ placement = values.get("placement_pressure_per_allocation")
219
215
  if per_alloc:
220
216
  assert max(per_alloc.values()) == reference
221
217
  for i, pinned in per_alloc.items():
222
218
  low = closure[i] if closure else pinned
223
- mid = clique[i] if clique else pinned
224
- high = placement[i] if placement else mid
225
- assert low <= pinned <= mid <= high
226
- if closure and values.get("get_closure_pressure") is not None:
227
- assert max(closure.values()) == values["get_closure_pressure"]
219
+ high = placement[i] if placement else pinned
220
+ assert low <= pinned <= high
221
+ if closure and values.get("closure_pressure") is not None:
222
+ assert max(closure.values()) == values["closure_pressure"]
228
223
  if placement:
229
- assert max(placement.values()) == _peak(placed)
224
+ assert max(placement.values()) == placement_pressure(placed)
230
225
 
231
226
 
232
227
  def _ratios(values: dict[str, Any], reference: int) -> dict[str, float]: