0.9.12: Windows pack id SavePoint, starter following, index check, icon polish, dialog padding, generated screenshots #144

Merged
ethan-hann merged 32 commits from integration-0912 into main 2026-10-25 19:07:51 -05:00
Owner

Windows is packed as SavePoint, ending the staged switch D38 describes (0.9.11 moved the data out of the folder a SavePoint setup empties).

#56: a short-lived starter that hands over to the real game inside the game's folder (Eve Online's eve.exe and exefile.exe) is followed until that process exits; the grace is unchanged, link starts follow nothing new, store clients, launchers and browsers outside the folder are never followed (D13.10). Reviewed in four rounds. #63: a test pins the default two-minute grace.

#140: the skip-worktree check reads the index file (versions 2 to 4) instead of a header test that never fired, falling back to git on anything it cannot be sure of (D41.11).

#20: Windows windows use the .ico, small icon frames use the filled glyph, and the in-app mark is one control centered by its ink.

Still to come on this branch: the dialog button padding fix with a guard test, and the screenshot job that regenerates docs/images.

Windows is packed as SavePoint, ending the staged switch D38 describes (0.9.11 moved the data out of the folder a SavePoint setup empties). #56: a short-lived starter that hands over to the real game inside the game's folder (Eve Online's eve.exe and exefile.exe) is followed until that process exits; the grace is unchanged, link starts follow nothing new, store clients, launchers and browsers outside the folder are never followed (D13.10). Reviewed in four rounds. #63: a test pins the default two-minute grace. #140: the skip-worktree check reads the index file (versions 2 to 4) instead of a header test that never fired, falling back to git on anything it cannot be sure of (D41.11). #20: Windows windows use the .ico, small icon frames use the filled glyph, and the in-app mark is one control centered by its ink. Still to come on this branch: the dialog button padding fix with a guard test, and the screenshot job that regenerates docs/images.
Every watcher test injected its own grace, so a change of GameSessionOptions.DefaultGrace back to a short value passed the suite. A link with a process name that never appears and default options now settles at exactly two minutes and not at one second less.

The test passed on its first run. Mutation check: DefaultGrace set to 30 seconds made With_the_default_timings_a_name_that_never_appears_settles_at_two_minutes_and_not_before fail on Assert.False(rig.Watcher.IsSettled) (Expected: False, Actual: True), as did the existing default-timings test; restored.
Some games ship a small starter in the install folder that starts the real game (a different, deeper program) and exits; the process-name suggestion picks the starter, so the session ended when it left. The watcher now keeps the session open while a process the started program (or a game matched by name) started, directly or through others, is still running, and ends it when the last one exits, whatever it is called.

RunningProcess gains ParentPid and StartedAt. Windows reads parents from a Toolhelp32 snapshot and start times from GetProcessTimes; Linux reads fields 4 and 22 of /proc/<pid>/stat plus btime; macOS reports neither, so its behavior is unchanged. A parent id outlives its parent and can be reused, so ProcessFamily accepts a process as a child only when it started no earlier than the parent it names, and not when another process now holds that id and the candidate began after it. The grace for a program that never appears is untouched.

Observed reds before the change:
- GameSessionChildTests.A_child_still_running_after_the_started_program_exits_keeps_the_session_open_until_it_exits: Assert.False(IsSettled) Expected False, Actual True (also the grandchild, seen-while-alive, reused-id child, and no-grace-while-following cases).
- ProcessInspectorTests.Linux_reads_the_parent_and_the_start_time_from_the_stat_line_after_the_last_bracket: Expected 42, Actual null (also the boot-time-less ordering test and the real child test).
- RealSessionTests.A_starter_named_in_the_definition_...: Expected NamedProcessEnded, Actual ChildExited (by mutating the follow off; the test passed on first run).

Mutation checks for tests that passed on first run: dropping the start-time lower bound, the reused-id guard, observing a child before the starter left, and a wrong parent default each made the matching test fail; restored.
Windows windows now load the multi-size .ico, so the title bar and taskbar
pick the frame that fits instead of shrinking the 256 px PNG; other
platforms keep the PNG. One AppIcon helper serves the main, crash and
already-running windows.

