import hashlib import json import platform import subprocess import sys from pathlib import Path ROOT = Path("/mnt/f70f6709-366e-49a0-861f-497645d98975/lyz/GraphEvolve/n_full_v1") REPO = ROOT.parent INCLUDE = [ "configs/scenes.json", "dataset/scene_specs_all.jsonl", "dataset/scene_specs_dev.jsonl", "dataset/scene_specs_test.jsonl", "dataset/truth_all.jsonl", "dataset/prompts_all.jsonl", "dataset/prompts_nat_spatialsense.jsonl", "dataset/prompts_nat_vsr.jsonl", "assets/asset_catalog.jsonl", "scripts/blender_render.py", "scripts/geometry_truth.py", "scripts/build_prompts.py", "scripts/build_natural_prompts.py", "scripts/run_models.py", "scripts/run_real.py", "scripts/run_deepseek.py", "scripts/vcg_witness.py", "scripts/vcg_calibrate.py", "scripts/vcg_gate.py", "scripts/make_release_archive.py", "scripts/make_croissant.py", "scripts/validate_croissant.py", "n_full/generate_dataset.py", "analysis/synth_report.py", "analysis/natural_report.py", "analysis/make_tables.py", "analysis/make_tex_tables.py", "analysis/make_v2_figs.py", "analysis/bootstrap.py", "analysis/paired_effects.py", "predictions/synth_qwen3vl/*.jsonl", "predictions/synth_qwen25vl/*.jsonl", "predictions/synth_deepseekvl2s/*.jsonl", "predictions/natural/*_qwen3vl_shard*.jsonl", "predictions/natural/*_qwen25vl_shard*.jsonl", "predictions/natural/*_deepseekvl2s_shard*.jsonl", "analysis/synth_*.json", "analysis/matrix_*.json", "analysis/boot_*.json", "analysis/gate_*.json", "analysis/natural_*.json", "analysis/paired_effects.json", ] MODELS = { "qwen3vl": "/repository/models/Qwen3-VL-8B-Instruct", "qwen25vl": "/repository/models/Qwen2.5-VL-7B-Instruct", "deepseekvl2s": "/repository/models/dsvl2-ms", "witness_detector": "/repository/models/grounding-dino-tiny", "witness_depth": "/repository/models/depth-anything-v2-small", } # 每个模型系统的输入格式与解码设置,作为模型系统的一部分记录 MODEL_SYSTEMS = { "qwen3vl": {"family": "Qwen3-VL", "image_preprocess": "native processor, min/max pixels default", "score": "log-softmax over the yes/no first token, no generation"}, "qwen25vl": {"family": "Qwen2.5-VL", "image_preprocess": "native processor, min/max pixels default", "score": "log-softmax over the yes/no first token, no generation"}, "deepseekvl2s": {"family": "DeepSeek-VL2", "image_preprocess": "official processor, dynamic tiling", "score": "log-softmax over the Yes/No first token, no generation", "code": "deepseek_vl2 package source from jsDelivr @ main, siglip attention replaced by torch SDPA", "env": "envs/dsvl2: transformers 4.38.2, tokenizers 0.15.2, timm 0.9.16"}, } def sha256(path, chunk=1 << 20): digest = hashlib.sha256() with open(path, "rb") as fh: while True: block = fh.read(chunk) if not block: break digest.update(block) return digest.hexdigest() def package_version(name): try: out = subprocess.run([sys.executable, "-c", f"import {name}; print({name}.__version__)"], capture_output=True, text=True, check=False) return out.stdout.strip() or None except Exception: return None def main(): files = {} total = 0 paths = [] for rel in INCLUDE: if any(ch in rel for ch in "*?["): matched = sorted(p for p in ROOT.glob(rel) if p.is_file()) if not matched: raise RuntimeError(f"no match for {rel}") paths.extend(matched) else: path = ROOT / rel if not path.exists(): raise RuntimeError(f"missing {rel}") paths.append(path) for path in paths: rel = path.relative_to(ROOT).as_posix() size = path.stat().st_size total += size files[rel] = {"bytes": size, "sha256": sha256(path)} lock = { "schema": "graphevolve.nfull.lock.v1", "seed": 20261106, "python": sys.version.split()[0], "platform": platform.platform(), "packages": {name: package_version(name) for name in ("torch", "transformers", "numpy", "PIL")}, "models": MODELS, "model_systems": MODEL_SYSTEMS, "blender": subprocess.run(["/home/liuyz/blender-3.3.21-linux-x64/blender", "--version"], capture_output=True, text=True, check=False).stdout.splitlines()[0], "files": files, "total_bytes": total, } out = ROOT / "manifests/run_lock.json" out.parent.mkdir(parents=True, exist_ok=True) out.write_text(json.dumps(lock, ensure_ascii=False, indent=2), encoding="utf-8") print(f"WROTE {out} files={len(files)} bytes={total}") if __name__ == "__main__": main()