Skip to content

feat: add explicit sequence-based reordering for DeltaResult items#3074

Merged
oferchen merged 1 commit intomasterfrom
feat/delta-result-reorder-buffer
Mar 31, 2026
Merged

feat: add explicit sequence-based reordering for DeltaResult items#3074
oferchen merged 1 commit intomasterfrom
feat/delta-result-reorder-buffer

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Add sequence field to DeltaResult with with_sequence() builder for stamping submission order
  • Introduce ReorderBuffer<T> with BTreeMap-backed reordering and capacity bounds
  • Wire into pipeline docs and add integration test

Test plan

  • Unit tests: in-order, out-of-order, gaps, capacity, empty buffer, drain_ready
  • Integration test: full pipeline with par_bridge and reorder
  • Existing tests pass (sequence defaults to 0)
  • CI: fmt, clippy, nextest, all platforms

@github-actions github-actions Bot added the enhancement New feature or request label Mar 30, 2026
Add a `sequence` field to `DeltaResult` with a `with_sequence()` builder
and `sequence()` accessor so producers can stamp submission order before
parallel dispatch.

Introduce `ReorderBuffer<T>` in the `concurrent_delta::reorder` module -
a BTreeMap-backed buffer that accepts out-of-order items by sequence
number and yields them strictly in order via `next_in_order()` and
`drain_ready()`. Configurable capacity bound prevents unbounded memory
growth when a slow item blocks delivery.

Wire the buffer into the pipeline architecture docs and add an
integration test demonstrating the full work queue -> par_bridge ->
strategy dispatch -> reorder buffer flow.
@oferchen oferchen force-pushed the feat/delta-result-reorder-buffer branch from e695f83 to c51fb72 Compare March 31, 2026 07:39
@oferchen oferchen merged commit 872b139 into master Mar 31, 2026
36 of 37 checks passed
@oferchen oferchen deleted the feat/delta-result-reorder-buffer branch March 31, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant