Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ ckpt intermittent schematicO3 [BENCHMARKS...] --trace 1,2 [--cap board] [--devic
# Analysis
ckpt analyze strip-mining LOG_FILE [-o CSV]
ckpt analyze milp-coarse ... # coarse-allocation MILP analysis
ckpt analyze plot CSV_DIR [--metric M] [--algorithms A...]

# Device interaction
ckpt device read-serial [--timeout N] [--end-marker M]
Expand Down Expand Up @@ -206,8 +205,7 @@ scripts/ckpt/
│ └── schematic.py # SCHEMATIC semantic verification
└── analysis/
├── strip_mining.py # Parse verbose logs for strip-mining K values
├── milp_coarse.py # Coarse-allocation MILP analysis
└── plot.py # Plot benchmark CSV results (requires `uv sync --extra plot`)
└── milp_coarse.py # Coarse-allocation MILP analysis
```

### Standalone Scripts
Expand All @@ -216,9 +214,11 @@ scripts/ckpt/
# Visualize results from a result directory
Rscript scripts/plot_results.R [--result-dir DIR] [--output-dir DIR] [--absolute] [--all-metrics]
[--benchmarks B,...] [--metrics M,...] [--log-scale] [--config FILE]
# Box plot of intermittent-power results (results/intermittent/summary.csv)
Rscript scripts/plot_intermittent.R [--result-dir DIR] [--output-dir DIR]
```

`scripts/plot_results.R` produces per-capacitor bar charts, by default `execution_time` and `runtime_region_boundary_calls` normalized against the baseline marked `normalize_ref` in the config (falling back to the first algorithm). `--all-metrics` adds `region_boundaries`, `profiling_time`, and `compilation_time`; `--absolute` turns normalization off. Region boundary data comes from the device-debug CSVs, timing data from the non-debug ones. Which CSVs are read, and their labels/colors/patterns, come from a JSON config — no filename is hardcoded in the R script. `scripts/plot_config.json` is the default; `scripts/plot_config_o0.json` additionally plots `uninstrumentedO0.csv` as a second execution-time baseline (`--config scripts/plot_config_o0.json`). Each config lists `algorithms` (per-capacitor series; CSV names default to `<algo>.csv` / `<algo>_debug.csv`, overridable with `csv` / `debug_csv`) and `baselines` (capacitor-independent series; `csv` required, optional `metrics` restricts which metrics they appear in).
`scripts/plot_results.R` produces per-capacitor bar charts, by default `execution_time` and `runtime_region_boundary_calls` normalized against the baseline marked `normalize_ref` in the config (falling back to the first algorithm). `--all-metrics` adds `region_boundaries`, `profiling_time`, and `compilation_time`; `--absolute` turns normalization off. Region boundary data comes from the device-debug CSVs, timing data from the non-debug ones. Which CSVs are read, and their labels/colors/patterns, come from a JSON config — no filename is hardcoded in the R script. `scripts/plot_config.json` is the default; `scripts/plot_config_o0.json` additionally plots `uninstrumentedO0.csv` as a second execution-time baseline (`--config scripts/plot_config_o0.json`). Each config lists `algorithms` (per-capacitor series; CSV names default to `<algo>.csv` / `<algo>_debug.csv`, overridable with `csv` / `debug_csv`) and `baselines` (capacitor-independent series; `csv` required, optional `metrics` restricts which metrics they appear in). `scripts/plot_intermittent.R` takes its series labels, colors, and fill patterns from `scripts/plot_config.json` too; shared helpers live in `scripts/plot_common.R`.

## Architecture

Expand Down
Binary file modified results/intermittent/normalized_time_box.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_10uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_50uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_5uF_normalized.pdf
Binary file not shown.
Binary file removed results/plots/runtime_region_boundary_calls_10uF.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_10uF_normalized.pdf
Binary file not shown.
Binary file removed results/plots/runtime_region_boundary_calls_50uF.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_50uF_normalized.pdf
Binary file not shown.
Binary file removed results/plots/runtime_region_boundary_calls_5uF.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_5uF_normalized.pdf
Binary file not shown.
299 changes: 0 additions & 299 deletions scripts/ckpt/analysis/plot.py

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/ckpt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import click

from .analysis.plot import ALGORITHMS, METRICS
from .bench.all import ALL_ALGORITHMS, DEFAULT_ALGORITHMS
from .compile.common import HALT_MODES
from .errors import (
Expand Down Expand Up @@ -1815,51 +1814,6 @@ def analyze_milp_coarse_cmd(
write_milp_coarse_summary_csv(summary_rows, Path(output))


@analyze.command("plot")
@click.argument("csv_dir", type=click.Path(exists=True))
@click.option(
"--metric",
type=click.Choice(list(METRICS.keys())),
default="prologue",
help="Metric to plot.",
)
@click.option(
"--algorithms",
multiple=True,
type=click.Choice(list(ALGORITHMS.keys())),
help="Algorithms to include (default: all).",
)
@click.option("--benchmarks", multiple=True, help="Benchmark programs to include.")
@click.option("--capacitors", multiple=True, help="Capacitor sizes to include.")
@click.option(
"--normalize",
type=click.Choice(list(ALGORITHMS.keys())),
help="Normalize values relative to this algorithm.",
)
@click.option("-o", "--output", type=click.Path(), help="Output file (e.g., plot.png).")
def analyze_plot_cmd(
csv_dir: str,
metric: str,
algorithms: tuple[str, ...],
benchmarks: tuple[str, ...],
capacitors: tuple[str, ...],
normalize: str | None,
output: str | None,
) -> None:
"""Plot benchmark comparison chart from CSV results."""
from .analysis.plot import plot_benchmarks

plot_benchmarks(
csv_dir=Path(csv_dir),
metric=metric,
algorithms=_list_or_none(algorithms),
benchmarks=_list_or_none(benchmarks),
capacitors=_list_or_none(capacitors),
normalize=normalize,
output_file=_path_or_none(output),
)


# =========================================================================
# device group
# =========================================================================
Expand Down
Loading
Loading