0.9.13: table corners, Linux program-name suggestion, failed program starts, deterministic screenshots #149

Merged
ethan-hann merged 23 commits from integration-0913 into main 2026-10-25 20:56:54 -05:00
Owner

Rounded corners: a table's header and last row painted over its border at the corners (reported from the app). They now get matching inner radii; a pixel test checks every corner in light and dark.

#147: on Linux, Counter-Strike: Source was given Valve's vpk tool as its program name, so a Steam start was never followed. A program named after the launcher script beside it now wins, scripts rank below programs, Valve's tools and Steam's client binaries are never suggested, and Unity and Unreal Linux builds rank up; checked against the real install's file list (D48.7).

#148: a started program that closes at once with an error keeps the two-minute grace (a Steam game started directly exits with code 1 and Steam starts it again), but the running card says so at once, and if nothing appears the session ends as "The program closed right away" with the code, dated at the program's exit. On Linux the editor notes that games installed by Steam usually need Steam to start them (D13.10). Reviewed twice.

#146: the docs screenshot job lays every screen out fully before drawing and draws each image twice, failing if the two differ, so reruns are byte-identical. Guide images regenerated.

Rounded corners: a table's header and last row painted over its border at the corners (reported from the app). They now get matching inner radii; a pixel test checks every corner in light and dark. #147: on Linux, Counter-Strike: Source was given Valve's vpk tool as its program name, so a Steam start was never followed. A program named after the launcher script beside it now wins, scripts rank below programs, Valve's tools and Steam's client binaries are never suggested, and Unity and Unreal Linux builds rank up; checked against the real install's file list (D48.7). #148: a started program that closes at once with an error keeps the two-minute grace (a Steam game started directly exits with code 1 and Steam starts it again), but the running card says so at once, and if nothing appears the session ends as "The program closed right away" with the code, dated at the program's exit. On Linux the editor notes that games installed by Steam usually need Steam to start them (D13.10). Reviewed twice. #146: the docs screenshot job lays every screen out fully before drawing and draws each image twice, failing if the two differ, so reruns are byte-identical. Guide images regenerated.
The table clips its children to its outer rounded rect, but its 1px stroke
sits inside that curve, so the header's and the selected last row's square
fills covered the stroke at the corners and showed past it. The header now
rounds its top corners and the last row its bottom corners to the inner
curve (the table radius less the stroke), for rows that are direct
children, marked last, or items-control containers. The last row's
separator is dropped by style, so the games table no longer pushes it out
of the clip with a negative margin.

Guard tests render the container, then again with every descendant fill
removed, and compare the pixels from the stroke's outer half outwards at
each corner. Observed reds before the fix:
GamesCornerClippingTests.The_table_keeps_its_header_and_rows_inside_its_rounded_corners
(Dark and Light, first and last row selected): Assert.Empty() Failure,
"top-left corner pixel (5,1) is #1A1E22, it is #232..." (header fill over
the stroke), plus "bottom-left corner pixel (5,1) is #1C2329..." with the
last row selected. Mutation checks: the shelf card test fails with the art
tile's corner radius removed; TableCornerTests fail for all three row
shapes with the bottom radius set to 0. Library shelf cards were already
correct and are now guarded. Docs screenshots regenerated.
On Linux the suggestion for Counter-Strike: Source was bin/vpk, a Valve tool, instead of cstrike_linux64 beside cstrike.sh. A program that shares the start of a launcher script's name in the same folder now gets a large bonus, shell scripts rank below real programs, vpk and steamclient helpers are dropped, .x86_64 builds get a bonus, and Unreal's Binaries/Linux folder and -Linux-Shipping, _linux, _linux64 suffixes are understood.

Observed reds: A_source_game_on_linux_is_the_binary_beside_its_launcher_script_not_a_tool_in_bin (Expected cstrike_linux64, Actual vpk); The_binary_named_after_the_launcher_script_is_the_game for hl2_linux and csgo_linux64 (Actual vpk); Linux_tool_binaries_are_never_the_suggestion (Expected null, Actual steamclient64); A_game_that_is_only_a_script_still_gets_that_script (Actual null); the Rank test (Actual bin/vpk). Mutation check: launcher bonus 0 fails four of the new tests.
With the real sizes the 16 KB cstrike_linux64 stub is smaller than every tool, so without a launcher script bspzip won. Red: Valve_map_and_texture_utilities_are_tools_even_without_a_launcher_script, Expected cstrike_linux64, Actual bspzip. bspzip, vtf2tga and simdtest are now helper names.
On Linux, Valve's cstrike.sh exits within a second with an error when Steam did not start it. The session then waited out the two-minute grace and told the player the program name might be wrong.

