jgrusewski 16100912c3 plan(sp18 v2): allocate 22 ISV slots [483..505) for D-leg + B-leg
Adds combined SP18 D-leg Hold-reward adaptive-cap slots [483..493) +
B-leg TD(λ) Q(s') bootstrap diagnostics + PopArt reset flag at
[493..505) per spec DD6 (D-leg 10 slots) + B-DD13 (B-leg 12 slots).

D-leg [483..493) — 10 slots:
  483 HOLD_REWARD_POS_CAP            (sentinel 5.0,  bounds [0.5, 50])
  484 HOLD_REWARD_NEG_CAP            (sentinel -10.0)
  485 HOLD_REWARD_DECOMP_DIAG        (sentinel 0.0)
  486 HOLD_OPP_COST_FIRE_RATE_EMA    (sentinel 0.0)
  487..493 HRC_* Welford accumulators (mirrors SP16 T3 HCS_* pattern)

B-leg [493..505) — 12 slots:
  493 TD_ERROR_MAG_EMA               (HEALTH_DIAG B-DD9 ratio gate input)
  494 Q_NEXT_TARGET_P99              (target-Q bootstrap bound check)
  495 Q_NEXT_MINUS_REWARD_P99        (sanity: should be O(1) post-fix)
  496 V_SHARE_TREND_DIAG             (B-leg synergy probe)
  497 POPART_RESET_FLAG              (sentinel 1.0 — one-shot, B-DD11)
  498..504 TDB_* Welford accumulators (mirrors HRC_* pattern)
  504 RESERVED                        (B-leg follow-up)

Pearl-A first-observation bootstrap sentinels match position-side
SP14 P0-A REWARD_POS_CAP_ADAPTIVE pattern (POS=5.0, NEG=-10.0). Slot
497 POPART_RESET_FLAG sentinel = 1.0 per B-DD11 — host writes 1.0
once at first SP18 epoch, kernel zeroes after consuming, gating the
per-fold PopArt slot 63 EMA reset at the SP18 deployment boundary.

ISV_TOTAL_DIM bumped 483 → 505; layout_fingerprint_seed updated with
all 22 new slot names; state_layout.cuh C-side mirror in lockstep
(continues SP14-P0A/P1/audit-fix-4A/4B mirror precedent — SP16/SP17
slots intentionally not mirrored per existing pattern, only SP18 gets
fresh mirror entries).

`feedback_no_partial_refactor`: both legs share an ISV section + a
single fingerprint bump; SP13 [380..383) and SP16 [461..474) slots
remain ALLOCATED but RETIRED in PP.4 (sentinel 0.0, no producer
launch — RESERVED-gap pattern from SP14-C.1 preserves checkpoint
compatibility).

Audit doc updated per Invariant 7 with Pre-Phase PP.2 entry.

Spec: docs/superpowers/specs/2026-05-08-sp18-reward-shape-hold-attractor-design.md
Plan: docs/superpowers/plans/2026-05-08-sp18-reward-shape-hold-attractor.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 00:34:13 +02:00

Foxhunt

Production HFT trading system in Rust.

Architecture

The workspace contains 32 crates organized as follows:

Core Libraries (16)

Crate Purpose
trading_engine Order processing, FIX 4.4, IB TWS, SIMD, RDTSC timing
risk VaR, Kelly, circuit breakers, kill switches, compliance
risk-data Risk data types and shared structures
trading-data Trading data types
ml DQN Rainbow, PPO, TFT, Mamba2, ensemble inference
ml-data ML data types and feature definitions
data Market data ingestion and storage
backtesting Replay engine, strategy tester
adaptive-strategy Ensemble execution, microstructure analysis
common Shared types, resilience, error handling
storage S3 and local model storage
model_loader Model serialization and loading
market-data Market data feed handlers
database PostgreSQL access layer (SQLx)
config Configuration management
tli CLI commands and tooling

Services (8)

Service Purpose
backtesting_service gRPC backtesting service
broker_gateway_service FIX routing, broker connectivity
trading_service Core trading operations
ml_training_service Model training orchestration
data_acquisition_service Market data acquisition
trading_agent_service Autonomous trading agents
api_gateway gRPC API gateway with auth
web-gateway Axum REST + WebSocket gateway

Frontend

web-dashboard/ -- React 19 + TypeScript + Vite + TradingView charts.

Building

# Check compilation (no PostgreSQL required)
SQLX_OFFLINE=true cargo check --workspace

# Run tests for a specific crate
SQLX_OFFLINE=true cargo test -p <crate> --lib

# Clippy
SQLX_OFFLINE=true cargo clippy --workspace

ML Models

Four production model architectures on Candle v0.9.1 with CUDA:

  • DQN Rainbow -- Deep Q-Network with prioritized replay, dueling heads, noisy nets
  • PPO -- Proximal Policy Optimization with GAE and LSTM policies
  • TFT -- Temporal Fusion Transformer for multi-horizon forecasting
  • Mamba2 -- State space model for sequence prediction

Each model has a standalone trainer and a UnifiedTrainable adapter for the hyperopt pipeline.

Infrastructure

  • Git: Gitea at git.fxhnt.ai (Tailscale-only), Scaleway DEV1-S
  • Observability: OpenTelemetry OTLP (env OTEL_EXPORTER_OTLP_ENDPOINT)
  • Database: PostgreSQL with SQLx offline mode for CI

License

Proprietary. All rights reserved.

Description
No description provided
Readme 849 MiB
Languages
Rust 88.2%
Cuda 7.7%
Python 1.3%
Shell 1.1%
PLpgSQL 0.8%
Other 0.8%