k4bench.provenance.diff¶
k4bench.provenance.diff ¶
Diff two Key4hep stacks — which packages moved, and to what.
The unit of comparison is the release (the nightly tag), not the day a benchmark ran. The nightly build lags: on a day with no new nightly the benchmark sources the newest one available, so several consecutive run dates routinely share one identical stack. Comparing run dates would invent changes that never happened.
That makes the empty diff as informative as a full one. Two nights that share a stack cannot differ by an upstream commit, so a metric that stepped between them moved for some other reason — the host, the sample, or noise. Callers are expected to say so rather than present an empty list as "nothing found".
PackageChange
dataclass
¶
PackageChange(name: str, base_commit: str | None, head_commit: str | None, version: str = '', repo_url: str | None = None)
One package's difference between two stacks.
base_commit is None for a package that appeared, head_commit is
None for one that went away; both are set when it simply moved.
diff_packages ¶
diff_packages(base: dict, head: dict) -> list[PackageChange]
Packages that differ between two k4h_packages maps.
Changed packages come first (they are what a regression hunt is looking for), then added, then removed; alphabetical within each group. An empty result means the two stacks are identical — see the module docstring.
Source code in k4bench/provenance/diff.py
unchanged_packages ¶
Packages present in both stacks at the same commit.
Reported as a count rather than a table: "11 repos unchanged" is context a reader needs to size the diff, but eleven identical rows are not.