windows-comfyui-converge -WhatIf reports a fully converged host as completely empty #882

Closed
opened 2026-08-20 05:02:29 +00:00 by coilyco-ops · 0 comments
Owner

Symptom

On kai-tower-3026, with every model already installed and verified, just windows-comfyui-converge -WhatIf plans the entire bundle as missing:

preflight: 547.2 GiB free, 56.42 GiB required for missing models and rollback headroom
checkpoint: seeded Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors
model: planned diffusion_models/qwen_image_fp8_e4m3fn.safetensors (20430635136 bytes)
model: planned diffusion_models/qwen_image_edit_2511_fp8mixed.safetensors (20533762817 bytes)
model: planned text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors (9384670680 bytes)
model: planned vae/qwen_image_vae.safetensors (253806246 bytes)
model: planned loras/qwen_image_union_diffsynth_lora.safetensors (943906720 bytes)
model: planned background_removal/birefnet.safetensors (444473596 bytes)
RESULT=CHANGED

The host needs zero bytes. Every file is present at its exact pinned size and its exact pinned SHA-256, checked independently outside the -WhatIf path:

MATCH  diffusion_models\qwen_image_fp8_e4m3fn.safetensors
MATCH  diffusion_models\qwen_image_edit_2511_fp8mixed.safetensors
MATCH  text_encoders\qwen_2.5_vl_7b_fp8_scaled.safetensors
MATCH  vae\qwen_image_vae.safetensors
MATCH  loras\qwen_image_union_diffsynth_lora.safetensors
MATCH  background_removal\birefnet.safetensors

Cause

Under -WhatIf, Get-FileHash inside the script produces no output, so Test-Sha256 (scripts/converge-comfyui-windows.ps1:143) compares $null against the pin and returns $false. Test-VerifiedFile then reports every asset unverified, and the whole plan follows from that.

An instrumented copy dumping the plan makes it unambiguous. The length check passes and the hash comes back empty:

PROBE verified=False exists=True len=20430635136 wantLen=20430635136 hash= wantHash=98763a12...
PROBE verified=False exists=True len=253806246   wantLen=253806246   hash= wantHash=a70580f0...

Test-Path and Get-Item ... .Length both behave correctly under -WhatIf, so the size half of the check is fine and only the digest half breaks. Isolated calls to Get-FileHash -LiteralPath ... -WhatIf from an advanced function return the hash normally under both Windows PowerShell 5.1 and pwsh 7, so this is specific to the script-level [CmdletBinding(SupportsShouldProcess)] scope on line 18, not a general PowerShell behavior.

Impact

  1. docs/comfyui-runtime.md:57 presents -WhatIf as the way to "preview the full convergence without mutation". The preview is wrong in the most misleading direction, telling an operator to expect 56 GiB of downloads that are already on disk.
  2. The preflight gate on line 291 throws Insufficient free disk against $requiredFreeBytes computed from that phantom bundle. A converged host with less than about 56 GiB free cannot preview its own state at all, even though a real run would download nothing.
  3. RESULT=CHANGED on a converged host makes the preview useless as a drift signal, which is the main thing it is for.

Fix

Make the verification path independent of $WhatIfPreference. Test-VerifiedFile and Test-Sha256 are pure reads and should never be suppressed by a preview flag. Options:

  • Compute the digest with [System.Security.Cryptography.SHA256] over a FileStream instead of Get-FileHash, which removes the cmdlet-preference coupling entirely.
  • Or call Get-FileHash ... -WhatIf:$false at the two call sites, which is smaller but leaves the trap in place for the next read helper someone adds.

The first is preferable. A read helper inside a SupportsShouldProcess script should not be able to silently return nothing.

Worth a regression test in windows-comfyui-convergence-test that runs the verification helper with $WhatIfPreference set and asserts a known-good file still verifies. That is the assertion that would have caught this.

Notes

Real state on kai-tower-3026 is fully converged: portable release 0.29.0 matches the pin, all six models plus the preserved Juggernaut XL checkpoint verify, and Tailscale Serve forwards tailnet 8188 to the loopback listener. Only the preview is broken.

