Skip to content

#606 stage B: templates/ltx2/refine-in-place with lem-tuned strength ladders #639

Closed

Description

@dkackman

Stage B of #606. Plan v2, section Stage B (and Design 2–4): #606 (comment). The plan comment is authoritative. This body restates it.

Filed by the feature lead, claude-opus-5-5 (anthropic).

Builds

  • Template templates/ltx2/refine-in-place. Steps:
  • The strength knob. select with rule: "index" over N dict candidates {"sigmas": [...], "noise_scale": s0}, with index: "variable:strength". The pipeline reads previous_result:<step>.sigmas / .noise_scale.
    • strength is an integer 0..N-1: 0 preserve, N-1 reinterpret, default the middle ladder.
    • N is 3–5, as many ladders as lem tuning can separate.
    • Each ladder has three sigmas, strictly decreasing, with no trailing 0, and noise_scale == sigmas[0].
  • The ladders are tuned on lem, not copied from vrgamedevgirl: at least two sources, each strength run, and frames judged with get_output_frames. The chosen values and their job ids go in the hand-off comment.
  • plugins/dw/skills/ltx-2.5/SKILL.md, kept terse (about 3.8 KB of headroom):
    • a routing line for same-size refine;
    • "schedule not a knob" reworded to "except refine-in-place's strength";
    • the noise_scale = sigmas[0] rule;
    • the cost list.
  • A workflows/templates/ltx2/README.md row, and a cost entry from the lem runs.

No engine code knows a ladder. refine-clip and two-stage are not changed.

Owes

Deploy

Server (template) + plugin.

Passes when

  • Its own repro works: each strength run on one asset gives output at the expected size, with the soundtrack in final/. Lowest strength stays closest to the source and highest moves farthest. Run time is flat across strengths.
  • and every pending: #<this issue> case the tester writes passes.

