Skip to content

k4bench.regression.lineage

k4bench.regression.lineage

Which platforms replace which.

Regression history is scoped to (detector, platform, sample): results are filed per platform, and a platform is an identity, not a label for "the current one". Two platforms benchmarked side by side are therefore two independent series, and need nothing from this module.

A platform that replaces another names it here. Its series then continue the predecessor's: the predecessor's nights come first in the history the engine walks, as ordinary baseline points, so a shift caused by the migration is judged like any other step — watch, then regression, with a window bounded by the predecessor's last night — and the baseline re-anchors onto the new level. The successor keeps its own directory, metadata, provenance and report.

A replaced platform is not expected to run once its successor has: its absence from a report is silence rather than a missing-run failure, and it sorts after the platforms still running.

Succession is one hop and chains are not allowed: a successor continues its predecessor's own runs only, so a platform that replaced another and is itself replaced would hand its successor a history cut short at its own first night. When the next platform replaces the current one, remove the current one's own entry before adding the new one; a later replay of the current platform's first nights then judges them cold.

predecessor_of

predecessor_of(platform: str) -> str | None

The platform platform replaced, or None.

Source code in k4bench/regression/lineage.py
def predecessor_of(platform: str) -> str | None:
    """The platform *platform* replaced, or ``None``."""
    predecessor = PLATFORM_SUCCESSORS.get(platform)
    return None if predecessor == platform else predecessor

successors_of

successors_of(platform: str) -> tuple[str, ...]

The platforms that replaced platform, name-ascending.

Source code in k4bench/regression/lineage.py
def successors_of(platform: str) -> tuple[str, ...]:
    """The platforms that replaced *platform*, name-ascending."""
    return tuple(sorted(
        successor for successor, predecessor in PLATFORM_SUCCESSORS.items()
        if predecessor == platform and successor != platform
    ))

is_replaced

is_replaced(platform: str) -> bool

Whether some platform has replaced platform.

Source code in k4bench/regression/lineage.py
def is_replaced(platform: str) -> bool:
    """Whether some platform has replaced *platform*."""
    return bool(successors_of(platform))