Keep the first setting in UTF-8 files with a BOM #4795
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4795"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T08:55:11Z.
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 playskips 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
v2026.11.30.03andmain5fabb46eskipped 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.b27bb496629842ad794e0caa31dc626066ed1f63applied 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 --stagedpassed for both files.mainhas five existing Clippy errors. Main CI / check · Shared lint fix #4707Checked for overlap
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-12-01T12:38:31Z.
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.->
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 victoryand theplay::tests::prefix;-p victory-gpu --libgivesrunning 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.