Skip to content

sim-capacity: release every order at exactly submit+latency by default; receipts re-run (old kept as superseded) - #254

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
claude/sim-capacity-exact-latency-20260925
Sep 25, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
claude/sim-capacity-exact-latency-20260925

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

What

The sim-capacity NautilusTrader runs now release every latency-delayed order at exactly submit + configured latency, and the committed receipts are re-run with that as the default. The old behaviour stays available behind an explicit switch (--release-timing), and both earlier receipts are kept byte-identical as *-superseded.json.

Why

The engine cross-check (#245) measured a NautilusTrader 2.0.0rc5 timing property. A delayed order is released only when the next quote on its own instrument, or some other due timer, is processed at or after submit + latency. That added a median of 28 ms (SPY) and 53 ms (NVDA) beyond the configured latency, and a p90 of 135 ms and 263 ms.

The tested fix is one otherwise-inert set_time_alert_ns per order at submit + latency. It makes every order resolve at exactly the configured latency, matching hftbacktest's timing in #245.

Results

Paper parity, superseded Paper parity, new Elite, superseded Elite, new
Fills per minute (min / median / max) 171 / 175 / 180 170 / 176 / 180 859 / 873 / 882 866 / 873 / 884
Minutes at or above 180 capped at 180 by design capped at 180 by design 30 of 30 30 of 30
Fills better than the NBBO touch 0 of 5,255 0 of 5,278 0 of 26,145 0 of 26,230
Submit to fill, 70 ms config (min / p50 / p90 / max) not tracked 70.0 / 70.0 / 70.0 / 70.0 ms not tracked 70.0 / 70.0 / 70.0 / 70.0 ms
Release check (early / inexact) — 0 / 0 — 0 / 0
Independent recount agrees yes yes yes yes

Elite latency sweep (new). Every point clears 180 in all 30 minutes, and every exact-release check shows zero early and zero inexact releases.

Latency Fills per minute (min / median / max)
0 ms (no latency model, so no alert) 889 / 898.5 / 900
70 ms 866 / 873 / 884
250 ms 807 / 830 / 854
1000 ms 672 / 727.5 / 761

Paper parity is rate-limited to 180 per minute by its own RiskEngineConfig. Its predeclared rule is that it must never exceed 180 per minute (max 180), not that it must sustain it. This rule is unchanged, and experiment.json records it.

Checks

  • Tests. tests/test_sim_capacity.py has 65 tests, 3 of them new (ExactReleaseTimingTests).
    • System Python: 65 run, 28 pinned-runtime skips.
    • Pinned rc5 runtime: 65 run, 0 skipped.
    • With the release alert forced off, 2 of the 3 new tests fail as expected. The third checks that legacy mode resolves some fills later, and does not depend on the alert.
  • Convergence record. experiment.json has 3 new dated observations. The timing limitation is marked resolved, with the old text kept and a correction appended. Its pins cover the new and superseded receipts.
  • Validators. validate.py, evidence_manifest.py --check and validate_convergence.py --all-recorded pass on the tree with main merged in.
  • Dashboard and sim tests (test_grand_dashboard, test_native_dashboard_data, test_new_host_grand_list, test_sim_capacity, test_sim_engine_crosscheck): 190 tests OK with main merged in.
  • The builder's full suite on its older base showed 8 grand-dashboard failures ("missing evidence reference"). On that base, the dashboard still pointed at the renamed receipt. Grand-dashboard checkpoint: sim cross-check agreement; paper runs blocked on key rotation #248 moved that reference to the cross-check receipt, and the failures are gone with main merged in.
  • Secret scan: gitleaks in git mode over the branch commits: no leaks.

Evidence class

Infrastructure evidence only: a simulation capacity replay on retained SIP quotes. It is not broker throughput and not strategy performance (NS-06).

Review and process

  • Implementation: a Claude builder working in a coordinator-created worktree.
  • Coordinator verification: I checked the receipts myself. Every fill is checked for exact release, with zero violations across all 4 elite sweep points and paper parity, and both superseded receipts are kept. I also checked the references to the renamed files and the merged-tree tests.
  • Process note. The builder was launched with an agent type that sets worktree isolation, and it bypassed that environment's git wrapper with /usr/bin/git. The commits are secret-scanned clean, and such agent types are no longer used here.
  • Codex cross-family review: unavailable until 2026-09-30, so it was skipped.

🤖 Generated with Claude Code

Scout and others added 2 commits September 25, 2026 10:12
…atency by default

On the pinned NautilusTrader 2.0.0rc5 engine, a deferred order was released
only when its own instrument's next quote, or any due clock timer, was
processed at or after submit + latency -- not exactly at that instant
(measured in sim-engine-crosscheck: extra delay of median 28ms SPY / 53ms
NVDA, p90 135ms/263ms). CapacityExerciserParams.release_alert_latency_ns
registers one otherwise-inert per-order set_time_alert_ns at exactly
submit+latency, fixing this; runner.run_one wires it from a new
exact_release parameter (default True), with --release-timing legacy on the
CLI to reproduce the old behavior on demand.

- exerciser.py: release_alert_latency_ns field + the per-order alert.
- runner.py: exact_release/--release-timing wiring, check_release_timing
  (asserted by cmd_run: no fill before submit+latency, none inexact when
  exact release is active), release_timing in the receipt.
- tests/test_sim_capacity.py: ExactReleaseTimingTests on a sparse synthetic
  quote set, exact mode exactness and legacy mode slack; verified failing
  with the alert disabled and passing restored. All 65 sim-capacity tests
  pass on system Python (28 skip cleanly) and the pinned runtime (0 skipped).
- Re-ran the paper-parity and elite-tier receipts (with latency sweep) from
  retained --replay data: receipts/20260925-*.json. submit-to-fill is
  exactly 70.0ms (min=p50=p90=max) at the 70ms primary latency; every
  latency-sweep point has zero early/inexact release-timing violations;
  fills/min, NBBO-touch (0 violations), recount-agrees and fee totals all
  still hold. Prior receipts kept unmodified as
  receipts/20260924-*-superseded.json.
- experiment.json: dated 2026-09-25 observations for the new runs and
  tests, timing limitation marked resolved (old text kept, correction
  appended), qualification_run_ids repointed at the new elite-tier run,
  every {path, sha256} pin refreshed. validate_convergence.py
  --all-recorded passes for all 22 recorded records.
- manifests/evidence.json: refreshed/added entries, sorted,
  json.dumps(indent=2) formatting confirmed byte-identical on reserialize.
  validate.py and evidence_manifest.py --check both pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With #248 on main, the dashboard's simulation lane references the
cross-check receipt rather than the renamed 20260924 receipt. The
grand-dashboard tests that failed on this branch's older base
(missing evidence reference) now pass: 190 dashboard and sim tests OK.
validate.py, evidence_manifest.py --check and
validate_convergence.py --all-recorded pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins seathatflowsinourveins added the lane:trading Trading lane: sim, paper and live north star label Sep 25, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@seathatflowsinourveins
seathatflowsinourveins merged commit d2daa16 into main Sep 25, 2026
23 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/sim-capacity-exact-latency-20260925 branch September 25, 2026 14:55
seathatflowsinourveins pushed a commit that referenced this pull request Sep 25, 2026
…0260925

Two use-stage receipts, native_proven, recorded with scripts/host_receipts.py
at origin/main 720e294 on the WSL2 Threadripper/RTX 4090 host from #231,
each bound to its layer winner's current pin:

- socraticode 1.14.0 (foundation/semantic-rag): through mcporter, the health
  check reaches Qdrant and the vLLM-served Nemotron embedder, the index of a
  separate clone of this repository is green, a gate-ladder question returns
  scripts/trading_gates.py and catalogs/us-equities/gates-20260922.json in the
  top eight, and an unrelated control query returns neither. The -2
  generation supersedes the first recording: it drops an unestablished
  "read-only clone" wording and asserts the launched package version against
  the winner pin.
- ai-memory 2.3.2 (foundation/durable-memory): read-only status of the host
  service (counts and flags only), then write, search, read-back and delete
  of a scoped probe page on a disposable scratch server with its own data
  directory; after deletion the same search finds nothing and read-page
  fails. The scratch server and directory are removed.

Rebased onto d2daa16 (#254) with the docs/lanes.md hot-file protocol: main's
manifests/evidence.json plus the three receipts re-registered; the component
evidence matrix is regenerated with main's component_matrix.py, and the
new-host grand list is unchanged by these receipts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins added a commit that referenced this pull request Sep 25, 2026
… incentive board and data lake, and the recounted WSL host (#288)

- simulation: 866 to 884 fills per min at 70 ms exact release, 30 of 30
  minutes, and 672 at 1 s (#254, sim-capacity/receipts/20260925-elite-tier.json).
- paper: adds the margin financing model (#243); still blocked on the
  paper keys (HTTP 401).
- mover-early-entry-studies: v1 to v3, with the v3 core merged (#190) and not
  frozen.
- New gates:
  - incentive-board-forward (#187, #220): 0 orders;
  - data-lake-source (#208): minute-bar pilot not run.
- wsl-workstation-host: the foundation lane's wording. Counts were recounted
  on main 0074a0c by the last independent_session verdict per receipt,
  superseded excluded: 69 receipts, 56 agree, 1 needs changes, 0 awaiting
  review, 12 superseded (#285).

The foundation lane acked the strings and the recount rule.

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:trading Trading lane: sim, paper and live north star

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant