From 878cc9ba724263aa0ac078e36d536384b699cdda Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Thu, 14 May 2026 15:47:01 +0200 Subject: [PATCH] =?UTF-8?q?feat(sp22-vnext):=20F-3c=20follow-up=20?= =?UTF-8?q?=E2=80=94=20K=3D3=20CE=20EMA=20in=20stdout=20HEALTH=5FDIAG=20au?= =?UTF-8?q?x=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The F-3c commit (cdd3dc6ed) pushed `aux_trade_outcome_ce_ema` into the regression-detection metrics vec but never wired a `tracing:: info!` console emit. Smoke `train-q5k5k` ran clean past the rollout + post-rollout phases — but `argo logs train-q5k5k | grep aux_trade_outcome` returned zero hits, so the operator had no way to read the K=3 head's CE EMA trajectory. Fix: extend the existing K=2 aux HEALTH_DIAG print HEALTH_DIAG[N]: aux [next_bar_mse=… regime_ce=… w=…] to include `trade_outcome_ce=…`: HEALTH_DIAG[N]: aux [next_bar_mse=… regime_ce=… trade_outcome_ce=… w=…] Reads ISV[538] via the same `trainer.read_isv_signal_at(...)` accessor the regression-detection vec uses — single source of truth, no duplicated mirroring. Expected operator-visible trajectory across smoke epochs: Epoch 0 (cold-start, Pearl A sentinel): 0.000 Epoch 1+ (first non-zero bootstrap): ~1.099 (= ln(3)) Healthy learning: 0.5 - 0.7 Pinned at ln(3) for many epochs: head can't learn cargo check -p ml clean. Audit doc updated. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../src/trainers/dqn/trainer/training_loop.rs | 20 ++++++++--- docs/dqn-wire-up-audit.md | 35 +++++++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/crates/ml/src/trainers/dqn/trainer/training_loop.rs b/crates/ml/src/trainers/dqn/trainer/training_loop.rs index 2d9c33429..87c0469e2 100644 --- a/crates/ml/src/trainers/dqn/trainer/training_loop.rs +++ b/crates/ml/src/trainers/dqn/trainer/training_loop.rs @@ -5994,20 +5994,32 @@ impl DQNTrainer { use crate::cuda_pipeline::gpu_dqn_trainer::{ AUX_NEXT_BAR_MSE_EMA_INDEX, AUX_REGIME_CE_EMA_INDEX, }; - let (aux_nb_mse, aux_rg_ce, aux_w) = + use crate::cuda_pipeline::sp22_isv_slots::AUX_TRADE_OUTCOME_CE_EMA_INDEX; + let (aux_nb_mse, aux_rg_ce, aux_to_ce, aux_w) = if let Some(ref fused) = self.fused_ctx { let trainer = fused.trainer(); ( trainer.read_isv_signal_at(AUX_NEXT_BAR_MSE_EMA_INDEX), trainer.read_isv_signal_at(AUX_REGIME_CE_EMA_INDEX), + // SP22 H6 vNext Phase F-3c follow-up (2026-05-14): + // K=3 trade-outcome head CE EMA in the existing aux + // print line. The F-3c commit pushed this metric to + // the regression-detection vec but never added it to + // a `tracing::info!` line, so smoke v3 (train-q5k5k) + // ran without operator-visible CE feedback. Cold- + // start = 0.000 (Pearl A sentinel); after first + // trade-close batch = ~ln(3) ≈ 1.099 (uniform + // K=3 prior); healthy learning trajectory drops + // toward 0.5-0.7 across epochs. + trainer.read_isv_signal_at(AUX_TRADE_OUTCOME_CE_EMA_INDEX), trainer.aux_weight(), ) } else { - (0.0, 0.0, 0.0) + (0.0, 0.0, 0.0, 0.0) }; tracing::info!( - "HEALTH_DIAG[{}]: aux [next_bar_mse={:.3e} regime_ce={:.3e} w={:.3}]", - epoch, aux_nb_mse, aux_rg_ce, aux_w, + "HEALTH_DIAG[{}]: aux [next_bar_mse={:.3e} regime_ce={:.3e} trade_outcome_ce={:.3e} w={:.3}]", + epoch, aux_nb_mse, aux_rg_ce, aux_to_ce, aux_w, ); } diff --git a/docs/dqn-wire-up-audit.md b/docs/dqn-wire-up-audit.md index 3aa46eb99..deee89351 100644 --- a/docs/dqn-wire-up-audit.md +++ b/docs/dqn-wire-up-audit.md @@ -2,6 +2,41 @@ **Status:** Populated during Plan 1 Task 6 (A.5 orphan audit). Updated on every commit per Invariant 7. +## 2026-05-14 — feat(sp22-vnext): F-3c follow-up — K=3 CE EMA in stdout HEALTH_DIAG line + +**Branch:** `sp20-aux-h-fixed`. **Trigger:** smoke `train-q5k5k` +ran clean past the rollout + post-rollout phases, but no +`aux_trade_outcome_ce` value visible in any tracing log because +the F-3c commit (`cdd3dc6ed`) only pushed the metric to the +regression-detection vec (`metric_bands.update_and_check`), never +added it to a `tracing::info!` console emit. + +The F-3c commit message claimed "Operator sees CE every epoch: +Cold-start: 0.000 / ~1.098 (= ln(3)) / ~0.5-0.7" — but `argo logs +train-q5k5k | grep aux_trade_outcome` returned zero hits because +the metric never reached stdout. + +**Fix:** extend the existing K=2 aux HEALTH_DIAG print +(`HEALTH_DIAG[N]: aux [next_bar_mse=… regime_ce=… w=…]`) to +include `trade_outcome_ce=…`: + +```rust +tracing::info!( + "HEALTH_DIAG[{}]: aux [next_bar_mse={:.3e} regime_ce={:.3e} \ + trade_outcome_ce={:.3e} w={:.3}]", + epoch, aux_nb_mse, aux_rg_ce, aux_to_ce, aux_w, +); +``` + +Reads ISV[538] via the same `trainer.read_isv_signal_at(...)` +accessor the regression-detection vec uses — single source of +truth. + +**Tests:** `cargo check -p ml --lib` clean. + +**Touched:** `crates/ml/src/trainers/dqn/trainer/training_loop.rs` +(single print-line edit + new import). + ## 2026-05-14 — fix(sp22-vnext): K=3 aux_outcome_labels CF-half buffer underrun **Branch:** `sp20-aux-h-fixed`. **Trigger:** workflow `train-xzv56`