Concepts

Compare many sources without losing direction.

A source matrix runs directional pairwise comparisons across a provider set. Use it when the same question needs to be read across every provider pair without collapsing direction.

Problem

A provider set creates too many pairwise stories.

With two providers, it is reasonable to read one comparison result. With five providers, the same question becomes twenty directional comparisons. Looking only at aggregates hides which source was the target, which source was the comparison side, and whether the failure was asymmetric.

That direction matters. A residual in provider A versus provider B means A had target-only duration that B did not cover. The opposite cell asks whether B had target-only duration against A. Both cells can be true over different ranges.

Solution

Build a directional cell for every source pair.

A source matrix keeps source order explicit. Rows are targets. Columns are comparison sources. The diagonal is self-comparison, so it acts as a quick signal that the source had windows for the selected window family. Every non-diagonal cell runs the same overlap, residual, missing, and coverage logic.

var matrix = pipeline.History.CompareSources(
    "Provider matrix",
    "DeviceOffline",
    ["provider-a", "provider-b", "provider-c"]);

var weakCells = matrix.Cells
    .Where(cell => !cell.IsDiagonal)
    .Where(cell => cell.CoverageRatio.GetValueOrDefault(1) < 0.95)
    .ToArray();

Anatomy

Read it as cells, not as one heat map.

Rows are the lane being tested. Columns are the lane expected to cover it. The diagonal is the sanity check. Off-diagonal cells carry coverage ratio, residual, and missing counts so you can drill into the underlying rows when a number looks wrong.

How to read it

Use the cell kind before the number.

The matrix is not just a heat map. Read each cell as a compact comparison result, then drill into the underlying rows when a number looks wrong.

Diagonal cell

Shows the source against itself. It is expected to have full coverage when the source has windows, and no target residuals because both sides are the same lane.

Residual count

Duration or row count where the row source was active and the column source was not. This is the main signal for target coverage failure.

Missing count

Duration or row count where the column source was active and the row source was not. This is the reverse disagreement, kept in the same cell so direction is visible.

Coverage ratio

Covered target magnitude divided by total target magnitude for that directional pair. A low ratio says the column source did not cover the row source well enough.

Use it for

Provider QA, migration checks, and source drift.

Source matrices are useful when every provider should tell the same state story, or when a new provider is being phased in and must be measured against the established lanes before it becomes trusted.