Files
foxhunt/AGENT_36_INTEGRATION_CHECKLIST.txt
jgrusewski 8ce7c52586 fix(dqn): Update evaluation script feature dimension from 125 to 128
- Fixed feature dimension mismatch in evaluate_dqn_main_orchestrator.rs
- Updated all 5 occurrences: state_dim, input comments, feature vector type
- Aligned with Wave 16D training (128 features: 125 market + 3 portfolio)

Issue: Validation backtest reveals 100% HOLD action collapse - requires reward
system investigation and redesign per latest RL research.
2025-11-08 18:28:56 +01:00

90 lines
2.7 KiB
Plaintext

AGENT 36: WAVE 14-15 FIX INTEGRATION CHECKLIST
==============================================
MISSION: Wire ALL Wave 14-15 fixes into hyperopt pipeline
FILES TO MODIFY:
----------------
1. ml/examples/hyperopt_dqn_demo.rs
- Add 6 CLI flags:
* --enable-preprocessing (bool)
* --preprocess-window (usize, default 50)
* --preprocess-clip-sigma (f32, default 5.0)
* --enable-polyak (bool)
* --tau (f32, default 0.001)
* --feature-count (usize, default 225)
2. ml/src/hyperopt/adapters/dqn.rs
- Add fields to DQNTrainer struct
- Pass preprocessing config to InternalDQNTrainer
- Pass Polyak config to DQN model
- Wire feature_count through
3. ml/src/trainers/dqn.rs
- Call preprocessing::apply_stationarity() if enabled
- Pass tau to target_update::polyak_update() if enabled
- Use reward::apply_q_constraints() (Agent 27)
- Filter features if feature_count < 225
4. ml/src/dqn/dqn.rs (model)
- Accept tau parameter in constructor
- Use polyak_update() instead of hard copy if tau provided
VALIDATION TESTS:
-----------------
Run 3-trial campaign with ALL fixes enabled:
cargo run --release -p ml --example hyperopt_dqn_demo --features cuda -- \
--parquet-file test_data/ES_FUT_180d.parquet \
--trials 3 \
--epochs 5 \
--enable-preprocessing \
--preprocess-window 50 \
--preprocess-clip-sigma 5.0 \
--enable-polyak \
--tau 0.001 \
--feature-count 125 \
2>&1 | tee /tmp/agent36_validation.log
SUCCESS CRITERIA:
-----------------
✅ At least 1/3 trials complete (not pruned)
✅ Gradient norms < 200 (ideally < 100)
✅ Log shows "Applying preprocessing" messages
✅ Log shows "Using Polyak averaging (tau=0.001)"
✅ Log shows "125 dimensions" not 225
✅ At least 1 trial has Sharpe > 0.5
FAIL CONDITIONS:
----------------
❌ All 3 trials pruned (gradient explosion)
❌ Gradient norms still > 1000
❌ No preprocessing logs (not wired correctly)
❌ Still showing 225 dimensions
DEPENDENCIES:
-------------
Agent 27: ✅ Q-value constraints (ml/src/dqn/reward.rs)
Agent 28: ✅ Preprocessing (ml/src/preprocessing.rs)
Agent 29: ❌ Feature reduction (NOT IMPLEMENTED - need Agent 37)
Agent 30: ✅ Polyak averaging (ml/src/dqn/target_update.rs)
Agent 34: ✅ Backtesting (ml/src/evaluation/backtesting.rs)
NEXT AGENT:
-----------
Agent 37: Implement feature reduction (225→125)
- After Agent 36 completes wiring
- ETA: 4-6 hours
ESTIMATED TIME:
---------------
Integration: 8-12 hours
Validation: 30 minutes
Total: 8.5-12.5 hours
REFERENCE DOCS:
---------------
- AGENT_35_VALIDATION_CAMPAIGN.md (full report)
- WAVE15_CRITICAL_FAILURE_SUMMARY.txt (quick summary)
- Wave 14-15 agent reports (individual fix details)