"""Offline checks for the research harness; no server or model files required.""" import json import struct import hashlib import shutil import subprocess import pytest from scripts.h3_merge_study import header, check_gpu_headroom from scripts.h3_render_study import graph, PROMPTS from scripts.h3_study_record import collect_merge_run from scripts.h3_benchmark import case_matrix, EXPORT_RUNS, successful from scripts.h3_av_review import validate_labels, output_video, DIMENSIONS from scripts import h3_av_review from scripts.h3_study_record import collect_render_run def test_local_profile_uses_requested_quantization_and_limited_resolution(): result = graph(PROMPTS["cup"], 123, [], "study", profile="local") assert result["1"]["inputs"]["unet_name"] == "minimax_h3_fl2va_pruned_int8_convrot.safetensors" assert result["2"]["inputs"]["clip_name"] == "qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors" assert result["2"]["inputs"]["type"] == "minimax" assert (result["5"]["inputs"]["width"], result["5"]["inputs"]["height"]) == (640, 384) assert result["5"]["inputs"]["length"] % 17 == 5 assert result["6"]["inputs"]["noise_seed"] == 123 assert result["8"]["inputs"]["steps"] == 20 assert result["13"]["inputs"]["audio"] == ["12", 0] assert not any("Lora" in n["class_type"] for n in result.values()) def test_adapter_chain_controls_both_schedule_and_guider_without_prompt_changes(): result = graph(PROMPTS["boxing"], 456, [("a.safetensors", .8), ("b.safetensors", -.3)], "study", "local") assert result["20"]["inputs"]["model"] == ["1", 0] assert result["21"]["inputs"]["model"] == ["20", 0] assert result["21"]["inputs"]["strength_model"] == -.3 assert result["8"]["inputs"]["model"] == result["9"]["inputs"]["model"] == ["21", 0] assert result["5"]["inputs"]["prompt"] == PROMPTS["boxing"] assert result["6"]["inputs"]["noise_seed"] == 456 def test_checkpoint_header_reader_does_not_require_tensor_payload(tmp_path): payload = json.dumps({"layer.weight": {"shape": [8, 16], "dtype": "I8", "data_offsets": [0, 128]}}).encode() path = tmp_path / "shape-only.safetensors" path.write_bytes(struct.pack("', 1)[1].split('', 1)[0] real_run(['node', '--check'], input=script, text=True, check=True, capture_output=True)