Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

38 changes: 33 additions & 5 deletions docs/native-vector-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,41 @@ compiled lag or window. A discard sink demonstrates this live-value bound:
batch_rows × (projected + intermediate + final columns) + bounded state
```

## Exact indicator kernels

M20-04 adds operation-driven implementations for every TA-Lib function reachable
from NFI X7 at upstream `e857f9b6`: ADX, AROON, BBANDS, CCI, EMA, MAX, MFI, MIN,
MINUS_DI, OBV, PLUS_DI, ROC, RSI, SMA, STDDEV, STOCHF, SUM, ULTOSC, and WILLR.
Pandas rolling mean, sum, min, and max are also exact for every inventoried
window, including the 2,016-candle window.

The committed oracle contains 2,200 input rows, all 56 reachable TA-Lib parameter
variants, and 24 rolling variants. Finite values compare by exact f64 bits; NaN
warmup positions compare exactly and signal-boundary tests use no tolerance.
Moving, directional, oscillator, and rolling state continues across arbitrary
record-batch boundaries while retaining only period-scale memory.

Regenerate the oracle from an inventory with:

```bash
uv run python scripts/generate_indicator_kernel_fixture.py \
.nfi/indicator-inventory.json \
benchmarks/reference/indicator-kernels/nfi-x7-e857f9b6-talib-v0.6.4.json
```

TA-Lib multi-output calls are represented by generic output names such as
`aroondown`, `fastk`, or `upperband`; tuple assignment and constant output
subscripts compile without Signal- or strategy-specific branches.

## Current claim boundary

M20-03 provides the engine, typed columns, generic scalar operations, causal
shift, rolling storage, and source-located fail-closed errors. TA-Lib indicators,
rolling reducers, EWM algorithms, and the complete latest-NFI kernel set belong
to M20-04 and require official Python/TA-Lib column-exact fixtures before Native
promotion. An unimplemented reachable opcode stops; it is never guessed.
The latest X7 indicator operation set now has exact Native kernels. This does not
yet claim that the entire latest X7 source compiles: compilation currently stops
at `strategy.py:3168:21` on an informative/config attribute that belongs to the
source and multi-timeframe lowering work in M20-05. EWM remains fail-closed
because it is not reachable in this upstream inventory. Unknown functions,
non-SMA TA-Lib MA types, centered rolling windows, Arrow null indicator inputs,
and unselected multi-output calls also stop rather than being guessed.

The Rust boundary can validate a compiled contract directly:

Expand Down
70 changes: 63 additions & 7 deletions planning/roadmap-state.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schema_version": "1.0.0",
"roadmap_id": "nfi-backtest-engine-post-v1.1.0",
"revision": 129,
"updated_at": "2026-08-10T23:08:02+09:00",
"revision": 131,
"updated_at": "2026-08-11T00:55:12+09:00",
"acceptance_commands": "planning/acceptance-commands.json",
"active_task_id": null,
"execution_policy": {
Expand Down Expand Up @@ -4730,7 +4730,7 @@
"order": 2004,
"milestone": "M20",
"title": "Implement all NFI-reachable indicator kernels",
"status": "pending",
"status": "completed",
"depends_on": [
"M20-03"
],
Expand All @@ -4748,10 +4748,18 @@
"column-exact vector fixtures",
"boundary-sensitive signal tests"
],
"started_at": null,
"completed_at": null,
"commit_sha": null,
"evidence": [],
"started_at": "2026-08-11T00:08:20+09:00",
"completed_at": "2026-08-11T00:55:12+09:00",
"commit_sha": "d589e53b71681c01f2b487a4bbfa5d9c5617d036",
"evidence": [
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/acceptance-report.json",
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/kernel-oracle-report.json",
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/latest-program-gap.json",
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/SHA256SUMS.txt",
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/x7-spot/run.json",
".nfi/roadmap-acceptance/M20-04/d589e53b71681c01f2b487a4bbfa5d9c5617d036/x7-futures/run.json",
"benchmarks/reference/indicator-kernels/nfi-x7-e857f9b6-talib-v0.6.4.json"
],
"blocker": null
},
{
Expand Down Expand Up @@ -8292,6 +8300,54 @@
"next_eligible_task": "M20-04",
"next_task_manual_gate": false
}
},
{
"sequence": 177,
"timestamp": "2026-08-11T00:08:20+09:00",
"task_id": "M20-04",
"event": "task_started",
"details": {
"objective": "implement every latest-NFI-reachable indicator kernel with column-exact Python and TA-Lib shadow evidence",
"latest_upstream_must_be_frozen": true,
"zero_tolerance_native_promotion": true,
"unverified_numerical_substitutions_allowed": false,
"strategy_or_signal_hardcoding_allowed": false,
"kernel_dispatch_must_be_operation_driven": true
}
},
{
"sequence": 178,
"timestamp": "2026-08-11T00:55:12+09:00",
"task_id": "M20-04",
"event": "task_completed",
"details": {
"implementation_commit": "d589e53b71681c01f2b487a4bbfa5d9c5617d036",
"latest_upstream_commit": "e857f9b687189b5a4634abbb02b257c1d70df84a",
"latest_strategy_sha256": "3c9a27500ee8cb01d3bc35903a3bd44b5892383b1eafb0f10a3d332e3c5a5974",
"inventory_fingerprint": "f09bc6b043f160058f21a2b638a37de5fa056b94595271664ce61ac601fd10fb",
"oracle_fingerprint": "f1fc94e7f1496e21258fb94907194135870ace2fc144660160b6904a64ccf321",
"oracle_rows": 2200,
"talib_operation_count": 19,
"talib_parameter_variant_count": 56,
"pandas_rolling_variant_count": 24,
"column_and_warmup_exact": true,
"tolerance_used": false,
"streaming_chunk_exact": true,
"bounded_state": true,
"python_test_count": 732,
"future_compatibility_test_count": 134,
"rust_workspace_test_count": 195,
"spot_trade_surface_and_full_state_exact": true,
"futures_trade_surface_and_full_state_exact": true,
"runtime_hardcoding_added": false,
"unsafe_rust_added": false,
"latest_x7_fully_compiled": false,
"latest_x7_fail_closed_source": "strategy.py:3168:21",
"all_latest_nfi_reachable_indicator_kernels_exact": true,
"full_native_strategy_claim": false,
"next_eligible_task": "M20-05",
"next_task_manual_gate": false
}
}
]
}
Loading