Skip to content

split_block

Distributes FIT rates of a specific fault type across multiple targets.

SplitBlock

Bases: BlockInterface

Distributes the FIT rate of a specific fault type across multiple other fault types.

The distribution is based on a defined percentage mapping. This is typically used to model how a generic fault (like "DRAM Error") manifests as specific sub-types (e.g., SBE, DBE) based on physical probabilities.

Source code in src/ecc_analyzer/core/split_block.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class SplitBlock(BlockInterface):
    """Distributes the FIT rate of a specific fault type across multiple other fault types.

    The distribution is based on a defined percentage mapping. This is typically used
    to model how a generic fault (like "DRAM Error") manifests as specific sub-types
    (e.g., SBE, DBE) based on physical probabilities.
    """

    def __init__(
        self,
        name: str,
        fault_to_split: FaultType,
        distribution_rates: dict[FaultType, float],
        is_spfm: bool = True,
    ):
        """Initializes the SplitBlock with a distribution mapping.

        Args:
            name (str): The descriptive name of the split operation.
            fault_to_split (FaultType): The source fault type (Enum) to be distributed.
            distribution_rates (dict[FaultType, float]): Dictionary mapping target
                FaultTypes to their probability (0.0 - 1.0).
            is_spfm (bool, optional): Indicates if this split occurs on the SPFM/residual
                path. Defaults to True.

        Raises:
            ValueError: If the sum of the provided distribution rates exceeds 1.0.
        """
        sum_of_rates = sum(distribution_rates.values())
        if sum_of_rates > 1.0 + 1e-9:
            raise ValueError(f"Sum of distribution rates ({sum_of_rates:.4f}) must not exceed 1.0.")

        self.name = name
        self.fault_to_split = fault_to_split
        self.distribution_rates = distribution_rates
        self.is_spfm = is_spfm

    def compute_fit(self, spfm_rates: dict[FaultType, float], lfm_rates: dict[FaultType, float]) -> tuple[dict[FaultType, float], dict[FaultType, float]]:
        """Transforms the input fault rate dictionaries by redistributing the source fault rate.

        Args:
            spfm_rates (dict[FaultType, float]): Current residual failure rates.
            lfm_rates (dict[FaultType, float]): Current latent failure rates.

        Returns:
            tuple[dict[FaultType, float], dict[FaultType, float]]: A tuple containing:
                - Updated SPFM rates.
                - Updated LFM rates.
        """
        new_spfm = spfm_rates.copy()
        new_lfm = lfm_rates.copy()
        target_dict = new_spfm if self.is_spfm else new_lfm

        if self.fault_to_split in target_dict:
            original_rate = target_dict.pop(self.fault_to_split)
            for target_fault, probability in self.distribution_rates.items():
                split_rate = original_rate * probability
                target_dict[target_fault] = target_dict.get(target_fault, 0.0) + split_rate

        return new_spfm, new_lfm

__init__(name, fault_to_split, distribution_rates, is_spfm=True)

Initializes the SplitBlock with a distribution mapping.

Parameters:

Name Type Description Default
name str

The descriptive name of the split operation.

required
fault_to_split FaultType

The source fault type (Enum) to be distributed.

required
distribution_rates dict[FaultType, float]

Dictionary mapping target FaultTypes to their probability (0.0 - 1.0).

required
is_spfm bool

Indicates if this split occurs on the SPFM/residual path. Defaults to True.

True

Raises:

Type Description
ValueError

If the sum of the provided distribution rates exceeds 1.0.

Source code in src/ecc_analyzer/core/split_block.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(
    self,
    name: str,
    fault_to_split: FaultType,
    distribution_rates: dict[FaultType, float],
    is_spfm: bool = True,
):
    """Initializes the SplitBlock with a distribution mapping.

    Args:
        name (str): The descriptive name of the split operation.
        fault_to_split (FaultType): The source fault type (Enum) to be distributed.
        distribution_rates (dict[FaultType, float]): Dictionary mapping target
            FaultTypes to their probability (0.0 - 1.0).
        is_spfm (bool, optional): Indicates if this split occurs on the SPFM/residual
            path. Defaults to True.

    Raises:
        ValueError: If the sum of the provided distribution rates exceeds 1.0.
    """
    sum_of_rates = sum(distribution_rates.values())
    if sum_of_rates > 1.0 + 1e-9:
        raise ValueError(f"Sum of distribution rates ({sum_of_rates:.4f}) must not exceed 1.0.")

    self.name = name
    self.fault_to_split = fault_to_split
    self.distribution_rates = distribution_rates
    self.is_spfm = is_spfm

compute_fit(spfm_rates, lfm_rates)

Transforms the input fault rate dictionaries by redistributing the source fault rate.

Parameters:

Name Type Description Default
spfm_rates dict[FaultType, float]

Current residual failure rates.

required
lfm_rates dict[FaultType, float]

Current latent failure rates.

required

Returns:

Type Description
tuple[dict[FaultType, float], dict[FaultType, float]]

tuple[dict[FaultType, float], dict[FaultType, float]]: A tuple containing: - Updated SPFM rates. - Updated LFM rates.

Source code in src/ecc_analyzer/core/split_block.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def compute_fit(self, spfm_rates: dict[FaultType, float], lfm_rates: dict[FaultType, float]) -> tuple[dict[FaultType, float], dict[FaultType, float]]:
    """Transforms the input fault rate dictionaries by redistributing the source fault rate.

    Args:
        spfm_rates (dict[FaultType, float]): Current residual failure rates.
        lfm_rates (dict[FaultType, float]): Current latent failure rates.

    Returns:
        tuple[dict[FaultType, float], dict[FaultType, float]]: A tuple containing:
            - Updated SPFM rates.
            - Updated LFM rates.
    """
    new_spfm = spfm_rates.copy()
    new_lfm = lfm_rates.copy()
    target_dict = new_spfm if self.is_spfm else new_lfm

    if self.fault_to_split in target_dict:
        original_rate = target_dict.pop(self.fault_to_split)
        for target_fault, probability in self.distribution_rates.items():
            split_rate = original_rate * probability
            target_dict[target_fault] = target_dict.get(target_fault, 0.0) + split_rate

    return new_spfm, new_lfm