"""Figures for 'Where the Frame Goes on the Board' (paper analysis, 2026-10-16). Reads frame_board_paper_20261016/numbers/paper_numbers.json (paper_numbers.py) and the primary CSVs it names; writes vector PDFs to where_the_frame_goes_board_20261016/figures/. Palette: categorical slots 1-3 of the reference palette (validated all-pairs, light), muted gray for context; every series is identified by a legend or a direct label, never by colour alone. """ import csv, json, collections, statistics as st from pathlib import Path import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np AF = Path(__file__).resolve().parents[2] NUM = AF / 'frame_board_paper_20261016/numbers' OUT = AF / 'where_the_frame_goes_board_20261016/figures' FU = AF / 'cps3_frame_followup_20261015' CEN = AF / 'slowdown_census_20261015' BLUE, ORANGE, AQUA, GRAY = '#2a78d6', '#eb6834', '#1baf7a', '#898781' INK, INK2, GRID, AXIS = '#0b0b0b', '#52514e', '#e1e0d9', '#c3c2b7' plt.rcParams.update({ 'font.family': 'DejaVu Sans', 'font.size': 8, 'axes.titlesize': 8.5, 'axes.labelsize': 8, 'axes.edgecolor': AXIS, 'axes.linewidth': 0.8, 'axes.labelcolor': INK2, 'xtick.color': INK2, 'ytick.color': INK2, 'xtick.labelsize': 7.5, 'ytick.labelsize': 7.5, 'axes.grid': True, 'grid.color': GRID, 'grid.linewidth': 0.6, 'grid.linestyle': '-', 'axes.axisbelow': True, 'legend.frameon': False, 'legend.fontsize': 7.5, 'axes.spines.top': False, 'axes.spines.right': False, 'lines.linewidth': 1.6, 'lines.solid_capstyle': 'round', 'pdf.fonttype': 42, 'figure.dpi': 150, 'savefig.bbox': 'tight', 'savefig.pad_inches': 0.03}) N = json.loads((NUM / 'paper_numbers.json').read_text()) def save(fig, name): fig.savefig(OUT / f'{name}.pdf') fig.savefig(OUT / f'{name}.png', dpi=160) plt.close(fig) def fig_timeline(): fb = N['frame_budget_p1'] att = N['attract_b26'] vend, snd = fb['vblend']['median'], fb['snd']['median'] ps, pe, per = fb['passstart']['median'], fb['passend']['median'], fb['period']['median'] mvend, mps, mpe = vend + att['vblend']['median'], ps + att['passstart']['median'], pe + att['passend']['median'] lp = N['legacy_schedule_pass']['pass_duration']['median'] slice_t = 104166 / 8 rows = [ ('CPS3 board, P1 attract (medians)', [(0, vend - snd, 'h'), (vend - snd, snd, 's'), (vend, ps - vend, 'g'), (ps, pe - ps, 'p'), (pe, per - pe, 'i')]), ('Board model 0x20261017, same frames', [(0, mvend - snd, 'h'), (mvend - snd, snd, 's'), (mvend, mps - mvend, 'g'), (mps, mpe - mps, 'p'), (mpe, per - mpe, 'i')]), ('Fightcade schedule, 3-slice window', [(0, 3027 - 1766, 'h'), (3027 - 1766, 1766, 's'), (3027, slice_t - 3027, 'z'), (slice_t, lp, 'p'), (slice_t + lp, 4 * slice_t - slice_t - lp, 'z')]), ('Fightcade schedule, 1-slice window', [(0, 3027 - 1766, 'h'), (3027 - 1766, 1766, 's'), (3027, 3 * slice_t - 3027, 'z'), (3 * slice_t, lp, 'p'), (3 * slice_t + lp, slice_t - lp, 'z')]), ] style = dict(h=(GRAY, 'VBlank handler (kick, video, inputs, re-arm)'), s=(AQUA, 'sound driver'), g=('#c3c2b7', 'epilogue, IRQ10, scheduler'), p=(BLUE, 'game pass (tasks 2-4)'), i=('#e9e8e3', 'idle: scheduler spins'), z=('#f6dccf', 'CPU suspended by the idle shortcut')) fig, ax = plt.subplots(figsize=(6.6, 2.35)) seen = set() for y, (label, segs) in enumerate(rows): for x0, w, k in segs: c, lab = style[k] ax.barh(len(rows) - 1 - y, w, left=x0, height=0.55, color=c, edgecolor='white', linewidth=1.0, label=lab if k not in seen else None) seen.add(k) ax.text(-600, len(rows) - 1 - y, label, ha='right', va='center', fontsize=7.5, color=INK) ax.set_yticks([]) ax.set_xlim(0, 52433) ax.set_xlabel('FRT ticks after the VBlank timer reset (1 tick = 8 CPU clocks; frame = 52,433 ticks)') ax.grid(axis='y', visible=False) ax.spines['left'].set_visible(False) ax.legend(loc='upper center', bbox_to_anchor=(0.36, -0.32), ncol=3, handlelength=1.2, columnspacing=1.0) save(fig, 'frame_timeline') def fig_cost_ratio(): rows = N['p1_loops']['rows'] cat = {} for r in rows: n = r['name'] cat[r['id']] = ('CPU core, cached' if n in ('empty', 'alu8', 'ramrd_l', 'mul_l', 'muls_w', 'dmuls_l', 'div1', 'bra4', 'bt_nt', 'jsr4', 'pool8', 'stk_rd', 'fetch1k') else 'work RAM, flash, BIOS' if n in ('thr_rd_l', 'thr_rd_w', 'thr_rd_b', 'ramwr_l', 'ramwr_w', 'ramwr_b', 'ramfill', 'romfill', 'thr_rom_l', 'fetch8k', 'copy', 'thr_wr_l', 'pushpop', 'bios_thr_l', 'biosfill') else 'video and I/O' if n not in ('frc_rd', 'ftcsr_rd') else 'on-chip timer') order = ['CPU core, cached', 'work RAM, flash, BIOS', 'video and I/O', 'on-chip timer'] fig, ax = plt.subplots(figsize=(6.6, 5.6)) y, ticks, labels = 0, [], [] for c in order: group = sorted([r for r in rows if cat[r['id']] == c], key=lambda r: r['board_over_legacy']) for r in group: ax.barh(y, r['board_over_legacy'], height=0.62, color=BLUE if c != 'CPU core, cached' else GRAY, left=0) ax.text(r['board_over_legacy'] * 1.06, y, f"{r['board_over_legacy']:.1f}x", va='center', fontsize=6.5, color=INK2) ticks.append(y) labels.append(f"{r['id']} {r['name']}") y += 1 ax.text(60, y - len(group) / 2 - 0.5, c, ha='right', va='center', fontsize=7.5, color=INK, style='italic') y += 0.8 ax.set_xscale('log') ax.set_xlim(0.8, 70) ax.set_xticks([1, 2, 5, 10, 20, 50]) ax.set_xticklabels(['1', '2', '5', '10', '20', '50']) ax.minorticks_off() ax.axvline(1, color=INK2, linewidth=0.8) ax.set_yticks(ticks) ax.set_yticklabels(labels, fontsize=6.5) ax.invert_yaxis() ax.set_xlabel('board time / instruction-table time (FBNeo and MAME cost model), log scale') ax.grid(axis='y', visible=False) save(fig, 'cost_ratio') def lab(): return {int(r['id']): r for r in csv.DictReader(open(FU / 'data/p2/lab_cpu.csv'))} def warm(r): return st.median([int(r[f's{i}_warm']) for i in (1, 3, 5, 7)]) def fig_cache(): L = lab() byname = {r['name']: r for r in L.values()} fig, axs = plt.subplots(1, 2, figsize=(6.6, 2.5), gridspec_kw=dict(width_ratios=[1.25, 1])) ax = axs[0] d = np.arange(1, 7) for m, col, lab_ in ((1, BLUE, 'four-way (CCR 01)'), (9, ORANGE, 'two-way (CCR 09)'), (0, GRAY, 'cache off (CCR 00)')): same = [warm(byname[f'cache_m{m}_s1024_d{i}']) for i in d] spread = [warm(byname[f'cache_m{m}_s16_d{i}']) for i in d] ax.plot(d, same, color=col, marker='o', markersize=4.5, markeredgecolor='white', markeredgewidth=1, label=lab_ + ', same set') ax.set_xticks(d) if m: ax.plot(d, spread, color=col, marker='o', markersize=4.5, markerfacecolor='white', markeredgecolor=col, linewidth=0.9, alpha=0.9, label=lab_ + ', spread sets') ax.set_xlabel('distinct lines loaded per iteration, d') ax.set_ylabel('warm ticks, 256 iterations') ax.legend(fontsize=6.3, loc='upper left', handlelength=2.4) ax.set_title('Same-set thrash cliffs at d = ways + 1', loc='left', color=INK) ax = axs[1] for m, col, lab_ in ((1, BLUE, 'four-way'), (9, ORANGE, 'two-way')): extra = [8 * (warm(byname[f'cache_m{m}_s1024_d{i}']) - warm(byname[f'cache_m{m}_s16_d{i}'])) / (256 * i) for i in d] ax.plot(d, extra, color=col, marker='o', markersize=4.5, markeredgecolor='white', markeredgewidth=1, label=lab_) ax.axhline(36, color=INK2, linewidth=0.8) ax.text(1.05, 37.5, 'P1 RAM line refill, 36 clocks', fontsize=6.5, color=INK2) ax.set_ylim(-3, 45) ax.set_xlabel('d') ax.set_ylabel('extra CPU clocks per load') ax.legend(loc='center left', fontsize=6.5) ax.set_title('Conflict cost per load', loc='left', color=INK) fig.tight_layout(w_pad=1.5) save(fig, 'cache') def fig_pipeline(): L = lab() byname = {r['name']: r for r in L.values()} fig, axs = plt.subplots(1, 3, figsize=(6.8, 2.35)) ax = axs[0] gaps = [0, 2, 8] for w, col, lab_ in (('w', ORANGE, 'word'), ('b', AQUA, 'byte (= word)'), ('l', BLUE, 'long')): sl = [(warm(byname[f'write_{w}_n256_g{g}']) - warm(byname[f'write_{w}_n64_g{g}'])) / 192 for g in gaps] if w == 'b': ax.plot(gaps, sl, color=col, marker='o', markersize=7, markerfacecolor='none', markeredgecolor=col, markeredgewidth=1.2, linewidth=0, label=lab_) else: ax.plot(gaps, sl, color=col, marker='o', markersize=4.5, markeredgecolor='white', markeredgewidth=1, label=lab_) ax.plot(gaps, [sl[0] + g for g in gaps], color=col, linewidth=0.8, alpha=0.45) ax.text(3.2, 5.0, 'thin lines: serial sum\n(store + one per ADD)', fontsize=6, color=INK2) ax.set_xticks(gaps) ax.set_xlabel('independent ADDs between stores') ax.set_ylabel('CPU clocks per store group') ax.set_title('Stores hide work', loc='left', color=INK) ax.legend(loc='upper left', fontsize=6.5) ax = axs[1] for src, col, lab_ in (('other', AQUA, 'other RAM word'), ('same', BLUE, 'same RAM word'), ('flash', ORANGE, 'flash')): v = [warm(byname[f'wr_rd_{src}_g{g}']) for g in gaps] if src == 'same': ax.plot(gaps, v, color=col, marker='o', markersize=7, markerfacecolor='none', markeredgecolor=col, markeredgewidth=1.2, linewidth=0, label=lab_) else: ax.plot(gaps, v, color=col, marker='o', markersize=4.5, markeredgecolor='white', markeredgewidth=1, label=lab_) ax.plot(gaps, [1475.5 + 512 * g / 8 for g in gaps], color=INK2, linewidth=0.8) ax.text(3.2, 1820, 'serial sum', fontsize=6, color=INK2) ax.set_xticks(gaps) ax.set_xlabel('ADDs between write and read') ax.set_ylabel('warm ticks, 512 pairs') ax.set_title('Write-then-read is flat', loc='left', color=INK) ax.legend(loc='center right', fontsize=6.3) ax = axs[2] g = [0, 1, 3] for op, col, lab_ in (('mul_l', BLUE, 'MUL.L'), ('muls_w', ORANGE, 'MULS.W')): c0 = [warm(byname[f'mul_{op}_g{x}_c0']) for x in g] c1 = [warm(byname[f'mul_{op}_g{x}_c1']) for x in g] ax.plot(g, c0, color=col, marker='o', markersize=4.5, markerfacecolor='white', markeredgecolor=col, linewidth=0.9) ax.plot(g, c1, color=col, marker='o', markersize=4.5, markeredgecolor='white', markeredgewidth=1) ax.text(3.15, c0[-1], lab_ + ', unused', va='center', fontsize=6, color=INK2) ax.text(3.15, c1[-1], lab_ + ', MACL used', va='center', fontsize=6, color=INK2) ax.set_xticks(g) ax.set_xlim(-0.2, 5.2) ax.set_ylim(400, 2700) ax.set_xlabel('independent ADDs after each multiply') ax.set_ylabel('warm ticks, 2,048 multiplies') ax.set_title('Issue is not result', loc='left', color=INK) fig.tight_layout(w_pad=1.0) save(fig, 'pipeline') def fig_irq(): B = N['irq_bands'] fig, axs = plt.subplots(1, 3, figsize=(6.7, 2.2), gridspec_kw=dict(width_ratios=[1, 1, 1])) ax = axs[0] x, n = zip(*B['p1']) ax.bar(x, n, width=0.9, color=GRAY) ax.set_xlim(140, 245) ax.set_title('P1 board, 483 records', loc='left', color=INK) ax.set_ylabel('records') ax = axs[1] for key, col, lab_ in (('p2_nonstale', BLUE, 'stale marker clear'), ('p2_stale', ORANGE, 'stale marker set')): x, n = zip(*B[key]) ax.bar(x, n, width=0.9, color=col, label=f'{lab_} ({sum(n)})') ax.set_xlim(140, 245) ax.set_title('P2 board, by marker', loc='left', color=INK) ax.set_xlabel('IRQ10 service stamp minus VBlank-end stamp, ticks') ax.legend(fontsize=6.2, loc='upper center') ax = axs[2] x, n = zip(*B['b26']) ax.bar(x, n, width=0.9, color=BLUE) ax.set_xlim(116, 221) ax.set_title('Board model, P1 window', loc='left', color=INK) fig.tight_layout(w_pad=0.8) save(fig, 'irq_bands') def fig_stale(): rows = [r for r in csv.DictReader(open(AF / 'board_probe_20261011/board_return_20261013_131322/analysis/reviewed_records.csv')) if r['status'] not in ('unresolved', 'not_filmed')] R = {int(r['idx']): r for r in rows} def band(r): if r['irqn'] != '1' or r['irqfirst'] == '65535': return None g = int(r['irqfirst']) - int(r['vblend']) return 0 if 140 <= g <= 175 else 1 if 210 <= g <= 240 else None pairs = [(int(R[k]['period']), band(R[k + 1])) for k in R if k + 1 in R and band(R[k + 1]) is not None and k != 60] bins = np.arange(51880, 52072, 8) st_ = np.histogram([p for p, b in pairs if b == 1], bins)[0] ns = np.histogram([p for p, b in pairs if b == 0], bins)[0] allp = np.histogram([int(r['period']) for r in R.values()], bins)[0] fig, ax = plt.subplots(figsize=(6.6, 2.3)) c = (bins[:-1] + bins[1:]) / 2 ax.bar(c, ns, width=7.2, color=GRAY, label='next record: IRQ10 in the low band') ax.bar(c, st_, width=7.2, bottom=ns, color=ORANGE, label='next record: IRQ10 in the high (stale) band') ax.axvspan(51981, 52021, color=ORANGE, alpha=0.08, linewidth=0) ax.text(52001, max(ns + st_) * 1.02, 'stale band 51,981-52,021', ha='center', fontsize=6.5, color=INK2) ax.set_xlabel('PER(k): ticks from the timer reset to VBlank entry k (P1 board)') ax.set_ylabel('records') ax.legend(fontsize=6.5, loc='upper left') save(fig, 'stale_band') def fig_attract(): rows = list(csv.DictReader(open(NUM / 'attract_pairs_b26.csv'))) f = [int(r['frame']) for r in rows if r['board_passend'] != '65535' and r['emu_passend'] != '65535'] b = [int(r['board_passend']) for r in rows if r['board_passend'] != '65535' and r['emu_passend'] != '65535'] e = [int(r['emu_passend']) for r in rows if r['board_passend'] != '65535' and r['emu_passend'] != '65535'] fig, axs = plt.subplots(1, 2, figsize=(6.6, 2.4), gridspec_kw=dict(width_ratios=[2.2, 1])) ax = axs[0] ax.plot(f, b, color=GRAY, linewidth=1.0, label='board (P1, accepted rows)') ax.plot(f, e, color=BLUE, linewidth=0.9, label='board model 0x20261017') ax.annotate('slot 3 still running at VBlank\n(frame 4678, both)', xy=(4678, 9054), xytext=(4760, 14000), fontsize=6.3, color=INK2, arrowprops=dict(arrowstyle='-', color=INK2, linewidth=0.6)) ax.set_xlabel('game frame (attract demo, Ibuki v Chun-Li)') ax.set_ylabel('last pass return, ticks after reset') ax.set_ylim(0, 52433) ax.axhline(52000, color=INK2, linewidth=0.7) ax.text(5320, 50200, 'VBlank', fontsize=6.3, color=INK2, ha='right') ax.legend(fontsize=6.5, loc='lower right') ax = axs[1] d = [x - y for x, y in zip(e, b) if abs(x - y) < 3000] ax.hist(d, bins=np.arange(-1400, 200, 50), color=BLUE) ax.axvline(0, color=INK2, linewidth=0.8) ax.set_xlabel('model - board, ticks') ax.set_ylabel('frames') ax.set_title(f"median {int(N['attract_b26']['passend']['median'])} ticks ({100 * N['attract_b26']['passend_relative_median']:.1f} %)", loc='left', color=INK) fig.tight_layout(w_pad=1.2) save(fig, 'attract') def fig_counters(): C = N['counters'] s3 = C['model_overruns'] near = [f for f, m in C['near_misses_under_2000'] if m < 1000] x = np.arange(0, 8000) cm = np.searchsorted(np.array(s3), x, side='right') cn = cm + np.searchsorted(np.array(sorted(near)), x, side='right') fig, ax = plt.subplots(figsize=(6.6, 2.5)) ax.step(x, cm, where='post', color=GRAY, linewidth=1.4, label='model: slot 3 running at VBlank') ax.step(x, cn, where='post', color=BLUE, linewidth=1.6, label='model + the 8 frames finishing within 1,000 ticks of VBlank (upper bound; 5-7 expected)') pts = {} for r in C['readings']: pts[r['game_frame']] = r['board_ovr3'] ax.plot(list(pts), list(pts.values()), 'o', color=ORANGE, markersize=6, markeredgecolor='white', markeredgewidth=1.2, label='board running counter OVR3 (first P1 return photos)', zorder=5) ax.plot([488], [1], 'o', color=ORANGE, markersize=6, markeredgecolor='white', markeredgewidth=1.2, zorder=5) ax.annotate('first detection: frame 488 on the board and in the model', xy=(488, 1), xytext=(700, 12), fontsize=6.3, color=INK2, arrowprops=dict(arrowstyle='-', color=INK2, linewidth=0.6)) ax.axvspan(4618, 5317, color=BLUE, alpha=0.06, linewidth=0) ax.text(4967, 2, 'P1 ring\n(frame-paired)', ha='center', fontsize=6, color=INK2) ax.annotate('8 end-of-demo frames\n(5626-5633)', xy=(5630, 27), xytext=(6100, 20), fontsize=6.3, color=INK2, arrowprops=dict(arrowstyle='-', color=INK2, linewidth=0.6)) ax.set_xlim(0, 8000) ax.set_ylim(0, 54) ax.set_xlabel('game frame from power-on (probe image P1)') ax.set_ylabel('cumulative overrun frames') ax.legend(fontsize=6.3, loc='upper left') save(fig, 'counters') def fig_census(): m = [int(x) for x in open(NUM / 'live_margins_b24.csv').read().split()[1:]] fig, axs = plt.subplots(1, 2, figsize=(6.6, 2.5), gridspec_kw=dict(width_ratios=[1.3, 1])) ax = axs[0] ax.hist(m, bins=np.arange(0, 46000, 1000), color=BLUE) ax.set_yscale('log') ax.set_xlabel('margin at VBlank, ticks (frame = 52,433)') ax.set_ylabel('live frames (log)') ax.set_title(f'{len(m):,} completed live passes', loc='left', color=INK) ax = axs[1] b26, leg = N['census_b26']['stalls'], N['census_legacy']['stalls'] states = ['round end', 'result screens', 'before FIGHT', 'round intro', 'non-fight (G_No 0)', 'normal fight'] yb = np.arange(len(states)) def frames(d): return sum(int(k) * v for k, v in d.items()) ax.barh(yb + 0.18, [frames(b26.get(s, {})) for s in states], height=0.34, color=BLUE, label='board model') ax.barh(yb - 0.18, [frames(leg.get(s, {})) for s in states], height=0.34, color=GRAY, label='instruction-table timing') for i, s in enumerate(states): d = b26.get(s, {}) lab_ = ' '.join(f'{v}x{k}' for k, v in sorted(d.items(), key=lambda t: int(t[0]))) ax.text(frames(d) + 2, i + 0.18, lab_, va='center', fontsize=5.8, color=INK2) ax.set_yticks(yb) ax.set_yticklabels(states, fontsize=6.8) ax.invert_yaxis() ax.set_xlabel('stalled frames, 99 episodes') ax.set_xlim(0, 160) ax.legend(fontsize=6.3, loc='lower right') ax.set_title('Stalls: count x length', loc='left', color=INK) ax.grid(axis='y', visible=False) fig.tight_layout(w_pad=1.2) save(fig, 'census') def fig_p2(): P = N['p2_groups'] res = {r['id']: r for r in P['residuals']} L = lab() b12 = json.loads((FU / 'data/emulator/build12_p2_observations.json').read_text()) b12w = {int(t['id']): st.median([s['ticks'] for s in t['samples'] if not s['cold']]) for t in b12['cpu']} groups = ['p1_bridge', 'cache_conflict', 'instruction_capacity', 'load_dependency', 'multiply', 'write_read_handoff', 'copy', 'ram_spacing', 'spacing_control', 'frt_phase'] fig, ax = plt.subplots(figsize=(6.6, 2.9)) rng = np.random.default_rng(7) for i, g in enumerate(groups): ids = [k for k, r in res.items() if r['group'] == g] old = [100 * (b12w[k] - warm(L[k])) / warm(L[k]) for k in ids] new = [res[k]['err'] for k in ids] j = rng.uniform(-0.12, 0.12, len(ids)) ax.scatter(i - 0.18 + j, old, s=9, color=GRAY, label='build12 (14 Oct, before P2)' if i == 0 else None, linewidths=0) ax.scatter(i + 0.18 + j, new, s=9, color=BLUE, label='model 0x20261017 (fitted to P2)' if i == 0 else None, linewidths=0) ax.axhspan(-1, 1, color=AQUA, alpha=0.12, linewidth=0) ax.axhline(0, color=INK2, linewidth=0.7) ax.set_xticks(range(len(groups))) ax.set_xticklabels([g.replace('_', ' ') for g in groups], rotation=25, ha='right', fontsize=6.8) ax.set_ylabel('model - board, % of warm median') ax.set_ylim(-35, 15) ax.legend(fontsize=6.5, loc='lower left') ax.grid(axis='x', visible=False) save(fig, 'p2_residuals') def fig_dma(): rows = list(csv.DictReader(open(FU / 'data/p2/live.csv'))) b12 = json.loads((FU / 'data/emulator/build12_p2_observations.json').read_text())['live'] fig, ax = plt.subplots(figsize=(4.2, 2.5)) for src, col, lab_ in ((rows, ORANGE, 'board (P2)'), (b12, BLUE, 'build12, no contention model')): x = [int(r['dma_output_units64']) for r in src if int(r['dma_output_units64']) > 0] y = [int(r['kick']) for r in src if int(r['dma_output_units64']) > 0] ax.scatter(x, y, s=10, color=col, linewidths=0, label=lab_) k, c = np.polyfit(x, y, 1) xx = np.array([min(x), max(x)]) ax.plot(xx, k * xx + c, color=col, linewidth=1.2) ax.text(xx[1] + 4, k * xx[1] + c, f'{k:.2f} ticks / 64 B', fontsize=6.3, color=INK2, va='center') ax.set_xlim(0, 420) ax.set_xlabel('character-DMA batch, 64-byte output units') ax.set_ylabel('kick stamp, ticks after reset') ax.legend(fontsize=6.5, loc='upper left') save(fig, 'dma_kick') def main(): OUT.mkdir(parents=True, exist_ok=True) for f in (fig_timeline, fig_cost_ratio, fig_cache, fig_pipeline, fig_irq, fig_stale, fig_attract, fig_counters, fig_census, fig_p2, fig_dma): f() print('ok', f.__name__) if __name__ == '__main__': main()