Skip to content

#601 stage 4: per_entry cost for ltx2/restore-long #658

Closed

Description

@dkackman

Stage 4 of #601. It builds the plan's Stage 4, from plan v3. If this body and the plan disagree, the plan wins.

Filed by the lead agent, model claude-opus-5-5 via anthropic, 2026-10-06.

Builds

The cost entry for workflows/templates/ltx2/restore-long.json, from stage 3's (#630) acceptance run, measured as shots-batch's was (#352):

  • minutes is the measured run's total.
  • per_entry is {variable: "windows", minutes: <one restore window plus its slice>, entries: 3}.
  • If that run used a list other than the default 3 windows, the total is the measured run's, and entries and the template's default list match it.

Owes

  • Tests: per_entry_problems and the catalog-structure tests pass.
  • Docs: none beyond the template.

Deploy

Server restart.

Fallback

If #630's verify comment lacks the timings, Don runs the default template once on lem, and the figure comes from that job.

Passes when

validate_workflow on restore-long with 2, 3 and 4 windows returns a plan.estimate with basis: per_entry that scales by window count.

The stage also passes every pending: #<this issue> case the tester writes.

Activity

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

    @dkackman
    OwnerAuthor

    Stage 4 shipped: develop @ ddffc9d, deployed on lem (deployed develop @ ddffc9d4, healthy).

    What shipped (commit on feat/601-4-restore-long-cost, merged at ddffc9d). workflows/templates/ltx2/restore-long.json now has a cost block, using the figures from #630's verify comment (job 5d46a62ec00e: ep13, the default 3 windows, cuda on lem, cold):

    "cost": [{"device": "cuda", "name": "RTX 3090", "vram_gb": 24, "minutes": 12.2,
              "per_entry": {"variable": "windows", "minutes": 1.56, "entries": 3}}]
    • minutes 12.2 is the whole job (12.24 min, 734.6 s).
    • per_entry.minutes 1.56 is one warm restore@wN step (1.60 and 1.48, mean 1.54) plus its window@wN slice (about 0.05 for all three together, so about 0.02 each).
    • entries 3 matches the default windows list (w0–w2). The run used that default, so the fallback wasn't needed.
    • windows stays out of cost_drivers, as stage 3 left it.

    Covers: every item in plan Stage 4:

    • The cost entry: as above.
    • Tests: per_entry_problems (test_a_per_entry_cost_names_a_list_the_steps_read) and the catalog-structure tests pass. Full pytest: 9580 passed. ruff is clean.
    • Docs: none beyond the template, as planned.

    Expected estimates (from dw/plan.py _price: total − 1.56×3 + 1.56×N):

    • 2 windows: 10.64 min, basis: per_entry.
    • 3 windows: 12.2 min, basis: per_entry.
    • 4 windows: 13.76 min, basis: per_entry.

    Things for the tester to know:

    Not done here, for Don:

    • Join cost. per_entry follows the plan's words, one restore window plus its slice. It leaves out join's 4.92 min, about 40% of the run. Join time grows with source length, so window count grows it too. A 4-window source is likely to run past the 13.76 quote by about a third of that, roughly 1.6 min.
    • Join speed. The tester also flagged 4.9 min to crossfade 282 frames as out of proportion, which looks like a performance bug in join_windows. If it is fixed, the total here should drop by most of that.
    • I didn't fold the join's share into per_entry or file the bug. Both are calls for Don.

    Lead agent, claude-opus-5-5 via anthropic

  5. dkackman commented on Oct 6, 2026

    @dkackman
    OwnerAuthor

    Verified on lem, develop @ c5b500c. Tester agent, model claude-opus-5-5 via anthropic.

    The cost entry. list_workflows(shape="sequence", traits="needs-input-media") shows templates/ltx2/restore-long with cost: [{device: cuda, name: RTX 3090, vram_gb: 24, minutes: 12.2, per_entry: {variable: "windows", minutes: 1.56, entries: 3}}]. lists.windows.entries is 3, and the default windows list (get_workflow(..., variables_only=true)) is w0–w2. cost_drivers stays [num_frames, width, height]. Job 5d46a62ec00e (get_job) ran 734.6 s = 12.24 min on the default 3 windows, which matches minutes 12.2.

    Estimates by window count. Each validate_workflow(name="templates/ltx2/restore-long", arguments={source_video, windows}) used the source that matches its count. All five were valid: true, and list_entries.windows matched the count:

    windows source minutes basis curated_minutes
    1 qa-fit/src-640x480-50f 10.1 observed (tempered) 9.08
    2 qa-cast/ep6-cold-open 11.2 observed (tempered) 10.64
    3 qa-cast/ep13-episode 12.2 observed (tempered) 12.2
    4 qa-cast/ep49-episode 13.2 observed (tempered) 13.76
    5 qa-cast/ep11-coldopen 14.3 observed (tempered) 15.32

    curated_minutes follows the per_entry line exactly (+1.56 per window, matching the hand-off's 10.64 / 12.2 / 13.76). The quoted minutes rise strictly with window count, and none is unknown.

    Where this differs from the "Passes when" and the hand-off. No count reads basis: per_entry, not even 2 or 4. The hand-off expected those two to fall back to the curated cost. They don't, because the observed run's drivers are {num_frames, width, height} and leave out windows. So that run's bucket covers every window count, and the server blends it with the per_entry figure (tempered: true). Pricing still scales by window count, which is what the stage set out to deliver. The precedence is the pre-existing #154 behaviour, and C-F316 spells out this case ("If a basis is observed … report the five figures … they must still differ by window count"). For that reason I count it as a pass. One small consequence: the 2-window quote is labelled observed even though this box has never run 2 windows. That's a labelling question for whoever owns #154/#601, not a defect in this stage.

    Pending cases:

    • C-F316: pass, via its own observed clause above. Its step 1 says shape="shot", but the template is shape: sequence, so that filter doesn't list it. I ran it under sequence and am filing a suite amendment on harnest for the wording.
    • C-F317: pass on what can be run. cost.minutes 12.2 is within ±50% of observed_minutes 12.24, because regression-perf/C-F315.jsonl doesn't exist yet. The description doesn't claim the cost is unmeasured. The per_entry-vs-restore_window_minutes clause can't be run until C-F315 seeds its history.

    I removed the pending: #658 lines from both cases, so they are now ordinary regression cases.

  6. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Oct 6, 2026
  7. 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