Repository navigation
PyUI: identify ROMs for achievement progress with Cheevos's helper - #1888
Merged
Merged
Conversation
View achievement progress identified unknown ROMs through an identify-rom command added to the bundled RAOfflineProxy. Proxy updates replace that directory: the nightly-54 refresh already removed the command, hiding the action. Cheevos now ships the helper (App/Cheevos/identify-rom.sh), and the installed proxy stays unmodified. - Offer the action when Cheevos's config.json has "gameProgress": 2 and ships identify-rom.sh, instead of checking for the proxy's file. - Keep the loaded CheevosCacheManager mapping as the first fast path, with no subprocess, ROM checks or cache access. - Run the helper in its own session with a per-lookup scratch directory under Saves/cheevos/cache/identify-work. B and the 60 s timeout stop the whole process group, escalating to SIGKILL; the scratch directory is removed either way. - Accept only the helper's documented results: malformed output or a crash is a failed lookup, and a structured error survives a nonzero exit. Add a message for the new "dependency" reason. - Remove cheevos_identification_cache.py: saved path associations now live in Cheevos, in the same rom-identifications.json. Tested on Miyoo Mini+. Requires Cheevos v0.2.2+. With an older Cheevos the action stays hidden.
Starting Cheevos's identify-rom.sh from PyUI takes 0.9-2.4 s on a Miyoo Mini+, even when Cheevos has already saved the ROM's game, so View achievement progress showed "Checking RetroAchievements..." for that long every time. Spruce 4.5.5 answered saved paths in-process. Read rom-identifications.json before starting the helper, and use only a match saved under the ROM's absolute path: versions 1 and 2, at most 256 KB, real game IDs only. Misses, expiry, virtual IDs and saving stay with the helper. The read takes under 1 ms on a Mini+.
abalakh
added a commit
to spruceUI/cheevos
that referenced
this pull request
Oct 19, 2026
Each identification helper run is a new process. Asking RA through Python first imported ssl and http.client (0.45 s on a Miyoo Mini+) and resolved RA's address through the C library (0.3-0.8 s). Spruce ships a static curl for every platform and makes its own HTTPS requests with it; curl answers RA's r=gameid in 0.3-0.6 s, process included. - Add platform/curl_transport.py: GET through the curl on Spruce's PATH, matching HttpTransport: certificates from $SSL_CERT_FILE, no ~/.curlrc, proxies or redirects, a 15 s limit, TLS failures on RA's hosts retried over HTTP, and RA's Date for the app clock. No answer is offline. Any other failure (curl missing, not executable, built for another architecture, unexpected output) falls back to Python's HTTPS for the rest of the run. - Move RA's hosts, Response and default_user_agent to ra_client/common.py, so the helper loads no TLS code. - Document that Spruce now reads saved matches from rom-identifications.json itself (spruceUI/spruceOS#1888), which makes a match's shape a contract. On a Miyoo Mini+, the RA step took 0.6-1.3 s instead of 1.8-2.1 s, and a new SNES zip 2.5-3.7 s instead of 3.8-4.2 s.
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.
View achievement progress identified unknown ROMs through an identify-rom command added to the bundled RAOfflineProxy. Proxy updates replace that directory: the nightly-54 refresh already removed the command, hiding the action. Cheevos now ships the helper (App/Cheevos/identify-rom.sh), and the installed proxy stays unmodified.
Tested on Miyoo Mini+.
Requires Cheevos v0.2.2+. With an older Cheevos the action stays hidden.