josie / alder-tools

alderbench

Sister app to aldermon for the same Alder Lake box (i5-12600KF, ASRock Z690M ITX/ax). Runs comparative benchmarks and CPU stress tests across stock vs OC/UV configurations, cycling instruction sets so each clock rail (integer / SSE / AVX2) is tested separately — "OCCT but it cycles ISAs", with per-ISA scores written to JSON reports.

Standalone — no shared code with aldermon. aldermon owns the live sensors (clocks/temps/power); alderbench owns the workloads + scores. Run them side by side during a sweep to watch what the load is doing.

Usage

alderbench                     # TUI picker: Stability | Bench | Core-cycle | Custom
alderbench --tui               # TUI sweep straight from the config (no picker)
alderbench --preset stability  # 1-hour ISA-cycling stability sweep (TUI)
alderbench --preset bench      # comparative scores sweep (TUI)
alderbench --preset core-cycle # per-core single-core stability cycle (TUI)
alderbench --headless          # scripted sweep, no TUI (CI / scripts)
alderbench --smoke-workload 7zip-bench   # run one workload 3s, print verdict + score
alderbench --report runs/1756-c2c-latency.json  # print a past run's summary
alderbench --list              # enumerate workload names
alderbench --help              # usage

The TUI needs a real terminal; --headless covers scripts.

Workloads

| name | what it does | score | |------------------|-----------------------------------------------------|------------------| | stress-ng-cpu | integer stressor, all --cpu-methods (stability) | verdict only | | y-cruncher-sse | SSE4.2 FFT stress via the SNB variant binary | bits/sec per algo| | y-cruncher-avx2| AVX2 FFT stress via the HSW variant binary | bits/sec per algo| | 7zip-bench | 7z b compression benchmark | MIPS rating | | c2c-latency | cache-line ping-pong across every pinned cpu pair | ns/hop per pair | | dram-latency | pointer-chase at L1/L2/L3/DRAM-sized working sets | ns/access per size |

Verdicts come from each workload's own self-check (y-cruncher "Passed", 7z exit code, ping-pong sequence integrity, chase cycle integrity) — that's the stability signal per ISA rail. c2c/dram are in-process (zero-dep: raw sched_setaffinity + Instant), and double as coherency/memory stability checks.

Requirements: stress-ng + 7z on PATH. y-cruncher: download the static build and unpack it under ./bin/ (gitignored) — alderbench invokes the per-microarchitecture variant binaries (Binaries/11-SNB ~ Hina for SSE, 13-HSW ~ Airi for AVX2) directly, never the wrapper. minecraft-server is planned; the run loop skips it with a warning.

TUI keys

Picker: j/k/arrows navigate, Enter starts, q quits. Editor: j/k rows, ←/→ fields, Enter on Name cycles workloads, on Cores cycles 0-15/0-11/12-15, on Duration/Cooldown/Loops opens numeric input; a/d add/delete rows, </> reorder. During a sweep q cancels — while a workload runs the panel heartbeat-refreshes every few seconds (never at render-loop frequency, so it won't steal CPU from single-core runs); workloads that outrun their estimate (7z's fixed passes) say so explicitly. Watch aldermon for live load.

Config

alderbench.conf is searched at ./ → ~/.config/alderbench/ → /etc/alderbench/ (first match wins). Simple KEY = VALUE lines; # comments; unknown keys ignored; out-of-range numerics rejected.

poll_ms      = 250          # tick interval (50..60000)
cool_secs    = 15           # cooldown between workloads (0..3600)
loop_count   = 1            # sweep repeats; 0 = infinite
report_dir   = runs         # where JSON reports go
bin_dir      = bin          # where the y-cruncher bundle lives

# Either a comma list (names inherit per-workload defaults)…
workloads = stress-ng-cpu, y-cruncher-sse, 7zip-bench

# …or per-entry blocks:
workload.1.name           = y-cruncher-avx2
workload.1.duration_secs  = 300        # estimate, not a hard stop
workload.1.cores          = 0-11       # taskset-style range: 0-11 P-only, 12-15 E-only

Note: cores is honored by stress-ng, 7zip (taskset + -mmt), and the pinned c2c/dram pairs. y-cruncher stress re-pins its own threads to every logical core (verified: taskset -c 0 does not constrain it) — a y-cruncher leg is a machine-wide event, so schedule it when the desktop is free.

duration_secs is a display estimate: workloads run until they finish themselves (self-terminating stressors) or you quit; 7z b's fixed passes may overrun it.

Reports

One JSON file per finished workload: runs/<unix-seconds>-<workload>.json, schema version 2:

{"schema_version":2,"workload":"c2c-latency","params":"30s cores=0-15",
 "started":1758366463,"isa_class":"other","verdict":{"kind":"clean"},
 "score":{"kind":"c2c","pairs":[{"a":0,"b":1,"ns":28.0}, ...]}}

alderbench --report <path> prints a one-line human summary of any of these. Diff report dirs across OC configs to compare scores.

Install

make check     # fmt + clippy + tests
make install   # DESTDIR/PREFIX aware; bin → $(PREFIX)/bin,
               # conf → /etc/alderbench/alderbench.conf

Gentoo-friendly: make install DESTDIR="$D" PREFIX=/usr in an ebuild.