Repository navigation
[NM-636] GPU 번역 디스크 캐시 + 검출기와 각인 · 마크 번갈아 열기 + 내려놓기 - #91
Merged
Merged
Conversation
- LiteRT GPU serialization 으로 번역 결과를 codeCacheDir/litert_gpu 에 남긴다. 빌드가 바뀌거나 GPU 로 죽으면 비운다 - 검출이 끝나면 검출기를 닫고 각인 · 마크를 연다. 재촬영하면 반대로. 마크를 먼저 열어 여는 순간의 튐이 겹치지 않게 한다 - 식별이 끝나거나 촬영 화면을 닫으면 모델을 내려놓는다 - S24: 다시 열기 약 8초 → 2초, 메모리 정점 약 1.5GB → 955MB, 식별 뒤 거의 0 - GpuCacheTest: 캐시로 다시 연 모델이 처음 연 모델과 같은 답을 내는지 기기별로 본다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 검출 · 각인 · 마크를 잠금을 쥔 채 실행한다 — 받아 간 모델을 다른 쪽이 첫 실행 전에 닫던 창을 없앤다 - 판독 루프가 취소를 삼키지 않게 알약마다 확인한다 — 재촬영 뒤에도 돌며 새 검출기를 닫지 않게 - 내려놓기를 화면 콜백 대신 보유 수로 — 알약 탭에서의 시스템 뒤로 · 탭 이동도 내려놓는다 - 내려놓기 · 다시 쓰기의 순서 값을 잠금으로 묶는다 - GPU 캐시 비우기를 메인 스레드 밖에서 한다 - GpuCacheTest: 저장을 못 하는 드라이버는 실패가 아니라 건너뜀 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 내려놓기가 진행 중인 판독 · 검출을 실패시키던 것을 없앤다 — 탭을 옮겨도 남은 알약까지 다 읽는다 - 회전처럼 플로우 화면이 잠깐 0 이 되는 때를 넘기려고 1초 기다리고, 닫기 직전 잠금 안에서 다시 본다 - 판독 루프 전체를 사용 중으로 묶는다 — 알약 사이 빈틈에 끼어 매번 닫았다 다시 열던 것(S24) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
통과 기준 검증
판독 중 재촬영 경합은 실기기에서 시점을 맞추지 못했다(캐시가 차면 판독이 결과 화면보다 먼저 끝난다). 구조로 막았다 — 검출 · 판독은 잠금을 쥔 채 실행하고, 판독 루프는 알약마다 취소를 확인한다. |
Merged
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.
무엇
codeCacheDir/litert_gpu에 남긴다. 빌드가 바뀌거나 직전 실행이 GPU 로 죽으면 백그라운드에서 비운다. 키는 모델 파일 · 크기 · 배치 · 정밀도 · 앱 버전 · 기기 빌드.실측 (Galaxy S24 · Exynos 2400, debug)
내려놓기 경로: 홈 → 촬영 → 뒤로(627 → 245MB), 알약 탭 → 촬영 → 시스템 뒤로(628 → 234MB), 판독 중 홈 탭 이동(세 알약 다 읽은 뒤 846 → 364MB, 모델은 한 번만 연다).
Firebase Test Lab —
GpuCacheTest(빈 캐시로 열기 → 같은 캐시로 다시 열기 → 답 비교)10대 모두 통과, 캐시를 쓰고 다시 연 모델이 같은 답을 냈다. 시간은 열기 + 실행 1회.
a12 · F01L 은 GPU 실행 자체가 느리다(기존 발견, ML 쪽 과제).
리뷰
코드 리뷰 스킬 두 번. 1차 9건 · 2차 6건을 반영했다. 반영하지 않은 것: 캐시 키에 모델 해시 — 모델은 APK 에만 실려 바뀌면 곧 앱 업데이트이고, 시스템이 업데이트 · OS 업그레이드마다
codeCacheDir를 비운다(KDoc 에 근거).🤖 Generated with Claude Code