Replace raw ps[N] access across all CUDA kernels with PS_* named constants defined in state_layout.cuh. 32 constants total covering the full 38-slot portfolio state: position/cash/value, DSR stats, Kelly stats, plan fields, and OFI scratch range. Notable deviations from pre-written plan mapping: the plan's PS_VALUE/PS_POSITION/PS_CASH values (0,1,2) had the wrong semantics. Code wins (feedback_trust_code_not_docs): ps[0]=position, ps[1]=cash, ps[2]=portfolio_value. All 148 raw ps[digit] accesses in experience_kernels.cu and trade_stats_kernel.cu migrated. In-comment range references (e.g. "ps[30..37]") left as documentation. trade_stats_kernel.cu: migrated base+14 offset to PS_KELLY_WIN_COUNT. docs/dqn-named-dims.md: PS_* table corrected to match actual code layout. No behavioural change; pure refactor. Plan 1 Task 4A. Spec §3 Invariant 8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ml
10-model ML ensemble for the Foxhunt HFT system, built on Candle v0.9.1.
Models
- DQN (Rainbow) — deep Q-network with prioritized replay, dueling heads, noisy nets
- PPO — proximal policy optimization with GAE, LSTM policies, clip-higher
- TFT — temporal fusion transformer for multi-horizon forecasting
- Mamba2 — state space model for sequence prediction
- Liquid Networks — biologically inspired networks for non-stationary data
- TLOB — transformer-based limit order book analysis
- KAN — Kolmogorov-Arnold networks
- xLSTM — extended LSTM architecture
- TGGN — temporal graph neural network
- Diffusion — diffusion-based generative model
Key Modules
ensemble— model ensemble coordination and confidence aggregationhyperopt— PSO-based hyperparameter optimization with per-model adapterstrainers— unified training loops (DQN, PPO, supervised)inference—InferenceAdaptertrait for predictioncheckpoint— model checkpointing and restorationevaluation— walk-forward evaluation pipeline
Usage
use ml::dqn::DQN;
use ml::ppo::PpoTrainer;