# HG changeset patch # User Tuomo Valkonen # Date 1785421664 18000 # Node ID afb3ce40cff69a10ecafa81988b7104b49148677 # Parent 642141008293f40de7b153765067c866ea14d649 Ensure that transport is reset if no spike was left at endpoint after weight optimisation diff -r 642141008293 -r afb3ce40cff6 src/sliding_fb.rs --- a/src/sliding_fb.rs Wed Jul 29 00:08:14 2026 -0500 +++ b/src/sliding_fb.rs Thu Jul 30 09:27:44 2026 -0500 @@ -873,7 +873,9 @@ // the `ε` here. That way, `d` is in its entirely multiplied by τ, as is `t`, // making all factors independent of τ. let maybe_excess = match ρ.α_γ.total_cmp(&0.0) { - Greater => (δ.α >= 0.0).then(|| { + // Note, the δ.α > 0 (and < 0) restriction will cause the transport to be reset, + // if no spike was left at the target point after weight optimisation. + Greater => (δ.α > 0.0).then(|| { let gvx = v.differential(&ρ.x); let d = if tconfig.alt_remainder_control { let τv̆y = τv̆.apply(&ρ.y); @@ -888,7 +890,7 @@ }; d * ρ.α_γ }), - Less => (δ.α <= 0.0).then(|| { + Less => (δ.α < 0.0).then(|| { let gvx = v.differential(&ρ.x); let d = if tconfig.alt_remainder_control { let τv̆y = τv̆.apply(&ρ.y);