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.
An empty diff means no recorded changes. Callers distinguish complete captures from missing provenance before claiming that the endpoint stacks are identical.
PackageChange
dataclass
¶
PackageChange(name: str, base_commit: str | None, head_commit: str | None, version: str = '', repo_url: str | None = None, base_version: str | None = None, head_version: str | None = None, head_githash: str | None = None, kind: str = 'head', loaded: bool | None = None)
One package's difference between two stacks.
A recorded version or commit establishes presence at an endpoint. HEAD revisions can be unknown even when a manifest records the package.
package_key ¶
A package name as both stacks can agree on it.
Spack lower-cases and hyphenates (dd4hep, fcc-config,
k4projecttemplate) where LCG spells names as upstream does (DD4hep,
fcc_config, k4_project_template); a window spanning a platform
migration compares one of each.
Source code in k4bench/provenance/diff.py
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 tracked git commits are identical.
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.
Source code in k4bench/provenance/diff.py
diff_stacks ¶
diff_stacks(base: StackSnapshot, head: StackSnapshot) -> list[PackageChange]
Version/commit changes only; build hashes alone never manufacture a row.
Loaded means observed at either endpoint in this benchmark scope. If either capture is absent, an unobserved package's load status remains unknown.
Source code in k4bench/provenance/diff.py
hash_only_rebuilds ¶
hash_only_rebuilds(base: StackSnapshot, head: StackSnapshot) -> int
Count changed build hashes only when the recorded code stayed the same.