Repository navigation
docs(engine): spec Option B SlotBarrier split (DG-2.a) - #4748
Merged
Merged
Conversation
Turns the DG-1 audit recommendation into an implementable spec for DG-3: split SlotBarrier into BarrierState (counter+Condvar) and SlotData (per-file payload) so finish_file's try_unwrap target is structurally disjoint from the Arc the worker's DecrementGuard drop body holds. Recommends atomic single-PR migration, sequences the eight affected sites, and shows how the spin-then-yield workaround in parallel_apply.rs:729-748 falls away.
This was referenced May 23, 2026
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Turns the DG-1 audit recommendation into an implementable spec for DG-3: split SlotBarrier into BarrierState (counter+Condvar) and SlotData (per-file payload) so finish_file's try_unwrap target is structurally disjoint from the Arc the worker's DecrementGuard drop body holds. Recommends atomic single-PR migration, sequences the eight affected sites, and shows how the spin-then-yield workaround in parallel_apply.rs:729-748 falls away.
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.
Summary
Turns the DG-1 audit recommendation (PR #4744,
docs/design/decrementguard-audit.mdsection 7) into animplementable spec for DG-3. Adds
docs/design/dg-2a-option-b-spec.mdcovering:BarrierState(counter + Condvar) andSlotData(per-file payload behind its own mutex), packed in a
SlotEntrypair carrier that becomes the new DashMap value.
finish_file'stry_unwraptarget(
Arc<SlotData>) is structurally disjoint from the Arc theworker's
DecrementGuarddrop body holds (Arc<BarrierState>),so the wake-before-Arc-drop window from audit s.4 disappears.
try_unwrapsite, and worker drop-body sequencewalked race-free step-by-step.
Arc<SlotBarrier>clones + 1DecrementGuardconstruction.shim required because all touched types are crate-private and
the public
ParallelDeltaAppliersurface is unchanged.crates/engine/src/concurrent_delta/parallel_apply.rs:729-748shipped in PR feat(engine): add flush_workers/drain_inflight barrier API to ParallelDeltaApplier (FFB-2) #4665.
This is a pure design spec; no
.rsfiles are touched. DG-3implements; DG-4 (spin removal) folds into DG-3 once Option B lands;
DG-5 stresses the new shape on Windows.
Test plan
split shape and migration order.
section 7.