XSEmu launcher (Qt 6, design C) with runners, plus XSEmu.exe hosting, control pipe and warm-up progress #12
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/zortos293--XSEmu!12
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/12/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@zortos293 on GitHub · 2026-11-26 14:54 UTC · original
zortos293:capy/xsemu-launcher→main· +30244 −192 · 264 files · 85 commits · merged 2026-11-26 22:42 UTCAdds
XSEmuLauncher, a Qt 6 Widgets desktop launcher for XSEmu (design C, "Cover grid"), plus the emulator-side hooks it needs.XSEmu.exestays a separate process. The launcher starts it, hosts its window and talks to it over a named pipe. The contract is docs/launcher-protocol.md.Emulator side (
crates/xcl)XSEmu; the crate staysxcl. The "other emulator running" check matches bothXSEmu.exeandxcl.exe. windows.yml uploadsXSEmu-debug.run --host-hwnd <hex>(hosting.rs): the game window becomes a child of the launcher's window. Keyboard and mouse focus follow the hosted window (hle/kbm.rs,hle/gameinput.rs), and it is DPI aware.run --control-pipe <name>(control.rs): JSON lines carrying status, present counts and exit reasons, plus pause, resume and stop commands.present.rs,eh.rs,loader.rsandhost.rsreport into it.warm-up --progress-json(warm_up_json.rs,real.rs,main.rs): progress events on stdout. Cancel with{"cmd":"cancel"}or by closing stdin. Cancelling starts no new builds; what is already built stays, so the warm-up resumes where it stopped.assets/logo/XSEmu.icois linked throughbuild.rs.All three options are opt-in: without them,
runandwarm-upbehave as before. Shader translator sources are untouched, so caches are not rekeyed.Launcher (
launcher/)xcl.toml, and a Runs-with picker.--versionstarts withXSEmu, and--helplists--control-pipeand--progress-json). Older builds are refused with "This XSEmu build is too old for the launcher". Play and Warm-up are refused whileXSEmu.exe,xcl.exeorgame_scarlett_master.exeruns, or while a configured busy-marker file exists. Only one emulator process tree runs at a time.The app is C++17 and CMake.
launcher.ymlbuilds it with Qt 6.8 MSVC plus windeployqt and uploads theXSEmuLauncher-windowsartifact before tests run. It also builds with Qt 6.4 on Ubuntu with-Werrorand runs ctest: 11 test executables (protocol, controllers, library, settings, title config, shader cache, cover art, runners, in-game, reparent) driven againstfake-xsemu.Screenshots
Grabbed from the app itself with the dev lever (
--state … --grab) againstfake-xsemufixtures. All art is drawn in code.Notes
assets/logo/XSEmu.icois a binary outsidetests/data/, whichscripts/pr_check.pyflags. The icon is original art for the app.xcl warm-up [--full] --progress-json writes warmup_start, warmup_progress (once a second and at the end), warmup_done and error as JSON lines on stdout (docs/launcher-protocol.md); the process's stdout handle points at stderr, so the console text goes there. {"cmd":"cancel"} or the end of stdin cancels: no build starts (a compile waiting for its governor slot gives up with Refused::Cancelled and is not noted in the --full record), those running finish, built blobs and the --full record stay, exit code 4. The encoding, the stdin command reader, the per-phase rate/ETA and the option parsing live in warm_up_json.rs with unit tests. Without --progress-json nothing changes. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>Settings, Game folders, Runners: the folder community runners are downloaded and built in, with the Rust toolchain cache (_toolchains). Default %LOCALAPPDATA%\XSEmu\runners; XSEMU_RUNNERS_DIR still wins. A folder picker, the free space on that drive, and a warning under 20 GB (DiskSpace::kRunnerLowBytes): a source build keeps Rust, the checkout and CARGO_TARGET_DIR there and can run out of room part way. Changing it leaves installed runners where they are (their location is pinned). Runners page: Change location on every non-built-in card that is installed or installable. The runner's own folder (checkout, target, bin/app, data, cache, runner.json, install log) goes to <folder>\<id>. An installed runner offers Move (rename on the same drive, else copy, check file count, bytes and the program, then delete the old folder; state Moving meanwhile) or Rebuild there (a fresh install there; the old folder goes once it succeeds, and a failure keeps the old one in use). Refused while that runner installs, builds or moves, or runs a game or a pre-cache (Services wires EmulatorController and WarmupController). Both persist in settings.ini (runners/folder, runners/locations) and Paths follows them, so runner.json, Installed, the executable, launch tokens ({runnerDir}, {installDir}) and cache dirs use the new place. Tests: persistence across a new AppSettings/RunnerManager, Installed and tokens at the new place after Move, a cross-drive copy with checks, Rebuild there, refusals while busy (and through Services: a game and a pre-cache), the Runners folder pinning installed runners, and the free-space warning with an injected free-bytes function. Dev lever states settings-runners-folder and runners-change-location. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>@coderabbitai[bot] on GitHub · 2026-11-26 14:54 UTC · original · edited 2026-11-26 22:33 UTC
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
CodeRabbit Verify
@capy-ai[bot] on GitHub · 2026-11-26 18:12 UTC · original · reviewed
Capy found 3 potential issues (1 high, 2 medium).
View 3 other findings in Capy.
@capy-ai[bot] on GitHub · 2026-11-26 18:12 UTC · original
On
launcher/src/pages/settings/ShadersSection.cppline 69 (outdated):Clearing the shader cache can delete unrelated user files
High Severity
A user can select a non-cache folder containing a subdirectory named
driver,pipelines, ortranslated:isShaderCacheFolderaccepts it without checking its other contents. Clear cache then recursively deletes every entry in that folder, including unrelated documents or source files, although the confirmation describes only compiled shaders. The same problem occurs when unrelated files share a legitimate cache directory. Restrict deletion to verified cache-owned entries and reject ambiguous directories rather than treating one matching subdirectory as ownership of the entire folder.@capy-ai[bot] on GitHub · 2026-11-26 18:12 UTC · original
On
launcher/src/pages/GameDetailsPage.cppline 760 (outdated):Per-game emulator overrides are overwritten at launch
Medium Severity
With the global console set to Series S, selecting Series X here writes
anacondaonly intoxcl.toml. On the next Play,EmulatorController::startcallsLaunchConfig::prepareTitle, whosetitleValuesreads overrides fromAppSettings::gameOverrides, finds none, and overwrites the file withlockhart. Other per-game controls are likewise overwritten whenever their launcher-wide default is set. Persist and clear these choices in the override store used by launch preparation, and read that same store when displaying them.@ -0,0 +457,4 @@m_env.insert(QStringLiteral("CARGO_HOME"), QDir::toNativeSeparators(cargoHome));m_env.insert(QStringLiteral("RUSTUP_HOME"), QDir::toNativeSeparators(QDir(home).filePath(QStringLiteral("rustup"))));const QString bin = QDir(cargoHome).filePath(QStringLiteral("bin"));m_env.insert(QStringLiteral("PATH"), QDir::toNativeSeparators(bin) + QDir::listSeparator() + m_env.value(QStringLiteral("PATH")));@capy-ai[bot] on GitHub · 2026-11-26 18:12 UTC · original
Bootstrapped Cargo cannot be located on Windows
Medium Severity
On a Windows PC without Cargo in the launcher's original PATH,
ensureRustinstalls it under_toolchains/cargo/binand adds that directory only tom_env. Both curated source runners subsequently invoke the bare program namecargothroughrunProcess. Windows executable lookup uses the parent process's search path, not the environment block supplied to the child, so the build fails to start even after Rust setup succeeds. Retain the absolute path to the selected or installed Cargo executable and use it for build steps.@capy-ai[bot] on GitHub · 2026-11-26 18:33 UTC · original · reviewed
Capy found 1 potential issue (1 medium).
@capy-ai[bot] on GitHub · 2026-11-26 18:33 UTC · original
On
launcher/src/pages/GameDetailsPage.cppline 755 (outdated):Per-game console choice no longer reaches runner launches and runner warm-up
Medium Severity
The commit moved every Game details choice into
AppSettings::gameOverridesand removed the direct write to the title'sxcl.toml. OnlyLaunchConfig::prepareTitlecopies those overrides toxcl.toml, andEmulatorController::startcalls it only for built-in XSEmu (if (!spec.isBuiltIn()) return startRunner(...)returns beforeprepareTitle).EmulatorController::startRunner(EmulatorController.cpp:255-256) andWarmupController::startRunnerStep(WarmupController.cpp:305) take the console fromxcl.tomlwith fallback todefaultDeviceType(), then pass it into the runner tokens (Runner.cpp:60mapsanacondatoseries-x). Example: a game set to Series X under Game details, never played with built-in XSEmu, has noxcl.toml; a runner Play or runner warm-up therefore uses the launcher default console, and the UI still shows Series X. Before this commit the UI wrotedevice_typeintoxcl.toml, so runners honored it. After Use defaults, a runner keeps whatever stale valuexcl.tomlholds. The new note text at GameDetailsPage.cpp:781 ('written to xcl.toml when the game starts') is also false for runner games. Fix by resolving the effective per-game values (viaLaunchConfig::titleValues) in the runner start and precache paths, or by callingprepareTitlebefore the runner branch.@capy-ai[bot] on GitHub · 2026-11-26 18:45 UTC · original · reviewed
Capy found no issues.
@capy-ai[bot] on GitHub · 2026-11-26 19:42 UTC · original · reviewed
Capy found 1 potential issue (1 medium).
@capy-ai[bot] on GitHub · 2026-11-26 19:42 UTC · original
On
launcher/src/core/ShaderCacheInfo.cppline 29 (outdated):Incremental manifest parse keeps a stale offset after pipelines.bin is rewritten
Medium Severity
readManifest resumes from the byte offset saved by the previous scan. It resets only when the file is shorter than that offset or its first 64 bytes changed. The emulator's warm-up calls Store::rewrite (crates/xcl/src/hle/d3d12x/real.rs:5177-5179, pso_manifest.rs:337-349) whenever its load found broken or repeated entries, and that rewrite drops them from pipelines.bin. If a dropped entry sits before the saved offset, every later entry boundary shifts left by that entry's size. The saved offset then lands inside an entry. The warm-up's appends can carry the file past that offset before the warm-up-finished refresh runs, so the size check does not fire. The first 64 bytes only change if the dropped entry was the first one, so the head check does not fire either. Parsing from the stale offset reads a garbage length prefix. If the length exceeds the buffered data, the loop keeps reading and
bufgrows to the rest of the file on every scan, and the offset never advances. Otherwise garbage keys and entries are added tokeysandentries. Either waypipelinesandmanifestEntriesare wrong, and they stay wrong until pipelines.bin shrinks below the stale offset. They are shown in Shaders settings, Game details, Library and the in-game boot card ("N pipelines cached"). Fix: do not trust size plus a 64-byte head to prove the bytes before the saved offset are unchanged. Store a hash of the last parsed entry, and before resuming check that it still sits at offset minus its length prefix and length. Reset when it does not match. The new incrementalParseMatchesFullParse test covers a head change and a shrink, but not an entry dropped before the offset with the file regrown.@capy-ai[bot] on GitHub · 2026-11-26 20:14 UTC · original · reviewed
Capy found 1 potential issue (1 medium).
View 1 other finding in Capy.
@capy-ai[bot] on GitHub · 2026-11-26 20:14 UTC · original
On
launcher/src/core/RunnerManager.cppline 415 (outdated):Uninstall deletes a runner folder while a game or pre-cache is using it
Medium Severity
RunnerManager::uninstall (launcher/src/core/RunnerManager.cpp:407-428) refuses only while this runner is installing or moving (line 415). It never consults busyReason() or the in-use check that relocate() relies on; that check is wired in Services.cpp:13-21 and covers a running game on this runner (emulator.isActive() && runnerId()==id) and an active pre-cache. RunnersPage.cpp:264 connects the Uninstall button, shown for Installed and UpdateAvailable (RunnersPage.cpp:278), straight to uninstall(m_spec.id) and discards the returned error. So while a game runs on the runner, Uninstall proceeds to QDir(Paths::runnerDir(id)).removeRecursively() on the live runner. Where the running executable is locked (Windows), removal deletes the other files, including runner.json, so the launcher reports NotInstalled while the game keeps running, with no message to the user. Fix: refuse at line 415 when busyReason(id) is non-empty, matching relocate(), and have the Runners page either hide Uninstall while busyReason is set or show the returned error. Verified statically from the code path; the Windows file-locking outcome is reasoned from the Qt call, not run.
@capy-ai[bot] on GitHub · 2026-11-26 20:26 UTC · original · reviewed
Capy found no issues.
View 4 other findings in Capy.
@capy-ai[bot] on GitHub · 2026-11-26 21:04 UTC · original · reviewed
Capy found no issues.
View 4 other findings in Capy.
@capy-ai[bot] on GitHub · 2026-11-26 22:30 UTC · original · reviewed
Capy found no issues.
View 3 other findings in Capy.
@capy-ai[bot] on GitHub · 2026-11-26 22:34 UTC · original · reviewed
Capy found no issues.
View 1 other finding in Capy.