Commit Graph

112 Commits

Author SHA1 Message Date
jgrusewski
d5e270e18b fix: Components 2+5 fully GPU — zero CPU compute, zero copies
xLSTM: qlstm_step kernel reads q_stats_buf directly on device, updates
C matrix on device, writes context[8] to device buffer. qlstm_train_step
runs SGD on device. No DtoH readback.

RK4 ODE: liquid_tau_rk4_step kernel reads per_branch_q_gap_ema (device),
context (device), writes liquid_mod (device). No pinned memory — plain
CudaSlice. Replaces CPU update_liquid_tau entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 08:35:40 +02:00
jgrusewski
9c4c97cf8d spec: Supervised Architecture Transfer — 7 concepts from KAN/xLSTM/Diffusion/TGNN/Liquid/TFT/TLOB
1. KAN spline activations → adaptive branch gates (learnable activation shape)
2. xLSTM matrix memory → temporal Q-value context (trajectory pattern detection)
3. Diffusion denoising → iterative Q-refinement (uncertainty-conditioned)
4. TGNN gating → cross-branch graph message passing (structural coordination)
5. Liquid RK4 ODE → higher-order training dynamics (adaptive Euler/RK4)
6. TFT quantile outputs → uncertainty-driven exploration (replaces epsilon-greedy)
7. TLOB MBP-10 → direct microstructure injection to order/urgency branches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 08:19:18 +02:00
jgrusewski
d5414bec25 spec: Component 6 early termination — PLATEAU_EXHAUSTED after 12 attempts
3 rewinds × 4 routes = 12 max attempts. Failed = improvement rate below
threshold over 10 epochs. On exhaustion: save best model, exit cleanly,
log "structural change needed". Saves ~3 hours H100 vs frozen training.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 23:46:27 +02:00
jgrusewski
f5985cff14 spec: add Component 6 — Trajectory Backtracking (single GPU)
Checkpoint ring buffer ranked by improvement rate, plateau detection
via liquid tau velocity, informed perturbation cycle (Adam reset,
shrink-perturb, temp boost, LR×2), depth-limited rewind. ~150 lines
in training_loop.rs, zero CUDA changes. Recovers from plateaus that
prevention mechanisms (spread gradient, liquid tau) fail to avoid.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 23:38:05 +02:00
jgrusewski
0cfb2c7786 fix: 6 concerns in Cross-Pollinated Branch Intelligence spec
1. Variable Selection: static → input-dependent bottleneck (true TFT VSN)
2. Q Attention: add direct gradient via Expected SARSA target integration
3. Liquid Tau: modulates IQL scales via separate liquid_mod[4] buffer
4. Selectivity: per_sample_loss proxy (per-sample grad norms infeasible at 32GB)
5. GLU gate: zero-init W_gate/b_gate → sigmoid(0)=0.5 (stable start)
6. Weight layout: updated for 8 VSN bottleneck matrices (indices 26-33)

NUM_WEIGHT_TENSORS: 26 → 42. Total new params: ~297K.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 23:14:41 +02:00
jgrusewski
8a9424b6eb spec: Cross-Pollinated Branch Intelligence — 5-component unified design
Combines TFT Variable Selection, GLU Gating, Cross-Branch Q Attention,
Liquid adaptive tau, and Mamba-2 Selective Replay into unified branch
architecture. Plus 11-item dead code cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 23:06:18 +02:00
jgrusewski
234870d966 spec: direction-conditioned magnitude head (Layer 3)
Magnitude FC input changes from h_s2[B, SH2] to [h_s2; Q_dir][B, SH2+3].
Direction E[Q] values (3 scalars per sample) are computed from branch 0
logits and concatenated. w_b1fc grows by 3*adv_h parameters (768 for AH=256).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:14:49 +02:00
jgrusewski
a5945db538 spec: Adaptive Training Dynamics v2 — 4-layer design for breaking Sharpe plateau
Layer 1: Rank-preserving signed reward standardization (SNR 0.001→0.5)
Layer 2: Temporal Q-gap momentum (spread modulation at plateaus)
Layer 3: Direction-conditioned magnitude (dir Q-values → mag head input)
Layer 4: Distributional variance position sizing (Kelly from C51 atoms)

