﻿# Out-of-order video inference results: prevent an older completion from replacing a newer scene

Out-of-order video inference results: prevent an older completion from replacing a newer scene. A practical streaming-video guide with failure mechanisms, a controlled scenario, acceptance evidence and primary refere.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/sv-out-of-order-detections-freshness-gate/
Language: en

Parallel frame inference finishes in a different order from capture. An older slow result arrives last and overwrites the application display or scene state derived from a newer frame.

## The media mechanism

Completion order is not observation order. A current-state application needs a declared source-local acceptance relation and cannot infer newest evidence from whichever callback happened most recently.

## Establish the pipeline boundary

Define the acceptance relation for the consumer. A current-state display may reject older observations after a newer one is accepted; historical analytics may retain both while preserving their capture order.

Carry source epoch, observation identity and geometry context in the dispatch record. Looking up only the current camera state when a callback arrives can attach an old result to a newer session or format.

Reverse completion order deliberately and inspect every stateful side effect, including overlays, counters and alert aggregation. A correct final screen can hide an earlier stale alert that was already emitted. Record discarded completions as completed-but-unaccepted work where useful, and release their resources safely. Never infer observation recency from worker completion timestamps when the source-local acquisition relation is available.

## A constructed failure case

Dispatch marked earlier and later frames, then reverse their completion order. A current-scene consumer must not regress its accepted observation merely because the earlier computation was slower, while the historical record can retain both results.

## A practical validation procedure

Attach source generation and capture identity at dispatch. Delay an earlier task so later work completes first, then enforce the chosen stale-result rule. Keep historical analytics separate when they legitimately need every result regardless of completion order.

Keep an unchanged control and a deliberate failure case. Change the relevant setting or interruption independently, then compare observed frame identities and state transitions. Measure through recovery as well as the first error; a restarted worker can retain obsolete results or references.

## Evidence for acceptance

Keep dispatch identity, completion order and acceptance or rejection of each result.

## Recovery and limits

Rejecting an old result does not undo resource work already consumed by its inference.

Define whether recovery drains, discards or isolates pending frames before resuming ordinary service. Preserve compact diagnostic identities and the fixture configuration. Avoid treating a new connection or a live process as proof that previous in-flight work has finished safely.

## References and interpretation

Primary references: [GStreamer clock synchronization design](https://gstreamer.freedesktop.org/documentation/additional/design/synchronisation.html); [GStreamer application pipeline manipulation](https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html).

This is a proposed operational validation, not an executed Retrivium benchmark. Documentation defines interfaces and supported behavior; the actual pipeline needs its own evidence. Repeat the check after relevant plugin, decoder, source or preprocessing changes.

## Related reading

Continue with [SAM2 video segmentation: object identity belongs to the inference session](/journal/fg2-sam2-video-session-object-memory/); [Video flush boundaries: reject in-flight inference results from the previous segment](/journal/sv-flush-segment-epoch-inflight-results/). Their adjacent context does not replace the specific frame-flow acceptance check described here.
