Skip to content

Commit f1b1df6

Browse files
feat(bench): record + label the machine (Framework Laptop 13) on the chart (#186)
The benchmark hardware is a Framework Laptop 13 (AMD Ryzen 7040 Series — the board generation is inferable from the CPU). Surface that everywhere. margine-bench-kernel.sh: capture `machine` from DMI (sys_vendor + product_name, e.g. "Framework Laptop 13 (AMD Ryzen 7040Series)") into the JSON identity, so future runs self-record the model. margine-bench-compare.py: new --machine flag; the chart subtitle now uses machine (JSON field > --machine > cpu_model fallback). Regenerate the published chart with the Framework label; update the README perf hero sub-caption and the results/2026-06-16 provenance README to name the machine. Validation: shellcheck + ruff clean; chart re-rendered, ASCII-safe, subtitle shows "Framework Laptop 13 (AMD Ryzen 5 7640U, Radeon 760M)".
1 parent e2c4c83 commit f1b1df6

6 files changed

Lines changed: 16 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tools that make it ready for work from minute one. Built on
4444

4545
<img src="tools/bench/results/2026-06-16/perf-kernel.svg" alt="Margine CachyOS/BORE kernel vs stock Fedora kernel — scheduler benchmark chart" width="92%">
4646

47-
<sub>Median of 4 runs · governor performance · scx off · same hardware · <a href="tools/bench/results/2026-06-16/">how this was measured →</a></sub>
47+
<sub>Median of 4 runs · Framework Laptop 13 (Ryzen 5 7640U) · governor performance · scx off · <a href="tools/bench/results/2026-06-16/">how this was measured →</a></sub>
4848

4949
</div>
5050

tools/bench/margine-bench-compare.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def main():
101101
ap.add_argument("--out-prefix", default="margine-bench-compare",
102102
help="output path prefix for .svg / .md (default: %(default)s)")
103103
ap.add_argument("--title", default="Kernel performance — Margine vs stock")
104+
ap.add_argument("--machine", help="hardware label for the subtitle "
105+
"(overrides the auto-detected DMI machine / cpu_model)")
104106
args = ap.parse_args()
105107

106108
if len(args.json) < 2:
@@ -132,7 +134,7 @@ def main():
132134
for lab in order:
133135
g = groups[lab]
134136
a = {"label": lab, "n_runs": len(g)}
135-
for k in ("cpu_model", "nproc", "governor", "date", "kernel"):
137+
for k in ("cpu_model", "nproc", "governor", "date", "kernel", "machine"):
136138
a[k] = g[0].get(k)
137139
for key, name, *_ in METRICS:
138140
vals = [r[key] for r in g if isinstance(r.get(key), (int, float))]
@@ -178,7 +180,8 @@ def rel(val, baseval, lower):
178180
return (baseval / val) if lower else (val / baseval)
179181

180182
meta = runs[subj]
181-
ctx = (f"{meta.get('cpu_model', 'unknown CPU')} · {meta.get('nproc', '?')} CPUs · "
183+
hw = args.machine or meta.get("machine") or meta.get("cpu_model", "unknown CPU")
184+
ctx = (f"{hw} · {meta.get('nproc', '?')} CPUs · "
182185
f"governor {meta.get('governor', '?')} · {meta.get('date', '')}")
183186

184187
# Thermal comparability: a run that started much hotter throttles and looks

tools/bench/margine-bench-kernel.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ identity_report() {
259259
res cachyos "$( [[ "$krel" == *cachy* ]] && echo 1 || echo 0 )"
260260
res bore "$( [[ "$(cat /proc/sys/kernel/sched_bore 2>/dev/null || echo 0)" == 1 ]] && echo 1 || echo 0 )"
261261
[[ -r /proc/cpuinfo ]] && res cpu_model "$(grep -m1 'model name' /proc/cpuinfo | cut -d: -f2- | sed 's/^ *//')"
262+
# Machine model from DMI (e.g. "Framework Laptop 13 (AMD Ryzen 7040Series)") —
263+
# the comparer prefers this over cpu_model for the chart subtitle.
264+
[[ -r /sys/class/dmi/id/product_name ]] && res machine "$(printf '%s %s' \
265+
"$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null || true)" \
266+
"$(cat /sys/class/dmi/id/product_name 2>/dev/null || true)" \
267+
| sed 's/ */ /g; s/^ *//; s/ *$//')"
262268
[[ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]] && \
263269
res governor "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
264270
[[ -r /sys/kernel/sched_ext/state ]] && \

tools/bench/results/2026-06-16/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kernel**, plus the published chart.
88

99
## Conditions
1010

11-
- **Hardware:** AMD Ryzen 5 7640U w/ Radeon 760M (12 threads), laptop, on AC.
11+
- **Hardware:** Framework Laptop 13 (AMD Ryzen 7040 Series — Ryzen 5 7640U / Radeon 760M, 12 threads), on AC. The exact board generation is inferable from the CPU.
1212
- **Governor:** `performance`. sched_ext (scx) schedulers: **off** (stock BORE).
1313
- **Method:** the *same* `margine-bench-kernel.sh` on the *same* laptop, switching
1414
ostree deployments — Margine vs `ghcr.io/ublue-os/bluefin-dx:stable` — so the

tools/bench/results/2026-06-16/perf-kernel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Margine kernel vs stock Fedora — same laptop, median of runs
22

3-
*AMD Ryzen 5 7640U w/ Radeon 760M Graphics · 12 CPUs · governor performance · 2026-06-16T23:07:27+02:00 · start temp margine-cachyos 54°C, bluefin-dx 52°C · median of margine-cachyos ×3, bluefin-dx ×4. Lower is better for latency/time, higher for throughput. Baseline for the deltas is **bluefin-dx**. Each run executed the same `margine-bench-kernel.sh` under a `stress-ng` background load.*
3+
*Framework Laptop 13 (AMD Ryzen 5 7640U, Radeon 760M) · 12 CPUs · governor performance · 2026-06-16T23:07:27+02:00 · start temp margine-cachyos 54°C, bluefin-dx 52°C · median of margine-cachyos ×3, bluefin-dx ×4. Lower is better for latency/time, higher for throughput. Baseline for the deltas is **bluefin-dx**. Each run executed the same `margine-bench-kernel.sh` under a `stress-ng` background load.*
44

55
| Metric | **margine-cachyos** | bluefin-dx | margine-cachyos vs bluefin-dx |
66
|---|---|---|---|

tools/bench/results/2026-06-16/perf-kernel.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)