The watcher now ends the session with a new ProgramFailedAtStart kind when the started program exits nonzero inside the relaunch window, no configured name was seen, and nothing it started is still alive. Exit code 0 keeps the grace. The after-play dialog and the capture-off toast say the program closed right away with an error, give the code, and suggest Through Steam. Edit game shows a note on Linux when the install folder is in a Steam library and Run the program is chosen.

Observed reds:
- GameSessionWatcherTests.A_program_that_exits_with_an_error_at_once_ends_the_session_without_the_grace: Assert.True() Failure, Expected True, Actual False
- PostPlayDialogViewModelTests.A_program_that_closed_right_away_with_an_error_says_so_...: Expected "The program closed right away", Actual "You played for 2 hours 14 minutes"
- GameEditorLaunchTests.On_Linux_a_Steam_library_game_...: 3 shown:True cases failed against a stub returning false
Mutation check on the watcher condition (dropped the window, exit code 0, and child guards): the exit-code-0, past-window, and child-alive tests failed.
An existing test that exited a stub with code 4 now exits it with 0, since a nonzero stub exit is the new fast end.
The job now draws every image a second time and fails if any bytes differ. Observed red: Redraws_every_image_in_docs_images failed with "These images differ between two passes in one run: before-playing.png" (other runs: after-play.png, first-snapshot.png).

The cause was not the text caret or an animation: renders of an unchanged screen are stable within one settled window, but the anti-aliased rounded corners of dialogs and cards came out one level different depending on the order layout passes had run in. Draw now invalidates measure on every control and lays out from the root before capturing, which makes the result canonical.

Five images change by a few corner pixels (max channel delta 5): activity, add-game, after-play, before-playing, first-snapshot. Reruns are byte-identical.
# Conflicts:
#	docs/images/after-play.png
#	docs/images/before-playing.png
Steam games call SteamAPI_RestartAppIfNecessary and exit with code 1 at once, then Steam starts them again, sometimes 30-60 s later. Ending the session at the exit would cut off that relaunch, so the grace is kept for every exit code.

A nonzero exit inside the relaunch window now only sets EarlyExitCode on the watcher (cleared when the game or a followed child shows up). The orchestrator carries it on SessionState.Running, and the running card says the program closed right away with the exit code while SavePoint keeps watching; "I'm done playing" stays. If the grace runs out with nothing seen, the session ends as ProgramFailedAtStart with the code instead of NamedProcessNeverAppeared.

Observed reds:
- GameSessionWatcherTests.A_program_that_exits_with_an_error_at_once_and_is_never_followed_...: Assert.False() Failure on IsSettled before the grace, Expected False, Actual True
- ..._Steam_to_start_it_again_and_exits_with_one_is_followed_to_the_new_copy: Assert.False() Failure, Expected False, Actual True
- ..._early_exit_code_shows_during_the_wait_...: Expected 127, Actual null (stub)
- LaunchFlowSessionTests.A_program_that_closed_right_away_is_said_on_the_running_card_...: Assert.Same failure, a new card was built
Marking_finished_while_the_stub_is_being_followed is back to exit code 4.
ProgramFailedAtStart is now dated at the program's exit, so the wait for a restart is not play time. NamedProcessNeverAppeared keeps including the wait on purpose (its outcome doc says so, and its dialog shows no play time). The end kind doc now says the grace is kept.

Adds an orchestrator test with the real FakeGame (--exit-code 127): Running carries the code, then Exited is ProgramFailedAtStart with the code. Adds a test that changing the install folder or start method raises PropertyChanged for the Linux Steam note. The running card now reads "an error (code N)" like the dialog and toast.

Observed reds:
- GameSessionWatcherTests.A_program_that_exits_with_an_error_at_once_...: Expected 00:00:01, Actual 00:00:31 (PlayDuration)
- Orchestrator test and the PropertyChanged test passed on first run; mutation checks (Running state without the code; Folders notify removed) made each fail, then restored.
Version 0.9.13
Some checks failed
Docs / site (pull_request) Successful in 1m19s
Gate / linux (pull_request) Successful in 14m26s
Gate / windows (pull_request) Has been cancelled
d6009ab3e2
Steam or a launcher can take the focus as a game quits, hiding the after-play dialog. When the dialog opens while the window is not in front (or is minimized), SessionAttention flashes the taskbar button (FlashWindowEx, Windows only, never activates the window) and posts a desktop notification naming the game. Linux and macOS rely on the notification, since Avalonia exposes no urgency hint. The launch flow reports through ISessionAttention, filled in by HostIntegration once the window exists.

