mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 16:49:58 -04:00
Give up on RivaTuner Statistics Server for the run when it hooks the game with the limit for 30 s and never shows it holds it.
The review found that nothing ended an RTSS hold that was never proven: when RTSS listed the game with the limit in its profile but one sign never came (presents of another API value than Vulkan's, the update flag never cleared, a period that never moved), the profile kept the limit and the game's pacer held the frames too for the whole run, two limiters where the pacing rules allow one, with only a reason line in the log and nothing in the menu. Before the hold had to be proven, RTSS alone held the game once it listed it. rtss_decide.h rtss_decide now counts the polls in a row where RTSS lists the game, the profile holds a limit of this run (not "none"), a picture went out within 200 ms and the hold is not shown; at RTSS_UNPROVEN_POLLS (60, 30 s) it puts the profile back and RTSS is out for the run (RTSS_FAIL_UNPROVEN, "RivaTuner Statistics Server never showed it holds the game"). A minimised window, RTSS not hooked, a want of no limit, a kept-out want or a poll that shows the hold start the count again. rtss_limit.c logs the give-up, rtss_limit_state returns 3 for it, so the menu says RivaTuner does not limit the game and the game does, and rtss_out_of_limit counts it, so a limit set in RTSS itself is reported as a second limiter. The comment above rtss_decide, rewritten for the rule, is wrapped at 120 columns and no longer cites rtss_fresh, which does not exist. tests/rtss_limit_check.c checks each sign that never comes (given up at the 60th poll, once, for the run), the polls that do not count and a shown hold restarting the count; tests/rtss_worker_check.c unproven_run checks it against the real worker. docs/architecture.md, docs/building.md and nx2navi.ini.example describe the rule and the remaining window of two limiters before it. This changes when the game takes the limit back from RTSS, beyond the approved rules: an RTSS whose hold never shows in its shared memory (a version or setting that differs) is now left out after 30 s and the game's limiter holds alone, as with rtss = 0, where it held the frames beside the game's limiter before. Not reproduced before the change. Checks that passed: tests/rtss_limit_check.py (41 of 41), 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:
@@ -795,6 +795,28 @@ static void api_run(void) {
|
||||
CHECK(rtss_limit_active() && saves == 1, "RTSS limits, no second write");
|
||||
}
|
||||
|
||||
// RTSS lists the game with the limit and pictures go out, but it never reads the profile again (its update flag stays
|
||||
// set): after 30 s the profile goes back, the menu says RTSS does not limit the game, and the game's limiter holds for
|
||||
// the run.
|
||||
static void unproven_run(void) {
|
||||
app_set(1, 0xA | 0x10000000u, 1000, 2000, 60);
|
||||
ask(60000);
|
||||
poll();
|
||||
CHECK(own.exists && own.limit == 60, "written");
|
||||
for (int i = 0; i < RTSS_UNPROVEN_POLLS - 1; i++) poll();
|
||||
show("29.5 s with the update flag set");
|
||||
CHECK(own.exists && rtss_limit_state() == 0 && !rtss_limit_active(), "not yet");
|
||||
poll();
|
||||
show("30 s");
|
||||
CHECK(!own.exists && rtss_limit_state() == 3 && !rtss_limit_active(), "put back; the menu's note");
|
||||
CHECK(logged("RivaTuner Statistics Server listed the game with its limit at 60.000 fps for 30 s and never showed "
|
||||
"it holds it; the game's own limiter for the rest of the run"),
|
||||
"logged");
|
||||
CHECK(logged("the game's own limiter (RivaTuner Statistics Server never showed it holds the game)"), "the reason");
|
||||
settle(144000);
|
||||
CHECK(saves == 1 && !own.exists && rtss_limit_state() == 3, "out for the run");
|
||||
}
|
||||
|
||||
// No picture goes out (a minimised window): RTSS has nothing to hold, and the game's limiter holds until pictures go
|
||||
// out again; the profile stays as it is.
|
||||
static void idle_run(void) {
|
||||
@@ -1113,6 +1135,7 @@ static const struct { const char *name; void (*run)(void); } scenarios[] = {
|
||||
{"over_slack_run", over_slack_run},
|
||||
{"over_unlimited_run", over_unlimited_run},
|
||||
{"api_run", api_run},
|
||||
{"unproven_run", unproven_run},
|
||||
{"idle_run", idle_run},
|
||||
{"quit_run", quit_run},
|
||||
{"library_run", library_run},
|
||||
|
||||
Reference in New Issue
Block a user