Keep the first setting in UTF-8 files with a BOM #4796

Open
github-bot wants to merge 1 commit from github-bot/gh-4795 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 08:55 UTC · original
andrewpozdnakov7-jpg:codex2/fix/settings-utf8-bom → main · +19 −3 · 2 files · 1 commits · open

What it changes

Windows PowerShell can write a UTF-8 byte-order mark at the very start of victory-settings.txt. When the file starts directly with a setting, victory play skips that setting. Saving another option from F1 also drops the untouched first setting from disk.

Both readers now skip one leading BOM before splitting the lines. A settings file without a BOM follows the same parsing rules.

How it was tested

  • GPU and profile: the settings checks use a synthetic file with CRLF line endings. In-game testing is pending.
  • Before: the exact parsers from v2026.11.30.03 and main 5fabb46e skipped a first-line 60 FPS cap. The Windows/MSVC regression saw 33,333 µs instead of 16,667 µs. The original F1 save methods also removed that line when saving a different DLSS setting.
  • After: b27bb496629842ad794e0caa31dc626066ed1f63 applied the 16,667 µs cap with and without a BOM. An isolated check of the F1 save method kept the first line while updating the other setting in both files.
  • cargo test --offline --locked --jobs 2 -p victory: 92 unit and 3 integration tests passed on Windows x64 / MSVC. cargo xtask policy --staged passed for both files.
  • CI on main has five existing Clippy errors. Main CI / check · Shared lint fix #4708

Checked for overlap

  • I searched issues and PRs for the symptom and reviewed open PRs touching the same files. Related: #4632 changes quoted command-line arguments. #4765 and #4712 change the F1 interface.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 08:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4795) `andrewpozdnakov7-jpg:codex2/fix/settings-utf8-bom` → `main` · +19 −3 · 2 files · 1 commits · open ## What it changes Windows PowerShell can write a UTF-8 byte-order mark at the very start of `victory-settings.txt`. When the file starts directly with a setting, `victory play` skips that setting. Saving another option from F1 also drops the untouched first setting from disk. Both readers now skip one leading BOM before splitting the lines. A settings file without a BOM follows the same parsing rules. ## How it was tested - GPU and profile: the settings checks use a synthetic file with CRLF line endings. In-game testing is pending. - Before: the exact parsers from `v2026.11.30.03` and `main` `5fabb46e` skipped a first-line 60 FPS cap. The Windows/MSVC regression saw 33,333 µs instead of 16,667 µs. The original F1 save methods also removed that line when saving a different DLSS setting. - After: `b27bb496629842ad794e0caa31dc626066ed1f63` applied the 16,667 µs cap with and without a BOM. An isolated check of the F1 save method kept the first line while updating the other setting in both files. - `cargo test --offline --locked --jobs 2 -p victory`: 92 unit and 3 integration tests passed on Windows x64 / MSVC. `cargo xtask policy --staged` passed for both files. - CI on `main` has five existing Clippy errors. [Main CI / check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) · [Shared lint fix #4708](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4708) ## Checked for overlap - [x] I searched issues and PRs for the symptom and reviewed open PRs touching the same files. Related: #4632 changes quoted command-line arguments. #4765 and #4712 change the F1 interface. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:59:59 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 12:38 UTC · original

Verification of this PR (AI-assisted: Hy4 flash), source only, no game data.

Windows / rustc 1.100.0 / MSVC. Worktree at head b27bb496, dedicated per-worktree CARGO_TARGET_DIR (D:\Victory-Contrib\NVIDIA-Contrib\target-4795), never shared.

Negative control on base 5fabb46e:

  • git grep -F menu_file_bom_keeps_the_first_setting 5fabb46e -- . -> exit 1 (test is new)
    Whitespace: git diff --check 5fabb46e..b27bb496 -> exit 0, clean.
cargo test --locked -p victory --bin victory -- play::tests::menu_file_bom_keeps_the_first_setting --exact --test-threads=1

-> test play::tests::menu_file_bom_keeps_the_first_setting ... ok / test result: ok. 1 passed; 0 failed; 91 filtered out.

Note for the author: the test lives in the binary crate apps/victory/src/play.rs, so it needs -p victory --bin victory and the play::tests:: prefix; -p victory-gpu --lib gives running 0 tests (a false negative, not a failure).

GPU/driver: N/A (file-parsing test, no device).

Verdict: PASS for the new synthetic test on this host.

**@⁠cloph-dsp** on GitHub · 2026-12-01 12:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4795#issuecomment-7311432528) Verification of this PR (AI-assisted: Hy4 flash), source only, no game data. Windows / rustc 1.100.0 / MSVC. Worktree at head b27bb496, dedicated per-worktree CARGO_TARGET_DIR (D:\Victory-Contrib\NVIDIA-Contrib\target-4795), never shared. Negative control on base 5fabb46e: - `git grep -F menu_file_bom_keeps_the_first_setting 5fabb46e -- .` -> exit 1 (test is new) Whitespace: `git diff --check 5fabb46e..b27bb496` -> exit 0, clean. ``` cargo test --locked -p victory --bin victory -- play::tests::menu_file_bom_keeps_the_first_setting --exact --test-threads=1 ``` -> `test play::tests::menu_file_bom_keeps_the_first_setting ... ok` / `test result: ok. 1 passed; 0 failed; 91 filtered out`. Note for the author: the test lives in the binary crate `apps/victory/src/play.rs`, so it needs `-p victory --bin victory` and the `play::tests::` prefix; `-p victory-gpu --lib` gives `running 0 tests` (a false negative, not a failure). GPU/driver: N/A (file-parsing test, no device). Verdict: PASS for the new synthetic test on this host.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4796/head:github-bot/gh-4795'
git switch 'github-bot/gh-4795'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4795'
git switch 'github-bot/gh-4795'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4795'
git switch 'github-bot/gh-4795'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4795'
git switch 'main'
git merge --squash 'github-bot/gh-4795'
git switch 'main'
git merge --ff-only 'github-bot/gh-4795'
git switch 'main'
git merge 'github-bot/gh-4795'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
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
github/trustno1-coder--VIctory-NVIDIA!4796
No description provided.