diff --git a/crates/ml-alpha/cuda/rl_confidence_gate.cu b/crates/ml-alpha/cuda/rl_confidence_gate.cu index bf40c024e..521c0c66d 100644 --- a/crates/ml-alpha/cuda/rl_confidence_gate.cu +++ b/crates/ml-alpha/cuda/rl_confidence_gate.cu @@ -89,9 +89,15 @@ extern "C" __global__ void rl_confidence_gate( } const float sigma = sqrtf(var + 1e-8f); - // Lower confidence bound. - const float lcb = mu - lambda * sigma; - const float conf = fmaxf(0.0f, fminf(lcb / (sigma_norm + 1e-8f), 1.0f)); + // Lower confidence bound, shifted relative to atom span so conf=0 + // means "worst possible" and conf=1 means "certain at V_MAX". + // Without the V_MIN shift, any distribution with σ > μ gives conf=0 + // (permanent block for near-uniform Q at training start). + const float v_min = atom_supports[0]; + const float v_max = atom_supports[Q_N_ATOMS - 1]; + const float span = v_max - v_min + 1e-8f; + const float lcb = (mu - v_min) - lambda * sigma; + const float conf = fmaxf(0.0f, fminf(lcb / span, 1.0f)); if (conf < threshold) { actions[b] = ACTION_HOLD;