3939_compose_tmpdir = tempfile .mkdtemp (prefix = "verify-patch-" )
4040COMPOSE = Path (_compose_tmpdir ) / "compose.yaml"
4141COMPOSE .write_text (COMPOSE_CONTENT )
42- atexit .register (lambda : __import__ ("shutil" ).rmtree (_compose_tmpdir , ignore_errors = True ))
42+ atexit .register (
43+ lambda : __import__ ("shutil" ).rmtree (_compose_tmpdir , ignore_errors = True )
44+ )
4345
4446# Set to None to run all, or list specific benchmark names to filter.
4547# SELECTED_BENCHMARKS = None
@@ -84,13 +86,25 @@ def get_artifacts(proj: Path, harness: str, build_id: str) -> dict | None:
8486 """Fetch full artifacts dict via oss-crs artifacts."""
8587 try :
8688 result = subprocess .run (
87- ["uv" , "run" , "oss-crs" , "artifacts" ,
88- "--compose-file" , str (COMPOSE ),
89- "--fuzz-proj-path" , str (proj ),
90- "--target-harness" , harness ,
91- "--build-id" , build_id ,
92- "--run-id" , build_id ],
93- capture_output = True , text = True , timeout = 30 ,
89+ [
90+ "uv" ,
91+ "run" ,
92+ "oss-crs" ,
93+ "artifacts" ,
94+ "--compose-file" ,
95+ str (COMPOSE ),
96+ "--fuzz-proj-path" ,
97+ str (proj ),
98+ "--target-harness" ,
99+ harness ,
100+ "--build-id" ,
101+ build_id ,
102+ "--run-id" ,
103+ build_id ,
104+ ],
105+ capture_output = True ,
106+ text = True ,
107+ timeout = 30 ,
94108 cwd = str (PROJECT_ROOT ),
95109 )
96110 if result .returncode != 0 :
@@ -113,9 +127,16 @@ def get_timing_from_artifacts(artifacts: dict) -> dict | None:
113127
114128
115129def main ():
116- parser = argparse .ArgumentParser (description = "Run verify-patch against CRSBench benchmarks" )
117- parser .add_argument ("-n" , "--limit" , type = int , default = 0 ,
118- help = "Max benchmarks to run (0 = all, default: all)" )
130+ parser = argparse .ArgumentParser (
131+ description = "Run verify-patch against CRSBench benchmarks"
132+ )
133+ parser .add_argument (
134+ "-n" ,
135+ "--limit" ,
136+ type = int ,
137+ default = 0 ,
138+ help = "Max benchmarks to run (0 = all, default: all)" ,
139+ )
119140 args = parser .parse_args ()
120141
121142 if not BENCHMARKS_DIR .is_dir ():
@@ -124,9 +145,11 @@ def main():
124145
125146 targets = list (discover_targets (BENCHMARKS_DIR ))
126147 if SELECTED_BENCHMARKS is not None :
127- targets = [(p , h , d , pv ) for p , h , d , pv in targets if p .name in SELECTED_BENCHMARKS ]
148+ targets = [
149+ (p , h , d , pv ) for p , h , d , pv in targets if p .name in SELECTED_BENCHMARKS
150+ ]
128151 if args .limit > 0 :
129- targets = targets [:args .limit ]
152+ targets = targets [: args .limit ]
130153 print (f"Running { len (targets )} benchmarks\n " )
131154
132155 results = []
@@ -135,9 +158,9 @@ def main():
135158 for proj , harness , diff , pov_dir in targets :
136159 name = proj .name
137160 build_id = f"vp-{ name } "
138- print (f"{ '=' * 60 } " )
161+ print (f"{ '=' * 60 } " )
139162 print (f" { name } | { harness } " )
140- print (f"{ '=' * 60 } " )
163+ print (f"{ '=' * 60 } " )
141164
142165 rc = subprocess .run (
143166 [str (SCRIPT ), str (proj ), harness , str (diff ), str (pov_dir ), str (COMPOSE )],
@@ -156,7 +179,9 @@ def main():
156179 test_s = timing .get ("test" , 0 )
157180 print (f"\n Timing: rebuild={ rebuild_s :.1f} s test={ test_s :.1f} s" )
158181
159- crs_data = list (artifacts ["crs" ].values ())[0 ] if artifacts .get ("crs" ) else {}
182+ crs_data = (
183+ list (artifacts ["crs" ].values ())[0 ] if artifacts .get ("crs" ) else {}
184+ )
160185 log_paths = {}
161186 if crs_data .get ("log_dir" ):
162187 log_paths ["crs_log_dir" ] = crs_data ["log_dir" ]
@@ -175,28 +200,30 @@ def main():
175200 results .append ((name , harness , status ))
176201 print (f" -> { status } \n " )
177202
178- print (f"\n { '=' * 60 } " )
203+ print (f"\n { '=' * 60 } " )
179204 print (" SUMMARY" )
180- print (f"{ '=' * 60 } " )
205+ print (f"{ '=' * 60 } " )
181206 passed = sum (1 for _ , _ , s in results if s == "PASS" )
182207 for name , harness , status in results :
183208 t = all_timings .get (name )
184209 timing_str = ""
185210 if t :
186- timing_str = f" rebuild={ t .get ('rebuild' ,0 ):.1f} s test={ t .get ('test' ,0 ):.1f} s"
211+ timing_str = (
212+ f" rebuild={ t .get ('rebuild' , 0 ):.1f} s test={ t .get ('test' , 0 ):.1f} s"
213+ )
187214 print (f" { status } { name } ({ harness } ){ timing_str } " )
188215 print (f"\n { passed } /{ len (results )} passed" )
189216
190217 if all_timings :
191- print (f"\n { '=' * 60 } " )
218+ print (f"\n { '=' * 60 } " )
192219 print (" ALL TIMINGS (JSON)" )
193- print (f"{ '=' * 60 } " )
220+ print (f"{ '=' * 60 } " )
194221 print (json .dumps (all_timings , indent = 2 ))
195222
196223 if all_logs :
197- print (f"\n { '=' * 60 } " )
224+ print (f"\n { '=' * 60 } " )
198225 print (" LOG PATHS" )
199- print (f"{ '=' * 60 } " )
226+ print (f"{ '=' * 60 } " )
200227 for name , paths in all_logs .items ():
201228 print (f"\n { name } :" )
202229 for key , path in paths .items ():
0 commit comments