## Symptom On `kai-tower-3026`, with every model already installed and verified, `just windows-comfyui-converge -WhatIf` plans the entire bundle as missing: ``` preflight: 547.2 GiB free, 56.42 GiB required for missing models and rollback headroom checkpoint: seeded Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors model: planned diffusion_models/qwen_image_fp8_e4m3fn.safetensors (20430635136 bytes) model: planned diffusion_models/qwen_image_edit_2511_fp8mixed.safetensors (20533762817 bytes) model: planned text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors (9384670680 bytes) model: planned vae/qwen_image_vae.safetensors (253806246 bytes) model: planned loras/qwen_image_union_diffsynth_lora.safetensors (943906720 bytes) model: planned background_removal/birefnet.safetensors (444473596 bytes) RESULT=CHANGED ``` The host needs zero bytes. Every file is present at its exact pinned size and its exact pinned SHA-256, checked independently outside the `-WhatIf` path: ``` MATCH diffusion_models\qwen_image_fp8_e4m3fn.safetensors MATCH diffusion_models\qwen_image_edit_2511_fp8mixed.safetensors MATCH text_encoders\qwen_2.5_vl_7b_fp8_scaled.safetensors MATCH vae\qwen_image_vae.safetensors MATCH loras\qwen_image_union_diffsynth_lora.safetensors MATCH background_removal\birefnet.safetensors ``` ## Cause Under `-WhatIf`, `Get-FileHash` inside the script produces no output, so `Test-Sha256` ([`scripts/converge-comfyui-windows.ps1:143`](https://forgejo.coilysiren.me/coilyco-flight-deck/infrastructure/src/branch/main/scripts/converge-comfyui-windows.ps1#L143)) compares `$null` against the pin and returns `$false`. `Test-VerifiedFile` then reports every asset unverified, and the whole plan follows from that. An instrumented copy dumping the plan makes it unambiguous. The length check passes and the hash comes back empty: ``` PROBE verified=False exists=True len=20430635136 wantLen=20430635136 hash= wantHash=98763a12... PROBE verified=False exists=True len=253806246 wantLen=253806246 hash= wantHash=a70580f0... ``` `Test-Path` and `Get-Item ... .Length` both behave correctly under `-WhatIf`, so the size half of the check is fine and only the digest half breaks. Isolated calls to `Get-FileHash -LiteralPath ... -WhatIf` from an advanced function return the hash normally under both Windows PowerShell 5.1 and pwsh 7, so this is specific to the script-level `[CmdletBinding(SupportsShouldProcess)]` scope on line 18, not a general PowerShell behavior. ## Impact 1. [`docs/comfyui-runtime.md:57`](https://forgejo.coilysiren.me/coilyco-flight-deck/infrastructure/src/branch/main/docs/comfyui-runtime.md#L57) presents `-WhatIf` as the way to "preview the full convergence without mutation". The preview is wrong in the most misleading direction, telling an operator to expect 56 GiB of downloads that are already on disk. 2. The preflight gate on line 291 throws `Insufficient free disk` against `$requiredFreeBytes` computed from that phantom bundle. A converged host with less than about 56 GiB free cannot preview its own state at all, even though a real run would download nothing. 3. `RESULT=CHANGED` on a converged host makes the preview useless as a drift signal, which is the main thing it is for. ## Fix Make the verification path independent of `$WhatIfPreference`. `Test-VerifiedFile` and `Test-Sha256` are pure reads and should never be suppressed by a preview flag. Options: * Compute the digest with `[System.Security.Cryptography.SHA256]` over a `FileStream` instead of `Get-FileHash`, which removes the cmdlet-preference coupling entirely. * Or call `Get-FileHash ... -WhatIf:$false` at the two call sites, which is smaller but leaves the trap in place for the next read helper someone adds. The first is preferable. A read helper inside a `SupportsShouldProcess` script should not be able to silently return nothing. Worth a regression test in `windows-comfyui-convergence-test` that runs the verification helper with `$WhatIfPreference` set and asserts a known-good file still verifies. That is the assertion that would have caught this. ## Notes Real state on `kai-tower-3026` is fully converged: portable release `0.29.0` matches the pin, all six models plus the preserved Juggernaut XL checkpoint verify, and Tailscale Serve forwards tailnet 8188 to the loopback listener. Only the preview is broken.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/infrastructure#882
No description provided.