Improve store install storage checks and recovery; adaptive parallel Epic installs (#710)

Space checks before Epic, GOG and Amazon installs (measured zero vs unknown), clear failure reasons with retry/clear, resume-aware checks, and safe per-file replacement so a failed or cancelled update never breaks an installed game.

Epic installs stream chunks straight into staged files in parallel (most bytes written once, a small budgeted cache for shared chunks, about 1x game size instead of 2x), pace updates by free space, and keep the lookahead, batch and bounded Java writers as hidden alternatives.

Co-authored-by: Juan Marti Mercado <juanma@microsoft.com>
Co-authored-by: The412Banner <the412banner@users.noreply.github.com>
This commit is contained in:
Juan MartíandThe412Banner authored and GitHub committed 2026-10-13 22:29:23 -04:00
1 parent d310e59fce
commit a074ba994b
34 files changed
+6777 -233

No files matched your search

@@ -82,6 +82,15 @@ object SessionPrefs {
prefs(context).edit().putString("gameStoresSpeedTier", tier).apply()
}
/**
* Hidden A/B switch for the Epic installer: "adaptive" (default: native parallel fetch written
* straight into staged files), "lookahead" (the native ordered-lookahead engine that caches each
* chunk and copies it into staged files), "batch" (the older whole-cache native fetch, then
* native assembly; needs about twice the game's size free) or "java" (the bounded Java writer).
* No UI; set it in the `session` preferences for benchmarks.
*/
fun storesEpicMode(context: Context): String = prefs(context).getString("storesEpicMode", "adaptive") ?: "adaptive"
fun storesOpenTab(context: Context): String =
prefs(context).getString("storesOpenTab", STORES_OPEN_LIBRARY)?.takeIf { it == STORES_OPEN_STORE } ?: STORES_OPEN_LIBRARY