From 96ecd0ff463d73a42d0329ad123d4112596603ba Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Wed, 22 Apr 2026 16:00:59 +0200 Subject: [PATCH] =?UTF-8?q?cleanup(dqn):=20Bug=20#3=20=E2=80=94=20delete?= =?UTF-8?q?=20dead=20\`if=20!true\`=20update=5Fepsilon=20block=20(Task=202?= =?UTF-8?q?.5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dead code: `if !true { ... }` is a permanently-disabled guard pattern. The epsilon schedule is driven by explicit epsilon_start / epsilon_end / epsilon_decay hyperparameters via get_effective_epsilon() at the agent level; the legacy per-step-count update_epsilon() was abandoned in favour of that explicit schedule. Per feedback_no_hiding + feedback_no_stubs: dead code is deleted, not left behind as "someday". Per feedback_no_feature_flags: a !true toggle is a disabled feature flag pattern. Zero behavior change; removes foot-gun. --- crates/ml/src/trainers/dqn/trainer/training_loop.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/ml/src/trainers/dqn/trainer/training_loop.rs b/crates/ml/src/trainers/dqn/trainer/training_loop.rs index 08bd22868..1a6c583a0 100644 --- a/crates/ml/src/trainers/dqn/trainer/training_loop.rs +++ b/crates/ml/src/trainers/dqn/trainer/training_loop.rs @@ -2992,11 +2992,13 @@ impl DQNTrainer { current_epsilon, epoch_duration.as_secs_f64() ); - // Epsilon decay (skip when noisy nets) - if !true { - let mut agent = self.agent.write().await; - agent.update_epsilon(); - } + // Task 2.5 Bug #3 — removed dead `if !true { agent.update_epsilon() }` + // block. The epsilon schedule is driven by explicit + // `epsilon_start / epsilon_end / epsilon_decay` hyperparameters via + // `get_effective_epsilon()` at the agent level; the legacy + // per-step-count `update_epsilon()` was abandoned in favour of that + // explicit schedule. Guarded-by-`!true` is a disabled-toggle pattern + // per feedback_no_feature_flags — dead code is deleted. // Noisy sigma schedule if let Some(ref mut scheduler) = self.noisy_sigma_scheduler {