Based on train-w6qfd results: val_Sharpe=21-25 sustained, Q-gap=0.138
growing. Builds on 32 fixes from this session. Implementation order:
1→2→4→3 (signal → momentum → variance → architecture).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:40:03 +02:00
jgrusewski
33b03a86a6 docs: IQL H100 hardening spec — drift readiness, p5 floor, buffer-relative staleness
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:13:39 +02:00
jgrusewski
d0227e78bb docs: fix 6 issues in IQL integration spec from code review
- Fix staleness: buffer_write_pos is host-side, pass as scalar (not in GpuBatch)
- Fix epsilon: branching_action_select takes 3 scalar epsilons, not 1
- Fix dead code list: add GpuExperienceCollector::v_range_ptr, FusedTrainingCtx wrappers, training_loop callers
- Fix step 0: seed per_sample_support with [-1, 1] default at construction
- Fix entropy: delete ent_scale conditionals, branch_scales subsumes them
- Fix non-graph c51 launches: 4 sites in gpu_dqn_trainer.rs need per_sample_support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 14:51:30 +02:00
jgrusewski
b593f038f7 docs: IQL full integration design spec — 5 components
Covers: PER advantage-weighted staleness, per-sample C51 atom
support centered on V(s), per-branch advantage decomposition,
dual-tau expectile gap exploration, and v_range dead code removal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 14:45:26 +02:00
jgrusewski
44b07d1022 docs: spec for single shared cuBLAS handle refactor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:29:05 +02:00
jgrusewski
0f5b2b07b0 docs: spec for deterministic eval via training graph replay
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 09:26:14 +02:00
jgrusewski
1a3da6f6b0 spec: Candle GpuVarStore elimination — 40+ call sites, 15 files, blocks bottleneck
VarStore is a CPU-trip corrupting data + degrading performance. Must be
replaced with direct pointer buffers (flat params_buf is already the
source of truth). Checkpoint, weight extraction, and polyak updates
all need porting to direct CudaSlice operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:30:12 +02:00
jgrusewski
553289545a spec: Autonomous Branch Intelligence (ABI) — fix DQN action collapse
10-component design to fix 82% Flat/Small action concentration:
1. Collapse degenerate 9→7 level exposure space
2. Per-branch reward decomposition (direction/magnitude/order/urgency)
3. Hindsight action relabeling for magnitude
4. Position-aware temporal exploration with per-branch epsilon
5. IQN quantile spread as anti-collapse signal
6. Activate PopArt + couple with tau reset
7. Feed the gradient vaccine with diverse batches
8. Per-branch bottleneck widths
9. Ensemble variance at inference
10. Clear PER between folds

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:23:23 +02:00
jgrusewski
1b5af8e9f3 spec: dead code cleanup + GPU per-phase CUDA event profiling 2026-04-10 22:16:24 +02:00
jgrusewski
8c92db09f3 spec: Argo training pipeline redesign — one workflow, smart caching
Single train template replaces 7 overlapping workflows. Binary cache
on PVC by commit SHA, fxcache skip-if-exists. Delete 5 dead templates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:26:55 +02:00
jgrusewski
49bedfcd69 feat(magnitude): per-branch loss weighting — 0.2× C51 + 4.0× MSE for magnitude
C51 cross-entropy structurally prefers low-variance actions (Small positions
have tighter return distributions). MSE is variance-neutral. By reducing
C51's gradient to 20% and amplifying MSE to 4× for the magnitude branch,
MSE becomes the dominant loss signal for position sizing.

Direction/order/urgency keep full C51 gradient for distributional risk awareness.
Replaces the previous mag_amp=1.5 which addressed a symptom (Flat gradient
starvation) rather than the root cause (C51 variance bias).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 22:23:19 +02:00
jgrusewski
193cb11035 docs: volume bar pipeline spec + implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:26:40 +02:00
jgrusewski
4eaa431739 fix(critical): disable mirror universe — only negates 4/42 features but inverts direction
The mirror universe feature negated only features[0..3] (4 return-like
features) but inverted the direction action (Short↔Long). The remaining
38 directional features (momentum, trend, patterns) were NOT negated.
This taught the model the WRONG direction on 50% of epochs, cancelling
out the directional signal and producing worse-than-random performance.

Disabled until proper full-feature mirroring is implemented.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:05:22 +02:00
jgrusewski
c94af7523e docs: Phase 2 hierarchical 4-branch DQN spec — direction(3) × magnitude(3) × order(3) × urgency(3)
Replaces broken 9-output exposure branch with two 3-output branches.
Each 3-output branch has -1/2 gradient (33%) — strong enough for dueling.
Eliminates i%3 Q-value degeneracy permanently.

