k4bench.labels¶
k4bench.labels ¶
Human labels for the identifiers that name a benchmark run.
A run is identified by three machine strings — a detector name, an EOS sample
directory (p8_ee_Zbb_ecm91) and an LCG/Spack platform triplet
(x86_64-almalinux9-gcc14.2.0-opt). This module turns the latter two into
something a person reads, and is the single place that knows their layouts.
It lives at the top level, and depends on nothing, because its three consumers
sit in different layers and must not import each other: the e-group email and
the dashboard display these labels, while the blame ranker puts them in the
prompt a model judges with (:mod:k4bench.blame.rank). That last consumer is
why the vocabulary below is behaviour, not styling — widening
:data:_PARTICLE_LABELS changes what the model is told is being simulated, so
it is versioned and tested here rather than tweaked as presentation.
Every function degrades to the raw string when a name does not match a known layout: an unrecognized future sample reads plainly instead of being guessed at and rendered as garbled physics.
PlatformLabel
dataclass
¶
A recognized platform triplet, split into the parts that mean something
on their own — a caller that needs only the compiler or only the build type
(an opt vs. dbg build reads differently for a codegen change) gets
it from here rather than re-splitting the slug and re-deriving the layout
this module already decided.
pretty_sample ¶
Human-readable label for an EOS sample directory name.
Covers the two naming layouts currently produced by the benchmark:
single-particle guns (single_{particle}_{energy}) and generator
samples ({gen}_{beams}_{process}_ecm{energy}, e.g.
p8_ee_Zbb_ecm91). Anything else is returned unchanged.
Source code in k4bench/labels.py
describe_platform ¶
describe_platform(platform: str) -> PlatformLabel | None
platform split into its four labelled parts, or None when it does
not match the {arch}-{os}{ver}-{compiler}{ver}-{type} layout, e.g.
x86_64-almalinux9-gcc14.2.0-opt -> x86_64 / AlmaLinux 9 /
GCC 14.2.0 / optimized.
Source code in k4bench/labels.py
pretty_platform ¶
One-line platform label, e.g. x86_64-almalinux9-gcc14.2.0-opt ->
AlmaLinux 9 · GCC 14.2.0 (optimized). Falls back to the raw string for
anything :func:describe_platform does not recognize.
The architecture is deliberately omitted: every run group in one report
shares it, so it carries no information in a UI label. Callers that need it
(the ranker's run context) use :func:describe_platform.