Skip to content

Drop the unused LiteRT and WebGPU accelerator libraries from Apple bundles (#1911) - #1927

Merged
leehack merged 2 commits into
mainfrom
lane-1911-strip-apple-litert
Nov 11, 2026
Merged

leehack merged 2 commits into
mainfrom
lane-1911-strip-apple-litert

Conversation

@leehack

@leehack leehack commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Pin leehack/[email protected] (owner PR #119, merge 5da99205; release), which stops shipping the macOS libLiteRt.dylib and libLiteRtWebGpuAccelerator.dylib and the iOS loose libLiteRt.dylib. LiteRtLm embeds LiteRT and its GPU accelerator, so dyld traces show none of them is opened.
  • Companion Package.swift drops the LiteRt and LiteRtWebGpuAccelerator targets (4 binary targets left); the v0.19 macOS required-library inventory, the prepare-app script and the sync script follow. The sync remover matches name: "LiteRt" exactly and refuses a release that drops only one of the two.
  • Admits v0.19.1-4 in the LiteRT-LM library smoke and the S24 binding (Android archives hold the same libraries as v0.19.1-3).
  • Fixes #1911.

Production-readiness scope

  • User-facing scope: macOS LiteRT-LM apps drop two dylibs (16.9 MB installed; 6.2 MB less XCFramework download via llamadart_litert_lm_flutter, same for the hook bundle); iOS hook download drops 2.7 MB per slice. Generation unchanged.
  • Supported platforms/paths: macOS arm64 hook and SwiftPM companion, iOS hook; Android, Linux and Windows unchanged.
  • Unsupported or intentionally unavailable paths: v0.18.x and earlier owner releases keep their inventories (sync tests cover both).
  • Out of scope / follow-ups: iOS loose libLiteRtLm.dylib and the WebgpuDawn target left in place; each is a possible follow-up. Overlap with Name the pinned LiteRT-LM runtime tag in unsupported-runtime errors #1920 is resolved (rebased on e632b443, which includes 0.19.6 batch integration: #1920, #1922, #1919, #1924 #1926).

Completeness checklist

  • Scope implemented
  • Unsupported combinations: N/A (inventory reduction)
  • Docs, README, skills, changelogs updated
  • Regression coverage incl. version-skew (v0.18 keeps files)
  • Validation registry: N/A, no capability change
  • Security/privacy: no secrets in logs or evidence

PR type guidance

  • Feature PR: N/A. Bugfix PR: N/A. Packaging change: root cause is the unused libraries, evidence in #1911.

Test Plan

  • dart run tool/prepare_workspace.dart
  • dart format --output=none --set-exit-if-changed .
  • dart analyze
  • dart test -p vm -j 1 --exclude-tags local-only (TMPDIR isolated): all pass except 6 windows_registry_qualification_test.dart cases that need pwsh, absent on this Mac (CI covers)
  • dart test -p chrome --exclude-tags local-only: CI
  • coverage-lib: CI/main; lib/ change is list removals
  • python3 -m unittest discover -s tool/native -p 'test_*.py' (207), check_native_release_digests.dart (8 LiteRT-LM bundles match v0.19.1-4), companion and validation package tests
  • Mutants caught: re-adding libLiteRt.dylib to _liteRtLmV1RequiredLibrariesForAbi; Swift remover dropping one target; substring instead of exact name: "LiteRt" match

Matrix Evidence

Matrix row Scope covered Platform / model / backend Result Evidence / notes
litert-lm-chat-features-smoke chat features macOS, Qwen3-0.6B, CPU and GPU, hook at v0.19.1-4 pass hook dir holds 4 dylibs
litert-lm-json-schema JSON Schema macOS, Gemma 4 E2B, CPU and GPU pass
litert-lm-multimodal-embedding embeddings macOS, EmbeddingGemma 2, CPU pass
litert-lm-asr-smoke ASR macOS, Moonshine tiny pass transcript matched
chat app macOS build companion layout flutter build macos --debug pass otool -L: LiteRtLm.framework depends only on its Gemma provider and Dawn; no LiteRt or accelerator embedded
iOS simulator probe C ABI iOS 26.5 sim, Qwen3-0.6B CPU and GPU, released arm64-sim LiteRtLm (same bytes as PR candidate) pass simctl spawn of the C probe; no T3 device session
Gemma 4 vision/audio/MTP, GPU media macOS covered by pre-adoption evidence with the libraries deleted (#1911); not rerun at the pin

Review Notes

  • Independent review status: PASS at e11d7997 (fresh auditor session, 0 P1/P2): digests and SwiftPM checksums match v0.19.1-4; sandboxed macOS chat app and iOS 26.5 simulator JSON Schema on GPU pass through the trimmed companion; v0.19.1-3 override passes; Windows DLL diff is build metadata only; evaluator exit 2. Evidence: llamadart-evidence/pr-1927/
  • CI status / head SHA: green (37 pass, 9 skipped) at e11d7997

High-risk regression review

  • Classification: high-risk (artifactConsumer, backendRuntime)
  • Implementation task: lane-1911
  • Independent blocking QA task: PASS at e11d7997, 0 P1/P2. Maintainer merge approval given ("Merge Drop the unused LiteRT and WebGPU accelerator libraries from Apple bundles (#1911) #1927"). Audit P3s are logged on 0.19.x audit follow-ups (index) #1861.
  • Exact head / current base: e11d7997 / e632b443
  • Production-branch deletion, bypass, or miswire proof: hook cache at v0.19.1-4 holds exactly the four required dylibs and the e2e rows above load them; mutants above fail the inventory tests
  • Affected-family real-model/artifact evidence: table above
  • Explicit unavailable-family or other N/A evidence: Gemma 4 media/MTP and iOS app-level run not rerun at the pin
  • Known PR-caused P1 regressions: 0
  • Unresolved review threads: 0

…ndles

LiteRtLm embeds LiteRT and its GPU accelerator, so the macOS libLiteRt and
libLiteRtWebGpuAccelerator and the iOS loose libLiteRt are never opened.
Pin litert-lm-native v0.19.1-4, which stops shipping them, and teach the pin
sync script the four-target Swift topology.

Refs #1911
@leehack
leehack marked this pull request as ready for review November 11, 2026 15:32
@leehack
leehack merged commit dc8e262 into main Nov 11, 2026
46 checks passed
@leehack
leehack deleted the lane-1911-strip-apple-litert branch November 11, 2026 15:32
@github-actions

Copy link
Copy Markdown
Contributor

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

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.

Check whether macOS libLiteRtWebGpuAccelerator, libLiteRt and the iOS loose libLiteRt are needed

1 participant