4.4 KiB
P01 — Measure existing research paths before extending the benchmark
Parent epic: E7. Priority/severity: P2 / Medium. Relative complexity: M. Recommended specialization: Performance/infrastructure engineering.
Scheduling source of truth: manifest entry P01. No task is authorized until the plan is approved. Dependencies and decision references below describe the design; the manifest controls current readiness.
Evidence and root cause
- PER-01 — Verified: EventQueue insertion scans prior events; native run is synchronous/one-shot and returns full JSON. Actual end-to-end bottleneck distribution still needs controlled measurements. apps/stock/engine/src/backtest/mod.rs:138; apps/stock/engine/src/api/backtest.rs:194.
- FIN-05 — Verified: Rust and TypeScript separately implement fill/accounting behavior; the exposed native TypeScript callback method explicitly rejects callbacks. apps/stock/engine/src/api/backtest.rs:63; apps/stock/orchestrator/src/execution/SimulationExecution.ts:114.
- KEEP-02 — Verified: Preserve frozen/hash-verified historical snapshots and fenced durable runner attempts; extend them instead of creating a second job engine. apps/stock/orchestrator/src/data/historical-dataset.ts:98; apps/stock/orchestrator/src/backtest/BacktestRunner.ts:190.
Intended behavior and implementation scope
Extend the current dataset benchmark with one small harness for paths that actually exist: process/addon startup, dataset preparation, native load/run/result parse and repeated parameter trials. No new observability framework or fabricated callback timing. Mark unavailable counters/phases explicitly; F07/S01/P03/P04/A02 extend the same harness as capabilities arrive.
Exclusions
No speculative distributed infrastructure or weakened correctness gates.
Likely files and ownership
- scripts/benchmark-dataset.ts
- scripts/benchmark-research.ts (new)
- test/fixtures/ (benchmark datasets)
Write locks: benchmark-harness. One agent owns this change. Lock names do not override actual overlapping files.
Dependencies and blockers
No code prerequisite. Global execution approval and write-lock acquisition still required.
No additional economic-policy approval is needed for this narrowly scoped task.
Parallel eligibility: only with disjoint actual files and reserved write locks; read FIRST-WAVE.md for the initial exact ownership boundaries.
Acceptance criteria
- Single/multi-asset native fixtures and parameter trials record source/native binary/runtime/host/seed hashes and raw timings.
- Separate fresh-process/unprepared data from reused input objects; do not call one-shot repeated loads resident warm throughput.
- Report wall time, observed bar/trial rates, result bytes and RSS; DB/queue/allocation counters are unavailable until instrumented, not zero.
- Fixed fixture/economic hashes match repeated runs under the same policy; current known economic defects are limitations, not benchmark truth.
Mandatory tests
- Tiny harness self-test and1k/10k/100k optional scaling; runtime versions/build hash verified.
- No timing-flaky CI gate. Unsupported multi-strategy ownership/callback paths are labelled unavailable until canonical tasks land.
Apply relevant quality gates. Report exact commands/results and unavailable checks; named new cases are requirements, not claims of existing passing tests.
Regression risks and rollback
Performance measurements can hide semantic changes; require economic hash equivalence. Keep migrations additive and previous results readable. Do not add a switch that restores a correctness defect. Versioned cutover/migration is required only when persisted contracts or active engines change; never silently fall back to old economics.
Handoff
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.