perf(research): add compact replay projections and representative profiling
This commit is contained in:
parent
19e9dad68b
commit
e3bd722e31
21 changed files with 2830 additions and 130 deletions
|
|
@ -1,14 +1,14 @@
|
|||
# Revised development roadmap
|
||||
|
||||
Baseline `b7aeca4` · handoff 2026-10-23 · **F07 reviewed, validated and committed**
|
||||
Baseline `b7aeca4` · execution 2026-10-23 · **F09/P07 reviewed and validated; uncommitted**
|
||||
|
||||
Authorization update: the owner accepted and committed the reviewed F07 changes as `e3635f2` on 2026-10-23. The accompanying performance question requests assessment, not optimization implementation. No other ADR or multi-asset mark policy is approved. Pushes, PRs, trading operations and further task implementation remain outside scope.
|
||||
Authorization update: after committing F07 (`e3635f2`, completion record `19e9dad`), the owner requested performance stories and continuation. This authorizes F09 compact projections and P07 profiling, preserving existing financial semantics. F08 retains separate historical reporting work. No other ADR or multi-asset mark policy is approved; new commits, pushes, PRs and trading/default-engine operations remain outside scope.
|
||||
|
||||
## Strategy and review outcome
|
||||
|
||||
Use TypeScript for strategies, research and the web product; one Rust kernel owns money, risk, matching and replay. Preserve durable decisions/checkpoints, transactional execution, frozen datasets, reviewed calculations and failure-oriented tests.
|
||||
|
||||
The skeptical review consolidates **52 separate task definitions into 43 scheduled tasks plus 5 conditional tasks**. Four old IDs remain merged redirects, not extra work. This is a smaller delivery plan, not a smaller correctness standard. See [review findings and dispositions](REVIEW.md), [complete index](backlog/README.md) and [canonical manifest](backlog/manifest.json).
|
||||
The skeptical review established 43 scheduled tasks, 5 conditional tasks and 4 merged redirects. The measured F09/P07 additions bring the current plan to **45 scheduled + 5 conditional + 4 merged = 54 retained IDs**. See [review findings and dispositions](REVIEW.md), [complete index](backlog/README.md) and [canonical manifest](backlog/manifest.json).
|
||||
|
||||
The existing web workbench improves during engine migration. Legacy results remain labelled; fixing controls or terminal valuation does not make same-bar economics trustworthy. C06 blocks shared-runtime legacy research rather than building another soon-to-be-retired simulator runtime.
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ Long-only is the approved first canonical model, not deletion of short history o
|
|||
| --- | --- | --- |
|
||||
| M0: safe interim behavior | C01/C02/C03/C04/C06; O01; P01 | Scoped terminal/funding/input fixes; failed init cleans up; shared-runtime research rejected; migration lock and honest baseline measurements |
|
||||
| M1: usable current workbench | W01–W04 | Save, submit, cancel, inspect and reopen tested in browser; unsupported controls hidden; legacy economic limitations visible |
|
||||
| M2: canonical Rust/TS research | F01/F02/F04–F08, D01, S01/S02; R01/R10/W03/C06 then R05 | Owner-aware finance, deterministic replay, one TS strategy and retained input provenance work through durable runs |
|
||||
| M2: canonical Rust/TS research | F01/F02/F04–F09, D01, S01/S02; R01/R10/W03/C06 then R05; P07 measurements | Owner-aware finance, deterministic replay, compact results, one TS strategy and retained input provenance work through durable runs |
|
||||
| M3: useful research product | R02/R03/R04/R11/R12 | Catalog/workspace/dataset selection and original reproduction; metadata/UI proceed alongside engine work |
|
||||
| M4: batch research and validation | R06–R09, P04; S05 when ready | Bounded sweeps, summary comparisons, OOS/reset-segment walk-forward and measured worker scaling; regime panels only with S05 |
|
||||
| M5: paper parity and AI research | S03/S04, A01–A04 | Recovery parity, operator readiness, isolated bounded AI experiments and evidence-linked human paper promotion |
|
||||
|
|
@ -52,6 +52,8 @@ flowchart LR
|
|||
D01[Availability-aware eligible datasets] --> F06
|
||||
P01[Existing-path measurements] --> F06
|
||||
F06 --> F07[Bounded NAPI sessions] --> S01[TS decisions] --> S02[One SMA]
|
||||
F07 --> F09[Compact financial projections] --> F08
|
||||
F07 --> P07[Representative replay profiling]
|
||||
C02[Boundary integrity] --> F07
|
||||
F06 --> F08[Canonical projections + reviewed TS statistics]
|
||||
S02 --> R05[Durable canonical runs]
|
||||
|
|
@ -271,6 +273,40 @@ Limits remain explicit: trusted host interface, not an untrusted-code sandbox; n
|
|||
|
||||
Only the two named disposable fixture containers and their recreatable synthetic data were removed; development services were untouched. Worktree/logs retained. Browser/Python suites were not rerun because those boundaries did not change. **F07 is committed. Next recommended: F08 canonical metrics/result projections**, now code/ADR-ready but not yet authorized. S01 requires ADR-005 approval. No push, PR, default cutover or trading operation occurred.
|
||||
|
||||
## Twelfth-wave handoff — 2026-10-23
|
||||
|
||||
Two focused performance stories replace a broad optimization request: [F09](backlog/tasks/F09.md) emits compact authoritative terminal values/owned fills with optional complete diagnostics; [P07](backlog/tasks/P07.md) profiles no-trade, sparse and high-turnover workloads using the existing harness. F08 consumes F09 and later adds explicit session sampling/exposure/statistical policies. No session-close values are inferred from risk baselines, and fills are not relabelled completed trades.
|
||||
|
||||
Base `19e9dad`; isolated worktrees under `/tmp/stock-bot-wave12.F9Rlh4/`. One native/result contract owner, one disjoint benchmark owner, root planning/integration and independent review. Baseline profiling was measured on F07; compact comparisons used the accepted F09 contract. Internal journals/recovery, legacy/default paths and all mark-policy release gates remain. No framework, DSL, cache, worker-pool or web-pagination expansion.
|
||||
|
||||
Both stories are independently reviewed and `review` / `validated_uncommitted`. Root integrated 14 source/test files with exact reviewed hashes. F09's accepted contract was overlaid into P07's isolated worktree before compact comparison work; neither owner independently changed the other's contract.
|
||||
|
||||
- **F09:** native `project()` returns the existing authoritative ledger valuation and actual owned fills copied from committed commands/effects. It skips replay aliases and retains separate gross cash movement and fee postings, signed owner contributions and residual cost basis. Typed serialization borrows journal facts; no checkpoint copying, financial replay or TypeScript accounting is introduced. Complete-state/identity/format/cancellation guards cover the compact path. Full `finalize()` output, defaults, internal journals and recovery are preserved.
|
||||
- **P07:** the existing harness now selects no-trade, sparse and turnover profiles with identical callback cadence, plus trace/projection/both output. It records native-finalization, decoding, validation and disposal separately. Comparisons require the same dataset, policy, strategy, artifact, terminal view and actual fill facts. Full per-format hashes remain independent; no TypeScript valuation is fabricated to compare formats. A 200,000-fill regression prevents a benchmark-only JavaScript argument-limit failure.
|
||||
|
||||
Validation: full `CARGO_BUILD_JOBS=2 bun run check` passed build/types/contracts/lint/audit, 63 tooling, 43 utility, 35 calculation, 359 integration and **136 Rust tests**, zero failures; four existing manual benchmarks remain intentionally ignored. After the final benchmark files were integrated, all **72 tooling tests / 10,184 assertions** passed. Extra strict test/script TypeScript, scoped ESLint, rustfmt and diff checks passed. Disposable PostgreSQL/Redis suites passed **58 tests / 345 assertions** before and after integration. Independent debug and integrated release native/worker checks each passed **23 tests / 198 assertions**. These focused tests overlap larger suites. No browser/Python rerun was needed for unchanged boundaries.
|
||||
|
||||
Paired release results below use identical frozen source and addon `d98308d0…`, two fresh processes with two fresh native sessions each, including reversed callback order. Numbers are median **replay/decision/finalization/disposal time**, excluding native construction and benchmark-only oracle/hash work. Bars are total across assets. Preparation/imports, whole-trial time, all phase timings, RSS, hashes and raw report paths are recorded in the manifest. This is synthetic component conformance throughput on a shared host, not durable-job latency or an isolated-host SLA.
|
||||
|
||||
| Total bars | Profile | Assets / owners | Full trace | Compact | Reduction |
|
||||
| --- | --- | --- | ---: | ---: | ---: |
|
||||
| 10,000 | No trade | 1 / 1 | 1.142s | 0.744s | 34.9% |
|
||||
| 10,000 | No trade | 10 / 2 | 0.599s | 0.296s | 50.7% |
|
||||
| 10,000 | Sparse | 1 / 1 | 1.184s | 0.835s | 29.5% |
|
||||
| 10,000 | Sparse | 10 / 2 | 0.720s | 0.419s | 41.8% |
|
||||
| 10,000 | Turnover | 1 / 1 | 2.105s | 1.467s | 30.3% |
|
||||
| 10,000 | Turnover | 10 / 2 | 2.598s | 1.804s | 30.6% |
|
||||
| 100,000 | Sparse | 1 / 1 | 11.918s | 8.097s | 32.1% |
|
||||
| 100,000 | Sparse | 10 / 2 | 7.312s | 4.245s | 41.9% |
|
||||
| 100,000 | Turnover | 1 / 1 | 21.027s | 14.821s | 29.5% |
|
||||
| 100,000 | Turnover | 10 / 2 | 26.501s | 18.743s | 29.3% |
|
||||
|
||||
Every selected comparison passed independent economic oracles, complete result repeatability and common financial equality. All six 10k diagnostic hashes also match the historical F07 baseline. That intermediate extended harness's source bodies were not retained, only their hashes, so historical timings are contextual; speedup claims use the final paired source, which is archived with all 21 changed files as measured. Final planning edits follow the measurements; application source remains identical. No 100k no-trade run is claimed.
|
||||
|
||||
At 10k turnover, output falls from **66.7MB to 9.8MB** single and **103.6MB to 19.4MB** multi. At 100k turnover it falls from 672MB/1.044GB to 98.6MB/195.8MB. Full diagnostics remain available; this is an export reduction, not deletion of retained history. Compact 10k advance/submit accounts for 70–88% of run time. Those mixed timers should be profiled before selecting another optimization. Fixture TS decisions take only 0.9–3.5%; these results do not justify a DSL. Compact schema validation and disposal remain measured costs; removing checks or recovery history is not the next step.
|
||||
|
||||
Only the two exact disposable fixture containers and their synthetic data were removed; development services were untouched. Worktrees, logs and measured-source archive remain available. No commits, pushes, PRs, default cutover or trading operation occurred. **Next after acceptance: F08 historical equity/session/exposure and versioned statistics**, with explicit sampling conventions. S01 and product/AI work retain their pending ADR gates; the equal-time multi-asset risk-mark restriction remains unresolved.
|
||||
|
||||
## Deferred and rejected
|
||||
|
||||
Conditional: shared feature cache D04; cross-trial resident datasets P03; large-detail pagination/storage P05; tiny DSL P06; expanded cross-service monitoring O02. Each has a measured/real-need trigger and is not a prerequisite for scheduled work.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue