Skip to content

Commit 1c9abaf

Browse files
did it pass ?
1 parent 4e9f894 commit 1c9abaf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,14 +1823,14 @@ def run_optimized_candidate(
18231823
# if the test unmatched percentage is greater than 50%, we can't fix it
18241824
return self.get_results_not_matched_error()
18251825

1826+
print(f"should try to fix it, diffs: {diffs}")
18261827
# with the parsed test results diff ask the llm to fix the candidate to match the test results of the original code, and run again
18271828
# self.run_optimized_candidate(
18281829
# optimization_candidate_index=optimization_candidate_index,
18291830
# baseline_results=baseline_results,
18301831
# original_helper_code=original_helper_code,
18311832
# file_path_to_helper_classes=file_path_to_helper_classes,
18321833
# )
1833-
print(f"should try to fix it, diffs: {diffs}")
18341834
return self.get_results_not_matched_error()
18351835

18361836
logger.info(f"loading|Running performance tests for candidate {optimization_candidate_index}...")

codeflash/verification/equivalence.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
class TestDiffScope(Enum):
1919
RETURN_VALUE = "return_value"
2020
STDOUT = "stdout"
21-
TIMED_OUT = "timed_out"
2221
DID_PASS = "did_pass" # noqa: S105
22+
TIMED_OUT = "timed_out"
2323

2424

2525
@dataclass
@@ -28,6 +28,8 @@ class TestDiff:
2828
pytest_error: str
2929
original_value: any
3030
candidate_value: any
31+
original_pass: bool
32+
candidate_pass: bool
3133
test_src_code: Optional[str] = None
3234

3335

@@ -86,6 +88,8 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
8688
original_value=original_test_result.return_value,
8789
candidate_value=cdd_test_result.return_value,
8890
pytest_error=cdd_pytest_error,
91+
original_pass=original_test_result.did_pass,
92+
candidate_pass=cdd_test_result.did_pass,
8993
)
9094
)
9195

@@ -111,6 +115,8 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
111115
original_value=original_test_result.stdout,
112116
candidate_value=cdd_test_result.stdout,
113117
pytest_error=cdd_pytest_error,
118+
original_pass=original_test_result.did_pass,
119+
candidate_pass=cdd_test_result.did_pass,
114120
)
115121
)
116122
break
@@ -128,6 +134,8 @@ def compare_test_results(original_results: TestResults, candidate_results: TestR
128134
original_value=original_test_result.did_pass,
129135
candidate_value=cdd_test_result.did_pass,
130136
pytest_error=cdd_pytest_error,
137+
original_pass=original_test_result.did_pass,
138+
candidate_pass=cdd_test_result.did_pass,
131139
)
132140
)
133141
break

0 commit comments

Comments
 (0)