@@ -34,12 +34,16 @@ def existing_tests_source_for(
3434 test_cfg : TestConfig ,
3535 original_runtimes_all : dict [InvocationId , list [int ]],
3636 optimized_runtimes_all : dict [InvocationId , list [int ]],
37- ) -> str :
37+ ) -> list [ str ] :
3838 test_files = function_to_tests .get (function_qualified_name_with_modules_from_root )
3939 if not test_files :
4040 return ""
41- output : str = ""
42- rows = []
41+ output_existing : str = ""
42+ output_concolic : str = ""
43+ output_replay : str = ""
44+ rows_existing = []
45+ rows_concolic = []
46+ rows_replay = []
4347 headers = ["Test File::Test Function" , "Original ⏱️" , "Optimized ⏱️" , "Speedup" ]
4448 tests_root = test_cfg .tests_root
4549 original_tests_to_runtimes : dict [Path , dict [str , int ]] = {}
@@ -99,28 +103,74 @@ def existing_tests_source_for(
99103 * 100
100104 )
101105 if greater :
102- rows .append (
103- [
104- f"`{ print_filename } ::{ qualified_name } `" ,
105- f"{ print_original_runtime } " ,
106- f"{ print_optimized_runtime } " ,
107- f"⚠️{ perf_gain } %" ,
108- ]
106+ if '__replay_test_' in print_filename :
107+ rows_replay .append (
108+ [
109+ f"`{ print_filename } ::{ qualified_name } `" ,
110+ f"{ print_original_runtime } " ,
111+ f"{ print_optimized_runtime } " ,
112+ f"⚠️{ perf_gain } %" ,
113+ ]
114+ )
115+ elif 'codeflash_concolic' in print_filename :
116+ rows_concolic .append (
117+ [
118+ f"`{ print_filename } ::{ qualified_name } `" ,
119+ f"{ print_original_runtime } " ,
120+ f"{ print_optimized_runtime } " ,
121+ f"⚠️{ perf_gain } %" ,
122+ ]
109123 )
110- else :
111- rows .append (
112- [
113- f"`{ print_filename } ::{ qualified_name } `" ,
114- f"{ print_original_runtime } " ,
115- f"{ print_optimized_runtime } " ,
116- f"✅ { perf_gain } %" ,
117- ]
124+ else :
125+ rows_existing .append (
126+ [
127+ f"`{ print_filename } ::{ qualified_name } `" ,
128+ f"{ print_original_runtime } " ,
129+ f"{ print_optimized_runtime } " ,
130+ f"⚠️ { perf_gain } %" ,
131+ ]
118132 )
119- output += tabulate ( # type: ignore[no-untyped-call]
120- headers = headers , tabular_data = rows , tablefmt = "pipe" , colglobalalign = None , preserve_whitespace = True
133+ else :
134+ if '__replay_test_' in print_filename :
135+ rows_replay .append (
136+ [
137+ f"`{ print_filename } ::{ qualified_name } `" ,
138+ f"{ print_original_runtime } " ,
139+ f"{ print_optimized_runtime } " ,
140+ f"✅{ perf_gain } %" ,
141+ ]
142+ )
143+ elif 'codeflash_concolic' in print_filename :
144+ rows_concolic .append (
145+ [
146+ f"`{ print_filename } ::{ qualified_name } `" ,
147+ f"{ print_original_runtime } " ,
148+ f"{ print_optimized_runtime } " ,
149+ f"✅{ perf_gain } %" ,
150+ ]
151+ )
152+ else :
153+ rows_existing .append (
154+ [
155+ f"`{ print_filename } ::{ qualified_name } `" ,
156+ f"{ print_original_runtime } " ,
157+ f"{ print_optimized_runtime } " ,
158+ f"✅{ perf_gain } %" ,
159+ ]
160+ )
161+ output_existing += tabulate ( # type: ignore[no-untyped-call]
162+ headers = headers , tabular_data = rows_existing , tablefmt = "pipe" , colglobalalign = None , preserve_whitespace = True
163+ )
164+ output_existing += "\n "
165+ output_concolic += tabulate ( # type: ignore[no-untyped-call]
166+ headers = headers , tabular_data = rows_concolic , tablefmt = "pipe" , colglobalalign = None , preserve_whitespace = True
167+ )
168+ output_concolic += "\n "
169+ output_replay += tabulate ( # type: ignore[no-untyped-call]
170+ headers = headers , tabular_data = rows_replay , tablefmt = "pipe" , colglobalalign = None , preserve_whitespace = True
121171 )
122- output += "\n "
123- return output
172+ output_replay += "\n "
173+ return output_existing , output_replay , output_concolic
124174
125175
126176def check_create_pr (
@@ -131,6 +181,8 @@ def check_create_pr(
131181 generated_original_test_source : str ,
132182 function_trace_id : str ,
133183 coverage_message : str ,
184+ replay_tests : str ,
185+ concolic_tests : str ,
134186 git_remote : Optional [str ] = None ,
135187) -> None :
136188 pr_number : Optional [int ] = env_utils .get_pr_number ()
@@ -171,6 +223,8 @@ def check_create_pr(
171223 generated_tests = generated_original_test_source ,
172224 trace_id = function_trace_id ,
173225 coverage_message = coverage_message ,
226+ replay_tests = replay_tests ,
227+ concolic_tests = concolic_tests ,
174228 )
175229 if response .ok :
176230 logger .info (f"Suggestions were successfully made to PR #{ pr_number } " )
0 commit comments