Clean abstracted rewrite of optimization candidate loop #660
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
wip
PR Type
Enhancement
Description
Refactor candidate loop for async profiling and refinement
Introduce
line_profiler_doneandrefinement_doneflagsAdd waiting logic for profiling and refinements
Update optimization log message for context
Diagram Walkthrough
flowchart LR A["Start processing candidates"] --> B["Process next candidate"] B --> C{"candidates empty?"} C -- "no" --> B C -- "yes & profiling not done" --> D["Wait for line profiler"] D --> E["Add profiling results"] E --> B C -- "profiling done & refinement not done" --> F["Wait for refinements"] F --> G["Add refinement results"] G --> B C -- "profiling & refinement done" --> H["Exit loop"]File Walkthrough
aiservice.py
Improve optimization log detailcodeflash/api/aiservice.py
function_optimizer.py
Refactor candidate processing loopcodeflash/optimization/function_optimizer.py
while Trueloopline_profiler_doneandrefinement_doneflags