From 1ea5bf179e4f0d7170228feeddf20045d979c91f Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Tue, 22 Sep 2026 14:49:58 +0300 Subject: [PATCH] test: output value function snapshot fires on H3 too Adversarial review of 77cf37e found a real, cheaply-closable test gap: this file already calls node.sample() end-to-end with a monkeypatched value function for the explore_first_step tests, so the same pattern (plus spoofing minimax_h3.is_h3_model) proves the snapshot save is no longer skipped for H3. Co-Authored-By: Claude Sonnet 5 --- tests/test_scene_chain_sampler.py | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/test_scene_chain_sampler.py b/tests/test_scene_chain_sampler.py index 3a90345d..461547aa 100644 --- a/tests/test_scene_chain_sampler.py +++ b/tests/test_scene_chain_sampler.py @@ -1338,3 +1338,44 @@ def test_explore_first_step_candidates_are_isolated_from_identity_overlap(monkey assert identity_sentinel_during_candidates[2] is True assert install_calls == ["identity_overlap", "identity_overlap"] assert remove_calls == ["identity_overlap", "identity_overlap"] + + +def test_output_value_snapshot_is_saved_on_h3(monkeypatch): + """Regression (2026-09-22): the snapshot feeding the output-space value function used + to be saved `if not self._is_h3` -- a leftover from when output_guidance (forced off + on H3) was its only consumer. explore_first_step reads the SAME value function and is + NOT H3-excluded, so skipping the snapshot there permanently starved it: the console + printed "value function not ready yet (needs 10+ rated generations)" forever, no + matter how many generations were rated, because MIN_SAMPLES could never be reached + with zero snapshots ever written. This proves the snapshot call now fires on H3 too.""" + sample_calls.clear() + node = FunPackLTXAVSceneChainSampler() + + import minimax_h3 + monkeypatch.setattr(minimax_h3, "is_h3_model", lambda model: True, raising=True) + + snapshot_calls = [] + monkeypatch.setattr(FunPackLTXAVSceneChainSampler, "_save_output_value_snapshot", + lambda self, key, snap, mask: snapshot_calls.append(key), raising=True) + + latent_template = {"samples": torch.zeros(1, 2, 5, 3, 3)} + positive = [scene_cond(0)] + negative = [(torch.zeros(1, 2, 3), {})] + + node.sample( + model=FakeModel(), + vae=FakeVAE(), + positive=positive, + negative=negative, + sampler=object(), + sigmas=torch.tensor([1.0, 0.0]), + seed=10, + latent_template=latent_template, + num_frames_per_scene=5, + frame_overlap=2, + cfg=1.5, + max_scenes=8, + refinement_key_input="testkey", + ) + + assert snapshot_calls == ["testkey"]