Repository navigation
fix: raise ValueError instead of UnboundLocalError when no valid program found - #10219
Ricardo-M-L wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ram found get_program_with_highest_avg_score would fall through to a return that references undefined variables when sorted_results was empty. Now raises a clear ValueError with context.
Greptile SummaryThis change corrects MIPROv2 bookkeeping for selected few-shot demo sets and replaces an accidental local-variable failure with a clear error when no program remains eligible for selection. Direct behavior checks exercised different instruction and demo indexes and confirmed that the selected demo index is retained. They also exercised empty and fully evaluated program sets, which now raise Confidence Score: 5/5The changed optimizer and utility behavior performed as intended under direct execution and focused tests. A reproducible harness covered the formerly divergent instruction and demo indexes plus the empty and fully evaluated selection paths, and the focused utility suite completed successfully without a regression. Files Needing Attention: No files need follow-up attention.
What T-Rex did
Reviews (1): Last reviewed commit: "fix: raise ValueError instead of Unbound..." | Re-trigger Greptile |
|
Friendly ping - this PR is small and ready for a look whenever someone has bandwidth. Two independent one-line bugs, both currently reachable in MIPROv2:
Scope: 2 files, +2/-3, no API or signature changes. Both changes are strictly error-path or bookkeeping corrections - successful optimization runs behave identically. Happy to rebase if main has moved. |
This PR addresses: raise ValueError instead of UnboundLocalError when no valid program found