Files
ethanfel-ComfyUI-LoRA-Optim…/docs
EthanfelandClaude Fable 5 8ad35ac475 feat(autotuner): batch 4 — record_dataset wiring, merge-on-write, identity guard
- Wire the documented record_dataset option: new widget on the AutoTuner
  node calls _save_tuner_dataset_entry after each full sweep (the
  function existed, was tested, and was documented in the wiki — but
  nothing ever called it). Wiki wording aligned: entries are recorded
  on full sweeps only, cache/memory replays don't append.

- Merge-on-write for shared cache files: lora/pair/analysis cache saves
  and the content-hash cache re-read the on-disk state and overlay the
  caller's keys (caller wins; None never clobbers a real lora entry;
  analysis entries are remapped to the caller's stack order first).
  Entries are content-derived so same-key collisions hold equivalent
  data — this removes cross-process lost updates without resorting to
  cross-platform file locking. The GC's prune save passes merge=False
  so dead keys aren't resurrected.

- Model/clip identity tracking via weakrefs (_track_model_identity):
  bare id() comparison could alias a new object reusing a freed
  object's address and serve a stale cached merge; the guard now also
  detects clip swaps and id reuse. Shared by optimize_merge and
  auto_tune.

- _extract_block_name is lru_cached (pure function, called per prefix
  per smoothing pass with two regex evaluations) and drops its local
  re import.

Adds 3 test classes (235 total pass).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 15:35:33 +02:00
..