IconGen draws the 16, 24 and 32 px frames with the filled bookmark glyph,
where the outline's strokes are about a pixel wide and blur. The renderer
moves out of Program into IconRenderer so a test can reach it, and the
icon files are regenerated (only the .ico changes).

The shell and startup marks are a BrandMark control that draws the glyph
outline centered on its ink bounds. Centering by the em box left the glyph
about 1.7 px low in the 24 px mark.

Observed reds:
- BrandMarkTests.The_glyph_is_centered_by_its_ink... (24/16): "The glyph's
  ink is centered 13.73 px down a 24 px mark." (also 48/32: 26.42 px)
- AppIconTests.Frames_up_to_32_px_use_the_filled_glyph: Expected True,
  Actual False; The_small_ico_frames_are_drawn_with_the_filled_glyph: "The
  24px frame looks like the outline glyph, not the filled one."
- Platform.AppIconTests.Windows_windows_use_the_multi_size_ico: Expected end
  "/Assets/Icon/savepoint.ico".
Every install has moved its data out of %LOCALAPPDATA%\SavePoint by now, so
the temporary SavepointWindowsPackId is removed and SavepointPackId names the
app on both platforms. package.ps1 reads it and no longer renames the
downloads, since vpk already names them SavePoint-*. PackageLocationTests
pins the single id and that no data folder lies inside either
%LOCALAPPDATA%\SavePoint or %LOCALAPPDATA%\SavePointApp, and the platform
keeps refusing storage inside the SavePointApp folder older setups used.

Ship this only in the release after the one that carries the data move.
ClearSkipWorktreeAsync skipped its ls-files call only when the index header
said version 2, but repositories are created with index.version 4, so the
shortcut never fired and every switch, discard and save ran the listing.

IndexMarkScan now reads the index file itself: it walks every entry
(versions 2 to 4, including version 4 prefix-compressed names), checks the
extended flags for skip-worktree, and verifies the file's checksum. It
answers "none" only after reading the whole file; an unknown version or
extension (split or sparse index), a short or damaged file, a checksum
mismatch, or an unreadable file all fall back to the git listing.

Measured on 50,000 entries (3.6 MB version 4 index): git ls-files -t about
65-75 ms, the scan about 35 ms; on 2,000 entries the scan is about 2 ms.

Observed reds before the change (LeftOutReadOnceTests):
- A_save_into_a_version_4_index_without_marks_does_not_list_them:
  Assert.DoesNotContain() Failure: Filter matched in collection
- A_switch_without_left_out_files_never_asks_git_for_marks: same failure
- A_switch_that_marks_files_asks_git_once_for_marks_after_it_verified:
  Assert.Equal() Failure, Expected: 1, Actual: 2 (the start-of-switch
  listing no longer hidden by the old version 2 setup)
Mutation checks: ignoring the skip-worktree bit and matching "lonk" for the
split-index extension each failed the new tests; both restored.
BrandMark and its glyph are now decorative for assistive technology, and the
corner radius follows Width and Height however they are set, not only
through Size. New tests pin a live theme and accent switch of the square's
fill, and that every committed icon frame and PNG equals what IconGen draws
now, so drift between the tool and the files fails.

Observed reds:
- BrandMarkTests.The_mark_and_its_glyph_are_decorative_for_assistive_technology:
  Expected Raw, Actual Default.
- BrandMarkTests.The_corners_stay_a_quarter_of_the_side_when_the_size_changes_directly:
  Expected 10,10,10,10, Actual 6,6,6,6.
Passed on first run, then mutation-checked: the theme switch test fails
with a fixed red fill (Expected 4281426573, Actual 4294901760); the drift
tests fail for the 32 px frame when FilledUpTo is lowered to 24.
Following every surviving descendant held sessions open for Steam after a cold start, game launchers, browsers and crash reporters. Following now applies only to the started program's own tree, only when that program exited within the relaunch window, stops once another process has matched the configured name, and skips known helper programs and what they start. A link start follows nothing but the named process.

