{
  "schema": "vitrina-rf-research/v1",
  "checked_on": "2026-10-13",
  "scope": "One read-only source review. No training, inference, installs, remote job dispatch or product changes. Proposal only; prior YD attempt remains consumed.",
  "audience": "Internal team choosing continuation and budget",
  "rf_detr_small": {
    "business_conclusion": "Keep RF-DETR Small as an unmeasured challenger. The training recipe exhausted its local memory allowance before producing a model; this is not evidence of poor recognition quality.",
    "status": "TECHNICAL_FAILURE",
    "quality": "NOT_MEASURED",
    "observed": {
      "fits": 1,
      "retries": 0,
      "fit_seconds": 66.1,
      "epochs_completed": 0,
      "checkpoint_count": 0,
      "optimizer_steps": "UNKNOWN; receipt zero is not a trustworthy completed-step counter after exception",
      "runtime": {
        "python": "3.12.13",
        "torch": "2.14.1",
        "rfdetr": "1.11.2",
        "pytorch_lightning": "2.6.6",
        "numpy": "2.3.5",
        "venv": "vitrina/research/reviews/classifier-trial-20261006/detector-batch-preflight/runtime/rfdetr/.venv",
        "mps_watermarks": {
          "PYTORCH_MPS_HIGH_WATERMARK_RATIO": "0.80",
          "PYTORCH_MPS_LOW_WATERMARK_RATIO": "0.65"
        }
      },
      "resolution": 640,
      "microbatch": 2,
      "gradient_accumulation": 2,
      "planned_epochs": 18,
      "multi_scale": "per-batch, expanded scales enabled; 11 sizes from 480 to 800, step 32",
      "gradient_checkpointing": false,
      "num_workers": 2,
      "precision": "MPS 16-mixed (fp16)",
      "failure_site": "loss.backward() in Lightning automatic optimization, epoch 0",
      "oom": {
        "allocated_gib": 7.48,
        "other_allocations_gib": 1.96,
        "max_allowed_gib": 9.47,
        "requested_mib": 72
      },
      "max_mps_driver_gib": 9.432,
      "max_process_tree_rss_gib_guard": 2.659,
      "resource_guard": "12 GiB process-tree RSS guard did not fire. Stage imposed HIGH_WATERMARK_RATIO=0.80, which produced a stricter 9.47 GiB Metal limit.",
      "counter_caveat": "RSS and MPS-driver memory are different counters; do not add their independent maxima or describe the sum as unique physical memory."
    },
    "observed_vs_inferred": {
      "confirmed": "Training configuration, monotonic rise of sampled driver memory, terminal MPS allocation error and missing checkpoint are saved evidence.",
      "likely_contributors": "Variable input shapes, larger real annotation sets, Lightning/optimizer buffers and the real loader make the synthetic three-shape probe optimistic. Allocation-cache retention across shapes is plausible and consistent with the trace, but no allocator-profile ablation proves the decomposition.",
      "not_established": [
        "A general RF-DETR architecture failure",
        "An inherent incompatibility with Apple MPS",
        "A quality score on the jewelry task",
        "A guaranteed successful replacement configuration"
      ]
    },
    "installed_source_checks": {
      "version": "1.11.2",
      "small_default": "config.py:1032-1041: resolution 512, positional encoding 32, 2 windows x patch size 16",
      "fixed_shape": "TrainConfig.multi_scale accepts False/off. Use square_resize_div_64=True to preserve square outputs.",
      "checkpointing": "ModelConfig.gradient_checkpointing exists and belongs in the model constructor, not train().",
      "precision": "training/trainer.py:639-640 returns 32-true for amp_dtype=None; 730-742 returns 16-mixed for MPS auto or bf16. Explicit bf16 does not enable MPS BF16 in this version.",
      "keep_resolution": "640 is divisible by patch_size * num_windows = 32. Reducing to 512 is possible but would add a resolution confound for small mounts."
    },
    "proposed_next_recipe": {
      "status": "PROPOSED_NOT_RUN_REQUIRES_NEW_SERIES_ADMISSION",
      "intent": "One feasibility-and-quality attempt with the same Small model and frozen data protocol; change memory behavior without lowering the 640px task floor.",
      "constructor": {
        "model": "RFDETRSmall",
        "resolution": 640,
        "positional_encoding_size": 40,
        "gradient_checkpointing": true,
        "compile": false,
        "cuda_graphs": false
      },
      "train": {
        "device": "mps",
        "batch_size": 1,
        "grad_accum_steps": 4,
        "resolution": 640,
        "multi_scale": false,
        "square_resize_div_64": true,
        "amp_dtype": "fp16",
        "num_workers": 0,
        "epochs": 18,
        "seed": 0
      },
      "preserve": "Same pinned initial weights, class definitions, shared export, split, evaluator, train-only labels and validation-only threshold selection. Record augmentation and schedule differences from the old attempt.",
      "hard_ceiling_proposal": {
        "fits": 1,
        "retries": 0,
        "wall_seconds": 2700,
        "epochs": 18,
        "optimizer_steps": 630,
        "process_tree_rss_gib": 12,
        "mps_high_watermark_ratio": 0.8,
        "mps_low_watermark_ratio": 0.65
      },
      "memory_guard": "Keep the Metal cap; instrument driver and current-allocated memory plus process-tree RSS. Do not disable the watermark. Within the same fit, stop before the cap if memory fails to stabilize with usable headroom during the initial complete train/validation cycle. A checkpoint is necessary but not sufficient to declare success.",
      "success": "A terminal training receipt, usable checkpoint and exactly one frozen evaluation with explicit failures, excluded candidates and runtime boundaries.",
      "limits": "Feasibility, memory savings and 45-minute completion are unverified. Checkpointing trades extra compute for lower activation memory; microbatch one can slow training. Do not promise 18 epochs finish within the ceiling.",
      "nvidia_alternative": "Potential existing NVIDIA hardware was mentioned in surrounding context, but exact GPU, VRAM, availability and runtime were not supplied in this delegated evidence packet. Verify those first; no capacity, speed, cost or cloud budget claim. Do not dispatch automatically."
    },
    "license": {
      "name": "Apache-2.0",
      "scope": "RF-DETR Small and core package, confirmed by official detection table and saved model_config. Other RF-DETR Plus sizes have different terms; do not generalize Small license to the whole brand.",
      "source_ids": [
        "rf_detection",
        "rf_license"
      ]
    },
    "presentation_warning": "Official 3.5ms Small latency is T4/TensorRT/FP16/batch1 on model input, not our full-photo MPS pipeline. Exclude it from our measured cost/latency comparison."
  },
  "dinov3": {
    "license_name": "DINOv3 License, custom Meta agreement, last updated August 19, 2025",
    "license_summary": "It grants royalty-free use, modification and redistribution; it is not a non-commercial-only license. Distribution of materials or derivatives must carry the agreement and its terms. Research publication must acknowledge DINO. Privacy, trade-control and restricted end-use clauses apply. Meta disclaims warranties/support and can change the agreement. This is not Apache/MIT or a blanket clearance for every customer.",
    "commercial_continuation": "Treat customer delivery terms and exact legal entity/end use as a release checklist item; do not block internal evidence analysis or describe commercial use as prohibited. Prior owner license acceptance is recorded, but does not automatically establish every downstream customer deployment.",
    "provenance": {
      "weight_name": "dinov3_vits16_pretrain_lvd1689m-08c60483.pth",
      "weight_sha256": "08c60483bc63c04f533611e34bf70b120eedb7240f469bc16e9e20bf344b941d",
      "source_host": "dinov3.llamameta.net",
      "bytes": 86531063,
      "signed_url_saved": false,
      "source_commit": "6876159a11b4df116f30f667f8c9888617df0751",
      "owner_acceptance_recorded_in": [
        "research/reviews/insid3-approved-20261006/README.md",
        "research/reviews/insid3-approved-20261006/setup-result.json"
      ]
    },
    "source_ids": [
      "dino_license",
      "dino_repo"
    ]
  },
  "public_sources": [
    {
      "id": "rf_parameters",
      "title": "Roboflow RF-DETR training parameters",
      "url": "https://rfdetr.roboflow.com/latest/learn/train/training-parameters/",
      "supports": [
        "MPS integer batch and gradient accumulation",
        "Constructor-only checkpointing",
        "Precision and resolution requirements"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "rf_advanced",
      "title": "Roboflow RF-DETR advanced training",
      "url": "https://rfdetr.roboflow.com/latest/learn/train/advanced/",
      "supports": [
        "Memory-compute checkpointing tradeoff",
        "OOM mitigation"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "rf_detection",
      "title": "Roboflow RF-DETR detection model table",
      "url": "https://rfdetr.roboflow.com/latest/learn/run/detection/",
      "supports": [
        "Small Apache-2.0",
        "Small default512/32.1M",
        "Published latency hardware boundary"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "rf_license",
      "title": "RF-DETR repository license",
      "url": "https://github.com/roboflow/rf-detr/blob/develop/LICENSE",
      "supports": [
        "Apache-2.0 license link from official package documentation"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "pytorch_mps",
      "title": "PyTorch2.14 MPS environment variables",
      "url": "https://docs.pytorch.org/docs/2.14/mps_environment_variables.html",
      "supports": [
        "High watermark is hard allocation limit",
        "Zero disables cap and can cause system failure"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "dino_license",
      "title": "Meta DINOv3 License",
      "url": "https://github.com/facebookresearch/dinov3/blob/main/LICENSE.md",
      "raw_url": "https://raw.githubusercontent.com/facebookresearch/dinov3/main/LICENSE.md",
      "supports": [
        "Custom grant",
        "Redistribution",
        "Publication acknowledgment",
        "Trade controls",
        "Amendments"
      ],
      "checked_on": "2026-10-13"
    },
    {
      "id": "dino_repo",
      "title": "Official Meta DINOv3 repository",
      "url": "https://github.com/facebookresearch/dinov3",
      "supports": [
        "Code and weights covered by DINOv3 License",
        "Gated official weight download"
      ],
      "checked_on": "2026-10-13"
    }
  ],
  "source_pins": [
    {
      "path": "vitrina-local-models/lab/yd-series/runs/rfdetr_small/stage_result.json",
      "sha256": "604dcf7229f23f05fb1d968f99cb5612b2bc9fb5809aefd3b9a51366c8991c88",
      "bytes": 11348
    },
    {
      "path": "vitrina-local-models/lab/yd-series/runs/rfdetr_small/train/yd_train_receipt.json",
      "sha256": "585b13a16c56b6fe492c3ab2ffc404719d285baedc4691ed241321b3e4f5822e",
      "bytes": 2729
    },
    {
      "path": "vitrina-local-models/lab/yd-series/runs/rfdetr_small/train/training_config.json",
      "sha256": "9e2b2c817d88cd85e7b04710d6c64074d7feda2520a4de39390768b0d75459d9",
      "bytes": 4396
    },
    {
      "path": "vitrina-local-models/lab/yd-series/runs/rfdetr_small/train/yd_memory.jsonl",
      "sha256": "caa4c043c775e8260174047e23520afa82e1e4793167c0e0c4eac4bfde882868",
      "bytes": 774
    },
    {
      "path": "vitrina-local-models/lab/yd-series/runs/rfdetr_small/train.log",
      "sha256": "86b58ff82667af734af819bf005d947de9eb2edda1bdf23a2634eb9b3ddb6f65",
      "bytes": 15835
    },
    {
      "path": "vitrina/research/reviews/classifier-trial-20261006/detector-batch-preflight/runtime/rfdetr/.venv/lib/python3.12/site-packages/rfdetr/config.py",
      "sha256": "674eaafb19a00fcfcaa6e4495ea4c6f20b3fa347002f0e5ead8fdd1fe30f77a1",
      "bytes": 94559
    },
    {
      "path": "vitrina/research/reviews/classifier-trial-20261006/detector-batch-preflight/runtime/rfdetr/.venv/lib/python3.12/site-packages/rfdetr/training/trainer.py",
      "sha256": "a4c6a11b62aa611c317200f2de17d952d0b091b25b62e0fe36efd71370f254d3",
      "bytes": 54474
    },
    {
      "path": "vitrina/research/reviews/classifier-trial-20261006/detector-batch-preflight/runtime/rfdetr/.venv/lib/python3.12/site-packages/rfdetr/datasets/coco.py",
      "sha256": "6f1d08811c0d85ee07dce5b2cdd4b014e9cb996630f1aca6955dc3f5468dd6fd",
      "bytes": 80803
    },
    {
      "path": "vitrina/research/reviews/insid3-approved-20261006/download.json",
      "sha256": "d77ced612b6e718d1c3b5c1206d08ec6c795248c482eadb53acceedbde7236c9",
      "bytes": 231
    },
    {
      "path": "vitrina/research/reviews/insid3-approved-20261006/README.md",
      "sha256": "085aeda0f3666b067f02471f13adc70b1a95529e93fb26bb867161b5a1ce1b28",
      "bytes": 4425
    },
    {
      "path": "vitrina/research/reviews/insid3-approved-20261006/setup-result.json",
      "sha256": "1e04d69206a09e49c1a7e8703b0c4e3b5aa8f3691460f939d501827707b63336",
      "bytes": 1058
    },
    {
      "path": "vitrina/research/reviews/insid3-approved-20261006/source/dinov3-6876159a11b4df116f30f667f8c9888617df0751/LICENSE.md",
      "sha256": "25d122eb8f5b880fd23c736fb6ea8018ee45c12237e00b8a86d14c653904999e",
      "bytes": 7503
    },
    {
      "path": "vitrina/research/reviews/insid3-approved-20261006/assets/dinov3_vits16_pretrain_lvd1689m-08c60483.pth",
      "sha256": "08c60483bc63c04f533611e34bf70b120eedb7240f469bc16e9e20bf344b941d",
      "bytes": 86531063
    },
    {
      "path": "vitrina-local-models/lab/t2-qwen/result.json",
      "sha256": "ca1f78f6138dbee2811899a9f45e07e3e629c9f0a57123f6ed142127f1b3b123",
      "bytes": 9800
    }
  ],
  "limitations": [
    "No new model execution; proposed recipe is untested.",
    "No new clean evaluation set; archived annotations remain AI drafts.",
    "No independent proof of exact allocator-retention mechanism.",
    "License summary supports planning; downstream contractual applicability remains a release decision."
  ]
}