From ce5df135034b5718a89e3ea2940a3bb0a30bc99c Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Mon, 25 May 2026 11:00:56 +0200 Subject: [PATCH] fix(rl): heat cap uses >= not > (pos=8 at cap=8 must trigger) With strict >, pos=8 passed the cap check, then a LongLarge(+2) made pos=10 before the next step's cap fired. Using >= prevents position from ever exceeding the cap by the fill size. Co-Authored-By: Claude Opus 4.7 --- crates/ml-alpha/cuda/rl_position_heat_check.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ml-alpha/cuda/rl_position_heat_check.cu b/crates/ml-alpha/cuda/rl_position_heat_check.cu index 58f4e35dc..aa029d4ea 100644 --- a/crates/ml-alpha/cuda/rl_position_heat_check.cu +++ b/crates/ml-alpha/cuda/rl_position_heat_check.cu @@ -52,10 +52,10 @@ extern "C" __global__ void rl_position_heat_check( if (b < b_size && cap > 0) { const int position_lots = *(const int*)(pos_state + b * pos_bytes); - if (position_lots > cap) { + if (position_lots >= cap) { actions[b] = ACTION_FLAT_FROM_LONG; s_flags[tid] = 1; - } else if (position_lots < -cap) { + } else if (position_lots <= -cap) { actions[b] = ACTION_FLAT_FROM_SHORT; s_flags[tid] = 1; }