Skip to content

fix(core-runtime): align local backtest with clean Core and stabilize run loop#12

Merged
bxvtr merged 18 commits into
mainfrom
implementation/semantics
May 16, 2026
Merged

fix(core-runtime): align local backtest with clean Core and stabilize run loop#12
bxvtr merged 18 commits into
mainfrom
implementation/semantics

Conversation

@bxvtr
Copy link
Copy Markdown
Contributor

@bxvtr bxvtr commented May 15, 2026

Summary

Aligned Core Runtime with the cleaned tradingchassis_core API and restored local Backtesting after the Core refactor. Runtime now uses clean CoreStep/CoreWakeupStep paths, dispatches from CoreStepResult.dispatchable_intents, and no longer depends on removed Core compatibility APIs.

Motivation

Core was refactored into a standalone deterministic trading decision engine. Core Runtime needed to be updated so local Backtesting still works with the new Core API while preserving Runtime ownership of venue I/O, dispatch, scheduling, and Backtesting orchestration.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Breaking change

Technical Details

  • Replaced removed Core compatibility usage such as GateDecision, compat_gate_decision, risk.decide_intents, and old Control-Time compatibility paths.
  • Updated Runtime to pass RiskEngine as a PolicyIntentEvaluator via CorePolicyAdmissionContext.
  • Updated Runtime to pass a Runtime-owned ExecutionControl via CoreExecutionControlApplyContext.
  • Updated mixed wakeup handling to use final-state run_core_wakeup_step semantics.
  • Updated Order Execution feedback handling for the new account-level OrderExecutionFeedbackEvent.
  • Preserved Runtime-owned external dispatch and OrderSubmittedEvent emission after successful NEW dispatch.
  • Fixed local Backtesting non-termination issues around stale ControlSchedulingObligation and stale NEW inflight state.
  • Added opt-in loop diagnostics for local Backtesting debugging.
  • Handled expected hftbacktest recorder exhaustion without swallowing unrelated exceptions.

Determinism & Reproducibility

  • Change preserves deterministic behavior
  • Tests confirm reproducibility
  • No hidden state introduced

Performance Impact

  • No measurable impact
  • Benchmarks included
  • Performance improvement

Tests

  • Unit tests added/updated
  • Integration tests added/updated
  • Existing tests pass

Breaking Changes

Core Runtime now depends on the cleaned Core API. Removed Core compatibility contracts are no longer supported, including GateDecision-style decision flow, risk.decide_intents, old Control-Time Queue reevaluation contexts, and snapshot-shaped Core Order feedback. Runtime callers should use the updated CoreStep/CoreWakeupStep integration path.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)

@bxvtr bxvtr self-assigned this May 15, 2026
@bxvtr bxvtr merged commit f1175f2 into main May 16, 2026
4 checks passed
@bxvtr bxvtr deleted the implementation/semantics branch May 16, 2026 10:16
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