Skip to content

Commit a2337b8

Browse files
committed
fix: use tiered boost for tested functions instead of overriding addressable-time ranking
Sort tested vs untested into two tiers while preserving the original addressable-time order within each tier.
1 parent bc6f2cb commit a2337b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codeflash/optimization/optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ def rank_all_functions_globally(
493493
if file_path:
494494
globally_ranked.append((file_path, func))
495495

496-
# Boost functions with existing unit tests — more tests ranks higher
496+
# Boost functions with existing unit tests above untested ones, preserving addressable-time order within each tier
497497
if function_to_tests:
498498
globally_ranked.sort(
499-
key=lambda x: -existing_unit_test_count(x[1], self.args.project_root, function_to_tests)
499+
key=lambda x: -(1 if existing_unit_test_count(x[1], self.args.project_root, function_to_tests) > 0 else 0)
500500
)
501501

502502
console.rule()

0 commit comments

Comments
 (0)