-
Your Name authored
When the house balance is deeply negative, extract_balanced_safe() correctly sets target_payout=0 but the lower_bound floor (base_weight × 0.05) still gave expensive outcomes a non-zero selection probability. A 4000 payin with 10% cap (max redistribution 400) could still select KO1 at 23840 payout (~2.8% chance), causing a 19840 house loss. Add a hard exclusion: when target_payout ≤ 0 and an outcome's payout exceeds expected_redistribution (the cap limit), force its weight to 0 if at least one affordable outcome exists. This makes the cap a binding constraint, not just a hint. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
ca964fe9