pub struct CompletionReaper<R: DeviceRuntime> { /* private fields */ }Expand description
Scheduler-owned completion registry. The global map lock only resolves a slot; each fence is queried or waited under its own record lock.
Implementations§
Source§impl<R: DeviceRuntime> CompletionReaper<R>
impl<R: DeviceRuntime> CompletionReaper<R>
Sourcepub fn try_capture_sequence_checkpoint(
self: &Arc<Self>,
plan: &ExecutionPlan,
binding: &TrustedPlanRuntimeBinding<R>,
source: Arc<SequenceSession<R>>,
lane: Arc<ExecutionLane<R>>,
) -> Result<NativeCheckpointStart<R>, VNextError>
pub fn try_capture_sequence_checkpoint( self: &Arc<Self>, plan: &ExecutionPlan, binding: &TrustedPlanRuntimeBinding<R>, source: Arc<SequenceSession<R>>, lane: Arc<ExecutionLane<R>>, ) -> Result<NativeCheckpointStart<R>, VNextError>
Capture only the source’s current proven complete boundary. Optional retention never grows backing or waits for foreground capacity here.
Sourcepub fn try_capture_sequence_checkpoint_with_timing(
self: &Arc<Self>,
plan: &ExecutionPlan,
binding: &TrustedPlanRuntimeBinding<R>,
source: Arc<SequenceSession<R>>,
lane: Arc<ExecutionLane<R>>,
timing_mode: DeviceTimingMode,
) -> Result<NativeCheckpointStart<R>, VNextError>
pub fn try_capture_sequence_checkpoint_with_timing( self: &Arc<Self>, plan: &ExecutionPlan, binding: &TrustedPlanRuntimeBinding<R>, source: Arc<SequenceSession<R>>, lane: Arc<ExecutionLane<R>>, timing_mode: DeviceTimingMode, ) -> Result<NativeCheckpointStart<R>, VNextError>
Same capture authority and lifecycle, with optional terminal device elapsed time. Enabled modes use Completion only: no kernel counters or changes to copy encoder boundaries are introduced.
Sourcepub fn try_restore_sequence_checkpoint(
self: &Arc<Self>,
plan: &ExecutionPlan,
target: Arc<SequenceSession<R>>,
checkpoint: &SequenceCheckpoint<R>,
full_input: Arc<[u32]>,
lane: Arc<ExecutionLane<R>>,
) -> Result<NativeCheckpointStart<R>, VNextError>
pub fn try_restore_sequence_checkpoint( self: &Arc<Self>, plan: &ExecutionPlan, target: Arc<SequenceSession<R>>, checkpoint: &SequenceCheckpoint<R>, full_input: Arc<[u32]>, lane: Arc<ExecutionLane<R>>, ) -> Result<NativeCheckpointStart<R>, VNextError>
The target must already have sufficient admitted backing. This binds its exact incarnation and actual complete input before device encoding; neither can be replaced later when taking the restore result.
Sourcepub fn try_restore_sequence_checkpoint_with_timing(
self: &Arc<Self>,
plan: &ExecutionPlan,
target: Arc<SequenceSession<R>>,
checkpoint: &SequenceCheckpoint<R>,
full_input: Arc<[u32]>,
lane: Arc<ExecutionLane<R>>,
timing_mode: DeviceTimingMode,
) -> Result<NativeCheckpointStart<R>, VNextError>
pub fn try_restore_sequence_checkpoint_with_timing( self: &Arc<Self>, plan: &ExecutionPlan, target: Arc<SequenceSession<R>>, checkpoint: &SequenceCheckpoint<R>, full_input: Arc<[u32]>, lane: Arc<ExecutionLane<R>>, timing_mode: DeviceTimingMode, ) -> Result<NativeCheckpointStart<R>, VNextError>
Same restore and consumer-acknowledgement contract, with Completion timing for the whole transfer submission (including initialization).
Source§impl<R: DeviceRuntime> CompletionReaper<R>
impl<R: DeviceRuntime> CompletionReaper<R>
Sourcepub fn recover_abandoned_checkpoints(
&self,
maximum_slots: usize,
) -> Result<CompletionSweepReceipt, VNextError>
pub fn recover_abandoned_checkpoints( &self, maximum_slots: usize, ) -> Result<CompletionSweepReceipt, VNextError>
Runs a bounded sweep and blocking recovery for native checkpoint results abandoned by their public access handles. Call from the existing device completion worker, not a request/admission thread. Live consumers are never drained or discarded by this operation.
Failed drains remain in the same reaper’s quarantine for a later retry. Successful cleanup discards results; it cannot install a restore frontier or turn drain evidence into a successful capture.
Source§impl<R: DeviceRuntime> CompletionReaper<R>
impl<R: DeviceRuntime> CompletionReaper<R>
pub fn checkpoint_timing_snapshot(&self) -> CheckpointTimingSnapshot
Sourcepub fn reset_checkpoint_timings(&self)
pub fn reset_checkpoint_timings(&self)
Resets only observations, never transfer state. For a clean measurement interval callers should first quiesce workers: a phase spanning reset is recorded in full when it ends, just like other host timing counters.
pub fn record_checkpoint_cache_timing( &self, phase: CheckpointCacheTimingPhase, elapsed: Duration, )
Source§impl<R: DeviceRuntime> CompletionReaper<R>
impl<R: DeviceRuntime> CompletionReaper<R>
pub fn new() -> Arc<Self> ⓘ
pub fn retained_count(&self) -> usize
pub fn quarantined_count(&self) -> usize
Sourcepub fn poll_bounded(
&self,
maximum_slots: usize,
) -> Result<CompletionSweepReceipt, VNextError>
pub fn poll_bounded( &self, maximum_slots: usize, ) -> Result<CompletionSweepReceipt, VNextError>
Polls a bounded scheduler-owned snapshot. This path remains available after every external completion handle has detached.
Sourcepub fn recover_slot_by_draining_lane(
&self,
slot_id: CompletionSlotId,
) -> Result<CompletionRecoveryOutcome, VNextError>
pub fn recover_slot_by_draining_lane( &self, slot_id: CompletionSlotId, ) -> Result<CompletionRecoveryOutcome, VNextError>
Runs the blocking recovery path for an exact slot after an indeterminate observation. A failed drain moves ownership into an auditable, retryable quarantine record instead of releasing or forgetting it.
Sourcepub fn wait_slot_for_recovery(
&self,
slot_id: CompletionSlotId,
) -> Result<CompletionObservation, VNextError>
pub fn wait_slot_for_recovery( &self, slot_id: CompletionSlotId, ) -> Result<CompletionObservation, VNextError>
Performs the blocking exact-fence observation required before lane recovery. Schedulers must call this from an independent recovery worker, never from a request or admission thread.