Activity

  1. added
    featureWork bigger than a fix: designed with Don, built in stages (harnest R11)
    owner:leadFeature lead's turn (harnest R11)
    stageA child issue: one stage of a feature
    on Oct 5, 2026
  2. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Progress (claude-opus-5-5, anthropic): branch feat/606-B-refine-in-place @ 6a389ef has the template with five ladders tuned on lem, plus the pipeline's AudioVideo unwrap and the select index hardening. Still to do: the catalog, step-cache and pipeline/select tests, SKILL.md, the README row, the plugin bump, the merge, the deploy and the hand-off.

  3. added 2 commits that reference this issue on Oct 6, 2026
  4. added and removed
    owner:leadFeature lead's turn (harnest R11)
    on Oct 6, 2026
  5. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Hand-off from the feature lead, claude-opus-5-5 (anthropic).

    Shipped: develop @ a08d0fc, which merges feat/606-B-refine-in-place (6a389ef and its follow-up). Deploy: [deploy 09:33:18] deployed develop @ a08d0fc7, healthy, mcp=true.

    What it covers, by plan item (Stage B, plan v2)

    • Template templates/ltx2/refine-in-place. #602 stage A: fit_to_model and restore_to_source tasks #631 had landed, so it takes the fit/restore shape:
    • The strength knob. strength is an integer 0–4, default 2. There are five ladders, each with three sigmas, strictly decreasing, no trailing 0, and noise_scale == sigmas[0].
    • Cost. 1.5 min on an RTX 3090. Measured runs took 86–88 s each, flat across strengths.
    • Skill. ltx-2.5 SKILL.md got:
      • a same-size routing line;
      • "not a knob (except refine-in-place's strength)";
      • the ladder rule;
      • the cost list.
    • Docs. A workflows/templates/ltx2/README.md row.
    • Owed tests:
      • TestLtxRefineInPlace in tests/test_catalog_structure.py;
      • a TEMPLATE_PIPELINE_KEYS row;
      • COMPACT_BUDGET raised from 9,400 to 9,550 (measured at 9,460), with its paragraph.

    Tuned ladders and evidence. Frames were judged with get_output_frames on two sources.

    strength sigmas (noise_scale = first) Hal ep64-shot-ltx-hal.mp4 Priya ep63-shot-ltx-priya.mp4
    0 [0.4, 0.25, 0.1] 0fc9d00eaaf5 8df6832e9279
    1 [0.55, 0.4, 0.2] – 4d6c7b95541c
    2 [0.7, 0.5, 0.3] cdf5a13b6ecf 82be84e05d51
    3 [0.8, 0.6, 0.35] 51dc938c939b 7851317d5a1d
    4 [0.85, 0.65, 0.4] 89b899ecb15d 8fc989111737
    • How the strengths look:
      • 0: near the source.
      • 2: a subtle retexture.
      • 4: identity, framing and scene hold; skin texture, tone and expression are re-rendered.
    • Priya's source cuts from a wide shot to a close-up, and every rung keeps both shots.
    • Rejected draft rungs:
      • σ0 0.975 replaced the subject and the scene (ab272bf1c5f3).
      • σ0 0.909375, refine-clip's value, gave a plastic, deformed face at the same size (fb239482f976).
      • σ0 0.3 and 0.5 were indistinguishable from the source (0774397df05b, ef697f48b00d).

    Deviations

    1. LTX2RefinePipeline.encode_video now accepts a dw AudioVideo, taken as its frames. fit_to_model returns an AudioVideo, which has no len(), so the stage A pipeline refused the template's direct previous_result:fitted.video. There is a unit test. The video doc string on get_pipeline_signature says this.
    2. The tuning runs predate that fix. They ran with a loop_frames adapter step between fit and refine. That step converts the frames to uint8 and back. The shipped template feeds the fit's float frames directly, so pixels can differ by at most 1/255 from the tuned runs. Nothing else in the template differs.
    3. The vae component is placed on cuda. Encoding with the VAE on CPU hit a bfloat16 CUDA/CPU mismatch.
    4. select index hardening. A non-whole index such as 2.5 or "two" is now refused with "select: index must be a whole number". 2.0 and "2" are accepted. The out-of-range message now names the range, e.g. "out of range for 5 candidates (0 to 4)". The old message text is a prefix of the new one.
    5. No plugins/dw version bump. plugins/dw/README.md says "the plugin's version is the engine's; the release script bumps both", so a stage bump would break that rule.

    No MCP shape changed, so this isn't a breaking change.

  6. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (4d4809569e..a08d0fc715: dw/community_pipelines/pipeline_ltx2_refine.py dw/tasks/select.py). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  7. 28 remaining items

  8. added
    owner:leadFeature lead's turn (harnest R11)
    and removed on Oct 6, 2026
  9. added 2 commits that reference this issue on Oct 6, 2026
  10. added and removed
    owner:leadFeature lead's turn (harnest R11)
    on Oct 6, 2026
  11. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Re-hand-off after the architecture review's map finding, from the feature lead, claude-opus-5-5 (anthropic).

    Shipped: develop @ c5990a4, which merges feat/606-B-refine-in-place (docs commit on top of 9c9f950). Deploy: [deploy 18:16:06] deployed develop @ c5990a4a, healthy, mcp=true.

    The finding: the map row now names select's index rule. I edited row "Task argument domains" in docs/ARCHITECTURE.md:

    • Its list of rules outside the table now includes "select's index (select_index_problem, select_rule_problems: a whole number, at least 0, and below the candidate count when the count is known, i.e. at run time or when candidates is a written list)".
    • Its test cell now includes tests/test_select_validation.py::TestSelectErrors::test_an_out_of_range_literal_index_names_both_ends.
    • tests/test_architecture_map.py passes, the full pytest passes (9389 passed), and ruff is clean.

    No code changed since 0102565. The behavior is the same as in the last hand-off, including its disclosed deviation: strength 5 and -1 are both refused at validate_workflow with "…out of range for 5 candidates (0 to 4)". Everything else in the earlier hand-offs still stands. This isn't a breaking change.

  12. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Verified against lem develop @ 14663be (contains c5990a4). Tester: claude-opus-5-5 (anthropic).

    M-F093 now passes. Its −1 message was the only failure last time. Source asset:refine/src-512x288.mp4, workspace regression-model-specific:

    • strength: -1: refused at validate_workflow, at steps[0].task.arguments.index: "select: index -1 is out of range for 5 candidates (0 to 4)." It names the value and both ends of the range, and it doesn't wrap.
    • strength: 5: refused at validate with the same message for 5. This is the disclosed deviation: it used to fail in the select step. The case accepts either route, and no job was made.
    • strength: 1.5: refused at arguments.strength with "strength 1.5 would be realized as 1…", so it isn't truncated.
    • strength: "1": validates clean. My follow-up last round showed it coerced to 1, and that path didn't change.

    Re-checks after the select refactor, which also changed select() at run time:

    • M-F091. strength still defaults to 2, the middle of N=5. The constraints on width/height (32*n+0) and num_frames (8*n+1, 9+) are unchanged.
    • M-F092.
      • source_video with strength 0 and with strength 4 each validate clean at 1.4 min (basis observed). The three strengths have the same estimate.
      • width 500, height 300 and num_frames 120 are each refused at validate, and each message names its rule.
    • M-F094. The silent asset asset:refine/src-512x288-silent.mp4 validates clean.
      • Job 425a9733a464 failed in about 1.6 s at source_audio/normalize_audio: "asset:refine/src-512x288-silent.mp4 carries no audio track…".
      • Its manifest holds only ladder, with no files.
    • M-F095, one strength only. Job e64b54e5b2b7 ran strength 0 at seed 543.
      • It succeeded in 85.9 s, in line with the 85.5 s warm median last round. There were no warnings.
      • The ladder selected position 0, so the refactored run-time select() still picks the right ladder.
      • It wrote one intermediate/ file (refine) and one final/ file (with_source_audio).
      • The final is 512×288, 121 frames, 24 fps, 48 kHz stereo, 5.04 s, peak −3.28 dBFS, with no findings.
      • I didn't re-run strengths 1–4 or re-compare frames. Those passed last round on c3fc366. Since then the change is limited to select's validate/run-time index check, and the docs. I left the timing out of regression-perf/M-F095.jsonl because this was a partial re-run.

    I deleted both jobs. Every pending case passes, so I removed the pending: #639 line from M-F091 to M-F095 in harnest regression-suite-model-specific.md. Closing as verified.

  13. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Oct 6, 2026
  14. added a commit that references this issue on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureWork bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actstageA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP call

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions