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.
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.gitignore +4 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/CMakeLists.txt +6 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/PKG-INFO +8 -8
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/README.md +7 -7
- omnimalloc-0.6.0/examples/01_basic.py +26 -0
- omnimalloc-0.6.0/examples/02_plotting.py +29 -0
- omnimalloc-0.6.0/examples/03_allocators.py +43 -0
- omnimalloc-0.6.0/examples/04_sources.py +39 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/examples/05_benchmark.py +12 -12
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/pyproject.toml +4 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/benchmark_allocation.py +5 -4
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/benchmark_pressure.py +70 -75
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/scripts/generate_readme_assets.py +73 -73
- omnimalloc-0.6.0/scripts/stress_omni.py +292 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/best_fit.cpp +4 -14
- omnimalloc-0.6.0/src/cpp/allocators/best_fit.hpp +20 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/first_fit.cpp +32 -144
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/first_fit.hpp +25 -48
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/local_search.cpp +6 -7
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/local_search.hpp +5 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/omni.cpp +4 -15
- omnimalloc-0.6.0/src/cpp/allocators/omni.hpp +25 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/simulated_annealing.cpp +11 -13
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/simulated_annealing.hpp +13 -19
- omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.cpp → omnimalloc-0.6.0/src/cpp/allocators/supermalloc.cpp +46 -25
- omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.hpp → omnimalloc-0.6.0/src/cpp/allocators/supermalloc.hpp +24 -20
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/tabu_search.cpp +10 -11
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/tabu_search.hpp +12 -19
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/allocators/telamalloc.cpp +17 -16
- omnimalloc-0.6.0/src/cpp/allocators/telamalloc.hpp +46 -0
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/antichain.cpp +15 -12
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/antichain.hpp +13 -9
- omnimalloc-0.5.0/src/cpp/primitives/clock_rows.hpp → omnimalloc-0.6.0/src/cpp/analysis/clock.hpp +17 -4
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/closure.cpp +32 -22
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/closure.hpp +14 -10
- omnimalloc-0.6.0/src/cpp/analysis/conflicts.cpp +164 -0
- omnimalloc-0.6.0/src/cpp/analysis/conflicts.hpp +57 -0
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/linearize.cpp +7 -5
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/linearize.hpp +7 -16
- {omnimalloc-0.5.0/src/cpp/primitives → omnimalloc-0.6.0/src/cpp/analysis}/placement.cpp +14 -69
- omnimalloc-0.6.0/src/cpp/analysis/placement.hpp +22 -0
- omnimalloc-0.6.0/src/cpp/bindings.cpp +244 -0
- omnimalloc-0.5.0/src/cpp/allocators/defaults.hpp → omnimalloc-0.6.0/src/cpp/common/deadline.hpp +17 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/allocation.cpp +5 -9
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/allocation.hpp +42 -30
- omnimalloc-0.6.0/src/cpp/primitives/allocation_kind.hpp +47 -0
- omnimalloc-0.6.0/src/python/omnimalloc/__init__.py +24 -0
- omnimalloc-0.6.0/src/python/omnimalloc/_allocate.py +39 -0
- omnimalloc-0.6.0/src/python/omnimalloc/_cpp.pyi +137 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/__init__.py +1 -18
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/base.py +13 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/best_fit.py +2 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/genetic.py +34 -34
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/greedy.py +13 -8
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/greedy_base.py +94 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/hillclimb.py +25 -23
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/minimalloc.py +15 -12
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/omni.py +31 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/random.py +6 -5
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/simulated_annealing.py +63 -0
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/supermalloc.py +171 -0
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/tabu_search.py +61 -0
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/telamalloc.py +59 -0
- omnimalloc-0.6.0/src/python/omnimalloc/allocators/utils.py +15 -0
- omnimalloc-0.6.0/src/python/omnimalloc/analysis/__init__.py +17 -0
- omnimalloc-0.6.0/src/python/omnimalloc/analysis/_conflicts.py +46 -0
- omnimalloc-0.6.0/src/python/omnimalloc/analysis/_pressure.py +131 -0
- omnimalloc-0.5.0/src/python/omnimalloc/primitives/vector_clock.py → omnimalloc-0.6.0/src/python/omnimalloc/analysis/clock.py +4 -2
- omnimalloc-0.6.0/src/python/omnimalloc/analysis/linearize.py +34 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/__init__.py +2 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/benchmark.py +7 -7
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/model.py +13 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/onnx.py +8 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/export.py +2 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/result.py +2 -4
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/visualize.py +14 -26
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/__init__.py +1 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/base.py +6 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/concurrent_tiling.py +4 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/generator.py +15 -14
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/minimalloc.py +3 -60
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/pinwheel.py +5 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/sync_patterns.py +4 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/tiling.py +5 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/utils.py +1 -11
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/__init__.py +0 -1
- omnimalloc-0.6.0/src/python/omnimalloc/common/constants.py +35 -0
- omnimalloc-0.6.0/src/python/omnimalloc/common/deadline.py +36 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/optional.py +1 -5
- omnimalloc-0.6.0/src/python/omnimalloc/common/parallel.py +20 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/registry.py +22 -3
- omnimalloc-0.6.0/src/python/omnimalloc/common/validation.py +15 -0
- omnimalloc-0.6.0/src/python/omnimalloc/io.py +104 -0
- omnimalloc-0.6.0/src/python/omnimalloc/primitives/__init__.py +12 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/allocation.py +2 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/memory.py +11 -19
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/pool.py +7 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/utils.py +3 -1
- omnimalloc-0.6.0/src/python/omnimalloc/validate.py +93 -0
- omnimalloc-0.6.0/src/python/omnimalloc/visualize.py +603 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/conftest.py +9 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_allocators_on_sources.py +40 -41
- omnimalloc-0.6.0/tests/integration/test_omni_torture.py +460 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_supermalloc.py +11 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_best_fit.py +10 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_genetic.py +11 -11
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_greedy.py +75 -66
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_hillclimb.py +10 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_minimalloc.py +5 -5
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_omni.py +18 -17
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_random.py +5 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_simulated_annealing.py +26 -25
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_supermalloc.py +46 -22
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_tabu_search.py +34 -19
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_telamalloc.py +22 -25
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_vector_time.py +41 -46
- omnimalloc-0.6.0/tests/unit/analysis/test_conflicts.py +154 -0
- {omnimalloc-0.5.0/tests/unit → omnimalloc-0.6.0/tests/unit/analysis}/test_linearize.py +24 -5
- {omnimalloc-0.5.0/tests/unit/primitives → omnimalloc-0.6.0/tests/unit/analysis}/test_pressure.py +133 -85
- {omnimalloc-0.5.0/tests/unit → omnimalloc-0.6.0/tests/unit/analysis}/test_vector_conflict_properties.py +18 -19
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/converters/test_model.py +131 -106
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/converters/test_onnx.py +18 -18
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_campaign.py +5 -5
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_export.py +3 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_report.py +7 -7
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_result.py +7 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/results/test_visualize.py +26 -2
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_base.py +10 -10
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_concurrent_tiling.py +6 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_generator.py +9 -9
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_huggingface.py +3 -3
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_minimalloc.py +3 -4
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_pinwheel.py +6 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_sync_patterns.py +6 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/sources/test_tiling.py +6 -6
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/test_benchmark.py +2 -2
- omnimalloc-0.6.0/tests/unit/common/test_deadline.py +64 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/common/test_registry.py +50 -17
- omnimalloc-0.6.0/tests/unit/primitives/__init__.py +3 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_allocation.py +32 -30
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_allocation_vector.py +12 -12
- omnimalloc-0.6.0/tests/unit/primitives/test_allocationkind.py +37 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_memory.py +29 -88
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_pool.py +0 -24
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_system.py +7 -7
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/test_allocate.py +32 -34
- omnimalloc-0.6.0/tests/unit/test_io.py +182 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/test_validate.py +47 -90
- omnimalloc-0.6.0/tests/unit/test_visualize.py +582 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/uv.lock +24 -0
- omnimalloc-0.5.0/examples/01_basic.py +0 -26
- omnimalloc-0.5.0/examples/02_plotting.py +0 -29
- omnimalloc-0.5.0/examples/03_allocators.py +0 -51
- omnimalloc-0.5.0/examples/04_sources.py +0 -42
- omnimalloc-0.5.0/src/cpp/allocators/best_fit.hpp +0 -35
- omnimalloc-0.5.0/src/cpp/allocators/greedy.cpp +0 -27
- omnimalloc-0.5.0/src/cpp/allocators/greedy.hpp +0 -31
- omnimalloc-0.5.0/src/cpp/allocators/omni.hpp +0 -35
- omnimalloc-0.5.0/src/cpp/allocators/telamalloc.hpp +0 -53
- omnimalloc-0.5.0/src/cpp/bindings.cpp +0 -284
- omnimalloc-0.5.0/src/cpp/primitives/buffer_kind.hpp +0 -46
- omnimalloc-0.5.0/src/cpp/primitives/placement.hpp +0 -24
- omnimalloc-0.5.0/src/python/omnimalloc/__init__.py +0 -35
- omnimalloc-0.5.0/src/python/omnimalloc/_cpp.pyi +0 -310
- omnimalloc-0.5.0/src/python/omnimalloc/allocate.py +0 -41
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_base.py +0 -114
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_cpp.py +0 -87
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/omni.py +0 -23
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/simulated_annealing.py +0 -71
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/supermalloc.py +0 -175
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/tabu_search.py +0 -69
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/telamalloc.py +0 -65
- omnimalloc-0.5.0/src/python/omnimalloc/allocators/utils.py +0 -25
- omnimalloc-0.5.0/src/python/omnimalloc/common/units.py +0 -18
- omnimalloc-0.5.0/src/python/omnimalloc/dump.py +0 -87
- omnimalloc-0.5.0/src/python/omnimalloc/primitives/__init__.py +0 -23
- omnimalloc-0.5.0/src/python/omnimalloc/primitives/linearize.py +0 -24
- omnimalloc-0.5.0/src/python/omnimalloc/primitives/pressure.py +0 -126
- omnimalloc-0.5.0/src/python/omnimalloc/validate.py +0 -111
- omnimalloc-0.5.0/src/python/omnimalloc/visualize.py +0 -451
- omnimalloc-0.5.0/tests/unit/allocators/test_greedy_cpp.py +0 -402
- omnimalloc-0.5.0/tests/unit/primitives/test_bufferkind.py +0 -37
- omnimalloc-0.5.0/tests/unit/test_dump.py +0 -143
- omnimalloc-0.5.0/tests/unit/test_visualize.py +0 -380
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.clang-format +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.clang-tidy +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.pre-commit-config.yaml +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/.python-version +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/LICENSE +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/allocation_dark.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/allocation_light.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/hero_dark.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/hero_light.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/quality_dark.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/quality_light.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/scaling_dark.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/assets/scaling_light.svg +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/examples/README.md +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/common/parallel.hpp +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/hash_utils.hpp +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/cpp/primitives/id_type.hpp +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/allocators/naive.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/converters/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/campaign.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/report.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/results/utils.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/huggingface.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/sources/tiling_base.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/timer.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/benchmark/utils.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/common/directories.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/primitives/system.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/src/python/omnimalloc/py.typed +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_examples.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/integration/test_notebooks.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/allocators/test_naive.py +0 -0
- {omnimalloc-0.5.0/tests/unit/benchmark → omnimalloc-0.6.0/tests/unit/analysis}/__init__.py +0 -0
- {omnimalloc-0.5.0/tests/unit/benchmark/converters → omnimalloc-0.6.0/tests/unit/benchmark}/__init__.py +0 -0
- {omnimalloc-0.5.0/tests/unit/benchmark/results → omnimalloc-0.6.0/tests/unit/benchmark/converters}/__init__.py +0 -0
- {omnimalloc-0.5.0/tests/unit/benchmark/sources → omnimalloc-0.6.0/tests/unit/benchmark/results}/__init__.py +0 -0
- {omnimalloc-0.5.0/tests/unit/common → omnimalloc-0.6.0/tests/unit/benchmark/sources}/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/benchmark/test_timer.py +0 -0
- {omnimalloc-0.5.0/tests/unit/primitives → omnimalloc-0.6.0/tests/unit/common}/__init__.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/common/test_directories.py +0 -0
- {omnimalloc-0.5.0 → omnimalloc-0.6.0}/tests/unit/primitives/test_utils.py +0 -0
|
@@ -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
|
|
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.
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
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 += ("
|
|
28
|
+
allocators += ("minimalloc",)
|
|
29
29
|
sources = (
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
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
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
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"
|
|
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
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
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 ``
|
|
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
|
-
- ``
|
|
10
|
-
min flow), the tightest sound lower bound on any
|
|
11
|
-
reference every ratio is measured against
|
|
12
|
-
- ``
|
|
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
|
-
- ``
|
|
20
|
-
- ``
|
|
21
|
-
- ``
|
|
22
|
-
off an untimed ``OmniAllocator`` placement
|
|
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 ``
|
|
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 <=
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 = "
|
|
73
|
-
PER_ALLOCATION_REFERENCE = "
|
|
72
|
+
REFERENCE = "pressure(work_budget=None)"
|
|
73
|
+
PER_ALLOCATION_REFERENCE = "pressure_per_allocation"
|
|
74
74
|
METHODS = (
|
|
75
|
-
"
|
|
75
|
+
"pressure",
|
|
76
76
|
REFERENCE,
|
|
77
|
-
"
|
|
78
|
-
"
|
|
77
|
+
"closure_pressure",
|
|
78
|
+
"omni",
|
|
79
79
|
PER_ALLOCATION_REFERENCE,
|
|
80
|
-
"
|
|
81
|
-
"
|
|
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
|
-
"
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
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
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
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
|
-
"
|
|
136
|
-
REFERENCE: lambda:
|
|
137
|
-
"
|
|
138
|
-
|
|
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
|
-
"
|
|
146
|
-
|
|
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
|
-
"
|
|
149
|
-
|
|
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("
|
|
203
|
-
assert values.get("
|
|
204
|
-
assert values.get("
|
|
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("
|
|
217
|
-
placement = values.get("
|
|
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
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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()) ==
|
|
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]:
|