Skip to content

feat: FP32 MobileCLIP-S0 vision, EXIF upright rotation, tuned search & release AAB - #6

Merged
saariuslystoned merged 2 commits into
mainfrom
feat/fp16-vision-exif-and-release-aab
Dec 2, 2026
Merged

saariuslystoned merged 2 commits into
mainfrom
feat/fp16-vision-exif-and-release-aab

Conversation

@saariuslystoned

@saariuslystoned saariuslystoned commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes visual search accuracy on real camera photos and adds bundleRelease R8 verification:

  1. FP32 MobileCLIP-S0 Vision Backbone (43 MB, SHA-256 pinned):
    • Replaces dynamic INT8 vision_model_int8.onnx (which severely degrades MobileCLIP's reparameterized Conv2D embeddings) with FP32 vision_model.onnx (17d3c037b1d488c10c50e09f6009ea5a198caef4e0e8f4ea5617b7cb2d067ac0), avoiding both INT8 accuracy collapse and an ARM64 ONNX Runtime 1.25.0 CPU EP bug where vision_model_fp16.onnx silently outputs all-zero vectors.
    • Adds a finite non-zero embedding guard in MobileClipOnnxEncoder.extractEmbedding() and cleans up legacy INT8/FP16 vision cache files on upgrade.
  2. CLIP Zero-Shot Prompt Framing:
    • MobileClipOnnxEncoder.buildVisualPrompts() ensembles raw short descriptive queries with "a photo of a <query>" (L2-normalized average) while leaving numeric/code queries untouched.
  3. JPEG EXIF Orientation Rotation:
    • Adds androidx.exifinterface:exifinterface:1.3.7 (0 platform permissions) to rotate portrait camera JPEGs upright in ImportManager.decodeSampledBitmap() (and refreshes thumbnails + upright dimensions during DB v8 re-index).
  4. Domain Stopword Scrubbing & Calibrated Semantic Floor (DB_VERSION = 8):
    • Scrubs generic filler/domain stopwords (photo, picture, screenshot, a, of, etc.) before SQLite FTS5 matching.
    • Raises SEMANTIC_MATCH_THRESHOLD to 0.17f (SEMANTIC_TOP_RATIO = 0.80f) to match FP32 CLIP cosine separation and triggers clean auto-reindex on upgrade.
  5. Release AAB (bundleRelease) & Durable FreeSched Pin:
    • Adds -keep class ai.onnxruntime.** { *; } to app/proguard-rules.pro and verifies bundleRelease (91 MB total including :models_pack) in CI.
    • Pins scripts/build-freesched-aar.sh to durable freesilicon/freesched main SHA 22f08fc753cdf1fba8a1253b384483dd575ea5f7.

Verification

  • ./gradlew --no-daemon testDebugUnitTest assembleDebug bundleDebug bundleRelease — PASS (app-release.aab = 91 MB).
  • ./scripts/check-zero-permissions.sh — PASS (0 platform permissions across debug/release merged manifests and APK).
  • ./scripts/check-16k-alignment.sh — PASS (PT_LOAD 0x4000 on all 4 native .sos + zipalign -P 16).
  • ./scripts/clean-room-audit.sh — PASS (59 files, 0 errors).
  • Live install & re-index verified on retail Android 17 Pixel devices (norm > 0 across indexed embeddings, 0 zero-vectors, 0 crashes).

@saariuslystoned saariuslystoned changed the title feat: FP16 MobileCLIP-S0 vision, EXIF upright rotation, tuned search & release AAB feat: FP32 MobileCLIP-S0 vision, EXIF upright rotation, tuned search & release AAB Dec 2, 2026
@saariuslystoned
saariuslystoned merged commit 818cb1f into main Dec 2, 2026
2 checks passed
@saariuslystoned
saariuslystoned deleted the feat/fp16-vision-exif-and-release-aab branch December 2, 2026 06:14
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