Release V3.5.2 stabilization and optimization

This commit is contained in:
ukr8b3g-cmyk
2026-08-26 02:34:26 +09:00
parent b8ab766eb3
commit 70cbbcd5fb
32 changed files with 2606 additions and 86 deletions
+67 -2
View File
@@ -10,7 +10,72 @@
- E2-8A Contract, E2-8B1 CPU/static validation, E2-8B2 external LBH GPU PoC, and E2-8C Second Pass GPU acceptance are formally PASS. The E2-8C CPU baseline is `260 passed`.
- External LATENT nodes may discard custom dictionary metadata. Identically shaped group reordering therefore cannot be cryptographically detected; count, position, T, geometry, and audio-shape checks are enforced.
Updated: 2026-08-25
Updated: 2026-08-26
## V3.5.2 final release gate (2026-08-26)
- V3.5.2 is the release-candidate baseline for the Stabilization & Optimization Update. It adds no generation mode and preserves all V3.5.x workflow contracts plus V3.4 Node IDs/backend socket keys.
- Phase 3-1 Prompt/CLIP cross-run cache and Phase 4-6A Video Guide memory optimization are the only adopted Production optimizations. Sampling, Conditioning payloads, Terminal Merge, Assembly, Seam, Run Storage, and standard ComfyUI Seed behavior remain unchanged.
- Final pre-release T2VA API smoke at 576x576 / 1x5 seconds / 20 steps confirmed MISS `encode_calls=1` and HIT `encode_calls=0`; Prompt/CLIP time changed from `8.454306s` to `0.000038s`. Both runs used derived Sampling seed `5684542245315818407` and produced identical decoded video MD5 `40e378d7c80e6bebd9d64b322c13e677` and audio PCM MD5 `4fb0a699227c4f834f7a52ba4d395ae8`.
- The accepted Video Guide GPU A/B remains the Phase 4-4 result: full source SHA-256, identity, 124-frame prefix, VAE/Qwen inputs, Sampling seed, decoded video MD5, and audio PCM MD5 all match exactly between old and optimized preprocessing.
- Final post-sync gate is PASS: `485 passed`, compileall exit `0`, V3.5.2 runtime verifier PASS, all 172 Manifest hashes valid, `git diff --check` exit `0`, required node registration complete, and the API queue empty. ComfyUI_W restarted with `H3 Continuum 3.5.2 loaded`; source, ComfyUI_W, and ComfyUI_WAN hashes match for `version.py`, `metadata.ini`, and the accepted `reference_video.py`.
- Public result image is `docs/images/v352-stabilization-optimization.png`, copied bit-exact from the user-supplied `D:\SD_PIC\Neo\Clip_91.png` (SHA-256 `0c1dfd5acff349b98ecdfb57ae50941f6da26a462dfd2aaa9b7c7b0a34abf304`). README text is the canonical environment description where the supplied image contains a different ComfyUI minor-version label.
- Exact release-preparation snapshot: `pre-v352-release-preparation-exact-20260826_022016`, revision `b8ab766eb364063f8af88781e7be70ee7286fba0`, 198 source files plus the four active runtime metadata files.
## V3.5.1 stabilization Phase 4-6A Video Guide memory optimization (2026-08-26)
- Phase 4 Feature Tax & Redundancy Audit is PASS. No evidence-backed Production speed optimization was selected. Driving Audio generated-audio Decode/Assembly and same-rate Audio hashing remain documented `SIMPLIFY` candidates below the 1% adoption threshold; Sampling, Session/State validation, Refine Context, Run Storage, Assembly Plan validation, and V3.4 remain unchanged.
- Phase 4-6A is formally PASS, including Phase 4-4 GPU acceptance. `reference_video.py` now normalizes, finite-checks, and hashes the complete Video Guide in eight-frame CPU float32 RGB chunks while retaining only the prefix used by the one-chunk H3 conditioning contract. Full source shape/dtype/raw-byte order and SHA-256 remain exact, so unused-tail changes and non-finite values still affect identity/validation.
- The primary ComfyUI_W runtime contained a pre-existing uncommitted Video Guide preprocess v3 that was newer than the repository v2. With explicit approval, its H3 `17k+5` frame alignment and final-frame padding behavior was integrated into the authoritative source before applying the memory optimization. The active v3 contract, source SHA-256, combined hash, frame count, and Run Storage identity are preserved by dedicated regressions.
- Deterministic 300x256x256 RGB / 124-frame-prefix comparison against the pre-change ComfyUI_W v3 produced the same `source_sha256` and complete contract. Preprocessing peak RSS above the already allocated input fell from `396.758 MiB` to `114.695 MiB`; retained Video Guide storage fell from `225.0 MiB` / 300 frames to `93.0 MiB` / 124 frames. Host time was `0.246672s` versus `0.257602s`, so this is accepted as a memory optimization rather than a speed claim.
- Dedicated Video Guide plus existing Driving Audio regressions are `17 passed`; canonical full pytest is `485 passed`. Source runtime verification, 171 Manifest hashes, syntax, and `git diff --check` pass. Only the known `pynvml` and inaccessible repository pytest-cache warnings remain.
- Phase 4-4 compared the pre-change v3 implementation and the optimized implementation through the normal ComfyUI API with the same 15-second / 360-frame 800x800 Video Guide, V3.5 one-chunk 5-second workflow, 576x576 output, 20 steps, seed input `46001`, and Hi-Res Fix disabled. Both resolved the guide to 640x640 / 124 frames, used one physical group and the same derived Sampling seed `3288707263902886519`, and assembled 124->120 frames at 24 fps / 5.000 seconds with 32 kHz stereo audio.
- The actual VHS-loaded source SHA-256 is `ea03aa0cb216213b3a7320f7fa262f226e8e9075d31f69bdb184eec7ea189f5d`; old/new combined identity, 124-frame prefix, 640x640 VAE input, and Qwen input are byte-identical. Decoded video MD5 is `53cd381aff184c2f8aa5910ab62be342` and decoded audio PCM MD5 is `3653c0ec89947a928075d4ba056ff624` on both paths. Representative frames show no gross artifact or collapse. Runtime was restored to the optimized file and its SHA-256 matches source (`a0266ab4434b8e9844219d2b6dd8a168d198dd8f142775be01a39b81dc196b91`).
- Accepted pre-change snapshot is `pre-phase4-6a-video-guide-memory-exact-20260826_012227` (6 exact source/runtime files, revision `b8ab766eb364063f8af88781e7be70ee7286fba0`). The standard full snapshot attempt stopped only on the known ACL-inaccessible `.pytest_cache`.
## V3.5.1 stabilization Phase 3-2 synchronized GPU rebaseline (2026-08-26)
- Phase 3-2 is formally PASS and is measurement-only. No Production node, schema, Sampling/Conditioning payload, Terminal Merge, Assembly, Seam, Run Storage, or V3.4 behavior changed. Diagnostics run from repository tools against the normal ComfyUI API and are not installed into `custom_nodes`.
- After one excluded warm-up and with the Phase 3-1 Prompt/CLIP cache already hot (`encode_calls=0`), the three-run API medians are `168.069s` for 1x5 T2VA at 576x576 and `379.765s` for 3x5 FL2VA Long Terminal Merge at 640x640. Synchronized in-process medians are respectively `166.986s` / `378.107s`, with Sampling `120.516s` / `295.216s`, Video VAE Decode `19.154s` / `51.634s`, Audio VAE Decode `0.466s` / `1.040s`, Assemble + Seam `0.130s` / `0.619s`, and MP4 save `2.583s` / `7.248s`.
- True whole-workflow PyTorch CUDA allocator peaks are `1.456 GiB` T2VA and `4.129 GiB` FL2VA. They are allocator observations, not total device VRAM usage and do not include every model-weight, ComfyUI staging, driver, or external allocation. Separate per-node peak runs confirm Sampling as the CUDA maximum; Video VAE Decode peaks are `0.290 GiB` / `0.319 GiB`. Whole-workflow Windows RSS/private peaks are about `29.15/45.53 GiB` T2VA and `30.82/46.18 GiB` FL2VA. These process peaks include Core/model staging and mapped/output pages and are attribution data, not Continuum-retained memory claims.
- T2VA external-attention API medians are: Sage `168.069s`; Sage + Sol-Attn `162.090s` (`-3.56%`); Sage + Spectrum `124.830s` (`-25.73%`); Sage + Sol-Attn + Spectrum `121.147s` (`-27.92%`). Sol's sparse Triton kernel was verified active with zero fallback after moving its writable cache to the test evidence root. Spectrum emitted its Continuum API acceptance marker. These routes may change floating-point results and are not bit-exact Continuum A/B claims.
- The fastest combined route also passed one measured FL2VA Long Terminal Merge run at `288.548s` API (`-24.02%` versus the Sage median): 3 logical / 2 physical groups (`[1]`, `[2,3]`), terminal seed/trim contract intact, 640x640, 360 frames, 24 fps, 15.000s, and audio present. All measured T2VA routes produced 576x576, 120 frames, 24 fps, 5.000s, and audio. Representative contact-sheet review found no gross line/plate artifact or collapse; this does not turn the external plugins into Continuum-owned quality guarantees.
- The new rebaseline leaves no evidence-backed Continuum Production optimization candidate for Phase 3-3. Sampling is dominant but contract-sensitive; Video/Audio VAE Decode and MP4 encoding are external Core/downstream work; Assemble + Seam is below the 1% adoption threshold. Phase 3-1 remains frozen rather than broadening its cache scope.
- Reusable diagnostics are `tools/p32_profile_server.py`, `tools/p32_api_runner.py`, and `tools/p32_gpu_profile_probe.py`. Accepted evidence is under `D:\Codex\_test_results\ComfyUI-H3-Continuum\stabilization-phase3-2-20260825`. The accepted pre-change snapshot is `pre-stabilization-phase3-2-profile-accepted-20260825_220920` (479 files, revision `b8ab766eb364063f8af88781e7be70ee7286fba0`).
- Phase 3-2 focused validation is `13 passed`; canonical full pytest is `480 passed`. Diagnostic-file `py_compile`, all 170 Manifest hashes, source runtime verification, and `git diff --check` pass. Only the known `pynvml` FutureWarning remains.
## V3.5.1 stabilization Phase 3-1 Prompt/CLIP cross-run cache (2026-08-25)
- V3.5 now enables one private, bounded Prompt/CLIP conditioning cache. V3.4 public schema and execution remain unchanged. The cache belongs to the exact CLIP object, holds at most 16 LRU entries, and keys prompt text, exact resized First/Last image fingerprints, Last Frame presence, CLIP patch UUID, and CLIP layer.
- Reference Image, Reference Audio, Video Reference, Timeline Video, CLIP schedules, tokenizer options, and hook-modified CLIP states conservatively bypass the cache. Any cache error falls back to a normal encode and does not stop generation. Cached tensor payloads may be shared, but mutable metadata containers are copied for every consumer. CUDA-resident conditioning is never stored.
- Detailed Report records `hits`, `misses`, `bypasses`, and the actual Prompt/CLIP `encode_calls`. CPU regressions cover bit-exact payloads, mutable metadata isolation, every key invalidation, special-state bypass, CUDA-output rejection, fail-soft behavior, and 17th-entry LRU eviction.
- GPU/API 1x5 T2VA at 576x576 passed. MISS was `encode_calls=1`, Prompt/CLIP `5.898398s`; HIT was `encode_calls=0`, Prompt/CLIP `0.000028s`. Both same-seed outputs contain the same 120 decoded frame MD5 sequence and identical decoded audio PCM MD5. A separate base-seed-only change also remained a HIT with `encode_calls=0`, produced a different derived Sampling seed, and completed at 120 frames / 5.000s.
- GPU/API 3x5 FL2VA Long Terminal Merge at 640x640 passed with 3 logical / 2 physical groups (`[1]`, `[2,3]`). MISS was `encode_calls=4`, Prompt/CLIP `21.642687s`; HIT was `encode_calls=0`, Prompt/CLIP `0.007128s`. Both same-seed outputs contain the same 360 decoded frame MD5 sequence, identical decoded audio PCM MD5, and 15.000s duration. A separate base-seed-only change also retained four HITs / zero encode calls and the same physical grouping with newly derived physical seeds.
- No retained CUDA regression was observed: HIT completion CUDA allocated was lower than the adjacent MISS in both cases, and retained Refine Context GPU / observed GPU storage remained zero. The warm FL2VA HIT completed with about 21.3 MiB higher RSS than the adjacent MISS, consistent with the intentionally retained four-entry CPU conditioning cache and bounded by the 16-entry LRU.
- Focused CPU/static validation is `25 passed`; canonical full pytest is `467 passed`. Syntax, source/runtime verifier, source/runtime SHA-256 equality for the five changed Production files, and `git diff --check` pass. Accepted evidence is under `D:\Codex\_test_results\ComfyUI-H3-Continuum\stabilization-phase3-1-20260825`.
## V3.5.1 stabilization Phase 2-2 Conditioning attribution (2026-08-25)
- Extended the existing V3.5 Detailed Report timing only; no node, socket, UI, Sampling, Conditioning payload, Terminal Merge, Assembly, Seam, or Run Storage contract changed. Basic/Off reports and every V3.4 path remain unchanged.
- Conditioning is now split into First/Last image VAE, Reference Image VAE, Reference Audio VAE, Driving Audio VAE, Video Reference VAE, Timeline Video VAE, and Prompt/CLIP. Unconnected paths report `n/a`, and counts distinguish an absent path from a measured near-zero path. Timing remains `time.perf_counter()` only with no CUDA synchronization or allocator mutation.
- CPU/static validation is `29 passed` focused and `453 passed` full. The first full run was blocked only by the existing Windows ACL on pytest's default temp root; the clean rerun with an explicit writable `--basetemp` passed. The remaining warnings are the known `pynvml` deprecation and inaccessible repository `.pytest_cache` cache-write warning.
- Accepted GPU/API 1x5 T2VA at 576x576 took 158.701s API / 135.970s Sampler host wall. Conditioning was 6.004392s, of which Prompt/CLIP was 6.004374s; identity video VAE was 0.000006s. A preceding warm-up independently measured 6.283131s Conditioning / 6.283109s Prompt/CLIP. A cached 3.398s replay is explicitly excluded.
- Accepted 3x5 FL2VA Long Terminal Merge at 640x640 took 410.727s API / 346.197s Sampler host wall and preserved 3 logical / 2 physical groups (`[1]`, `[2,3]`), 360 frames, 15.000s, and Exact Duration `362 -> 360`. Conditioning was 23.644903s: Prompt/CLIP 22.873708s (96.7%) and First/Last image VAE 0.771176s (3.3%). Sampling remained dominant at 322.335226s.
- No optimization is adopted. The measured Continuum bookkeeping remains negligible, and Prompt/CLIP time is required Core model encoding across the distinct physical prompts, including the Terminal Merge prompt. Reference-specific paths are instrumented but were not connected in these accepted runs, so their GPU cost remains unmeasured rather than assumed.
- Accepted evidence is under `D:\Codex\_test_results\ComfyUI-H3-Continuum\stabilization-phase2-2-20260825`.
## V3.5.1 stabilization Phase 2-1 performance attribution (2026-08-25)
- Added measurement-only host timing to the existing V3.5 Detailed Report path. V3.4, Basic/Off reports, node schemas, UI, Sampling inputs/outputs, Terminal Merge, Assembly, Seam, and Run Storage contracts are unchanged.
- The report records total Preparation with Conditioning as an identified subset; each physical group's preparation, Sampling, CPU commit/finite validation, and Refine Context capture; plus Finalization and total host wall time. Terminal Merge is reported in physical order, so a 3-logical FL2VA run remains two measured groups: `[1]` and `[2,3]`.
- Timing uses `time.perf_counter()` only. It does not call `torch.cuda.synchronize()`, reset allocator peaks, clear caches, or change the normal asynchronous execution contract. Sampling values are host-observed elapsed time, not CUDA-event kernel timing.
- Core Video/Audio VAE Decode remains external and is not attributed to the Sampler. V3.5 Assembly continues to report its existing workflow elapsed time separately.
- CPU/static validation is `27 passed` focused and `451 passed` full with only the known `pynvml` FutureWarning. Runtime verification and source/runtime hashes pass.
- GPU/API measurement is PASS on the RTX 5060 Ti 16 GB system. Warm 1x5 T2VA at 576x576 took 143.888s API wall time; Sampler host wall was 134.736s, including 128.737s Sampling (95.5%), 5.963s Conditioning (4.4%), 0.013s CPU commit/finite validation, and 0.001s Refine Context capture. Output is 576x576, 120 frames, 5.000s, 32 kHz.
- The 3x5 FL2VA Long Terminal Merge run took 396.477s API wall time and retained 3 logical / 2 physical groups (`[1]`, `[2,3]`). Sampler host wall was 348.047s: 323.835s Sampling (93.0%), 24.003s Conditioning (6.9%), 0.050s CPU commit/finite validation, and 0.010s Refine Context capture. Output is 640x640, 360 frames, 15.000s, 32 kHz.
- The 1x5 Hi-Res Fix 1.2x run took 330.005s and produced 704x704, 120 frames, 5.000s, 32 kHz. Against the warm non-Hi-Res baseline, the integrated Resize/Second Pass/Decode path added about 186.1s, 0.49 GiB peak Working Set, and 1.34 GiB peak Private Bytes. Global observed VRAM usage was about 15.4-15.6 GiB in all three runs and is not a per-node allocator measurement.
- No optimization has been selected or implemented. Sampling dominates and the measured CPU commit, finite validation, Refine Context, and group preparation paths are rejected as optimization targets. Conditioning exceeds the 1% investigation threshold but must be split into CLIP/VAE/reference subphases before any change is justified.
- Accepted evidence is under `D:\Codex\_test_results\ComfyUI-H3-Continuum\stabilization-phase2-20260825`. The first 1x5 attempt reached an older already-running ComfyUI process and is retained only as excluded diagnostic evidence; all accepted runs used the restarted updated listener.
## V3.5.1 stabilization Phase 0 CI portability candidate (2026-08-25)
@@ -66,7 +131,7 @@ Updated: 2026-08-25
## Baseline
- Current public baseline: V3.5.1
- Release-candidate baseline: V3.5.2 (published baseline remains V3.5.1 until commit/push)
- Authoritative working repository: `D:\Codex\_git_push_work\ComfyUI-H3-Continuum`
- Primary tested runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum`
- Secondary runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_WAN\custom_nodes\ComfyUI-H3-Continuum`