loader: an unset VICTORY_FRAME_INTERVAL_MS leaves the title's rate alone #400

Manually merged
github merged 1 commit from github-bot/gh-400 into gh-pr/400/base 2026-12-04 18:53:44 +00:00 AGit
Owner

@⁠h-dowd on GitHub · 2026-12-04 00:23 UTC · original
h-dowd:fix/frame-interval-loader-default → main · +4 −1 · 1 files · 1 commits · merged 2026-12-04 18:48 UTC

Follow-up to #261, which made victory-gpu's frame clock follow the title when VICTORY_FRAME_INTERVAL_MS is unset.

Cause. The switch is read in two places. #261 fixed victory-gpu/src/frame.rs, but victory-loader/src/frame_rate.rs (asked_interval_ms) still read unset as "10". So at load the title's two reads of its frame rate setting were patched to rate 100, and the frame clock, now following the title, followed that patched interval: 16.667 ms in the world instead of the title's 33.333 ms. docs/SETTINGS.md says "Unset follows the title", and title already gave that behaviour.

Change. Unset now returns None in the loader too, so nothing is patched: the same one-line change #261 made in the frame clock. title and explicit milliseconds behave as before.

Measured (release build, RX 9070 XT, Series X, VICTORY_FRAME_INTERVAL_MS unset in both runs):

Patch log lines (rate=100) frame interval lines In-world fps (median, max)
Before 3 interval=16.667ms title=16.667ms 60.0, 60.0 (11 samples)
After 0 interval=33.333ms title=33.333ms 30.0, 31.6 (107 samples)

The two runs used different presets; the interval and patch lines are what this change affects. frame_rate unit tests pass (4/4); none of them covers the unset case, since it depends on the process environment.

🤖 Generated with Claude Code

**@⁠h-dowd** on GitHub · 2026-12-04 00:23 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/400) `h-dowd:fix/frame-interval-loader-default` → `main` · +4 −1 · 1 files · 1 commits · merged 2026-12-04 18:48 UTC Follow-up to #261, which made `victory-gpu`'s frame clock follow the title when `VICTORY_FRAME_INTERVAL_MS` is unset. **Cause.** The switch is read in two places. #261 fixed `victory-gpu/src/frame.rs`, but `victory-loader/src/frame_rate.rs` (`asked_interval_ms`) still read unset as `"10"`. So at load the title's two reads of its frame rate setting were patched to rate 100, and the frame clock, now following the title, followed that patched interval: 16.667 ms in the world instead of the title's 33.333 ms. `docs/SETTINGS.md` says "Unset follows the title", and `title` already gave that behaviour. **Change.** Unset now returns `None` in the loader too, so nothing is patched: the same one-line change #261 made in the frame clock. `title` and explicit milliseconds behave as before. **Measured** (release build, RX 9070 XT, Series X, `VICTORY_FRAME_INTERVAL_MS` unset in both runs): | | Patch log lines (`rate=100`) | `frame interval` lines | In-world fps (median, max) | |---|---|---|---| | Before | 3 | `interval=16.667ms title=16.667ms` | 60.0, 60.0 (11 samples) | | After | 0 | `interval=33.333ms title=33.333ms` | 30.0, 31.6 (107 samples) | The two runs used different presets; the interval and patch lines are what this change affects. `frame_rate` unit tests pass (4/4); none of them covers the unset case, since it depends on the process environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
72e5d49 made victory-gpu's frame clock follow the title when the switch
is unset, but the loader still read unset as 10 ms and patched the
title's frame rate setting to 100. The clock then followed the title's
patched interval, so the world ran at up to 60 fps instead of its 30.
Unset now means no patch, as `title` already did and as SETTINGS.md says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 00:23:51 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 07:32 UTC · original

Checked 500e68d. Looks right to me.

The only caller of asked_interval_ms() is the loader step in apps/victory/src/run.rs:369. With Some(ms) it turns that into a title rate (title_rate, frame_rate.rs:76-83) and patches the setting reads. With None the whole block is skipped and the title keeps its 30. So on main an unset variable meant Some(10), which title_rate turns into 100, and the title got patched to 100. Nothing else calls it.

The 72e5d49 claim holds. That commit changed crates/victory-gpu/src/frame.rs:45 from the same unwrap_or_else(|_| "10".into()) to .ok()?, and 72e5d49 is an ancestor of this head. So on main the clock follows the title when the variable is unset, but the loader still forced rate 100. This PR makes the two agree, and the module doc at frame_rate.rs:1 ("off without it") is now actually true.

Docs and launchers already describe the new behaviour, so nothing goes stale. docs/SETTINGS.md:20 and README.md:122 both list the default as unset, and SETTINGS says "Unset follows the title". run.conf.default:195-199 says "Unset follows the title" and ships the line empty. I found no launcher, preset or config that relies on 10. None of the files under presets/ set it.

title and malformed values work the same as before (frame_rate.rs:52-61). An empty value, which you get if someone uncomments VICTORY_FRAME_INTERVAL_MS= in run.conf (run.sh sources it with set -a), is a parse failure that prints the warning and returns None. That was already true before this change, and the gpu side does the same.

On a non-unicode value, var returns Err. Before, that fell back to "10" and the title got rate 100. Now it is a silent None, which matches what frame.rs:45 does. It's arguably better than before, since it no longer disagrees with the clock. Not worth switching to var_os for.

One side effect worth knowing about. VICTORY_TITLE_FPS is only read inside that Some branch (run.rs:371), so setting it without VICTORY_FRAME_INTERVAL_MS now does nothing. Before, it worked on top of the hidden 10 ms default. It only shows up in code comments (run.rs:366 and frame_rate.rs:74), not in the user docs, so probably fine. If it's meant to work on its own, though, the docs should say it needs the interval set.

Tests ran natively on Windows (MSVC toolchain, not Wine). cargo test -p victory-loader --lib gave 84 passed, 0 failed. Main has moved since the PR base but none of the touched files changed, and the PR still merges cleanly onto current main.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 07:32 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/400#issuecomment-7404787271) Checked 500e68d. Looks right to me. The only caller of `asked_interval_ms()` is the loader step in `apps/victory/src/run.rs:369`. With `Some(ms)` it turns that into a title rate (`title_rate`, `frame_rate.rs:76-83`) and patches the setting reads. With `None` the whole block is skipped and the title keeps its 30. So on main an unset variable meant `Some(10)`, which `title_rate` turns into 100, and the title got patched to 100. Nothing else calls it. The 72e5d49 claim holds. That commit changed `crates/victory-gpu/src/frame.rs:45` from the same `unwrap_or_else(|_| "10".into())` to `.ok()?`, and 72e5d49 is an ancestor of this head. So on main the clock follows the title when the variable is unset, but the loader still forced rate 100. This PR makes the two agree, and the module doc at `frame_rate.rs:1` ("off without it") is now actually true. Docs and launchers already describe the new behaviour, so nothing goes stale. `docs/SETTINGS.md:20` and `README.md:122` both list the default as unset, and SETTINGS says "Unset follows the title". `run.conf.default:195-199` says "Unset follows the title" and ships the line empty. I found no launcher, preset or config that relies on 10. None of the files under `presets/` set it. `title` and malformed values work the same as before (`frame_rate.rs:52-61`). An empty value, which you get if someone uncomments `VICTORY_FRAME_INTERVAL_MS=` in run.conf (run.sh sources it with `set -a`), is a parse failure that prints the warning and returns `None`. That was already true before this change, and the gpu side does the same. On a non-unicode value, `var` returns `Err`. Before, that fell back to "10" and the title got rate 100. Now it is a silent `None`, which matches what frame.rs:45 does. It's arguably better than before, since it no longer disagrees with the clock. Not worth switching to `var_os` for. One side effect worth knowing about. `VICTORY_TITLE_FPS` is only read inside that `Some` branch (`run.rs:371`), so setting it without `VICTORY_FRAME_INTERVAL_MS` now does nothing. Before, it worked on top of the hidden 10 ms default. It only shows up in code comments (run.rs:366 and frame_rate.rs:74), not in the user docs, so probably fine. If it's meant to work on its own, though, the docs should say it needs the interval set. Tests ran natively on Windows (MSVC toolchain, not Wine). `cargo test -p victory-loader --lib` gave 84 passed, 0 failed. Main has moved since the PR base but none of the touched files changed, and the PR still merges cleanly onto current main. AI-assisted: yes
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:16 UTC · original

This is the missing half of 72e5d49: crates/victory-loader/src/frame_rate.rs:48 still manufactures "10" on unset while crates/victory-gpu/src/frame.rs:45 already returns ?, and .ok()? here matches both the doc comment directly above it (frame_rate.rs:44-46) and docs/SETTINGS.md:20. Malformed input still warns in both places, so no new parse split. Nothing to fix.

Two things worth a sentence in the commit message, because both will surprise someone later:

  • VICTORY_TITLE_FPS is read inside if let Some(ms) in apps/victory/src/run.rs:369-371, so with the interval unset it is now silently inert. It was undocumented before, so this is a nit, but a user who set title fps 30 alone will see it stop doing anything.
  • No test can cover the unset case without touching the process environment, so this half is source-review-only; the four existing frame_rate tests still pass unchanged.

I could not make it break anything: unset now means "patch nothing", which is what the setting's own text says.

**@⁠Luxuride** on GitHub · 2026-12-04 11:16 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/400#issuecomment-7409869316) This is the missing half of `72e5d49`: `crates/victory-loader/src/frame_rate.rs:48` still manufactures `"10"` on unset while `crates/victory-gpu/src/frame.rs:45` already returns `?`, and `.ok()?` here matches both the doc comment directly above it (`frame_rate.rs:44-46`) and `docs/SETTINGS.md:20`. Malformed input still warns in both places, so no new parse split. Nothing to fix. Two things worth a sentence in the commit message, because both will surprise someone later: - `VICTORY_TITLE_FPS` is read inside `if let Some(ms)` in `apps/victory/src/run.rs:369-371`, so with the interval unset it is now silently inert. It was undocumented before, so this is a nit, but a user who set `title fps 30` alone will see it stop doing anything. - No test can cover the unset case without touching the process environment, so this half is source-review-only; the four existing `frame_rate` tests still pass unchanged. I could not make it break anything: unset now means "patch nothing", which is what the setting's own text says.
github-bot changed target branch from main to gh-pr/400/base 2026-12-04 18:53:42 +00:00
github manually merged commit 500e68d8a9 into gh-pr/400/base 2026-12-04 18:53:44 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.