Observed reds: SessionAttentionTests.A_window_behind_another_one_flashes_and_posts_a_notification_naming_the_game (Expected: 1, Actual: 0), SessionAttentionTests.A_minimized_window_that_still_reports_active_is_called_back_too (Expected: 1, Actual: 0), LaunchFlowSessionTests.The_player_is_called_back_as_the_after_play_dialog_opens (Expected: [Skyrim Special Edition], Actual: []). Mutation check on the in-front guard failed A_window_in_front_of_the_player_is_left_alone as expected.
On Linux a process whose parent exits is handed to init or a subreaper, so a
starter that started the game and exited within one look left no parent link
and the game was not followed. When the starter is gone, the session now links
a process to it without the parent id when the process started within the
relaunch window after the starter, its program lies in the game's folder, it
is not a known crash reporter, and it was not started by another process of
the session. Exactly one such process is followed; two or more are followed by
none and the outcome names them (AmbiguousHandoverPids), which the session log
reports. The first answer stands for the session. The grace, the rule that a
followed process never counts as the name being seen, and the rule that a link
start follows nothing are unchanged. Windows keeps the parent id and is not
affected.

Observed reds:
- GameSessionHandoverTests.A_lone_game_process_in_the_folder_... : Assert.False
  (IsSettled) expected False, was True (the session ended at the grace).
- GameSessionHandoverTests.Two_such_processes_...: AmbiguousHandoverPids
  expected [600, 601], was [].
- RealSessionTests.A_starter_named_in_the_definition_that_hands_over_... on
  Linux (WSL Ubuntu) with the starter no longer lingering and the linking
  switched off: expected NamedProcessEnded, was ChildExited. Green with it on.
Mutation checks: dropping the window, start floor, helper, folder, parent and
Linux-only clauses each failed the test written for it.
On Linux Steam keeps a reaper process per game, with SteamLaunch AppId=<id> on
its command line, from the moment it begins starting the game until the game
has ended. Checked on the Linux test VM: Counter-Strike: Source (native) shows
the reaper at once, cstrike.sh about 1.6 s later and cstrike_linux64 at 2.1 s;
Balatro (Proton) shows one reaper for the first-run script (gone at 5.7 s),
another from 6.2 s, wine at 7.2 s and Balatro.exe at 9.8 s, with a gap of
about half a second between the two reapers. In both the helper outlives
nothing and stays until the game exits.

A link start with a process name now counts its grace from the last look that
found the helper for that app id, so a slow bootstrap no longer ends the
session early. The helper is matched by exact app id (240 is not 2400). The
rule applies only to a Steam run or rungameid link on Linux; Windows (no
reaper), macOS, other stores and program starts are unchanged, and a quit game
still ends the session at once. The Linux inspector now keeps the whole command
line for that one helper (RunningProcess.CommandLine, null elsewhere).

Observed reds:
- GameSessionLauncherWaitTests.The_grace_does_not_run_while_...: Assert.False
  (IsSettled) expected False, was True; same for A_gap_between_two_launcher_...
- GameStarterTests.On_Linux_a_Steam_link_waits_while_...: IsSettled expected
  False, was True.
- SteamLaunchTests (app id and helper cases): expected 240, was null; expected
  True, was False.
- ProcessInspectorTests.Linux_reads_the_whole_command_line_of_Steams_reaper...:
  expected the joined line, was null.
Mutation checks: dropping the program-start guard, the Linux guard and the id
boundary each failed the test written for it.
The helper list was compared with the process name, which on Linux is the
kernel name cut to 15 characters, so crashpad_handle and CrashReportClie never
matched. A double-forking handler then became an orphan candidate and made the
match ambiguous, or held a session as the single candidate. A process now
matches by the file name of its program when known, else by a 15-character name
that begins a listed helper. The same check guards children of a followed
process.

Also, when the starter's start time was never seen, a process must have begun at
or after the session's start to be linked without a parent id, so a server or
second copy started just before is left alone.

Observed reds: GameSessionChildTests.A_crash_reporter_listed_by_its_truncated_
kernel_name_is_not_followed (3 cases) timed out waiting for NamedProcessNever-
Appeared because the reporter's child was followed; GameSessionHandoverTests
.A_crash_reporter_listed_by_its_truncated_kernel_name_... expected followed [600]
with no ambiguity, got an ambiguous match; ..._started_just_before_the_session_
... timed out because the process was linked.
Record the Linux starter link and the Steam launch helper wait in D13.10
Some checks failed
Docs / site (pull_request) Successful in 1m24s
Gate / linux (pull_request) Successful in 14m28s
Gate / windows (pull_request) Successful in 39m4s
Gate / windows (push) Has been cancelled
Gate / linux (push) Has been cancelled
Release / linux (push) Successful in 2m38s
Release / windows (push) Successful in 3m9s
Release / checksums (push) Successful in 32s
Docs / site (push) Successful in 1m29s
a9239fc662
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!149
No description provided.