ac9bcab94a35e1686b294d057355dc52df32c010
Lands the static-configuration branch of Plan 1 C.6: cql_alpha, conviction_floor (no-op if IQL_BRANCH_SCALE_FLOOR already serves), plan_threshold written to dedicated ISV slots at constructor. Consumer kernels (CQL, backtest_plan, experience) read from ISV instead of config fields / hardcoded literals. Also pre-allocates ISV slots for the 6 upcoming GPU-kernel tasks (atoms, gamma, kelly_cap, tau, epsilon outputs + CPU-born epoch inputs). Those slots start at 0; GPU kernels in follow-up commits fill them. New ISV slots: - EPOCH_IDX_INDEX=39, TOTAL_EPOCHS_INDEX=40 (CPU-born inputs) - EPSILON_EFF_INDEX=41, TAU_EFF_INDEX=42, GAMMA_EFF_INDEX=43, KELLY_CAP_EFF_INDEX=44 (GPU-written in follow-up tasks) - CQL_ALPHA_INDEX=45, PLAN_THRESHOLD_INDEX=46 (static config; this commit) - Task 15 confirmed no-op: IQL_BRANCH_SCALE_FLOOR_INDEX=36 already serves conviction-floor role (constructor + ISV read in iql kernel). Layout fingerprint auto-updated via seed-byte edits; fingerprint re-tail at [47..49). ISV_TOTAL_DIM 39 -> 49. GpuDqnTrainConfig gains total_epochs field; fused_training.rs passes hyperparams.epochs at construction; default 0 for smoke tests. write_isv_signal_at bound extended from ISV_DIM(23) to ISV_TOTAL_DIM(49) so tail slots are writable by CPU. cql_alpha consumer: compute_cql_logit_gradients reads base from ISV[CQL_ALPHA_INDEX] instead of config.cql_alpha; adaptive formula (base x health x (1-regime_stability)) unchanged. plan_threshold consumers: experience_kernels.cu (experience_state_gather, experience_action_select, experience_env_step) and backtest_plan_kernel.cu (backtest_plan_state_isv) read plan_thr from ISV[ISV_PLAN_THRESHOLD_IDX=46] via isv_signals pointer already present in both kernels; null-guard defaults to 0.5f for smoke-scale runs without ISV warmup. ISV_PLAN_THRESHOLD_IDX=46 defined in state_layout.cuh (included by both plan kernel files); value must match PLAN_THRESHOLD_INDEX in gpu_dqn_trainer.rs. StateResetRegistry entries added for all new slots: SchemaContract for TOTAL_EPOCHS/CQL_ALPHA/PLAN_THRESHOLD; FoldReset for EPOCH_IDX and GPU-written per-fold slots. No behavioural change: all threshold/base values remain at their prior defaults; consumers now read adaptive values from ISV instead of baked-in config or hardcoded literals. Plan 1 Tasks 12, 15, 16 + pre-allocation for 9, 10, 11, 13, 14. Spec §4.C.6 (2026-04-24 GPU-drives-CPU-reads revision). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Languages
Rust
88.2%
Cuda
7.7%
Python
1.3%
Shell
1.1%
PLpgSQL
0.8%
Other
0.8%