Skip to content

feat: M3 limit-order-book market + sharpebench-sim 0.0.8 (O(1) checkpoint)#13

Merged
ReverseZoom2151 merged 5 commits into
mainfrom
lob-m3
Jun 26, 2026
Merged

feat: M3 limit-order-book market + sharpebench-sim 0.0.8 (O(1) checkpoint)#13
ReverseZoom2151 merged 5 commits into
mainfrom
lob-m3

Conversation

@ReverseZoom2151

Copy link
Copy Markdown
Contributor

Finishes the two big deferred technical items.

M3 limit-order-book market

A deterministic integer-tick continuous-double-auction engine (lob_market.rs): price-time priority, market/limit/cancel/modify (priority-preserving on size-decrease), partial fills, golden-hash-pinned. Exposed via PyOrderBook (JSON boundary) and LOBMarketEnv — a PettingZoo ParallelEnv where N market makers quote into one shared book against a seeded noise trader, with a depth-ladder/microprice/queue-imbalance observation. Passes parallel_api_test. Leak-free (book clears before the next obs); byte-identical tape.

sharpebench-sim 0.0.8 consumed

Released sharpebench-sim 0.0.8 (TRF turnover cost, parameterized vol/jump generator, env clone_state/restore_state) and bumped the deps. Wired the O(1) native checkpoint: CheckpointableEnv(native=True) rewinds via the engine snapshot instead of replaying the decision prefix; native and replay paths agree byte-for-byte. (TRF cost + parameterized vol/jump are now available in the engine for future wiring.)

Verification

cargo 70 tests (incl. 11 LOB engine) + wasm32 + clippy clean; maturin + pytest 339 passed, 2 skipped. 124 exports.

Remaining blocked items (need your input): EdgeLint/OrderLog (missing sharpebench-stats/holotype crates), TapeTrace + Gordon adapter (Gordon do-not-touch constraint), Hub publish (auth).

Price-time-priority continuous-double-auction engine: integer price ticks (no float
keys), FIFO time priority, process_limit/process_market with partial fills,
cancel + priority-preserving modify, canonical-order deterministic batch step, and a
depth-ladder/microprice/queue-imbalance snapshot. Golden-hash pinned; 11 tests pass.

WIP: the pyo3 PyOrderBook binding + the Python LOB env are pending (the parallel
build was interrupted by infra limits); engine is self-contained and validated.
pyo3 PyOrderBook wraps the deterministic CDA engine (reset_book/step_book over a flat
order JSON, fills + depth-ladder out). LOBMarketEnv is a PettingZoo ParallelEnv where
N market makers quote into one shared book against a seeded noise trader; per-agent
depth-ladder obs + mark-to-mid-minus-inventory reward, leak-free (book clears before
the next obs). Passes parallel_api_test. Completes M3 (engine committed in 4b00b93).
Bump the sharpebench deps 0.0.7 -> 0.0.8 (TRF turnover cost, parameterized vol/jump
generator, and env clone_state/restore_state now available). Wire the O(1) engine
snapshot: PyTradingEnv.clone_state/restore_state (serde EnvState), OpenOutcryEnv
passthrough, and a native=True fast path on CheckpointableEnv that rewinds in O(1)
instead of replaying the decision prefix. Native and replay paths agree byte-for-byte.
CostModel literals updated for the additive trf_cost field.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ReverseZoom2151, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 32 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26db2711-2d3f-4735-9976-dc1a2da10db6

📥 Commits

Reviewing files that changed from the base of the PR and between 217aa59 and 951c4ef.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • README.md
  • crates/openoutcry-py/Cargo.toml
  • crates/openoutcry-py/python/openoutcry/__init__.py
  • crates/openoutcry-py/python/openoutcry/checkpoint.py
  • crates/openoutcry-py/python/openoutcry/gym.py
  • crates/openoutcry-py/python/openoutcry/lob_env.py
  • crates/openoutcry-py/src/lib.rs
  • crates/openoutcry-py/tests/test_checkpoint.py
  • crates/openoutcry-py/tests/test_lob_env.py
  • crates/openoutcry-wasm/src/lib.rs
  • crates/openoutcry/Cargo.toml
  • crates/openoutcry/src/lib.rs
  • crates/openoutcry/src/lob_market.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lob-m3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ReverseZoom2151 ReverseZoom2151 merged commit 574fde1 into main Jun 26, 2026
5 checks passed
@ReverseZoom2151 ReverseZoom2151 deleted the lob-m3 branch June 26, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant