You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vram_estimate does not account for guides, held audio or refine #694
Design follow-up (review 2026-10-07, structural item 4).Filed by Claude Fable 5.1 from the 2026-10-07 develop review and its fix branch (merged to develop as c32c48d).
Problem:dw/vram_estimate.py models references and the voxel variables only. Up to GUIDE_LIMIT (4) guides — each a VAE-encoded clip plus optional audio rows — held-audio rows and a refine pass add attention rows and encode memory the declared estimate never counts. GUIDE_LIMIT is documented as a VRAM guard (#648) but validate_workflow will not warn.
Build: measure on lem (3090): one H3 run per added input (1–4 guides at 22 and 39 frames with and without audio; hold_audio; refine_strength) and fit a gb_per_guide_frame / gb_per_held_second term; add the terms to the vram_estimate schema (dw/workflow_schema.json), required_vram_gb, and the chained-segments / hold-audio templates. If the terms are too small to matter at 24 GB, say so in the "Observed cost" map row instead and close.
Acceptance: a validate warning appears before an OOM for the largest guide/hold/refine combination the catalog allows on a 24 GB card.
Plan by claude-opus-5-5 (anthropic), design session 2026-10-08, against develop at c32c48d. v2 is from the Stage A build (#778), 2026-10-08: the measurements are in, and they change Stage A's acceptance and the shape of the term.
Verdict: build smaller
Add a guide term to vram_estimate: one key, measured in Stage A as the template's own bytes per voxel. Cut the hold_audio and refine terms. The code shows neither adds memory that the current formula misses (details under "Corrections").
Axis
Finding
Value
Guides are the one real gap. The only measurement (docs/proposals/complete/h3-guides-complete.md:101-111, 3090, 960×544×124) shows a 22→124-frame guide, or 1→4 guides, each adding about 1.25 GiB. At 4 × 124 frames the extrapolated peak is about 23.5 GiB at 544p, and the projection counts none of it. At 768p, or at frame counts where the plain projection already sits near 24, this is an OOM that validate passes. The users who gain are Don's driving sessions that build guided or chained shots: they work in custom workflows, and those get the term through the inherited-ceiling warning for free (dw/vram_inheritance.py:132-136 copies every estimate key).
Demand evidence
Weak but real. No field-report names a guide OOM (search: vram/OOM/guides/hold_audio/refine). The same class has been fixed piece by piece four times: #265 (frames), #324 (H3 ceilings), #479 (references, a field report: projected 22.5 GB, needed about 29), and #516/#552 (projection scope). Guides are the next input in that class, and WORKFLOW_GUIDE.md:1694 already tells users the limit of 4 is "a VRAM limit" that nothing enforces.
Build cost
Stage A $3–5 (GPU measurement on lem) plus Stage B $4–6, about $7–11 in total. Cutting hold and refine removes about 6 of the issue's measurement runs.
Inertia
Two optional schema keys. No new MCP or REST surface, and no tool-description text (the MCP line about inherited ceilings is unchanged). One more term in _formula and the refusal message. One field in tests/test_vram_inheritance.py::_ESTIMATE_FIELDS. A media probe on the run path and the admission path (see Q1), which is the largest new obligation. No security boundary changes.
Reversibility
Fully reversible. Both keys are optional, and removing them later only loosens a check: no data or names depend on them.
Cheaper alternatives
(a) Docs only: the "outside the estimate" note in WORKFLOW_GUIDE plus the minimax-h3 skill. This costs about $1, but validate still passes the OOM. (b) Warn whenever guides are present: a flat warning that guides sit outside the estimate. This is cheap, but it fires on the 1 × 22 case that clearly fits, so drivers learn to ignore it. (c) Lower GUIDE_LIMIT to 3: a blunt cap that does not track frames or canvas, which are what actually cost memory. Recommendation: (a) is folded into Stage B regardless. If Stage A shows the guide cost is negligible at the largest canvas the catalog allows, the feature ends at A with (a), the exit the issue itself names.
Overlap
#693 (splits dw/server/jobs.py, currently in plan review) touches the dispatch plumbing next to admission.py. Stage B changes only _vram_need's input and leaves jobs.py alone, so it does not depend on #693. Whichever lands second rebases.
Problem and non-goals
Problem: H3 guides (up to 4 clips, each VAE-encoded on the target canvas and spliced in as condition rows, plus audio rows when "audio": true) add memory that required_gb never counts. The same applies to the guide a continuity: "guide" chain appends to every segment after the first (dw/pipeline_processors/chain.py:187-189). As a result validate_workflow, the run-time backstop and the worker-pool dispatcher all under-project a guided step.
Non-goals:
terms for hold_audio and refine_strength (cut, see below);
re-calibrating base_gb or bytes_per_voxel;
MPS calibration (the existing caveat, "an estimate of an estimate", stands);
LTX-2.5 refine pipelines (a different pipeline that declares no estimate).
Corrections to the issue
hold_audio adds no rows. It is cut or padded to the target's own num_audio_latents and overwrites rows that are already allocated (h3_blocks.py:192-233, :302-330). Its marginal cost is one audio-VAE encode of the target's length, which happens before denoising and is freed afterwards. Cut. Evidence that would bring it back: a hold run that OOMs while its plain projection passed.
refine_strength is not a second pass. It is a separate step that restarts the schedule at σ = strength (h3_blocks.py:93-152, :394-452). Its own width × height × num_frames is projected like any other step's, and the stage record says it "saves no VRAM" and costs none extra (h3-audio-hold-refine-complete.md:141-144). Cut, on the same reopen condition.
The term is per guide voxel, not per guide frame. Guides are encoded on the target canvas, so their cost scales with width × height as well as frames. A per-frame GB constant would be wrong at 768p.
Stage A measured it (docs/proposals/h3-guide-vram.md on feat/694-A-guide-vram, 14 runs on lem's 3090):
The value: charging guide voxels at the template's own 28.71 B separates every OOM from every completed run, with no per-clip constant. Every OOM projects above 24 GiB, every completed run below it, and every uncensored row projects at or above its measured peak. The separating range is 27.7–35.9 B.
Not a two-term least-squares fit: that form (80 B plus 0.18 GiB per clip over the 0-guide peak) misses the 768p rows by about 1.5 GiB. The peak pool grows in steps, and the plain projection is a ceiling that sits 1–5.6 GiB above the 0-guide peaks.
No audio term: guide audio has no measurable cost.
The guide chain's own guide. It exists only at run time inside the chain loop. The projection must count it from the step's chain block (continuity: "guide", whose guide_frames is 22 or 39 and known statically), or a chained workflow with 3 guides of its own is projected as 3 when it actually runs with 4.
No template uses guides, hold or refine today.minimax/chained-segments.json (the guide-chain template) declares no vram_estimate and no cost at all. So "add the terms to the chained-segments / hold-audio templates" really means: give chained-segments.json an estimate, and put the guide terms on every H3 t2va/fl2va template's estimate. _ESTIMATE_FIELDS requires one pipeline's templates to agree, and custom workflows inherit the terms from those templates. Ref2VA templates get none, because guides are refused with ref2va (dw/guides.py:97-114).
The acceptance criterion says "warning", but a declared estimate refuses. A template's own vram_estimate is an error at validate (dw/validation.py:358-369), a ValueError at run (dw/workflow_run.py:317) and a hard need at dispatch. Only the inherited path warns. The new term follows whichever path it sits on, so a custom guided workflow warns and a template refuses.
The design
Schema (dw/workflow_schema.json:71-89, which has additionalProperties: false): one optional key on vram_estimate, bytes_per_guide_voxel (number ≥ 0). It is multiplied by Σ over the step's guides of (guide latent-snapped frames × width × height). The H3 templates set it to their bytes_per_voxel, 28.71.
gb_per_guide and gb_per_guide_audio are dropped: Stage A measured no per-clip or guide-audio cost. An absent key adds nothing, so every current estimate is unchanged.
Engine (dw/vram_estimate.py):
required_gb(estimate, values, references=0, guides=()) adds the term. guides is a list of snapped frame counts.
_projections builds that list from the step's guides (entries with a null video are dropped, as references are) plus the chain-appended guide when the step's chain.continuity == "guide".
Each clip's frame count comes from a probe (dw/guides.py::_clip_frames, snapped by snap_guide_length). A clip that cannot be probed (a previous_result: value, an unreadable header) is charged at the step's own num_frames, the most a guide can hold.
_formula and the refusal message name the guides ("… with 3 guides (22+22+124 frames) projects to …").
Call sites (see Q1): validate passes its memoized ValidationContext.probe. Admission (dw/server/admission.py:219-233) passes the context's probe it already has. The run path (dw/workflow_run.py:311-322) gets a header-only probe, so all three answer the same number.
Templates:bytes_per_guide_voxel: 28.71 goes on every H3 t2va/fl2va template's estimate. chained-segments.json gets a cost entry and a vram_estimate (the existing H3 t2va numbers plus the guide key).
Docs:
WORKFLOW_GUIDE.md:469-483 (the formula);
WORKFLOW_GUIDE.md:1694 (the limit of 4 is now checked against the card);
the ARCHITECTURE projection row (:93-95);
the measurement record, docs/proposals/h3-guide-vram.md (already written, merged with Stage A);
the minimax-h3 skill's guides line, which gets one clause (the ceiling drops with each guide, as it already says for references).
MCP/REST/syntax surface: schema keys only. No tool, route or description changes.
Guide sets: 0, 1, 2 and 4 guides at 22 frames; 1 and 4 at 124; 1 × 39 with and without "audio": true.
The near-top frame counts v1 asked for filled the card with no guides, so they couldn't show a guide delta; they are listed as superseded.
The peak is nvidia-smi memory.used during denoise and decode. The engine records no max_memory_reserved.
Two 768 rows filled the card and still completed. They are recorded as censored (≥ 23.55).
Owes:docs/proposals/h3-guide-vram.md, holding the table with job ids, the least-squares fit and its residuals, the check of the chosen term, the audio delta, and the exit verdict. The next build session merges the branch to develop. No code.
Exit: not met. At 28.71 B the term adds 13.7 GiB at 4 × 124 on 1344×768, so the feature continues to Stage B.
Deploy: none.
Acceptance intent (v2, changed): no code changes, so the tester checks the record:
every listed run exists in list_jobs on lem, with its job id in the table;
every completed run has the status and frame count the table states, and each OOM run failed with an out-of-memory error;
plain projection + 28.71 B × guide voxels reproduces the doc's projection column. Each projection is ≥ its uncensored measured peak, is > 24 GiB for each OOM row, and is < 24 GiB for each completed row.
This replaces v1's "the fit reproduces each row within 0.5 GB", which no two-term additive fit can meet on this data (the doc shows the residuals).
Stage B: the guide term, wired through validate, run and dispatch
Builds: the schema key, required_gb/_projections/_formula/message, the probe at the three call sites, the template numbers, an estimate for chained-segments.json, and the docs above.
Unit tests:
absent keys leave every projection unchanged;
guide voxels scale with the canvas;
a null-video guide costs nothing;
an unprobeable guide is charged at num_frames;
a chain with continuity: "guide" counts one extra guide;
validate, apply_vram_estimate and required_vram_gb agree on the same guided definition;
_ESTIMATE_FIELDS gains the new key;
test_every_template_with_vram_estimate_validates_clean_at_its_defaults still passes, including chained-segments.
Deploy: server (engine plus templates). Needs a restart on lem.
Estimate: $4–6 (one key instead of two saves little).
Acceptance intent (over MCP, on lem):
A custom H3 t2va workflow (no estimate of its own) at the largest canvas, at a frame count that validates clean with no guides, gets a vram_projection_inheritedwarning once it carries 4 longest-length guide assets. The warning names guides and their frame counts in the formula. The same workflow with 1 × 22 guide stays clean.
The same guided shape submitted through a template that declares the estimate (chained-segments with 3 own guides plus the chain guide, at its largest allowed frames) is refused at validate_workflow, refused at run_workflow without validating first, and the refusal names 4 guides. Cutting to 1 own guide makes it valid.
A guide given as previous_result: validates against the worst case (charged at the step's num_frames), and the message says so.
The guide in the original acceptance criterion, the largest combination the catalog allows on 24 GB, is flagged by validate before any GPU time. The tester may run that combination once to confirm it would OOM, but this is optional and costs GPU time.
Order, dependencies, risks
Order: A then B. B uses A's numbers, and A's exit can cancel B.
Over-refusal. A hard refusal built on 14 points can refuse a template run that would have fit. Mitigation: 28.71 is the bottom of the range that separates the outcomes (27.7–35.9). On this data it refuses only the two OOMs. The thinnest margin is 768 2×22, at +0.05 GiB of pool peak.
A probe on the run path. It adds a header read per guide clip before queueing. It is cheap, but it is a new I/O point on that path, and it uses the same validated paths guides_errors already probes, so it is not a new trust surface.
Stage A on a busy lem. Measurement runs queue behind real work, so schedule them while the queue is idle.
Questions
Q1: where the guide's frame count comes from. Default: probe at validate, run and admission (identical answers, at the cost of a header read on the run path). Alternative: charge every guide at the step's num_frames everywhere, with no probe. That is simpler, but it over-projects short guides by up to about 5 GB at 768p and would refuse runs that fit. If you pick it, Stage B shrinks by about $1, and the message says "worst case".
Q2: cutting hold_audio and refine. Default: cut both on the code evidence above. If you want them measured anyway, Stage A gains about 4 runs (+$1) and a third key may follow.
Q3: giving chained-segments.json a cost and vram_estimate. Default: yes, because it is the only template where guides happen without the author writing them. If you say no, the chain's guide is still counted for custom chained workflows (warning only), and the template stays unchecked as it is today.
Reply in comments and hand back with owner:lead. Approve by adding status:plan-approved yourself. No agent may set it.
Plan v1 approved (Don), with the defaults. Q1: probe each guide's frame count at validate, run and admission. Q2: cut the hold_audio and refine terms. Q3: yes, give chained-segments.json a cost and a vram_estimate. The tester verifies the docs-only stage A by checking the record, as the plan proposes. Stage A's exit rule (< 0.5 GB → stop and return as v2) stands. Order is A then B.
Spec for plan v2, tester session (claude-opus-5-5 via anthropic). Both stages were reshaped, so both are respecced. All cases are in regression-suite-model-specific.md, and each carries pending: #<stage>. I can't rewrite the v1 cases (M-F104–M-F112), so the v2 cases are new IDs. dkackman/harnest#92 asks the curator to retire the v1 ones: they assert the dropped gb_per_guide and the 0.5 GB fit.
M-F117. Every cited job exists in list_jobs, and its resolved workflow and status (completed, or failed with a CUDA OOM) match its row. The plan's point set is covered at 124 frames on both canvases, or the record states why a point is missing. Plain projection plus 28.71 B × guide voxels reproduces the projection column. Each OOM row projects above 24 GiB, each completed row (censored included) below it, and each uncensored row at or above its peak. 28.71 lies inside the stated separating range. The record states the deviations, the audio delta and the residuals. The exit verdict is "not met" (about 13.7 GiB).
#779, stage B: the guide term through validate, run and dispatch
M-F118: the schema. bytes_per_guide_voxel is optional and ≥ 0. A negative, a string or null is refused. Absent and 0 equal no guides. The dropped gb_per_guide/gb_per_guide_audio are refused as unknown keys.
M-F119: a custom 768p t2va with no estimate, at 1344×768×277. It is clean with no guides and with 1 × 22. With 4 × 124 it gets one vram_projection_inherited warning naming "4 guides (124+…)", never an error, at the plain projection + 13.69 GiB. audio: true doesn't change the GB. A null-video guide is either refused or costs nothing.
M-F120: a 30-frame clip is charged as 22. The term scales with the canvas (960×544 is 0.506 of 1344×768). The declared template gives an error, not a warning. The plain declared projection is unchanged.
M-F121: a previous_result: guide is charged at num_frames (277 → 7.64 GiB), and the message says "worst case". That is an error when the estimate is declared and a warning when it is inherited.
M-F122: chained-segments gains cost and vram_estimate (with the key). Three own guides plus the 39-frame chain guide at 345 frames are refused at validate_workflow and at run_workflow without validating first, with the same message naming 4 guides, and no job is created. One own guide is valid. continuity: "last_frame" counts no chain guide. If the refusal doesn't happen at 960×544, it must happen at 1344×768.
M-F123: every minimax template validates at its defaults. Each t2va/fl2va estimate carries bytes_per_guide_voxel equal to its bytes_per_voxel, ref2va estimates don't, and no dropped key appears. Default projections are unchanged.
M-F124: the served formula text (guide term, probe, worst case, chain guide, declared refuses / inherited warns), the guides section's 4-limit line, and the minimax-h3 skill's guides line.
M-F125: the largest combination is 1344×768, the largest clean length, and 4 of the longest allowed guides with audio. It is refused at validate when the estimate is declared and warned when inherited. An optional paid OOM confirmation is included.
Notes. None of these blocks a stage.
Where M-F117 reads the record.list_guides() on lem today serves no docs/proposals/ file. Unless that changes, #694 stage A: measure guide memory on lem (docs only) #778's hand-off comment must quote the table (with job ids, guide sets, canvas, peak, projection and outcome), the fit and residuals, the separating range and the exit verdict verbatim. Otherwise a consumer can't check the stage.
The null-video guide. The plan's unit tests say a null-video guide costs nothing, but today's guides section defines no null-video form. M-F119 step 5 therefore accepts either a refusal with the existing message or a zero-cost guide.
Units. The plan's numbers are in GiB, while today's VRAM messages say "GB". Each case gives both conversions, and the runner compares in whichever unit the message's formula uses. If stage B's message labels GiB values as "GB", that is worth fixing in the build.
Closed:#778 (stage A, the measurement record, develop @ acde06e9) and #779 (stage B, bytes_per_guide_voxel through validate, admission and run, develop @ bc0b19b5).
Design record:docs/proposals/complete/h3-guide-vram-complete.md, merged to develop as fec3f0d3 (commit 41a41922, branch docs/694-closeout). Docs only, no deploy. It covers the v1→v2 change, what was built, the deviations (chained-segments became the inherited fl2va ceiling), what was cut or deferred with reopen triggers (hold_audio/refine terms, calibration margins, the run-time asset-path seam, MPS), and bounces per stage. The stage comments name no usage: figures, so cost isn't recorded. The Stage A measurement record stays at docs/proposals/h3-guide-vram.md because dw/vram_estimate.py cites it; it now links the design record. todo.md lists the feature under Shipped since the ranking.
verify: run every case whose source: names one of this feature's stages, and close the parent if they all pass. These are M-F117–M-F125. The v1 cases M-F104–M-F112 are superseded and pending retirement (dkackman/harnest#92).
Tester verify pass for #694's stage cases, lem on develop @ 8826b03. Ran as claude-opus-5-5 via anthropic. Every call went over MCP in workspace regression-model-specific.
Outcome: not closed yet. M-F117–M-F122, M-F124 and M-F125 pass. M-F123's full catalog sweep did not fit in this session's budget; only part of it ran (details below). Nothing has failed, so this is not bounced. The next verify session only needs to finish M-F123.
Case
Result
What ran
M-F117
pass
Job 24efcc4da549's OOM confirmed against the projection.
M-F118
pass
Ran as written.
M-F119
pass at 260 frames
At 1344×768 the declared plain projection at 277 is now 23.94 GB, over the 23.6 ceiling. Following the case's step 1, I used 260, the largest clean 17n+5 (plain 23.48). s1 clean. s2 (one 22-frame guide) warns at 24.08 (inherited ceiling 24). s3/s4 warn at 37.16 GB, "4 guides (124+124+124+124 frames)". audio:true gives the same GB. s5 (one null video) gives "3 guides (124+124+124)", 33.74.
M-F120
pass
22-frame and 30-frame clips both give 34.35 GB, "124+124+124+22", so the 30-frame clip snapped to 22. Inline NT 960×544×345 with 4×124 guides: warning at 28.04 GB. Declared copy: valid:false at 37.16 with the guides named. With no guides it is valid and silent.
M-F121
pass
previous_result:clip guide (a loop_frames step) at 260: error at 30.65 GB, "1 guide (260 frames; 1 not probeable before the run, so charged at num_frames - the worst case)". Inherited copy: warning at 30.65. Same guide plus three 124-frame guides: error at 40.92 GB. At 124 frames with one more 124-frame guide: error at 26.57 GB. All say "worst case".
M-F122
pass
get_workflow templates/minimax/chained-segments has bytes_per_guide_voxel: 28.71. Inline CS3 (continuity:"guide", guide_frames 39, num_frames 345, 3×124 guides): valid:false at 26.86 GB, "4 guides (124+124+124+39 frames)". The same with last_frame: 3 guides, 26.31 GB. CS1 valid. run_workflow for CS3 with acknowledged_cost was refused before queueing ("This job needs 26.9 GB of VRAM … (23.6 GB usable)"). list_jobs' newest job was unchanged before and after, so no job was created.
M-F123
partial
validate_workflow at defaults returns valid:true with no VRAM error for templates/minimax/chained-segments and templates/minimax/reference-to-video. chained-segments' estimate has bytes_per_guide_voxel = bytes_per_voxel = 28.71 (via get_workflow, under M-F122). Not yet run: the per-template sweep of every other templates/minimax/* name; the check that no ref2va template carries the key; the check that no estimate has gb_per_guide.
M-F124
pass
get_guide("workflows", section="Authoring a workflow from an agent") gives the formula as bytes_per_guide_voxel × each guide's snapped frames × canvas. It also covers: - probing at validate, admission and run, with an unprobeable previous_result: guide charged at num_frames as the worst case; - the continuity:"guide" carry (22 or 39) counting as a guide; - declared estimates refusing while inherited ones warn. It names no gb_per_guide. An absent key adding nothing is implied by "plus", not stated outright. The "H3: holding a clip with guides" count row says each guide's frames are charged by the template's vram_estimate. The minimax-h3 skill says "the VRAM ceiling charges each guide's frames on the canvas".
M-F125
pass
260 frames with 4×124 guides: declared copy errors at 37.16 GB, inherited copy (audio:true) warns at 37.16. The guide's clip-length row caps a guide at 124 frames, so nothing longer exists to test.
Wording problems in the cases, none of them product failures. I'll file them as one suite request on dkackman/harnest:
At 1344×768, 277 frames is no longer clean (23.94 > 23.6), so M-F119, M-F120, M-F121 and M-F125 should say 260.
Guide frames 51/102/153 don't fit at 260 ("runs to frame 277, past the end"). 0/34/85/136 do.
The inherited ceiling's warning names templates/minimax/shots-batch as the source template, not video-with-audio-768p; the numbers are the same.
M-F119 s2's 24.08 against 24 is a thin margin.
M-F122's refused run comes back as a tool error, not a status:failed / run_id:null result.
Nothing was saved this session, so there is nothing to clean up.
Verified by tester, claude-opus-5-5 via anthropic, against lem on develop @ c0d1c0b.
Feature-parent close-out. Both stages (#778, #779) are closed. The acceptance is every case whose source: names them: M-F117 to M-F125.
M-F117 to M-F122, M-F124, M-F125: passed in the previous verify session (develop @ 8826b03). That record is on this issue.
M-F123 (catalog sweep, partial last time): completed this session. I called validate_workflow at defaults (workspace regression-model-specific) on all 22 templates/minimax/* and get_workflow on each.
t2va with an estimate (video-with-audio, video-with-audio-768p, shots-batch, chained-segments, enhance-prompt): bytes_per_guide_voxel 28.71 equals bytes_per_voxel 28.71 in each ✓
ref2va-only (reference-to-video, chain-matched-and-aligned, chain-matched-to-audio, chain-video-continuity, composable-references, dialogue-short, generated-subject-reference, music-video, storyboard, voice-timbre-reference): gb_per_reference 1.0, with no bytes_per_guide_voxel ✓
fl2va with no vram_estimate (image-to-video, first-and-last-frame, last-frame-only, enhance-prompt-with-image): nothing to check under the case's "with a vram_estimate" wording.
No validate carried a VRAM warning or error, and every H3 template is valid: true at defaults ✓
Two observations outside this feature:
music-video-cuts is valid: false at defaults: "Asset 'song.wav' not found in the asset library (workspace, common, examples)" at variables.song. It is a utility template (transcribe/beats/plan_cuts) with no H3 step and no estimate. This is a missing input asset, not a VRAM regression, so I'm not counting it against vram_estimate does not account for guides, held audio or refine #694. I'm filing a suite request on harnest to scope M-F123's "every template" wording.
Transient validate failures under parallel calls: a few validate_workflow calls run about 6 at a time intermittently returned check 'component_types' failed (RuntimeError) and passed on retry. Filed separately.
Activity
dkackman commentedon Oct 8, 2026
Plan v2: #694, guides in the H3 VRAM estimate
Plan by
claude-opus-5-5(anthropic), design session 2026-10-08, againstdevelopat c32c48d. v2 is from the Stage A build (#778), 2026-10-08: the measurements are in, and they change Stage A's acceptance and the shape of the term.Verdict: build smaller
Add a guide term to
vram_estimate: one key, measured in Stage A as the template's own bytes per voxel. Cut thehold_audioandrefineterms. The code shows neither adds memory that the current formula misses (details under "Corrections").docs/proposals/complete/h3-guides-complete.md:101-111, 3090, 960×544×124) shows a 22→124-frame guide, or 1→4 guides, each adding about 1.25 GiB. At 4 × 124 frames the extrapolated peak is about 23.5 GiB at 544p, and the projection counts none of it. At 768p, or at frame counts where the plain projection already sits near 24, this is an OOM thatvalidatepasses. The users who gain are Don's driving sessions that build guided or chained shots: they work in custom workflows, and those get the term through the inherited-ceiling warning for free (dw/vram_inheritance.py:132-136copies every estimate key).field-reportnames a guide OOM (search: vram/OOM/guides/hold_audio/refine). The same class has been fixed piece by piece four times: #265 (frames), #324 (H3 ceilings), #479 (references, a field report: projected 22.5 GB, needed about 29), and #516/#552 (projection scope). Guides are the next input in that class, andWORKFLOW_GUIDE.md:1694already tells users the limit of 4 is "a VRAM limit" that nothing enforces._formulaand the refusal message. One field intests/test_vram_inheritance.py::_ESTIMATE_FIELDS. A media probe on the run path and the admission path (see Q1), which is the largest new obligation. No security boundary changes.GUIDE_LIMITto 3: a blunt cap that does not track frames or canvas, which are what actually cost memory. Recommendation: (a) is folded into Stage B regardless. If Stage A shows the guide cost is negligible at the largest canvas the catalog allows, the feature ends at A with (a), the exit the issue itself names.dw/server/jobs.py, currently in plan review) touches the dispatch plumbing next toadmission.py. Stage B changes only_vram_need's input and leavesjobs.pyalone, so it does not depend on #693. Whichever lands second rebases.Problem and non-goals
Problem: H3
guides(up to 4 clips, each VAE-encoded on the target canvas and spliced in as condition rows, plus audio rows when"audio": true) add memory thatrequired_gbnever counts. The same applies to the guide acontinuity: "guide"chain appends to every segment after the first (dw/pipeline_processors/chain.py:187-189). As a resultvalidate_workflow, the run-time backstop and the worker-pool dispatcher all under-project a guided step.Non-goals:
hold_audioandrefine_strength(cut, see below);base_gborbytes_per_voxel;Corrections to the issue
hold_audioadds no rows. It is cut or padded to the target's ownnum_audio_latentsand overwrites rows that are already allocated (h3_blocks.py:192-233,:302-330). Its marginal cost is one audio-VAE encode of the target's length, which happens before denoising and is freed afterwards. Cut. Evidence that would bring it back: a hold run that OOMs while its plain projection passed.refine_strengthis not a second pass. It is a separate step that restarts the schedule at σ = strength (h3_blocks.py:93-152,:394-452). Its ownwidth × height × num_framesis projected like any other step's, and the stage record says it "saves no VRAM" and costs none extra (h3-audio-hold-refine-complete.md:141-144). Cut, on the same reopen condition.The term is per guide voxel, not per guide frame. Guides are encoded on the target canvas, so their cost scales with
width × heightas well as frames. A per-frame GB constant would be wrong at 768p.Stage A measured it (
docs/proposals/h3-guide-vram.mdonfeat/694-A-guide-vram, 14 runs on lem's 3090):The guide chain's own guide. It exists only at run time inside the chain loop. The projection must count it from the step's
chainblock (continuity: "guide", whoseguide_framesis 22 or 39 and known statically), or a chained workflow with 3 guides of its own is projected as 3 when it actually runs with 4.No template uses guides, hold or refine today.
minimax/chained-segments.json(the guide-chain template) declares novram_estimateand nocostat all. So "add the terms to the chained-segments / hold-audio templates" really means: givechained-segments.jsonan estimate, and put the guide terms on every H3 t2va/fl2va template's estimate._ESTIMATE_FIELDSrequires one pipeline's templates to agree, and custom workflows inherit the terms from those templates. Ref2VA templates get none, because guides are refused with ref2va (dw/guides.py:97-114).The acceptance criterion says "warning", but a declared estimate refuses. A template's own
vram_estimateis an error at validate (dw/validation.py:358-369), aValueErrorat run (dw/workflow_run.py:317) and a hard need at dispatch. Only the inherited path warns. The new term follows whichever path it sits on, so a custom guided workflow warns and a template refuses.The design
Schema (
dw/workflow_schema.json:71-89, which hasadditionalProperties: false): one optional key onvram_estimate,bytes_per_guide_voxel(number ≥ 0). It is multiplied by Σ over the step's guides of (guide latent-snapped frames ×width×height). The H3 templates set it to theirbytes_per_voxel, 28.71.gb_per_guideandgb_per_guide_audioare dropped: Stage A measured no per-clip or guide-audio cost. An absent key adds nothing, so every current estimate is unchanged.Engine (
dw/vram_estimate.py):required_gb(estimate, values, references=0, guides=())adds the term.guidesis a list of snapped frame counts._projectionsbuilds that list from the step'sguides(entries with a null video are dropped, as references are) plus the chain-appended guide when the step'schain.continuity == "guide".dw/guides.py::_clip_frames, snapped bysnap_guide_length). A clip that cannot be probed (aprevious_result:value, an unreadable header) is charged at the step's ownnum_frames, the most a guide can hold._formulaand the refusal message name the guides ("… with 3 guides (22+22+124 frames) projects to …").Call sites (see Q1):
validatepasses its memoizedValidationContext.probe. Admission (dw/server/admission.py:219-233) passes the context's probe it already has. The run path (dw/workflow_run.py:311-322) gets a header-only probe, so all three answer the same number.Templates:
bytes_per_guide_voxel: 28.71goes on every H3 t2va/fl2va template's estimate.chained-segments.jsongets acostentry and avram_estimate(the existing H3 t2va numbers plus the guide key).Docs:
WORKFLOW_GUIDE.md:469-483(the formula);WORKFLOW_GUIDE.md:1694(the limit of 4 is now checked against the card);:93-95);docs/proposals/h3-guide-vram.md(already written, merged with Stage A);minimax-h3skill's guides line, which gets one clause (the ceiling drops with each guide, as it already says for references).MCP/REST/syntax surface: schema keys only. No tool, route or description changes.
Stages
Stage A: measure guide memory on lem (docs only) — measured
Built (#694 stage A: measure guide memory on lem (docs only) #778, on
feat/694-A-guide-vram@ 38b3eb5, not yet merged): 14 H3 t2va runs on the 3090 at 960×544 and 1344×768, all at 124 frames."audio": true.nvidia-smi memory.usedduring denoise and decode. The engine records nomax_memory_reserved.Owes:
docs/proposals/h3-guide-vram.md, holding the table with job ids, the least-squares fit and its residuals, the check of the chosen term, the audio delta, and the exit verdict. The next build session merges the branch todevelop. No code.Exit: not met. At 28.71 B the term adds 13.7 GiB at 4 × 124 on 1344×768, so the feature continues to Stage B.
Deploy: none.
Acceptance intent (v2, changed): no code changes, so the tester checks the record:
list_jobson lem, with its job id in the table;plain projection + 28.71 B × guide voxelsreproduces the doc's projection column. Each projection is ≥ its uncensored measured peak, is > 24 GiB for each OOM row, and is < 24 GiB for each completed row.This replaces v1's "the fit reproduces each row within 0.5 GB", which no two-term additive fit can meet on this data (the doc shows the residuals).
Stage B: the guide term, wired through validate, run and dispatch
required_gb/_projections/_formula/message, the probe at the three call sites, the template numbers, an estimate forchained-segments.json, and the docs above.num_frames;continuity: "guide"counts one extra guide;apply_vram_estimateandrequired_vram_gbagree on the same guided definition;_ESTIMATE_FIELDSgains the new key;test_every_template_with_vram_estimate_validates_clean_at_its_defaultsstill passes, includingchained-segments.vram_projection_inheritedwarning once it carries 4 longest-length guide assets. The warning names guides and their frame counts in the formula. The same workflow with 1 × 22 guide stays clean.chained-segmentswith 3 own guides plus the chain guide, at its largest allowed frames) is refused atvalidate_workflow, refused atrun_workflowwithout validating first, and the refusal names 4 guides. Cutting to 1 own guide makes it valid.previous_result:validates against the worst case (charged at the step'snum_frames), and the message says so.Order, dependencies, risks
guides_errorsalready probes, so it is not a new trust surface.Questions
num_frameseverywhere, with no probe. That is simpler, but it over-projects short guides by up to about 5 GB at 768p and would refuse runs that fit. If you pick it, Stage B shrinks by about $1, and the message says "worst case".hold_audioand refine. Default: cut both on the code evidence above. If you want them measured anyway, Stage A gains about 4 runs (+$1) and a third key may follow.chained-segments.jsonacostandvram_estimate. Default: yes, because it is the only template where guides happen without the author writing them. If you say no, the chain's guide is still counted for custom chained workflows (warning only), and the template stays unchecked as it is today.Reply in comments and hand back with
owner:lead. Approve by addingstatus:plan-approvedyourself. No agent may set it.dkackman commentedon Oct 8, 2026
Plan v1 approved (Don), with the defaults. Q1: probe each guide's frame count at validate, run and admission. Q2: cut the
hold_audioand refine terms. Q3: yes, givechained-segments.jsonacostand avram_estimate. The tester verifies the docs-only stage A by checking the record, as the plan proposes. Stage A's exit rule (< 0.5 GB → stop and return as v2) stands. Order is A then B.24 remaining items
dkackman commentedon Oct 8, 2026
Spec for plan v2, tester session (claude-opus-5-5 via anthropic). Both stages were reshaped, so both are respecced. All cases are in
regression-suite-model-specific.md, and each carriespending: #<stage>. I can't rewrite the v1 cases (M-F104–M-F112), so the v2 cases are new IDs. dkackman/harnest#92 asks the curator to retire the v1 ones: they assert the droppedgb_per_guideand the 0.5 GB fit.#778, stage A: the measurement record
list_jobs, and its resolved workflow and status (completed, or failed with a CUDA OOM) match its row. The plan's point set is covered at 124 frames on both canvases, or the record states why a point is missing. Plain projection plus 28.71 B × guide voxels reproduces the projection column. Each OOM row projects above 24 GiB, each completed row (censored included) below it, and each uncensored row at or above its peak. 28.71 lies inside the stated separating range. The record states the deviations, the audio delta and the residuals. The exit verdict is "not met" (about 13.7 GiB).#779, stage B: the guide term through validate, run and dispatch
bytes_per_guide_voxelis optional and ≥ 0. A negative, a string or null is refused. Absent and 0 equal no guides. The droppedgb_per_guide/gb_per_guide_audioare refused as unknown keys.vram_projection_inheritedwarning naming "4 guides (124+…)", never an error, at the plain projection + 13.69 GiB.audio: truedoesn't change the GB. A null-video guide is either refused or costs nothing.previous_result:guide is charged atnum_frames(277 → 7.64 GiB), and the message says "worst case". That is an error when the estimate is declared and a warning when it is inherited.chained-segmentsgainscostandvram_estimate(with the key). Three own guides plus the 39-frame chain guide at 345 frames are refused atvalidate_workflowand atrun_workflowwithout validating first, with the same message naming 4 guides, and no job is created. One own guide is valid.continuity: "last_frame"counts no chain guide. If the refusal doesn't happen at 960×544, it must happen at 1344×768.bytes_per_guide_voxelequal to itsbytes_per_voxel, ref2va estimates don't, and no dropped key appears. Default projections are unchanged.Notes. None of these blocks a stage.
list_guides()on lem today serves nodocs/proposals/file. Unless that changes, #694 stage A: measure guide memory on lem (docs only) #778's hand-off comment must quote the table (with job ids, guide sets, canvas, peak, projection and outcome), the fit and residuals, the separating range and the exit verdict verbatim. Otherwise a consumer can't check the stage.videoform. M-F119 step 5 therefore accepts either a refusal with the existing message or a zero-cost guide.Merge docs/694-closeout (#694)
dkackman commentedon Oct 8, 2026
Lead,
claude-opus-5-5(anthropic). Close-out session, 2026-10-08.Closed: #778 (stage A, the measurement record,
develop@acde06e9) and #779 (stage B,bytes_per_guide_voxelthrough validate, admission and run,develop@bc0b19b5).Design record:
docs/proposals/complete/h3-guide-vram-complete.md, merged todevelopasfec3f0d3(commit41a41922, branchdocs/694-closeout). Docs only, no deploy. It covers the v1→v2 change, what was built, the deviations (chained-segments became the inherited fl2va ceiling), what was cut or deferred with reopen triggers (hold_audio/refine terms, calibration margins, the run-time asset-path seam, MPS), and bounces per stage. The stage comments name nousage:figures, so cost isn't recorded. The Stage A measurement record stays atdocs/proposals/h3-guide-vram.mdbecausedw/vram_estimate.pycites it; it now links the design record.todo.mdlists the feature under Shipped since the ranking.verify: run every case whose
source:names one of this feature's stages, and close the parent if they all pass. These are M-F117–M-F125. The v1 cases M-F104–M-F112 are superseded and pending retirement (dkackman/harnest#92).dkackman commentedon Oct 8, 2026
Tester verify pass for #694's stage cases, lem on
develop@ 8826b03. Ran as claude-opus-5-5 via anthropic. Every call went over MCP in workspaceregression-model-specific.Outcome: not closed yet. M-F117–M-F122, M-F124 and M-F125 pass. M-F123's full catalog sweep did not fit in this session's budget; only part of it ran (details below). Nothing has failed, so this is not bounced. The next verify session only needs to finish M-F123.
17n+5(plain 23.48).s1 clean.
s2 (one 22-frame guide) warns at 24.08 (inherited ceiling 24).
s3/s4 warn at 37.16 GB, "4 guides (124+124+124+124 frames)".
audio:truegives the same GB.s5 (one null video) gives "3 guides (124+124+124)", 33.74.
Inline NT 960×544×345 with 4×124 guides: warning at 28.04 GB.
Declared copy:
valid:falseat 37.16 with the guides named. With no guides it is valid and silent.previous_result:clipguide (aloop_framesstep) at 260: error at 30.65 GB, "1 guide (260 frames; 1 not probeable before the run, so charged at num_frames - the worst case)".Inherited copy: warning at 30.65.
Same guide plus three 124-frame guides: error at 40.92 GB.
At 124 frames with one more 124-frame guide: error at 26.57 GB. All say "worst case".
get_workflow templates/minimax/chained-segmentshasbytes_per_guide_voxel: 28.71.Inline CS3 (
continuity:"guide",guide_frames39,num_frames345, 3×124 guides):valid:falseat 26.86 GB, "4 guides (124+124+124+39 frames)".The same with
last_frame: 3 guides, 26.31 GB. CS1 valid.run_workflowfor CS3 withacknowledged_costwas refused before queueing ("This job needs 26.9 GB of VRAM … (23.6 GB usable)").list_jobs' newest job was unchanged before and after, so no job was created.validate_workflowat defaults returnsvalid:truewith no VRAM error fortemplates/minimax/chained-segmentsandtemplates/minimax/reference-to-video.chained-segments' estimate hasbytes_per_guide_voxel=bytes_per_voxel= 28.71 (viaget_workflow, under M-F122).Not yet run: the per-template sweep of every other
templates/minimax/*name; the check that no ref2va template carries the key; the check that no estimate hasgb_per_guide.get_guide("workflows", section="Authoring a workflow from an agent")gives the formula asbytes_per_guide_voxel× each guide's snapped frames × canvas. It also covers:- probing at validate, admission and run, with an unprobeable
previous_result:guide charged atnum_framesas the worst case;- the
continuity:"guide"carry (22 or 39) counting as a guide;- declared estimates refusing while inherited ones warn.
It names no
gb_per_guide. An absent key adding nothing is implied by "plus", not stated outright.The "H3: holding a clip with
guides" count row says each guide's frames are charged by the template'svram_estimate.The
minimax-h3skill says "the VRAM ceiling charges each guide's frames on the canvas".audio:true) warns at 37.16.The guide's clip-length row caps a guide at 124 frames, so nothing longer exists to test.
Wording problems in the cases, none of them product failures. I'll file them as one suite request on dkackman/harnest:
templates/minimax/shots-batchas the source template, notvideo-with-audio-768p; the numbers are the same.status:failed/run_id:nullresult.Nothing was saved this session, so there is nothing to clean up.
dkackman commentedon Oct 8, 2026
Verified by tester, claude-opus-5-5 via anthropic, against lem on develop @ c0d1c0b.
Feature-parent close-out. Both stages (#778, #779) are closed. The acceptance is every case whose
source:names them: M-F117 to M-F125.validate_workflowat defaults (workspaceregression-model-specific) on all 22templates/minimax/*andget_workflowon each.bytes_per_guide_voxel28.71 equalsbytes_per_voxel28.71 in each ✓gb_per_reference1.0, with nobytes_per_guide_voxel✓vram_estimate(image-to-video, first-and-last-frame, last-frame-only, enhance-prompt-with-image): nothing to check under the case's "with a vram_estimate" wording.gb_per_guide/gb_per_guide_audioappear nowhere ✓valid: trueat defaults ✓Two observations outside this feature:
music-video-cutsisvalid: falseat defaults: "Asset 'song.wav' not found in the asset library (workspace, common, examples)" atvariables.song. It is a utility template (transcribe/beats/plan_cuts) with no H3 step and no estimate. This is a missing input asset, not a VRAM regression, so I'm not counting it against vram_estimate does not account for guides, held audio or refine #694. I'm filing a suite request on harnest to scope M-F123's "every template" wording.validate_workflowcalls run about 6 at a time intermittently returnedcheck 'component_types' failed (RuntimeError)and passed on retry. Filed separately.All acceptance cases pass. Closing.
docs(proposals): dkackman#694 close-out - H3 guide VRAM design record