Skip to content

Preserve FIFO order through the PriceLevelData round-trip (#131) - #133

Merged
joaquinbejar merged 1 commit into
mainfrom
issue-131-data-fifo-order
Jul 14, 2026
Merged

joaquinbejar merged 1 commit into
mainfrom
issue-131-data-fifo-order

Conversation

@joaquinbejar

Copy link
Copy Markdown
Owner

Summary

PriceLevelData::orders was built from the unordered DashMap iterator, so a
round-trip through the plain serde path scrambled price-time priority — the
property the snapshot package has preserved since #109. It now materializes
in queue-consumption order; TryFrom re-admits in vector order, so FIFO
(including demotions) survives. Docs point persistence at the snapshot
package.

Testing

  • Round-trip test with an upsize demotion (old path fails it)
  • Pre-push checks clean — 526 tests, 0 failed

Closes #131

The plain serde path built PriceLevelData::orders from iter_orders() --
the unordered DashMap iterator -- so serde_json round-trips through the
public PriceLevelData scrambled price-time priority, the exact property
the checksum-protected snapshot package has preserved since #109. The
vector is now materialized in queue-consumption order (ascending
insertion sequence) and TryFrom<PriceLevelData> re-admits in vector
order, so the round-trip preserves FIFO including demotions. Docs state
the contract and point persistence at the snapshot package (checksummed,
carries statistics).

Closes #131
@joaquinbejar joaquinbejar added bug Something isn't working price-level Engine: level/order_queue/snapshot/statistics + execution results labels Jul 14, 2026
@joaquinbejar joaquinbejar self-assigned this Jul 14, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/price_level/level.rs 90.75% <ø> (-1.49%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joaquinbejar
joaquinbejar merged commit ace2941 into main Jul 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working price-level Engine: level/order_queue/snapshot/statistics + execution results

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-snapshot serde path (PriceLevelData) does not preserve FIFO order

2 participants