fix(home): each build's size is what it holds of its own, and the footer says what builds share #210
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!210
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/LongshotLauncher:fix/honest-build-sizes"
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?
Type: fix · Risk: low · Tested on: Windows 11 Home (26200), .NET SDK 10.0.404: the core checks (on base
4e85759: the same Windows-only failures as main, below),dotnet buildof the solution with warnings as errors, the screenshots tool; no launcher run against real builds · Needs: a look from someone with two builds that share their game files; the shader store side waits for the game's store PRTL;DR
The home made two builds look like two full copies of the game. With Nightly 486 and v3.0.0 installed, the rows said 36.6 GB and 36.0 GB (72 GB together). But the two share their 24.4 GB of game files by hard links (Longshot MagicBeanDev/Longshot#360, launcher #58), so they really take 48.2 GB. Now each row shows what the build holds of its own (12.2 GB, 11.6 GB), and the footer keeps the real total and says what the builds share:
The launcher also learns about the shared SPIR-V shader store the game is getting: the footer counts it once, and Free up space clears it along with every version's shader caches. And a build whose .nup was moved to another folder now still shares its game files. Related to Longshot MagicBeanDev/Longshot#1759 (cache reuse across instances).
Screenshots
Same two builds, measured as on a real PC (
tools/screenshots, sceneshome-shared-sizesandhome-shared-store; the "before" is the same scene on main):With the shader store (3.5 GB), and Free up space with it (scene
free-space-store):What changed
Sizes on the home (
Core/Disk.cs,App/ViewModels/HomeViewModel.cs)Disk.Own(entry): what a build holds of its own. That'sBuildEntry.Frees(its files with no hard link outside its folder), or its folder's bytes when Frees isn't known. The row shows it. The Delete dialog already used the same number (Freed), so the row and Delete frees … now agree.Disk.InstancesUse(...): the footer. The total is unchanged (Counted, each file once), plus the shader store. What they share is the total minus the sum of the rows' own sizes. It's only said when it's more than 0:builds.jsonwith Bytes but no Counted/Frees says nothing about sharing, as before.App/Views/HomeView.axaml: the footer's TextBlock wraps instead of being cut with an ellipsis (TextWrapping="Wrap"in place ofTextTrimming). The longer line was cut at "24.4 GB …" at the window's normal size. This is the one layout change: no new element, button or row. It still takes one line when the text fits. Jordan: say if you'd rather keep it to one line; the alternatives are a shorter sentence or the share in a tooltip.The shader store (
Core/Saves.cs,Core/ShaderCaches.cs,App/LauncherService.cs,App/ViewModels/SettingsViewModel.cs)SaveEnvironment.ShaderStoreis where the game keeps it. That'sLONGSHOT_SHADER_STOREwhen set, else%LOCALAPPDATA%\Longshot\shaderson Windows and${XDG_CACHE_HOME:-~/.cache}/longshot/shaderson Linux. It's the PC's store even for a portable launcher, since the game doesn't take it from--user. It reads the switch exactly as the game does (gpu/vk/spirv_pack.h'sdefault_dir):LONGSHOT_SHADER_STORE=0(and, on Windows, noLOCALAPPDATA) means no store, so nothing is counted or cleared, and anXDG_CACHE_HOMEthat isn't a full path is ignored.ShaderCaches.StoreFiles/StoreBytes/ClearStorecoverspirv.pack,spirv.idx,spirv.lockand what a write leaves beside them (spirv.pack.<anything>). They never touch anything else in the folder, becauseLONGSHOT_SHADER_STOREmay name one that holds other things. The folder itself goes only once it is empty. Nothing is cleared while Longshot runs (the same check asShaderCaches.Clear).LauncherService.MeasureShaderStore).ColdBuildandDeleteGameare unchanged, and the store's names aren'tShaderCaches.IsCachenames (checked).Game files shared from a moved .nup (
Core/BuildRegistry.cs, its own commit)SameGameFilesused to offer a donor build only when its recorded .nup path was the new build's. Why the path was required: I found no reason in #58 or its history. make_game'sromfs_from_buildcompares the donor's.longshot_romfsstamp alone (the .nup's file name and size), and the launcher already checks that stamp (Unpacked). So the path check only missed shares: a .nup moved or copied to another folder, or a build listed again without itsNuprecord, made the next build unpack about 25 GB again. The check is now the stamp, as the builder's is. The order is unchanged: same drive first, then the newest. The safety is the same as before, since the builder's check is the gate either way.Translations: the three footer sentences are in all 12 catalogs, placed after
"{0} instances use {1} in {2}.". These are my translations and want a native speaker's look. The three Free up space texts are left out, like the texts beside them, which no catalog has yet.scripts/translations.py: no broken placeholders or plural forms.How it was tested
Run by an AI agent (Claude Opus 5.5) working for me. Windows 11 Home 10.0.26200, .NET SDK 10.0.404, base
4e85759(rebased 2026-11-20 after #211, #213, #215 and #216).tests/launcher_core):ScreenChecks.InstancesUseChecks: the row size and every footer sentence, with the real PC's numbers (36.6/12.2 and 36.0/11.6 GB give 48.2 GB and 24.4 GB shared), the store, one build, an unmeasured build, and an oldbuilds.json.ShaderCacheChecks.ShaderStoreChecks: the store's path on both systems and withLONGSHOT_SHADER_STORE; no store withLONGSHOT_SHADER_STORE=0or noLOCALAPPDATAon Windows (never a folder named0); a relativeXDG_CACHE_HOMEignored; its size; clearing it (refused while Longshot runs; only its files, the player's files in the folder stay; the folder goes when that empties it); the store's names are no build cache's; Free up space's option and hint.RegistryChecks: a moved .nup still shares, so does a build with noNuprecord, and a .nup of the same name and another size shares nothing.InstanceFolderChecks' footer source check now readsCore/Disk.cs.python -I tests/test_launcher_core.py, on this branch and on main4e85759side by side, each check group run on past a failure (a local wrapper, not committed): the same 8 groups fail on both, each with the same message, all Windows-only (InstallChecks' shortcut on the Unicode scratch path,UnlistedChecks,OtherLauncherChecks,SavesChecks,SaveBackupsChecks,HookshotChecks' Linux paths,NfcChecks,ScreenChecks' dump folder). Every group this PR adds to passes:RegistryChecks,InstanceFolderChecks,ShaderCacheChecksandDiskChecks(InstancesUseChecks). CI on Linux runs them all.dotnet build LongshotLauncher.slnx -warnaserror: no warnings.tools/screenshots.Measurements: the home measures the store each time it's shown: one listing of one folder, off the window's thread. The build folders' measuring (
Disk.Measure) is unchanged. Nothing in the build or the game changes.Not tested:
720c6988: its store isspirv.pack/spirv.idx/spirv.lock, a store made again is written as<name>.newand renamed into place (covered by<name>.<anything>),0means none, and its delete contract (the three files together, never while a game has them open) is whatClearStoredoes.Needs: a launcher run with two builds of one .nup (the footer's text), and, once the game's store lands, Free up space with the store ticked.
Notes
spirv.pack/.idx/.lockin that folder, withLONGSHOT_SHADER_STOREto move it. If that layout changes before it merges,ShaderCaches.StoreNamesandSaveEnvironment.ShaderStorechange with it. Longshot MagicBeanDev/Longshot#737 is a different shared-store design and doesn't use these paths.TextWrappinginApp/Views/HomeView.axamland the footer source check intests/launcher_core/InstanceFolderChecks.cs. #202 keepsMetaandFooteras they are, so they carry over.🤖 Generated with Claude Code
Screenshots from
tools/screenshots(Windows, 960x600): the home before (main) and after with two builds sharing their game files, the home with the shader store, and Free up space with and without the store.Looks great! Let's get this rebased and merged
b315ef27c8ccf7067c9eNew commits pushed, approval review dismissed automatically according to repository settings
@HumanBean thanks. Rebased onto main
4e85759(after #211, #213, #215 and #216). Head is now408c11f.Core/Saves.cs. #211'sLinuxUserFiles/LongshotUserand this PR'sShaderStorewere added at the same spot, so I kept both. Nothing else needed changing.408c11f: I checked the launcher's store path against the game's store PR (Longshot #1809, head720c6988). The game takesLONGSHOT_SHADER_STORE=0to mean no store, but the launcher read it as a folder named0in its own working folder.ShaderStorenow reads the switch exactly as the game does:0(or, on Windows, noLOCALAPPDATA) means no store, so nothing is counted or cleared, and anXDG_CACHE_HOMEthat isn't a full path is ignored. Checks added inShaderStoreChecks.<name>.newand rename it into place, andStoreFilesalready covers those. Its cleanup contract (the three files deleted together, never while a game has them open) is whatClearStoredoes.dotnet build -warnaserroris clean. In the core suite, with each check group run on past a failure, this branch and main fail the same 8 Windows-only groups with the same messages. Every group this PR touches passes.Taking it out of WIP, as you asked to merge it. The footer wrapping is still Jordan's call (in the description).
WIP: fix(home): each build's size is what it holds of its own, and the footer says what builds shareto fix(home): each build's size is what it holds of its own, and the footer says what builds share