kiji-proxy icon indicating copy to clipboard operation
kiji-proxy copied to clipboard

macOS DMG ships two copies of the model and nears GitHub's 2 GiB asset limit

Open Davidnet opened this issue 2 weeks ago • 1 comments

Raised in the review of #690. These numbers are estimates; no DMG was built.

The macOS app carries two copies of the model:

  • one embedded in the Go binary (make build-go-embed);
  • one in resources/model/quantized, copied by rsync (src/scripts/build_dmg.sh:289-300).

v5's model.onnx compresses to 831 MiB with gzip -6, against 603 MiB for the current model.

v1.6.8 (measured) with v5 (estimated)
DMG 1,346 MiB ≈1,800 MiB
zip 1,325 MiB ≈1.78 GB

That is about 12% under GitHub's 2 GiB per-asset limit. The uncompressed app is about 2.6 GB inside a DMG filesystem sized at 3 GB (src/frontend/package.json: "size": "3g"). A larger model would break both the release upload (create-release) and hdiutil ("no space"). Linux .tar.gz and .deb carry one copy (about 631 → 860 MiB), so they're fine.

Related: when the embedded model is extracted on upgrade (#692), files are replaced one at a time. If the app is killed mid-extraction, the set is mismatched until the next start repairs it. Old vocab.txt and ort_config.json stay in the extraction directory; nothing reads them.

Suggested fix

  • Run the build-dmg workflow once on the v5 stack before tagging, to measure the real size.
  • Drop the duplicate resources/model/quantized copy. The comment at build_dmg.sh:290 says one copy is enough.

Davidnet avatar Nov 17 '26 02:11 Davidnet

Measured

The build workflow was run by hand on #690's branch (2e2bc1b, v5 model, create_release=false; run 44004045545). All builds passed, and the release and tap steps were skipped. Sizes are exact, read from the artifact's zip index:

Asset v1.6.8 release v5 build Share of 2 GiB
macOS DMG 1,346 MiB 1,818 MiB (1,906,130,052 B) 88.8%
macOS zip 1,325 MiB 1,771 MiB (1,857,373,932 B) 86.5%
Linux .tar.gz 631 MiB ≈862 MiB* ≈42%
Linux .deb 596 MiB ≈781 MiB* ≈38%

* These are artifact bundle sizes, not the individual release files.

  • The estimate above (≈1,800 MiB) held. The DMG has about 230 MiB of headroom (11%).
  • The 3 GB disk image packed without errors.
  • The Mac app still ships the model twice: once embedded in the binary and once in resources/model/quantized. A model about 15% bigger would push the DMG or the zip over GitHub's 2 GiB asset limit.
  • Dropping the second copy would bring the DMG to roughly 1 GiB.

Davidnet avatar Nov 17 '26 03:11 Davidnet