Expand description
Effect decomposition using Bayesian linear regression (spec §3.4.6).
This module decomposes timing differences into interpretable components:
- Uniform shift (μ): All quantiles move equally (e.g., branch timing)
- Tail effect (τ): Upper quantiles shift more than lower (e.g., cache misses)
§Design Matrix (spec §3.4.6)
X = [1 | b_tail] where:
- Column 0: ones = [1, 1, …, 1] - uniform shift affects all quantiles equally
- Column 1: b_tail = [-0.5, -0.375, …, 0.5] - tail effect is antisymmetric
The tail basis is centered (sums to zero) so μ and τ are orthogonal.
§Model
Δ = Xβ + ε, ε ~ N(0, Σ_n)
With the same conjugate Gaussian model as the Bayesian layer (spec §3.4.6).
§Effect Pattern Classification (spec §3.4.6)
An effect component is “significant” if |effect| > 2×SE:
- UniformShift: Only μ is significant
- TailEffect: Only τ is significant
- Mixed: Both are significant
- Indeterminate: Neither is significant (classify by relative magnitude)
Structs§
- Effect
Decomposition - Result of effect decomposition (internal, detailed).
- Effect
Estimate - Simplified effect estimate for public API.
Functions§
- classify_
pattern - Classify the effect pattern based on posterior estimates (spec §3.4.6).
- decompose_
effect - Decompose timing differences into shift and tail effects (spec §3.4.6).