From cabaec4107263da0e15dddb1cb5872fadbd4df07 Mon Sep 17 00:00:00 2001 From: AI Machine Date: Sun, 19 Jul 2026 20:08:57 +0200 Subject: [PATCH] =?UTF-8?q?fix(ltx):=20Soften=20Schedule=20=E2=80=94=20log?= =?UTF-8?q?=20real=20step=20count=20from=20the=20wired=20schedule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #266 review finding P3 (diagnostic accuracy). The fallback kept only connected_ref = sigmas[0] from the wired SIGMAS, so when a run omitted extra_options["sigmas"] the coverage log fabricated a [ref, 0.0] schedule and reported "first 1 of 1 steps" — even though the wired 16-step curve covers "first 7 of 16". That contradicted the PR/changelog promise that the same coverage line is logged each run. Keep the WHOLE wired schedule (connected_sigmas) and report coverage against whichever schedule is actually in force: the runtime one, else the wired one we anchored to. Anchoring behavior is unchanged. Verified: with extra_options={} and a wired 16-step front-loaded curve, the log now reads "first 7 of 16 steps", matching the info output; the mask still softens (0.2 -> 0.28 at peak gain). 21/21 tests, ruff clean. Co-Authored-By: Claude Opus 4.8 --- k_ltx_keyframe_soften_schedule.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/k_ltx_keyframe_soften_schedule.py b/k_ltx_keyframe_soften_schedule.py index 6f108f3..b1d27a6 100644 --- a/k_ltx_keyframe_soften_schedule.py +++ b/k_ltx_keyframe_soften_schedule.py @@ -170,13 +170,16 @@ class LTXKeyframeSoftenSchedule: return (m, info) prev_fn = m.model_options.get("denoise_mask_function") - # Fallback anchor from the connected preview SIGMAS (if wired). Used only - # when a run omits extra_options["sigmas"] — gives the wired input a real - # runtime role, not just the info readout. + # Fallback from the connected SIGMAS (if wired). Used when a run omits + # extra_options["sigmas"] — gives the wired input a real runtime role, + # not just the info readout. Keep the WHOLE schedule, not only the anchor: + # the coverage log needs the real step count to stay honest (a wired + # 16-step schedule must report "of 16 steps", not a synthetic 1). try: - connected_ref = float(sigmas[0]) if sigmas is not None else None + connected_sigmas = [float(s) for s in sigmas] if sigmas is not None else None except Exception: - connected_ref = None + connected_sigmas = None + connected_ref = connected_sigmas[0] if connected_sigmas else None logged = [False] warned = [False] @@ -225,10 +228,11 @@ class LTXKeyframeSoftenSchedule: if not logged[0]: logged[0] = True nested = getattr(denoise_mask, "is_nested", False) + # Report coverage against the schedule actually in force: the + # runtime one, else the wired one we anchored to. + cov = rt if rt is not None else connected_sigmas try: - count, n_steps = steps_in_range( - rt if rt is not None else [ref, 0.0], soften_range - ) + count, n_steps = steps_in_range(cov, soften_range) except Exception: count, n_steps = 0, 0 log.info(