Skip to content

Adopt stable-diffusion-native v0.3.0-6 for Apple memory release (#2004) - #2018

Merged
leehack merged 7 commits into
mainfrom
lane-2004-sd-v0305
Nov 15, 2026
Merged

leehack merged 7 commits into
mainfrom
lane-2004-sd-v0305

Conversation

@leehack

@leehack leehack commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adopt published stable-diffusion-native v0.3.0-6, owner 0ec6c1fa1e60d5124413b6c14b8fe510f112567d (owner #46). It adds Apple model-loader scratch release to v5's ggml host-buffer fix for #2004.
  • Sync all 12 hook bundle pins, SwiftPM XCFramework checksum, manifest fixture and current docs. Public headers are byte-identical to v5; bindings and graph-split capability floors stay unchanged.
  • Preserve checksum-proven v3/v4 Apple companion admission with upgrade warnings. Both lack the new release fixes; v3 also lacks graph splitting.

Production-readiness scope

  • User-facing scope: opt-in image runtime adoption; v6 full-VAE device qualification passed at tested source 6b191b28; integration-head CI passed and a fresh independent audit accepted 28a2a299 against actual main 501a0772.
  • Supported platforms/paths: 12 native hook bundles and Apple companion SwiftPM binary.
  • Unsupported or intentionally unavailable paths: existing platform restrictions remain; unlisted tags and altered companion checksums are rejected.
  • Out of scope / follow-ups: maintainer approved and merged the audited head; release prep remains separate under #2011. Core and companion publication remain separate.

Completeness checklist

  • Implementation and bounded device qualification complete; final CI, independent audit and device-evidence applicability accepted.
  • Unsupported/version-skew paths retain rejection coverage.
  • README, website, example, skill, companion docs and changelogs updated.
  • Manifest/pin and companion checksum regression coverage retained.
  • Validation registry N/A: capability unchanged; graph-split floor remains v4.
  • No credentials or signed URLs added.
  • Follow-ups tracked above.

PR type guidance

  • Bugfix PR: owner-side Apple scratch allocation repair; consumer coverage checks artifacts and admission. Real-device qualification passed; results and limitations are recorded below.
  • Feature PR / Docs-only PR: N/A, runtime repin.

Test Plan

  • Clean preparation using Flutter 3.47.1 / Dart 3.13.1.
  • Root format and analyze.
  • Integration-head native VM CI shards passed at 28a2a299; targeted integration suites passed locally.
  • Integration-head selected Chrome CI shards passed at 28a2a299.
  • coverage-lib: N/A, lib changes are pin constants/maps only.
  • Platform boundaries, native release digests and release docs consistency.
  • Four Python native sync/header suites.
  • macOS local-only runtime-hook probe and SwiftPM resolve.
  • Docs site build.
  • V6 full-VAE qualification: four loads/disposals and eight successful decodes per device, no failures, tested source 6b191b28.
  • Documentation follow-up: 149 targeted Markdown/tooling tests passed; skill 499 lines; diff whitespace checks passed. Docs site build passed. No unchanged full test or device repeat.

Matrix Evidence

Matrix row Scope covered Platform / model / backend Result Evidence / notes
native-sync-python-suites pin/header/sync policy macOS Python PASS 167 + 14 + 23 + 5 tests
native-hook-bundles hook, checksum and companion admission macOS VM PASS affected VM suites: 3012 passed, 11 skipped; final package-skills 35/35 and hook 57/57 passed; v3/v4 published checksums verified
release-doc-version-consistency core/companion release metadata Dart 3.13.1 PASS release-prep mode intentionally fails pending version/floor changes
runtime-hook probe published v6 consumer bundling macOS arm64 PASS 3 tests, no model execution
SwiftPM resolve published v6 XCFramework macOS PASS checksum verified
image-generation-smoke / image-exit-teardown standalone matrix rows native N/A not separately rerun; bounded iOS full-VAE load/decode/disposal evidence below; no claim of exit-teardown qualification
iOS full-VAE soak v6 disposal and generation iPhone 16 Pro iOS 18.3.2 / iPhone 17 Pro iOS 26.5.1, MTL0 PASS session session-5511bf15-6626-4b14-b920-70836728c503, tested source 6b191b28, 4 loads/disposals + 8 decodes each, no failures

Review Notes

  • Fresh independent Sol high delta audit accepted head 28a2a299 against live main 501a0772: no blockers, zero known PR-caused P1s and zero unresolved threads. CI: 37 SUCCESS, 9 SKIPPED. Maintainer approved ready-for-review and merge; merged as bde98bc9.
  • Mutation controls: 26 killed; one nonblocking warning-content assertion gap is tracked with the existing companion-warning item in #2009. Current warning text is correct.
  • Corrected prior documentation P3s: disclosed v5 iOS 18 post-dispose delta (~370 MB versus ~150 MB on v3/v4), removed the claim that iPhone 16 Pro qualified an iOS 26 fix, and expanded v3/v4 upgrade warnings to name missing release fixes.
  • Historical v4/v5 harness calls profile.buildModel(modelPath: modelFile) without taesdPath: both A/B and original v5 soak used SD-Turbo q8_0 with embedded full VAE, not TAESD. Current evidence descriptions corrected; raw logs unchanged.

High-risk regression review

  • Classification: high-risk (artifactConsumer).
  • Implementation task: iOS 26: SD model memory not released after repeated ImageGenerationEngine dispose (iPhone 17 Pro) #2004 / 0.19.11 release plan: iOS 26 SD memory, Windows GPU and embedding GPU qualification #2011 consumer lane.
  • Independent blocking QA task: accepted fresh independent Codex Sol high audit for 28a2a299 / live main 501a0772; no participation in implementation, integration or device execution.
  • Exact head / current base: 28a2a2999272f7a1d2eaf1ac1e15bb63efdb9fba / 501a0772433fd47c4448bf98643f6c168e4a21a0 (fetched actual main, not stale PR base metadata).
  • Production-branch deletion, bypass, or miswire proof: N/A, artifact constants and docs only.
  • Affected-family real-model/artifact evidence: published v6 artifacts and full-VAE device qualification at source 6b191b28; applicability to the unchanged SD boundary at 28a2a299 independently verified.
  • Explicit unavailable-family or other N/A evidence: qualification is bounded to the recorded SD-Turbo full-VAE recipe.
  • Known PR-caused P1 regressions: 0, independently reviewed at the exact current head/base.
  • Unresolved review threads: 0, refreshed after the independent audit.

Artifact provenance and compatibility

  • Release run 43656290921: all 12 builds, package, verify and release passed at owner 0ec6c1fa; 27 assets published.
  • Sync verified manifest and runtime/XCFramework GitHub digests; digest check verifies all 12 bundle checksums against SHA256SUMS. Downloaded Linux runtime/symbols and XCFramework bytes also match SHA256SUMS.
  • XCFramework SHA-256: 7e5a79218d731ce7fb6b54020190a79630bd843d9a1dbafb24e5f0442ab95cb8.
  • Downloaded v5/v6 stable-diffusion.h and sd_dart_wrapper.h are byte-identical; no bindings regeneration needed.
  • Older v3/v4 checksum admission retained. Companion 0.19.10 (v4) and earlier v3 companions retain app-lock compatibility but do not receive v6 fixes.
  • Release prep must bump SD companion to 0.19.11 and its core floor to >=0.19.11 <0.20.0, finalize Unreleased sections and runtime baseline. This PR does not publish packages.

Tested implementation source: 6b191b28b0f39eae1368fc76ea37f8051c5d2cb8. CI checks completed successfully or were skipped at that head. The current integration imports main through a merge commit with no manual conflict resolution. SD pins, fixtures, SwiftPM checksum and native binary are unchanged; the fresh audit verified applicability of the saved device results to this integrated tree.

V6 device qualification record

  • Test ZIP SHA-256: a7af0af3d97606d2e93d0eacb84f4307d521ca6120a6ae50bbbb601f255881a8. Same full-VAE model/harness; no taesdPath; per-device PNG hashes unchanged across v4/v5/v6.
  • End residuals relative to first baseline, before epilogue churn: iOS 18.3.2 v6 37.91–40.05 MiB (v5 239.66–240.56; v4 21.38–25.56); iOS 26.5.1 v6 32.36–43.95 MiB (v5 28.23–43.63).
  • Historical v4 iOS 26 provider PASS included one load_failed, five disposal records and about 1.9 GiB retention; it was not a clean functional pass.
  • Small nonzero residuals remain. These are single-session observations, not proof of zero leaks. Raw configs say runtime_version: unknown; independent binary verification establishes v6 provenance (XCFramework checksum, matching UUID and normalized unsigned bytes).
  • Detailed maintained record: doc/cross_platform_validation.md, v0.3.0-6 full-VAE disposal qualification. Preserved evidence: llamadart-evidence/issue-2004/results/ab-v6/{evidence-report.md,comparison.json} and bundles/ab-v6/{state.json,artifact-verification.json}. Raw logs unchanged.

Final integration head: 28a2a2999272f7a1d2eaf1ac1e15bb63efdb9fba, merged actual main 501a0772433fd47c4448bf98643f6c168e4a21a0. 37 successful / 9 skipped checks; fresh independent audit accepted. Tested source remains 6b191b28b0f39eae1368fc76ea37f8051c5d2cb8; v6 binary unchanged.

Historical independent audit evidence (stale after base/head change)

  • Full consumer diff, published artifacts, legacy companion admission, saved raw device logs and signed-framework provenance independently checked.
  • Schema-v2 readiness: exit 2, unverifiedPrerequisites, the expected repository-local result; it does not establish authenticated external enforcement.
  • Preserved audit: llamadart-evidence/pr-2018/e3902ecc-audit/audit-report-e3902ecc.md; readiness input/output and causal controls are alongside it. The integration head supersedes this audit; none of its readiness claims qualify the new head.

Current-main integration validation

  • Merged actual fetched main 501a0772433fd47c4448bf98643f6c168e4a21a0 into existing author history without rebase; no conflicts or manual resolutions. Both parent histories are retained.
  • Clean pinned-SDK workspace preparation, targeted pin/hook, imported llama.cpp service and changelog integration tests passed (472 passed, 3 skipped); git diff --check passed. No broad-suite or physical-device rerun.
  • Nonblocking P3 warning-content assertion gap remains tracked in 0.19.11 audit follow-ups #2009. No production feature from main was reimplemented.

Current-head independent audit

  • Accepted at 28a2a2999272f7a1d2eaf1ac1e15bb63efdb9fba against live main 501a0772433fd47c4448bf98643f6c168e4a21a0, verified directly through the default-branch ref at start/end.
  • Complete PR-owned payload and SD production boundary unchanged. 122 targeted tests passed; four new integration controls killed. Prior 26 killed SD controls reused by exact blob/dependency identity; existing P3 remains tracked in 0.19.11 audit follow-ups #2009.
  • Saved evidence: llamadart-evidence/pr-2018/28a2a299-audit/audit-report-28a2a299.md, readiness-input-28a2a299.json, readiness-output-28a2a299.json, and final-binding.json.
  • Schema-v2 evaluator exits 2 / unverifiedPrerequisites as expected; this is repository-local consistency, not authenticated external enforcement. Release prep remains separate.

Merge and post-merge verification

…dispose (#2004)

The runtime carries the ggml vm_allocate host-buffer fix. v0.3.0-3 and
v0.3.0-4 companions stay admitted with an upgrade warning; headers and
bindings are unchanged. The iOS 26 known-limit notes now say the fix is in
runtime v0.3.0-5, device check pending.
@leehack leehack changed the title Pin stable-diffusion-native v0.3.0-5 so iOS 26 frees model memory at dispose (#2004) Adopt stable-diffusion-native v0.3.0-6 for Apple memory release (#2004) Nov 15, 2026
@leehack
leehack marked this pull request as ready for review November 15, 2026 12:34
@leehack
leehack merged commit bde98bc into main Nov 15, 2026
47 checks passed
@leehack
leehack deleted the lane-2004-sd-v0305 branch November 15, 2026 12:34
@github-actions

Copy link
Copy Markdown
Contributor

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

This was referenced Nov 15, 2026
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