$ show Recol/DLSS-Updater
DLSS Updater is a cross-platform (Windows/Linux) desktop GUI application built with Python and Flet that scans installed game libraries for GPU upscaling and frame-generation DLLs (NVIDIA DLSS, AMD FSR, Intel XeSS, DirectStorage, Streamline), compares installed versions against a manifest hosted in a companion GitHub repository, downloads updated DLLs, and replaces them with automatic backup and per-game rollback. Beyond DLL swapping, it writes per-game NVIDIA DLSS preset overrides through the NvAPI driver-settings API on Windows, generates DXVK-NVAPI launch options for Proton/Wine prefixes on Linux, integrates deeply with Steam (library scanning, exe resolution, app-ID/artwork fetch, FTS5 search over ~207K apps), and self-updates by fetching SHA-256-verified MSI/Flatpak artifacts from GitHub releases. The architecture separates a core engine (scanner, updater, DLL repository cache, SQLite database, backup manager, config, exe resolver) from a Flet UI layer via thin service modules, with a Material Design 3 theming system, hub/games/backups/settings views, slide-panel dialogs, and progressive card rendering. The codebase is explicitly engineered for Python 3.14 free-threaded (GIL-disabled) execution: thread-safe singletons, named anyio CapacityLimiter instances for all blocking I/O, a deterministic background-task registry, typed msgspec structs, and memory-mapped DLL caching in the high-performance batch update pipeline. It ships an unusually thorough regression test suite (~40 test files) that documents historical bugs — Flet API removals, UTC timestamp leaks, locked-file retries, thread-safety under free-threading, download-URL allowlisting, orphaned-backup recovery — plus CodSpeed benchmarks, and security-minded practices (TLS trust pinning, DLL URL allowlists, msiexec-only update path). The dominant risks are ecosystem churn and packaging complexity rather than core code quality: heavy pinning of Flet 1.0.2 with many documented dead/renamed API workarounds, the free-threaded CPython 3.14 requirement, a four-way distribution matrix (MSI via Briefcase, PyInstaller onefile/source, Flatpak, Flathub source build), and acknowledged design debt (a very large MainView coordinator, duplicated color/status helpers, tests coupled to Flet internals). The scanning/update/DLL-repository engine itself is well-isolated, security-conscious, and genuinely reusable.
The LLM identified 6 files worth highlighting for reuse:
Central definitions of shared anyio CapacityLimiter instances (thread_cpu, thread_io, io_heavy, io_extreme) that bound every blocking filesystem, PE-header, and network operation used across the application. It replaces ad-hoc semaphores/executors with named, tuned limits and is trivially extractable into any async Python project that needs disciplined thread-pool concurrency.
Thread-safe registry for fire-and-forget background tasks with a deterministic cancel_all_tasks() that uses a bounded repeated-cancel loop. It solves the recurring problem of structured shutdown in concurrent desktop apps — cancelling tasks spawned from multiple contexts without races or hangs — and can be lifted into any asyncio/anyio application.
A self-contained parser for Valve's VDF/ACF formats (Steam libraryfolders.vdf, appmanifest files) using pre-compiled regexes and an anyio semaphore for bounded concurrent manifest parsing. Any Steam-integration or game-library tool needs exactly this file, and it is isolated enough to extract directly into a new project.
Pure string-normalization utilities for matching game names across launchers, manifests, and store search results (case/punctuation/whitespace folding), backed by a manual thread-safe bounded cache that deliberately replaces lru_cache for free-threaded Python safety. A clean, near-dependency-free component demonstrating the manual-cache-instead-of-global-state pattern.
Pure functions and constants for Flet hero/header visuals — scrim gradients, brand-wash overlays, watermark icons, pills, and themed accent pairs — shared across cards, panels, dialogs, and slide-panel headers. Framework-specific but framework-isolated: an engineer building any Flet desktop app could copy this file to obtain a consistent MD3-style hero-surface vocabulary without touching the rest of the codebase.
ThemeAwareMixin + ThemeRegistry: components declare (dark, light) themed property pairs and receive priority-ordered cascade re-theming with delayed animations, including detection of detached navigation subtrees so stale views are healed on re-attach. This is the architectural cornerstone of the UI's live dark/light toggle and encodes non-obvious Flet knowledge (patch-drop bugs on detached subtrees, replacement-based healing); it could be extracted as the theming layer of another Flet project.