Skip to content

Add best-fit, simulated annealing, tabu search, and telamalloc allocators#28

Merged
fpedd merged 1 commit into
mainfrom
add-local-search-allocators
Jul 7, 2026
Merged

Add best-fit, simulated annealing, tabu search, and telamalloc allocators#28
fpedd merged 1 commit into
mainfrom
add-local-search-allocators

Conversation

@fpedd

@fpedd fpedd commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Four new C++ allocators exposed via nanobind with Python wrappers,
registry integration, and unit tests:

  • BestFitAllocator: greedy placement into the smallest fitting gap
    among placed temporal overlaps, falling back past the last one.
  • SimulatedAnnealingAllocator: anneals over first-fit placement orders,
    swapping a peak allocation with an earlier temporal neighbor and
    accepting worsening moves with a cooling Metropolis probability.
  • TabuSearchAllocator: samples swap neighborhoods over the same orders
    with tabu memory and an aspiration criterion.
  • TelamallocAllocator: TelaMalloc-style search (Maas et al., ASPLOS
    2023) adapted to minimize peak memory: phase decomposition over the
    temporal-overlap graph, tiered squeaky-wheel packing with
    min-conflict eviction, and binary search on per-phase capacity.

The order-search scaffolding (initial_order, earlier_neighbors) and
placement helpers (peak_of, placed_overlapping) live in greedy_base;
simulated annealing and tabu search route their candidate evaluation
through the existing FirstFitPlacer, and best-fit shares the
placed-overlap collection with the first-fit offset search. The three
search allocators release the GIL for the duration of the native
search, matching greedy_many/solve_many.

…tors

Four new C++ allocators exposed via nanobind with Python wrappers,
registry integration, and unit tests:

- BestFitAllocator: greedy placement into the smallest fitting gap
  among placed temporal overlaps, falling back past the last one.
- SimulatedAnnealingAllocator: anneals over first-fit placement orders,
  swapping a peak allocation with an earlier temporal neighbor and
  accepting worsening moves with a cooling Metropolis probability.
- TabuSearchAllocator: samples swap neighborhoods over the same orders
  with tabu memory and an aspiration criterion.
- TelamallocAllocator: TelaMalloc-style search (Maas et al., ASPLOS
  2023) adapted to minimize peak memory: phase decomposition over the
  temporal-overlap graph, tiered squeaky-wheel packing with
  min-conflict eviction, and binary search on per-phase capacity.

The order-search scaffolding (initial_order, earlier_neighbors) and
placement helpers (peak_of, placed_overlapping) live in greedy_base;
simulated annealing and tabu search route their candidate evaluation
through the existing FirstFitPlacer, and best-fit shares the
placed-overlap collection with the first-fit offset search. The three
search allocators release the GIL for the duration of the native
search, matching greedy_many/solve_many.
@fpedd fpedd merged commit 105e7fb into main Jul 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant