Skip to content

Inherited cost estimate quoted unchanged when frame count differs: 7x under-quote on multi-shot Ref2VA #821

Closed

Description

@dkackman

Field report

validate_workflow quoted 7.8 min (basis: inherited, from templates/minimax/reference-to-video) for two multi-shot Ref2VA render jobs. Each actually took ~56 min per card, about 7× more. The plan reported differs: ['frame count'], but the minutes went out unchanged. Each job had 3-4 shots and 768-899 rendered frames, against the template's single 124-frame clip. An earlier run showed the same gap at about 2×.

Cause

  • inherited_observed (dw/server/deps.py:174) prices an inline workflow from the observed runs of the catalog template with the same pipeline identity. inherited_differences (dw/vram_inheritance.py:78) detects the frame-count difference, but it only goes into a warning (dw/server/routes/jobs.py:930). minutes is never adjusted.
  • Shot count is not counted. template_identity accepts any number of steps that share one identity, so 3-4 H3 steps are priced as one template run.
  • Frame count is not scaled. Driver values only carry over when the inline workflow uses the template's own variable names.

Scaling by frames would have been close: 899/124 ≈ 7.2 and 768/124 ≈ 6.2, against an actual 56/7.8 ≈ 7.2. Each shot is a separate generation, so cost grows roughly in line with total rendered frames. plan_cuts already returns render_frames "for quoting the cost".

Proposed fix

When an inherited estimate's differs includes frame count, or the workflow runs the identity in more than one step, do one of these:

Never quote the template's figure unchanged. Model loading is a fixed cost that doesn't grow with frames, so scaling the whole number linearly over-quotes slightly. That is the safe direction to be wrong in.

Acceptance

  • A multi-step inline H3 workflow totalling ~900 frames, priced against a 124-frame template, does not quote the template's minutes as they stand.
  • A test pins both the multi-step case and the single-step longer-num_frames case.

Activity

  1. added
    bugSomething isn't working
    priority:2Backlog rank: solid ROI, moderate scope
    field-reportFiled from Don's own dw sessions (real use), not the harness
    on Oct 11, 2026
  2. dkackman commented on Oct 11, 2026

    @dkackman
    OwnerAuthor

    triage: work — not fixed on develop @ 84fdf78 (#796's 8f23dea gates observed history only; the inherited basis still quotes template minutes unchanged). Fix scales or withholds it in the estimate path (dw/server/deps.py / dw/vram_inheritance.py / routes/jobs.py), no new surface. (triage by claude-opus-5-5 via anthropic)

  3. added a commit that references this issue on Oct 11, 2026
  4. dkackman commented on Oct 11, 2026

    @dkackman
    OwnerAuthor

    Fixed in bf65c85 on develop, deployed to lem (12:33, healthy). Model: claude-sonnet-5-5 via anthropic.

    Chose the withhold option. inherited_observed (dw/server/deps.py) now skips a template candidate when (a) the inline workflow has a different number of pipeline steps than the template (multi-shot), or (b) after applying the matched bucket's driver values, the inline frame count still differs from the template's (literal/renamed num_frames). With no candidate left the estimate comes back basis: unknown, not the template's minutes. A workflow that shares the template's driver variable (e.g. num_frames argument) still gets its exact bucket's figure, unchanged behavior.

    Not done: scaling by total rendered frames (basis: derived) — only withholding. Tests in tests/test_inherited_cost.py: 3-step inline vs 1-step template, literal 899 frames vs 124-frame template (both → no inherited figure), and shared-driver bucket still priced.

    To verify: validate_workflow on an inline multi-shot H3 Ref2VA workflow (3-4 shots, ~900 frames) should not show 7.8 min / basis inherited.

  5. dkackman commented on Oct 11, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (84fdf7859f..bf65c85410: dw/server/deps.py). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  6. dkackman commented on Oct 11, 2026

    @dkackman
    OwnerAuthor

    Architecture review: pass (reviewer, claude-opus-5-5 via anthropic).

    Read: git diff 84fdf785..bf65c854 -- dw/ dw_mcp/ (only dw/server/deps.py: _pipeline_steps, _scales_past_template, the skip in inherited_observed) against docs/ARCHITECTURE.md and stage-c-guardrails item 3.

    • Second owner: none. The change stays inside the owners that the Inherited cost row names. The frame-count test calls vram_inheritance.inherited_differences and doesn't re-derive it. _pipeline_steps uses the same "step with a pipeline dict" predicate as template_identity, but both modules belong to the same row, so no rule moved.
    • Build vs. buy: none. It's plain dict and step counting.
    • Map: no new module, and no rule moved between modules, so no row needed adding. Not blocking: the Inherited cost row's rule sentence doesn't yet say that a template is skipped (estimate withheld) when the step count or the frame count it is bucketed at differs. Its test column also doesn't cite the new tests/test_inherited_cost.py cases. That's worth a line at the next consolidation.
    • Context: the rationale is in a comment in deps.py and in _scales_past_template's docstring. No CLAUDE.md change.

    No arch-approved waiver was needed. The issue is back to the tester for verification.

  7. dkackman commented on Oct 11, 2026

    @dkackman
    OwnerAuthor

    Verified on lem (develop @ 264c9a1) by the tester, claude-opus-5-5 via anthropic.

    All calls were validate_workflow with an inline H3 Ref2VA workflow that has the same pipeline identity as templates/minimax/reference-to-video (124 frames, 960x544, 9 steps, observed 7.75 min over 33 runs):

    case steps × frames estimate
    control: 1 step, num_frames variable = 124 1 × 124 minutes: 7.8, basis: inherited, inherited_from: templates/minimax/reference-to-video, differs: [quantization]
    repro: multi-shot, shared num_frames variable = 294 3 × 294 = 882 minutes: null, basis: unknown
    longer single step, literal num_frames: 294 1 × 294 minutes: null, basis: unknown
    step count only: 2 steps at the template's 124 2 × 124 minutes: null, basis: unknown

    The control proves that the inline identity still inherits, so the unknown results come from the new skip and not from an identity mismatch. The template's minutes are no longer quoted unchanged for a multi-step workflow or a different frame count, which meets the acceptance. As the hand-off says, the fix withholds the figure rather than scaling it (basis: derived). The issue offered either option.

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

    backend:sharedbugSomething isn't workingfield-reportFiled from Don's own dw sessions (real use), not the harnessowner:testerTester's turn to actpriority:2Backlog rank: solid ROI, moderate scopestatus:verifiedTester confirmed the fix via a real MCP calltarget:lem

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions