| 373 | |
| 374 | |
| 375 | def format_table(results: dict[str, int]) -> str: |
| 376 | baseline = results.get("baseline") |
| 377 | lines = [ |
| 378 | "| Config | SLIM row | Label | total_flash | Δ vs baseline | Δ vs previous |", |
| 379 | "|---|:---:|---|---:|---:|---:|", |
| 380 | ] |
| 381 | prev: int | None = None |
| 382 | for name, cfg in CONFIGS.items(): |
| 383 | if name not in results: |
| 384 | continue |
| 385 | total = results[name] |
| 386 | dvb = "" if baseline is None else f"{total - baseline:+,} B" |
| 387 | dvp = "" if prev is None else f"{total - prev:+,} B" |
| 388 | row = "—" if cfg.slim_row is None else f"{cfg.slim_row}" |
| 389 | lines.append( |
| 390 | f"| `{name}` | {row} | {cfg.label} | {total:,} B | {dvb} | {dvp} |" |
| 391 | ) |
| 392 | prev = total |
| 393 | return "\n".join(lines) + "\n" |
| 394 | |
| 395 | |
| 396 | def main() -> int: |