Skip to content

Clarify image weight formats and add loading regressions - #1237

Merged
leehack merged 5 commits into
mainfrom
docs/image-format-support
Oct 20, 2026
Merged

leehack merged 5 commits into
mainfrom
docs/image-format-support

Conversation

@leehack

@leehack leehack commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Clarify the existing public image-loading contract: GGUF/Safetensors load directly, PyTorch state-dict files require explicit roles, and container recognition does not establish model/device compatibility. Add 19 file-to-native regression cases and optional real same-weight CPU container comparisons.

Refs #1218, which stays open for remaining full-checkpoint qualification. Updated against main 33915ed38 after the 0.15.4 cut; image-format notes stay under new Unreleased sections, and the README links to next-release docs. Executable library code, runtime pins, bindings, versions and dependency constraints are unchanged.

Production-readiness scope

  • User-facing scope: Align README, guide/support matrix, Dartdoc, image skill, example instructions and Unreleased changelogs. Explain container/role/layout boundaries, dtype limits, eager loading and unsupported directory/managed-shard ingestion.
  • Supported platforms/paths: Recording-runtime tests cover real file resolution, header classification and all eight worker/native path fields, including Windows path normalization. Real qualification is limited to SD Turbo + full TAESD on macOS arm64 CPU.
  • Unsupported or intentionally unavailable paths: No added model, GPU/mobile/browser, conversion, mmap or quantization support. Full PyTorch checkpoints remain unqualified; small component success does not remove the documented native limits.
  • Out of scope / follow-ups: Native #23: confirmed legacy scanner overflow above 2 GiB. Native #24: unresolved large ZIP load timeouts. Directory/shard loading remains Support bounded Diffusers directories and Safetensors shard sets #1219; upstream/ABI/FP8 qualification remains native #20.

Completeness checklist

  • Declared documentation/regression scope is complete; no runtime implementation changes.
  • Unsupported paths and qualification limits are documented; public docs, examples, support matrix and changelogs agree.
  • Positive/negative coverage includes renamed/extensionless files, mixed roles, native refusal/recovery, malformed/unknown headers, decoder-only TAESD, LoRA headers, index auto-detection and directory rejection. Existing version/platform diagnostics pass.
  • Validation registry change is N/A: no public capability change; optional comparisons use the existing image-generation-smoke lane.
  • Security/privacy checked: no credentials, signed URLs or private model paths added; error path redaction is covered.
  • Non-blocking native follow-ups are filed and linked above.

Test Plan

Flutter 3.47.1 / Dart 3.13.1. New head: a39571c2414b6344db50a37e0a33e0fbe8d123a7; base: 33915ed38559bbfd78660cc18e190a21fb3a0210. Fresh exact-head CI passed; earlier-head results are superseded.

  • Clean workspace preparation, repository format, analysis, release-doc versions and platform-boundary checks on the updated head.
  • ./tool/docs/build_site.sh --port 43837: 2558 routes, internal links/finalization and search index passed. The README's /docs/next/...#weight-formats-and-layouts target exists.
  • Released changelog sections match current main byte-for-byte; no runtime/dependency/version pin or released snapshot changes in the PR diff.
  • Both maintained real CPU format tests rerun on this head: full GGUF/Safetensors/local-index checkpoints, and Safetensors/ZIP .pt/nested ZIP .ckpt/legacy .pth TAESD variants passed.
  • Full VM coverage, Chrome, macOS/Windows and tooling regression suites passed in fresh CI on this head.

Repeat real comparisons from example/basic_app using LLAMADART_SD_TURBO_MODEL, LLAMADART_TAESD, and comma-separated same-weight variants in LLAMADART_IMAGE_CHECKPOINT_FORMATS / LLAMADART_TAESD_FORMATS. No model download or Python checkpoint execution is introduced.

dart test --configuration test/image_generation_smoke.yaml -t local-only \
  test/image_generation_e2e_test.dart --name 'containers preserve CPU pixels'

Matrix Evidence

