- 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.
94 lines
2.5 KiB
Plaintext
94 lines
2.5 KiB
Plaintext
WAVE 5: DEBUG & VALIDATION - QUICK REFERENCE
|
|
=============================================
|
|
|
|
STATUS: ❌ INCOMPLETE - Wave 6 Required
|
|
DATE: 2025-11-08
|
|
|
|
TEST RESULTS
|
|
------------
|
|
Pass Rate: 163/174 (93.7%)
|
|
Baseline: 147/147 (100%) - Wave 16J
|
|
Regression: -6.3%
|
|
Failed Tests: 11
|
|
|
|
CRITICAL BUG
|
|
------------
|
|
Bug #1: SELL Trade P&L Calculation (CRITICAL)
|
|
File: ml/src/dqn/portfolio_tracker.rs:223-229
|
|
Issue: get_portfolio_value() uses wrong formula for shorts
|
|
Error: 9-10% underreporting of P&L on short positions
|
|
|
|
WRONG:
|
|
fn get_portfolio_value(&self, current_price: f32) -> f32 {
|
|
self.cash + (self.position_size * current_price)
|
|
}
|
|
|
|
CORRECT:
|
|
fn get_portfolio_value(&self, current_price: f32) -> f32 {
|
|
let unrealized_pnl = self.position_size * (current_price - self.position_entry_price);
|
|
self.cash + unrealized_pnl
|
|
}
|
|
|
|
Example:
|
|
- Sell 10 at 100 → cash=11,000, position=-10
|
|
- Price drops to 90 (favorable)
|
|
- Wrong: 11,000 + (-10*90) = 10,100 ❌
|
|
- Right: 11,000 + (-10)*(90-100) = 11,100 ✅
|
|
|
|
FAILED TESTS (11)
|
|
-----------------
|
|
Portfolio Tracker (2):
|
|
1. test_portfolio_tracker_pnl_calculation_long
|
|
2. test_portfolio_tracker_pnl_calculation_short
|
|
|
|
Portfolio Integration (9):
|
|
3. test_edge_case_large_positions
|
|
4. test_edge_case_negative_pnl
|
|
5. test_integration_full_trade_cycle
|
|
6. test_pnl_calculation_accuracy
|
|
7. test_pnl_reward_nonzero
|
|
8. test_portfolio_features_populated
|
|
9. test_portfolio_tracking_buy_action
|
|
10. test_portfolio_tracking_sell_action ⚠️ KEY
|
|
11. test_reward_function_receives_portfolio
|
|
|
|
CODE CHANGES
|
|
------------
|
|
Files: 8 modified (527 insertions, 129 deletions)
|
|
Key: ml/src/dqn/portfolio_tracker.rs (+213 lines)
|
|
Status: UNCOMMITTED (all changes in working directory)
|
|
|
|
WAVE 6 RECOMMENDATION
|
|
---------------------
|
|
Agents: 3 agents, 2-3 hours
|
|
Tasks:
|
|
A1: Fix Bug #1 (30 min)
|
|
A2: Standardize features (1 hour)
|
|
A3: Validate + commit (30 min)
|
|
|
|
Target: 174/174 tests (100%)
|
|
|
|
COORDINATION FAILURE
|
|
--------------------
|
|
Expected: 5 agents (A1-A5)
|
|
Actual: 1 agent (A3 - entropy task, blocked)
|
|
Issue: Task mismatch - A3 assigned entropy work, portfolio needed
|
|
Result: Portfolio work done outside wave, incomplete
|
|
|
|
PRODUCTION READINESS
|
|
--------------------
|
|
Compilation: ✅ YES
|
|
Tests: ❌ NO (93.7% vs 100% required)
|
|
Bugs: ❌ NO (Bug #1 unfixed)
|
|
Regression: ❌ YES (-6.3%)
|
|
Documentation: ❌ NO (uncommitted)
|
|
|
|
VERDICT: 0% READY - DO NOT DEPLOY
|
|
|
|
NEXT ACTION
|
|
-----------
|
|
SPAWN WAVE 6: Portfolio Bug Fix Campaign
|
|
|
|
===================================
|
|
END QUICK REF - See WAVE_5_DEBUG_VALIDATION_SUMMARY.md for details
|