Skip to content

Add vector-clock lifetimes for concurrent allocation problems#24

Open
fpedd wants to merge 1 commit into
mainfrom
feat/vector-clock-lifetimes
Open

Add vector-clock lifetimes for concurrent allocation problems#24
fpedd wants to merge 1 commit into
mainfrom
feat/vector-clock-lifetimes

Conversation

@fpedd

@fpedd fpedd commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Lifetimes generalize from scalar interval bounds to vector clocks with one
component per thread, so allocation problems from partially-synchronized
concurrent executions can be expressed directly. Temporal overlap becomes the
happens-before conflict test (neither free happens-before the other's alloc);
scalar problems keep the existing sweep and semantics, and 1-tuples normalize
to scalars. See docs/vector-clock-lifetimes.md for the design.

  • Allocation (C++/nanobind) stores TimePoint = int64 | vector, with
    componentwise validation, span accessors, a scalar fast path in
    overlaps_temporally, and ValueError on scalar-accessor misuse
  • compute_temporal_overlaps dispatches to the scalar sweep or the pairwise
    vector loop; compute_conflict_degrees counts conflicts per allocation
    (multiplicity-correct under duplicate ids) without marshaling the graph
  • get_pressure computes the max-weight antichain of the happens-before order
    via a lower-bounded min flow (weighted Dilworth dual)
  • try_linearize synthesizes scalar lifetimes with the identical conflict
    relation when the order is an interval order (no induced 2+2), unlocking
    scalar-only allocators; offsets and conflicts carry over exactly
  • allocators declare supports_vector_time; conflict-relation allocators
    (greedy family, naive, order-search) accept vector clocks, minimalloc and
    supermalloc reject them with a precise error, and mixed dimensions are a
    hard error on every path
  • run_benchmark skips incompatible allocator/source pairs (decided once per
    variant) and fails with a precise error if a campaign ends up empty
  • ConcurrentTilingSource shards guillotine tilings across simulated workers
    with random sync messages; stacked bands keep capacity a provably
    achievable optimum (num_allocations >= num_threads enforced)
  • plot_allocation renders one lane per thread, supports memories mixing
    scalar and vector pools, and fixes the pool background color selection
  • dump/load round-trip vector times as :-joined components (an omnimalloc
    extension of the minimalloc CSV format)

@fpedd fpedd force-pushed the feat/vector-clock-lifetimes branch 2 times, most recently from 309bd45 to 94bb492 Compare July 9, 2026 12:04
Lifetimes generalize from scalar interval bounds to vector clocks with one
component per thread, so allocation problems from partially-synchronized
concurrent executions can be expressed directly. Temporal overlap becomes the
happens-before conflict test (neither free happens-before the other's alloc);
scalar problems keep the existing sweep and semantics, and 1-tuples normalize
to scalars.

- Allocation (C++/nanobind) stores TimePoint = int64 | vector<int64>, with
  componentwise validation, span accessors, a scalar fast path in
  overlaps_temporally, and ValueError on scalar-accessor misuse
- compute_temporal_overlaps dispatches to the scalar sweep or the pairwise
  vector loop; compute_conflict_degrees counts conflicts per allocation
  (multiplicity-correct under duplicate ids) without marshaling the graph
- get_pressure computes the max-weight antichain of the happens-before order
  via a lower-bounded min flow (weighted Dilworth dual)
- try_linearize synthesizes scalar lifetimes with the identical conflict
  relation when the order is an interval order (no induced 2+2), unlocking
  scalar-only allocators; offsets and conflicts carry over exactly
- allocators declare supports_vector_time; conflict-relation allocators
  (greedy family, naive, order-search) accept vector clocks, minimalloc and
  supermalloc reject them with a precise error, and mixed dimensions are a
  hard error on every path
- run_benchmark skips incompatible allocator/source pairs (decided once per
  variant) and fails with a precise error if a campaign ends up empty
- ConcurrentTilingSource shards guillotine tilings across simulated workers
  with random sync messages; stacked bands keep capacity a provably
  achievable optimum (num_allocations >= num_threads enforced)
- plot_allocation renders one lane per thread, supports memories mixing
  scalar and vector pools, and fixes the pool background color selection
- dump/load round-trip vector times as :-joined components (an omnimalloc
  extension of the minimalloc CSV format)
@fpedd fpedd force-pushed the feat/vector-clock-lifetimes branch from 94bb492 to ca776b9 Compare July 10, 2026 08:58
@fpedd fpedd marked this pull request as ready for review July 10, 2026 09:04
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