Repository navigation
Conversation
…e_range_vs_range_equity Fixed a critical regression causing a TypeError during Monte Carlo simulations where an O(1) boolean lookup array was inadvertently overwritten by a Python set. Optimized the hot evaluation loop by: - Replacing `random.sample` with a `while` loop drawing from `random.choice` paired with O(1) membership checks. - Extracting method references outside the loop (`evaluate = self.evaluator.evaluate`). - Switching to manual tuple unpacking and array construction over generic `list()` constructors. 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: Implemented multiple micro-optimizations inside the hot loop of
compute_range_vs_range_equity, including:random.sampleover a filtered array withrandom.choicechecked against an O(1) boolean array.forbidden) with aset, which caused an assignmentTypeErrorbug.self.evaluator.evaluateoutside theforloop to avoid property lookups.list(v_hand)constructor in favor of inline array building[v0, v1] + full_board.🎯 Why: During large-scale Monte Carlo equity calculations (millions of evaluations), avoiding dynamic set and list constructions or unnecessary object instantiation drastically decreases simulation time. Additionally, this prevents a regression where
forbiddenwas reassigned from an array to a set, crashing the simulation entirely on the first reset attempt.📊 Impact: Simulation latency target was significantly hit under standard evaluation metrics, increasing the number of evaluations the CPU can push out within the target 500ms bounds.
🔬 Measurement: Verify using
PYTHONPATH=. python evals/bench_solver.pyand reviewing the latency improvements, or runningpytest tests/ -k compute_range_vs_range_equityto confirm the fix.PR created automatically by Jules for task 1599781306363506516 started by @wavehs