Repository navigation
Conversation
…equity The forbidden variable was originally initialized as a boolean array `[False] * 52`, but later reassigned to a Python `set` in the hot loop. This broke subsequent item assignments (like `forbidden[v0] = False`). Fixed by applying index-based boolean updates instead of sets, resolving the runtime crash while preserving the O(1) optimization. Co-authored-by: wavehs <156133648+wavehs@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: The
forbiddenvariable tracking used cards in thecompute_range_vs_range_equityhot loop was accidentally being reassigned to asetviaforbidden = set(v_hand) | set(sampled_board), which broke index-based assignments expected later (TypeError: 'set' object does not support item assignment). The fix maintainsforbiddenas a boolean array using direct index assignments.🎯 Why: The previous code was failing runtime equity calculations, preventing the Monte Carlo ranges analysis from working properly. A pre-allocated boolean array avoids set allocations in the hot path.
📊 Impact: Resolves a runtime
TypeErrorcrash while keeping the O(1) membership check optimization inside the hot Monte Carlo loop.🔬 Measurement:
pytest tests/test_solver.pynow passes fortest_compute_range_vs_range_equity, confirming correct equity distributions are calculated instead of a crash.PR created automatically by Jules for task 16584192988146320489 started by @wavehs