3 novel gems: direction-specific dense reward, per-branch epsilon,
Flat detection shortcut with gradient zeroing.

~480 lines of dead code removed (aux optimizer, CEA, pre-training).
20+ files changed. Full CUDA, no CPU path, no stubs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 12:04:23 +02:00
jgrusewski
fdc8f30c8d docs: H100 graph-level optimization spec — 4 deferred fixes (~13s/epoch)
Fix 2: Eliminate validation graph re-capture (DtoD into same buffers)
Fix 3: Async validation on separate CUDA stream (overlap with experience)
Fix 4: Aux GEMM in graph_aux (GPU scalar + kernel sig change)
Fix 7: Mega-graph fusion (spectral+forward+aux → 2 launches)

Combined with 5 implemented fixes: 47s → ~16s/epoch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 08:48:36 +02:00
jgrusewski
f1e53797ca docs: H100 epoch optimization v2 spec — 47s → 19s (2.5x speedup)
9 optimizations: single-copy weight sync, graph update vs re-capture,
async validation, aux GEMM fusion, conditional frequency, target sync,
mega-graph, batch_size 16K, validation subsampling.

50 trials × 40 epochs: 26hr → 10.6hr ($45/run savings at $3/hr)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 01:49:01 +02:00
jgrusewski
1a93b71c69 feat(v8): wire 5 dead CUDA kernels + config fixes
Kernels now wired with Rust load + launch methods:
- popart_normalize_kernel: running mean/var + in-place normalization
- exposure_pretrain_step: supervised direction pre-training with backward GEMM
- td_lambda_kernel: exponentially-weighted lambda-returns
- compute_difficulty_scores: per-bar curriculum difficulty
- hindsight_relabel_kernel: optimal exit relabeling

Config fixes:
- batch_size hyperopt range: [64, 512] → [512, 8192] (H100 capacity)
- micro_reward_scale: 0.001 → 0.01 (10x stronger bootstrap)
- micro_reward hyperopt range: [0, 0.005] → [0, 0.05]

900 tests pass, 0 regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 01:26:09 +02:00
jgrusewski
327349c5e2 docs: reward v8 master plan — 18-item comprehensive training overhaul
5 categories, 18 items:
A) v7.1 fixes: aux GEMM, CEA warmup, OFI gate, dead code
B) Bootstrap trap: GPU cosine epsilon, n-step→5, dense micro-reward
C) Initialization: supervised pre-train, pessimistic Q-init, phase schedule
D) Advanced: TD(λ), PopArt normalization, curriculum learning, hindsight relabel
E) Dead code removal

4 new CUDA kernels, 3 modified, 12 new config fields, 4 removed.
Full GPU, no CPU path, no memory copies. Target: 50%+ win rate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:14:40 +02:00
jgrusewski
4ab7af5713 docs: reward v7.1 spec — 6 critical fixes for exposure degeneracy and training quality
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 22:21:11 +02:00
jgrusewski
d18b386be3 fix: promote entire backtest pipeline from bf16 to f32
CRITICAL CORRECTNESS FIX: bf16 has $32 resolution at $5K equity.
Transaction costs ($12.50), tick PnL ($12.50), and cumulative returns
were ALL below bf16 resolution — rounded to zero. Sharpe was quantized
to ~0.004 resolution. All previous hyperopt evaluations used garbage
metrics.

Changed to f32:
- backtest_env_kernel.cu: prices, portfolio_state, step_rewards,
  step_returns — both backtest_env_step and backtest_env_step_batch
- backtest_metrics_kernel.cu: all accumulators, shared memory,
  metrics_out, annualization_factor
- backtest_gather_kernel.cu: portfolio parameter (f32 → bf16 for
  model input at output stage only)
- gpu_backtest_evaluator.rs: all buffer types, upload paths,
  metrics download, shared memory byte calculations

Kept bf16: features_buf, states_buf (neural network input for
tensor cores), cuBLAS forward pass buffers.

