diff --git a/crates/ml/src/cuda_pipeline/experience_kernels.cu b/crates/ml/src/cuda_pipeline/experience_kernels.cu index e6fdc4d28..8365d05f9 100644 --- a/crates/ml/src/cuda_pipeline/experience_kernels.cu +++ b/crates/ml/src/cuda_pipeline/experience_kernels.cu @@ -1919,6 +1919,16 @@ extern "C" __global__ void experience_env_step( reward *= -1.0f; } + /* Plan conviction as reward scaling (always active, ISV-driven). + * The plan head receives ISV-gated h_s2 (temporal attention → feature gate → plan MLP). + * Its conviction output scales the reward → Q-value → C51 loss gradient path. + * No hardcoded constants — conviction IS the learned scaling factor. + * ISV modulates conviction indirectly through the attention-gated trunk. */ + if (plan_params_ptr != NULL && fabsf(reward) > 1e-8f) { + float conviction = plan_params_ptr[i * 6 + 4]; /* [0, 1] */ + reward *= conviction; /* low conviction → dampened signal, high → amplified */ + } + out_rewards[out_off] = reward; out_dones[out_off] = (float)done;