IsRunning now re-reads the process list and counts a followed child, so a new launch is not allowed over a game that is still running after the player ended the session. A starter that was never listed uses the session start less two seconds as the earliest start of its children, so a stale parent id from an older process is ignored.

Observed reds before the change:
- A_game_that_quits_to_be_started_again_by_a_store_it_started_ends_at_the_new_copys_exit_not_the_stores, A_program_that_ran_a_while_and_exits_ends_the_session_even_though_something_it_started_lives_on, A_link_session_does_not_follow_what_the_named_game_started, A_known_helper_the_started_program_started_is_not_followed (four names), A_stale_parent_id_pointing_at_a_starter_that_was_never_listed...: the outcome never arrived (TimeoutException after 10 s, the session stayed open).
- A_followed_child_still_counts_as_running_after_the_player_says_they_are_done: Assert.True(IsRunning()) Expected True, Actual False.

Mutation check for the test that passed on first run (A_child_newer_than_the_session_is_followed_when_the_starter_was_never_listed): raising the floor by an hour made it fail; restored.
The scan could not tell a SHA-256 repository (32-byte object ids misalign the
walk), accepted an all-zero trailer as a valid checksum (index.skipHash, or a
zero-filled tail), did not check names, and skipped only a fixed list of
extensions.

- Fall back unless the repository config shows SHA-1 (or cannot be read).
- Never accept a zero trailer; only a matching SHA-1 counts.
- Check each name against the 12-bit length in the flags (4095 means 4095 or
  more), reject empty names, and for version 4 decode the strip count and
  check it against the previous name.
- Fall back on any extension whose signature does not start with A to Z, as
  git does for required extensions; the link/sdir list is gone.
- Tests use real split and sparse indexes made by git, a real sha256
  repository with and without index.skipHash, a zero-filled tail at many
  offsets, 4095+ byte names in versions 2 to 4, and damaged entries with the
  checksum recomputed.

Observed reds before the change (IndexMarkScanTests): zero_filled_tail
(versions 2 and 4), extension_git_requires_and_this_reader_does_not_know,
index_written_without_a_checksum: Assert.True() Failure, Expected True,
Actual False. The sha256 and 4095-byte-name tests passed on first run.
Mutations: name-length check made always true failed the damaged-entry tests
(versions 2 and 4); the extension rule made inert failed the required-extension
test. Making the object-format check always pass fails no test, since the
checksum mismatch already catches a SHA-256 index; it stays as a guard.
A followed child no longer marks the configured name as seen, so a short-lived helper that exits before the store starts the game does not end the session early; the grace runs from the starter's exit as before. When the grace ends with a followed child alive the session stays open and ends when the last one exits.

A descendant is followed only when its program lies inside the game's install folder (compared ignoring case on Windows, after resolving links); one with no readable path is not. The helper list shrinks to crash reporters that live in game folders, and the generic "launcher" entry is gone. The watcher takes the folder as a constructor argument; GameStarter passes the install folder. The real-process test now has the spawned child live in the game folder.

Observed reds before the change: A_short_lived_helper_that_exits_before_the_named_game_appears_does_not_end_the_session_early (Assert.False(IsSettled) Expected False, Actual True); A_game_named_Launcher_in_the_game_folder_is_followed... (same assertion); and these timed out after 10 s with the session held open: A_child_outside_the_game_folder_is_not_followed..., A_folder_with_a_similar_prefix_is_not_the_game_folder, A_child_whose_program_cannot_be_read_is_not_followed, A_crash_reporter_in_the_game_folder_is_not_followed(crashpad_handler).

Mutation check for the crash reporter cases that passed on first run (CrashReportClient, UnityCrashHandler64, WerFault): disabling the helper filter made all four cases fail; restored.
A session held past the grace by a followed child now keeps its previous answer when the process list cannot be read, treats a follower whose start time or program fails to read once as still running when both matched before, and ends only after two looks without a follower, dated at the first. The starter's own start is the floor for its children when known; when it is not, the floor is ten seconds before the session start so boot-time rounding cannot hide a real child.