Verified: Sharpe now has 6-digit precision (19.4745) vs bf16's
~0.004 resolution. All 345 tests + 3 smoke tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:58:11 +02:00
jgrusewski
5fb0089cd2 spec: f32 backtest pipeline — eliminate bf16 financial arithmetic
bf16 has $32 resolution at $5K equity. Transaction costs ($12.50),
tick PnL ($12.50), and cumulative returns are all below resolution.
All previous hyperopt evaluations used garbage metrics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:43:04 +02:00
jgrusewski
c5b4046169 spec: GPU-native validation + H100 performance optimizations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:48:07 +02:00
jgrusewski
d4269252c6 docs: H100 maximum performance spec and implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 11:15:24 +02:00
jgrusewski
42c8d85bba docs: spec for GPU regime + H100 training hang fix
Three issues in one spec:
1. H100 hang: cuBLAS set_stream() inside CUDA graph capture → deadlock
2. Bug: train_walk_forward calls non-stratified generate_folds()
3. GPU regime: classification kernel + prefix sum for O(1) range queries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:25:05 +02:00
jgrusewski
95e96aa976 docs: spec for Q-value explosion / NaN investigation
Documented all findings from the training step performance session:
- Shared memory race was real but not the NaN source (racecheck: 0 hazards)
- NaN is non-deterministic numerical instability, NOT a concurrency bug
- Suspected math bug in gradient budget allocation during MSE warmup
- Investigation plan: GPU NaN detection kernels, gradient audit, git bisect

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 23:00:16 +02:00
jgrusewski
ca7201a1ec docs: spec for training step performance + Q-value explosion investigation
Two remaining issues: (1) ~400ms/step instead of ~1-7ms on RTX 3050,
(2) Q-value explosion when C51 kicks in at epoch 2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 17:30:18 +02:00
jgrusewski
36d4c39f2d docs: spec + plan for C51 loss accumulator fix (separate MSE/C51 buffers)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:49:13 +02:00
jgrusewski
37d78e02c8 docs: spec for CUDA kernel safety fix (__restrict__ aliasing NaN bug)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:07:47 +02:00
jgrusewski
5b57a4b855 docs: spec for feature extraction pipeline fix (strict cache, symbol scoping)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:28:42 +02:00
jgrusewski
59ef927607 docs: spec for fixing 14 GPU test failures + OFI pipeline issue
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:57:49 +02:00
jgrusewski
0b185ddb54 docs: H100 GPU optimization spec — 9 optimizations for 2min→<10s epochs
CUDA events, multi-stream branches, graph-captured experience
collection, dynamic batch sizing, async readbacks, fxcache alignment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:36:40 +02:00
jgrusewski
a643652d0e docs: feature pre-compute pipeline design spec
Flat binary .fxcache format (f64 + bf16 versions), precompute_features
binary, Argo workflow integration, local validation plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:30:42 +02:00
jgrusewski
136696d8b8 docs: full BF16 rewrite spec + plan — zero F32 on GPU
Spec: every CUDA kernel, every GPU buffer, every cuBLAS call → BF16.
37 HOT kernels + 11 WARM + 7 COLD = 55 total kernel files.
12 implementation tasks across 4 phases.

Phase 1: Foundation (buffer types, weight sets)
Phase 2: cuBLAS GemmEx BF16×BF16→BF16 (forward + backward)
Phase 3: Optimizer + loss kernels (Adam, C51, MSE, spectral norm)
Phase 4: Environment + auxiliary (experience, backtest, IQN, attention)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 20:42:37 +01:00
jgrusewski
be8f3310d5 feat: gradient stability + 9-agent audit bug fixes
Per-component gradient clipping:
- 2 new CUDA kernels (dqn_clipped_saxpy, dqn_clip_grad)
- CQL gradient isolated into separate scratch buffer
- Budget allocation: C51=70%, CQL=15%, IQN=10%, Ens=5%
- Dynamic budget — inactive components' share goes to C51

Spectral norm extended to all 10 weight matrices:
- Was trunk-only (W_s1, W_s2), now covers all heads
- 16 u/v power iteration buffers, batched GOFF sync-back
- Uniform sigma_max, end-to-end Lipschitz bounded

Bug fixes from 9-agent audit:
- Backtest episode reset: all 8 fields (was 5), max_equity updated before floor check
- gradient_clip_norm unified: 10.0 everywhere (was 10.0 vs 1.0)
- entropy_coefficient: Option<f64> → f64, single default 0.001
- Close price: unwrap_or(1.0) → direct indexing (no silent wrong rewards)
- step_count: only increments during training (was incrementing on inference)
- Quantile loss: single CUDA context (was 3×), silent fallbacks removed
- MaybeNoisyLinear: single-variant enum removed → direct NoisyLinear
- Budget fractions: exported as pub(crate) constants, referenced not hardcoded

