3.9 KiB
3.9 KiB
Piker FSP Expertise
Treat financial signal processing as causal, revision-aware processing of event-time market data, not as generic batch array manipulation.
Start Here
- Identify the source
Flume, timeframe, event clock, and writer actor. - State whether the operation is historical bootstrap, backfill revision, current-sample mutation, or sample-step append.
- Record source and destination absolute SHM bounds before reasoning from lengths or
ShmArray.index. - Separate compute, SHM publication, IPC wakeup, and graphics costs before optimizing.
- Preserve causality, warm-up behavior, missing-data semantics, and output schema in every implementation and test.
Read architecture.md before modifying runtime code. Read signal-processing.md before adding an algorithm. Use roadmap-and-research.md for design and dependency work, and test-map.md for verification.
Core Contracts
piker.dataowns provider ingestion, sourceFlumes, history publication, quote fan-out, OHLC mutation, andsamplerdstep events.piker.fspowns operator declarations, historical computation, realtime state updates, and destination SHM publication.piker.ui._fsp.FspAdmincurrently owns FSP worker selection, destination allocation, cascade lifetime, and chart attachment.- One logical writer owns each destination FSP array.
- Output event time and absolute indices derive from the source series, not task scheduling or quote arrival order.
- A source prepend changes historical provenance even when the current sample index is unchanged. Recompute or patch the affected destination range.
- One-step destination lag is normal between source sampling and destination append. A destination lead or unexplained bound shift is not.
- Backfill notifications are source and timeframe specific even though the current sampler transport broadcasts them globally.
- Only graphics backed by a rebuilt destination should refresh. Never use an FSP update as an unconditional whole-chart redraw request.
Editing Workflow
- Trace the operator from
@fspdeclaration throughcascade(),connect_streams(), destination SHM,FspAdmin, and every consumingViz. - Write an event-order table covering source writes, bound publication, notifications, cancellation, recomputation, and destination publication.
- Add deterministic tests for history and realtime phases independently.
- Add a controlled interleaving test for every race fix.
- Profile representative visible ranges and feed rates before adding a dependency or native boundary.
Companion Skills
- Use
piker-conc-expertfor Tractor contexts, actor topology, cancellation, service ownership, and cross-actor state. - Use
timeseries-optimizationfor NumPy/Polars lookup and vectorization. - Use
piker-profilingfor distributed performance measurements. - Use
pyqtgraph-optimizationfor renderer and graphics batching work. - Use
piker-clearing-expertwhen a derived signal reaches EMS or accounting.
Do Not
- Do not hide a historical mismatch merely to stop a resync log.
- Do not infer a complete synchronization state from array length alone.
- Do not run Python loops over historical numeric arrays without evidence.
- Do not apply regular-grid DSP blindly to irregular tick arrival times.
- Do not introduce an external stream runtime that duplicates Tractor before measuring an isolated protocol or kernel prototype.
- Do not route strategy signals directly around EMS order-state, risk, or accounting contracts.