Put back a profile a run that did not close left in RivaTuner Statistics Server, also at a start that keeps RTSS out.

The review found that the worker read rtss-profile.txt only on its first poll with the hooks library, which it loads
only for a limit, so a start with frame generation on, with the driver's low latency on from the first present, or
with NX2NAVI_RTSS=0 never put back a killed run's limit: RTSS then went on limiting the game at that value (counting
the generated frames too under frame generation), and the log and the menu reported it as the player's own limit
beside the game's limiter. rtss_limit.c worker now looks at the state file on its first poll that finds RTSS running
(left_start): a limit puts the profile back with the library it loads anyway, as before; frame generation and low
latency load the library for that one restore (restore_left, which now takes the line found); NX2NAVI_RTSS=0 keeps the
thread read-only and logs that the file holds the game's limit from a run that did not close and that a start with
RTSS let in puts it back. A restore the library could not be loaded for waits for the first poll with the library.
tests/rtss_worker_check.c adds kill_restart_framegen (the next start asks frame generation first: the profile is
removed, no limit written, the line gone) and kill_restart_setting (NX2NAVI_RTSS=0: no library loaded, the profile and
the line stay, the log says so). The rtss_limit.c header, docs/architecture.md, docs/building.md and
nx2navi.ini.example say so, and the ini text no longer says the game alone paces movies under RTSS.

Not reproduced before the change. Checks that passed: tests/rtss_limit_check.py (40 of 40),
pass_cc_check.py --wall on rtss_limit.c, tools/check_content.py --staged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 19:42:54 -05:00
parent ad84e0a1c0
commit a7b4f0c7cb
5 changed files with 99 additions and 35 deletions

View File

@@ -25,14 +25,15 @@
# fps_limit = 60
# Where RivaTuner Statistics Server is installed and running, the limit goes into its profile for the game's
# executable and RTSS does the limiting instead of the game, once RTSS is seen holding the game to it; closing the game
# puts back what the profile held, and after a crash or a kill the next start does (rtss-profile.txt next to the game
# keeps what it held). Changing that profile needs the game run as administrator (RTSS keeps its profiles under Program
# Files). Without it the game limits by itself, as it does with frame generation on (RTSS would count the generated
# frames), while a movie plays or the window is minimised, and for the rest of the run when RTSS's own frame counter
# shows the game past the limit (RTSS then hooks the game without holding it back); with low latency on, the driver
# holds the limit. rtss = 0 always leaves it to the game. With rtss = 0, frame generation or low latency, a limit set in
# RTSS itself (its global profile or the game's, a frame time limit or scanline sync) limits the game a second time:
# the log and the settings menu say so, and setting it to 0 in RTSS leaves one limiter.
# puts back what the profile held, and after a crash or a kill the next start does, unless it has rtss = 0
# (rtss-profile.txt next to the game keeps what it held). Changing that profile needs the game run as administrator
# (RTSS keeps its profiles under Program Files). Without it the game limits by itself, as it does with frame generation
# on (RTSS would count the generated frames), while the window is minimised, and for the rest of the run when RTSS's
# own frame counter shows the game past the limit (RTSS then hooks the game without holding it back); the game paces
# movies itself. With low latency on, the driver holds the limit. rtss = 0 always leaves it to the game. With rtss = 0,
# frame generation or low latency, a limit set in RTSS itself (its global profile or the game's, a frame time limit or
# scanline sync) limits the game a second time: the log and the settings menu say so, and setting it to 0 in RTSS
# leaves one limiter.
# rtss = 1
# 1: asks RTSS's EnumProfiles whether the game's profile exists, instead of looking for its file. EnumProfiles crashes
# the game (RTSS keeps a pointer of the game's in 32 bits); only for testing an RTSS that fixed it.