Skip to content

[Issue 101][eval-and-fix] Guard diffusers metadata lookup (closes pollockjj/mydevelopment#119)#36

Merged
pollockjj merged 13 commits into
issue_101from
issue_119
May 5, 2026
Merged

[Issue 101][eval-and-fix] Guard diffusers metadata lookup (closes pollockjj/mydevelopment#119)#36
pollockjj merged 13 commits into
issue_101from
issue_119

Conversation

@pollockjj
Copy link
Copy Markdown
Owner

@pollockjj pollockjj commented May 4, 2026

Plan: Lock-in regression for the comfy/sd.py diffusers-format metadata guard

Overview

The unsafe metadata["keep_diffusers_format"] indexing in VAE.__init__ (CodeRabbit r2959796358, Critical) is already corrected to metadata.get("keep_diffusers_format") on pollockjj/ComfyUI:issue_101 (SHA 7936e591) at comfy/sd.py:444. This plan adds one regression-only test module to tests-unit/comfy_test/, with five binary AC cells that pin all five input shapes the live guard's or-disjunct must resolve: AC1 (truthy missing-key dict → convert_vae_state_dict invoked), AC2 (key-present-"true" → invocation skipped), AC3 (metadata is None → invoked, additive completeness added in round 8), AC4 (key-present-"false" → invoked, additive completeness added in round 8), AC5 (metadata = {} empty-dict → invoked, additive completeness added in round 26). Zero LOC of production code change.

Round 8 Scope Expansion

The deliverable was extended in round 8 of PR review (Copilot inline finding r3185061776 on PR #36, ACCEPTED in github_issues/119/pr_review_round_8/copilot_decisions.json) from the issue body's two-cell binary AC contract (AC1 key-missing, AC2 key-present-"true") to a four-cell completeness contract that pins four of the five input shapes the live guard's disjunct must resolve. AC3 (metadata is None) and AC4 (key-present-"false") are strictly additive: zero edits to AC1 / AC2 nodeids, literals, or assertions; new test functions appended after AC2; the _exercise_guard helper handles all four cells. The expansion locks the guard against the regression shape if metadata and metadata.get(...) is None: which would keep AC1+AC2 green while breaking real callers that omit metadata or pass a non-"true" value (full regression-coverage witness in github_issues/119/pr_review_round_8/triage_notes.md). PR body updated in round 9 (Copilot inline finding r3185101996 ACCEPTED, github_issues/119/pr_review_round_9/copilot_decisions.json) to align the description and slice contract with the four-cell deliverable on the wire at that time.

Round 26 Scope Expansion

The deliverable was further extended in round 26 of PR review (Copilot inline finding r3185375054 on PR #36, ACCEPTED in github_issues/119/pr_review_round_26/copilot_decisions.json) from the round-8 four-cell contract to the current five-cell completeness contract that pins all five input shapes the live guard's or-disjunct must resolve. AC5 (metadata = {} empty-dict) is strictly additive: zero edits to AC1 / AC2 / AC3 / AC4 nodeids, literals, or assertions; new test function appended after AC4; the _exercise_guard helper handles all five cells. The expansion locks the guard against the regression shape if metadata is None or (metadata and metadata.get("keep_diffusers_format") != "true"): which would keep AC1+AC2+AC3+AC4 green while breaking real callers that pass an empty dict — a real production input shape produced by comfy.utils.convert_old_quants (comfy/utils.py:1359-1360) which normalizes None to {} before load_state_dict_guess_config constructs the VAE at comfy/sd.py:1739 (vae = VAE(sd=vae_sd, metadata=metadata)). The empty-dict short-circuits the regression's and to False because bool({}) is False, while AC1's truthy missing-key mapping {"unrelated_key": "value"} evaluates to True and does not pin this falsy missing-key path. Full regression-coverage witness in github_issues/119/pr_review_round_26/triage_notes.md. PR body updated in round 27 (Copilot inline findings r3185413283 and r3185413305 ACCEPTED, github_issues/119/pr_review_round_27/copilot_decisions.json) to align the description and slice contract with the five-cell deliverable now on the wire.

Diagnosis Summary

Pre-merge state on pollockjj/ComfyUI:issue_101 carried if metadata is None or metadata["keep_diffusers_format"] != "true": at the comfy/sd.py:444 guard. When metadata was a non-None dict that did not contain the keep_diffusers_format key — the common case for any safetensors VAE with ordinary metadata — the indexing raised KeyError("keep_diffusers_format") BEFORE diffusers_convert.convert_vae_state_dict(sd) could rewrite the state dict, breaking otherwise-valid diffusers-format VAEs. The CodeRabbit-suggested fix swapped the unsafe […] for .get(…), restoring the intended two-branch behavior: (1) call convert_vae_state_dict when metadata is None, lacks the key, or has the key but pinned to a value other than the literal string "true"; (2) skip the conversion only when the caller has explicitly pinned keep_diffusers_format = "true". The fix landed via upstream Comfy-Org#11294 follow-up and is currently live on issue_101. This packet is regression-only: it commits the test module that would have caught the original KeyError and that locks the symmetric skip-branch against future regression.

Failure Signature

  • Pre-merge form metadata["keep_diffusers_format"] != "true" raises KeyError: 'keep_diffusers_format' when invoked with metadata = {"any_other_key": "any_value"} — observable as an unhandled KeyError traceback rooted at comfy/sd.py line of the unsafe indexing.

Reproduction Path

  • The pre-merge form is no longer reachable on issue_101; this regression test packet asserts the post-merge .get() form via patched-mock observation. The deliverable repo's CI suite would surface a regression to the unsafe form as an AC1 test failure.

Failure Boundary

  • The defect is bounded by the inner if metadata is None or …: predicate at comfy/sd.py:444. The outer if not is_seedvr2_vae and 'decoder.up_blocks.0.resnets.0.norm1.weight' in sd.keys(): (line 443) and the SeedVR2 short-circuit on is_seedvr2_vae (line 442) are out of scope; AC1, AC2, AC3, AC4, and AC5 all feed only the diffusers trigger key (line 443) and never the SeedVR2 indicator (line 442) to keep the test pinned to the targeted guard.

Proposed Fix

  • No production-code change. The fix is already live at comfy/sd.py:444 on issue_101 SHA 7936e591. This plan's deliverable is one new test module at tests-unit/comfy_test/test_diffusers_metadata_guard.py exercising the live form via patched unittest.mock.

Verification Strategy

  • Five binary AC cells. All five cells patch comfy.sd.diffusers_convert.convert_vae_state_dict and comfy.sd.model_management.is_amd via the _exercise_guard helper, invoke a _make_standin-bound VAE.__init__ with sd={trigger_key: torch.zeros(1)}, and assert on mock_convert.call_count plus mock_is_amd.called (post-guard reach witness). AC1 invokes with metadata={"unrelated_key":"value"} and asserts mock_convert.call_count == 1; with the pre-merge unsafe indexing, the call would raise KeyError before reaching the patched call, leaving call_count == 0 and failing AC1. AC2 invokes with metadata={"keep_diffusers_format":"true"} and asserts mock_convert.call_count == 0, locking the symmetric skip path; it would FAIL under a regression that removes the inner guard entirely (always-call form) producing call_count == 1. AC3 invokes with metadata=None and asserts mock_convert.call_count == 1, pinning the first disjunct (metadata is None); it would FAIL under the round-8 Copilot regression shape if metadata and metadata.get(...) is None: which evaluates None and X = None and skips the conversion. AC4 invokes with metadata={"keep_diffusers_format":"false"} and asserts mock_convert.call_count == 1, pinning the second disjunct against any non-"true" value; it would FAIL under the same round-8 regression shape which evaluates "false" is None = False and skips the conversion. AC5 invokes with metadata={} and asserts mock_convert.call_count == 1, pinning the falsy missing-key path that real callers produce via convert_old_quants's None{} normalization; it would FAIL under the round-26 Copilot regression shape if metadata is None or (metadata and metadata.get(...) != "true"): which short-circuits the empty dict's and to False and skips the conversion.

Affected Repositories

Repository Path Base Branch Issue Branch
pollockjj/ComfyUI /home/johnj/dev_master/ComfyUI issue_101 issue_119
pollockjj/mydevelopment /home/johnj/dev_master/mydevelopment main issue_119

pollockjj/ComfyUI:issue_119 carries the deliverable test module; pollockjj/mydevelopment:issue_119 carries the bookkeeping plan, gate outputs, evidence logs, and post-mortem. The deliverable PR targets issue_101 (per --deliverable-base issue_101 melian flag); the bookkeeping PR targets main.

Research and Methodology

Plan Foundations Comment URL: https://github.com/pollockjj/mydevelopment/issues/119#issuecomment-4374620437

Detected Scope: none — Regression-only test packet for an already-applied upstream fix at comfy/sd.py:444 on pollockjj/ComfyUI:issue_101; mirrors the _make_standin precedent established by #109 in tests-unit/comfy_test/seedvr_model_test.py:48-58 with byte-identical pattern.

The linked comment is the load-bearing artifact for the equivalence rule (behavioral-mock-callcount, proposed seed entry), the binding parent-issue directives (CodeRabbit r2959796358 thread on Comfy-Org#11294 and the issue body's two-AC contract — extended to four AC cells per round-8 Copilot review r3185061776 per the Round 8 Scope Expansion section above, then to five AC cells per round-26 Copilot review r3185375054 per the Round 26 Scope Expansion section above), the internal-surface citations (comfy/sd.py:440-446 on issue_101, comfy/utils.py:1359-1360 and comfy/sd.py:1697,1739 on issue_101 for the AC5 production-input path, and tests-unit/comfy_test/seedvr_model_test.py:48-58 on issue_109), and the I/O contract for the binary integer measurement. Every AC below that names a tool, file path, function symbol, or measurement traces by quote or live probe to either that comment or the ## Ground Truth Probes section.

Tools, Pipeline, and Measurements

Plan Foundations Comment URL: https://github.com/pollockjj/mydevelopment/issues/119#issuecomment-4374620437

The linked comment's ## Tools, Pipeline, and Measurements section enumerates: (1) Existing Tooling Inventory (pytest, unittest.mock, torch, comfy.cli_args — all REUSE with citations); (2) Pipeline stages from pytest invocation to mock-call-count assertion; (3) Measurements table (binary integer assertions, one per AC — two ACs at plan-foundations time, four after round-8 expansion per the Round 8 Scope Expansion section above, five after round-26 expansion per the Round 26 Scope Expansion section above); (4) HR-06 declared not applicable (no sweep); (5) HR-11 declared not applicable (no characterization verdict). The five ACs below trace each tool, pipeline stage, and measurement to that section.

Ground Truth Probes

Probe ID Consumed by AC(s) Probe command Observed output (verbatim)
GTP-1 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI show issue_101:comfy/sd.py | sed -n '440,446p'
class VAE:
def init(self, sd=None, device=None, config=None, dtype=None, metadata=None):
is_seedvr2_vae = "decoder.up_blocks.2.upsamplers.0.upscale_conv.weight" in sd
if not is_seedvr2_vae and 'decoder.up_blocks.0.resnets.0.norm1.weight' in sd.keys(): #diffusers format
if metadata is None or metadata.get("keep_diffusers_format") != "true":
sd = diffusers_convert.convert_vae_state_dict(sd)
GTP-2 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI show issue_109:tests-unit/comfy_test/seedvr_model_test.py | sed -n '48,58p'
def _make_standin(positive_conditioning):
class _StandIn(torch.nn.Module):
def init(self):
super().init()
self.register_buffer(
"positive_conditioning", positive_conditioning
)

_resolve_text_conditioning = NaDiT._resolve_text_conditioning
_swap_pos_neg_halves = NaDiT._swap_pos_neg_halves

return _StandIn()
GTP-3 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 cd /home/johnj/dev_master/ComfyUI && .venv/bin/python -c "import comfy.cli_args as c; c.args.cpu = True; import comfy.sd, inspect; print(list(inspect.signature(comfy.sd.VAE.__init__).parameters))" ['self', 'sd', 'device', 'config', 'dtype', 'metadata']
GTP-4 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 cd /home/johnj/dev_master/ComfyUI && .venv/bin/python -c "import comfy.cli_args as c; c.args.cpu = True; import comfy.sd as sd; import comfy.diffusers_convert; print('same_module:', sd.diffusers_convert is comfy.diffusers_convert)" same_module: True
GTP-5 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 cd /home/johnj/dev_master/ComfyUI && .venv/bin/python -c "import inspect, comfy.cli_args as c; c.args.cpu = True; import comfy.sd as sd; print(list(inspect.signature(sd.diffusers_convert.convert_vae_state_dict).parameters))" ['vae_state_dict']
GTP-6 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI grep -n "decoder.up_blocks.0.resnets.0.norm1.weight" issue_101 -- comfy/sd.py issue_101:comfy/sd.py:443: if not is_seedvr2_vae and 'decoder.up_blocks.0.resnets.0.norm1.weight' in sd.keys(): #diffusers format
GTP-7 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI grep -n "decoder.up_blocks.2.upsamplers.0.upscale_conv.weight" issue_101 -- comfy/sd.py | head -1 issue_101:comfy/sd.py:442: is_seedvr2_vae = "decoder.up_blocks.2.upsamplers.0.upscale_conv.weight" in sd
GTP-8 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI show issue_101:pytest.ini
[pytest]
markers =
inference: mark as inference test (deselect with '-m "not inference"')
execution: mark as execution test (deselect with '-m "not execution"')
testpaths =
tests
tests-unit
addopts = -s
pythonpath = .
GTP-9 Slice 1 AC-1, AC-2, AC-3, AC-4, AC-5 git -C /home/johnj/dev_master/ComfyUI show issue_101:comfy/sd.py | grep -n "from . import diffusers_convert" 34:from . import diffusers_convert

Asset Readiness Inventory

Asset Location Provenance Status
Live comfy/sd.py source carrying the safe-.get() form at comfy/sd.py:444 pollockjj/ComfyUI:issue_101 SHA 7936e591, blob path comfy/sd.py lines 440–446 Merged from Comfy-Org#11294 follow-up (CodeRabbit r2959796358); git log issue_101 --oneline -10 shows the merge commit at HEAD VERIFIED via GTP-1 (git show issue_101:comfy/sd.py)
_make_standin precedent file pollockjj/ComfyUI:issue_109 SHA 4cdaf5a5, blob path tests-unit/comfy_test/seedvr_model_test.py lines 48–58 Established by #109 PR (parent #101); per git ls-tree issue_109 -- tests-unit/comfy_test/, the file is on issue_109 only and does not exist on issue_101 VERIFIED via GTP-2 (git show issue_109:tests-unit/comfy_test/seedvr_model_test.py); the new test on issue_119 ports the pattern (does not import the file)
Pytest test infrastructure (pytest.ini, tests-unit/comfy_test/ directory) pollockjj/ComfyUI:issue_101 repo root + tests-unit/comfy_test/ Standard ComfyUI test infrastructure, present since pre-merge VERIFIED via GTP-8 (git show issue_101:pytest.ini)

No external model weights, datasets, calibration corpora, or third-party services are required. The packet operates entirely on the in-tree source surface and stdlib (unittest.mock, contextlib) plus the repo-pinned pytest and torch.

Created Surface Contract

Created literal Slice that creates it
File tests-unit/comfy_test/test_diffusers_metadata_guard.py (new test module on pollockjj/ComfyUI:issue_119) Slice 1
Function test_diffusers_guard_invokes_convert_when_metadata_missing_key (AC1, in the new module) Slice 1
Function test_diffusers_guard_skips_convert_when_metadata_pins_keep_true (AC2, in the new module) Slice 1
Function test_diffusers_guard_invokes_convert_when_metadata_is_none (AC3, in the new module; additive completeness added round 8 per Copilot r3185061776) Slice 1
Function test_diffusers_guard_invokes_convert_when_metadata_pins_keep_false (AC4, in the new module; additive completeness added round 8 per Copilot r3185061776) Slice 1
Function test_diffusers_guard_invokes_convert_when_metadata_is_empty_dict (AC5, in the new module; additive completeness added round 26 per Copilot r3185375054) Slice 1
Helper _make_standin() (this packet's local port of the #109 pattern; binds comfy.sd.VAE.__init__ onto a tiny standin class so the production __init__ body executes in its own module namespace without instantiating a full VAE) Slice 1
Helper _exercise_guard(metadata) (single-source harness shared by AC1, AC2, AC3, AC4, AC5; patches comfy.sd.diffusers_convert.convert_vae_state_dict via passthrough lambda and comfy.sd.model_management.is_amd via _PostGuardReached sentinel; returns (mock_convert, mock_is_amd) for per-cell paired assertions) Slice 1
Sentinel exception class _PostGuardReached (raised by the patched is_amd to halt VAE.__init__ at the first call past the guard; caught by narrow contextlib.suppress(_PostGuardReached) in _exercise_guard) Slice 1
Module-level constant _DIFFUSERS_TRIGGER_KEY = "decoder.up_blocks.0.resnets.0.norm1.weight" (in the new module; mirrors the literal at comfy/sd.py:443 per GTP-6) Slice 1
Evidence log github_issues/119/slice1/test_AC1_key_missing.log (committed on pollockjj/mydevelopment:issue_119) Slice 1
Evidence log github_issues/119/slice1/test_AC2_key_present_true.log (committed on pollockjj/mydevelopment:issue_119) Slice 1
Evidence log github_issues/119/slice1/test_AC3_metadata_none.log (committed on pollockjj/mydevelopment:issue_119; round-8 additive completeness) Slice 1
Evidence log github_issues/119/slice1/test_AC4_keep_false.log (committed on pollockjj/mydevelopment:issue_119; round-8 additive completeness) Slice 1
Evidence log github_issues/119/slice1/test_AC5_metadata_empty_dict.log (committed on pollockjj/mydevelopment:issue_119; round-26 additive completeness) Slice 1

Slices


Slice 1: Lock the diffusers-format metadata guard via five-cell regression test

Kind: implementation

Objective: Prove that the live comfy/sd.py:443-446 two-branch guard correctly resolves all five input shapes its or-disjunct must handle: AC1 (metadata non-None truthy missing-key dict → convert_vae_state_dict invoked); AC2 (metadata non-None, key="true" → invocation skipped); AC3 (metadata is None → invoked, additive completeness from round 8 per Copilot r3185061776); AC4 (metadata non-None, key="false" → invoked, additive completeness from round 8 per Copilot r3185061776); AC5 (metadata = {} empty-dict → invoked, additive completeness from round 26 per Copilot r3185375054). All five cells exercise the guard via patched unittest.mock observation under a _make_standin standin class that binds the production VAE.__init__ without instantiating a full VAE, sharing the _exercise_guard helper so the patched-converter / patched-is_amd / _PostGuardReached / narrow-suppress machinery is single-sourced.

Acceptance Criteria

  • AC-1: cd /home/johnj/dev_master/ComfyUI && python3 -m pytest -q tests-unit/comfy_test/test_diffusers_metadata_guard.py::test_diffusers_guard_invokes_convert_when_metadata_missing_key exits 0; the test patches comfy.sd.diffusers_convert.convert_vae_state_dict with unittest.mock.patch.object(..., autospec=True), invokes a _make_standin-bound comfy.sd.VAE.__init__ with sd = {"decoder.up_blocks.0.resnets.0.norm1.weight": torch.zeros(1)} and metadata = {"unrelated_key": "value"} under contextlib.suppress(Exception), and asserts mock_convert.call_count == 1 — verified by committed artifact github_issues/119/slice1/test_AC1_key_missing.log (on pollockjj/mydevelopment:issue_119) containing the pytest stdout line matching ^1 passed (or ^.* 1 passed.*$) for that nodeid and exit code 0.

    • Pre-fix-fingerprint: with the pre-merge unsafe form metadata["keep_diffusers_format"] != "true" (CodeRabbit r2959796358 thread on feat: Add support For SeedVR2 (CORE-6) Comfy-Org/ComfyUI#11294, before the upstream fix landed on issue_101 SHA 7936e591), the same invocation raised KeyError: 'keep_diffusers_format' BEFORE reaching diffusers_convert.convert_vae_state_dict(sd); the patched mock therefore recorded call_count == 0, and assert mock_convert.call_count == 1 would have FAILED. (Diagnosis Summary §"Failure Signature".)
    • Post-fix-expectation: with the live comfy/sd.py:444 form metadata.get("keep_diffusers_format") != "true" on issue_101 SHA 7936e591, no KeyError is raised; the inner if evaluates True; diffusers_convert.convert_vae_state_dict(sd) is invoked exactly once before the suppressed downstream cascade; mock_convert.call_count == 1.
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective above (key-missing convert branch).
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBL9pFQ edited-at=2026-05-04T21:29:48Z
    • Probe: GTP-1, GTP-3, GTP-4, GTP-5, GTP-6, GTP-7, GTP-8, GTP-9
  • AC-2: cd /home/johnj/dev_master/ComfyUI && python3 -m pytest -q tests-unit/comfy_test/test_diffusers_metadata_guard.py::test_diffusers_guard_skips_convert_when_metadata_pins_keep_true exits 0; the test patches comfy.sd.diffusers_convert.convert_vae_state_dict with unittest.mock.patch.object(..., autospec=True), invokes the same _make_standin-bound comfy.sd.VAE.__init__ with sd = {"decoder.up_blocks.0.resnets.0.norm1.weight": torch.zeros(1)} and metadata = {"keep_diffusers_format": "true"} under contextlib.suppress(Exception), and asserts mock_convert.call_count == 0 — verified by committed artifact github_issues/119/slice1/test_AC2_key_present_true.log (on pollockjj/mydevelopment:issue_119) containing the pytest stdout line matching ^1 passed (or ^.* 1 passed.*$) for that nodeid and exit code 0.

    • Pre-fix-fingerprint: a regression that removes the inner if metadata is None or metadata.get("keep_diffusers_format") != "true": predicate at comfy/sd.py:444 and unconditionally executes sd = diffusers_convert.convert_vae_state_dict(sd) on the diffusers-format trigger branch (an "always-call" wrong correction class) would produce mock_convert.call_count == 1 for the key-present-"true" case, violating the explicit-skip contract documented at comfy/sd.py:443-446 and the issue body AC2. (Diagnosis Summary §"Failure Boundary".) Note that the originally-flagged KeyError bug shape did NOT itself break this branch — for metadata == {"keep_diffusers_format":"true"} the unsafe indexing succeeded — so AC2's diagnostic value is regression-prevention against the wrong-correction class above, locking the skip branch for the future.
    • Post-fix-expectation: with the live comfy/sd.py:443-446 two-branch guard on issue_101 SHA 7936e591, the inner predicate evaluates False (metadata is not None; metadata.get("keep_diffusers_format") returns "true"; "true" != "true" is False; None or False is False); diffusers_convert.convert_vae_state_dict(sd) is NOT invoked; mock_convert.call_count == 0.
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective above (key-present-"true" skip branch).
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBL9pFQ edited-at=2026-05-04T21:29:48Z
    • Probe: GTP-1, GTP-3, GTP-4, GTP-5, GTP-6, GTP-7, GTP-8, GTP-9
  • AC-3: cd /home/johnj/dev_master/ComfyUI && python3 -m pytest -q tests-unit/comfy_test/test_diffusers_metadata_guard.py::test_diffusers_guard_invokes_convert_when_metadata_is_none exits 0; the test invokes _exercise_guard(metadata=None) (helper definition above), which patches comfy.sd.diffusers_convert.convert_vae_state_dict and comfy.sd.model_management.is_amd via unittest.mock.patch.object(..., autospec=True), drives a _make_standin-bound comfy.sd.VAE.__init__ with sd = {"decoder.up_blocks.0.resnets.0.norm1.weight": torch.zeros(1)} and metadata = None under contextlib.suppress(_PostGuardReached), and asserts mock_convert.call_count == 1 and mock_is_amd.called — verified by committed artifact github_issues/119/slice1/test_AC3_metadata_none.log (on pollockjj/mydevelopment:issue_119) containing the pytest stdout line matching ^1 passed (or ^.* 1 passed.*$) for that nodeid and exit code 0.

    • Pre-fix-fingerprint: a regression of the shape if metadata and metadata.get("keep_diffusers_format") is None: at comfy/sd.py:444 (the canonical wrong-correction class Copilot called out in r3185061776) evaluates the left operand to None (falsy) on metadata=None input, short-circuits the conjunction to None, and SKIPS the conversion — mock_convert.call_count == 0 for the AC3 input, violating the live guard's first-disjunct contract metadata is None → convert. Real callers that omit metadata (the common case for any safetensors VAE without the explicit pin) would silently lose the diffusers-format rewrite under that regression.
    • Post-fix-expectation: with the live comfy/sd.py:444 form if metadata is None or metadata.get("keep_diffusers_format") != "true":, the first disjunct short-circuits to True on metadata=None input; diffusers_convert.convert_vae_state_dict(sd) is invoked exactly once before the patched is_amd raises _PostGuardReached to halt the constructor at the first call past the guard; mock_convert.call_count == 1, mock_is_amd.called == True.
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective above (metadata is None disjunct, additive completeness from round 8).
    • Foundations-pin: round-8 Copilot finding r3185061776 (PR [Issue 101][eval-and-fix] Guard diffusers metadata lookup (closes pollockjj/mydevelopment#119) #36); ACCEPT decision committed in github_issues/119/pr_review_round_8/copilot_decisions.json.
    • Probe: GTP-1, GTP-3, GTP-4, GTP-5, GTP-6, GTP-7, GTP-8, GTP-9
  • AC-4: cd /home/johnj/dev_master/ComfyUI && python3 -m pytest -q tests-unit/comfy_test/test_diffusers_metadata_guard.py::test_diffusers_guard_invokes_convert_when_metadata_pins_keep_false exits 0; the test invokes _exercise_guard(metadata={"keep_diffusers_format": "false"}), drives the same _make_standin-bound comfy.sd.VAE.__init__ under the same patched convert_vae_state_dict / patched is_amd / contextlib.suppress(_PostGuardReached) machinery, and asserts mock_convert.call_count == 1 and mock_is_amd.called — verified by committed artifact github_issues/119/slice1/test_AC4_keep_false.log (on pollockjj/mydevelopment:issue_119) containing the pytest stdout line matching ^1 passed (or ^.* 1 passed.*$) for that nodeid and exit code 0.

    • Pre-fix-fingerprint: the same round-8 regression shape if metadata and metadata.get("keep_diffusers_format") is None: evaluates True and ("false" is None) to True and False = False on AC4 input, SKIPS the conversion, and produces mock_convert.call_count == 0 — violating the live guard's second-disjunct contract metadata.get(key) != "true" → convert. Real callers that pass an explicit non-"true" value (e.g., a YAML config that pins keep_diffusers_format: false) would silently lose the rewrite under that regression.
    • Post-fix-expectation: with the live comfy/sd.py:444 form, the first disjunct evaluates False (metadata is not None); the second disjunct evaluates "false" != "true" = True; False or True = True; diffusers_convert.convert_vae_state_dict(sd) is invoked exactly once before the patched is_amd raises _PostGuardReached; mock_convert.call_count == 1, mock_is_amd.called == True.
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective above (key-present-non-"true" disjunct, additive completeness from round 8).
    • Foundations-pin: round-8 Copilot finding r3185061776 (PR [Issue 101][eval-and-fix] Guard diffusers metadata lookup (closes pollockjj/mydevelopment#119) #36); ACCEPT decision committed in github_issues/119/pr_review_round_8/copilot_decisions.json.
    • Probe: GTP-1, GTP-3, GTP-4, GTP-5, GTP-6, GTP-7, GTP-8, GTP-9
  • AC-5: cd /home/johnj/dev_master/ComfyUI && python3 -m pytest -q tests-unit/comfy_test/test_diffusers_metadata_guard.py::test_diffusers_guard_invokes_convert_when_metadata_is_empty_dict exits 0; the test invokes _exercise_guard(metadata={}), drives the same _make_standin-bound comfy.sd.VAE.__init__ under the same patched convert_vae_state_dict / patched is_amd / contextlib.suppress(_PostGuardReached) machinery, and asserts mock_convert.call_count == 1 and mock_is_amd.called — verified by committed artifact github_issues/119/slice1/test_AC5_metadata_empty_dict.log (on pollockjj/mydevelopment:issue_119) containing the pytest stdout line matching ^1 passed (or ^.* 1 passed.*$) for that nodeid and exit code 0.

    • Pre-fix-fingerprint: the round-26 regression shape if metadata is None or (metadata and metadata.get("keep_diffusers_format") != "true"): short-circuits the inner and on metadata={} because bool({}) is False, evaluates the entire predicate to None or False = False, SKIPS the conversion, and produces mock_convert.call_count == 0 — violating the live guard's second-disjunct contract metadata.get(key) != "true" → convert for the falsy missing-key shape that real callers produce. The empty-dict shape is reachable in production via comfy.utils.convert_old_quants (comfy/utils.py:1359-1360) which normalizes None to {} before load_state_dict_guess_config constructs the VAE at comfy/sd.py:1739 (vae = VAE(sd=vae_sd, metadata=metadata)); a caller of load_state_dict_guess_config(sd, metadata=None) flows through that normalization to VAE(sd=vae_sd, metadata={}) and would silently lose the rewrite under the round-26 regression. AC1's truthy missing-key mapping {"unrelated_key": "value"} does not pin this path because bool({"unrelated_key": "value"}) is True and the regression's and does not short-circuit on it.
    • Post-fix-expectation: with the live comfy/sd.py:444 form, the first disjunct evaluates False (metadata is not None); the second disjunct evaluates {}.get("keep_diffusers_format") = None and None != "true" = True; False or True = True; diffusers_convert.convert_vae_state_dict(sd) is invoked exactly once before the patched is_amd raises _PostGuardReached; mock_convert.call_count == 1, mock_is_amd.called == True.
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective above (falsy missing-key shape produced by convert_old_quants None{} normalization, additive completeness from round 26).
    • Foundations-pin: round-26 Copilot finding r3185375054 (PR [Issue 101][eval-and-fix] Guard diffusers metadata lookup (closes pollockjj/mydevelopment#119) #36); ACCEPT decision committed in github_issues/119/pr_review_round_26/copilot_decisions.json.
    • Probe: GTP-1, GTP-3, GTP-4, GTP-5, GTP-6, GTP-7, GTP-8, GTP-9

Constraints

  • Python: python3 (the deliverable slot's .venv/bin/python resolves via the slot's pytest invocation; never hardcode a host-specific absolute interpreter path).
  • Runner: python3 -m pytest invoked from cd /home/johnj/dev_master/ComfyUI (deliverable clone); evidence logs land on pollockjj/mydevelopment:issue_119 under github_issues/119/slice1/.
  • Isolation flags: not applicable — pytest unit tests, no GPU/process-isolation harness.
  • No packages installed into host venv.
  • No pkill, no rm -rf, no python main.py.
  • All commits on issue branch issue_119 of each repo, not on base branches (pollockjj/ComfyUI:issue_101 and pollockjj/mydevelopment:main are read-only PR targets for this packet).
  • Relevant Existing Tooling:
    • pytest (REUSE) — repo-pinned via pollockjj/ComfyUI:issue_101 tests-unit/requirements.txt; invoked via python3 -m pytest per pytest.ini (pythonpath = ., testpaths = tests tests-unit).
    • unittest.mock (REUSE) — stdlib; precedent in tests-unit/comfy_test/folder_path_test.py:6 (from unittest.mock import patch).
    • torch (REUSE) — repo-pinned via pollockjj/ComfyUI:issue_101 requirements.txt; precedent for CPU-mode test bootstrap in tests-unit/comfy_test/seedvr_model_test.py:33-37.
    • comfy.cli_args (REUSE) — in-tree; precedent for args.cpu = True test bootstrap in tests-unit/comfy_test/seedvr_model_test.py:33-37.
    • _make_standin pattern (KNOWN-GOOD-REF) — established in pollockjj/ComfyUI:issue_109 tests-unit/comfy_test/seedvr_model_test.py:48-58; this packet ports the pattern (does not import it; the precedent file does not exist on issue_101, only on issue_109).
  • Evidence Primitive Requirements:
    • Each AC requires a committed pytest stdout log on pollockjj/mydevelopment:issue_119 at github_issues/119/slice1/test_AC{1,2,3,4,5}_*.log showing 1 passed and exit code 0 for the named nodeid.
    • The evidence primitive is the pair (mock_convert.call_count integer; mock_is_amd.called boolean) asserted inside each test body; the pytest stdout log captures the assertion result by reporting passed (both assertions held) or failed (either assertion violated).
  • Repository Hygiene:
    • Every dirty repo state is resolved by the agent without stash or external decision deferral.
    • Dirty paths are classified as committed work, precise committed .gitignore rules for safe generated bulk, or discarded generated debris.
    • Clean committed work already present on the active branch is repo provenance and is integrated, not removed as dirty-state cleanup.
    • Slicers and Melian must run live git status --short gates locally and must refuse to submit while any touched repo is dirty.
    • Plans must not require repo_hygiene.txt, raw git status --short transcripts, or CLEAN markers as QA evidence.
    • QA verifies submitted commits, branch refs, and artifact presence through GitHub rather than trusting slicer-authored cleanliness transcripts.

Out of Scope

  • Any change to comfy/sd.py — production code is already correct on issue_101 SHA 7936e591 per the upstream merge; this packet is regression-only.
  • Any change to comfy/diffusers_convert.py — the conversion routine is out of scope; this packet tests the guard, not the conversion. The patched convert_vae_state_dict mock uses a passthrough lambda state_dict: state_dict side-effect specifically to avoid encoding the converter's output shape in the test (which would couple the regression to converter semantics that are not the test target).
  • Coverage of the SeedVR2 VAE branch (gated above the diffusers guard by is_seedvr2_vae at comfy/sd.py:442); all five ACs feed a state dict that lacks the SeedVR2 indicator key (decoder.up_blocks.2.upsamplers.0.upscale_conv.weight, GTP-7) so the SeedVR2 short-circuit never fires.
  • Coverage of any non-VAE call site in comfy/sd.py.
  • Note on round-8 scope expansion: the metadata is None and key-present-non-"true" cases were initially marked out of scope at plan-foundations time per the issue body's two-cell contract. Round 8 of PR review (Copilot inline r3185061776, ACCEPT) brought both cases in scope as AC3 and AC4 — see the Round 8 Scope Expansion section above. They are no longer out of scope on the round-9 deliverable.
  • Note on round-26 scope expansion: the metadata = {} empty-dict case was initially marked out of scope at plan-foundations time and remained out of scope through the round-8 four-cell contract. Round 26 of PR review (Copilot inline r3185375054, ACCEPT) brought it in scope as AC5 — see the Round 26 Scope Expansion section above. It is no longer out of scope on the round-27 deliverable.
  • Slice 0 calibration default — not applicable. The plan's I/O contract does not name a measurement instrument with a published anchor; the only measurement is a binary integer (mock.call_count) with an exact-match assertion. Per tdd-plan Phase 2 rule 12 and Phase 4 Check 25, Slice 0 calibration default applies only when the I/O contract names a measurement instrument; this packet's unittest.mock call-count assertion is not such an instrument. Documented here per the explicit-rationale-in-Out-of-Scope requirement.

Tracked in pollockjj/mydevelopment Comfy-Org#119 (bookkeeping PR pollockjj/mydevelopment#201).

pollockjj added 2 commits May 4, 2026 16:57
…get binary regression

Pin the CodeRabbit Critical fix at comfy/sd.py:443-446 with two AC-mapped
binary cells in tests-unit/comfy_test/vae_diffusers_format_guard_test.py:

- AC1 key-missing: state dict carries the diffusers-format trigger key and
  metadata is non-None but lacks 'keep_diffusers_format'. The fixed guard
  must call convert_vae_state_dict exactly once and not raise KeyError.
- AC2 key-present-"true": metadata['keep_diffusers_format'] == 'true'. The
  guard must skip conversion entirely.

Source thread: Comfy-Org#11294 r2959796358. Zero LOC of production
code change in this packet — the safe .get form is already merged from
upstream into pollockjj/ComfyUI:issue_101 (HEAD 8d5cfce).
QA gate slice 1 contract requires nodeids
test_diffusers_guard_invokes_convert_when_metadata_missing_key (AC1)
and test_diffusers_guard_skips_convert_when_metadata_pins_keep_true
(AC2) under tests-unit/comfy_test/test_diffusers_metadata_guard.py.
The previously committed cells under vae_diffusers_format_guard_test.py
exercise the same guard but use names and a shape the gate's
verification command does not target, so the contract paths returned
404 and exit code 4. This module adds the contract-shaped cells
(unittest.mock.patch.object on comfy.sd.diffusers_convert.
convert_vae_state_dict with autospec, _make_standin binding
comfy.sd.VAE.__init__, contextlib.suppress around the post-guard
fallthrough, and a binary mock_convert.call_count assertion) at the
contract's exact path; vae_diffusers_format_guard_test.py is retained
unchanged as the manifest lists both files.
Copilot AI review requested due to automatic review settings May 4, 2026 22:09
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 1

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The patch only adds regression tests for the VAE diffusers metadata guard, and I did not find any discrete, actionable issues introduced by these changes.

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds regression coverage around the comfy.sd.VAE.__init__ diffusers-format metadata guard so future changes do not reintroduce the metadata["keep_diffusers_format"] KeyError path.

Changes:

  • Adds a regression test module that verifies conversion is invoked when metadata lacks keep_diffusers_format.
  • Adds a regression test module that verifies conversion is skipped when metadata["keep_diffusers_format"] == "true".
  • Introduces a second overlapping test module covering the same guard through a different test shape.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests-unit/comfy_test/vae_diffusers_format_guard_test.py Adds guard regression tests by instantiating VAE with a synthetic diffusers-format state dict.
tests-unit/comfy_test/test_diffusers_metadata_guard.py Adds guard regression tests using a stand-in class bound to VAE.__init__ and mocked conversion calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +28
"""Regression tests for the VAE diffusers-format guard at comfy/sd.py:443-446.

Tracks pollockjj/mydevelopment#119 (parent #101). The guard previously
indexed ``metadata["keep_diffusers_format"]`` directly, which raised
``KeyError`` when ``metadata`` was non-``None`` but lacked that key —
the common case for any safetensors VAE with ordinary metadata. CodeRabbit
flagged this as Critical on Comfy-Org/ComfyUI#11294 (thread r2959796358).
The merged fix on ``pollockjj/ComfyUI:issue_101`` uses
``metadata.get("keep_diffusers_format") != "true"`` so a missing key
flows through to invoke ``convert_vae_state_dict``, while the
explicit ``"true"`` value skips the conversion.

The guard is inline in ``VAE.__init__`` rather than a separate method,
so the ``_make_standin`` precedent from #109's
``seedvr_model_test.py`` (which borrows ``NaDiT`` methods onto a small
``torch.nn.Module`` subclass) does not apply directly. Instead we drive
the guard by calling ``VAE.__init__`` with a synthetic state dict that
contains only the diffusers-format trigger key
(``decoder.up_blocks.0.resnets.0.norm1.weight``). The trigger key
satisfies the outer ``if`` of the guard but matches no other elif
branch in the post-guard model-detection chain, so ``__init__`` falls
through to the ``else: logging.warning(...); self.first_stage_model =
None; return`` path at ``comfy/sd.py:860-863``. ``convert_vae_state_dict``
is monkey-patched to a tracker rather than allowed to execute on the
synthetic dict, since the production routine assumes a real diffusers
VAE state dict.
"""

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 2

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds regression tests for the existing VAE diffusers metadata guard. I did not identify any discrete introduced issue that would break existing behavior or invalidate the test intent.

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +95
with contextlib.suppress(Exception):
StandIn(sd=sd, metadata=metadata)
Comment on lines +117 to +118
with contextlib.suppress(Exception):
StandIn(sd=sd, metadata=metadata)
import comfy.sd # noqa: E402


_DIFFUSERS_TRIGGER_KEY = "decoder.up_blocks.0.resnets.0.norm1.weight"
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 3

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds focused regression tests for the VAE diffusers metadata guard. I did not find a discrete issue in the added test logic that would break existing behavior or make the patch incorre

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 4

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds focused regression tests for the VAE diffusers metadata guard, and the assertions appear to exercise the intended branches without introducing a discrete correctness issue in the

No findings.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 5

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds targeted regression tests for the VAE diffusers metadata guard, and the assertions appear to exercise both the missing-key conversion path and the explicit keep-diffusers opt-out

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with unittest.mock.patch.object(
comfy.sd.diffusers_convert,
"convert_vae_state_dict",
autospec=True,
Comment on lines +149 to +153
) as mock_is_amd:
with contextlib.suppress(Exception):
StandIn(sd=sd, metadata=metadata)

assert mock_convert.call_count == 0
Comment on lines +116 to +121
) as mock_is_amd:
with contextlib.suppress(Exception):
StandIn(sd=sd, metadata=metadata)

assert mock_convert.call_count == 1
assert mock_is_amd.called
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 6

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds focused regression tests for the VAE diffusers metadata guard. I did not find any introduced issue that would break existing behavior or make the tests invalid in the intended env

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +135 to +139
with unittest.mock.patch.object(
comfy.sd.diffusers_convert,
"convert_vae_state_dict",
autospec=True,
side_effect=lambda state_dict: state_dict,
Comment on lines +28 to +32
* ``unittest.mock.patch.object(comfy.sd.model_management, "is_amd",
autospec=True, side_effect=_PostGuardReached(...))`` — patches
the FIRST function called after the guard at ``comfy/sd.py:448``
(``if model_management.is_amd():``). Raising a dedicated sentinel
exception from this mock halts ``__init__`` immediately past the
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 7

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds focused regression tests for the VAE diffusers metadata guard, and the harness correctly isolates the guarded branch while allowing non-sentinel failures to propagate. I did not i

No findings.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 27

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds targeted regression tests for the diffusers metadata guard, and I did not identify any discrete introduced bug in the test logic. Local execution was blocked by the environment mi

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +287 to +309
def test_diffusers_guard_invokes_convert_when_metadata_is_empty_dict():
"""AC5: state dict carries the diffusers-format trigger key and
``metadata`` is the empty dict ``{}``. The guard's second disjunct
(``metadata.get("keep_diffusers_format") != "true"``) must evaluate
to ``True`` because ``{}.get("keep_diffusers_format")`` returns
``None`` and ``None != "true"`` is ``True``, driving the conversion
branch and invoking ``convert_vae_state_dict`` exactly once. The
empty dict is a real production input: ``comfy.utils.convert_old_quants``
(``comfy/utils.py`` line 1359-1360) normalizes ``None`` to ``{}``
before ``load_state_dict_guess_config`` constructs the VAE at
``comfy/sd.py`` line 1739 (``vae = VAE(sd=vae_sd, metadata=metadata)``).
AC1 covers the truthy missing-key shape ``{"unrelated_key": "value"}``
but does not pin the falsy missing-key shape: a regression of the
shape ``if metadata is None or (metadata and metadata.get(...) != "true"):``
short-circuits the ``and`` on the empty dict and skips the
conversion, breaking the ``convert_old_quants``-normalized callers
while keeping AC1, AC2, AC3 and AC4 green (Copilot review feedback
on PR pollockjj/ComfyUI#36, comment r3185375054). The branch
witness is ``mock_convert.call_count == 1``; ``mock_is_amd.called``
is the paired post-guard reach witness; the narrow
``suppress(_PostGuardReached)`` keeps any other regression loud.
"""
mock_convert, mock_is_amd = _exercise_guard({})
``None``-normalized empty dict, or pass a non-``"true"``
``keep_diffusers_format`` value.

All four cells share an ``_exercise_guard`` helper so the
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 28

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The added regression tests exercise the intended metadata guard paths without introducing an identifiable correctness issue in the changed code.

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 29

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The added regression tests exercise the intended metadata guard branches and pass against the current implementation. I did not find a discrete issue introduced by this test-only change that would bre

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 30

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: No actionable correctness issues were found in the added regression tests.

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +43 to +46
``comfy.utils.convert_old_quants`` (``comfy/utils.py`` line 1359-1360)
normalizes ``None`` to ``{}`` before ``load_state_dict_guess_config``
constructs the VAE at ``comfy/sd.py`` line 1739
(``vae = VAE(sd=vae_sd, metadata=metadata)``). AC1 covers the truthy
Comment on lines +295 to +300
(``comfy/utils.py`` line 1359-1360) normalizes ``None`` to ``{}``
before ``load_state_dict_guess_config`` constructs the VAE at
``comfy/sd.py`` line 1739 (``vae = VAE(sd=vae_sd, metadata=metadata)``).
AC1 covers the truthy missing-key shape ``{"unrelated_key": "value"}``
but does not pin the falsy missing-key shape: a regression of the
shape ``if metadata is None or (metadata and metadata.get(...) != "true"):``
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 31

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The change only adds targeted regression tests for the VAE diffusers metadata guard. I did not identify any introduced test logic or integration issue that would break existing behavior.

No findings.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review — Cycle 32

Overall: patch is incorrect
Overall confidence: 0.0
Explanation: codex review returned unparseable output: The patch only adds focused regression tests for the VAE diffusers metadata guard. The harness appears consistent with the current constructor flow and should not break existing behavior.

No findings.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Reduces the test module from 310 LOC to 106 LOC by collapsing the
prose carried in across 31 PR-review cycles. No test logic changes:
helpers, mock wiring, halt point, and all 5 AC cells (key-missing,
keep-true, None, keep-false, empty-dict) are unchanged. Pytest:
5 passed in 2.20s on the prosoche dev slot venv.

Removed: the multi-paragraph module-docstring narrative that recapped
the slice-rework history and cited Copilot comment IDs (which rot when
threads are deleted); the per-test docstrings that re-explained the
helper contract already documented at `_exercise_guard`; and the
8-line sentinel-class docstring that justified its own existence.

Kept: a tight module docstring naming the bug, the merged fix, the 5
input shapes covered, and the precedent link to seedvr_model_test.py;
a one-sentence docstring per cell stating the input shape and the
expected branch outcome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants