2ba0eef718f336da903a0df871061877c20403c4
Smoke smoke-test-xvzgk (commit f139a63ee) confirms Phase B
instrumentation fires correctly: backward-path slots 24-35 capture
the F1 ep2 explosion's NaN topology beyond the prior visible-only
[6, 12] (grad_buf + save_h_s2).
F1 first-fire signature: flagged=[6, 12, 26, 32]
- 26 iqn_trunk_m — apply_iqn_trunk_gradient cuBLAS bwd output
- 32 bn_d_concat_buf — Bottleneck Linear backward dy
- 6, 12 = downstream propagation (existing visible flags)
CLEAN at first-fire: slots 27 (iqn_d_h_s2_buf), 28 (d_branch_logits_buf),
33/34/35 (bw_d_h_s2 multi-point), 24/25 (d_value/adv_logits_buf),
29 (cql), 30 (aux).
Source kernels identified (drives Task 6 surgical fix):
1. apply_iqn_trunk_gradient cuBLAS sgemm (gpu_dqn_trainer.rs:6843+) —
matches session_2026-04-05 residual-8% finding, never closed.
2. Bottleneck Linear backward cuBLAS sgemm — NEW finding (not in audit's
original top-3 ranking). cuBLAS GEMM produces NaN from clean inputs;
suggests extreme intermediate products at F1's Bellman-target shift.
Both are template (f) cuBLAS-wrapper fixes — input range guard + output
sanitization, ISV-driven bounds (Q_ABS_REF_INDEX=16, Q_DIR_ABS_REF_INDEX=21,
H_S2_RMS_EMA_INDEX=96 — all existing slots, no new ISV).
F0 Sharpe regression to 34.55 (from 55.87 baseline) noted as concern.
Possible stochastic variance OR Phase B instrumentation timing impact;
calibrate with Task 6 fix smoke. No deferral per operating principles.
F2 cascade (steps 5+): flagged adds slots 2, 3, 7, 8, 24, 25, 29, 33, 34
once F1's corrupted Adam EMAs + weights flow into F2. Slots 27, 28, 35
STAY CLEAN throughout — IQN-internal backward chain is NOT the seed;
the cascade enters IQN's consumer but never the IQN producer.
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%