Skip to content

Keep every placement a broken pool would have lost, and drop the pin cliff - #51

Open
fpedd wants to merge 1 commit into
mainfrom
fix-pinning-followups
Open

Keep every placement a broken pool would have lost, and drop the pin cliff#51
fpedd wants to merge 1 commit into
mainfrom
fix-pinning-followups

Conversation

@fpedd

@fpedd fpedd commented Aug 3, 2026

Copy link
Copy Markdown
Owner

A worker dying abruptly breaks the whole executor, so every future still in
flight fails with it: allocate_parallel was catching that per variant and
finding nothing left, turning one OOM kill into "Every allocator variant
failed". The variants a broken pool stranded never ran at all, so they are
retried one pool each -- never in the calling process, where whatever killed
the worker would kill the caller, and never sharing a pool, where the same
variant would strand them again.

The thread ceiling lives in native process-global state, which a forked
worker inherits and a spawned one does not, so the cap was silently absent
inside every pool worker off Linux. Pools hand it down explicitly now, split
by the worker count: the ceiling covers the product, not each level of it.

stack_around_pins fell off its linear path the moment a single pin
existed, rescanning every occupied range per item and inserting into it:
20k allocations went from 9ms to 14.9s, and the naive allocator is the
linear baseline. Claims only ever shrink a free range from below and never
split one, so the range count is fixed at what the pins leave and a max tree
over the capacities answers each first fit in O(log n).

The adjacency ceiling counts 4 bytes per directed edge, but the placers took
their rows through ConflictIndices, widening every one to size_t behind a
per-row vector. They walk the CSR rows in place now, so the accounting is
the whole cost rather than a stage of it, and the type is gone.

TwoPlusTwoSource truncated its last group below four allocations, handing
back a linearizable instance from a source that promises the opposite; it
refuses the count instead. Validating a Memory directly no longer names it
twice, and available_cores reports the benchmark environment's core count
rather than being unused beside os.cpu_count.

…cliff

A worker dying abruptly breaks the whole executor, so every future still in
flight fails with it: `allocate_parallel` was catching that per variant and
finding nothing left, turning one OOM kill into "Every allocator variant
failed". The variants a broken pool stranded never ran at all, so they are
retried one pool each -- never in the calling process, where whatever killed
the worker would kill the caller, and never sharing a pool, where the same
variant would strand them again.

The thread ceiling lives in native process-global state, which a forked
worker inherits and a spawned one does not, so the cap was silently absent
inside every pool worker off Linux. Pools hand it down explicitly now, split
by the worker count: the ceiling covers the product, not each level of it.

`stack_around_pins` fell off its linear path the moment a single pin
existed, rescanning every occupied range per item and inserting into it:
20k allocations went from 9ms to 14.9s, and the naive allocator is the
linear baseline. Claims only ever shrink a free range from below and never
split one, so the range count is fixed at what the pins leave and a max tree
over the capacities answers each first fit in O(log n).

The adjacency ceiling counts 4 bytes per directed edge, but the placers took
their rows through `ConflictIndices`, widening every one to size_t behind a
per-row vector. They walk the CSR rows in place now, so the accounting is
the whole cost rather than a stage of it, and the type is gone.

TwoPlusTwoSource truncated its last group below four allocations, handing
back a linearizable instance from a source that promises the opposite; it
refuses the count instead. Validating a Memory directly no longer names it
twice, and `available_cores` reports the benchmark environment's core count
rather than being unused beside `os.cpu_count`.
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