diff --git a/__pycache__/csv_preprocessor.cpython-312.pyc b/__pycache__/csv_preprocessor.cpython-312.pyc index d82c258..f8c4c47 100644 Binary files a/__pycache__/csv_preprocessor.cpython-312.pyc and b/__pycache__/csv_preprocessor.cpython-312.pyc differ diff --git a/csv_preprocessor.py b/csv_preprocessor.py index e1b204f..a3bc3db 100644 --- a/csv_preprocessor.py +++ b/csv_preprocessor.py @@ -65,9 +65,6 @@ CLK_LP_LOW_MIN_NS = 300.0 HS_BURST_AMPLITUDE_MIN_MV = 40.0 # mV — below this, no real HS burst is present # Lowered from 50 mV: 48 mV capture (0001) was a false alarm; true flicker (0008) at 34 mV. -HS_BURST_AMPLITUDE_HIGH_MV = 70.0 # mV — above this with short LP-low → anomalous LP states -# Normal HS (dynamic video) = ~15–40 mV P95-P5/2 on LP probe (RC-filtered). -# LP-01/LP-10 states in the burst window (cap 0042 type) produce 130+ mV → flag these. # Mode A minimum amplitude: LP-11-return edge artifacts produce near-zero amplitude in the # burst window (burst is pure LP-low DC between two LP-11 regions). Require ≥ this to @@ -997,7 +994,7 @@ def analyze_lp_file(path: Path) -> "LPMetrics": f"(TCLK_PREPARE+TCLK_ZERO minimum) — SN65DSI83 may fail to lock CLK lane" ) - # Flicker suspect: four confirmed failure modes on this hardware: + # Flicker suspect: three confirmed failure modes on this hardware: # # A) Normal LP-low (~342–380 ns) → bridge misses SoT → returns to LP-11 # Signature: lp11_to_hs fires at real LP-low end (~347 ns), hs_amplitude ≈ 15–30 mV. @@ -1007,21 +1004,13 @@ def analyze_lp_file(path: Path) -> "LPMetrics": # A2) LP-11 present, HS attempt made but amplitude too weak for rolling-std to fire # Signature: lp11_to_hs is None (rolling-std < HS_OSC_STD_V throughout 500 ns # lookahead), hs_amplitude < 50 mV, LP-11 returns ~500 ns later. - # Root cause: marginal VDD_DSI (LP-11 sags to ~1.0 V vs 1.2 V nominal), reducing - # HS drive strength below the detection threshold. - # Confirmed: capture 0010 (lp11_to_hs=None, amp≈32 mV, LP-11 returned at +513 ns). # - # B) Short LP-low (50–200 ns, vs nominal ~342–380 ns) → marginal SoT timing - # → HS burst starts but is weak, hs_amplitude ≈ 40–60 mV (vs normal 100–122 mV). - # Signature: lp_low anomalously short, lp11_to_hs fires at noise spike (~3 ns). - # The lp11_to_hs guard cannot be used here, so LP-low duration gates the check. - # Confirmed example: capture 0120 (lp_low=108 ns, lp11_to_hs=1.7 ns, amp=49 mV). + # B) Short LP-low (< 200 ns, vs nominal ~342–380 ns) → anomalous SoT timing. + # Flag on LP-low duration alone: any lp_low < 200 ns is outside the normal range + # and warrants investigation regardless of amplitude or rolling-std state. + # Confirmed: capture 0124 (lp_low=108 ns). # - # C) No LP-11 detected at all → MIPI link silent or stuck - # Signature: no LP-11 region found, lp_transition_valid=False, no LP or HS seen. - # This is the most severe failure: the bridge or DSI IP has stopped outputting. - # Confirmed: follow-up of capture 13 (no LP-11, no HS) while display was flickering. - # Guard: only flag DAT lane (not CLK which is normally in continuous HS mode). + # C) No LP-11 detected at all → MIPI link silent or stuck. # # Only flag DAT lane (CLK is continuous HS — LP states not expected). _lp_low_short = ( @@ -1047,26 +1036,9 @@ def analyze_lp_file(path: Path) -> "LPMetrics": # weak oscillations are misclassified as LP-low, masking the true HS failure or lp11_to_hs_ns is None # Mode B: LP-low anomalously short + low amplitude = marginal HS launch. - # Gated by hs_rolling_std_found: if HS actually launched (rolling-std fires - # after LP-low ends), LP-low being short is a timing anomaly but not a flicker. - or (_lp_low_short and not hs_rolling_std_found) - # Mode D: LP-low normal, noise-spike lp11_to_hs (< 50 ns), low HS amplitude. - # Requires video/dynamic content. Gate: if rolling-std fires after LP-low ends, - # HS launched normally and the early lp11_to_hs was just the LP-low edge trigger. - or (lp11_to_hs_ns is not None - and lp11_to_hs_ns < LP_LOW_DUR_MIN_NS - and not _lp_low_short - and not hs_rolling_std_found) + or _lp_low_short ) ) - # Mode E: short LP-low with anomalously HIGH amplitude — LP-01/LP-10 states in the - # burst window (link failed to launch HS cleanly). Normal LP probe HS = 15–40 mV; - # LP-01/LP-10 DC levels produce 70+ mV. Confirmed: cap 0042 (lp_low=61 ns, amp=133 mV). - hs_burst_anomalous = ( - _lp_low_short - and hs_amplitude_mv is not None - and hs_amplitude_mv > HS_BURST_AMPLITUDE_HIGH_MV - ) # Mode C: no LP-11 at all → link silent (but exclude CLK which is always HS) link_silent = ( channel == "dat" @@ -1080,13 +1052,9 @@ def analyze_lp_file(path: Path) -> "LPMetrics": or ( lp_transition_valid and ( - # LP-00 absent entirely (LP-01/LP-00 skipped — SoT never completed). - # Short-but-non-zero LP-low is handled by Mode B inside hs_burst_absent; - # flagging it standalone (even with healthy HS amplitude) caused false - # positives when noise triggers gave lp_low < 50 ns with normal HS. lp_low_duration_ns is None or hs_burst_absent - or hs_burst_anomalous + or _lp_low_short ) ) ) @@ -1108,6 +1076,7 @@ def analyze_lp_file(path: Path) -> "LPMetrics": hs_amplitude_mv = hs_amplitude_mv, lp_transition_valid = lp_transition_valid, clk_lp_startup_ok = clk_lp_startup_ok, + hs_rolling_std_found = hs_rolling_std_found, flicker_suspect = flicker_suspect, warnings = warnings, )