Files
foxhunt/crates/ml
jgrusewski 719f18baab perf: eliminate ALL remaining concerns — zero waste in hot path
Vaccine:
- Replaced upload_batch_gpu (sync DtoD) with upload_batch_ptrs_6 +
  submit_indirect_upload_ops (async indirect kernels). Zero sync.
- Deleted upload_batch_gpu entirely — no callers remain.

Causal intervention:
- Removed entirely from hot path. Was running 14 cuBLAS forward passes
  every 100 steps with no readback and no training decision based on
  the result. Pure GPU waste.
- Kernel still exists in cubin for future offline analysis.

Causal readback:
- Removed stream.synchronize() + memcpy_dtoh from run_causal_intervention.
  Return value was already discarded by caller. Now returns 0.0 immediately.
  Sensitivity stays on GPU.

Dead code:
- Deleted upload_batch_gpu (72 lines) — replaced by indirect upload.

Per-step hot path on step 2+:
  9 graph replays (~45µs)
  5 async HtoD (92 bytes, ~5µs)
  Zero sync. Zero DtoH. Zero alloc. Zero CPU compute.
  Zero concerns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 10:35:16 +02:00
..

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 aggregation
  • hyperopt — PSO-based hyperparameter optimization with per-model adapters
  • trainers — unified training loops (DQN, PPO, supervised)
  • inferenceInferenceAdapter trait for prediction
  • checkpoint — model checkpointing and restoration
  • evaluation — walk-forward evaluation pipeline

Usage

use ml::dqn::DQN;
use ml::ppo::PpoTrainer;