Add vector-clock lifetimes for concurrent allocation problems#24
Open
fpedd wants to merge 1 commit into
Open
Conversation
309bd45 to
94bb492
Compare
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)
94bb492 to
ca776b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
componentwise validation, span accessors, a scalar fast path in
overlaps_temporally, and ValueError on scalar-accessor misuse
vector loop; compute_conflict_degrees counts conflicts per allocation
(multiplicity-correct under duplicate ids) without marshaling the graph
via a lower-bounded min flow (weighted Dilworth dual)
relation when the order is an interval order (no induced 2+2), unlocking
scalar-only allocators; offsets and conflicts carry over exactly
(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
variant) and fails with a precise error if a campaign ends up empty
with random sync messages; stacked bands keep capacity a provably
achievable optimum (num_allocations >= num_threads enforced)
scalar and vector pools, and fixes the pool background color selection
extension of the minimalloc CSV format)