Skip to content

LTX-2.5 sigma schedule: Ltx2SigmaSchedule(1, ...) divides 0/0 and returns {-nan, 0} #452

Description

@localai-bot

Found while repairing LTX-2.5 phase L5 (#435, PR #437) after a sweep over step counts was added. Reported rather than repaired, deliberately: the fix moves every sigma on every arm, so it needs its own spec and fresh review.

The defect

Ltx2SigmaSchedule(1, ...) returns {-nan, 0} where upstream returns {0.10000002, 0}.

Root cause, measured

Upstream's shift is a Python scalar divided by a tensor, and torch evaluates that as scalar * reciprocal(tensor). At sigma == 1 that yields 0.99999994, not 1.0.

At steps == 1 that one-ulp residue is the entire stretch anchor. Our port computes the same expression in f32 and gets exactly 1.0, so the stretch divides 0/0.

Why it was invisible

Two layers:

  1. The fixture exercised steps in {8,6,5,1,4,7} with no sweep, and
  2. MaxAbsDiff dropped NaN (MaxAbsDiff helpers are NaN-blind: a golden comparing all-NaN against correct values reports max|diff| = 0 and PASSES #449), so the OneStep arm compared NaN against a correct golden and reported worst = 0.0.

Both are now closed: L5's repair added a sweep asserting exact-0 termination over steps 1..200 (which carves out steps == 1 explicitly, so the defect is recorded in the tree rather than only in a report), and #449 hardened the helper.

Wants

Mirror upstream's scalar * reciprocal(tensor) evaluation so the anchor carries the same one-ulp residue, then regenerate the affected goldens. Note the ordering trap: the goldens must be regenerated from upstream, never adjusted to match the port. Expect every sigma on every arm to move by ~1 ulp, so this is a whole-phase re-gate, not a local edit.

Related: #449 (the NaN-blind helper that hid it), .agents/specs/ltx-2-5.md §7.0(c) (the fixture that could not discriminate).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions