@@ -246,7 +246,9 @@ def outcome_keys(runs):
246246 """Preserve first-appearance order across runs, mirroring component ordering."""
247247 keys = []
248248 for run in runs :
249- for component , cdata in run ["component_summaries" ].get ("components" , {}).items ():
249+ for component , cdata in (
250+ run ["component_summaries" ].get ("components" , {}).items ()
251+ ):
250252 for table , tdata in cdata .get ("tables" , {}).items ():
251253 for outcome in tdata .get ("outcomes" , {}):
252254 key = (component , table , outcome )
@@ -258,7 +260,10 @@ def outcome_keys(runs):
258260def outcome_data (run , key ):
259261 component , table , outcome = key
260262 tables = (
261- run ["component_summaries" ].get ("components" , {}).get (component , {}).get ("tables" , {})
263+ run ["component_summaries" ]
264+ .get ("components" , {})
265+ .get (component , {})
266+ .get ("tables" , {})
262267 )
263268 return tables .get (table , {}).get ("outcomes" , {}).get (outcome )
264269
@@ -274,7 +279,9 @@ def outcome_categories(runs, key):
274279
275280
276281def outcome_totals (runs , key ):
277- return [sum ((outcome_data (run , key ) or {}).get ("counts" , {}).values ()) for run in runs ]
282+ return [
283+ sum ((outcome_data (run , key ) or {}).get ("counts" , {}).values ()) for run in runs
284+ ]
278285
279286
280287def outcome_table (runs , key , categories ):
@@ -319,7 +326,7 @@ def outcome_chart(runs, key, categories):
319326 width = share * 5.3
320327 rows .append (
321328 f'<rect x="310" y="{ y } " width="{ width :.2f} " height="12" fill="{ COLORS [i % len (COLORS )]} ">'
322- f' <title>{ escape (run [" spec" ][ " label" ])} : { count :,} ({ share :.1f} %)</title></rect>'
329+ f" <title>{ escape (run [' spec' ][ ' label' ])} : { count :,} ({ share :.1f} %)</title></rect>"
323330 )
324331 y += 17
325332 y += 10
@@ -358,15 +365,15 @@ def numeric_chart(runs, key):
358365 hi_x = 310 + (value ["max" ] - minimum ) * scale
359366 rows .append (
360367 f'<rect x="{ mean_x - 2 :.2f} " y="{ y } " width="4" height="12" fill="{ COLORS [i % len (COLORS )]} ">'
361- f' <title>{ escape (run [" spec" ][ " label" ])} : mean { value [" mean" ]:.3f} , '
362- f' range [{ value [" min" ]:.3f} , { value [" max" ]:.3f} ]</title></rect>'
368+ f" <title>{ escape (run [' spec' ][ ' label' ])} : mean { value [' mean' ]:.3f} , "
369+ f" range [{ value [' min' ]:.3f} , { value [' max' ]:.3f} ]</title></rect>"
363370 f'<path d="M { lo_x :.2f} { y + 6 } H { hi_x :.2f} " stroke="#222"/>'
364371 )
365372 y += 17
366373 return (
367374 f'<svg viewBox="0 0 900 { y + 20 } " role="img" aria-label="Outcome numeric range">'
368375 f'<text x="310" y="18">{ minimum :.2f} </text><text x="790" y="18">{ maximum :.2f} </text>'
369- f' { "" .join (rows )} </svg>'
376+ f" { '' .join (rows )} </svg>"
370377 )
371378
372379
@@ -382,7 +389,9 @@ def summary_table(runs, key):
382389 cells = []
383390 for run in runs :
384391 data = outcome_data (run , key )
385- cells .append (f"<td>{ data [stat ]:,} </td>" if data and stat in data else "<td>—</td>" )
392+ cells .append (
393+ f"<td>{ data [stat ]:,} </td>" if data and stat in data else "<td>—</td>"
394+ )
386395 rows .append (f"<tr><th>{ label } </th>{ '' .join (cells )} </tr>" )
387396 return f"<table><tr><th>Statistic</th>{ headers } </tr>{ '' .join (rows )} </table>"
388397
@@ -414,7 +423,9 @@ def outcomes_section(runs):
414423 else :
415424 body = summary_table (runs , key )
416425 style = "" if index == 0 else "display:none"
417- panels .append (f'<div class="outcome-panel" id="{ anchor } " style="{ style } ">{ body } </div>' )
426+ panels .append (
427+ f'<div class="outcome-panel" id="{ anchor } " style="{ style } ">{ body } </div>'
428+ )
418429 return (
419430 "<h2>Component outcomes</h2>"
420431 "<p>Model choice distributions recovered from ActivitySim checkpoints, merged across "
@@ -618,7 +629,8 @@ def report(directories, destination):
618629"""
619630 outcomes_html = outcomes_section (runs )
620631 # Outcome labels live only in escaped HTML attributes/text, never in JS.
621- outcomes_script = """
632+ outcomes_script = (
633+ """
622634<script>
623635const outcomeSelect = document.getElementById('outcome-select');
624636const outcomesSection = document.getElementById('outcomes-section');
@@ -638,7 +650,10 @@ def report(directories, destination):
638650 });
639651}
640652</script>
641- """ if outcomes_html else ""
653+ """
654+ if outcomes_html
655+ else ""
656+ )
642657 document = f"""<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>abench report</title>
643658<style>body{{font:15px system-ui;margin:2rem;color:#17212b}}.cards{{display:flex;gap:24px;overflow-x:auto}}article{{flex:1;min-width:420px;border:1px solid #ccc;padding:16px}}pre{{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}}svg{{width:100%;min-width:420px}}table{{border-collapse:collapse;width:100%}}th,td{{padding:10px;text-align:left;border-bottom:1px solid #ddd}}.fastest{{background:#d7f3dc}}small{{color:#58616a}}.runtime{{max-width:1200px}}.scroll{{overflow-x:auto}}.outcome-toggle button{{margin-left:4px;border:1px solid #ccc;background:#f4f6f8;padding:4px 10px;border-radius:4px;cursor:pointer}}.outcome-toggle button.active{{background:#0072b2;color:#fff;border-color:#0072b2}}.plot-view{{display:none}}#outcomes-section.plot-mode .table-view{{display:none}}#outcomes-section.plot-mode .plot-view{{display:block}}</style>
644659<h1>abench report</h1><p>Whole-container cgroup v2 memory counts shared pages once, including file cache, kernel memory and the supervisor. Swap is recorded separately in memory.csv. Cache preparation and post-run summaries are excluded. Peak is the kernel high-water mark sampled during the model lifetime, including container startup. Memory panels use identical axes.</p>
0 commit comments