This commit is contained in:
david rice
2026-04-27 10:35:56 +01:00
parent 0fe208aef6
commit 6a51228d5f
4 changed files with 128 additions and 4 deletions

View File

@@ -55,6 +55,12 @@ LP_LOW_HS_ONSET_MARGIN_NS = 20.0 # ns
# LP-low plateau below this → SoT sequence too brief for receiver to detect → flicker risk
FLICKER_LP_LOW_MAX_NS = 50.0 # ns
# Mode G: LP-low significantly shorter than the baseline seen on this hardware.
# Normal LP-low (THS_PREPARE + THS_ZERO + preamble HS-0 symbols) measures ~379380 ns.
# Flicker-associated short LP-low values cluster at 34194 ns (confirmed: cap 27 at 108 ns).
# The gap between 194 and 379 ns is unambiguous — 250 ns splits the populations cleanly.
LP_LOW_FLICKER_THRESHOLD_NS = 250.0 # ns — below this, LP-low is suspiciously short
# CLK lane LP-00 minimum for SN65DSI83 CLK lane lock (TCLK_PREPARE + TCLK_ZERO ≥ 300 ns)
CLK_LP_LOW_MIN_NS = 300.0
@@ -69,10 +75,13 @@ HS_BURST_AMPLITUDE_MIN_MV = 40.0 # mV — below this, no real HS burst is prese
# Measures fraction of post-LP-low window (100 ns margin, 3 µs look-ahead) where rolling_std
# exceeds HS_OSC_STD_V. With dynamic video at 432 Mbps DDR each bit spans ~4.6 ns; transitions
# (~1 ns) fire the 1 ns rolling window ~20% of the time → healthy HS → osc_frac ≈ 0.140.22.
# Blanking/control packets carry uniform data → osc_frac ≈ 0.000.02 (confirmed NOT flicker).
# Partial or transient HS dropout sits between these bands → suspicious → send to Claude.
# Static solid-colour content (e.g. FF 33 BB repeating) has fewer bit transitions, so healthy
# osc_frac is lower: ~0.110.17. Blanking/control packets → osc_frac ≈ 0.000.02 (normal).
# Confirmed partial/transient HS dropout (Apr-23, cap 0105): osc_frac = 0.079.
# Suspicious zone must sit below the lowest healthy static-pink value (~0.11) and above true
# dropout values (~0.040.08). Threshold set to 0.10 to give clear separation.
HS_OSC_FRACTION_SUSPICIOUS_LO = 0.04 # below this: dead HS — blanking / control (normal)
HS_OSC_FRACTION_SUSPICIOUS_HI = 0.13 # above this: healthy HS; between bands → flag
HS_OSC_FRACTION_SUSPICIOUS_HI = 0.10 # above this: healthy HS; between bands → flag
# Mode A minimum amplitude: LP-11-return edge artifacts produce near-zero amplitude in the
@@ -809,6 +818,9 @@ class LPMetrics:
+ (f" avg {self.hs_burst_dur_ns:.0f} ns" if self.hs_burst_dur_ns else ""))
if self.hs_amplitude_mv is not None:
lines.append(f" HS amplitude : {self.hs_amplitude_mv:.0f} mV (single-ended p-p/2)")
if self.hs_osc_fraction is not None:
lines.append(f" HS osc fraction : {self.hs_osc_fraction:.4f} "
f"(suspicious {HS_OSC_FRACTION_SUSPICIOUS_LO:.2f}{HS_OSC_FRACTION_SUSPICIOUS_HI:.2f})")
if self.flicker_suspect:
if not self.lp_transition_valid and not self.lp11_voltage_v:
lines.append(
@@ -823,6 +835,20 @@ class LPMetrics:
f"(amplitude {self.hs_amplitude_mv:.0f} mV < {HS_BURST_AMPLITUDE_MIN_MV:.0f} mV, "
f"lp11_to_hs={self.lp11_to_hs_ns:.0f} ns) ***"
)
elif (self.hs_osc_fraction is not None
and HS_OSC_FRACTION_SUSPICIOUS_LO < self.hs_osc_fraction < HS_OSC_FRACTION_SUSPICIOUS_HI):
lines.append(
f" *** FLICKER SUSPECT: partial HS dropout "
f"(osc_frac={self.hs_osc_fraction:.4f} in suspicious "
f"{HS_OSC_FRACTION_SUSPICIOUS_LO:.2f}{HS_OSC_FRACTION_SUSPICIOUS_HI:.2f} zone) ***"
)
elif (self.lp_low_duration_ns is not None
and self.lp_low_duration_ns < LP_LOW_FLICKER_THRESHOLD_NS):
lines.append(
f" *** FLICKER SUSPECT: short LP-low "
f"({self.lp_low_duration_ns:.0f} ns vs ~380 ns normal — "
f"bridge may miss SoT) ***"
)
else:
lines.append(
f" *** FLICKER SUSPECT: LP-low plateau absent or < {FLICKER_LP_LOW_MAX_NS:.0f} ns ***"
@@ -1066,6 +1092,14 @@ def analyze_lp_file(path: Path) -> "LPMetrics":
and hs_osc_fraction is not None
and HS_OSC_FRACTION_SUSPICIOUS_LO < hs_osc_fraction < HS_OSC_FRACTION_SUSPICIOUS_HI
)
# Mode G: LP-low plateau present but much shorter than the ~380 ns baseline.
# Indicates insufficient THS_PREPARE+THS_ZERO (or preamble) for the bridge to lock
# the data lane SoT — the bridge likely misses the first few pixels of the line.
mode_g_short_lp_low = (
lp_transition_valid
and lp_low_duration_ns is not None
and lp_low_duration_ns < LP_LOW_FLICKER_THRESHOLD_NS
)
flicker_suspect = (
channel == "dat"
and (
@@ -1076,6 +1110,7 @@ def analyze_lp_file(path: Path) -> "LPMetrics":
lp_low_duration_ns is None
or hs_burst_absent
or mode_f_partial_hs
or mode_g_short_lp_low
)
)
)