Observed reds before the change (Assert.False(IsSettled), Expected False, Actual True): A_process_list_that_cannot_be_read_does_not_end_a_session_held_past_the_grace, One_look_that_cannot_read_the_childs_details_..., One_look_without_the_child_followed_by_its_return_..., A_session_held_past_the_grace_ends_after_two_looks_without_the_child_at_the_time_of_the_first, and A_child_a_few_seconds_older_than_the_session_by_clock_drift_... (observed by restoring the two second floor; the floor test otherwise passed first run).
Record the starter-following rule in D13 and the index check in D41
Some checks failed
Docs / site (pull_request) Successful in 1m19s
Gate / linux (pull_request) Failing after 11m45s
Gate / windows (pull_request) Has been cancelled
9970754d3b
D13.10 now says when SavePoint follows the processes a short-lived starter hands over to (only inside the game's folder, the grace unchanged, held past it while one lives); D41.11 says how marks are found without asking git when the index holds none.
The pictures in docs/images were taken by hand from an old build. A test
class now draws each of them headlessly from the real views and view models
over the fake backend: Grounded with Vanilla 1.4 and Modded profiles, five
snapshots, a Recently removed entry, an Activity list with a running job, and
a finished session's choices. Light theme, Blue accent, 1280x800, a fixed
clock and reduced motion, so two runs write byte-identical files.

The job runs only with SAVEPOINT_DOC_SCREENSHOTS=1 and is listed as an
expected skip on Linux CI and Windows. An always-on test checks that every
image the user guide and README reference exists and has a generator, and
that no generator is unused.

Observed red: DocScreenshotCoverageTests.The_screenshot_job_draws_every_image_the_guides_show
failed with Assert.Empty, collection ["activity.png", "add-game.png",
"after-play.png", "before-playing.png", "first-run.png", ...], before the job
named any image. The other three coverage tests passed first time; a mutation
(user-guide link renamed to settingz.png) made the exists, draws-every and
draws-only tests fail, then it was restored.
A dialog's footer buttons had 26px to the edge but their 4px focus ring reached into the last 22px, and the scrolling viewers that clip a dialog's content left only 2px between the ring and the clip. On a full dialog (the running first snapshot) the buttons read as sitting on the edge and the ring on Cancel looked cut off.

The dialog padding is now 30px (26px of air plus the ring), and the host and the pinned-footer frame take their ring room from shared tokens (Md3DialogRingRoom, Md3DialogRingOutset, Md3DialogBodyRingOutset, 8px) instead of two copies of a literal 6.

New guard DialogFooterClearanceTests renders every dialog state (the existing dialog states plus the running and finished first snapshot with long file names, plain, typed-word and long-text confirmations, close during snapshot, launch checks) at 1040x660, 800x560 and the two scaled-screen sizes. It measures each button's focus ring (read from the button template) against the dialog edge (needs 26px) and the scrolling viewer (needs 4px).

Observed red before the change: 116 of 120 cases failed with assertion messages such as "CancelButton ring is 22px from the dialog's bottom edge, needs 26px" and "ring has 2px inside the scrolling viewer's bottom edge, needs 4px" (bottom 22px in 408 findings, right 22px in 232, left 22px in 32, 23px bottom on the first-run template picker). 4 cases did not fail. After: 120 of 120 pass.
The doc images showed the pre-0.9.11 storage folder, so the seed now uses
the Windows default (SavePoint Data\Storage). The job drops keyboard focus
before every picture so no focus ring is drawn.

Activity details for a new profile's first snapshot read 'Taking snapshot
"Vanilla 1.4" of "Vanilla 1.4"' because the snapshot is named after its
profile. That case now writes a step of its own: 'Taking the first snapshot
of "Vanilla 1.4".'. The fake backend mirrors it.

Observed reds: CaptureLinesTests.Creating_a_profile_writes_the_same_steps_with_the_new_profiles_name
(Expected activity.step.capture.startFirst {profile=Modded 1.6}, Actual
activity.step.capture.start {profile=Modded 1.6, snapshot=Modded 1.6});
JobLineFormatterTests.A_step_is_said_in_the_catalogs_words_with_its_arguments
(Expected 'Taking the first snapshot of "Vanilla 1.4".', Actual 'Something
happened that this version of SavePoint ...') and
Every_step_core_writes_has_a_sample_here_and_a_message_that_says_something.
DialogFrame is a content control, and those clip to their bounds. The frame's bottom and right edge are the footer's, so the ring of a button in the footer (drawn 4px outside the button) was cut flat at the button's own edge, bottom and right. The frame now sets ClipToBounds to false; its body scroll viewer still clips its own content.

The earlier geometry guard could not see this, so DialogFooterClearanceTests gains a pixel test: with each footer button focused by keyboard it requires the theme's focus ring color on screen just outside the middle of all four sides, at 1040x660 and 800x560, in dark for every dialog state and in light for the added states.

Observed red before the change: 17 cases failed, for example "CancelButton at 1040x660: ring missing on the bottom (#ff272a2f at 652,613, ring #ff9dcbfb)" and "ContinueButton ... ring missing on the right"; failing states were launch-dialog (+unsaved, saving), games-new-profile-wizard, wizard running and saved (dark and light), post-play (three states), library picker (two), library confirm, library add, clear all and first-run templates. Confirmations, close-during-snapshot, editor consent and reconnect, and launch progress already drew full rings. After: all 157 cases of the class pass.
Version 0.9.12
Some checks failed
Docs / site (pull_request) Successful in 1m24s
Gate / linux (pull_request) Has been cancelled
Gate / windows (pull_request) Has been cancelled
d3de62c527
Record the checked Windows upgrade path in D38
Some checks failed
Docs / site (pull_request) Successful in 1m28s
Gate / linux (pull_request) Failing after 13m33s
Gate / windows (pull_request) Has been cancelled
1533e6e9eb
RealSessionTests.A_starter_named_in_the_definition_that_hands_over_to_a_process_it_started_is_followed_until_that_process_leaves
failed on Linux with 'Expected NamedProcessEnded, Actual ChildExited'. Linux gives an orphan to
another parent as soon as its parent exits, and the stub left within one poll, so the process
list never showed the game under it. FakeGame gets --linger <ms> (the stub stays up after
spawning) and the test uses it.

Red observed: FakeGameTests.Spawn_with_linger_stays_up_beside_the_child_before_it_leaves failed
with 'the ready file ... child-ready.txt never appeared' (unknown --linger exits with code 2).
Linux red before the fix: the RealSessionTests assertion above, in WSL Ubuntu.
Each_committed_png_is_what_the_generator_draws (256, 512, 1024) and
Each_committed_ico_frame_is_what_the_generator_draws (24 to 256) failed on Linux because Skia
anti-aliases edges slightly differently there (mean channel step up to 0.053, no pixel off by
more than a tenth of the range). The check now fails when more than 0.05 percent of the pixels
are off by more than 24 per channel or the mean channel step exceeds 0.2.

Mutation check: FilledUpTo 32 -> 24 makes the 32 px frame use the outline glyph; the 32 px
frame test fails with '9.473% of the pixels differ strongly and the mean channel step is 9.324'.
Restored; the class passes on Windows and under WSL Ubuntu.
Say in D13 that Linux follows only a starter seen beside its game, and document --linger
All checks were successful
Docs / site (pull_request) Successful in 1m23s
Gate / linux (pull_request) Successful in 14m14s
Gate / windows (pull_request) Successful in 34m9s
Docs / site (push) Successful in 1m40s
Release / linux (push) Successful in 2m33s
Gate / linux (push) Successful in 15m1s
Gate / windows (push) Successful in 33m49s
Release / windows (push) Successful in 2m51s
Release / checksums (push) Successful in 33s
5120a4e1f0
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint!144
No description provided.