[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-anomalygen":3,"mdc-8aeho4-key":34,"related-org-nvidia-anomalygen":6660,"related-repo-nvidia-anomalygen":6819},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"anomalygen","generate synthetic anomaly images with AnomalyGen","PAIDF AnomalyGen pipeline — fine-tune, generate synthetic anomaly images (SDG), evaluate quality (nn_score), and per-sample search. Modes: full (train + generate), finetune_only, inference_only (from checkpoint). Invoke for any AnomalyGen \u002F SDG \u002F fine-tune \u002F synthetic-anomaly task — even if the user only mentions one phase.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Machine Learning","machine-learning","tag",{"name":17,"slug":18,"type":15},"Evals","evals",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Image Generation","image-generation",11,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fpaidf-anomalygen","2026-07-14T05:31:18.720185","CC-BY-4.0 AND Apache-2.0",3,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"Diffusion-based pipeline for generating photorealistic, mask-aligned synthetic anomaly images for industrial visual inspection from only a few real examples","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fpaidf-anomalygen\u002Ftree\u002FHEAD\u002Fskills\u002Fanomalygen","---\nname: anomalygen\ndescription: >-\n  PAIDF AnomalyGen pipeline — fine-tune, generate synthetic anomaly images (SDG),\n  evaluate quality (nn_score), and per-sample search. Modes: full (train +\n  generate), finetune_only, inference_only (from checkpoint). Invoke for any\n  AnomalyGen \u002F SDG \u002F fine-tune \u002F synthetic-anomaly task — even if the user only\n  mentions one phase.\nlicense: CC-BY-4.0 AND Apache-2.0\nmetadata:\n  author: NVIDIA\n  tags: [anomaly-generation, synthetic-data, fine-tuning, diffusion, paidf]\n---\n\n# PAIDF AnomalyGen\n\n## TL;DR — Mode Selection\n\nLock the mode first, then collect the required params for that mode:\n\n| User says | `mode` | Required | Phases that run |\n|---|---|---|---|\n| supplies a checkpoint dir + step | `inference_only` | `checkpoint_dir`, `step`, `num_SDG`, `dataset_dir` | 0, 2-7 |\n| has a dataset, wants to **train only** | `finetune_only` | `dataset_dir`, `defect_spec` | 0-1 |\n| has a dataset, wants **train + generate** | `full` | `dataset_dir`, `defect_spec`, `num_SDG` | 0-7 |\n\nIn `mode=full`, `CKPT` and `STEP` are auto-derived after Phase 1 — do NOT\nask the user for them. In `mode=inference_only`, both must be supplied.\n\nMulti-phase pipeline (0–7). The `mode` flag selects which phases run.\n\n| Phase | What runs | Mode(s) |\n|---|---|---|\n| 0 | Verify \u002F download pretrained checkpoints | all |\n| 1 | Fine-tune on `dataset_dir` | `full`, `finetune_only` |\n| 2 | Prepare inference JSONL (AMP routing) | `full`, `inference_only` |\n| 3 | SDG → `original\u002F` (targets `num_SDG`; smaller if Phase 2 dropped a defect — see Error handling) | `full`, `inference_only` |\n| 4 | Eval `original\u002F` → `per_sample.csv` + `eval.log`; merges `nn_score` into `SDG_result.csv` | `full`, `inference_only` |\n| 5 | Per-sample `(guidance, crop_ratio)` search → `rounds\u002Fround_NN\u002F` (SDG + eval per round) | `full`, `inference_only` |\n| 6 | Assemble best-of-rounds → `searched\u002F` (stitch only; carries over per-sample nn). Plus `rounds\u002Fsearch_summary.csv` | `full`, `inference_only` |\n| 7 | Filter `searched\u002F` by `nn_threshold` (default `0.4`); regen dropped samples up to 5× via re-AMP; fallback best-per-defect; canonical eval → `searched\u002F{per_sample.csv, eval.log}` | `full`, `inference_only` |\n\nRun every phase through to completion without mid-run pauses. Collect all\nrequired parameters up front. Run every command from the repo root.\n\n**Shell setup.** `${ANOMALYGEN_SCRIPTS}` is preset in the container; on\nhost, export once per shell:\n\n```bash\nexport ANOMALYGEN_SCRIPTS=\"$(git rev-parse --show-toplevel)\u002Fscripts\u002Futilities\"\n```\n\n`python3 -m scripts.utilities.\u003Cname>` works from any CWD in the container\n(PYTHONPATH preset) and from the repo root on host.\n\nWhen inside a product container (`ANOMALYGEN_PRODUCT_MODE=1`), invoke\n`anomalygen-guard` before any GPU work. If it reports `BLOCKED`, fix the\nlisted issues before continuing.\n\n## Reference files\n\n| File | When to read |\n|---|---|\n| `references\u002Ffinetune.md` | Before Phase 0 \u002F Phase 1 (env check, dataset validation, config, training, best-checkpoint selection) |\n| `references\u002Finference.md` | Before any of Phases 2–7 (AMP routing, JSONL, SDG, eval, search, filtering navigator) |\n| `references\u002Fsetup.md` | Checkpoint download fails; first-time setup; HF_TOKEN \u002F disk issues |\n| `references\u002Fdatasets.md` | Preparing or obtaining a UC1 \u002F UC2 \u002F UC3 dataset; `dataset_dir` doesn't exist yet |\n| `references\u002Fprep-testcase.md` | AMP fails; need full param table, helper descriptions, allocation invariant |\n| `references\u002Fsdg-inference.md` | NCCL hang; checkpoint validation error; multi-GPU VRAM question; full step list |\n| `references\u002Feval.md` | Unexpected scores; FID column order; eval output format reference |\n| `references\u002Fsdg-refine.md` | draws.json alignment; re-AMP heuristics; search output layout |\n\nFor `mode=full`: read both `finetune.md` and `inference.md` before starting.\n\n---\n\n## Required parameters\n\n`num_SDG` allocation depends on `prep_testcase.sh --mode`:\n- **`inference` (default, used by Phase 2)** — uniform across defect types;\n  override per-defect via `--per-defect-counts`.\n- **`validation` (used by Phase 1's validation JSONL)** — proportional to\n  training mask counts (largest-remainder rounding); enforces ≥1 per defect.\n\nSee `references\u002Fprep-testcase.md` for the full mode table.\n\n| Parameter | Description |\n|---|---|\n| `mode` | `full` (Phase 0→7), `inference_only` (skip Phase 1), or `finetune_only` (Phase 0→1 only). |\n| `name` | Experiment label. |\n| `dataset_dir` | Training\u002Freference dataset root. Drives mask-count allocation, AMP submask templates, and holds `semantic_segmentation_labels.json` for `cad` defects. |\n| `defect_spec` | JSONL tagging each defect `spatial_dependency` as `free`\u002F`text`\u002F`cad`. `text` entries need `roi_prompt_defect_location`. Template: `assets\u002Fdefect_spec_template.jsonl`. |\n| `num_SDG` | Total output samples per bucket. *(Ignored when `mode=finetune_only`.)* |\n\n## Conditionally required\n\n| Parameter | Required when | Description |\n|---|---|---|\n| `checkpoint_dir` \u002F `step` | `mode=inference_only` | Pre-existing fine-tuned model. In `mode=full` these are auto-derived after Phase 1; passing them is an error. In `mode=finetune_only` silently ignored — Phase 1 always trains from scratch (no resume-from-checkpoint support). Both must be present together — supplying only one is an error. |\n\n## Optional parameters\n\n| Parameter | Default | Description |\n|---|---|---|\n| `clean_dir` | `dataset_dir` | Clean images. Set only when they live outside the training dataset. Forwarded as `--clean-dir` to prep-testcase and `--clean-image-path` to finetune. |\n| `validation_jsonl` | auto-generated | Pre-built validation JSONL for Phase 1. When supplied, preflight verifies every `defect_spec` type appears and paths exist. |\n| `num_search_run` | `3` | Per-sample search budget for Phase 5. Set `0` to skip search (only `original\u002F` produced). *(Ignored when `mode=finetune_only`.)* |\n| `nn_threshold` | `0.4` | `nn_score` cutoff for Phase 7 (DINOv2 correspondence to real defects — key KPI). Samples below the threshold are regenerated; final `searched\u002F` always has `num_SDG`. Set to `0` to disable filtering. |\n| `max_iter` | `75000` | Phase 1 only. Total fine-tune iterations. |\n| `save_iter` | `5000` | Phase 1 only. Checkpoint save interval. |\n| `validation_iter` | `5000` | Phase 1 only. Validation (`nn_score`) logging interval. |\n| `num_gpus` | `1` | Forwarded to Phase 1 (finetune) and Phase 3 (SDG). Eval and search rounds stay single-GPU. |\n| `model_size` | `2b` | `2b` or `14b`. Used by finetune and SDG. On-disk checkpoint path encodes in upper-case (`2b`→`2B`, `14b`→`14B`). |\n| `lr` | `0.02` | Phase 1 only. Learning rate. |\n| `batch_size` | `2` | Phase 1 only. Per-GPU batch size. |\n| `image_size` | `512` | Phase 1 only. Training resolution (square). |\n| `guidance_range` | `1.5 10.0` | Phase 5 search draw range for guidance. |\n| `crop_ratio_range` | `1.5 10.0` | Phase 5 search draw range for crop_ratio. |\n\n---\n\n## Mode validation (fail fast before any phase)\n\n- `mode` unset → halt: *\"`mode` is required (`full` | `inference_only` | `finetune_only`).\"*\n- `mode=inference_only` missing either `checkpoint_dir` or `step` → halt: *\"inference_only requires both `checkpoint_dir` and `step`.\"*\n- `mode=full` with `checkpoint_dir` or `step` supplied → halt: *\"full mode runs finetune; use `mode=inference_only` to reuse an existing checkpoint.\"*\n\n## Shared variables\n\nSet once before Phase 0:\n\n```bash\nMODE=\u003Cfull|inference_only|finetune_only>\nNAME=\u003Cexp>\nDATASET_DIR=\u003Cdataset_dir>\nCLEAN_DIR=${clean_dir:-${DATASET_DIR}}\nCKPT=\u003Ccheckpoint_dir>      # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\nSTEP=\u003Citer>                # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\nNUM_SDG=\u003CN>\nDEFECT_DESC=\u003Cdefect_spec.jsonl>\nDEFECTS=(T+A T+B)          # TEXTURE+TYPE names. For mode=inference_only, derive from ${CKPT}\u002Fag_config.yaml → dataloader_train.dataset.anomaly_types (also printed by validate_checkpoint.py). For mode=full, take from DEFECT_DESC entries. See references\u002Finference.md §Pre-flight checkpoint validation.\nNUM_SEARCH_RUN=${num_search_run:-3}\nNN_THRESHOLD=${nn_threshold:-0.4}\nMODEL_SIZE=\u003C2b|14b>\nNUM_GPUS=${num_gpus:-1}\nMAX_ITER=${max_iter:-75000}\nSAVE_ITER=${save_iter:-5000}\nVALIDATION_ITER=${validation_iter:-5000}\nLR=${lr:-0.02}\nBATCH_SIZE=${batch_size:-2}\nIMAGE_SIZE=${image_size:-512}\nVALIDATION_JSONL=${validation_jsonl:-}  # optional; set by Phase 1 Step 2 if not user-supplied\n\nBASE=results\u002F${NAME}\nJSONL=ag_inference\u002F${NAME}\u002Ftestcase.jsonl\nORIGINAL=${BASE}\u002Foriginal\nSEARCHED=${BASE}\u002Fsearched\nROUNDS=${BASE}\u002Frounds\nREGENS=${BASE}\u002Fregens\n```\n\n## Guard preflight (product mode only)\n\n```bash\nif [[ \"${ANOMALYGEN_PRODUCT_MODE:-}\" == \"1\" ]]; then\n    python3 .agents\u002Fskills\u002Fanomalygen-guard\u002Fscripts\u002Fpreflight.py \\\n        --mode ${MODE} \\\n        --name ${NAME} \\\n        --dataset-dir ${DATASET_DIR} \\\n        --defect-spec ${DEFECT_DESC} \\\n        --num-search-run ${NUM_SEARCH_RUN} \\\n        --model-size ${MODEL_SIZE} \\\n        ${CLEAN_DIR:+--clean-dir ${CLEAN_DIR}} \\\n        ${NUM_SDG:+--num-sdg ${NUM_SDG}} \\\n        ${CKPT:+--checkpoint-dir ${CKPT}} \\\n        ${STEP:+--step ${STEP}} \\\n        ${VALIDATION_JSONL:+--validation-jsonl ${VALIDATION_JSONL}}\nfi\n```\n\n`--validation-jsonl` is forwarded only when the user supplied one; preflight\nthen verifies every `defect_spec` type appears in the file and that\n`image_filename` \u002F `mask_filename` paths exist. Auto-generated validation\nJSONLs are caught upstream by `allocate_samples.py`, which refuses to\nallocate 0 entries to any defect.\n\nFor `MODE=finetune_only`, omit `--num-sdg` if the user did not supply one.\n\n---\n\n## Phase 0 — checkpoints\n\nRead `references\u002Ffinetune.md §Phase 0` for HF_TOKEN requirements and what\ngets downloaded (~140 GB). Verify first; download only what is missing.\n\n```bash\n${ANOMALYGEN_SCRIPTS}\u002Fcheck.sh \\\n    || ${ANOMALYGEN_SCRIPTS}\u002Fdownload_checkpoints.sh\n```\n\n---\n\n## Phase 1 — fine-tune (skip when `MODE=inference_only`)\n\nRead `references\u002Ffinetune.md §Phase 1` for dataset structure, config\ntemplate details, and best-checkpoint selection.\n\n```bash\n# Step 1: Validate dataset structure — derive anomaly types\npython3 -m scripts.utilities.validate_dataset ${DATASET_DIR}\n\n# Step 2: Generate validation JSONL (skip if user provided VALIDATION_JSONL)\n# num_SDG = total training mask count from Step 1 output\n# --mode validation is required (prep_testcase.sh default is inference).\n${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name validation_${NAME} \\\n    --num-sdg \u003Ctotal_mask_count> \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002Fvalidation_${NAME}\u002Famp \\\n    --output-jsonl ag_inference\u002Fvalidation_${NAME}\u002Ftestcase.jsonl \\\n    --mode validation\nVALIDATION_JSONL=ag_inference\u002Fvalidation_${NAME}\u002Ftestcase.jsonl\n\n# Step 3: Generate training config — show to user and confirm before writing\npython3 -m scripts.utilities.generate_config \\\n    --name ${NAME} --dataset-dir ${DATASET_DIR} \\\n    --defect-spec ${DEFECT_DESC} --validation-jsonl ${VALIDATION_JSONL} \\\n    --output ag_configs\u002F${NAME}.yaml \\\n    --model-size ${MODEL_SIZE} --max-iter ${MAX_ITER} \\\n    --save-iter ${SAVE_ITER} --validation-iter ${VALIDATION_ITER} \\\n    --lr ${LR} --batch-size ${BATCH_SIZE} \\\n    --image-size ${IMAGE_SIZE}\n\n# Step 4: Launch training (run in background)\n${ANOMALYGEN_SCRIPTS}\u002Flaunch_training.sh \\\n    --ag-config ag_configs\u002F${NAME}.yaml \\\n    --num-gpus ${NUM_GPUS} \\\n    --model-size ${MODEL_SIZE}\n```\n\nAfter training, derive `CKPT` and `STEP` (uppercase model_size in path):\n\n```bash\nMODEL_SIZE_UPPER=\"${MODEL_SIZE^^}\"\nCKPT=\".\u002Fresults\u002Fanomaly_gen\u002F${NAME}\u002F${NAME}_training_FP32_lr${LR}_bs=${BATCH_SIZE}_${MODEL_SIZE_UPPER}_${IMAGE_SIZE}x${IMAGE_SIZE}\"\n# STEP = highest nn_score step from validation logs (see references\u002Ffinetune.md)\n```\n\nIf `MODE=finetune_only`: stop here.\n\n---\n\n## Phase 2 — prep-testcase (skip when `MODE=finetune_only`)\n\nRead `references\u002Fprep-testcase.md` (AMP routing, full param table) and\n`references\u002Finference.md §Phase 2` (pairing strategy, n_seeds sizing).\nDo NOT pass `--seeds` — it is auto-computed and is not a recognized flag.\n\n`prep_testcase.sh` defaults to `--mode inference` (uniform allocation across\ndefect types, no KPI floor). Phase 2 always uses inference mode here.\n\n```bash\n${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name ${NAME} --num-sdg ${NUM_SDG} \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002F${NAME}\u002Famp \\\n    --output-jsonl ${JSONL}\n```\n\n**Custom per-defect counts.** When the user specifies counts per defect\ntype (e.g. \"5 IC+bridge, 10 passive_component+missing\"), add\n`--per-defect-counts`:\n\n```bash\n${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name ${NAME} --num-sdg 15 \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002F${NAME}\u002Famp \\\n    --output-jsonl ${JSONL} \\\n    --per-defect-counts '{\"IC+bridge\":5,\"passive_component+missing\":10}'\n# Defects not in the dict get 0.\n```\n\nSum should equal `--num-sdg` (script warns + uses override sum if not).\nConfirm the allocation when the user's intent is ambiguous (e.g. \"each\ndefect 10\" + \"total only 1\").\n\n---\n\n## Phase 3 — SDG → `original\u002F`\n\nRead `references\u002Finference.md §Phase 3` (JSONL validation, multi-GPU\ncaveats) and `references\u002Fsdg-inference.md` (full step list, output\nverification, NCCL controls).\n\n```bash\npython3 -m scripts.utilities.validate_checkpoint ${CKPT} --step ${STEP}\npython3 -m scripts.utilities.validate_jsonl ${CKPT} ${JSONL}\n\n${ANOMALYGEN_SCRIPTS}\u002Frun_sdg.sh \\\n    --checkpoint_dir ${CKPT} --step ${STEP} \\\n    --input_jsonl ${JSONL} --output_dir ${ORIGINAL} \\\n    --model_size ${MODEL_SIZE} --num_gpus ${NUM_GPUS}\n\n${ANOMALYGEN_SCRIPTS}\u002Fverify_output.sh ${JSONL} ${ORIGINAL}\n```\n\n---\n\n## Phase 4 — eval `original\u002F`\n\nRead `references\u002Feval.md` for score interpretation, feature counts, and\nerror cases. `run_eval.sh` writes three files inside `original\u002F`:\n`per_sample.csv`, `eval.log`, and merges `nn_score` into `SDG_result.csv`.\n\n```bash\n${ANOMALYGEN_SCRIPTS}\u002Frun_eval.sh \\\n    --real-path ${DATASET_DIR} --generated-path ${ORIGINAL} \\\n    --anomaly-types ${DEFECTS[@]}\n```\n\n---\n\n## Phase 5 — per-sample search rounds\n\nRead `references\u002Finference.md §Phase 5` (draw strategy) and\n`references\u002Fsdg-refine.md` (draws.json format, ranges, re-AMP).\nFor `r` in `1..NUM_SEARCH_RUN`:\n\n1. Read prior round's `per_sample.csv` (or `${ORIGINAL}\u002Fper_sample.csv` for `r=1`).\n2. Write `${ROUNDS}\u002Fround_${r}\u002Fdraws.json` with Claude-chosen `(guidance, crop_ratio)` per sample.\n3. Run round (SDG + eval; the round dir gets its own `sdg\u002F{SDG_result.csv, per_sample.csv, eval.log}`):\n\n```bash\n${ANOMALYGEN_SCRIPTS}\u002Frun_round.sh \\\n    --base-jsonl ${JSONL} \\\n    --draws ${ROUNDS}\u002Fround_${r}\u002Fdraws.json \\\n    --output-dir ${ROUNDS}\u002Fround_${r} \\\n    --real-path ${DATASET_DIR} --anomaly-types ${DEFECTS[@]} \\\n    --checkpoint-dir ${CKPT} --step ${STEP} \\\n    [--model-size ${MODEL_SIZE}]\n```\n\n`NUM_SEARCH_RUN=0` is valid — skip this phase entirely and let Phase 6\nclone `original\u002F` into `searched\u002F`.\n\n---\n\n## Phase 6 — assemble `searched\u002F` (stitch only)\n\nAlways run assemble (works with 0 rounds — `searched\u002F` clones\n`original\u002F`, so downstream always reads `searched\u002F` regardless of\n`num_search_run`). Stitch-only: copies winning images per sample-index\ninto `searched\u002F` and carries over per-sample `nn_score` \u002F `mnn_score`\nfrom each pick's source-round per_sample.csv. No eval — Phase 7 emits\nthe canonical `searched\u002Feval.log`.\n\n```bash\nmkdir -p ${ROUNDS}\npython3 -m scripts.utilities.assemble_searched \\\n    --original-dir ${ORIGINAL} --original-csv ${ORIGINAL}\u002Fper_sample.csv \\\n    --rounds-dir ${ROUNDS} --searched-dir ${SEARCHED}\n```\n\n---\n\n## Phase 7 — filter + regen + eval (default `nn_threshold=0.4`)\n\nPhase 7 **runs by default** (`nn_threshold=0.4`) on every `mode=full` and\n`mode=inference_only` invocation. Pass `nn_threshold=0` to skip Phase 7.\n\nFilter `searched\u002F` by `nn_threshold`. Dropped samples are regenerated\nvia re-AMP (fresh `(clean, submask)` pairing in the same defect type)\nfor up to 5 attempts. If still short, falls back to best-scoring\nnon-passing regens, then to dropped originals. Final bucket always\nequals `num_SDG`.\n\n`filter_with_regen.py` runs the final `run_eval.sh` internally — this\nis the only eval against `searched\u002F`. Read `references\u002Finference.md\n§Phase 7` for the regen mechanics, source-column tracing, and\n`regens\u002Fregen_summary.csv` schema.\n\n```bash\npython3 -m scripts.utilities.filter_with_regen \\\n    --searched-dir ${SEARCHED} \\\n    --per-sample-csv ${SEARCHED}\u002Fper_sample.csv \\\n    --threshold ${NN_THRESHOLD} \\\n    --num-sdg ${NUM_SDG} \\\n    --rounds-dir ${ROUNDS} \\\n    --regens-dir ${REGENS} \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --real-path ${DATASET_DIR} \\\n    --anomaly-types ${DEFECTS[@]} \\\n    --checkpoint-dir ${CKPT} --step ${STEP} \\\n    --model-size ${MODEL_SIZE} --num-gpus ${NUM_GPUS}\n```\n\n---\n\n## Output layout\n\nEvery eval'd bucket carries the same triad: `SDG_result.csv` (gen params +\n`nn_score`), `per_sample.csv` (per-sample nn + mnn), `eval.log` (FID \u002F\nper-defect avg).\n\n```\nresults\u002F\u003Cname>\u002F\n├── original\u002F         # Phase 3 + 4 — {reconstructed_image\u002F, SDG_result.csv, per_sample.csv, eval.log}\n├── searched\u002F         # final bucket (Phase 6 stitch + Phase 7 filter+regen+eval)\n│                     #   triad as above; SDG_result.csv adds `source` column\n├── rounds\u002F           # Phase 5\n│   ├── round_NN\u002F{draws.json, testcase.jsonl, sdg\u002F{images, triad}}\n│   └── search_summary.csv          # per-sample best-of-round audit\n└── regens\u002F           # Phase 7\n    ├── regen_NN\u002F{allocation.json, amp_samples.json, amp\u002F, testcase.jsonl, sdg\u002F{images, triad}}\n    └── regen_summary.csv           # per-sample source + prev_nn + nn audit\n```\n\n## Verification\n\n1. `${ORIGINAL}\u002Freconstructed_image\u002F` has up to `num_SDG` images.\n2. `${SEARCHED}\u002Freconstructed_image\u002F` count == `num_SDG` (Phase 7 fills with regen + best-per-defect fallback if needed).\n3. `${ROUNDS}\u002Fsearch_summary.csv` has one row per sample.\n4. `original\u002Feval.log`, each `rounds\u002Fround_NN\u002Fsdg\u002Feval.log`, and `searched\u002Feval.log` contain per-type `nn_score`, `mnn_score`, and `fid`.\n5. `${REGENS}\u002Fregen_summary.csv` exists when Phase 7 ran; `passed_threshold` column reports per-sample status, `prev_nn` vs `nn_score` reveals which samples regen actually improved.\n\n## Error handling\n\n- `dataset_dir` missing per-type mask dir → allocation scans zero and errors.\n- AMP output short of allocation → `build_jsonl.py` warns and writes what's available (JSONL shorter than `num_SDG` by that delta). Check `run_auto_roi_amp.py` logs for `NO_DETECTION` \u002F `FAILED`. A defect with **zero** AMP outputs is dropped warn-only; if **every** defect produces zero, `build_jsonl.py` halts with `error: 0 entries written`.\n- SDG failure mid-round in Phase 5 → halts; re-run resumes from the next round (rounds are append-only).\n- `mode=inference_only` with a `step` not on a `save_iter` boundary → `torch.load` FileNotFoundError; `ls ${CKPT}\u002Fcheckpoints\u002Fmodel\u002Fiter_*.pt` to find valid steps.\n- See `references\u002Ffinetune.md` and `references\u002Finference.md` for phase-specific error handling.\n",{"data":35,"body":43},{"name":4,"description":6,"license":26,"metadata":36},{"author":9,"tags":37},[38,39,40,41,42],"anomaly-generation","synthetic-data","fine-tuning","diffusion","paidf",{"type":44,"children":45},"root",[46,55,62,68,254,290,302,652,657,675,742,753,782,788,953,980,984,990,1008,1053,1065,1268,1274,1344,1350,1848,1851,1857,1978,1984,1989,2738,2744,3157,3198,3218,3221,3227,3240,3293,3296,3309,3321,4068,4086,4264,4276,4279,4291,4318,4337,4523,4539,4752,4764,4767,4778,4797,5085,5088,5099,5150,5239,5242,5248,5282,5345,5588,5611,5614,5627,5688,5823,5826,5839,5880,5911,5952,6315,6318,6324,6357,6367,6373,6502,6508,6654],{"type":47,"tag":48,"props":49,"children":51},"element","h1",{"id":50},"paidf-anomalygen",[52],{"type":53,"value":54},"text","PAIDF AnomalyGen",{"type":47,"tag":56,"props":57,"children":59},"h2",{"id":58},"tldr-mode-selection",[60],{"type":53,"value":61},"TL;DR — Mode Selection",{"type":47,"tag":63,"props":64,"children":65},"p",{},[66],{"type":53,"value":67},"Lock the mode first, then collect the required params for that mode:",{"type":47,"tag":69,"props":70,"children":71},"table",{},[72,106],{"type":47,"tag":73,"props":74,"children":75},"thead",{},[76],{"type":47,"tag":77,"props":78,"children":79},"tr",{},[80,86,96,101],{"type":47,"tag":81,"props":82,"children":83},"th",{},[84],{"type":53,"value":85},"User says",{"type":47,"tag":81,"props":87,"children":88},{},[89],{"type":47,"tag":90,"props":91,"children":93},"code",{"className":92},[],[94],{"type":53,"value":95},"mode",{"type":47,"tag":81,"props":97,"children":98},{},[99],{"type":53,"value":100},"Required",{"type":47,"tag":81,"props":102,"children":103},{},[104],{"type":53,"value":105},"Phases that run",{"type":47,"tag":107,"props":108,"children":109},"tbody",{},[110,164,207],{"type":47,"tag":77,"props":111,"children":112},{},[113,119,128,159],{"type":47,"tag":114,"props":115,"children":116},"td",{},[117],{"type":53,"value":118},"supplies a checkpoint dir + step",{"type":47,"tag":114,"props":120,"children":121},{},[122],{"type":47,"tag":90,"props":123,"children":125},{"className":124},[],[126],{"type":53,"value":127},"inference_only",{"type":47,"tag":114,"props":129,"children":130},{},[131,137,139,145,146,152,153],{"type":47,"tag":90,"props":132,"children":134},{"className":133},[],[135],{"type":53,"value":136},"checkpoint_dir",{"type":53,"value":138},", ",{"type":47,"tag":90,"props":140,"children":142},{"className":141},[],[143],{"type":53,"value":144},"step",{"type":53,"value":138},{"type":47,"tag":90,"props":147,"children":149},{"className":148},[],[150],{"type":53,"value":151},"num_SDG",{"type":53,"value":138},{"type":47,"tag":90,"props":154,"children":156},{"className":155},[],[157],{"type":53,"value":158},"dataset_dir",{"type":47,"tag":114,"props":160,"children":161},{},[162],{"type":53,"value":163},"0, 2-7",{"type":47,"tag":77,"props":165,"children":166},{},[167,178,187,202],{"type":47,"tag":114,"props":168,"children":169},{},[170,172],{"type":53,"value":171},"has a dataset, wants to ",{"type":47,"tag":173,"props":174,"children":175},"strong",{},[176],{"type":53,"value":177},"train only",{"type":47,"tag":114,"props":179,"children":180},{},[181],{"type":47,"tag":90,"props":182,"children":184},{"className":183},[],[185],{"type":53,"value":186},"finetune_only",{"type":47,"tag":114,"props":188,"children":189},{},[190,195,196],{"type":47,"tag":90,"props":191,"children":193},{"className":192},[],[194],{"type":53,"value":158},{"type":53,"value":138},{"type":47,"tag":90,"props":197,"children":199},{"className":198},[],[200],{"type":53,"value":201},"defect_spec",{"type":47,"tag":114,"props":203,"children":204},{},[205],{"type":53,"value":206},"0-1",{"type":47,"tag":77,"props":208,"children":209},{},[210,220,229,249],{"type":47,"tag":114,"props":211,"children":212},{},[213,215],{"type":53,"value":214},"has a dataset, wants ",{"type":47,"tag":173,"props":216,"children":217},{},[218],{"type":53,"value":219},"train + generate",{"type":47,"tag":114,"props":221,"children":222},{},[223],{"type":47,"tag":90,"props":224,"children":226},{"className":225},[],[227],{"type":53,"value":228},"full",{"type":47,"tag":114,"props":230,"children":231},{},[232,237,238,243,244],{"type":47,"tag":90,"props":233,"children":235},{"className":234},[],[236],{"type":53,"value":158},{"type":53,"value":138},{"type":47,"tag":90,"props":239,"children":241},{"className":240},[],[242],{"type":53,"value":201},{"type":53,"value":138},{"type":47,"tag":90,"props":245,"children":247},{"className":246},[],[248],{"type":53,"value":151},{"type":47,"tag":114,"props":250,"children":251},{},[252],{"type":53,"value":253},"0-7",{"type":47,"tag":63,"props":255,"children":256},{},[257,259,265,266,272,274,280,282,288],{"type":53,"value":258},"In ",{"type":47,"tag":90,"props":260,"children":262},{"className":261},[],[263],{"type":53,"value":264},"mode=full",{"type":53,"value":138},{"type":47,"tag":90,"props":267,"children":269},{"className":268},[],[270],{"type":53,"value":271},"CKPT",{"type":53,"value":273}," and ",{"type":47,"tag":90,"props":275,"children":277},{"className":276},[],[278],{"type":53,"value":279},"STEP",{"type":53,"value":281}," are auto-derived after Phase 1 — do NOT\nask the user for them. In ",{"type":47,"tag":90,"props":283,"children":285},{"className":284},[],[286],{"type":53,"value":287},"mode=inference_only",{"type":53,"value":289},", both must be supplied.",{"type":47,"tag":63,"props":291,"children":292},{},[293,295,300],{"type":53,"value":294},"Multi-phase pipeline (0–7). The ",{"type":47,"tag":90,"props":296,"children":298},{"className":297},[],[299],{"type":53,"value":95},{"type":53,"value":301}," flag selects which phases run.",{"type":47,"tag":69,"props":303,"children":304},{},[305,326],{"type":47,"tag":73,"props":306,"children":307},{},[308],{"type":47,"tag":77,"props":309,"children":310},{},[311,316,321],{"type":47,"tag":81,"props":312,"children":313},{},[314],{"type":53,"value":315},"Phase",{"type":47,"tag":81,"props":317,"children":318},{},[319],{"type":53,"value":320},"What runs",{"type":47,"tag":81,"props":322,"children":323},{},[324],{"type":53,"value":325},"Mode(s)",{"type":47,"tag":107,"props":327,"children":328},{},[329,347,379,406,448,512,555,596],{"type":47,"tag":77,"props":330,"children":331},{},[332,337,342],{"type":47,"tag":114,"props":333,"children":334},{},[335],{"type":53,"value":336},"0",{"type":47,"tag":114,"props":338,"children":339},{},[340],{"type":53,"value":341},"Verify \u002F download pretrained checkpoints",{"type":47,"tag":114,"props":343,"children":344},{},[345],{"type":53,"value":346},"all",{"type":47,"tag":77,"props":348,"children":349},{},[350,355,365],{"type":47,"tag":114,"props":351,"children":352},{},[353],{"type":53,"value":354},"1",{"type":47,"tag":114,"props":356,"children":357},{},[358,360],{"type":53,"value":359},"Fine-tune on ",{"type":47,"tag":90,"props":361,"children":363},{"className":362},[],[364],{"type":53,"value":158},{"type":47,"tag":114,"props":366,"children":367},{},[368,373,374],{"type":47,"tag":90,"props":369,"children":371},{"className":370},[],[372],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":375,"children":377},{"className":376},[],[378],{"type":53,"value":186},{"type":47,"tag":77,"props":380,"children":381},{},[382,387,392],{"type":47,"tag":114,"props":383,"children":384},{},[385],{"type":53,"value":386},"2",{"type":47,"tag":114,"props":388,"children":389},{},[390],{"type":53,"value":391},"Prepare inference JSONL (AMP routing)",{"type":47,"tag":114,"props":393,"children":394},{},[395,400,401],{"type":47,"tag":90,"props":396,"children":398},{"className":397},[],[399],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":402,"children":404},{"className":403},[],[405],{"type":53,"value":127},{"type":47,"tag":77,"props":407,"children":408},{},[409,414,434],{"type":47,"tag":114,"props":410,"children":411},{},[412],{"type":53,"value":413},"3",{"type":47,"tag":114,"props":415,"children":416},{},[417,419,425,427,432],{"type":53,"value":418},"SDG → ",{"type":47,"tag":90,"props":420,"children":422},{"className":421},[],[423],{"type":53,"value":424},"original\u002F",{"type":53,"value":426}," (targets ",{"type":47,"tag":90,"props":428,"children":430},{"className":429},[],[431],{"type":53,"value":151},{"type":53,"value":433},"; smaller if Phase 2 dropped a defect — see Error handling)",{"type":47,"tag":114,"props":435,"children":436},{},[437,442,443],{"type":47,"tag":90,"props":438,"children":440},{"className":439},[],[441],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":444,"children":446},{"className":445},[],[447],{"type":53,"value":127},{"type":47,"tag":77,"props":449,"children":450},{},[451,456,498],{"type":47,"tag":114,"props":452,"children":453},{},[454],{"type":53,"value":455},"4",{"type":47,"tag":114,"props":457,"children":458},{},[459,461,466,468,474,476,482,484,490,492],{"type":53,"value":460},"Eval ",{"type":47,"tag":90,"props":462,"children":464},{"className":463},[],[465],{"type":53,"value":424},{"type":53,"value":467}," → ",{"type":47,"tag":90,"props":469,"children":471},{"className":470},[],[472],{"type":53,"value":473},"per_sample.csv",{"type":53,"value":475}," + ",{"type":47,"tag":90,"props":477,"children":479},{"className":478},[],[480],{"type":53,"value":481},"eval.log",{"type":53,"value":483},"; merges ",{"type":47,"tag":90,"props":485,"children":487},{"className":486},[],[488],{"type":53,"value":489},"nn_score",{"type":53,"value":491}," into ",{"type":47,"tag":90,"props":493,"children":495},{"className":494},[],[496],{"type":53,"value":497},"SDG_result.csv",{"type":47,"tag":114,"props":499,"children":500},{},[501,506,507],{"type":47,"tag":90,"props":502,"children":504},{"className":503},[],[505],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":508,"children":510},{"className":509},[],[511],{"type":53,"value":127},{"type":47,"tag":77,"props":513,"children":514},{},[515,520,541],{"type":47,"tag":114,"props":516,"children":517},{},[518],{"type":53,"value":519},"5",{"type":47,"tag":114,"props":521,"children":522},{},[523,525,531,533,539],{"type":53,"value":524},"Per-sample ",{"type":47,"tag":90,"props":526,"children":528},{"className":527},[],[529],{"type":53,"value":530},"(guidance, crop_ratio)",{"type":53,"value":532}," search → ",{"type":47,"tag":90,"props":534,"children":536},{"className":535},[],[537],{"type":53,"value":538},"rounds\u002Fround_NN\u002F",{"type":53,"value":540}," (SDG + eval per round)",{"type":47,"tag":114,"props":542,"children":543},{},[544,549,550],{"type":47,"tag":90,"props":545,"children":547},{"className":546},[],[548],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":551,"children":553},{"className":552},[],[554],{"type":53,"value":127},{"type":47,"tag":77,"props":556,"children":557},{},[558,563,582],{"type":47,"tag":114,"props":559,"children":560},{},[561],{"type":53,"value":562},"6",{"type":47,"tag":114,"props":564,"children":565},{},[566,568,574,576],{"type":53,"value":567},"Assemble best-of-rounds → ",{"type":47,"tag":90,"props":569,"children":571},{"className":570},[],[572],{"type":53,"value":573},"searched\u002F",{"type":53,"value":575}," (stitch only; carries over per-sample nn). Plus ",{"type":47,"tag":90,"props":577,"children":579},{"className":578},[],[580],{"type":53,"value":581},"rounds\u002Fsearch_summary.csv",{"type":47,"tag":114,"props":583,"children":584},{},[585,590,591],{"type":47,"tag":90,"props":586,"children":588},{"className":587},[],[589],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":592,"children":594},{"className":593},[],[595],{"type":53,"value":127},{"type":47,"tag":77,"props":597,"children":598},{},[599,604,638],{"type":47,"tag":114,"props":600,"children":601},{},[602],{"type":53,"value":603},"7",{"type":47,"tag":114,"props":605,"children":606},{},[607,609,614,616,622,624,630,632],{"type":53,"value":608},"Filter ",{"type":47,"tag":90,"props":610,"children":612},{"className":611},[],[613],{"type":53,"value":573},{"type":53,"value":615}," by ",{"type":47,"tag":90,"props":617,"children":619},{"className":618},[],[620],{"type":53,"value":621},"nn_threshold",{"type":53,"value":623}," (default ",{"type":47,"tag":90,"props":625,"children":627},{"className":626},[],[628],{"type":53,"value":629},"0.4",{"type":53,"value":631},"); regen dropped samples up to 5× via re-AMP; fallback best-per-defect; canonical eval → ",{"type":47,"tag":90,"props":633,"children":635},{"className":634},[],[636],{"type":53,"value":637},"searched\u002F{per_sample.csv, eval.log}",{"type":47,"tag":114,"props":639,"children":640},{},[641,646,647],{"type":47,"tag":90,"props":642,"children":644},{"className":643},[],[645],{"type":53,"value":228},{"type":53,"value":138},{"type":47,"tag":90,"props":648,"children":650},{"className":649},[],[651],{"type":53,"value":127},{"type":47,"tag":63,"props":653,"children":654},{},[655],{"type":53,"value":656},"Run every phase through to completion without mid-run pauses. Collect all\nrequired parameters up front. Run every command from the repo root.",{"type":47,"tag":63,"props":658,"children":659},{},[660,665,667,673],{"type":47,"tag":173,"props":661,"children":662},{},[663],{"type":53,"value":664},"Shell setup.",{"type":53,"value":666}," ",{"type":47,"tag":90,"props":668,"children":670},{"className":669},[],[671],{"type":53,"value":672},"${ANOMALYGEN_SCRIPTS}",{"type":53,"value":674}," is preset in the container; on\nhost, export once per shell:",{"type":47,"tag":676,"props":677,"children":682},"pre",{"className":678,"code":679,"language":680,"meta":681,"style":681},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export ANOMALYGEN_SCRIPTS=\"$(git rev-parse --show-toplevel)\u002Fscripts\u002Futilities\"\n","bash","",[683],{"type":47,"tag":90,"props":684,"children":685},{"__ignoreMap":681},[686],{"type":47,"tag":687,"props":688,"children":691},"span",{"class":689,"line":690},"line",1,[692,698,704,710,715,721,727,732,737],{"type":47,"tag":687,"props":693,"children":695},{"style":694},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[696],{"type":53,"value":697},"export",{"type":47,"tag":687,"props":699,"children":701},{"style":700},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[702],{"type":53,"value":703}," ANOMALYGEN_SCRIPTS",{"type":47,"tag":687,"props":705,"children":707},{"style":706},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[708],{"type":53,"value":709},"=",{"type":47,"tag":687,"props":711,"children":712},{"style":706},[713],{"type":53,"value":714},"\"$(",{"type":47,"tag":687,"props":716,"children":718},{"style":717},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[719],{"type":53,"value":720},"git",{"type":47,"tag":687,"props":722,"children":724},{"style":723},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[725],{"type":53,"value":726}," rev-parse --show-toplevel",{"type":47,"tag":687,"props":728,"children":729},{"style":706},[730],{"type":53,"value":731},")",{"type":47,"tag":687,"props":733,"children":734},{"style":723},[735],{"type":53,"value":736},"\u002Fscripts\u002Futilities",{"type":47,"tag":687,"props":738,"children":739},{"style":706},[740],{"type":53,"value":741},"\"\n",{"type":47,"tag":63,"props":743,"children":744},{},[745,751],{"type":47,"tag":90,"props":746,"children":748},{"className":747},[],[749],{"type":53,"value":750},"python3 -m scripts.utilities.\u003Cname>",{"type":53,"value":752}," works from any CWD in the container\n(PYTHONPATH preset) and from the repo root on host.",{"type":47,"tag":63,"props":754,"children":755},{},[756,758,764,766,772,774,780],{"type":53,"value":757},"When inside a product container (",{"type":47,"tag":90,"props":759,"children":761},{"className":760},[],[762],{"type":53,"value":763},"ANOMALYGEN_PRODUCT_MODE=1",{"type":53,"value":765},"), invoke\n",{"type":47,"tag":90,"props":767,"children":769},{"className":768},[],[770],{"type":53,"value":771},"anomalygen-guard",{"type":53,"value":773}," before any GPU work. If it reports ",{"type":47,"tag":90,"props":775,"children":777},{"className":776},[],[778],{"type":53,"value":779},"BLOCKED",{"type":53,"value":781},", fix the\nlisted issues before continuing.",{"type":47,"tag":56,"props":783,"children":785},{"id":784},"reference-files",[786],{"type":53,"value":787},"Reference files",{"type":47,"tag":69,"props":789,"children":790},{},[791,807],{"type":47,"tag":73,"props":792,"children":793},{},[794],{"type":47,"tag":77,"props":795,"children":796},{},[797,802],{"type":47,"tag":81,"props":798,"children":799},{},[800],{"type":53,"value":801},"File",{"type":47,"tag":81,"props":803,"children":804},{},[805],{"type":53,"value":806},"When to read",{"type":47,"tag":107,"props":808,"children":809},{},[810,827,844,861,885,902,919,936],{"type":47,"tag":77,"props":811,"children":812},{},[813,822],{"type":47,"tag":114,"props":814,"children":815},{},[816],{"type":47,"tag":90,"props":817,"children":819},{"className":818},[],[820],{"type":53,"value":821},"references\u002Ffinetune.md",{"type":47,"tag":114,"props":823,"children":824},{},[825],{"type":53,"value":826},"Before Phase 0 \u002F Phase 1 (env check, dataset validation, config, training, best-checkpoint selection)",{"type":47,"tag":77,"props":828,"children":829},{},[830,839],{"type":47,"tag":114,"props":831,"children":832},{},[833],{"type":47,"tag":90,"props":834,"children":836},{"className":835},[],[837],{"type":53,"value":838},"references\u002Finference.md",{"type":47,"tag":114,"props":840,"children":841},{},[842],{"type":53,"value":843},"Before any of Phases 2–7 (AMP routing, JSONL, SDG, eval, search, filtering navigator)",{"type":47,"tag":77,"props":845,"children":846},{},[847,856],{"type":47,"tag":114,"props":848,"children":849},{},[850],{"type":47,"tag":90,"props":851,"children":853},{"className":852},[],[854],{"type":53,"value":855},"references\u002Fsetup.md",{"type":47,"tag":114,"props":857,"children":858},{},[859],{"type":53,"value":860},"Checkpoint download fails; first-time setup; HF_TOKEN \u002F disk issues",{"type":47,"tag":77,"props":862,"children":863},{},[864,873],{"type":47,"tag":114,"props":865,"children":866},{},[867],{"type":47,"tag":90,"props":868,"children":870},{"className":869},[],[871],{"type":53,"value":872},"references\u002Fdatasets.md",{"type":47,"tag":114,"props":874,"children":875},{},[876,878,883],{"type":53,"value":877},"Preparing or obtaining a UC1 \u002F UC2 \u002F UC3 dataset; ",{"type":47,"tag":90,"props":879,"children":881},{"className":880},[],[882],{"type":53,"value":158},{"type":53,"value":884}," doesn't exist yet",{"type":47,"tag":77,"props":886,"children":887},{},[888,897],{"type":47,"tag":114,"props":889,"children":890},{},[891],{"type":47,"tag":90,"props":892,"children":894},{"className":893},[],[895],{"type":53,"value":896},"references\u002Fprep-testcase.md",{"type":47,"tag":114,"props":898,"children":899},{},[900],{"type":53,"value":901},"AMP fails; need full param table, helper descriptions, allocation invariant",{"type":47,"tag":77,"props":903,"children":904},{},[905,914],{"type":47,"tag":114,"props":906,"children":907},{},[908],{"type":47,"tag":90,"props":909,"children":911},{"className":910},[],[912],{"type":53,"value":913},"references\u002Fsdg-inference.md",{"type":47,"tag":114,"props":915,"children":916},{},[917],{"type":53,"value":918},"NCCL hang; checkpoint validation error; multi-GPU VRAM question; full step list",{"type":47,"tag":77,"props":920,"children":921},{},[922,931],{"type":47,"tag":114,"props":923,"children":924},{},[925],{"type":47,"tag":90,"props":926,"children":928},{"className":927},[],[929],{"type":53,"value":930},"references\u002Feval.md",{"type":47,"tag":114,"props":932,"children":933},{},[934],{"type":53,"value":935},"Unexpected scores; FID column order; eval output format reference",{"type":47,"tag":77,"props":937,"children":938},{},[939,948],{"type":47,"tag":114,"props":940,"children":941},{},[942],{"type":47,"tag":90,"props":943,"children":945},{"className":944},[],[946],{"type":53,"value":947},"references\u002Fsdg-refine.md",{"type":47,"tag":114,"props":949,"children":950},{},[951],{"type":53,"value":952},"draws.json alignment; re-AMP heuristics; search output layout",{"type":47,"tag":63,"props":954,"children":955},{},[956,958,963,965,971,972,978],{"type":53,"value":957},"For ",{"type":47,"tag":90,"props":959,"children":961},{"className":960},[],[962],{"type":53,"value":264},{"type":53,"value":964},": read both ",{"type":47,"tag":90,"props":966,"children":968},{"className":967},[],[969],{"type":53,"value":970},"finetune.md",{"type":53,"value":273},{"type":47,"tag":90,"props":973,"children":975},{"className":974},[],[976],{"type":53,"value":977},"inference.md",{"type":53,"value":979}," before starting.",{"type":47,"tag":981,"props":982,"children":983},"hr",{},[],{"type":47,"tag":56,"props":985,"children":987},{"id":986},"required-parameters",[988],{"type":53,"value":989},"Required parameters",{"type":47,"tag":63,"props":991,"children":992},{},[993,998,1000,1006],{"type":47,"tag":90,"props":994,"children":996},{"className":995},[],[997],{"type":53,"value":151},{"type":53,"value":999}," allocation depends on ",{"type":47,"tag":90,"props":1001,"children":1003},{"className":1002},[],[1004],{"type":53,"value":1005},"prep_testcase.sh --mode",{"type":53,"value":1007},":",{"type":47,"tag":1009,"props":1010,"children":1011},"ul",{},[1012,1037],{"type":47,"tag":1013,"props":1014,"children":1015},"li",{},[1016,1027,1029,1035],{"type":47,"tag":173,"props":1017,"children":1018},{},[1019,1025],{"type":47,"tag":90,"props":1020,"children":1022},{"className":1021},[],[1023],{"type":53,"value":1024},"inference",{"type":53,"value":1026}," (default, used by Phase 2)",{"type":53,"value":1028}," — uniform across defect types;\noverride per-defect via ",{"type":47,"tag":90,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":53,"value":1034},"--per-defect-counts",{"type":53,"value":1036},".",{"type":47,"tag":1013,"props":1038,"children":1039},{},[1040,1051],{"type":47,"tag":173,"props":1041,"children":1042},{},[1043,1049],{"type":47,"tag":90,"props":1044,"children":1046},{"className":1045},[],[1047],{"type":53,"value":1048},"validation",{"type":53,"value":1050}," (used by Phase 1's validation JSONL)",{"type":53,"value":1052}," — proportional to\ntraining mask counts (largest-remainder rounding); enforces ≥1 per defect.",{"type":47,"tag":63,"props":1054,"children":1055},{},[1056,1058,1063],{"type":53,"value":1057},"See ",{"type":47,"tag":90,"props":1059,"children":1061},{"className":1060},[],[1062],{"type":53,"value":896},{"type":53,"value":1064}," for the full mode table.",{"type":47,"tag":69,"props":1066,"children":1067},{},[1068,1084],{"type":47,"tag":73,"props":1069,"children":1070},{},[1071],{"type":47,"tag":77,"props":1072,"children":1073},{},[1074,1079],{"type":47,"tag":81,"props":1075,"children":1076},{},[1077],{"type":53,"value":1078},"Parameter",{"type":47,"tag":81,"props":1080,"children":1081},{},[1082],{"type":53,"value":1083},"Description",{"type":47,"tag":107,"props":1085,"children":1086},{},[1087,1122,1139,1171,1238],{"type":47,"tag":77,"props":1088,"children":1089},{},[1090,1098],{"type":47,"tag":114,"props":1091,"children":1092},{},[1093],{"type":47,"tag":90,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":53,"value":95},{"type":47,"tag":114,"props":1099,"children":1100},{},[1101,1106,1108,1113,1115,1120],{"type":47,"tag":90,"props":1102,"children":1104},{"className":1103},[],[1105],{"type":53,"value":228},{"type":53,"value":1107}," (Phase 0→7), ",{"type":47,"tag":90,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":53,"value":127},{"type":53,"value":1114}," (skip Phase 1), or ",{"type":47,"tag":90,"props":1116,"children":1118},{"className":1117},[],[1119],{"type":53,"value":186},{"type":53,"value":1121}," (Phase 0→1 only).",{"type":47,"tag":77,"props":1123,"children":1124},{},[1125,1134],{"type":47,"tag":114,"props":1126,"children":1127},{},[1128],{"type":47,"tag":90,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":53,"value":1133},"name",{"type":47,"tag":114,"props":1135,"children":1136},{},[1137],{"type":53,"value":1138},"Experiment label.",{"type":47,"tag":77,"props":1140,"children":1141},{},[1142,1150],{"type":47,"tag":114,"props":1143,"children":1144},{},[1145],{"type":47,"tag":90,"props":1146,"children":1148},{"className":1147},[],[1149],{"type":53,"value":158},{"type":47,"tag":114,"props":1151,"children":1152},{},[1153,1155,1161,1163,1169],{"type":53,"value":1154},"Training\u002Freference dataset root. Drives mask-count allocation, AMP submask templates, and holds ",{"type":47,"tag":90,"props":1156,"children":1158},{"className":1157},[],[1159],{"type":53,"value":1160},"semantic_segmentation_labels.json",{"type":53,"value":1162}," for ",{"type":47,"tag":90,"props":1164,"children":1166},{"className":1165},[],[1167],{"type":53,"value":1168},"cad",{"type":53,"value":1170}," defects.",{"type":47,"tag":77,"props":1172,"children":1173},{},[1174,1182],{"type":47,"tag":114,"props":1175,"children":1176},{},[1177],{"type":47,"tag":90,"props":1178,"children":1180},{"className":1179},[],[1181],{"type":53,"value":201},{"type":47,"tag":114,"props":1183,"children":1184},{},[1185,1187,1193,1195,1201,1203,1208,1209,1214,1216,1221,1223,1229,1231,1237],{"type":53,"value":1186},"JSONL tagging each defect ",{"type":47,"tag":90,"props":1188,"children":1190},{"className":1189},[],[1191],{"type":53,"value":1192},"spatial_dependency",{"type":53,"value":1194}," as ",{"type":47,"tag":90,"props":1196,"children":1198},{"className":1197},[],[1199],{"type":53,"value":1200},"free",{"type":53,"value":1202},"\u002F",{"type":47,"tag":90,"props":1204,"children":1206},{"className":1205},[],[1207],{"type":53,"value":53},{"type":53,"value":1202},{"type":47,"tag":90,"props":1210,"children":1212},{"className":1211},[],[1213],{"type":53,"value":1168},{"type":53,"value":1215},". ",{"type":47,"tag":90,"props":1217,"children":1219},{"className":1218},[],[1220],{"type":53,"value":53},{"type":53,"value":1222}," entries need ",{"type":47,"tag":90,"props":1224,"children":1226},{"className":1225},[],[1227],{"type":53,"value":1228},"roi_prompt_defect_location",{"type":53,"value":1230},". Template: ",{"type":47,"tag":90,"props":1232,"children":1234},{"className":1233},[],[1235],{"type":53,"value":1236},"assets\u002Fdefect_spec_template.jsonl",{"type":53,"value":1036},{"type":47,"tag":77,"props":1239,"children":1240},{},[1241,1249],{"type":47,"tag":114,"props":1242,"children":1243},{},[1244],{"type":47,"tag":90,"props":1245,"children":1247},{"className":1246},[],[1248],{"type":53,"value":151},{"type":47,"tag":114,"props":1250,"children":1251},{},[1252,1254],{"type":53,"value":1253},"Total output samples per bucket. ",{"type":47,"tag":1255,"props":1256,"children":1257},"em",{},[1258,1260,1266],{"type":53,"value":1259},"(Ignored when ",{"type":47,"tag":90,"props":1261,"children":1263},{"className":1262},[],[1264],{"type":53,"value":1265},"mode=finetune_only",{"type":53,"value":1267},".)",{"type":47,"tag":56,"props":1269,"children":1271},{"id":1270},"conditionally-required",[1272],{"type":53,"value":1273},"Conditionally required",{"type":47,"tag":69,"props":1275,"children":1276},{},[1277,1296],{"type":47,"tag":73,"props":1278,"children":1279},{},[1280],{"type":47,"tag":77,"props":1281,"children":1282},{},[1283,1287,1292],{"type":47,"tag":81,"props":1284,"children":1285},{},[1286],{"type":53,"value":1078},{"type":47,"tag":81,"props":1288,"children":1289},{},[1290],{"type":53,"value":1291},"Required when",{"type":47,"tag":81,"props":1293,"children":1294},{},[1295],{"type":53,"value":1083},{"type":47,"tag":107,"props":1297,"children":1298},{},[1299],{"type":47,"tag":77,"props":1300,"children":1301},{},[1302,1317,1325],{"type":47,"tag":114,"props":1303,"children":1304},{},[1305,1310,1312],{"type":47,"tag":90,"props":1306,"children":1308},{"className":1307},[],[1309],{"type":53,"value":136},{"type":53,"value":1311}," \u002F ",{"type":47,"tag":90,"props":1313,"children":1315},{"className":1314},[],[1316],{"type":53,"value":144},{"type":47,"tag":114,"props":1318,"children":1319},{},[1320],{"type":47,"tag":90,"props":1321,"children":1323},{"className":1322},[],[1324],{"type":53,"value":287},{"type":47,"tag":114,"props":1326,"children":1327},{},[1328,1330,1335,1337,1342],{"type":53,"value":1329},"Pre-existing fine-tuned model. In ",{"type":47,"tag":90,"props":1331,"children":1333},{"className":1332},[],[1334],{"type":53,"value":264},{"type":53,"value":1336}," these are auto-derived after Phase 1; passing them is an error. In ",{"type":47,"tag":90,"props":1338,"children":1340},{"className":1339},[],[1341],{"type":53,"value":1265},{"type":53,"value":1343}," silently ignored — Phase 1 always trains from scratch (no resume-from-checkpoint support). Both must be present together — supplying only one is an error.",{"type":47,"tag":56,"props":1345,"children":1347},{"id":1346},"optional-parameters",[1348],{"type":53,"value":1349},"Optional parameters",{"type":47,"tag":69,"props":1351,"children":1352},{},[1353,1372],{"type":47,"tag":73,"props":1354,"children":1355},{},[1356],{"type":47,"tag":77,"props":1357,"children":1358},{},[1359,1363,1368],{"type":47,"tag":81,"props":1360,"children":1361},{},[1362],{"type":53,"value":1078},{"type":47,"tag":81,"props":1364,"children":1365},{},[1366],{"type":53,"value":1367},"Default",{"type":47,"tag":81,"props":1369,"children":1370},{},[1371],{"type":53,"value":1083},{"type":47,"tag":107,"props":1373,"children":1374},{},[1375,1416,1445,1494,1544,1570,1596,1628,1653,1720,1746,1771,1797,1823],{"type":47,"tag":77,"props":1376,"children":1377},{},[1378,1387,1395],{"type":47,"tag":114,"props":1379,"children":1380},{},[1381],{"type":47,"tag":90,"props":1382,"children":1384},{"className":1383},[],[1385],{"type":53,"value":1386},"clean_dir",{"type":47,"tag":114,"props":1388,"children":1389},{},[1390],{"type":47,"tag":90,"props":1391,"children":1393},{"className":1392},[],[1394],{"type":53,"value":158},{"type":47,"tag":114,"props":1396,"children":1397},{},[1398,1400,1406,1408,1414],{"type":53,"value":1399},"Clean images. Set only when they live outside the training dataset. Forwarded as ",{"type":47,"tag":90,"props":1401,"children":1403},{"className":1402},[],[1404],{"type":53,"value":1405},"--clean-dir",{"type":53,"value":1407}," to prep-testcase and ",{"type":47,"tag":90,"props":1409,"children":1411},{"className":1410},[],[1412],{"type":53,"value":1413},"--clean-image-path",{"type":53,"value":1415}," to finetune.",{"type":47,"tag":77,"props":1417,"children":1418},{},[1419,1428,1433],{"type":47,"tag":114,"props":1420,"children":1421},{},[1422],{"type":47,"tag":90,"props":1423,"children":1425},{"className":1424},[],[1426],{"type":53,"value":1427},"validation_jsonl",{"type":47,"tag":114,"props":1429,"children":1430},{},[1431],{"type":53,"value":1432},"auto-generated",{"type":47,"tag":114,"props":1434,"children":1435},{},[1436,1438,1443],{"type":53,"value":1437},"Pre-built validation JSONL for Phase 1. When supplied, preflight verifies every ",{"type":47,"tag":90,"props":1439,"children":1441},{"className":1440},[],[1442],{"type":53,"value":201},{"type":53,"value":1444}," type appears and paths exist.",{"type":47,"tag":77,"props":1446,"children":1447},{},[1448,1457,1465],{"type":47,"tag":114,"props":1449,"children":1450},{},[1451],{"type":47,"tag":90,"props":1452,"children":1454},{"className":1453},[],[1455],{"type":53,"value":1456},"num_search_run",{"type":47,"tag":114,"props":1458,"children":1459},{},[1460],{"type":47,"tag":90,"props":1461,"children":1463},{"className":1462},[],[1464],{"type":53,"value":413},{"type":47,"tag":114,"props":1466,"children":1467},{},[1468,1470,1475,1477,1482,1484],{"type":53,"value":1469},"Per-sample search budget for Phase 5. Set ",{"type":47,"tag":90,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":53,"value":336},{"type":53,"value":1476}," to skip search (only ",{"type":47,"tag":90,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":53,"value":424},{"type":53,"value":1483}," produced). ",{"type":47,"tag":1255,"props":1485,"children":1486},{},[1487,1488,1493],{"type":53,"value":1259},{"type":47,"tag":90,"props":1489,"children":1491},{"className":1490},[],[1492],{"type":53,"value":1265},{"type":53,"value":1267},{"type":47,"tag":77,"props":1495,"children":1496},{},[1497,1505,1513],{"type":47,"tag":114,"props":1498,"children":1499},{},[1500],{"type":47,"tag":90,"props":1501,"children":1503},{"className":1502},[],[1504],{"type":53,"value":621},{"type":47,"tag":114,"props":1506,"children":1507},{},[1508],{"type":47,"tag":90,"props":1509,"children":1511},{"className":1510},[],[1512],{"type":53,"value":629},{"type":47,"tag":114,"props":1514,"children":1515},{},[1516,1521,1523,1528,1530,1535,1537,1542],{"type":47,"tag":90,"props":1517,"children":1519},{"className":1518},[],[1520],{"type":53,"value":489},{"type":53,"value":1522}," cutoff for Phase 7 (DINOv2 correspondence to real defects — key KPI). Samples below the threshold are regenerated; final ",{"type":47,"tag":90,"props":1524,"children":1526},{"className":1525},[],[1527],{"type":53,"value":573},{"type":53,"value":1529}," always has ",{"type":47,"tag":90,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":53,"value":151},{"type":53,"value":1536},". Set to ",{"type":47,"tag":90,"props":1538,"children":1540},{"className":1539},[],[1541],{"type":53,"value":336},{"type":53,"value":1543}," to disable filtering.",{"type":47,"tag":77,"props":1545,"children":1546},{},[1547,1556,1565],{"type":47,"tag":114,"props":1548,"children":1549},{},[1550],{"type":47,"tag":90,"props":1551,"children":1553},{"className":1552},[],[1554],{"type":53,"value":1555},"max_iter",{"type":47,"tag":114,"props":1557,"children":1558},{},[1559],{"type":47,"tag":90,"props":1560,"children":1562},{"className":1561},[],[1563],{"type":53,"value":1564},"75000",{"type":47,"tag":114,"props":1566,"children":1567},{},[1568],{"type":53,"value":1569},"Phase 1 only. Total fine-tune iterations.",{"type":47,"tag":77,"props":1571,"children":1572},{},[1573,1582,1591],{"type":47,"tag":114,"props":1574,"children":1575},{},[1576],{"type":47,"tag":90,"props":1577,"children":1579},{"className":1578},[],[1580],{"type":53,"value":1581},"save_iter",{"type":47,"tag":114,"props":1583,"children":1584},{},[1585],{"type":47,"tag":90,"props":1586,"children":1588},{"className":1587},[],[1589],{"type":53,"value":1590},"5000",{"type":47,"tag":114,"props":1592,"children":1593},{},[1594],{"type":53,"value":1595},"Phase 1 only. Checkpoint save interval.",{"type":47,"tag":77,"props":1597,"children":1598},{},[1599,1608,1616],{"type":47,"tag":114,"props":1600,"children":1601},{},[1602],{"type":47,"tag":90,"props":1603,"children":1605},{"className":1604},[],[1606],{"type":53,"value":1607},"validation_iter",{"type":47,"tag":114,"props":1609,"children":1610},{},[1611],{"type":47,"tag":90,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":53,"value":1590},{"type":47,"tag":114,"props":1617,"children":1618},{},[1619,1621,1626],{"type":53,"value":1620},"Phase 1 only. Validation (",{"type":47,"tag":90,"props":1622,"children":1624},{"className":1623},[],[1625],{"type":53,"value":489},{"type":53,"value":1627},") logging interval.",{"type":47,"tag":77,"props":1629,"children":1630},{},[1631,1640,1648],{"type":47,"tag":114,"props":1632,"children":1633},{},[1634],{"type":47,"tag":90,"props":1635,"children":1637},{"className":1636},[],[1638],{"type":53,"value":1639},"num_gpus",{"type":47,"tag":114,"props":1641,"children":1642},{},[1643],{"type":47,"tag":90,"props":1644,"children":1646},{"className":1645},[],[1647],{"type":53,"value":354},{"type":47,"tag":114,"props":1649,"children":1650},{},[1651],{"type":53,"value":1652},"Forwarded to Phase 1 (finetune) and Phase 3 (SDG). Eval and search rounds stay single-GPU.",{"type":47,"tag":77,"props":1654,"children":1655},{},[1656,1665,1674],{"type":47,"tag":114,"props":1657,"children":1658},{},[1659],{"type":47,"tag":90,"props":1660,"children":1662},{"className":1661},[],[1663],{"type":53,"value":1664},"model_size",{"type":47,"tag":114,"props":1666,"children":1667},{},[1668],{"type":47,"tag":90,"props":1669,"children":1671},{"className":1670},[],[1672],{"type":53,"value":1673},"2b",{"type":47,"tag":114,"props":1675,"children":1676},{},[1677,1682,1684,1690,1692,1697,1699,1705,1706,1711,1712,1718],{"type":47,"tag":90,"props":1678,"children":1680},{"className":1679},[],[1681],{"type":53,"value":1673},{"type":53,"value":1683}," or ",{"type":47,"tag":90,"props":1685,"children":1687},{"className":1686},[],[1688],{"type":53,"value":1689},"14b",{"type":53,"value":1691},". Used by finetune and SDG. On-disk checkpoint path encodes in upper-case (",{"type":47,"tag":90,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":53,"value":1673},{"type":53,"value":1698},"→",{"type":47,"tag":90,"props":1700,"children":1702},{"className":1701},[],[1703],{"type":53,"value":1704},"2B",{"type":53,"value":138},{"type":47,"tag":90,"props":1707,"children":1709},{"className":1708},[],[1710],{"type":53,"value":1689},{"type":53,"value":1698},{"type":47,"tag":90,"props":1713,"children":1715},{"className":1714},[],[1716],{"type":53,"value":1717},"14B",{"type":53,"value":1719},").",{"type":47,"tag":77,"props":1721,"children":1722},{},[1723,1732,1741],{"type":47,"tag":114,"props":1724,"children":1725},{},[1726],{"type":47,"tag":90,"props":1727,"children":1729},{"className":1728},[],[1730],{"type":53,"value":1731},"lr",{"type":47,"tag":114,"props":1733,"children":1734},{},[1735],{"type":47,"tag":90,"props":1736,"children":1738},{"className":1737},[],[1739],{"type":53,"value":1740},"0.02",{"type":47,"tag":114,"props":1742,"children":1743},{},[1744],{"type":53,"value":1745},"Phase 1 only. Learning rate.",{"type":47,"tag":77,"props":1747,"children":1748},{},[1749,1758,1766],{"type":47,"tag":114,"props":1750,"children":1751},{},[1752],{"type":47,"tag":90,"props":1753,"children":1755},{"className":1754},[],[1756],{"type":53,"value":1757},"batch_size",{"type":47,"tag":114,"props":1759,"children":1760},{},[1761],{"type":47,"tag":90,"props":1762,"children":1764},{"className":1763},[],[1765],{"type":53,"value":386},{"type":47,"tag":114,"props":1767,"children":1768},{},[1769],{"type":53,"value":1770},"Phase 1 only. Per-GPU batch size.",{"type":47,"tag":77,"props":1772,"children":1773},{},[1774,1783,1792],{"type":47,"tag":114,"props":1775,"children":1776},{},[1777],{"type":47,"tag":90,"props":1778,"children":1780},{"className":1779},[],[1781],{"type":53,"value":1782},"image_size",{"type":47,"tag":114,"props":1784,"children":1785},{},[1786],{"type":47,"tag":90,"props":1787,"children":1789},{"className":1788},[],[1790],{"type":53,"value":1791},"512",{"type":47,"tag":114,"props":1793,"children":1794},{},[1795],{"type":53,"value":1796},"Phase 1 only. Training resolution (square).",{"type":47,"tag":77,"props":1798,"children":1799},{},[1800,1809,1818],{"type":47,"tag":114,"props":1801,"children":1802},{},[1803],{"type":47,"tag":90,"props":1804,"children":1806},{"className":1805},[],[1807],{"type":53,"value":1808},"guidance_range",{"type":47,"tag":114,"props":1810,"children":1811},{},[1812],{"type":47,"tag":90,"props":1813,"children":1815},{"className":1814},[],[1816],{"type":53,"value":1817},"1.5 10.0",{"type":47,"tag":114,"props":1819,"children":1820},{},[1821],{"type":53,"value":1822},"Phase 5 search draw range for guidance.",{"type":47,"tag":77,"props":1824,"children":1825},{},[1826,1835,1843],{"type":47,"tag":114,"props":1827,"children":1828},{},[1829],{"type":47,"tag":90,"props":1830,"children":1832},{"className":1831},[],[1833],{"type":53,"value":1834},"crop_ratio_range",{"type":47,"tag":114,"props":1836,"children":1837},{},[1838],{"type":47,"tag":90,"props":1839,"children":1841},{"className":1840},[],[1842],{"type":53,"value":1817},{"type":47,"tag":114,"props":1844,"children":1845},{},[1846],{"type":53,"value":1847},"Phase 5 search draw range for crop_ratio.",{"type":47,"tag":981,"props":1849,"children":1850},{},[],{"type":47,"tag":56,"props":1852,"children":1854},{"id":1853},"mode-validation-fail-fast-before-any-phase",[1855],{"type":53,"value":1856},"Mode validation (fail fast before any phase)",{"type":47,"tag":1009,"props":1858,"children":1859},{},[1860,1902,1943],{"type":47,"tag":1013,"props":1861,"children":1862},{},[1863,1868,1870],{"type":47,"tag":90,"props":1864,"children":1866},{"className":1865},[],[1867],{"type":53,"value":95},{"type":53,"value":1869}," unset → halt: ",{"type":47,"tag":1255,"props":1871,"children":1872},{},[1873,1875,1880,1882,1887,1889,1894,1895,1900],{"type":53,"value":1874},"\"",{"type":47,"tag":90,"props":1876,"children":1878},{"className":1877},[],[1879],{"type":53,"value":95},{"type":53,"value":1881}," is required (",{"type":47,"tag":90,"props":1883,"children":1885},{"className":1884},[],[1886],{"type":53,"value":228},{"type":53,"value":1888}," | ",{"type":47,"tag":90,"props":1890,"children":1892},{"className":1891},[],[1893],{"type":53,"value":127},{"type":53,"value":1888},{"type":47,"tag":90,"props":1896,"children":1898},{"className":1897},[],[1899],{"type":53,"value":186},{"type":53,"value":1901},").\"",{"type":47,"tag":1013,"props":1903,"children":1904},{},[1905,1910,1912,1917,1918,1923,1925],{"type":47,"tag":90,"props":1906,"children":1908},{"className":1907},[],[1909],{"type":53,"value":287},{"type":53,"value":1911}," missing either ",{"type":47,"tag":90,"props":1913,"children":1915},{"className":1914},[],[1916],{"type":53,"value":136},{"type":53,"value":1683},{"type":47,"tag":90,"props":1919,"children":1921},{"className":1920},[],[1922],{"type":53,"value":144},{"type":53,"value":1924}," → halt: ",{"type":47,"tag":1255,"props":1926,"children":1927},{},[1928,1930,1935,1936,1941],{"type":53,"value":1929},"\"inference_only requires both ",{"type":47,"tag":90,"props":1931,"children":1933},{"className":1932},[],[1934],{"type":53,"value":136},{"type":53,"value":273},{"type":47,"tag":90,"props":1937,"children":1939},{"className":1938},[],[1940],{"type":53,"value":144},{"type":53,"value":1942},".\"",{"type":47,"tag":1013,"props":1944,"children":1945},{},[1946,1951,1953,1958,1959,1964,1966],{"type":47,"tag":90,"props":1947,"children":1949},{"className":1948},[],[1950],{"type":53,"value":264},{"type":53,"value":1952}," with ",{"type":47,"tag":90,"props":1954,"children":1956},{"className":1955},[],[1957],{"type":53,"value":136},{"type":53,"value":1683},{"type":47,"tag":90,"props":1960,"children":1962},{"className":1961},[],[1963],{"type":53,"value":144},{"type":53,"value":1965}," supplied → halt: ",{"type":47,"tag":1255,"props":1967,"children":1968},{},[1969,1971,1976],{"type":53,"value":1970},"\"full mode runs finetune; use ",{"type":47,"tag":90,"props":1972,"children":1974},{"className":1973},[],[1975],{"type":53,"value":287},{"type":53,"value":1977}," to reuse an existing checkpoint.\"",{"type":47,"tag":56,"props":1979,"children":1981},{"id":1980},"shared-variables",[1982],{"type":53,"value":1983},"Shared variables",{"type":47,"tag":63,"props":1985,"children":1986},{},[1987],{"type":53,"value":1988},"Set once before Phase 0:",{"type":47,"tag":676,"props":1990,"children":1992},{"className":678,"code":1991,"language":680,"meta":681,"style":681},"MODE=\u003Cfull|inference_only|finetune_only>\nNAME=\u003Cexp>\nDATASET_DIR=\u003Cdataset_dir>\nCLEAN_DIR=${clean_dir:-${DATASET_DIR}}\nCKPT=\u003Ccheckpoint_dir>      # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\nSTEP=\u003Citer>                # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\nNUM_SDG=\u003CN>\nDEFECT_DESC=\u003Cdefect_spec.jsonl>\nDEFECTS=(T+A T+B)          # TEXTURE+TYPE names. For mode=inference_only, derive from ${CKPT}\u002Fag_config.yaml → dataloader_train.dataset.anomaly_types (also printed by validate_checkpoint.py). For mode=full, take from DEFECT_DESC entries. See references\u002Finference.md §Pre-flight checkpoint validation.\nNUM_SEARCH_RUN=${num_search_run:-3}\nNN_THRESHOLD=${nn_threshold:-0.4}\nMODEL_SIZE=\u003C2b|14b>\nNUM_GPUS=${num_gpus:-1}\nMAX_ITER=${max_iter:-75000}\nSAVE_ITER=${save_iter:-5000}\nVALIDATION_ITER=${validation_iter:-5000}\nLR=${lr:-0.02}\nBATCH_SIZE=${batch_size:-2}\nIMAGE_SIZE=${image_size:-512}\nVALIDATION_JSONL=${validation_jsonl:-}  # optional; set by Phase 1 Step 2 if not user-supplied\n\nBASE=results\u002F${NAME}\nJSONL=ag_inference\u002F${NAME}\u002Ftestcase.jsonl\nORIGINAL=${BASE}\u002Foriginal\nSEARCHED=${BASE}\u002Fsearched\nROUNDS=${BASE}\u002Frounds\nREGENS=${BASE}\u002Fregens\n",[1993],{"type":47,"tag":90,"props":1994,"children":1995},{"__ignoreMap":681},[1996,2035,2057,2077,2109,2136,2162,2184,2206,2239,2270,2298,2327,2356,2385,2414,2443,2472,2501,2530,2557,2567,2598,2634,2660,2686,2712],{"type":47,"tag":687,"props":1997,"children":1998},{"class":689,"line":690},[1999,2004,2009,2013,2018,2022,2026,2030],{"type":47,"tag":687,"props":2000,"children":2001},{"style":700},[2002],{"type":53,"value":2003},"MODE",{"type":47,"tag":687,"props":2005,"children":2006},{"style":706},[2007],{"type":53,"value":2008},"=\u003C",{"type":47,"tag":687,"props":2010,"children":2011},{"style":723},[2012],{"type":53,"value":228},{"type":47,"tag":687,"props":2014,"children":2015},{"style":706},[2016],{"type":53,"value":2017},"|",{"type":47,"tag":687,"props":2019,"children":2020},{"style":717},[2021],{"type":53,"value":127},{"type":47,"tag":687,"props":2023,"children":2024},{"style":706},[2025],{"type":53,"value":2017},{"type":47,"tag":687,"props":2027,"children":2028},{"style":717},[2029],{"type":53,"value":186},{"type":47,"tag":687,"props":2031,"children":2032},{"style":700},[2033],{"type":53,"value":2034},">\n",{"type":47,"tag":687,"props":2036,"children":2038},{"class":689,"line":2037},2,[2039,2044,2048,2053],{"type":47,"tag":687,"props":2040,"children":2041},{"style":700},[2042],{"type":53,"value":2043},"NAME",{"type":47,"tag":687,"props":2045,"children":2046},{"style":706},[2047],{"type":53,"value":2008},{"type":47,"tag":687,"props":2049,"children":2050},{"style":723},[2051],{"type":53,"value":2052},"exp",{"type":47,"tag":687,"props":2054,"children":2055},{"style":706},[2056],{"type":53,"value":2034},{"type":47,"tag":687,"props":2058,"children":2059},{"class":689,"line":27},[2060,2065,2069,2073],{"type":47,"tag":687,"props":2061,"children":2062},{"style":700},[2063],{"type":53,"value":2064},"DATASET_DIR",{"type":47,"tag":687,"props":2066,"children":2067},{"style":706},[2068],{"type":53,"value":2008},{"type":47,"tag":687,"props":2070,"children":2071},{"style":723},[2072],{"type":53,"value":158},{"type":47,"tag":687,"props":2074,"children":2075},{"style":706},[2076],{"type":53,"value":2034},{"type":47,"tag":687,"props":2078,"children":2080},{"class":689,"line":2079},4,[2081,2086,2091,2095,2100,2104],{"type":47,"tag":687,"props":2082,"children":2083},{"style":700},[2084],{"type":53,"value":2085},"CLEAN_DIR",{"type":47,"tag":687,"props":2087,"children":2088},{"style":706},[2089],{"type":53,"value":2090},"=${",{"type":47,"tag":687,"props":2092,"children":2093},{"style":700},[2094],{"type":53,"value":1386},{"type":47,"tag":687,"props":2096,"children":2097},{"style":706},[2098],{"type":53,"value":2099},":-${",{"type":47,"tag":687,"props":2101,"children":2102},{"style":700},[2103],{"type":53,"value":2064},{"type":47,"tag":687,"props":2105,"children":2106},{"style":706},[2107],{"type":53,"value":2108},"}}\n",{"type":47,"tag":687,"props":2110,"children":2112},{"class":689,"line":2111},5,[2113,2117,2121,2125,2130],{"type":47,"tag":687,"props":2114,"children":2115},{"style":700},[2116],{"type":53,"value":271},{"type":47,"tag":687,"props":2118,"children":2119},{"style":706},[2120],{"type":53,"value":2008},{"type":47,"tag":687,"props":2122,"children":2123},{"style":723},[2124],{"type":53,"value":136},{"type":47,"tag":687,"props":2126,"children":2127},{"style":706},[2128],{"type":53,"value":2129},">",{"type":47,"tag":687,"props":2131,"children":2133},{"style":2132},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2134],{"type":53,"value":2135},"      # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\n",{"type":47,"tag":687,"props":2137,"children":2139},{"class":689,"line":2138},6,[2140,2144,2148,2153,2157],{"type":47,"tag":687,"props":2141,"children":2142},{"style":700},[2143],{"type":53,"value":279},{"type":47,"tag":687,"props":2145,"children":2146},{"style":706},[2147],{"type":53,"value":2008},{"type":47,"tag":687,"props":2149,"children":2150},{"style":723},[2151],{"type":53,"value":2152},"iter",{"type":47,"tag":687,"props":2154,"children":2155},{"style":706},[2156],{"type":53,"value":2129},{"type":47,"tag":687,"props":2158,"children":2159},{"style":2132},[2160],{"type":53,"value":2161},"                # required iff MODE=inference_only; auto-derived after Phase 1 when MODE=full\n",{"type":47,"tag":687,"props":2163,"children":2165},{"class":689,"line":2164},7,[2166,2171,2175,2180],{"type":47,"tag":687,"props":2167,"children":2168},{"style":700},[2169],{"type":53,"value":2170},"NUM_SDG",{"type":47,"tag":687,"props":2172,"children":2173},{"style":706},[2174],{"type":53,"value":2008},{"type":47,"tag":687,"props":2176,"children":2177},{"style":723},[2178],{"type":53,"value":2179},"N",{"type":47,"tag":687,"props":2181,"children":2182},{"style":706},[2183],{"type":53,"value":2034},{"type":47,"tag":687,"props":2185,"children":2187},{"class":689,"line":2186},8,[2188,2193,2197,2202],{"type":47,"tag":687,"props":2189,"children":2190},{"style":700},[2191],{"type":53,"value":2192},"DEFECT_DESC",{"type":47,"tag":687,"props":2194,"children":2195},{"style":706},[2196],{"type":53,"value":2008},{"type":47,"tag":687,"props":2198,"children":2199},{"style":723},[2200],{"type":53,"value":2201},"defect_spec.jsonl",{"type":47,"tag":687,"props":2203,"children":2204},{"style":706},[2205],{"type":53,"value":2034},{"type":47,"tag":687,"props":2207,"children":2209},{"class":689,"line":2208},9,[2210,2215,2220,2225,2230,2234],{"type":47,"tag":687,"props":2211,"children":2212},{"style":700},[2213],{"type":53,"value":2214},"DEFECTS",{"type":47,"tag":687,"props":2216,"children":2217},{"style":706},[2218],{"type":53,"value":2219},"=(",{"type":47,"tag":687,"props":2221,"children":2222},{"style":723},[2223],{"type":53,"value":2224},"T+A",{"type":47,"tag":687,"props":2226,"children":2227},{"style":723},[2228],{"type":53,"value":2229}," T+B",{"type":47,"tag":687,"props":2231,"children":2232},{"style":706},[2233],{"type":53,"value":731},{"type":47,"tag":687,"props":2235,"children":2236},{"style":2132},[2237],{"type":53,"value":2238},"          # TEXTURE+TYPE names. For mode=inference_only, derive from ${CKPT}\u002Fag_config.yaml → dataloader_train.dataset.anomaly_types (also printed by validate_checkpoint.py). For mode=full, take from DEFECT_DESC entries. See references\u002Finference.md §Pre-flight checkpoint validation.\n",{"type":47,"tag":687,"props":2240,"children":2242},{"class":689,"line":2241},10,[2243,2248,2252,2256,2261,2265],{"type":47,"tag":687,"props":2244,"children":2245},{"style":700},[2246],{"type":53,"value":2247},"NUM_SEARCH_RUN",{"type":47,"tag":687,"props":2249,"children":2250},{"style":706},[2251],{"type":53,"value":2090},{"type":47,"tag":687,"props":2253,"children":2254},{"style":700},[2255],{"type":53,"value":1456},{"type":47,"tag":687,"props":2257,"children":2258},{"style":706},[2259],{"type":53,"value":2260},":-",{"type":47,"tag":687,"props":2262,"children":2263},{"style":700},[2264],{"type":53,"value":413},{"type":47,"tag":687,"props":2266,"children":2267},{"style":706},[2268],{"type":53,"value":2269},"}\n",{"type":47,"tag":687,"props":2271,"children":2272},{"class":689,"line":23},[2273,2278,2282,2286,2290,2294],{"type":47,"tag":687,"props":2274,"children":2275},{"style":700},[2276],{"type":53,"value":2277},"NN_THRESHOLD",{"type":47,"tag":687,"props":2279,"children":2280},{"style":706},[2281],{"type":53,"value":2090},{"type":47,"tag":687,"props":2283,"children":2284},{"style":700},[2285],{"type":53,"value":621},{"type":47,"tag":687,"props":2287,"children":2288},{"style":706},[2289],{"type":53,"value":2260},{"type":47,"tag":687,"props":2291,"children":2292},{"style":700},[2293],{"type":53,"value":629},{"type":47,"tag":687,"props":2295,"children":2296},{"style":706},[2297],{"type":53,"value":2269},{"type":47,"tag":687,"props":2299,"children":2301},{"class":689,"line":2300},12,[2302,2307,2311,2315,2319,2323],{"type":47,"tag":687,"props":2303,"children":2304},{"style":700},[2305],{"type":53,"value":2306},"MODEL_SIZE",{"type":47,"tag":687,"props":2308,"children":2309},{"style":706},[2310],{"type":53,"value":2008},{"type":47,"tag":687,"props":2312,"children":2313},{"style":723},[2314],{"type":53,"value":1673},{"type":47,"tag":687,"props":2316,"children":2317},{"style":706},[2318],{"type":53,"value":2017},{"type":47,"tag":687,"props":2320,"children":2321},{"style":717},[2322],{"type":53,"value":1689},{"type":47,"tag":687,"props":2324,"children":2325},{"style":700},[2326],{"type":53,"value":2034},{"type":47,"tag":687,"props":2328,"children":2330},{"class":689,"line":2329},13,[2331,2336,2340,2344,2348,2352],{"type":47,"tag":687,"props":2332,"children":2333},{"style":700},[2334],{"type":53,"value":2335},"NUM_GPUS",{"type":47,"tag":687,"props":2337,"children":2338},{"style":706},[2339],{"type":53,"value":2090},{"type":47,"tag":687,"props":2341,"children":2342},{"style":700},[2343],{"type":53,"value":1639},{"type":47,"tag":687,"props":2345,"children":2346},{"style":706},[2347],{"type":53,"value":2260},{"type":47,"tag":687,"props":2349,"children":2350},{"style":700},[2351],{"type":53,"value":354},{"type":47,"tag":687,"props":2353,"children":2354},{"style":706},[2355],{"type":53,"value":2269},{"type":47,"tag":687,"props":2357,"children":2359},{"class":689,"line":2358},14,[2360,2365,2369,2373,2377,2381],{"type":47,"tag":687,"props":2361,"children":2362},{"style":700},[2363],{"type":53,"value":2364},"MAX_ITER",{"type":47,"tag":687,"props":2366,"children":2367},{"style":706},[2368],{"type":53,"value":2090},{"type":47,"tag":687,"props":2370,"children":2371},{"style":700},[2372],{"type":53,"value":1555},{"type":47,"tag":687,"props":2374,"children":2375},{"style":706},[2376],{"type":53,"value":2260},{"type":47,"tag":687,"props":2378,"children":2379},{"style":700},[2380],{"type":53,"value":1564},{"type":47,"tag":687,"props":2382,"children":2383},{"style":706},[2384],{"type":53,"value":2269},{"type":47,"tag":687,"props":2386,"children":2388},{"class":689,"line":2387},15,[2389,2394,2398,2402,2406,2410],{"type":47,"tag":687,"props":2390,"children":2391},{"style":700},[2392],{"type":53,"value":2393},"SAVE_ITER",{"type":47,"tag":687,"props":2395,"children":2396},{"style":706},[2397],{"type":53,"value":2090},{"type":47,"tag":687,"props":2399,"children":2400},{"style":700},[2401],{"type":53,"value":1581},{"type":47,"tag":687,"props":2403,"children":2404},{"style":706},[2405],{"type":53,"value":2260},{"type":47,"tag":687,"props":2407,"children":2408},{"style":700},[2409],{"type":53,"value":1590},{"type":47,"tag":687,"props":2411,"children":2412},{"style":706},[2413],{"type":53,"value":2269},{"type":47,"tag":687,"props":2415,"children":2417},{"class":689,"line":2416},16,[2418,2423,2427,2431,2435,2439],{"type":47,"tag":687,"props":2419,"children":2420},{"style":700},[2421],{"type":53,"value":2422},"VALIDATION_ITER",{"type":47,"tag":687,"props":2424,"children":2425},{"style":706},[2426],{"type":53,"value":2090},{"type":47,"tag":687,"props":2428,"children":2429},{"style":700},[2430],{"type":53,"value":1607},{"type":47,"tag":687,"props":2432,"children":2433},{"style":706},[2434],{"type":53,"value":2260},{"type":47,"tag":687,"props":2436,"children":2437},{"style":700},[2438],{"type":53,"value":1590},{"type":47,"tag":687,"props":2440,"children":2441},{"style":706},[2442],{"type":53,"value":2269},{"type":47,"tag":687,"props":2444,"children":2446},{"class":689,"line":2445},17,[2447,2452,2456,2460,2464,2468],{"type":47,"tag":687,"props":2448,"children":2449},{"style":700},[2450],{"type":53,"value":2451},"LR",{"type":47,"tag":687,"props":2453,"children":2454},{"style":706},[2455],{"type":53,"value":2090},{"type":47,"tag":687,"props":2457,"children":2458},{"style":700},[2459],{"type":53,"value":1731},{"type":47,"tag":687,"props":2461,"children":2462},{"style":706},[2463],{"type":53,"value":2260},{"type":47,"tag":687,"props":2465,"children":2466},{"style":700},[2467],{"type":53,"value":1740},{"type":47,"tag":687,"props":2469,"children":2470},{"style":706},[2471],{"type":53,"value":2269},{"type":47,"tag":687,"props":2473,"children":2475},{"class":689,"line":2474},18,[2476,2481,2485,2489,2493,2497],{"type":47,"tag":687,"props":2477,"children":2478},{"style":700},[2479],{"type":53,"value":2480},"BATCH_SIZE",{"type":47,"tag":687,"props":2482,"children":2483},{"style":706},[2484],{"type":53,"value":2090},{"type":47,"tag":687,"props":2486,"children":2487},{"style":700},[2488],{"type":53,"value":1757},{"type":47,"tag":687,"props":2490,"children":2491},{"style":706},[2492],{"type":53,"value":2260},{"type":47,"tag":687,"props":2494,"children":2495},{"style":700},[2496],{"type":53,"value":386},{"type":47,"tag":687,"props":2498,"children":2499},{"style":706},[2500],{"type":53,"value":2269},{"type":47,"tag":687,"props":2502,"children":2504},{"class":689,"line":2503},19,[2505,2510,2514,2518,2522,2526],{"type":47,"tag":687,"props":2506,"children":2507},{"style":700},[2508],{"type":53,"value":2509},"IMAGE_SIZE",{"type":47,"tag":687,"props":2511,"children":2512},{"style":706},[2513],{"type":53,"value":2090},{"type":47,"tag":687,"props":2515,"children":2516},{"style":700},[2517],{"type":53,"value":1782},{"type":47,"tag":687,"props":2519,"children":2520},{"style":706},[2521],{"type":53,"value":2260},{"type":47,"tag":687,"props":2523,"children":2524},{"style":700},[2525],{"type":53,"value":1791},{"type":47,"tag":687,"props":2527,"children":2528},{"style":706},[2529],{"type":53,"value":2269},{"type":47,"tag":687,"props":2531,"children":2533},{"class":689,"line":2532},20,[2534,2539,2543,2547,2552],{"type":47,"tag":687,"props":2535,"children":2536},{"style":700},[2537],{"type":53,"value":2538},"VALIDATION_JSONL",{"type":47,"tag":687,"props":2540,"children":2541},{"style":706},[2542],{"type":53,"value":2090},{"type":47,"tag":687,"props":2544,"children":2545},{"style":700},[2546],{"type":53,"value":1427},{"type":47,"tag":687,"props":2548,"children":2549},{"style":706},[2550],{"type":53,"value":2551},":-}",{"type":47,"tag":687,"props":2553,"children":2554},{"style":2132},[2555],{"type":53,"value":2556},"  # optional; set by Phase 1 Step 2 if not user-supplied\n",{"type":47,"tag":687,"props":2558,"children":2560},{"class":689,"line":2559},21,[2561],{"type":47,"tag":687,"props":2562,"children":2564},{"emptyLinePlaceholder":2563},true,[2565],{"type":53,"value":2566},"\n",{"type":47,"tag":687,"props":2568,"children":2570},{"class":689,"line":2569},22,[2571,2576,2580,2585,2590,2594],{"type":47,"tag":687,"props":2572,"children":2573},{"style":700},[2574],{"type":53,"value":2575},"BASE",{"type":47,"tag":687,"props":2577,"children":2578},{"style":706},[2579],{"type":53,"value":709},{"type":47,"tag":687,"props":2581,"children":2582},{"style":723},[2583],{"type":53,"value":2584},"results\u002F",{"type":47,"tag":687,"props":2586,"children":2587},{"style":706},[2588],{"type":53,"value":2589},"${",{"type":47,"tag":687,"props":2591,"children":2592},{"style":700},[2593],{"type":53,"value":2043},{"type":47,"tag":687,"props":2595,"children":2596},{"style":706},[2597],{"type":53,"value":2269},{"type":47,"tag":687,"props":2599,"children":2601},{"class":689,"line":2600},23,[2602,2607,2611,2616,2620,2624,2629],{"type":47,"tag":687,"props":2603,"children":2604},{"style":700},[2605],{"type":53,"value":2606},"JSONL",{"type":47,"tag":687,"props":2608,"children":2609},{"style":706},[2610],{"type":53,"value":709},{"type":47,"tag":687,"props":2612,"children":2613},{"style":723},[2614],{"type":53,"value":2615},"ag_inference\u002F",{"type":47,"tag":687,"props":2617,"children":2618},{"style":706},[2619],{"type":53,"value":2589},{"type":47,"tag":687,"props":2621,"children":2622},{"style":700},[2623],{"type":53,"value":2043},{"type":47,"tag":687,"props":2625,"children":2626},{"style":706},[2627],{"type":53,"value":2628},"}",{"type":47,"tag":687,"props":2630,"children":2631},{"style":723},[2632],{"type":53,"value":2633},"\u002Ftestcase.jsonl\n",{"type":47,"tag":687,"props":2635,"children":2637},{"class":689,"line":2636},24,[2638,2643,2647,2651,2655],{"type":47,"tag":687,"props":2639,"children":2640},{"style":700},[2641],{"type":53,"value":2642},"ORIGINAL",{"type":47,"tag":687,"props":2644,"children":2645},{"style":706},[2646],{"type":53,"value":2090},{"type":47,"tag":687,"props":2648,"children":2649},{"style":700},[2650],{"type":53,"value":2575},{"type":47,"tag":687,"props":2652,"children":2653},{"style":706},[2654],{"type":53,"value":2628},{"type":47,"tag":687,"props":2656,"children":2657},{"style":723},[2658],{"type":53,"value":2659},"\u002Foriginal\n",{"type":47,"tag":687,"props":2661,"children":2663},{"class":689,"line":2662},25,[2664,2669,2673,2677,2681],{"type":47,"tag":687,"props":2665,"children":2666},{"style":700},[2667],{"type":53,"value":2668},"SEARCHED",{"type":47,"tag":687,"props":2670,"children":2671},{"style":706},[2672],{"type":53,"value":2090},{"type":47,"tag":687,"props":2674,"children":2675},{"style":700},[2676],{"type":53,"value":2575},{"type":47,"tag":687,"props":2678,"children":2679},{"style":706},[2680],{"type":53,"value":2628},{"type":47,"tag":687,"props":2682,"children":2683},{"style":723},[2684],{"type":53,"value":2685},"\u002Fsearched\n",{"type":47,"tag":687,"props":2687,"children":2689},{"class":689,"line":2688},26,[2690,2695,2699,2703,2707],{"type":47,"tag":687,"props":2691,"children":2692},{"style":700},[2693],{"type":53,"value":2694},"ROUNDS",{"type":47,"tag":687,"props":2696,"children":2697},{"style":706},[2698],{"type":53,"value":2090},{"type":47,"tag":687,"props":2700,"children":2701},{"style":700},[2702],{"type":53,"value":2575},{"type":47,"tag":687,"props":2704,"children":2705},{"style":706},[2706],{"type":53,"value":2628},{"type":47,"tag":687,"props":2708,"children":2709},{"style":723},[2710],{"type":53,"value":2711},"\u002Frounds\n",{"type":47,"tag":687,"props":2713,"children":2715},{"class":689,"line":2714},27,[2716,2721,2725,2729,2733],{"type":47,"tag":687,"props":2717,"children":2718},{"style":700},[2719],{"type":53,"value":2720},"REGENS",{"type":47,"tag":687,"props":2722,"children":2723},{"style":706},[2724],{"type":53,"value":2090},{"type":47,"tag":687,"props":2726,"children":2727},{"style":700},[2728],{"type":53,"value":2575},{"type":47,"tag":687,"props":2730,"children":2731},{"style":706},[2732],{"type":53,"value":2628},{"type":47,"tag":687,"props":2734,"children":2735},{"style":723},[2736],{"type":53,"value":2737},"\u002Fregens\n",{"type":47,"tag":56,"props":2739,"children":2741},{"id":2740},"guard-preflight-product-mode-only",[2742],{"type":53,"value":2743},"Guard preflight (product mode only)",{"type":47,"tag":676,"props":2745,"children":2747},{"className":678,"code":2746,"language":680,"meta":681,"style":681},"if [[ \"${ANOMALYGEN_PRODUCT_MODE:-}\" == \"1\" ]]; then\n    python3 .agents\u002Fskills\u002Fanomalygen-guard\u002Fscripts\u002Fpreflight.py \\\n        --mode ${MODE} \\\n        --name ${NAME} \\\n        --dataset-dir ${DATASET_DIR} \\\n        --defect-spec ${DEFECT_DESC} \\\n        --num-search-run ${NUM_SEARCH_RUN} \\\n        --model-size ${MODEL_SIZE} \\\n        ${CLEAN_DIR:+--clean-dir ${CLEAN_DIR}} \\\n        ${NUM_SDG:+--num-sdg ${NUM_SDG}} \\\n        ${CKPT:+--checkpoint-dir ${CKPT}} \\\n        ${STEP:+--step ${STEP}} \\\n        ${VALIDATION_JSONL:+--validation-jsonl ${VALIDATION_JSONL}}\nfi\n",[2748],{"type":47,"tag":90,"props":2749,"children":2750},{"__ignoreMap":681},[2751,2808,2826,2851,2875,2899,2923,2947,2971,3009,3045,3081,3117,3149],{"type":47,"tag":687,"props":2752,"children":2753},{"class":689,"line":690},[2754,2760,2765,2770,2775,2780,2785,2790,2794,2798,2803],{"type":47,"tag":687,"props":2755,"children":2757},{"style":2756},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[2758],{"type":53,"value":2759},"if",{"type":47,"tag":687,"props":2761,"children":2762},{"style":706},[2763],{"type":53,"value":2764}," [[",{"type":47,"tag":687,"props":2766,"children":2767},{"style":706},[2768],{"type":53,"value":2769}," \"${",{"type":47,"tag":687,"props":2771,"children":2772},{"style":700},[2773],{"type":53,"value":2774},"ANOMALYGEN_PRODUCT_MODE",{"type":47,"tag":687,"props":2776,"children":2777},{"style":706},[2778],{"type":53,"value":2779},":-}\"",{"type":47,"tag":687,"props":2781,"children":2782},{"style":706},[2783],{"type":53,"value":2784}," ==",{"type":47,"tag":687,"props":2786,"children":2787},{"style":706},[2788],{"type":53,"value":2789}," \"",{"type":47,"tag":687,"props":2791,"children":2792},{"style":723},[2793],{"type":53,"value":354},{"type":47,"tag":687,"props":2795,"children":2796},{"style":706},[2797],{"type":53,"value":1874},{"type":47,"tag":687,"props":2799,"children":2800},{"style":706},[2801],{"type":53,"value":2802}," ]];",{"type":47,"tag":687,"props":2804,"children":2805},{"style":2756},[2806],{"type":53,"value":2807}," then\n",{"type":47,"tag":687,"props":2809,"children":2810},{"class":689,"line":2037},[2811,2816,2821],{"type":47,"tag":687,"props":2812,"children":2813},{"style":717},[2814],{"type":53,"value":2815},"    python3",{"type":47,"tag":687,"props":2817,"children":2818},{"style":723},[2819],{"type":53,"value":2820}," .agents\u002Fskills\u002Fanomalygen-guard\u002Fscripts\u002Fpreflight.py",{"type":47,"tag":687,"props":2822,"children":2823},{"style":700},[2824],{"type":53,"value":2825}," \\\n",{"type":47,"tag":687,"props":2827,"children":2828},{"class":689,"line":27},[2829,2834,2839,2843,2847],{"type":47,"tag":687,"props":2830,"children":2831},{"style":723},[2832],{"type":53,"value":2833},"        --mode",{"type":47,"tag":687,"props":2835,"children":2836},{"style":706},[2837],{"type":53,"value":2838}," ${",{"type":47,"tag":687,"props":2840,"children":2841},{"style":700},[2842],{"type":53,"value":2003},{"type":47,"tag":687,"props":2844,"children":2845},{"style":706},[2846],{"type":53,"value":2628},{"type":47,"tag":687,"props":2848,"children":2849},{"style":700},[2850],{"type":53,"value":2825},{"type":47,"tag":687,"props":2852,"children":2853},{"class":689,"line":2079},[2854,2859,2863,2867,2871],{"type":47,"tag":687,"props":2855,"children":2856},{"style":723},[2857],{"type":53,"value":2858},"        --name",{"type":47,"tag":687,"props":2860,"children":2861},{"style":706},[2862],{"type":53,"value":2838},{"type":47,"tag":687,"props":2864,"children":2865},{"style":700},[2866],{"type":53,"value":2043},{"type":47,"tag":687,"props":2868,"children":2869},{"style":706},[2870],{"type":53,"value":2628},{"type":47,"tag":687,"props":2872,"children":2873},{"style":700},[2874],{"type":53,"value":2825},{"type":47,"tag":687,"props":2876,"children":2877},{"class":689,"line":2111},[2878,2883,2887,2891,2895],{"type":47,"tag":687,"props":2879,"children":2880},{"style":723},[2881],{"type":53,"value":2882},"        --dataset-dir",{"type":47,"tag":687,"props":2884,"children":2885},{"style":706},[2886],{"type":53,"value":2838},{"type":47,"tag":687,"props":2888,"children":2889},{"style":700},[2890],{"type":53,"value":2064},{"type":47,"tag":687,"props":2892,"children":2893},{"style":706},[2894],{"type":53,"value":2628},{"type":47,"tag":687,"props":2896,"children":2897},{"style":700},[2898],{"type":53,"value":2825},{"type":47,"tag":687,"props":2900,"children":2901},{"class":689,"line":2138},[2902,2907,2911,2915,2919],{"type":47,"tag":687,"props":2903,"children":2904},{"style":723},[2905],{"type":53,"value":2906},"        --defect-spec",{"type":47,"tag":687,"props":2908,"children":2909},{"style":706},[2910],{"type":53,"value":2838},{"type":47,"tag":687,"props":2912,"children":2913},{"style":700},[2914],{"type":53,"value":2192},{"type":47,"tag":687,"props":2916,"children":2917},{"style":706},[2918],{"type":53,"value":2628},{"type":47,"tag":687,"props":2920,"children":2921},{"style":700},[2922],{"type":53,"value":2825},{"type":47,"tag":687,"props":2924,"children":2925},{"class":689,"line":2164},[2926,2931,2935,2939,2943],{"type":47,"tag":687,"props":2927,"children":2928},{"style":723},[2929],{"type":53,"value":2930},"        --num-search-run",{"type":47,"tag":687,"props":2932,"children":2933},{"style":706},[2934],{"type":53,"value":2838},{"type":47,"tag":687,"props":2936,"children":2937},{"style":700},[2938],{"type":53,"value":2247},{"type":47,"tag":687,"props":2940,"children":2941},{"style":706},[2942],{"type":53,"value":2628},{"type":47,"tag":687,"props":2944,"children":2945},{"style":700},[2946],{"type":53,"value":2825},{"type":47,"tag":687,"props":2948,"children":2949},{"class":689,"line":2186},[2950,2955,2959,2963,2967],{"type":47,"tag":687,"props":2951,"children":2952},{"style":723},[2953],{"type":53,"value":2954},"        --model-size",{"type":47,"tag":687,"props":2956,"children":2957},{"style":706},[2958],{"type":53,"value":2838},{"type":47,"tag":687,"props":2960,"children":2961},{"style":700},[2962],{"type":53,"value":2306},{"type":47,"tag":687,"props":2964,"children":2965},{"style":706},[2966],{"type":53,"value":2628},{"type":47,"tag":687,"props":2968,"children":2969},{"style":700},[2970],{"type":53,"value":2825},{"type":47,"tag":687,"props":2972,"children":2973},{"class":689,"line":2208},[2974,2979,2983,2987,2992,2996,3000,3005],{"type":47,"tag":687,"props":2975,"children":2976},{"style":706},[2977],{"type":53,"value":2978},"        ${",{"type":47,"tag":687,"props":2980,"children":2981},{"style":700},[2982],{"type":53,"value":2085},{"type":47,"tag":687,"props":2984,"children":2985},{"style":706},[2986],{"type":53,"value":1007},{"type":47,"tag":687,"props":2988,"children":2989},{"style":700},[2990],{"type":53,"value":2991},"+--clean-dir ",{"type":47,"tag":687,"props":2993,"children":2994},{"style":706},[2995],{"type":53,"value":2589},{"type":47,"tag":687,"props":2997,"children":2998},{"style":700},[2999],{"type":53,"value":2085},{"type":47,"tag":687,"props":3001,"children":3002},{"style":706},[3003],{"type":53,"value":3004},"}}",{"type":47,"tag":687,"props":3006,"children":3007},{"style":700},[3008],{"type":53,"value":2825},{"type":47,"tag":687,"props":3010,"children":3011},{"class":689,"line":2241},[3012,3016,3020,3024,3029,3033,3037,3041],{"type":47,"tag":687,"props":3013,"children":3014},{"style":706},[3015],{"type":53,"value":2978},{"type":47,"tag":687,"props":3017,"children":3018},{"style":700},[3019],{"type":53,"value":2170},{"type":47,"tag":687,"props":3021,"children":3022},{"style":706},[3023],{"type":53,"value":1007},{"type":47,"tag":687,"props":3025,"children":3026},{"style":700},[3027],{"type":53,"value":3028},"+--num-sdg ",{"type":47,"tag":687,"props":3030,"children":3031},{"style":706},[3032],{"type":53,"value":2589},{"type":47,"tag":687,"props":3034,"children":3035},{"style":700},[3036],{"type":53,"value":2170},{"type":47,"tag":687,"props":3038,"children":3039},{"style":706},[3040],{"type":53,"value":3004},{"type":47,"tag":687,"props":3042,"children":3043},{"style":700},[3044],{"type":53,"value":2825},{"type":47,"tag":687,"props":3046,"children":3047},{"class":689,"line":23},[3048,3052,3056,3060,3065,3069,3073,3077],{"type":47,"tag":687,"props":3049,"children":3050},{"style":706},[3051],{"type":53,"value":2978},{"type":47,"tag":687,"props":3053,"children":3054},{"style":700},[3055],{"type":53,"value":271},{"type":47,"tag":687,"props":3057,"children":3058},{"style":706},[3059],{"type":53,"value":1007},{"type":47,"tag":687,"props":3061,"children":3062},{"style":700},[3063],{"type":53,"value":3064},"+--checkpoint-dir ",{"type":47,"tag":687,"props":3066,"children":3067},{"style":706},[3068],{"type":53,"value":2589},{"type":47,"tag":687,"props":3070,"children":3071},{"style":700},[3072],{"type":53,"value":271},{"type":47,"tag":687,"props":3074,"children":3075},{"style":706},[3076],{"type":53,"value":3004},{"type":47,"tag":687,"props":3078,"children":3079},{"style":700},[3080],{"type":53,"value":2825},{"type":47,"tag":687,"props":3082,"children":3083},{"class":689,"line":2300},[3084,3088,3092,3096,3101,3105,3109,3113],{"type":47,"tag":687,"props":3085,"children":3086},{"style":706},[3087],{"type":53,"value":2978},{"type":47,"tag":687,"props":3089,"children":3090},{"style":700},[3091],{"type":53,"value":279},{"type":47,"tag":687,"props":3093,"children":3094},{"style":706},[3095],{"type":53,"value":1007},{"type":47,"tag":687,"props":3097,"children":3098},{"style":700},[3099],{"type":53,"value":3100},"+--step ",{"type":47,"tag":687,"props":3102,"children":3103},{"style":706},[3104],{"type":53,"value":2589},{"type":47,"tag":687,"props":3106,"children":3107},{"style":700},[3108],{"type":53,"value":279},{"type":47,"tag":687,"props":3110,"children":3111},{"style":706},[3112],{"type":53,"value":3004},{"type":47,"tag":687,"props":3114,"children":3115},{"style":700},[3116],{"type":53,"value":2825},{"type":47,"tag":687,"props":3118,"children":3119},{"class":689,"line":2329},[3120,3124,3128,3132,3137,3141,3145],{"type":47,"tag":687,"props":3121,"children":3122},{"style":706},[3123],{"type":53,"value":2978},{"type":47,"tag":687,"props":3125,"children":3126},{"style":700},[3127],{"type":53,"value":2538},{"type":47,"tag":687,"props":3129,"children":3130},{"style":706},[3131],{"type":53,"value":1007},{"type":47,"tag":687,"props":3133,"children":3134},{"style":700},[3135],{"type":53,"value":3136},"+--validation-jsonl ",{"type":47,"tag":687,"props":3138,"children":3139},{"style":706},[3140],{"type":53,"value":2589},{"type":47,"tag":687,"props":3142,"children":3143},{"style":700},[3144],{"type":53,"value":2538},{"type":47,"tag":687,"props":3146,"children":3147},{"style":706},[3148],{"type":53,"value":2108},{"type":47,"tag":687,"props":3150,"children":3151},{"class":689,"line":2358},[3152],{"type":47,"tag":687,"props":3153,"children":3154},{"style":2756},[3155],{"type":53,"value":3156},"fi\n",{"type":47,"tag":63,"props":3158,"children":3159},{},[3160,3166,3168,3173,3175,3181,3182,3188,3190,3196],{"type":47,"tag":90,"props":3161,"children":3163},{"className":3162},[],[3164],{"type":53,"value":3165},"--validation-jsonl",{"type":53,"value":3167}," is forwarded only when the user supplied one; preflight\nthen verifies every ",{"type":47,"tag":90,"props":3169,"children":3171},{"className":3170},[],[3172],{"type":53,"value":201},{"type":53,"value":3174}," type appears in the file and that\n",{"type":47,"tag":90,"props":3176,"children":3178},{"className":3177},[],[3179],{"type":53,"value":3180},"image_filename",{"type":53,"value":1311},{"type":47,"tag":90,"props":3183,"children":3185},{"className":3184},[],[3186],{"type":53,"value":3187},"mask_filename",{"type":53,"value":3189}," paths exist. Auto-generated validation\nJSONLs are caught upstream by ",{"type":47,"tag":90,"props":3191,"children":3193},{"className":3192},[],[3194],{"type":53,"value":3195},"allocate_samples.py",{"type":53,"value":3197},", which refuses to\nallocate 0 entries to any defect.",{"type":47,"tag":63,"props":3199,"children":3200},{},[3201,3202,3208,3210,3216],{"type":53,"value":957},{"type":47,"tag":90,"props":3203,"children":3205},{"className":3204},[],[3206],{"type":53,"value":3207},"MODE=finetune_only",{"type":53,"value":3209},", omit ",{"type":47,"tag":90,"props":3211,"children":3213},{"className":3212},[],[3214],{"type":53,"value":3215},"--num-sdg",{"type":53,"value":3217}," if the user did not supply one.",{"type":47,"tag":981,"props":3219,"children":3220},{},[],{"type":47,"tag":56,"props":3222,"children":3224},{"id":3223},"phase-0-checkpoints",[3225],{"type":53,"value":3226},"Phase 0 — checkpoints",{"type":47,"tag":63,"props":3228,"children":3229},{},[3230,3232,3238],{"type":53,"value":3231},"Read ",{"type":47,"tag":90,"props":3233,"children":3235},{"className":3234},[],[3236],{"type":53,"value":3237},"references\u002Ffinetune.md §Phase 0",{"type":53,"value":3239}," for HF_TOKEN requirements and what\ngets downloaded (~140 GB). Verify first; download only what is missing.",{"type":47,"tag":676,"props":3241,"children":3243},{"className":678,"code":3242,"language":680,"meta":681,"style":681},"${ANOMALYGEN_SCRIPTS}\u002Fcheck.sh \\\n    || ${ANOMALYGEN_SCRIPTS}\u002Fdownload_checkpoints.sh\n",[3244],{"type":47,"tag":90,"props":3245,"children":3246},{"__ignoreMap":681},[3247,3268],{"type":47,"tag":687,"props":3248,"children":3249},{"class":689,"line":690},[3250,3254,3259,3263],{"type":47,"tag":687,"props":3251,"children":3252},{"style":706},[3253],{"type":53,"value":2589},{"type":47,"tag":687,"props":3255,"children":3256},{"style":700},[3257],{"type":53,"value":3258},"ANOMALYGEN_SCRIPTS",{"type":47,"tag":687,"props":3260,"children":3261},{"style":706},[3262],{"type":53,"value":2628},{"type":47,"tag":687,"props":3264,"children":3265},{"style":700},[3266],{"type":53,"value":3267},"\u002Fcheck.sh \\\n",{"type":47,"tag":687,"props":3269,"children":3270},{"class":689,"line":2037},[3271,3276,3280,3284,3288],{"type":47,"tag":687,"props":3272,"children":3273},{"style":706},[3274],{"type":53,"value":3275},"    ||",{"type":47,"tag":687,"props":3277,"children":3278},{"style":706},[3279],{"type":53,"value":2838},{"type":47,"tag":687,"props":3281,"children":3282},{"style":700},[3283],{"type":53,"value":3258},{"type":47,"tag":687,"props":3285,"children":3286},{"style":706},[3287],{"type":53,"value":2628},{"type":47,"tag":687,"props":3289,"children":3290},{"style":717},[3291],{"type":53,"value":3292},"\u002Fdownload_checkpoints.sh\n",{"type":47,"tag":981,"props":3294,"children":3295},{},[],{"type":47,"tag":56,"props":3297,"children":3299},{"id":3298},"phase-1-fine-tune-skip-when-modeinference_only",[3300,3302,3308],{"type":53,"value":3301},"Phase 1 — fine-tune (skip when ",{"type":47,"tag":90,"props":3303,"children":3305},{"className":3304},[],[3306],{"type":53,"value":3307},"MODE=inference_only",{"type":53,"value":731},{"type":47,"tag":63,"props":3310,"children":3311},{},[3312,3313,3319],{"type":53,"value":3231},{"type":47,"tag":90,"props":3314,"children":3316},{"className":3315},[],[3317],{"type":53,"value":3318},"references\u002Ffinetune.md §Phase 1",{"type":53,"value":3320}," for dataset structure, config\ntemplate details, and best-checkpoint selection.",{"type":47,"tag":676,"props":3322,"children":3324},{"className":678,"code":3323,"language":680,"meta":681,"style":681},"# Step 1: Validate dataset structure — derive anomaly types\npython3 -m scripts.utilities.validate_dataset ${DATASET_DIR}\n\n# Step 2: Generate validation JSONL (skip if user provided VALIDATION_JSONL)\n# num_SDG = total training mask count from Step 1 output\n# --mode validation is required (prep_testcase.sh default is inference).\n${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name validation_${NAME} \\\n    --num-sdg \u003Ctotal_mask_count> \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002Fvalidation_${NAME}\u002Famp \\\n    --output-jsonl ag_inference\u002Fvalidation_${NAME}\u002Ftestcase.jsonl \\\n    --mode validation\nVALIDATION_JSONL=ag_inference\u002Fvalidation_${NAME}\u002Ftestcase.jsonl\n\n# Step 3: Generate training config — show to user and confirm before writing\npython3 -m scripts.utilities.generate_config \\\n    --name ${NAME} --dataset-dir ${DATASET_DIR} \\\n    --defect-spec ${DEFECT_DESC} --validation-jsonl ${VALIDATION_JSONL} \\\n    --output ag_configs\u002F${NAME}.yaml \\\n    --model-size ${MODEL_SIZE} --max-iter ${MAX_ITER} \\\n    --save-iter ${SAVE_ITER} --validation-iter ${VALIDATION_ITER} \\\n    --lr ${LR} --batch-size ${BATCH_SIZE} \\\n    --image-size ${IMAGE_SIZE}\n\n# Step 4: Launch training (run in background)\n${ANOMALYGEN_SCRIPTS}\u002Flaunch_training.sh \\\n    --ag-config ag_configs\u002F${NAME}.yaml \\\n    --num-gpus ${NUM_GPUS} \\\n    --model-size ${MODEL_SIZE}\n",[3325],{"type":47,"tag":90,"props":3326,"children":3327},{"__ignoreMap":681},[3328,3336,3366,3373,3381,3389,3397,3417,3446,3477,3501,3525,3549,3583,3616,3629,3661,3668,3676,3696,3736,3776,3810,3851,3892,3933,3953,3960,3969,3990,4023,4048],{"type":47,"tag":687,"props":3329,"children":3330},{"class":689,"line":690},[3331],{"type":47,"tag":687,"props":3332,"children":3333},{"style":2132},[3334],{"type":53,"value":3335},"# Step 1: Validate dataset structure — derive anomaly types\n",{"type":47,"tag":687,"props":3337,"children":3338},{"class":689,"line":2037},[3339,3344,3349,3354,3358,3362],{"type":47,"tag":687,"props":3340,"children":3341},{"style":717},[3342],{"type":53,"value":3343},"python3",{"type":47,"tag":687,"props":3345,"children":3346},{"style":723},[3347],{"type":53,"value":3348}," -m",{"type":47,"tag":687,"props":3350,"children":3351},{"style":723},[3352],{"type":53,"value":3353}," scripts.utilities.validate_dataset",{"type":47,"tag":687,"props":3355,"children":3356},{"style":706},[3357],{"type":53,"value":2838},{"type":47,"tag":687,"props":3359,"children":3360},{"style":700},[3361],{"type":53,"value":2064},{"type":47,"tag":687,"props":3363,"children":3364},{"style":706},[3365],{"type":53,"value":2269},{"type":47,"tag":687,"props":3367,"children":3368},{"class":689,"line":27},[3369],{"type":47,"tag":687,"props":3370,"children":3371},{"emptyLinePlaceholder":2563},[3372],{"type":53,"value":2566},{"type":47,"tag":687,"props":3374,"children":3375},{"class":689,"line":2079},[3376],{"type":47,"tag":687,"props":3377,"children":3378},{"style":2132},[3379],{"type":53,"value":3380},"# Step 2: Generate validation JSONL (skip if user provided VALIDATION_JSONL)\n",{"type":47,"tag":687,"props":3382,"children":3383},{"class":689,"line":2111},[3384],{"type":47,"tag":687,"props":3385,"children":3386},{"style":2132},[3387],{"type":53,"value":3388},"# num_SDG = total training mask count from Step 1 output\n",{"type":47,"tag":687,"props":3390,"children":3391},{"class":689,"line":2138},[3392],{"type":47,"tag":687,"props":3393,"children":3394},{"style":2132},[3395],{"type":53,"value":3396},"# --mode validation is required (prep_testcase.sh default is inference).\n",{"type":47,"tag":687,"props":3398,"children":3399},{"class":689,"line":2164},[3400,3404,3408,3412],{"type":47,"tag":687,"props":3401,"children":3402},{"style":706},[3403],{"type":53,"value":2589},{"type":47,"tag":687,"props":3405,"children":3406},{"style":700},[3407],{"type":53,"value":3258},{"type":47,"tag":687,"props":3409,"children":3410},{"style":706},[3411],{"type":53,"value":2628},{"type":47,"tag":687,"props":3413,"children":3414},{"style":700},[3415],{"type":53,"value":3416},"\u002Fprep_testcase.sh \\\n",{"type":47,"tag":687,"props":3418,"children":3419},{"class":689,"line":2186},[3420,3425,3430,3434,3438,3442],{"type":47,"tag":687,"props":3421,"children":3422},{"style":717},[3423],{"type":53,"value":3424},"    --name",{"type":47,"tag":687,"props":3426,"children":3427},{"style":723},[3428],{"type":53,"value":3429}," validation_",{"type":47,"tag":687,"props":3431,"children":3432},{"style":706},[3433],{"type":53,"value":2589},{"type":47,"tag":687,"props":3435,"children":3436},{"style":700},[3437],{"type":53,"value":2043},{"type":47,"tag":687,"props":3439,"children":3440},{"style":706},[3441],{"type":53,"value":2628},{"type":47,"tag":687,"props":3443,"children":3444},{"style":700},[3445],{"type":53,"value":2825},{"type":47,"tag":687,"props":3447,"children":3448},{"class":689,"line":2208},[3449,3454,3459,3464,3469,3473],{"type":47,"tag":687,"props":3450,"children":3451},{"style":723},[3452],{"type":53,"value":3453},"    --num-sdg",{"type":47,"tag":687,"props":3455,"children":3456},{"style":706},[3457],{"type":53,"value":3458}," \u003C",{"type":47,"tag":687,"props":3460,"children":3461},{"style":723},[3462],{"type":53,"value":3463},"total_mask_coun",{"type":47,"tag":687,"props":3465,"children":3466},{"style":700},[3467],{"type":53,"value":3468},"t",{"type":47,"tag":687,"props":3470,"children":3471},{"style":706},[3472],{"type":53,"value":2129},{"type":47,"tag":687,"props":3474,"children":3475},{"style":700},[3476],{"type":53,"value":2825},{"type":47,"tag":687,"props":3478,"children":3479},{"class":689,"line":2241},[3480,3485,3489,3493,3497],{"type":47,"tag":687,"props":3481,"children":3482},{"style":723},[3483],{"type":53,"value":3484},"    --dataset-dir",{"type":47,"tag":687,"props":3486,"children":3487},{"style":706},[3488],{"type":53,"value":2838},{"type":47,"tag":687,"props":3490,"children":3491},{"style":700},[3492],{"type":53,"value":2064},{"type":47,"tag":687,"props":3494,"children":3495},{"style":706},[3496],{"type":53,"value":2628},{"type":47,"tag":687,"props":3498,"children":3499},{"style":700},[3500],{"type":53,"value":2825},{"type":47,"tag":687,"props":3502,"children":3503},{"class":689,"line":23},[3504,3509,3513,3517,3521],{"type":47,"tag":687,"props":3505,"children":3506},{"style":723},[3507],{"type":53,"value":3508},"    --clean-dir",{"type":47,"tag":687,"props":3510,"children":3511},{"style":706},[3512],{"type":53,"value":2838},{"type":47,"tag":687,"props":3514,"children":3515},{"style":700},[3516],{"type":53,"value":2085},{"type":47,"tag":687,"props":3518,"children":3519},{"style":706},[3520],{"type":53,"value":2628},{"type":47,"tag":687,"props":3522,"children":3523},{"style":700},[3524],{"type":53,"value":2825},{"type":47,"tag":687,"props":3526,"children":3527},{"class":689,"line":2300},[3528,3533,3537,3541,3545],{"type":47,"tag":687,"props":3529,"children":3530},{"style":723},[3531],{"type":53,"value":3532},"    --defect-spec",{"type":47,"tag":687,"props":3534,"children":3535},{"style":706},[3536],{"type":53,"value":2838},{"type":47,"tag":687,"props":3538,"children":3539},{"style":700},[3540],{"type":53,"value":2192},{"type":47,"tag":687,"props":3542,"children":3543},{"style":706},[3544],{"type":53,"value":2628},{"type":47,"tag":687,"props":3546,"children":3547},{"style":700},[3548],{"type":53,"value":2825},{"type":47,"tag":687,"props":3550,"children":3551},{"class":689,"line":2329},[3552,3557,3562,3566,3570,3574,3579],{"type":47,"tag":687,"props":3553,"children":3554},{"style":723},[3555],{"type":53,"value":3556},"    --amp-output-dir",{"type":47,"tag":687,"props":3558,"children":3559},{"style":723},[3560],{"type":53,"value":3561}," ag_inference\u002Fvalidation_",{"type":47,"tag":687,"props":3563,"children":3564},{"style":706},[3565],{"type":53,"value":2589},{"type":47,"tag":687,"props":3567,"children":3568},{"style":700},[3569],{"type":53,"value":2043},{"type":47,"tag":687,"props":3571,"children":3572},{"style":706},[3573],{"type":53,"value":2628},{"type":47,"tag":687,"props":3575,"children":3576},{"style":723},[3577],{"type":53,"value":3578},"\u002Famp",{"type":47,"tag":687,"props":3580,"children":3581},{"style":700},[3582],{"type":53,"value":2825},{"type":47,"tag":687,"props":3584,"children":3585},{"class":689,"line":2358},[3586,3591,3595,3599,3603,3607,3612],{"type":47,"tag":687,"props":3587,"children":3588},{"style":723},[3589],{"type":53,"value":3590},"    --output-jsonl",{"type":47,"tag":687,"props":3592,"children":3593},{"style":723},[3594],{"type":53,"value":3561},{"type":47,"tag":687,"props":3596,"children":3597},{"style":706},[3598],{"type":53,"value":2589},{"type":47,"tag":687,"props":3600,"children":3601},{"style":700},[3602],{"type":53,"value":2043},{"type":47,"tag":687,"props":3604,"children":3605},{"style":706},[3606],{"type":53,"value":2628},{"type":47,"tag":687,"props":3608,"children":3609},{"style":723},[3610],{"type":53,"value":3611},"\u002Ftestcase.jsonl",{"type":47,"tag":687,"props":3613,"children":3614},{"style":700},[3615],{"type":53,"value":2825},{"type":47,"tag":687,"props":3617,"children":3618},{"class":689,"line":2387},[3619,3624],{"type":47,"tag":687,"props":3620,"children":3621},{"style":723},[3622],{"type":53,"value":3623},"    --mode",{"type":47,"tag":687,"props":3625,"children":3626},{"style":723},[3627],{"type":53,"value":3628}," validation\n",{"type":47,"tag":687,"props":3630,"children":3631},{"class":689,"line":2416},[3632,3636,3640,3645,3649,3653,3657],{"type":47,"tag":687,"props":3633,"children":3634},{"style":700},[3635],{"type":53,"value":2538},{"type":47,"tag":687,"props":3637,"children":3638},{"style":706},[3639],{"type":53,"value":709},{"type":47,"tag":687,"props":3641,"children":3642},{"style":723},[3643],{"type":53,"value":3644},"ag_inference\u002Fvalidation_",{"type":47,"tag":687,"props":3646,"children":3647},{"style":706},[3648],{"type":53,"value":2589},{"type":47,"tag":687,"props":3650,"children":3651},{"style":700},[3652],{"type":53,"value":2043},{"type":47,"tag":687,"props":3654,"children":3655},{"style":706},[3656],{"type":53,"value":2628},{"type":47,"tag":687,"props":3658,"children":3659},{"style":723},[3660],{"type":53,"value":2633},{"type":47,"tag":687,"props":3662,"children":3663},{"class":689,"line":2445},[3664],{"type":47,"tag":687,"props":3665,"children":3666},{"emptyLinePlaceholder":2563},[3667],{"type":53,"value":2566},{"type":47,"tag":687,"props":3669,"children":3670},{"class":689,"line":2474},[3671],{"type":47,"tag":687,"props":3672,"children":3673},{"style":2132},[3674],{"type":53,"value":3675},"# Step 3: Generate training config — show to user and confirm before writing\n",{"type":47,"tag":687,"props":3677,"children":3678},{"class":689,"line":2503},[3679,3683,3687,3692],{"type":47,"tag":687,"props":3680,"children":3681},{"style":717},[3682],{"type":53,"value":3343},{"type":47,"tag":687,"props":3684,"children":3685},{"style":723},[3686],{"type":53,"value":3348},{"type":47,"tag":687,"props":3688,"children":3689},{"style":723},[3690],{"type":53,"value":3691}," scripts.utilities.generate_config",{"type":47,"tag":687,"props":3693,"children":3694},{"style":700},[3695],{"type":53,"value":2825},{"type":47,"tag":687,"props":3697,"children":3698},{"class":689,"line":2532},[3699,3703,3707,3711,3715,3720,3724,3728,3732],{"type":47,"tag":687,"props":3700,"children":3701},{"style":723},[3702],{"type":53,"value":3424},{"type":47,"tag":687,"props":3704,"children":3705},{"style":706},[3706],{"type":53,"value":2838},{"type":47,"tag":687,"props":3708,"children":3709},{"style":700},[3710],{"type":53,"value":2043},{"type":47,"tag":687,"props":3712,"children":3713},{"style":706},[3714],{"type":53,"value":2628},{"type":47,"tag":687,"props":3716,"children":3717},{"style":723},[3718],{"type":53,"value":3719}," --dataset-dir",{"type":47,"tag":687,"props":3721,"children":3722},{"style":706},[3723],{"type":53,"value":2838},{"type":47,"tag":687,"props":3725,"children":3726},{"style":700},[3727],{"type":53,"value":2064},{"type":47,"tag":687,"props":3729,"children":3730},{"style":706},[3731],{"type":53,"value":2628},{"type":47,"tag":687,"props":3733,"children":3734},{"style":700},[3735],{"type":53,"value":2825},{"type":47,"tag":687,"props":3737,"children":3738},{"class":689,"line":2559},[3739,3743,3747,3751,3755,3760,3764,3768,3772],{"type":47,"tag":687,"props":3740,"children":3741},{"style":723},[3742],{"type":53,"value":3532},{"type":47,"tag":687,"props":3744,"children":3745},{"style":706},[3746],{"type":53,"value":2838},{"type":47,"tag":687,"props":3748,"children":3749},{"style":700},[3750],{"type":53,"value":2192},{"type":47,"tag":687,"props":3752,"children":3753},{"style":706},[3754],{"type":53,"value":2628},{"type":47,"tag":687,"props":3756,"children":3757},{"style":723},[3758],{"type":53,"value":3759}," --validation-jsonl",{"type":47,"tag":687,"props":3761,"children":3762},{"style":706},[3763],{"type":53,"value":2838},{"type":47,"tag":687,"props":3765,"children":3766},{"style":700},[3767],{"type":53,"value":2538},{"type":47,"tag":687,"props":3769,"children":3770},{"style":706},[3771],{"type":53,"value":2628},{"type":47,"tag":687,"props":3773,"children":3774},{"style":700},[3775],{"type":53,"value":2825},{"type":47,"tag":687,"props":3777,"children":3778},{"class":689,"line":2569},[3779,3784,3789,3793,3797,3801,3806],{"type":47,"tag":687,"props":3780,"children":3781},{"style":723},[3782],{"type":53,"value":3783},"    --output",{"type":47,"tag":687,"props":3785,"children":3786},{"style":723},[3787],{"type":53,"value":3788}," ag_configs\u002F",{"type":47,"tag":687,"props":3790,"children":3791},{"style":706},[3792],{"type":53,"value":2589},{"type":47,"tag":687,"props":3794,"children":3795},{"style":700},[3796],{"type":53,"value":2043},{"type":47,"tag":687,"props":3798,"children":3799},{"style":706},[3800],{"type":53,"value":2628},{"type":47,"tag":687,"props":3802,"children":3803},{"style":723},[3804],{"type":53,"value":3805},".yaml",{"type":47,"tag":687,"props":3807,"children":3808},{"style":700},[3809],{"type":53,"value":2825},{"type":47,"tag":687,"props":3811,"children":3812},{"class":689,"line":2600},[3813,3818,3822,3826,3830,3835,3839,3843,3847],{"type":47,"tag":687,"props":3814,"children":3815},{"style":723},[3816],{"type":53,"value":3817},"    --model-size",{"type":47,"tag":687,"props":3819,"children":3820},{"style":706},[3821],{"type":53,"value":2838},{"type":47,"tag":687,"props":3823,"children":3824},{"style":700},[3825],{"type":53,"value":2306},{"type":47,"tag":687,"props":3827,"children":3828},{"style":706},[3829],{"type":53,"value":2628},{"type":47,"tag":687,"props":3831,"children":3832},{"style":723},[3833],{"type":53,"value":3834}," --max-iter",{"type":47,"tag":687,"props":3836,"children":3837},{"style":706},[3838],{"type":53,"value":2838},{"type":47,"tag":687,"props":3840,"children":3841},{"style":700},[3842],{"type":53,"value":2364},{"type":47,"tag":687,"props":3844,"children":3845},{"style":706},[3846],{"type":53,"value":2628},{"type":47,"tag":687,"props":3848,"children":3849},{"style":700},[3850],{"type":53,"value":2825},{"type":47,"tag":687,"props":3852,"children":3853},{"class":689,"line":2636},[3854,3859,3863,3867,3871,3876,3880,3884,3888],{"type":47,"tag":687,"props":3855,"children":3856},{"style":723},[3857],{"type":53,"value":3858},"    --save-iter",{"type":47,"tag":687,"props":3860,"children":3861},{"style":706},[3862],{"type":53,"value":2838},{"type":47,"tag":687,"props":3864,"children":3865},{"style":700},[3866],{"type":53,"value":2393},{"type":47,"tag":687,"props":3868,"children":3869},{"style":706},[3870],{"type":53,"value":2628},{"type":47,"tag":687,"props":3872,"children":3873},{"style":723},[3874],{"type":53,"value":3875}," --validation-iter",{"type":47,"tag":687,"props":3877,"children":3878},{"style":706},[3879],{"type":53,"value":2838},{"type":47,"tag":687,"props":3881,"children":3882},{"style":700},[3883],{"type":53,"value":2422},{"type":47,"tag":687,"props":3885,"children":3886},{"style":706},[3887],{"type":53,"value":2628},{"type":47,"tag":687,"props":3889,"children":3890},{"style":700},[3891],{"type":53,"value":2825},{"type":47,"tag":687,"props":3893,"children":3894},{"class":689,"line":2662},[3895,3900,3904,3908,3912,3917,3921,3925,3929],{"type":47,"tag":687,"props":3896,"children":3897},{"style":723},[3898],{"type":53,"value":3899},"    --lr",{"type":47,"tag":687,"props":3901,"children":3902},{"style":706},[3903],{"type":53,"value":2838},{"type":47,"tag":687,"props":3905,"children":3906},{"style":700},[3907],{"type":53,"value":2451},{"type":47,"tag":687,"props":3909,"children":3910},{"style":706},[3911],{"type":53,"value":2628},{"type":47,"tag":687,"props":3913,"children":3914},{"style":723},[3915],{"type":53,"value":3916}," --batch-size",{"type":47,"tag":687,"props":3918,"children":3919},{"style":706},[3920],{"type":53,"value":2838},{"type":47,"tag":687,"props":3922,"children":3923},{"style":700},[3924],{"type":53,"value":2480},{"type":47,"tag":687,"props":3926,"children":3927},{"style":706},[3928],{"type":53,"value":2628},{"type":47,"tag":687,"props":3930,"children":3931},{"style":700},[3932],{"type":53,"value":2825},{"type":47,"tag":687,"props":3934,"children":3935},{"class":689,"line":2688},[3936,3941,3945,3949],{"type":47,"tag":687,"props":3937,"children":3938},{"style":723},[3939],{"type":53,"value":3940},"    --image-size",{"type":47,"tag":687,"props":3942,"children":3943},{"style":706},[3944],{"type":53,"value":2838},{"type":47,"tag":687,"props":3946,"children":3947},{"style":700},[3948],{"type":53,"value":2509},{"type":47,"tag":687,"props":3950,"children":3951},{"style":706},[3952],{"type":53,"value":2269},{"type":47,"tag":687,"props":3954,"children":3955},{"class":689,"line":2714},[3956],{"type":47,"tag":687,"props":3957,"children":3958},{"emptyLinePlaceholder":2563},[3959],{"type":53,"value":2566},{"type":47,"tag":687,"props":3961,"children":3963},{"class":689,"line":3962},28,[3964],{"type":47,"tag":687,"props":3965,"children":3966},{"style":2132},[3967],{"type":53,"value":3968},"# Step 4: Launch training (run in background)\n",{"type":47,"tag":687,"props":3970,"children":3972},{"class":689,"line":3971},29,[3973,3977,3981,3985],{"type":47,"tag":687,"props":3974,"children":3975},{"style":706},[3976],{"type":53,"value":2589},{"type":47,"tag":687,"props":3978,"children":3979},{"style":700},[3980],{"type":53,"value":3258},{"type":47,"tag":687,"props":3982,"children":3983},{"style":706},[3984],{"type":53,"value":2628},{"type":47,"tag":687,"props":3986,"children":3987},{"style":700},[3988],{"type":53,"value":3989},"\u002Flaunch_training.sh \\\n",{"type":47,"tag":687,"props":3991,"children":3993},{"class":689,"line":3992},30,[3994,3999,4003,4007,4011,4015,4019],{"type":47,"tag":687,"props":3995,"children":3996},{"style":717},[3997],{"type":53,"value":3998},"    --ag-config",{"type":47,"tag":687,"props":4000,"children":4001},{"style":723},[4002],{"type":53,"value":3788},{"type":47,"tag":687,"props":4004,"children":4005},{"style":706},[4006],{"type":53,"value":2589},{"type":47,"tag":687,"props":4008,"children":4009},{"style":700},[4010],{"type":53,"value":2043},{"type":47,"tag":687,"props":4012,"children":4013},{"style":706},[4014],{"type":53,"value":2628},{"type":47,"tag":687,"props":4016,"children":4017},{"style":723},[4018],{"type":53,"value":3805},{"type":47,"tag":687,"props":4020,"children":4021},{"style":700},[4022],{"type":53,"value":2825},{"type":47,"tag":687,"props":4024,"children":4026},{"class":689,"line":4025},31,[4027,4032,4036,4040,4044],{"type":47,"tag":687,"props":4028,"children":4029},{"style":723},[4030],{"type":53,"value":4031},"    --num-gpus",{"type":47,"tag":687,"props":4033,"children":4034},{"style":706},[4035],{"type":53,"value":2838},{"type":47,"tag":687,"props":4037,"children":4038},{"style":700},[4039],{"type":53,"value":2335},{"type":47,"tag":687,"props":4041,"children":4042},{"style":706},[4043],{"type":53,"value":2628},{"type":47,"tag":687,"props":4045,"children":4046},{"style":700},[4047],{"type":53,"value":2825},{"type":47,"tag":687,"props":4049,"children":4051},{"class":689,"line":4050},32,[4052,4056,4060,4064],{"type":47,"tag":687,"props":4053,"children":4054},{"style":723},[4055],{"type":53,"value":3817},{"type":47,"tag":687,"props":4057,"children":4058},{"style":706},[4059],{"type":53,"value":2838},{"type":47,"tag":687,"props":4061,"children":4062},{"style":700},[4063],{"type":53,"value":2306},{"type":47,"tag":687,"props":4065,"children":4066},{"style":706},[4067],{"type":53,"value":2269},{"type":47,"tag":63,"props":4069,"children":4070},{},[4071,4073,4078,4079,4084],{"type":53,"value":4072},"After training, derive ",{"type":47,"tag":90,"props":4074,"children":4076},{"className":4075},[],[4077],{"type":53,"value":271},{"type":53,"value":273},{"type":47,"tag":90,"props":4080,"children":4082},{"className":4081},[],[4083],{"type":53,"value":279},{"type":53,"value":4085}," (uppercase model_size in path):",{"type":47,"tag":676,"props":4087,"children":4089},{"className":678,"code":4088,"language":680,"meta":681,"style":681},"MODEL_SIZE_UPPER=\"${MODEL_SIZE^^}\"\nCKPT=\".\u002Fresults\u002Fanomaly_gen\u002F${NAME}\u002F${NAME}_training_FP32_lr${LR}_bs=${BATCH_SIZE}_${MODEL_SIZE_UPPER}_${IMAGE_SIZE}x${IMAGE_SIZE}\"\n# STEP = highest nn_score step from validation logs (see references\u002Ffinetune.md)\n",[4090],{"type":47,"tag":90,"props":4091,"children":4092},{"__ignoreMap":681},[4093,4124,4256],{"type":47,"tag":687,"props":4094,"children":4095},{"class":689,"line":690},[4096,4101,4105,4110,4114,4119],{"type":47,"tag":687,"props":4097,"children":4098},{"style":700},[4099],{"type":53,"value":4100},"MODEL_SIZE_UPPER",{"type":47,"tag":687,"props":4102,"children":4103},{"style":706},[4104],{"type":53,"value":709},{"type":47,"tag":687,"props":4106,"children":4107},{"style":706},[4108],{"type":53,"value":4109},"\"${",{"type":47,"tag":687,"props":4111,"children":4112},{"style":700},[4113],{"type":53,"value":2306},{"type":47,"tag":687,"props":4115,"children":4116},{"style":723},[4117],{"type":53,"value":4118},"^^",{"type":47,"tag":687,"props":4120,"children":4121},{"style":706},[4122],{"type":53,"value":4123},"}\"\n",{"type":47,"tag":687,"props":4125,"children":4126},{"class":689,"line":2037},[4127,4131,4135,4139,4144,4148,4152,4156,4160,4164,4168,4172,4177,4181,4185,4189,4194,4198,4202,4206,4211,4215,4219,4223,4227,4231,4235,4239,4244,4248,4252],{"type":47,"tag":687,"props":4128,"children":4129},{"style":700},[4130],{"type":53,"value":271},{"type":47,"tag":687,"props":4132,"children":4133},{"style":706},[4134],{"type":53,"value":709},{"type":47,"tag":687,"props":4136,"children":4137},{"style":706},[4138],{"type":53,"value":1874},{"type":47,"tag":687,"props":4140,"children":4141},{"style":723},[4142],{"type":53,"value":4143},".\u002Fresults\u002Fanomaly_gen\u002F",{"type":47,"tag":687,"props":4145,"children":4146},{"style":706},[4147],{"type":53,"value":2589},{"type":47,"tag":687,"props":4149,"children":4150},{"style":700},[4151],{"type":53,"value":2043},{"type":47,"tag":687,"props":4153,"children":4154},{"style":706},[4155],{"type":53,"value":2628},{"type":47,"tag":687,"props":4157,"children":4158},{"style":723},[4159],{"type":53,"value":1202},{"type":47,"tag":687,"props":4161,"children":4162},{"style":706},[4163],{"type":53,"value":2589},{"type":47,"tag":687,"props":4165,"children":4166},{"style":700},[4167],{"type":53,"value":2043},{"type":47,"tag":687,"props":4169,"children":4170},{"style":706},[4171],{"type":53,"value":2628},{"type":47,"tag":687,"props":4173,"children":4174},{"style":723},[4175],{"type":53,"value":4176},"_training_FP32_lr",{"type":47,"tag":687,"props":4178,"children":4179},{"style":706},[4180],{"type":53,"value":2589},{"type":47,"tag":687,"props":4182,"children":4183},{"style":700},[4184],{"type":53,"value":2451},{"type":47,"tag":687,"props":4186,"children":4187},{"style":706},[4188],{"type":53,"value":2628},{"type":47,"tag":687,"props":4190,"children":4191},{"style":723},[4192],{"type":53,"value":4193},"_bs=",{"type":47,"tag":687,"props":4195,"children":4196},{"style":706},[4197],{"type":53,"value":2589},{"type":47,"tag":687,"props":4199,"children":4200},{"style":700},[4201],{"type":53,"value":2480},{"type":47,"tag":687,"props":4203,"children":4204},{"style":706},[4205],{"type":53,"value":2628},{"type":47,"tag":687,"props":4207,"children":4208},{"style":723},[4209],{"type":53,"value":4210},"_",{"type":47,"tag":687,"props":4212,"children":4213},{"style":706},[4214],{"type":53,"value":2589},{"type":47,"tag":687,"props":4216,"children":4217},{"style":700},[4218],{"type":53,"value":4100},{"type":47,"tag":687,"props":4220,"children":4221},{"style":706},[4222],{"type":53,"value":2628},{"type":47,"tag":687,"props":4224,"children":4225},{"style":723},[4226],{"type":53,"value":4210},{"type":47,"tag":687,"props":4228,"children":4229},{"style":706},[4230],{"type":53,"value":2589},{"type":47,"tag":687,"props":4232,"children":4233},{"style":700},[4234],{"type":53,"value":2509},{"type":47,"tag":687,"props":4236,"children":4237},{"style":706},[4238],{"type":53,"value":2628},{"type":47,"tag":687,"props":4240,"children":4241},{"style":723},[4242],{"type":53,"value":4243},"x",{"type":47,"tag":687,"props":4245,"children":4246},{"style":706},[4247],{"type":53,"value":2589},{"type":47,"tag":687,"props":4249,"children":4250},{"style":700},[4251],{"type":53,"value":2509},{"type":47,"tag":687,"props":4253,"children":4254},{"style":706},[4255],{"type":53,"value":4123},{"type":47,"tag":687,"props":4257,"children":4258},{"class":689,"line":27},[4259],{"type":47,"tag":687,"props":4260,"children":4261},{"style":2132},[4262],{"type":53,"value":4263},"# STEP = highest nn_score step from validation logs (see references\u002Ffinetune.md)\n",{"type":47,"tag":63,"props":4265,"children":4266},{},[4267,4269,4274],{"type":53,"value":4268},"If ",{"type":47,"tag":90,"props":4270,"children":4272},{"className":4271},[],[4273],{"type":53,"value":3207},{"type":53,"value":4275},": stop here.",{"type":47,"tag":981,"props":4277,"children":4278},{},[],{"type":47,"tag":56,"props":4280,"children":4282},{"id":4281},"phase-2-prep-testcase-skip-when-modefinetune_only",[4283,4285,4290],{"type":53,"value":4284},"Phase 2 — prep-testcase (skip when ",{"type":47,"tag":90,"props":4286,"children":4288},{"className":4287},[],[4289],{"type":53,"value":3207},{"type":53,"value":731},{"type":47,"tag":63,"props":4292,"children":4293},{},[4294,4295,4300,4302,4308,4310,4316],{"type":53,"value":3231},{"type":47,"tag":90,"props":4296,"children":4298},{"className":4297},[],[4299],{"type":53,"value":896},{"type":53,"value":4301}," (AMP routing, full param table) and\n",{"type":47,"tag":90,"props":4303,"children":4305},{"className":4304},[],[4306],{"type":53,"value":4307},"references\u002Finference.md §Phase 2",{"type":53,"value":4309}," (pairing strategy, n_seeds sizing).\nDo NOT pass ",{"type":47,"tag":90,"props":4311,"children":4313},{"className":4312},[],[4314],{"type":53,"value":4315},"--seeds",{"type":53,"value":4317}," — it is auto-computed and is not a recognized flag.",{"type":47,"tag":63,"props":4319,"children":4320},{},[4321,4327,4329,4335],{"type":47,"tag":90,"props":4322,"children":4324},{"className":4323},[],[4325],{"type":53,"value":4326},"prep_testcase.sh",{"type":53,"value":4328}," defaults to ",{"type":47,"tag":90,"props":4330,"children":4332},{"className":4331},[],[4333],{"type":53,"value":4334},"--mode inference",{"type":53,"value":4336}," (uniform allocation across\ndefect types, no KPI floor). Phase 2 always uses inference mode here.",{"type":47,"tag":676,"props":4338,"children":4340},{"className":678,"code":4339,"language":680,"meta":681,"style":681},"${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name ${NAME} --num-sdg ${NUM_SDG} \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002F${NAME}\u002Famp \\\n    --output-jsonl ${JSONL}\n",[4341],{"type":47,"tag":90,"props":4342,"children":4343},{"__ignoreMap":681},[4344,4363,4403,4426,4449,4472,4504],{"type":47,"tag":687,"props":4345,"children":4346},{"class":689,"line":690},[4347,4351,4355,4359],{"type":47,"tag":687,"props":4348,"children":4349},{"style":706},[4350],{"type":53,"value":2589},{"type":47,"tag":687,"props":4352,"children":4353},{"style":700},[4354],{"type":53,"value":3258},{"type":47,"tag":687,"props":4356,"children":4357},{"style":706},[4358],{"type":53,"value":2628},{"type":47,"tag":687,"props":4360,"children":4361},{"style":700},[4362],{"type":53,"value":3416},{"type":47,"tag":687,"props":4364,"children":4365},{"class":689,"line":2037},[4366,4370,4374,4378,4382,4387,4391,4395,4399],{"type":47,"tag":687,"props":4367,"children":4368},{"style":717},[4369],{"type":53,"value":3424},{"type":47,"tag":687,"props":4371,"children":4372},{"style":706},[4373],{"type":53,"value":2838},{"type":47,"tag":687,"props":4375,"children":4376},{"style":700},[4377],{"type":53,"value":2043},{"type":47,"tag":687,"props":4379,"children":4380},{"style":706},[4381],{"type":53,"value":2628},{"type":47,"tag":687,"props":4383,"children":4384},{"style":723},[4385],{"type":53,"value":4386}," --num-sdg",{"type":47,"tag":687,"props":4388,"children":4389},{"style":706},[4390],{"type":53,"value":2838},{"type":47,"tag":687,"props":4392,"children":4393},{"style":700},[4394],{"type":53,"value":2170},{"type":47,"tag":687,"props":4396,"children":4397},{"style":706},[4398],{"type":53,"value":2628},{"type":47,"tag":687,"props":4400,"children":4401},{"style":700},[4402],{"type":53,"value":2825},{"type":47,"tag":687,"props":4404,"children":4405},{"class":689,"line":27},[4406,4410,4414,4418,4422],{"type":47,"tag":687,"props":4407,"children":4408},{"style":723},[4409],{"type":53,"value":3484},{"type":47,"tag":687,"props":4411,"children":4412},{"style":706},[4413],{"type":53,"value":2838},{"type":47,"tag":687,"props":4415,"children":4416},{"style":700},[4417],{"type":53,"value":2064},{"type":47,"tag":687,"props":4419,"children":4420},{"style":706},[4421],{"type":53,"value":2628},{"type":47,"tag":687,"props":4423,"children":4424},{"style":700},[4425],{"type":53,"value":2825},{"type":47,"tag":687,"props":4427,"children":4428},{"class":689,"line":2079},[4429,4433,4437,4441,4445],{"type":47,"tag":687,"props":4430,"children":4431},{"style":723},[4432],{"type":53,"value":3508},{"type":47,"tag":687,"props":4434,"children":4435},{"style":706},[4436],{"type":53,"value":2838},{"type":47,"tag":687,"props":4438,"children":4439},{"style":700},[4440],{"type":53,"value":2085},{"type":47,"tag":687,"props":4442,"children":4443},{"style":706},[4444],{"type":53,"value":2628},{"type":47,"tag":687,"props":4446,"children":4447},{"style":700},[4448],{"type":53,"value":2825},{"type":47,"tag":687,"props":4450,"children":4451},{"class":689,"line":2111},[4452,4456,4460,4464,4468],{"type":47,"tag":687,"props":4453,"children":4454},{"style":723},[4455],{"type":53,"value":3532},{"type":47,"tag":687,"props":4457,"children":4458},{"style":706},[4459],{"type":53,"value":2838},{"type":47,"tag":687,"props":4461,"children":4462},{"style":700},[4463],{"type":53,"value":2192},{"type":47,"tag":687,"props":4465,"children":4466},{"style":706},[4467],{"type":53,"value":2628},{"type":47,"tag":687,"props":4469,"children":4470},{"style":700},[4471],{"type":53,"value":2825},{"type":47,"tag":687,"props":4473,"children":4474},{"class":689,"line":2138},[4475,4479,4484,4488,4492,4496,4500],{"type":47,"tag":687,"props":4476,"children":4477},{"style":723},[4478],{"type":53,"value":3556},{"type":47,"tag":687,"props":4480,"children":4481},{"style":723},[4482],{"type":53,"value":4483}," ag_inference\u002F",{"type":47,"tag":687,"props":4485,"children":4486},{"style":706},[4487],{"type":53,"value":2589},{"type":47,"tag":687,"props":4489,"children":4490},{"style":700},[4491],{"type":53,"value":2043},{"type":47,"tag":687,"props":4493,"children":4494},{"style":706},[4495],{"type":53,"value":2628},{"type":47,"tag":687,"props":4497,"children":4498},{"style":723},[4499],{"type":53,"value":3578},{"type":47,"tag":687,"props":4501,"children":4502},{"style":700},[4503],{"type":53,"value":2825},{"type":47,"tag":687,"props":4505,"children":4506},{"class":689,"line":2164},[4507,4511,4515,4519],{"type":47,"tag":687,"props":4508,"children":4509},{"style":723},[4510],{"type":53,"value":3590},{"type":47,"tag":687,"props":4512,"children":4513},{"style":706},[4514],{"type":53,"value":2838},{"type":47,"tag":687,"props":4516,"children":4517},{"style":700},[4518],{"type":53,"value":2606},{"type":47,"tag":687,"props":4520,"children":4521},{"style":706},[4522],{"type":53,"value":2269},{"type":47,"tag":63,"props":4524,"children":4525},{},[4526,4531,4533,4538],{"type":47,"tag":173,"props":4527,"children":4528},{},[4529],{"type":53,"value":4530},"Custom per-defect counts.",{"type":53,"value":4532}," When the user specifies counts per defect\ntype (e.g. \"5 IC+bridge, 10 passive_component+missing\"), add\n",{"type":47,"tag":90,"props":4534,"children":4536},{"className":4535},[],[4537],{"type":53,"value":1034},{"type":53,"value":1007},{"type":47,"tag":676,"props":4540,"children":4542},{"className":678,"code":4541,"language":680,"meta":681,"style":681},"${ANOMALYGEN_SCRIPTS}\u002Fprep_testcase.sh \\\n    --name ${NAME} --num-sdg 15 \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --amp-output-dir ag_inference\u002F${NAME}\u002Famp \\\n    --output-jsonl ${JSONL} \\\n    --per-defect-counts '{\"IC+bridge\":5,\"passive_component+missing\":10}'\n# Defects not in the dict get 0.\n",[4543],{"type":47,"tag":90,"props":4544,"children":4545},{"__ignoreMap":681},[4546,4565,4598,4621,4644,4667,4698,4721,4744],{"type":47,"tag":687,"props":4547,"children":4548},{"class":689,"line":690},[4549,4553,4557,4561],{"type":47,"tag":687,"props":4550,"children":4551},{"style":706},[4552],{"type":53,"value":2589},{"type":47,"tag":687,"props":4554,"children":4555},{"style":700},[4556],{"type":53,"value":3258},{"type":47,"tag":687,"props":4558,"children":4559},{"style":706},[4560],{"type":53,"value":2628},{"type":47,"tag":687,"props":4562,"children":4563},{"style":700},[4564],{"type":53,"value":3416},{"type":47,"tag":687,"props":4566,"children":4567},{"class":689,"line":2037},[4568,4572,4576,4580,4584,4588,4594],{"type":47,"tag":687,"props":4569,"children":4570},{"style":717},[4571],{"type":53,"value":3424},{"type":47,"tag":687,"props":4573,"children":4574},{"style":706},[4575],{"type":53,"value":2838},{"type":47,"tag":687,"props":4577,"children":4578},{"style":700},[4579],{"type":53,"value":2043},{"type":47,"tag":687,"props":4581,"children":4582},{"style":706},[4583],{"type":53,"value":2628},{"type":47,"tag":687,"props":4585,"children":4586},{"style":723},[4587],{"type":53,"value":4386},{"type":47,"tag":687,"props":4589,"children":4591},{"style":4590},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[4592],{"type":53,"value":4593}," 15",{"type":47,"tag":687,"props":4595,"children":4596},{"style":700},[4597],{"type":53,"value":2825},{"type":47,"tag":687,"props":4599,"children":4600},{"class":689,"line":27},[4601,4605,4609,4613,4617],{"type":47,"tag":687,"props":4602,"children":4603},{"style":723},[4604],{"type":53,"value":3484},{"type":47,"tag":687,"props":4606,"children":4607},{"style":706},[4608],{"type":53,"value":2838},{"type":47,"tag":687,"props":4610,"children":4611},{"style":700},[4612],{"type":53,"value":2064},{"type":47,"tag":687,"props":4614,"children":4615},{"style":706},[4616],{"type":53,"value":2628},{"type":47,"tag":687,"props":4618,"children":4619},{"style":700},[4620],{"type":53,"value":2825},{"type":47,"tag":687,"props":4622,"children":4623},{"class":689,"line":2079},[4624,4628,4632,4636,4640],{"type":47,"tag":687,"props":4625,"children":4626},{"style":723},[4627],{"type":53,"value":3508},{"type":47,"tag":687,"props":4629,"children":4630},{"style":706},[4631],{"type":53,"value":2838},{"type":47,"tag":687,"props":4633,"children":4634},{"style":700},[4635],{"type":53,"value":2085},{"type":47,"tag":687,"props":4637,"children":4638},{"style":706},[4639],{"type":53,"value":2628},{"type":47,"tag":687,"props":4641,"children":4642},{"style":700},[4643],{"type":53,"value":2825},{"type":47,"tag":687,"props":4645,"children":4646},{"class":689,"line":2111},[4647,4651,4655,4659,4663],{"type":47,"tag":687,"props":4648,"children":4649},{"style":723},[4650],{"type":53,"value":3532},{"type":47,"tag":687,"props":4652,"children":4653},{"style":706},[4654],{"type":53,"value":2838},{"type":47,"tag":687,"props":4656,"children":4657},{"style":700},[4658],{"type":53,"value":2192},{"type":47,"tag":687,"props":4660,"children":4661},{"style":706},[4662],{"type":53,"value":2628},{"type":47,"tag":687,"props":4664,"children":4665},{"style":700},[4666],{"type":53,"value":2825},{"type":47,"tag":687,"props":4668,"children":4669},{"class":689,"line":2138},[4670,4674,4678,4682,4686,4690,4694],{"type":47,"tag":687,"props":4671,"children":4672},{"style":723},[4673],{"type":53,"value":3556},{"type":47,"tag":687,"props":4675,"children":4676},{"style":723},[4677],{"type":53,"value":4483},{"type":47,"tag":687,"props":4679,"children":4680},{"style":706},[4681],{"type":53,"value":2589},{"type":47,"tag":687,"props":4683,"children":4684},{"style":700},[4685],{"type":53,"value":2043},{"type":47,"tag":687,"props":4687,"children":4688},{"style":706},[4689],{"type":53,"value":2628},{"type":47,"tag":687,"props":4691,"children":4692},{"style":723},[4693],{"type":53,"value":3578},{"type":47,"tag":687,"props":4695,"children":4696},{"style":700},[4697],{"type":53,"value":2825},{"type":47,"tag":687,"props":4699,"children":4700},{"class":689,"line":2164},[4701,4705,4709,4713,4717],{"type":47,"tag":687,"props":4702,"children":4703},{"style":723},[4704],{"type":53,"value":3590},{"type":47,"tag":687,"props":4706,"children":4707},{"style":706},[4708],{"type":53,"value":2838},{"type":47,"tag":687,"props":4710,"children":4711},{"style":700},[4712],{"type":53,"value":2606},{"type":47,"tag":687,"props":4714,"children":4715},{"style":706},[4716],{"type":53,"value":2628},{"type":47,"tag":687,"props":4718,"children":4719},{"style":700},[4720],{"type":53,"value":2825},{"type":47,"tag":687,"props":4722,"children":4723},{"class":689,"line":2186},[4724,4729,4734,4739],{"type":47,"tag":687,"props":4725,"children":4726},{"style":723},[4727],{"type":53,"value":4728},"    --per-defect-counts",{"type":47,"tag":687,"props":4730,"children":4731},{"style":706},[4732],{"type":53,"value":4733}," '",{"type":47,"tag":687,"props":4735,"children":4736},{"style":723},[4737],{"type":53,"value":4738},"{\"IC+bridge\":5,\"passive_component+missing\":10}",{"type":47,"tag":687,"props":4740,"children":4741},{"style":706},[4742],{"type":53,"value":4743},"'\n",{"type":47,"tag":687,"props":4745,"children":4746},{"class":689,"line":2208},[4747],{"type":47,"tag":687,"props":4748,"children":4749},{"style":2132},[4750],{"type":53,"value":4751},"# Defects not in the dict get 0.\n",{"type":47,"tag":63,"props":4753,"children":4754},{},[4755,4757,4762],{"type":53,"value":4756},"Sum should equal ",{"type":47,"tag":90,"props":4758,"children":4760},{"className":4759},[],[4761],{"type":53,"value":3215},{"type":53,"value":4763}," (script warns + uses override sum if not).\nConfirm the allocation when the user's intent is ambiguous (e.g. \"each\ndefect 10\" + \"total only 1\").",{"type":47,"tag":981,"props":4765,"children":4766},{},[],{"type":47,"tag":56,"props":4768,"children":4770},{"id":4769},"phase-3-sdg-original",[4771,4773],{"type":53,"value":4772},"Phase 3 — SDG → ",{"type":47,"tag":90,"props":4774,"children":4776},{"className":4775},[],[4777],{"type":53,"value":424},{"type":47,"tag":63,"props":4779,"children":4780},{},[4781,4782,4788,4790,4795],{"type":53,"value":3231},{"type":47,"tag":90,"props":4783,"children":4785},{"className":4784},[],[4786],{"type":53,"value":4787},"references\u002Finference.md §Phase 3",{"type":53,"value":4789}," (JSONL validation, multi-GPU\ncaveats) and ",{"type":47,"tag":90,"props":4791,"children":4793},{"className":4792},[],[4794],{"type":53,"value":913},{"type":53,"value":4796}," (full step list, output\nverification, NCCL controls).",{"type":47,"tag":676,"props":4798,"children":4800},{"className":678,"code":4799,"language":680,"meta":681,"style":681},"python3 -m scripts.utilities.validate_checkpoint ${CKPT} --step ${STEP}\npython3 -m scripts.utilities.validate_jsonl ${CKPT} ${JSONL}\n\n${ANOMALYGEN_SCRIPTS}\u002Frun_sdg.sh \\\n    --checkpoint_dir ${CKPT} --step ${STEP} \\\n    --input_jsonl ${JSONL} --output_dir ${ORIGINAL} \\\n    --model_size ${MODEL_SIZE} --num_gpus ${NUM_GPUS}\n\n${ANOMALYGEN_SCRIPTS}\u002Fverify_output.sh ${JSONL} ${ORIGINAL}\n",[4801],{"type":47,"tag":90,"props":4802,"children":4803},{"__ignoreMap":681},[4804,4849,4889,4896,4916,4956,4997,5034,5041],{"type":47,"tag":687,"props":4805,"children":4806},{"class":689,"line":690},[4807,4811,4815,4820,4824,4828,4832,4837,4841,4845],{"type":47,"tag":687,"props":4808,"children":4809},{"style":717},[4810],{"type":53,"value":3343},{"type":47,"tag":687,"props":4812,"children":4813},{"style":723},[4814],{"type":53,"value":3348},{"type":47,"tag":687,"props":4816,"children":4817},{"style":723},[4818],{"type":53,"value":4819}," scripts.utilities.validate_checkpoint",{"type":47,"tag":687,"props":4821,"children":4822},{"style":706},[4823],{"type":53,"value":2838},{"type":47,"tag":687,"props":4825,"children":4826},{"style":700},[4827],{"type":53,"value":271},{"type":47,"tag":687,"props":4829,"children":4830},{"style":706},[4831],{"type":53,"value":2628},{"type":47,"tag":687,"props":4833,"children":4834},{"style":723},[4835],{"type":53,"value":4836}," --step",{"type":47,"tag":687,"props":4838,"children":4839},{"style":706},[4840],{"type":53,"value":2838},{"type":47,"tag":687,"props":4842,"children":4843},{"style":700},[4844],{"type":53,"value":279},{"type":47,"tag":687,"props":4846,"children":4847},{"style":706},[4848],{"type":53,"value":2269},{"type":47,"tag":687,"props":4850,"children":4851},{"class":689,"line":2037},[4852,4856,4860,4865,4869,4873,4877,4881,4885],{"type":47,"tag":687,"props":4853,"children":4854},{"style":717},[4855],{"type":53,"value":3343},{"type":47,"tag":687,"props":4857,"children":4858},{"style":723},[4859],{"type":53,"value":3348},{"type":47,"tag":687,"props":4861,"children":4862},{"style":723},[4863],{"type":53,"value":4864}," scripts.utilities.validate_jsonl",{"type":47,"tag":687,"props":4866,"children":4867},{"style":706},[4868],{"type":53,"value":2838},{"type":47,"tag":687,"props":4870,"children":4871},{"style":700},[4872],{"type":53,"value":271},{"type":47,"tag":687,"props":4874,"children":4875},{"style":706},[4876],{"type":53,"value":2628},{"type":47,"tag":687,"props":4878,"children":4879},{"style":706},[4880],{"type":53,"value":2838},{"type":47,"tag":687,"props":4882,"children":4883},{"style":700},[4884],{"type":53,"value":2606},{"type":47,"tag":687,"props":4886,"children":4887},{"style":706},[4888],{"type":53,"value":2269},{"type":47,"tag":687,"props":4890,"children":4891},{"class":689,"line":27},[4892],{"type":47,"tag":687,"props":4893,"children":4894},{"emptyLinePlaceholder":2563},[4895],{"type":53,"value":2566},{"type":47,"tag":687,"props":4897,"children":4898},{"class":689,"line":2079},[4899,4903,4907,4911],{"type":47,"tag":687,"props":4900,"children":4901},{"style":706},[4902],{"type":53,"value":2589},{"type":47,"tag":687,"props":4904,"children":4905},{"style":700},[4906],{"type":53,"value":3258},{"type":47,"tag":687,"props":4908,"children":4909},{"style":706},[4910],{"type":53,"value":2628},{"type":47,"tag":687,"props":4912,"children":4913},{"style":700},[4914],{"type":53,"value":4915},"\u002Frun_sdg.sh \\\n",{"type":47,"tag":687,"props":4917,"children":4918},{"class":689,"line":2111},[4919,4924,4928,4932,4936,4940,4944,4948,4952],{"type":47,"tag":687,"props":4920,"children":4921},{"style":717},[4922],{"type":53,"value":4923},"    --checkpoint_dir",{"type":47,"tag":687,"props":4925,"children":4926},{"style":706},[4927],{"type":53,"value":2838},{"type":47,"tag":687,"props":4929,"children":4930},{"style":700},[4931],{"type":53,"value":271},{"type":47,"tag":687,"props":4933,"children":4934},{"style":706},[4935],{"type":53,"value":2628},{"type":47,"tag":687,"props":4937,"children":4938},{"style":723},[4939],{"type":53,"value":4836},{"type":47,"tag":687,"props":4941,"children":4942},{"style":706},[4943],{"type":53,"value":2838},{"type":47,"tag":687,"props":4945,"children":4946},{"style":700},[4947],{"type":53,"value":279},{"type":47,"tag":687,"props":4949,"children":4950},{"style":706},[4951],{"type":53,"value":2628},{"type":47,"tag":687,"props":4953,"children":4954},{"style":700},[4955],{"type":53,"value":2825},{"type":47,"tag":687,"props":4957,"children":4958},{"class":689,"line":2138},[4959,4964,4968,4972,4976,4981,4985,4989,4993],{"type":47,"tag":687,"props":4960,"children":4961},{"style":723},[4962],{"type":53,"value":4963},"    --input_jsonl",{"type":47,"tag":687,"props":4965,"children":4966},{"style":706},[4967],{"type":53,"value":2838},{"type":47,"tag":687,"props":4969,"children":4970},{"style":700},[4971],{"type":53,"value":2606},{"type":47,"tag":687,"props":4973,"children":4974},{"style":706},[4975],{"type":53,"value":2628},{"type":47,"tag":687,"props":4977,"children":4978},{"style":723},[4979],{"type":53,"value":4980}," --output_dir",{"type":47,"tag":687,"props":4982,"children":4983},{"style":706},[4984],{"type":53,"value":2838},{"type":47,"tag":687,"props":4986,"children":4987},{"style":700},[4988],{"type":53,"value":2642},{"type":47,"tag":687,"props":4990,"children":4991},{"style":706},[4992],{"type":53,"value":2628},{"type":47,"tag":687,"props":4994,"children":4995},{"style":700},[4996],{"type":53,"value":2825},{"type":47,"tag":687,"props":4998,"children":4999},{"class":689,"line":2164},[5000,5005,5009,5013,5017,5022,5026,5030],{"type":47,"tag":687,"props":5001,"children":5002},{"style":723},[5003],{"type":53,"value":5004},"    --model_size",{"type":47,"tag":687,"props":5006,"children":5007},{"style":706},[5008],{"type":53,"value":2838},{"type":47,"tag":687,"props":5010,"children":5011},{"style":700},[5012],{"type":53,"value":2306},{"type":47,"tag":687,"props":5014,"children":5015},{"style":706},[5016],{"type":53,"value":2628},{"type":47,"tag":687,"props":5018,"children":5019},{"style":723},[5020],{"type":53,"value":5021}," --num_gpus",{"type":47,"tag":687,"props":5023,"children":5024},{"style":706},[5025],{"type":53,"value":2838},{"type":47,"tag":687,"props":5027,"children":5028},{"style":700},[5029],{"type":53,"value":2335},{"type":47,"tag":687,"props":5031,"children":5032},{"style":706},[5033],{"type":53,"value":2269},{"type":47,"tag":687,"props":5035,"children":5036},{"class":689,"line":2186},[5037],{"type":47,"tag":687,"props":5038,"children":5039},{"emptyLinePlaceholder":2563},[5040],{"type":53,"value":2566},{"type":47,"tag":687,"props":5042,"children":5043},{"class":689,"line":2208},[5044,5048,5052,5056,5061,5065,5069,5073,5077,5081],{"type":47,"tag":687,"props":5045,"children":5046},{"style":706},[5047],{"type":53,"value":2589},{"type":47,"tag":687,"props":5049,"children":5050},{"style":700},[5051],{"type":53,"value":3258},{"type":47,"tag":687,"props":5053,"children":5054},{"style":706},[5055],{"type":53,"value":2628},{"type":47,"tag":687,"props":5057,"children":5058},{"style":700},[5059],{"type":53,"value":5060},"\u002Fverify_output.sh ",{"type":47,"tag":687,"props":5062,"children":5063},{"style":706},[5064],{"type":53,"value":2589},{"type":47,"tag":687,"props":5066,"children":5067},{"style":700},[5068],{"type":53,"value":2606},{"type":47,"tag":687,"props":5070,"children":5071},{"style":706},[5072],{"type":53,"value":2628},{"type":47,"tag":687,"props":5074,"children":5075},{"style":706},[5076],{"type":53,"value":2838},{"type":47,"tag":687,"props":5078,"children":5079},{"style":700},[5080],{"type":53,"value":2642},{"type":47,"tag":687,"props":5082,"children":5083},{"style":706},[5084],{"type":53,"value":2269},{"type":47,"tag":981,"props":5086,"children":5087},{},[],{"type":47,"tag":56,"props":5089,"children":5091},{"id":5090},"phase-4-eval-original",[5092,5094],{"type":53,"value":5093},"Phase 4 — eval ",{"type":47,"tag":90,"props":5095,"children":5097},{"className":5096},[],[5098],{"type":53,"value":424},{"type":47,"tag":63,"props":5100,"children":5101},{},[5102,5103,5108,5110,5116,5118,5123,5125,5130,5131,5136,5138,5143,5144,5149],{"type":53,"value":3231},{"type":47,"tag":90,"props":5104,"children":5106},{"className":5105},[],[5107],{"type":53,"value":930},{"type":53,"value":5109}," for score interpretation, feature counts, and\nerror cases. ",{"type":47,"tag":90,"props":5111,"children":5113},{"className":5112},[],[5114],{"type":53,"value":5115},"run_eval.sh",{"type":53,"value":5117}," writes three files inside ",{"type":47,"tag":90,"props":5119,"children":5121},{"className":5120},[],[5122],{"type":53,"value":424},{"type":53,"value":5124},":\n",{"type":47,"tag":90,"props":5126,"children":5128},{"className":5127},[],[5129],{"type":53,"value":473},{"type":53,"value":138},{"type":47,"tag":90,"props":5132,"children":5134},{"className":5133},[],[5135],{"type":53,"value":481},{"type":53,"value":5137},", and merges ",{"type":47,"tag":90,"props":5139,"children":5141},{"className":5140},[],[5142],{"type":53,"value":489},{"type":53,"value":491},{"type":47,"tag":90,"props":5145,"children":5147},{"className":5146},[],[5148],{"type":53,"value":497},{"type":53,"value":1036},{"type":47,"tag":676,"props":5151,"children":5153},{"className":678,"code":5152,"language":680,"meta":681,"style":681},"${ANOMALYGEN_SCRIPTS}\u002Frun_eval.sh \\\n    --real-path ${DATASET_DIR} --generated-path ${ORIGINAL} \\\n    --anomaly-types ${DEFECTS[@]}\n",[5154],{"type":47,"tag":90,"props":5155,"children":5156},{"__ignoreMap":681},[5157,5177,5218],{"type":47,"tag":687,"props":5158,"children":5159},{"class":689,"line":690},[5160,5164,5168,5172],{"type":47,"tag":687,"props":5161,"children":5162},{"style":706},[5163],{"type":53,"value":2589},{"type":47,"tag":687,"props":5165,"children":5166},{"style":700},[5167],{"type":53,"value":3258},{"type":47,"tag":687,"props":5169,"children":5170},{"style":706},[5171],{"type":53,"value":2628},{"type":47,"tag":687,"props":5173,"children":5174},{"style":700},[5175],{"type":53,"value":5176},"\u002Frun_eval.sh \\\n",{"type":47,"tag":687,"props":5178,"children":5179},{"class":689,"line":2037},[5180,5185,5189,5193,5197,5202,5206,5210,5214],{"type":47,"tag":687,"props":5181,"children":5182},{"style":717},[5183],{"type":53,"value":5184},"    --real-path",{"type":47,"tag":687,"props":5186,"children":5187},{"style":706},[5188],{"type":53,"value":2838},{"type":47,"tag":687,"props":5190,"children":5191},{"style":700},[5192],{"type":53,"value":2064},{"type":47,"tag":687,"props":5194,"children":5195},{"style":706},[5196],{"type":53,"value":2628},{"type":47,"tag":687,"props":5198,"children":5199},{"style":723},[5200],{"type":53,"value":5201}," --generated-path",{"type":47,"tag":687,"props":5203,"children":5204},{"style":706},[5205],{"type":53,"value":2838},{"type":47,"tag":687,"props":5207,"children":5208},{"style":700},[5209],{"type":53,"value":2642},{"type":47,"tag":687,"props":5211,"children":5212},{"style":706},[5213],{"type":53,"value":2628},{"type":47,"tag":687,"props":5215,"children":5216},{"style":700},[5217],{"type":53,"value":2825},{"type":47,"tag":687,"props":5219,"children":5220},{"class":689,"line":27},[5221,5226,5230,5234],{"type":47,"tag":687,"props":5222,"children":5223},{"style":723},[5224],{"type":53,"value":5225},"    --anomaly-types",{"type":47,"tag":687,"props":5227,"children":5228},{"style":706},[5229],{"type":53,"value":2838},{"type":47,"tag":687,"props":5231,"children":5232},{"style":700},[5233],{"type":53,"value":2214},{"type":47,"tag":687,"props":5235,"children":5236},{"style":706},[5237],{"type":53,"value":5238},"[@]}\n",{"type":47,"tag":981,"props":5240,"children":5241},{},[],{"type":47,"tag":56,"props":5243,"children":5245},{"id":5244},"phase-5-per-sample-search-rounds",[5246],{"type":53,"value":5247},"Phase 5 — per-sample search rounds",{"type":47,"tag":63,"props":5249,"children":5250},{},[5251,5252,5258,5260,5265,5267,5273,5275,5281],{"type":53,"value":3231},{"type":47,"tag":90,"props":5253,"children":5255},{"className":5254},[],[5256],{"type":53,"value":5257},"references\u002Finference.md §Phase 5",{"type":53,"value":5259}," (draw strategy) and\n",{"type":47,"tag":90,"props":5261,"children":5263},{"className":5262},[],[5264],{"type":53,"value":947},{"type":53,"value":5266}," (draws.json format, ranges, re-AMP).\nFor ",{"type":47,"tag":90,"props":5268,"children":5270},{"className":5269},[],[5271],{"type":53,"value":5272},"r",{"type":53,"value":5274}," in ",{"type":47,"tag":90,"props":5276,"children":5278},{"className":5277},[],[5279],{"type":53,"value":5280},"1..NUM_SEARCH_RUN",{"type":53,"value":1007},{"type":47,"tag":5283,"props":5284,"children":5285},"ol",{},[5286,5312,5332],{"type":47,"tag":1013,"props":5287,"children":5288},{},[5289,5291,5296,5298,5304,5305,5311],{"type":53,"value":5290},"Read prior round's ",{"type":47,"tag":90,"props":5292,"children":5294},{"className":5293},[],[5295],{"type":53,"value":473},{"type":53,"value":5297}," (or ",{"type":47,"tag":90,"props":5299,"children":5301},{"className":5300},[],[5302],{"type":53,"value":5303},"${ORIGINAL}\u002Fper_sample.csv",{"type":53,"value":1162},{"type":47,"tag":90,"props":5306,"children":5308},{"className":5307},[],[5309],{"type":53,"value":5310},"r=1",{"type":53,"value":1719},{"type":47,"tag":1013,"props":5313,"children":5314},{},[5315,5317,5323,5325,5330],{"type":53,"value":5316},"Write ",{"type":47,"tag":90,"props":5318,"children":5320},{"className":5319},[],[5321],{"type":53,"value":5322},"${ROUNDS}\u002Fround_${r}\u002Fdraws.json",{"type":53,"value":5324}," with Claude-chosen ",{"type":47,"tag":90,"props":5326,"children":5328},{"className":5327},[],[5329],{"type":53,"value":530},{"type":53,"value":5331}," per sample.",{"type":47,"tag":1013,"props":5333,"children":5334},{},[5335,5337,5343],{"type":53,"value":5336},"Run round (SDG + eval; the round dir gets its own ",{"type":47,"tag":90,"props":5338,"children":5340},{"className":5339},[],[5341],{"type":53,"value":5342},"sdg\u002F{SDG_result.csv, per_sample.csv, eval.log}",{"type":53,"value":5344},"):",{"type":47,"tag":676,"props":5346,"children":5348},{"className":678,"code":5347,"language":680,"meta":681,"style":681},"${ANOMALYGEN_SCRIPTS}\u002Frun_round.sh \\\n    --base-jsonl ${JSONL} \\\n    --draws ${ROUNDS}\u002Fround_${r}\u002Fdraws.json \\\n    --output-dir ${ROUNDS}\u002Fround_${r} \\\n    --real-path ${DATASET_DIR} --anomaly-types ${DEFECTS[@]} \\\n    --checkpoint-dir ${CKPT} --step ${STEP} \\\n    [--model-size ${MODEL_SIZE}]\n",[5349],{"type":47,"tag":90,"props":5350,"children":5351},{"__ignoreMap":681},[5352,5372,5396,5442,5482,5523,5563],{"type":47,"tag":687,"props":5353,"children":5354},{"class":689,"line":690},[5355,5359,5363,5367],{"type":47,"tag":687,"props":5356,"children":5357},{"style":706},[5358],{"type":53,"value":2589},{"type":47,"tag":687,"props":5360,"children":5361},{"style":700},[5362],{"type":53,"value":3258},{"type":47,"tag":687,"props":5364,"children":5365},{"style":706},[5366],{"type":53,"value":2628},{"type":47,"tag":687,"props":5368,"children":5369},{"style":700},[5370],{"type":53,"value":5371},"\u002Frun_round.sh \\\n",{"type":47,"tag":687,"props":5373,"children":5374},{"class":689,"line":2037},[5375,5380,5384,5388,5392],{"type":47,"tag":687,"props":5376,"children":5377},{"style":717},[5378],{"type":53,"value":5379},"    --base-jsonl",{"type":47,"tag":687,"props":5381,"children":5382},{"style":706},[5383],{"type":53,"value":2838},{"type":47,"tag":687,"props":5385,"children":5386},{"style":700},[5387],{"type":53,"value":2606},{"type":47,"tag":687,"props":5389,"children":5390},{"style":706},[5391],{"type":53,"value":2628},{"type":47,"tag":687,"props":5393,"children":5394},{"style":700},[5395],{"type":53,"value":2825},{"type":47,"tag":687,"props":5397,"children":5398},{"class":689,"line":27},[5399,5404,5408,5412,5416,5421,5425,5429,5433,5438],{"type":47,"tag":687,"props":5400,"children":5401},{"style":723},[5402],{"type":53,"value":5403},"    --draws",{"type":47,"tag":687,"props":5405,"children":5406},{"style":706},[5407],{"type":53,"value":2838},{"type":47,"tag":687,"props":5409,"children":5410},{"style":700},[5411],{"type":53,"value":2694},{"type":47,"tag":687,"props":5413,"children":5414},{"style":706},[5415],{"type":53,"value":2628},{"type":47,"tag":687,"props":5417,"children":5418},{"style":723},[5419],{"type":53,"value":5420},"\u002Fround_",{"type":47,"tag":687,"props":5422,"children":5423},{"style":706},[5424],{"type":53,"value":2589},{"type":47,"tag":687,"props":5426,"children":5427},{"style":700},[5428],{"type":53,"value":5272},{"type":47,"tag":687,"props":5430,"children":5431},{"style":706},[5432],{"type":53,"value":2628},{"type":47,"tag":687,"props":5434,"children":5435},{"style":723},[5436],{"type":53,"value":5437},"\u002Fdraws.json",{"type":47,"tag":687,"props":5439,"children":5440},{"style":700},[5441],{"type":53,"value":2825},{"type":47,"tag":687,"props":5443,"children":5444},{"class":689,"line":2079},[5445,5450,5454,5458,5462,5466,5470,5474,5478],{"type":47,"tag":687,"props":5446,"children":5447},{"style":723},[5448],{"type":53,"value":5449},"    --output-dir",{"type":47,"tag":687,"props":5451,"children":5452},{"style":706},[5453],{"type":53,"value":2838},{"type":47,"tag":687,"props":5455,"children":5456},{"style":700},[5457],{"type":53,"value":2694},{"type":47,"tag":687,"props":5459,"children":5460},{"style":706},[5461],{"type":53,"value":2628},{"type":47,"tag":687,"props":5463,"children":5464},{"style":723},[5465],{"type":53,"value":5420},{"type":47,"tag":687,"props":5467,"children":5468},{"style":706},[5469],{"type":53,"value":2589},{"type":47,"tag":687,"props":5471,"children":5472},{"style":700},[5473],{"type":53,"value":5272},{"type":47,"tag":687,"props":5475,"children":5476},{"style":706},[5477],{"type":53,"value":2628},{"type":47,"tag":687,"props":5479,"children":5480},{"style":700},[5481],{"type":53,"value":2825},{"type":47,"tag":687,"props":5483,"children":5484},{"class":689,"line":2111},[5485,5489,5493,5497,5501,5506,5510,5514,5519],{"type":47,"tag":687,"props":5486,"children":5487},{"style":723},[5488],{"type":53,"value":5184},{"type":47,"tag":687,"props":5490,"children":5491},{"style":706},[5492],{"type":53,"value":2838},{"type":47,"tag":687,"props":5494,"children":5495},{"style":700},[5496],{"type":53,"value":2064},{"type":47,"tag":687,"props":5498,"children":5499},{"style":706},[5500],{"type":53,"value":2628},{"type":47,"tag":687,"props":5502,"children":5503},{"style":723},[5504],{"type":53,"value":5505}," --anomaly-types",{"type":47,"tag":687,"props":5507,"children":5508},{"style":706},[5509],{"type":53,"value":2838},{"type":47,"tag":687,"props":5511,"children":5512},{"style":700},[5513],{"type":53,"value":2214},{"type":47,"tag":687,"props":5515,"children":5516},{"style":706},[5517],{"type":53,"value":5518},"[@]}",{"type":47,"tag":687,"props":5520,"children":5521},{"style":700},[5522],{"type":53,"value":2825},{"type":47,"tag":687,"props":5524,"children":5525},{"class":689,"line":2138},[5526,5531,5535,5539,5543,5547,5551,5555,5559],{"type":47,"tag":687,"props":5527,"children":5528},{"style":723},[5529],{"type":53,"value":5530},"    --checkpoint-dir",{"type":47,"tag":687,"props":5532,"children":5533},{"style":706},[5534],{"type":53,"value":2838},{"type":47,"tag":687,"props":5536,"children":5537},{"style":700},[5538],{"type":53,"value":271},{"type":47,"tag":687,"props":5540,"children":5541},{"style":706},[5542],{"type":53,"value":2628},{"type":47,"tag":687,"props":5544,"children":5545},{"style":723},[5546],{"type":53,"value":4836},{"type":47,"tag":687,"props":5548,"children":5549},{"style":706},[5550],{"type":53,"value":2838},{"type":47,"tag":687,"props":5552,"children":5553},{"style":700},[5554],{"type":53,"value":279},{"type":47,"tag":687,"props":5556,"children":5557},{"style":706},[5558],{"type":53,"value":2628},{"type":47,"tag":687,"props":5560,"children":5561},{"style":700},[5562],{"type":53,"value":2825},{"type":47,"tag":687,"props":5564,"children":5565},{"class":689,"line":2164},[5566,5571,5575,5579,5583],{"type":47,"tag":687,"props":5567,"children":5568},{"style":700},[5569],{"type":53,"value":5570},"    [--model-size ",{"type":47,"tag":687,"props":5572,"children":5573},{"style":706},[5574],{"type":53,"value":2589},{"type":47,"tag":687,"props":5576,"children":5577},{"style":700},[5578],{"type":53,"value":2306},{"type":47,"tag":687,"props":5580,"children":5581},{"style":706},[5582],{"type":53,"value":2628},{"type":47,"tag":687,"props":5584,"children":5585},{"style":723},[5586],{"type":53,"value":5587},"]\n",{"type":47,"tag":63,"props":5589,"children":5590},{},[5591,5597,5599,5604,5605,5610],{"type":47,"tag":90,"props":5592,"children":5594},{"className":5593},[],[5595],{"type":53,"value":5596},"NUM_SEARCH_RUN=0",{"type":53,"value":5598}," is valid — skip this phase entirely and let Phase 6\nclone ",{"type":47,"tag":90,"props":5600,"children":5602},{"className":5601},[],[5603],{"type":53,"value":424},{"type":53,"value":491},{"type":47,"tag":90,"props":5606,"children":5608},{"className":5607},[],[5609],{"type":53,"value":573},{"type":53,"value":1036},{"type":47,"tag":981,"props":5612,"children":5613},{},[],{"type":47,"tag":56,"props":5615,"children":5617},{"id":5616},"phase-6-assemble-searched-stitch-only",[5618,5620,5625],{"type":53,"value":5619},"Phase 6 — assemble ",{"type":47,"tag":90,"props":5621,"children":5623},{"className":5622},[],[5624],{"type":53,"value":573},{"type":53,"value":5626}," (stitch only)",{"type":47,"tag":63,"props":5628,"children":5629},{},[5630,5632,5637,5639,5644,5646,5651,5653,5658,5660,5665,5667,5672,5673,5679,5681,5687],{"type":53,"value":5631},"Always run assemble (works with 0 rounds — ",{"type":47,"tag":90,"props":5633,"children":5635},{"className":5634},[],[5636],{"type":53,"value":573},{"type":53,"value":5638}," clones\n",{"type":47,"tag":90,"props":5640,"children":5642},{"className":5641},[],[5643],{"type":53,"value":424},{"type":53,"value":5645},", so downstream always reads ",{"type":47,"tag":90,"props":5647,"children":5649},{"className":5648},[],[5650],{"type":53,"value":573},{"type":53,"value":5652}," regardless of\n",{"type":47,"tag":90,"props":5654,"children":5656},{"className":5655},[],[5657],{"type":53,"value":1456},{"type":53,"value":5659},"). Stitch-only: copies winning images per sample-index\ninto ",{"type":47,"tag":90,"props":5661,"children":5663},{"className":5662},[],[5664],{"type":53,"value":573},{"type":53,"value":5666}," and carries over per-sample ",{"type":47,"tag":90,"props":5668,"children":5670},{"className":5669},[],[5671],{"type":53,"value":489},{"type":53,"value":1311},{"type":47,"tag":90,"props":5674,"children":5676},{"className":5675},[],[5677],{"type":53,"value":5678},"mnn_score",{"type":53,"value":5680},"\nfrom each pick's source-round per_sample.csv. No eval — Phase 7 emits\nthe canonical ",{"type":47,"tag":90,"props":5682,"children":5684},{"className":5683},[],[5685],{"type":53,"value":5686},"searched\u002Feval.log",{"type":53,"value":1036},{"type":47,"tag":676,"props":5689,"children":5691},{"className":678,"code":5690,"language":680,"meta":681,"style":681},"mkdir -p ${ROUNDS}\npython3 -m scripts.utilities.assemble_searched \\\n    --original-dir ${ORIGINAL} --original-csv ${ORIGINAL}\u002Fper_sample.csv \\\n    --rounds-dir ${ROUNDS} --searched-dir ${SEARCHED}\n",[5692],{"type":47,"tag":90,"props":5693,"children":5694},{"__ignoreMap":681},[5695,5720,5740,5786],{"type":47,"tag":687,"props":5696,"children":5697},{"class":689,"line":690},[5698,5703,5708,5712,5716],{"type":47,"tag":687,"props":5699,"children":5700},{"style":717},[5701],{"type":53,"value":5702},"mkdir",{"type":47,"tag":687,"props":5704,"children":5705},{"style":723},[5706],{"type":53,"value":5707}," -p",{"type":47,"tag":687,"props":5709,"children":5710},{"style":706},[5711],{"type":53,"value":2838},{"type":47,"tag":687,"props":5713,"children":5714},{"style":700},[5715],{"type":53,"value":2694},{"type":47,"tag":687,"props":5717,"children":5718},{"style":706},[5719],{"type":53,"value":2269},{"type":47,"tag":687,"props":5721,"children":5722},{"class":689,"line":2037},[5723,5727,5731,5736],{"type":47,"tag":687,"props":5724,"children":5725},{"style":717},[5726],{"type":53,"value":3343},{"type":47,"tag":687,"props":5728,"children":5729},{"style":723},[5730],{"type":53,"value":3348},{"type":47,"tag":687,"props":5732,"children":5733},{"style":723},[5734],{"type":53,"value":5735}," scripts.utilities.assemble_searched",{"type":47,"tag":687,"props":5737,"children":5738},{"style":700},[5739],{"type":53,"value":2825},{"type":47,"tag":687,"props":5741,"children":5742},{"class":689,"line":27},[5743,5748,5752,5756,5760,5765,5769,5773,5777,5782],{"type":47,"tag":687,"props":5744,"children":5745},{"style":723},[5746],{"type":53,"value":5747},"    --original-dir",{"type":47,"tag":687,"props":5749,"children":5750},{"style":706},[5751],{"type":53,"value":2838},{"type":47,"tag":687,"props":5753,"children":5754},{"style":700},[5755],{"type":53,"value":2642},{"type":47,"tag":687,"props":5757,"children":5758},{"style":706},[5759],{"type":53,"value":2628},{"type":47,"tag":687,"props":5761,"children":5762},{"style":723},[5763],{"type":53,"value":5764}," --original-csv",{"type":47,"tag":687,"props":5766,"children":5767},{"style":706},[5768],{"type":53,"value":2838},{"type":47,"tag":687,"props":5770,"children":5771},{"style":700},[5772],{"type":53,"value":2642},{"type":47,"tag":687,"props":5774,"children":5775},{"style":706},[5776],{"type":53,"value":2628},{"type":47,"tag":687,"props":5778,"children":5779},{"style":723},[5780],{"type":53,"value":5781},"\u002Fper_sample.csv",{"type":47,"tag":687,"props":5783,"children":5784},{"style":700},[5785],{"type":53,"value":2825},{"type":47,"tag":687,"props":5787,"children":5788},{"class":689,"line":2079},[5789,5794,5798,5802,5806,5811,5815,5819],{"type":47,"tag":687,"props":5790,"children":5791},{"style":723},[5792],{"type":53,"value":5793},"    --rounds-dir",{"type":47,"tag":687,"props":5795,"children":5796},{"style":706},[5797],{"type":53,"value":2838},{"type":47,"tag":687,"props":5799,"children":5800},{"style":700},[5801],{"type":53,"value":2694},{"type":47,"tag":687,"props":5803,"children":5804},{"style":706},[5805],{"type":53,"value":2628},{"type":47,"tag":687,"props":5807,"children":5808},{"style":723},[5809],{"type":53,"value":5810}," --searched-dir",{"type":47,"tag":687,"props":5812,"children":5813},{"style":706},[5814],{"type":53,"value":2838},{"type":47,"tag":687,"props":5816,"children":5817},{"style":700},[5818],{"type":53,"value":2668},{"type":47,"tag":687,"props":5820,"children":5821},{"style":706},[5822],{"type":53,"value":2269},{"type":47,"tag":981,"props":5824,"children":5825},{},[],{"type":47,"tag":56,"props":5827,"children":5829},{"id":5828},"phase-7-filter-regen-eval-default-nn_threshold04",[5830,5832,5838],{"type":53,"value":5831},"Phase 7 — filter + regen + eval (default ",{"type":47,"tag":90,"props":5833,"children":5835},{"className":5834},[],[5836],{"type":53,"value":5837},"nn_threshold=0.4",{"type":53,"value":731},{"type":47,"tag":63,"props":5840,"children":5841},{},[5842,5844,5849,5851,5856,5858,5863,5865,5870,5872,5878],{"type":53,"value":5843},"Phase 7 ",{"type":47,"tag":173,"props":5845,"children":5846},{},[5847],{"type":53,"value":5848},"runs by default",{"type":53,"value":5850}," (",{"type":47,"tag":90,"props":5852,"children":5854},{"className":5853},[],[5855],{"type":53,"value":5837},{"type":53,"value":5857},") on every ",{"type":47,"tag":90,"props":5859,"children":5861},{"className":5860},[],[5862],{"type":53,"value":264},{"type":53,"value":5864}," and\n",{"type":47,"tag":90,"props":5866,"children":5868},{"className":5867},[],[5869],{"type":53,"value":287},{"type":53,"value":5871}," invocation. Pass ",{"type":47,"tag":90,"props":5873,"children":5875},{"className":5874},[],[5876],{"type":53,"value":5877},"nn_threshold=0",{"type":53,"value":5879}," to skip Phase 7.",{"type":47,"tag":63,"props":5881,"children":5882},{},[5883,5884,5889,5890,5895,5897,5903,5905,5910],{"type":53,"value":608},{"type":47,"tag":90,"props":5885,"children":5887},{"className":5886},[],[5888],{"type":53,"value":573},{"type":53,"value":615},{"type":47,"tag":90,"props":5891,"children":5893},{"className":5892},[],[5894],{"type":53,"value":621},{"type":53,"value":5896},". Dropped samples are regenerated\nvia re-AMP (fresh ",{"type":47,"tag":90,"props":5898,"children":5900},{"className":5899},[],[5901],{"type":53,"value":5902},"(clean, submask)",{"type":53,"value":5904}," pairing in the same defect type)\nfor up to 5 attempts. If still short, falls back to best-scoring\nnon-passing regens, then to dropped originals. Final bucket always\nequals ",{"type":47,"tag":90,"props":5906,"children":5908},{"className":5907},[],[5909],{"type":53,"value":151},{"type":53,"value":1036},{"type":47,"tag":63,"props":5912,"children":5913},{},[5914,5920,5922,5927,5929,5934,5936,5942,5944,5950],{"type":47,"tag":90,"props":5915,"children":5917},{"className":5916},[],[5918],{"type":53,"value":5919},"filter_with_regen.py",{"type":53,"value":5921}," runs the final ",{"type":47,"tag":90,"props":5923,"children":5925},{"className":5924},[],[5926],{"type":53,"value":5115},{"type":53,"value":5928}," internally — this\nis the only eval against ",{"type":47,"tag":90,"props":5930,"children":5932},{"className":5931},[],[5933],{"type":53,"value":573},{"type":53,"value":5935},". Read ",{"type":47,"tag":90,"props":5937,"children":5939},{"className":5938},[],[5940],{"type":53,"value":5941},"references\u002Finference.md §Phase 7",{"type":53,"value":5943}," for the regen mechanics, source-column tracing, and\n",{"type":47,"tag":90,"props":5945,"children":5947},{"className":5946},[],[5948],{"type":53,"value":5949},"regens\u002Fregen_summary.csv",{"type":53,"value":5951}," schema.",{"type":47,"tag":676,"props":5953,"children":5955},{"className":678,"code":5954,"language":680,"meta":681,"style":681},"python3 -m scripts.utilities.filter_with_regen \\\n    --searched-dir ${SEARCHED} \\\n    --per-sample-csv ${SEARCHED}\u002Fper_sample.csv \\\n    --threshold ${NN_THRESHOLD} \\\n    --num-sdg ${NUM_SDG} \\\n    --rounds-dir ${ROUNDS} \\\n    --regens-dir ${REGENS} \\\n    --dataset-dir ${DATASET_DIR} \\\n    --clean-dir ${CLEAN_DIR} \\\n    --defect-spec ${DEFECT_DESC} \\\n    --real-path ${DATASET_DIR} \\\n    --anomaly-types ${DEFECTS[@]} \\\n    --checkpoint-dir ${CKPT} --step ${STEP} \\\n    --model-size ${MODEL_SIZE} --num-gpus ${NUM_GPUS}\n",[5956],{"type":47,"tag":90,"props":5957,"children":5958},{"__ignoreMap":681},[5959,5979,6003,6031,6055,6078,6101,6125,6148,6171,6194,6217,6240,6279],{"type":47,"tag":687,"props":5960,"children":5961},{"class":689,"line":690},[5962,5966,5970,5975],{"type":47,"tag":687,"props":5963,"children":5964},{"style":717},[5965],{"type":53,"value":3343},{"type":47,"tag":687,"props":5967,"children":5968},{"style":723},[5969],{"type":53,"value":3348},{"type":47,"tag":687,"props":5971,"children":5972},{"style":723},[5973],{"type":53,"value":5974}," scripts.utilities.filter_with_regen",{"type":47,"tag":687,"props":5976,"children":5977},{"style":700},[5978],{"type":53,"value":2825},{"type":47,"tag":687,"props":5980,"children":5981},{"class":689,"line":2037},[5982,5987,5991,5995,5999],{"type":47,"tag":687,"props":5983,"children":5984},{"style":723},[5985],{"type":53,"value":5986},"    --searched-dir",{"type":47,"tag":687,"props":5988,"children":5989},{"style":706},[5990],{"type":53,"value":2838},{"type":47,"tag":687,"props":5992,"children":5993},{"style":700},[5994],{"type":53,"value":2668},{"type":47,"tag":687,"props":5996,"children":5997},{"style":706},[5998],{"type":53,"value":2628},{"type":47,"tag":687,"props":6000,"children":6001},{"style":700},[6002],{"type":53,"value":2825},{"type":47,"tag":687,"props":6004,"children":6005},{"class":689,"line":27},[6006,6011,6015,6019,6023,6027],{"type":47,"tag":687,"props":6007,"children":6008},{"style":723},[6009],{"type":53,"value":6010},"    --per-sample-csv",{"type":47,"tag":687,"props":6012,"children":6013},{"style":706},[6014],{"type":53,"value":2838},{"type":47,"tag":687,"props":6016,"children":6017},{"style":700},[6018],{"type":53,"value":2668},{"type":47,"tag":687,"props":6020,"children":6021},{"style":706},[6022],{"type":53,"value":2628},{"type":47,"tag":687,"props":6024,"children":6025},{"style":723},[6026],{"type":53,"value":5781},{"type":47,"tag":687,"props":6028,"children":6029},{"style":700},[6030],{"type":53,"value":2825},{"type":47,"tag":687,"props":6032,"children":6033},{"class":689,"line":2079},[6034,6039,6043,6047,6051],{"type":47,"tag":687,"props":6035,"children":6036},{"style":723},[6037],{"type":53,"value":6038},"    --threshold",{"type":47,"tag":687,"props":6040,"children":6041},{"style":706},[6042],{"type":53,"value":2838},{"type":47,"tag":687,"props":6044,"children":6045},{"style":700},[6046],{"type":53,"value":2277},{"type":47,"tag":687,"props":6048,"children":6049},{"style":706},[6050],{"type":53,"value":2628},{"type":47,"tag":687,"props":6052,"children":6053},{"style":700},[6054],{"type":53,"value":2825},{"type":47,"tag":687,"props":6056,"children":6057},{"class":689,"line":2111},[6058,6062,6066,6070,6074],{"type":47,"tag":687,"props":6059,"children":6060},{"style":723},[6061],{"type":53,"value":3453},{"type":47,"tag":687,"props":6063,"children":6064},{"style":706},[6065],{"type":53,"value":2838},{"type":47,"tag":687,"props":6067,"children":6068},{"style":700},[6069],{"type":53,"value":2170},{"type":47,"tag":687,"props":6071,"children":6072},{"style":706},[6073],{"type":53,"value":2628},{"type":47,"tag":687,"props":6075,"children":6076},{"style":700},[6077],{"type":53,"value":2825},{"type":47,"tag":687,"props":6079,"children":6080},{"class":689,"line":2138},[6081,6085,6089,6093,6097],{"type":47,"tag":687,"props":6082,"children":6083},{"style":723},[6084],{"type":53,"value":5793},{"type":47,"tag":687,"props":6086,"children":6087},{"style":706},[6088],{"type":53,"value":2838},{"type":47,"tag":687,"props":6090,"children":6091},{"style":700},[6092],{"type":53,"value":2694},{"type":47,"tag":687,"props":6094,"children":6095},{"style":706},[6096],{"type":53,"value":2628},{"type":47,"tag":687,"props":6098,"children":6099},{"style":700},[6100],{"type":53,"value":2825},{"type":47,"tag":687,"props":6102,"children":6103},{"class":689,"line":2164},[6104,6109,6113,6117,6121],{"type":47,"tag":687,"props":6105,"children":6106},{"style":723},[6107],{"type":53,"value":6108},"    --regens-dir",{"type":47,"tag":687,"props":6110,"children":6111},{"style":706},[6112],{"type":53,"value":2838},{"type":47,"tag":687,"props":6114,"children":6115},{"style":700},[6116],{"type":53,"value":2720},{"type":47,"tag":687,"props":6118,"children":6119},{"style":706},[6120],{"type":53,"value":2628},{"type":47,"tag":687,"props":6122,"children":6123},{"style":700},[6124],{"type":53,"value":2825},{"type":47,"tag":687,"props":6126,"children":6127},{"class":689,"line":2186},[6128,6132,6136,6140,6144],{"type":47,"tag":687,"props":6129,"children":6130},{"style":723},[6131],{"type":53,"value":3484},{"type":47,"tag":687,"props":6133,"children":6134},{"style":706},[6135],{"type":53,"value":2838},{"type":47,"tag":687,"props":6137,"children":6138},{"style":700},[6139],{"type":53,"value":2064},{"type":47,"tag":687,"props":6141,"children":6142},{"style":706},[6143],{"type":53,"value":2628},{"type":47,"tag":687,"props":6145,"children":6146},{"style":700},[6147],{"type":53,"value":2825},{"type":47,"tag":687,"props":6149,"children":6150},{"class":689,"line":2208},[6151,6155,6159,6163,6167],{"type":47,"tag":687,"props":6152,"children":6153},{"style":723},[6154],{"type":53,"value":3508},{"type":47,"tag":687,"props":6156,"children":6157},{"style":706},[6158],{"type":53,"value":2838},{"type":47,"tag":687,"props":6160,"children":6161},{"style":700},[6162],{"type":53,"value":2085},{"type":47,"tag":687,"props":6164,"children":6165},{"style":706},[6166],{"type":53,"value":2628},{"type":47,"tag":687,"props":6168,"children":6169},{"style":700},[6170],{"type":53,"value":2825},{"type":47,"tag":687,"props":6172,"children":6173},{"class":689,"line":2241},[6174,6178,6182,6186,6190],{"type":47,"tag":687,"props":6175,"children":6176},{"style":723},[6177],{"type":53,"value":3532},{"type":47,"tag":687,"props":6179,"children":6180},{"style":706},[6181],{"type":53,"value":2838},{"type":47,"tag":687,"props":6183,"children":6184},{"style":700},[6185],{"type":53,"value":2192},{"type":47,"tag":687,"props":6187,"children":6188},{"style":706},[6189],{"type":53,"value":2628},{"type":47,"tag":687,"props":6191,"children":6192},{"style":700},[6193],{"type":53,"value":2825},{"type":47,"tag":687,"props":6195,"children":6196},{"class":689,"line":23},[6197,6201,6205,6209,6213],{"type":47,"tag":687,"props":6198,"children":6199},{"style":723},[6200],{"type":53,"value":5184},{"type":47,"tag":687,"props":6202,"children":6203},{"style":706},[6204],{"type":53,"value":2838},{"type":47,"tag":687,"props":6206,"children":6207},{"style":700},[6208],{"type":53,"value":2064},{"type":47,"tag":687,"props":6210,"children":6211},{"style":706},[6212],{"type":53,"value":2628},{"type":47,"tag":687,"props":6214,"children":6215},{"style":700},[6216],{"type":53,"value":2825},{"type":47,"tag":687,"props":6218,"children":6219},{"class":689,"line":2300},[6220,6224,6228,6232,6236],{"type":47,"tag":687,"props":6221,"children":6222},{"style":723},[6223],{"type":53,"value":5225},{"type":47,"tag":687,"props":6225,"children":6226},{"style":706},[6227],{"type":53,"value":2838},{"type":47,"tag":687,"props":6229,"children":6230},{"style":700},[6231],{"type":53,"value":2214},{"type":47,"tag":687,"props":6233,"children":6234},{"style":706},[6235],{"type":53,"value":5518},{"type":47,"tag":687,"props":6237,"children":6238},{"style":700},[6239],{"type":53,"value":2825},{"type":47,"tag":687,"props":6241,"children":6242},{"class":689,"line":2329},[6243,6247,6251,6255,6259,6263,6267,6271,6275],{"type":47,"tag":687,"props":6244,"children":6245},{"style":723},[6246],{"type":53,"value":5530},{"type":47,"tag":687,"props":6248,"children":6249},{"style":706},[6250],{"type":53,"value":2838},{"type":47,"tag":687,"props":6252,"children":6253},{"style":700},[6254],{"type":53,"value":271},{"type":47,"tag":687,"props":6256,"children":6257},{"style":706},[6258],{"type":53,"value":2628},{"type":47,"tag":687,"props":6260,"children":6261},{"style":723},[6262],{"type":53,"value":4836},{"type":47,"tag":687,"props":6264,"children":6265},{"style":706},[6266],{"type":53,"value":2838},{"type":47,"tag":687,"props":6268,"children":6269},{"style":700},[6270],{"type":53,"value":279},{"type":47,"tag":687,"props":6272,"children":6273},{"style":706},[6274],{"type":53,"value":2628},{"type":47,"tag":687,"props":6276,"children":6277},{"style":700},[6278],{"type":53,"value":2825},{"type":47,"tag":687,"props":6280,"children":6281},{"class":689,"line":2358},[6282,6286,6290,6294,6298,6303,6307,6311],{"type":47,"tag":687,"props":6283,"children":6284},{"style":723},[6285],{"type":53,"value":3817},{"type":47,"tag":687,"props":6287,"children":6288},{"style":706},[6289],{"type":53,"value":2838},{"type":47,"tag":687,"props":6291,"children":6292},{"style":700},[6293],{"type":53,"value":2306},{"type":47,"tag":687,"props":6295,"children":6296},{"style":706},[6297],{"type":53,"value":2628},{"type":47,"tag":687,"props":6299,"children":6300},{"style":723},[6301],{"type":53,"value":6302}," --num-gpus",{"type":47,"tag":687,"props":6304,"children":6305},{"style":706},[6306],{"type":53,"value":2838},{"type":47,"tag":687,"props":6308,"children":6309},{"style":700},[6310],{"type":53,"value":2335},{"type":47,"tag":687,"props":6312,"children":6313},{"style":706},[6314],{"type":53,"value":2269},{"type":47,"tag":981,"props":6316,"children":6317},{},[],{"type":47,"tag":56,"props":6319,"children":6321},{"id":6320},"output-layout",[6322],{"type":53,"value":6323},"Output layout",{"type":47,"tag":63,"props":6325,"children":6326},{},[6327,6329,6334,6336,6341,6343,6348,6350,6355],{"type":53,"value":6328},"Every eval'd bucket carries the same triad: ",{"type":47,"tag":90,"props":6330,"children":6332},{"className":6331},[],[6333],{"type":53,"value":497},{"type":53,"value":6335}," (gen params +\n",{"type":47,"tag":90,"props":6337,"children":6339},{"className":6338},[],[6340],{"type":53,"value":489},{"type":53,"value":6342},"), ",{"type":47,"tag":90,"props":6344,"children":6346},{"className":6345},[],[6347],{"type":53,"value":473},{"type":53,"value":6349}," (per-sample nn + mnn), ",{"type":47,"tag":90,"props":6351,"children":6353},{"className":6352},[],[6354],{"type":53,"value":481},{"type":53,"value":6356}," (FID \u002F\nper-defect avg).",{"type":47,"tag":676,"props":6358,"children":6362},{"className":6359,"code":6361,"language":53},[6360],"language-text","results\u002F\u003Cname>\u002F\n├── original\u002F         # Phase 3 + 4 — {reconstructed_image\u002F, SDG_result.csv, per_sample.csv, eval.log}\n├── searched\u002F         # final bucket (Phase 6 stitch + Phase 7 filter+regen+eval)\n│                     #   triad as above; SDG_result.csv adds `source` column\n├── rounds\u002F           # Phase 5\n│   ├── round_NN\u002F{draws.json, testcase.jsonl, sdg\u002F{images, triad}}\n│   └── search_summary.csv          # per-sample best-of-round audit\n└── regens\u002F           # Phase 7\n    ├── regen_NN\u002F{allocation.json, amp_samples.json, amp\u002F, testcase.jsonl, sdg\u002F{images, triad}}\n    └── regen_summary.csv           # per-sample source + prev_nn + nn audit\n",[6363],{"type":47,"tag":90,"props":6364,"children":6365},{"__ignoreMap":681},[6366],{"type":53,"value":6361},{"type":47,"tag":56,"props":6368,"children":6370},{"id":6369},"verification",[6371],{"type":53,"value":6372},"Verification",{"type":47,"tag":5283,"props":6374,"children":6375},{},[6376,6394,6412,6423,6468],{"type":47,"tag":1013,"props":6377,"children":6378},{},[6379,6385,6387,6392],{"type":47,"tag":90,"props":6380,"children":6382},{"className":6381},[],[6383],{"type":53,"value":6384},"${ORIGINAL}\u002Freconstructed_image\u002F",{"type":53,"value":6386}," has up to ",{"type":47,"tag":90,"props":6388,"children":6390},{"className":6389},[],[6391],{"type":53,"value":151},{"type":53,"value":6393}," images.",{"type":47,"tag":1013,"props":6395,"children":6396},{},[6397,6403,6405,6410],{"type":47,"tag":90,"props":6398,"children":6400},{"className":6399},[],[6401],{"type":53,"value":6402},"${SEARCHED}\u002Freconstructed_image\u002F",{"type":53,"value":6404}," count == ",{"type":47,"tag":90,"props":6406,"children":6408},{"className":6407},[],[6409],{"type":53,"value":151},{"type":53,"value":6411}," (Phase 7 fills with regen + best-per-defect fallback if needed).",{"type":47,"tag":1013,"props":6413,"children":6414},{},[6415,6421],{"type":47,"tag":90,"props":6416,"children":6418},{"className":6417},[],[6419],{"type":53,"value":6420},"${ROUNDS}\u002Fsearch_summary.csv",{"type":53,"value":6422}," has one row per sample.",{"type":47,"tag":1013,"props":6424,"children":6425},{},[6426,6432,6434,6440,6442,6447,6449,6454,6455,6460,6461,6467],{"type":47,"tag":90,"props":6427,"children":6429},{"className":6428},[],[6430],{"type":53,"value":6431},"original\u002Feval.log",{"type":53,"value":6433},", each ",{"type":47,"tag":90,"props":6435,"children":6437},{"className":6436},[],[6438],{"type":53,"value":6439},"rounds\u002Fround_NN\u002Fsdg\u002Feval.log",{"type":53,"value":6441},", and ",{"type":47,"tag":90,"props":6443,"children":6445},{"className":6444},[],[6446],{"type":53,"value":5686},{"type":53,"value":6448}," contain per-type ",{"type":47,"tag":90,"props":6450,"children":6452},{"className":6451},[],[6453],{"type":53,"value":489},{"type":53,"value":138},{"type":47,"tag":90,"props":6456,"children":6458},{"className":6457},[],[6459],{"type":53,"value":5678},{"type":53,"value":6441},{"type":47,"tag":90,"props":6462,"children":6464},{"className":6463},[],[6465],{"type":53,"value":6466},"fid",{"type":53,"value":1036},{"type":47,"tag":1013,"props":6469,"children":6470},{},[6471,6477,6479,6485,6487,6493,6495,6500],{"type":47,"tag":90,"props":6472,"children":6474},{"className":6473},[],[6475],{"type":53,"value":6476},"${REGENS}\u002Fregen_summary.csv",{"type":53,"value":6478}," exists when Phase 7 ran; ",{"type":47,"tag":90,"props":6480,"children":6482},{"className":6481},[],[6483],{"type":53,"value":6484},"passed_threshold",{"type":53,"value":6486}," column reports per-sample status, ",{"type":47,"tag":90,"props":6488,"children":6490},{"className":6489},[],[6491],{"type":53,"value":6492},"prev_nn",{"type":53,"value":6494}," vs ",{"type":47,"tag":90,"props":6496,"children":6498},{"className":6497},[],[6499],{"type":53,"value":489},{"type":53,"value":6501}," reveals which samples regen actually improved.",{"type":47,"tag":56,"props":6503,"children":6505},{"id":6504},"error-handling",[6506],{"type":53,"value":6507},"Error handling",{"type":47,"tag":1009,"props":6509,"children":6510},{},[6511,6521,6592,6597,6637],{"type":47,"tag":1013,"props":6512,"children":6513},{},[6514,6519],{"type":47,"tag":90,"props":6515,"children":6517},{"className":6516},[],[6518],{"type":53,"value":158},{"type":53,"value":6520}," missing per-type mask dir → allocation scans zero and errors.",{"type":47,"tag":1013,"props":6522,"children":6523},{},[6524,6526,6532,6534,6539,6541,6547,6549,6555,6556,6562,6564,6569,6571,6576,6578,6583,6585,6591],{"type":53,"value":6525},"AMP output short of allocation → ",{"type":47,"tag":90,"props":6527,"children":6529},{"className":6528},[],[6530],{"type":53,"value":6531},"build_jsonl.py",{"type":53,"value":6533}," warns and writes what's available (JSONL shorter than ",{"type":47,"tag":90,"props":6535,"children":6537},{"className":6536},[],[6538],{"type":53,"value":151},{"type":53,"value":6540}," by that delta). Check ",{"type":47,"tag":90,"props":6542,"children":6544},{"className":6543},[],[6545],{"type":53,"value":6546},"run_auto_roi_amp.py",{"type":53,"value":6548}," logs for ",{"type":47,"tag":90,"props":6550,"children":6552},{"className":6551},[],[6553],{"type":53,"value":6554},"NO_DETECTION",{"type":53,"value":1311},{"type":47,"tag":90,"props":6557,"children":6559},{"className":6558},[],[6560],{"type":53,"value":6561},"FAILED",{"type":53,"value":6563},". A defect with ",{"type":47,"tag":173,"props":6565,"children":6566},{},[6567],{"type":53,"value":6568},"zero",{"type":53,"value":6570}," AMP outputs is dropped warn-only; if ",{"type":47,"tag":173,"props":6572,"children":6573},{},[6574],{"type":53,"value":6575},"every",{"type":53,"value":6577}," defect produces zero, ",{"type":47,"tag":90,"props":6579,"children":6581},{"className":6580},[],[6582],{"type":53,"value":6531},{"type":53,"value":6584}," halts with ",{"type":47,"tag":90,"props":6586,"children":6588},{"className":6587},[],[6589],{"type":53,"value":6590},"error: 0 entries written",{"type":53,"value":1036},{"type":47,"tag":1013,"props":6593,"children":6594},{},[6595],{"type":53,"value":6596},"SDG failure mid-round in Phase 5 → halts; re-run resumes from the next round (rounds are append-only).",{"type":47,"tag":1013,"props":6598,"children":6599},{},[6600,6605,6607,6612,6614,6619,6621,6627,6629,6635],{"type":47,"tag":90,"props":6601,"children":6603},{"className":6602},[],[6604],{"type":53,"value":287},{"type":53,"value":6606}," with a ",{"type":47,"tag":90,"props":6608,"children":6610},{"className":6609},[],[6611],{"type":53,"value":144},{"type":53,"value":6613}," not on a ",{"type":47,"tag":90,"props":6615,"children":6617},{"className":6616},[],[6618],{"type":53,"value":1581},{"type":53,"value":6620}," boundary → ",{"type":47,"tag":90,"props":6622,"children":6624},{"className":6623},[],[6625],{"type":53,"value":6626},"torch.load",{"type":53,"value":6628}," FileNotFoundError; ",{"type":47,"tag":90,"props":6630,"children":6632},{"className":6631},[],[6633],{"type":53,"value":6634},"ls ${CKPT}\u002Fcheckpoints\u002Fmodel\u002Fiter_*.pt",{"type":53,"value":6636}," to find valid steps.",{"type":47,"tag":1013,"props":6638,"children":6639},{},[6640,6641,6646,6647,6652],{"type":53,"value":1057},{"type":47,"tag":90,"props":6642,"children":6644},{"className":6643},[],[6645],{"type":53,"value":821},{"type":53,"value":273},{"type":47,"tag":90,"props":6648,"children":6650},{"className":6649},[],[6651],{"type":53,"value":838},{"type":53,"value":6653}," for phase-specific error handling.",{"type":47,"tag":6655,"props":6656,"children":6657},"style",{},[6658],{"type":53,"value":6659},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":6661,"total":6818},[6662,6680,6698,6709,6721,6735,6748,6760,6773,6784,6798,6807],{"slug":6663,"name":6663,"fn":6664,"description":6665,"org":6666,"tags":6667,"stars":6677,"repoUrl":6678,"updatedAt":6679},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6668,6671,6674],{"name":6669,"slug":6670,"type":15},"Documentation","documentation",{"name":6672,"slug":6673,"type":15},"MCP","mcp",{"name":6675,"slug":6676,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":6681,"name":6681,"fn":6682,"description":6683,"org":6684,"tags":6685,"stars":6695,"repoUrl":6696,"updatedAt":6697},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6686,6689,6692],{"name":6687,"slug":6688,"type":15},"Containers","containers",{"name":6690,"slug":6691,"type":15},"Deployment","deployment",{"name":6693,"slug":6694,"type":15},"Python","python",17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":6699,"name":6699,"fn":6700,"description":6701,"org":6702,"tags":6703,"stars":6695,"repoUrl":6696,"updatedAt":6708},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6704,6707],{"name":6705,"slug":6706,"type":15},"CI\u002FCD","ci-cd",{"name":6690,"slug":6691,"type":15},"2026-07-14T05:25:59.97109",{"slug":6710,"name":6710,"fn":6711,"description":6712,"org":6713,"tags":6714,"stars":6695,"repoUrl":6696,"updatedAt":6720},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6715,6716,6717],{"name":6705,"slug":6706,"type":15},{"name":6690,"slug":6691,"type":15},{"name":6718,"slug":6719,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":6722,"name":6722,"fn":6723,"description":6724,"org":6725,"tags":6726,"stars":6695,"repoUrl":6696,"updatedAt":6734},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6727,6730,6731],{"name":6728,"slug":6729,"type":15},"Debugging","debugging",{"name":6718,"slug":6719,"type":15},{"name":6732,"slug":6733,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":6736,"name":6736,"fn":6737,"description":6738,"org":6739,"tags":6740,"stars":6695,"repoUrl":6696,"updatedAt":6747},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6741,6744],{"name":6742,"slug":6743,"type":15},"Best Practices","best-practices",{"name":6745,"slug":6746,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":6749,"name":6749,"fn":6750,"description":6751,"org":6752,"tags":6753,"stars":6695,"repoUrl":6696,"updatedAt":6759},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6754,6755,6758],{"name":13,"slug":14,"type":15},{"name":6756,"slug":6757,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":6761,"name":6761,"fn":6762,"description":6763,"org":6764,"tags":6765,"stars":6695,"repoUrl":6696,"updatedAt":6772},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6766,6769],{"name":6767,"slug":6768,"type":15},"QA","qa",{"name":6770,"slug":6771,"type":15},"Testing","testing","2026-07-14T05:25:53.673039",{"slug":6774,"name":6774,"fn":6775,"description":6776,"org":6777,"tags":6778,"stars":6695,"repoUrl":6696,"updatedAt":6783},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6779,6780],{"name":6690,"slug":6691,"type":15},{"name":6781,"slug":6782,"type":15},"Infrastructure","infrastructure","2026-07-14T05:25:49.362534",{"slug":6785,"name":6785,"fn":6786,"description":6787,"org":6788,"tags":6789,"stars":6695,"repoUrl":6696,"updatedAt":6797},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6790,6793,6794],{"name":6791,"slug":6792,"type":15},"Code Review","code-review",{"name":6718,"slug":6719,"type":15},{"name":6795,"slug":6796,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":6799,"name":6799,"fn":6800,"description":6801,"org":6802,"tags":6803,"stars":6695,"repoUrl":6696,"updatedAt":6806},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6804,6805],{"name":6767,"slug":6768,"type":15},{"name":6770,"slug":6771,"type":15},"2026-07-14T05:25:54.928983",{"slug":6808,"name":6808,"fn":6809,"description":6810,"org":6811,"tags":6812,"stars":6695,"repoUrl":6696,"updatedAt":6817},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6813,6816],{"name":6814,"slug":6815,"type":15},"Automation","automation",{"name":6705,"slug":6706,"type":15},"2026-07-30T05:29:03.275638",496,{"items":6820,"total":27},[6821,6828,6841],{"slug":4,"name":4,"fn":5,"description":6,"org":6822,"tags":6823,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6824,6825,6826,6827],{"name":17,"slug":18,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":771,"name":771,"fn":6829,"description":6830,"org":6831,"tags":6832,"stars":23,"repoUrl":24,"updatedAt":6840},"perform runtime guardrails for AnomalyGen","Product runtime guardrails and preflight validation for PAIDF AnomalyGen. Use only when ANOMALYGEN_PRODUCT_MODE=1, typically inside the product container, before training, inference, evaluation, refinement, filtering, artifact edits, or release runtime validation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6833,6834,6835,6838],{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":6836,"slug":6837,"type":15},"Security","security",{"name":6839,"slug":1048,"type":15},"Validation","2026-07-14T05:31:20.483849",{"slug":6842,"name":6842,"fn":6843,"description":6844,"org":6845,"tags":6846,"stars":23,"repoUrl":24,"updatedAt":6855},"anomalygen-release","build and validate AnomalyGen containers","Build and validate PAIDF AnomalyGen product and develop Docker containers from docker\u002FDockerfile.cuda128. Use when the user asks to build an anomalygen product container, build an anomalygen develop container, validate container runtime permissions, or produce release summaries.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[6847,6848,6851,6854],{"name":6690,"slug":6691,"type":15},{"name":6849,"slug":6850,"type":15},"Docker","docker",{"name":6852,"slug":6853,"type":15},"Engineering","engineering",{"name":9,"slug":8,"type":15},"2026-07-14T05:31:17.447135"]