Skip to content

fix(android): harden backend selection on Android#96

Merged
leehack merged 3 commits intomainfrom
fix/issue-95-android-cpu-score
Mar 26, 2026
Merged

fix(android): harden backend selection on Android#96
leehack merged 3 commits intomainfrom
fix/issue-95-android-cpu-score

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented Mar 26, 2026

Summary

  • honor ggml_backend_score during asset-based backend fallback so unsupported Android CPU variant libraries are skipped before initialization
  • prefer CPU for Android GpuBackend.auto model loads so default configs avoid auto-initializing Vulkan on unstable devices while keeping Vulkan available for explicit opt-in
  • add regression tests, startup diagnostics, and changelog/README notes for the Android backend safety follow-up from issue SIGILL crash on Exynos 1380 (Samsung Galaxy Tab S9 FE) — KleidiAI i8mm #95

Testing

  • dart test test/unit/backends/llama_cpp/llama_cpp_service_test.dart
  • dart analyze

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.78%. Comparing base (8f80ae2) to head (8752e02).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/backends/llama_cpp/llama_cpp_service.dart 66.66% 12 Missing ⚠️

❌ Your patch status has failed because the patch coverage (66.66%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
- Coverage   76.90%   76.78%   -0.12%     
==========================================
  Files          67       67              
  Lines        8368     8394      +26     
==========================================
+ Hits         6435     6445      +10     
- Misses       1933     1949      +16     
Flag Coverage Δ
unittests 76.78% <66.66%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

leehack added 3 commits March 26, 2026 10:36
Avoid initializing unsupported Android CPU variant assets when dynamic asset loading bypasses the native score-aware loader. Add regression coverage and startup diagnostics so skipped and selected CPU assets are easier to verify.
Keep Android model loads on CPU when callers leave the backend in auto mode so default configurations avoid unstable Vulkan initialization. Update tests and README notes to match the new Android auto-backend policy.
Document the Android CPU loader hardening and the new CPU-first auto backend policy so the issue 95 follow-up is visible in unreleased notes.
@leehack leehack force-pushed the fix/issue-95-android-cpu-score branch from e413ab0 to 8752e02 Compare March 26, 2026 22:54
@leehack leehack merged commit def9040 into main Mar 26, 2026
6 checks passed
@leehack leehack deleted the fix/issue-95-android-cpu-score branch March 26, 2026 23:02
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.

2 participants