Repository navigation
feat: bundled INT8 dual-tower encoder, zero-permission OCR & :models_pack - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:models_pack) & deterministic RCL1 exporter (scripts/export-int8-models.py): Generatesdual_tower_int8.rcl1(64→128→512 symmetric INT8 dual-tower weights) andocr_glyphs_int8.rcl1(8×12 tight-cropped INT8 glyph templates) at build time with zero binary blobs checked into git.ModelPackLoader,Int8DualTowerEncoder): Loads verifiedRCL1weights from Play Asset Delivery install-time assets (with debug/test classloader fallback) and produces L2-normalized 512-d INT8 embeddings.BitmapOcrExtractor): Grayscale + border-aware Otsu binarization (supporting both light and dark UI screenshots), horizontal line & vertical word/glyph segmentation, geometric.vs-disambiguation, and 8×12 INT8 template cosine classification returning real text + normalized[0, 1]OcrBoxcoordinates (never fabricating boxes on blank images).FreeSchedEngine): Runs the exact same 8-image 2-layer FFN (seqLen=16, 64→128→64) in matching[out, in]weight layout on CPU vs FreeSched AHB+NNAPI with hot-loop timing boundaries, timeout slot draining, and honest fallback reporting.RecallDatabasev1→v2,ImportManager.reindexPendingScreenshots): Drops incompatible v1 embeddings on upgrade and re-indexes stored screenshots cleanly withimport_generationdelete fencing..github/workflows/ci.yml): AddsbundleDebugbuild + assertions thatdual_tower_int8.rcl1andocr_glyphs_int8.rcl1are present in both the AAB (:models_pack) and debug APK alongside existing zero-permission, 16 KiB ELF/zipalign, and clean-room audits.Verification
./gradlew --no-daemon testDebugUnitTest assembleDebug bundleDebug— 14/14 unit & Robolectric tests PASS../scripts/check-zero-permissions.sh— 0<uses-permission>in source manifest, 0 platform permissions in merged manifests & APK../scripts/check-16k-alignment.sh—libfreesched.so&libandroidx.graphics.path.souncompressed (ZIP_STORED),PT_LOAD 0x4000,zipalign -P 16PASS../scripts/clean-room-audit.sh— PASS across 48 files (0 errors).