Monitoring:
- Per-component gradient Prometheus gauges (C51 raw, combined)
- Diagnostic logging every 1000 steps

Tests: 7 new gradient budget tests, 1 gradient bounds smoke test
All 488 tests pass (359 ml-dqn + 129 ml)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:52:44 +01:00
jgrusewski
6414f57e34 docs: eval cleanup spec + plan — remove dead 5-action path, fix train/eval mismatch
3 fixes: (1) Delete GpuActionSelector + branching_action_select (zero callers,
hardcoded 5 actions vs production 9), (2) Add hold enforcement to backtest
env_step kernel (same Layer 2 as training), (3) Dynamic trade insufficiency
threshold = max(window_bars / (min_hold * 20), 5).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:43:58 +01:00
jgrusewski
2197db8472 docs: trade lifecycle fix spec — address review feedback
- Layer 1 now targets experience_action_select (GPU-fused training path)
  AND branching_action_select (backtest/fallback), not just the fallback
- Action masking covers both greedy AND random exploration paths
- Exposure index uses parameterized b0_size, not hardcoded 5 or 9
- Fixed end-of-episode variable name (total_bars, not timesteps_per_episode)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:53:13 +01:00
jgrusewski
3bd339b5a3 fix: backtest evaluator — correct annualization, window sizing, objective calibration
Root cause: backtest windows of 300K bars produced ±billions% returns via
multiplicative compounding, and sqrt(252) annualization was wrong for
1-minute bars.

Fixes:
- Window size capped to 10K bars (~25 trading days), evenly distributed
  across the full validation set (was clustered in first 6%)
- Annualization: configurable bars_per_day field in GpuBacktestConfig
  (default 390.0 for 1-min), produces sqrt(98280) ≈ 313.5
- tanh normalization recalibrated: Sharpe/5, Sortino/8 (was /2, /3)
- CVaR threshold scaled to per-bar: 0.003 with slope 1400 (was 0.05/200)
- VaR/CVaR strided sampling covers full window (was first 4096 only)
- financials.rs + ab_testing.rs: sqrt(252) → sqrt(98280) for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 19:43:26 +01:00
jgrusewski
33d91cce5b spec: profitability roadmap — 11 findings from deep research
4 critical root causes fixed this session (stop-loss, dense shaping,
action aliasing, HFT objective weight). 7 remaining improvements
documented with priority order: three-phase hyperopt, behavioral
cloning warm start, curriculum learning, ensemble, multi-timeframe,
attention, Decision Transformer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:45:06 +01:00
jgrusewski
51037f60b8 spec: trading realism conformance — 7 real-market requirements
RTH/ETH cost differential, market impact (done), book depth fill quality,
macro events, weekend gap risk, margin utilization feature.
All configurable via TOML. We trade against real markets — simulation must match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:35:55 +01:00
jgrusewski
1277e8d10e spec: dual distributional C51+IQN — CVaR position sizing + uncertainty gating
C51 for action selection (expected Q), IQN for risk quantification (CVaR).
Disagreement between C51 and IQN expected Q = uncertainty signal.
Architecture already 90% built — IQN head exists but output unused.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:05:22 +01:00
jgrusewski
739dd986bb spec: 9-exposure action space design — expand from 5 to 9 levels
25% step increments: {-100%, -75%, -50%, -25%, 0%, +25%, +50%, +75%, +100%}
Total factored actions: 81 (was 45). Branching Q-values: 15 (was 11).
Implementation after reward v2 H100 validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:45:18 +01:00
jgrusewski
75885bccaf spec: address review — DSR formula, div-by-zero guards, stride constant
- DSR uses pre-update A/B values (Moody & Saffell correct)
- peak_equity/prev_equity init to initial_capital (not zero)
- Division-by-zero guards on drawdown and return calculation
- PORTFOLIO_STRIDE=12 constant replaces hardcoded 3 (7 locations listed)
- Remove use_dsr flag (w_dsr>0 implies enabled)
- RewardSection struct needed in training_profile.rs
- All TOML profiles use same [reward] section

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:30:35 +01:00
jgrusewski
530edd76b9 spec: no backward compat — composite reward is the only reward
Tests must match reality. All profiles use the full 8-component
composite reward. No legacy PnL-only fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:27:28 +01:00