-
Couldn't load subscription status.
- Fork 22
Prevent candidate loop from exiting early #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
In rare situations, line profiler and refinement APIs would not have returned and all original candidates would be processed and the loop would exit. This PR would solve this situation.
PR Type
Enhancement
Description
Ensure all candidates processed before exit
Append line profiler results when depleted
Append refinement candidates when done profiling
Simplify loop with processing flags
Diagram Walkthrough
flowchart LR Start["Initial Candidates"] --> Process["Process Candidates"] Process --> Check1{"Candidates Exhausted?"} Check1 -- "No" --> Process Check1 -- "Yes" --> LP["Add Line Profiler Results"] LP --> Process Check1 -- "Yes" after LP --> Refine["Add Refinement Results"] Refine --> Process Check1 -- "Yes" after Refine --> End["Exit Loop"]File Walkthrough
aiservice.py
Update line profiler loggingcodeflash/api/aiservice.py
function_optimizer.py
Refactor candidate processing loopcodeflash/optimization/function_optimizer.py
while Trueline_profiler_doneandrefinement_done