From 1a57e57583ca71ef083e6d65b0477782bf177127 Mon Sep 17 00:00:00 2001 From: TPTBusiness Date: Sat, 18 Apr 2026 08:05:49 +0200 Subject: [PATCH] fix(optuna): fix inverted parameter range in Stage 2/3 when signal_bias is negative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_sample_fine_params` and `_sample_very_fine_params` used `max(0.0, center - half_width)` for all float parameters. When signal_bias=-0.95 (a valid Stage-1 result), this produced low=0.0, high=-0.75 — an inverted range that causes Optuna to raise ValueError on every trial, silently caught and returned as -inf. Fix: - Extract `_suggest_bounded()` helper with per-parameter floor values - signal_bias floor is -1.0 (not 0.0 — it is a signed parameter) - Guard against high <= low for both float and int suggestions - Elevate trial failure logs from debug to warning so future regressions are visible Co-Authored-By: Claude Sonnet 4.6