Matrix row Platform / model / backend Result and limits
Affected VM suites Synthetic headers / recording native runtime PASS in fresh CI; 19 new cases establish transport/mapping, not inference compatibility
Full VM/native and Chrome suites Linux coverage, macOS, Windows, Chrome PASS in fresh exact-head CI; no new Web image support claimed
image-generation-smoke (selected format cases) macOS arm64 / SD Turbo + full TAESD / CPU, four threads PASS; 128×128, one step, guidance 1, seed 42; other smoke scenarios not claimed
Direct-native controls Same published owner dylib Same successes and bounded failures as Dart; not an independent newer upstream build
GPU/mobile/other families and multi-shard sets Not run N/A; no qualification claimed
Artifact identities and original native-control qualification findings
  • stable-diffusion-native v0.2.0-4, bundled upstream 3f8527a46c54ecf4cb4ed6003da8e8982283c73c.
  • Owner runtime archive SHA-256 840df6e27e1cac6d378dd5529f7c3b8d3b176417f950ef523c3535c09c92f528; dylib 79ed1ab7c0451596bcb18070d459826a8b04409875873e91f39ffd84b2ffe1ce.
  • Full SD-Turbo F16 GGUF SHA-256 748f890c075c5d36df93a5ca47e382c7242cd10c2d1084861727f64fb4336540; equivalent Safetensors 4505ca3da482f3e01679f6301bf23cde136e0cb3ffeb66b7e809038f619a19b4 (1323 F16/F32 tensors). Both and a local index referencing that one weight file produce RGB SHA-256 97a26ebc59a0f94f4f137a601ca9bb3c79efe698a349d84bca25187a90c41c51, identical through Dart/native controls.
  • TAESD source SHA-256 db169d69145ec4ff064e49d99c95fa05d3eb04ee453de35824a6d0f325513549; trusted PyTorch 2.11.0 torch.save, protocol 2, generates all three component variants. With the Q4_0 SD-Turbo baseline (cf4372dbc8ae779c66cfdbb3ac2e413bce8eb4d694cc3e34c61b399930dc4a02), output SHA-256 is fa9ff99b77cffc5fdee4078416411415fa906a323a1e239717099533d1a029cc across decoder containers and Dart/native controls.
  • Full 2.6 GB PyTorch ZIP .pt and nested .ckpt: each Dart/native subprocess exceeded 45 seconds. Cause unresolved; not proof of an infinite hang. Full legacy .pth: native and Dart reject; model-free pinned-source control confirms signed span narrowing above 2 GiB. Input hashes and reproduction details are in the two owner issues.
  • PyTorch component success does not qualify full checkpoints. An explicit local one-file index success does not qualify managed or multi-shard ingestion.

Review Notes

  • Changelog and current-main compatibility checks passed. Scope/regression review found no blocking issues and no unresolved review threads. Independent high-risk audit is N/A for this standard-risk change; merge authorized by the maintainer.

  • CI: 28 successful checks, 5 intentionally skipped, no failures or pending checks on the head above. All workflows passed: CI, validation bundles, readiness advisory, and preview selection.

  • Post-merge QA: Main CI passed on a1b21dd09bb128bcd1104d96982b5bf02d15aecf (19 successful jobs, 3 intentionally skipped), including automatic chat-app deployment. The merged tree equals the verified PR head; released changelog sections, executable library code and runtime pins are unchanged. Docs Pages follows the normal release-cut workflow.

High-risk regression review

  • Classification: standard (classify_high_risk_changes.dart); executable library code and all runtime pins unchanged.
  • Implementation task: this bounded docs/regression PR.
  • Independent blocking QA task: N/A for standard classification; scope/regression review and exact-head CI are complete.
  • Exact head / current base: a39571c24 / 33915ed38.
  • Production-branch deletion, bypass, or miswire proof: N/A; production code is unchanged, and the PR is standard risk. Format mapping tests run in fresh CI.
  • Affected-family real-model/artifact evidence: SD Turbo + TAESD, macOS arm64 CPU, exact pinned artifact as recorded above.
  • Explicit unavailable-family or other N/A evidence: other architectures/dtypes/platforms, GPU and multi-shard layouts not qualified.
  • Known PR-caused P1 regressions: 0 known; no runtime implementation changes.
  • Unresolved review threads: 0, verified before merge.

@leehack
leehack marked this pull request as ready for review October 20, 2026 01:54
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Chat app preview removed for leehack/llamadart-chat-pr-1237.

@leehack
leehack merged commit a1b21dd into main Oct 20, 2026
36 checks passed
@leehack
leehack deleted the docs/image-format-support branch October 20, 2026 01:57
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.

1 participant