Repository navigation
#865 stage B: cache as a whole-object variable on every H3 template #884
Copy link
Copy link
Closed
Labels
featureWork bigger than a fix: designed with Don, built in stages (harnest R11)Work bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actTester's turn to actstageA child issue: one stage of a featureA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP callTester confirmed the fix via a real MCP calltarget:lem
Description
Stage B of #865. Builds the plan's Stage B section; the plan comment stays authoritative: #865 (comment) (plan v1, approved).
claude-opus-5-5 / anthropic
Builds
- The schema (
dw/workflow_schema.json,cachedefinition) acceptscacheas an object (as today) or a^variable:string. - Validation checks the substituted value against the cache object schema; a substituted
nulldrops the key (no cache). Per Don's review, put this check in the existing list of checks over the expanded definition (dw/validation.py:291onward), which feeds MCPvalidate_workflow, run-time validation andfor_eachmembers alike. - A whole-object
cachevariable (defaultnull) on every template from stage A plus the four older ones (video-with-audio,video-with-audio-768p,image-to-video,reference-to-video), wired to the H3 transformer step'scacheonly. Template defaults unchanged.
Decided in review (Q2): whole object, not a cache_threshold number. null is the only true "off", since an installed first_block hook changes output even when it skips nothing (#867 P2).
Owes
- unit tests: a
variable:cache resolving to a valid object; resolving tonull(key dropped); resolving to an invalid object (refused at validate, naming the field); cover afor_eachtemplate (dialogue-short); tests/test_catalog_speed_defaults.pytest_turbo_schedules_carry_no_block_cache: check the effective default, not the presence of acachekey;- catalog test: every H3 transformer step wires
cache; - raise
COMPACT_BUDGETwith a budget-log entry; docs/WORKFLOW_GUIDE.mdcache section (whole-object variable,null= off);docs/RECIPES_24GB.mdH3first_blockrow anddocs/ACCELERATION.md: replace "no template sets it today, add it to the workflow" with the argument;plugins/dw/skills/minimax-h3/references/quality-and-speed.md: name the argument instead of the JSON-edit route (docs: minimax-h3 skill + RECIPES_24GB/ACCELERATION - base-model (no LoRA, int8) quality path and measured speed levers #863 text); cache only at ≥ ~20 base steps, never with the turbo LoRAs.
Deploy
Server, restart needed (validation code).
Passes when
Its repro works (on lem, a 30-step no-LoRA dialogue-short run with cache: {"type":"first_block","threshold":0.05} completes and get_job_workflow shows the cache on the H3 step only; cache: {"type":"bogus"} and cache: "first_block" are refused at validate) and every pending: #<this issue> case the tester writes passes.
Blocked by: stage A (same files).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureWork bigger than a fix: designed with Don, built in stages (harnest R11)Work bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actTester's turn to actstageA child issue: one stage of a featureA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP callTester confirmed the fix via a real MCP calltarget:lem
Activity
feat(validation): #884 - cache variable tests, H3 wiring catalog test…
dkackman commentedon Oct 14, 2026
Built and deployed: stage B (cache as a whole-object variable on every H3 template)
Shipped:
develop@b692c402, which mergesfeat/865-B-h3-cache-variable(commits 4045d2b and the follow-up tests/docs commit). Deploy line:deployed develop @ b692c402, healthy after 5s (server restarted, so the new validation is live).What the plan asks for and where it is:
cacheas an object or a^variable:string. Indw/workflow_schema.json,pipeline_configuration.cacheis now"type": ["object","string"]with"pattern": "^variable:". The object properties andrequired: ["type"]are unchanged, so a literal string such as"first_block"still fails the raw schema.cache_errorsis indw/step_value_checks.py. It is registered asCheck("cache", …)afterfpsindw/validation.pyand runs over the substituted, for_each-expanded definition.steps.<step>.pipeline.configuration.cache, with an example of the object it expects. An invalid object is refused at the field inside it, e.g..cache.type.replace_variablesbehavior, so no cache is built.cachevariable defaulting to null, and"cache": "variable:cache"in the H3 step'spipeline.configurationonly. Template defaults are unchanged.tests/test_validation.py::TestCacheVariablecovers: a valid object, null dropping the key, a bogus type at.cache.type, a bare string, a missing type, an invalid default, a literal string failing the schema, and a literal object validating.TestCacheVariableOnAForEachTemplateruns on dialogue-short: valid is clean, and a bogus value is reported once and names the member.test_catalog_speed_defaults.py::test_turbo_schedules_carry_no_block_cachenow resolvesvariable:to the variable's default.test_catalog_structure.pychecks that every H3 transformer step wires cache, that only H3 steps do, that cache reaches only the H3 shot, and that the default drops the key.plugins/dw/skills/minimax-h3/references/quality-and-speed.md. The skill reference says to use the cache only at about 20 or more base steps and never with the turbo LoRAs, and that null is off.cache.Deviations, so none of these reads as a bug:
member '<name>@…'in the message.LEGITIMATE_MENTIONS. The description ofworkflows/templates/step-caching.jsonmentions "cache", which is now a catalog variable name, so it is listed there.breaking-changelabel. The schema only widens, and every template default is unchanged.Local test run: the full suite has 17 failures, all in
test_examples,test_component_type_errorsandtest_plugin_skills(Kandinsky6). The same tests fail with this stage's changes stashed, so they predate it. They are not from this stage.claude-opus-5-5 / anthropic
dkackman commentedon Oct 14, 2026
Architecture review queued by the loop driver: this hand-off changed
dw/ordw_mcp/ondevelop(31e4501304..b692c402b9: dw/step_value_checks.py dw/validation.py dw/workflow_schema.json). The reviewer checks it againstdocs/ARCHITECTURE.mdbefore the tester verifies.9 remaining items
dkackman commentedon Oct 14, 2026
Follow-up: the stage repro run passed (C-F428 at 960x544). Tester: claude-opus-5-5 / anthropic.
Job
a104407184ad: dialogue-short withlora_model_name: null, 30 steps, video_shift 12, audio_shift 3, 960x544,cache: {"type":"first_block","threshold":0.05}, seed 42.passes: 29.pass_swas 27.3 s once the model was resident.get_job_workflow(realized: true):shotfor_each step'spipeline.configuration.cacheis"variable:cache", and the variable is pinned to{"type":"first_block","threshold":0.05};draw_character_aanddraw_character_b(Z-Image) have nocachekey.delete_output(job_id="a104407184ad").This doesn't change the bounce. The only failure is still C-F425 and C-F426 value 7: a string
thresholdis accepted at validate.dkackman commentedon Oct 14, 2026
Bounce resolved: a string cache
thresholdis refused at validate (stage B, third hand-off) (claude-opus-5-5 / anthropic)Shipped:
develop@340e31d1. That mergesfeat/865-B-cache-threshold-type(commite07fbf38) and the other work already onorigin/develop. Deploy line:deployed develop @ 340e31d1, healthy after 7s. The server restarted, so the check is live.The bounce (C-F425 / C-F426 value 7). The tester's diagnosis was right. The whole-object check reused the schema's
thresholdtype,["number","string"], and the string branch exists only so a raw document can say"threshold": "variable:…"._cache_object_schema()indw/step_value_checks.pynow narrows any cache field typed number-or-string to its numeric type only. Today that field isthreshold.{"type":"first_block","threshold":"0.05"}and{"type":"first_block","threshold":"abc"}are now refused atsteps.<step>.pipeline.configuration.cache.threshold. On a for_each step it is reported once and names the member."threshold": "variable:t"still validates.Tests. In
tests/test_validation.py:TestCacheVariable::test_a_string_threshold_is_refused_at_the_fieldcovers"0.05"and"abc".test_a_threshold_variable_in_a_literal_object_still_validatescovers a literal object whosethresholdis a variable.TestCacheVariableOnAForEachTemplate::test_a_string_threshold_is_refused_onceruns on dialogue-short.Gate.
ruffis clean. The fullpytesthas 17 failures, and the same 17 fail on92c3952fwithout this change: Kandinsky6 / component-type tests that depend on the local diffusers install. None of them is in the cache tests.Nothing else in the stage changed. The first hand-off comment still describes the rest of the stage, including its deviations.
dkackman commentedon Oct 14, 2026
Architecture review queued by the loop driver: this hand-off changed
dw/ordw_mcp/ondevelop(e37f2fbdc8..340e31d1a3: dw/step_value_checks.py). The reviewer checks it againstdocs/ARCHITECTURE.mdbefore the tester verifies.dkackman commentedon Oct 14, 2026
Architecture review: passed, no findings (claude-opus-5-5 / anthropic)
What I read:
git diff e37f2fbd..340e31d1 -- dw/ dw_mcp/. The only file in the range isdw/step_value_checks.py, changed by commite07fbf38(#884): eight lines in_cache_object_schema(). I checked them againstdocs/ARCHITECTURE.mdand item 3 ofdocs/stabilization/harness/stage-c-guardrails.md.load_schemaand doesn't restate it. It stays insidecache_errors, which the Step-value checks row already assigns to this module. It doesn't re-derive thevariable:prefix, and substitution stays withdw/variables.py.cache_errors, since the earlier bounce was fixed.CLAUDE.mdchanged.The
340e31d1merge brings in no otherdw/ordw_mcp/change. The hand-off can go to verify.dkackman commentedon Oct 14, 2026
Verified: stage #884 against develop @ 340e31d. Every
pending: #884case passes. Tester: claude-opus-5-5 / anthropic, MCP calls only, workspaceregression-complete.The bounce (C-F425 / C-F426, value 7): fixed
validate_workflow(name="templates/minimax/dialogue-short", arguments={"character_a_voice":"asset:qa-cast/priya-voice.wav","character_b_voice":"asset:qa-cast/priya-voice.wav","cache":{"type":"first_block","threshold":"0.05"}})returnedvalid: false, refused atsteps[2].pipeline.configuration.cache.threshold: "Invalid cache: '0.05' is not of type 'number' in member 'shot@cold_open'". There is one error, not one per member.{"type":"first_block","threshold":"0.05"}is refused atsteps[0].pipeline.configuration.cache.threshold."0.05"and"abc"are refused at the same path.{"type":"first_block","threshold":0.05}validates, with only the existingcache_short_schedulewarning.cache: nullvalidates on video-with-audio.The cases not run in the last verify
8fdddc394eedrantemplates/minimax/first-and-last-frameat 512x288, 124 frames, seed 42, with both images set toasset:qa-cast/priya-portrait.jpg.get_job_workflow(realized: true), the step keeps"cache": "variable:cache", with the variable pinned tonull. This is the same realized form C-F422 accepted forattention_backend.timinghas nocacheblock. C-F429's literal-cache run does have one, so no cache was installed on this run.cachevariable declaration dropped and the step's cache set to a literal{"type":"first_block","threshold":0.05}.valid: true.{"type":"bogus"}was refused atsteps[0].pipeline.configuration.cache.type: "'bogus' is not one of ['first_block', 'faster', 'mag', 'taylorseer', 'text_kv']".223b74fd4d0b) succeeded. The realized step carries the literal cache as written, andtiming.cacheshowsfirst_block/ 0.05, with 4 forwards, 0 skipped.Carried from the earlier verify against 92c3952
threshold, and I re-checked values 1 and 2 above.a104407184ad, comment above). As written, at 1344x768,run_workflow's VRAM gate refuses it on lem's 3090. That is a sizing problem in the case, not a failure of the stage. The resize is requested in C-F428: resize to 960x544 - 1344x768 is refused for VRAM on lem's 3090 harnest#114.I deleted both outputs with
delete_output(job_id=...). I removed thepending: #884line from C-F424 through C-F429 inregression-suite-complete.md, so they are now ordinary cases.