[pr-fix][startup] Read UTF-8 F1 settings in the PowerShell launcher #242

Manually merged
TrustNo1 merged 1 commit from andrewpozdnakov7-jpg/Darner:port/e541-read-utf8-launcher-settings into main 2026-12-05 04:45:52 +00:00
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

F1 writes settings as UTF-8 without a BOM. In Windows PowerShell 5.1, the script's default text encoding can corrupt a non-ASCII setting. Decode UTF-8 explicitly and preserve the existing fallback for legacy files that contain invalid UTF-8.

Restores locally saved VIctory-NVIDIA work from December 1, 2026. Recovered revision: e54151a. Adapted by andrewpozdnakov7-jpg (GitHub profile).

How it was tested

  • Tested revision: fe99fe1 on f3840d7.
  • Commands and results: Windows PowerShell 5.1 fixtures passed for BOM-less UTF-8, UTF-8 with BOM, UTF-16 with BOM and legacy text ending in an incomplete UTF-8 byte. The initial ReadAllLines form discarded that last byte instead of triggering fallback, so the patch decodes the complete byte slice. PowerShell parsing, xtask policy, and git diff --check passed.
  • Changes a default: no.
  • Independent validation: superhero-520 tested both launchers with F1-written BOM-less UTF-8 on Chinese Windows (ACP 936). Main corrupted the inherited path on Windows PowerShell 5.1; the patch preserved it. Both worked on PowerShell 7.6.9. The fixture did not modify the settings files.
  • Independent warm-worker check: akimfomin confirmed the fix on Windows PowerShell 5.1 with ACP 1251 and a mixed Cyrillic/Chinese cache path. Main selected a misdecoded directory and reported 0 known, 0 made. The patched launcher selected the intended directory and reported 4 known, 4 made. Both exited 0.
  • Gates run on that revision: none of the three workspace-wide gates.
  • Independent Windows PowerShell 5.1 check on fe99fe1: the real warm worker found and made four early pipelines in the intended UTF-8 cache. Main used a misdecoded directory and found zero keys even though both runs exited 0. Test report
  • Coverage gaps: The local fixtures used synthetic settings. The independent run exercised the warm worker.

Checklist

  • I ran this change in the game.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: None found.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: <!-- optional --> ## What it changes F1 writes settings as UTF-8 without a BOM. In Windows PowerShell 5.1, the script's default text encoding can corrupt a non-ASCII setting. Decode UTF-8 explicitly and preserve the existing fallback for legacy files that contain invalid UTF-8. Restores locally saved VIctory-NVIDIA work from December 1, 2026. Recovered revision: e54151a. Adapted by [andrewpozdnakov7-jpg](https://git.gtahub.st/andrewpozdnakov7-jpg) ([GitHub profile](https://github.com/andrewpozdnakov7-jpg)). ## How it was tested - Tested revision: fe99fe1 on f3840d7. - Commands and results: Windows PowerShell 5.1 fixtures passed for BOM-less UTF-8, UTF-8 with BOM, UTF-16 with BOM and legacy text ending in an incomplete UTF-8 byte. The initial ReadAllLines form discarded that last byte instead of triggering fallback, so the patch decodes the complete byte slice. PowerShell parsing, xtask policy, and git diff --check passed. - Changes a default: no. - Independent validation: [superhero-520](https://git.gtahub.st/TrustNo1/Darner/pulls/242#issuecomment-861902) tested both launchers with F1-written BOM-less UTF-8 on Chinese Windows (ACP 936). Main corrupted the inherited path on Windows PowerShell 5.1; the patch preserved it. Both worked on PowerShell 7.6.9. The fixture did not modify the settings files. - Independent warm-worker check: [akimfomin](https://git.gtahub.st/TrustNo1/Darner/pulls/242#issuecomment-862008) confirmed the fix on Windows PowerShell 5.1 with ACP 1251 and a mixed Cyrillic/Chinese cache path. Main selected a misdecoded directory and reported 0 known, 0 made. The patched launcher selected the intended directory and reported 4 known, 4 made. Both exited 0. - Gates run on that revision: none of the three workspace-wide gates. - Independent Windows PowerShell 5.1 check on fe99fe1: the real warm worker found and made four early pipelines in the intended UTF-8 cache. Main used a misdecoded directory and found zero keys even though both runs exited 0. [Test report](https://git.gtahub.st/TrustNo1/Darner/pulls/242#issuecomment-862008) - Coverage gaps: The local fixtures used synthetic settings. The independent run exercised the warm worker. ## Checklist - [ ] I ran this change in the game. - [x] This PR contains one change based on main. - [x] The diff follows docs/asset-policy.md. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: None found. - Replaces or overlaps: none found
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (e54151a). Read BOM-less UTF-8 first and keep the legacy shell-encoding fallback for invalid UTF-8.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Contributor

I tested fe99fe1dfa210389d790163efd832c457aea5d55 against f3840d73d3504c30218debfbc8795b9225447317 on Chinese Windows (ANSI code page 936). I used Darner’s Rust darner_gpu::settings::write to save a DARNER_BENCH_CSV path containing Chinese characters, spaces and brackets. Each unmodified PowerShell launcher read a byte-identical copy of that BOM-less UTF-8 file and started a local observer that recorded its inherited environment.

On Windows PowerShell 5.1, main passed a corrupted path to the child. The PR preserved the exact path. On PowerShell 7.6.9, both revisions preserved it. All four launches exited 0 and left their settings files byte-for-byte unchanged. The observer replaced the emulator for this check.

I tested `fe99fe1dfa210389d790163efd832c457aea5d55` against `f3840d73d3504c30218debfbc8795b9225447317` on Chinese Windows (ANSI code page 936). I used Darner’s Rust `darner_gpu::settings::write` to save a `DARNER_BENCH_CSV` path containing Chinese characters, spaces and brackets. Each unmodified PowerShell launcher read a byte-identical copy of that BOM-less UTF-8 file and started a local observer that recorded its inherited environment. On Windows PowerShell 5.1, main passed a corrupted path to the child. The PR preserved the exact path. On PowerShell 7.6.9, both revisions preserved it. All four launches exited 0 and left their settings files byte-for-byte unchanged. The observer replaced the emulator for this check.
Contributor

Confirmed with a real warm worker on Windows PowerShell 5.1, system code page 1251. I saved DARNER_CACHE_DIR in a BOM-less UTF-8 settings file with the final directory named проверка-中文. Two isolated caches had the same four recorded early-pipeline keys and shader data. Both runs used the identical official .02 executable, RTX 4070 Ti SUPER, and scripts/play-nvidia.ps1 -Build release -WarmUsed -PrecompileJobs 1.

On main f3840d7 the script logged a different path, created a sibling directory with misdecoded characters and returned success with 0 known, 0 made. It wrote no completion marks in the intended cache. With the script from fe99fe1 the logged path matched exactly, the worker reported 4 known, 4 made, and the intended folder contained four completion marks. Both processes exited 0, so checking the exit code alone misses this regression. The separate warm-worker entry point was exercised; the game itself was not needed. Tested with Codex assistance.

Confirmed with a real warm worker on Windows PowerShell 5.1, system code page 1251. I saved `DARNER_CACHE_DIR` in a BOM-less UTF-8 settings file with the final directory named `проверка-中文`. Two isolated caches had the same four recorded early-pipeline keys and shader data. Both runs used the identical official .02 executable, RTX 4070 Ti SUPER, and `scripts/play-nvidia.ps1 -Build release -WarmUsed -PrecompileJobs 1`. On main `f3840d7` the script logged a different path, created a sibling directory with misdecoded characters and returned success with **0 known, 0 made**. It wrote no completion marks in the intended cache. With the script from `fe99fe1` the logged path matched exactly, the worker reported **4 known, 4 made**, and the intended folder contained four completion marks. Both processes exited 0, so checking the exit code alone misses this regression. The separate warm-worker entry point was exercised; the game itself was not needed. Tested with Codex assistance.
Author
Contributor

Thanks for testing a real warm worker. Four completion marks in the intended UTF-8 cache versus zero on main confirms the failure was more than a misprinted path. I added the result to the PR description, with the note that both processes exited 0.

Thanks for testing a real warm worker. Four completion marks in the intended UTF-8 cache versus zero on main confirms the failure was more than a misprinted path. I added the result to the PR description, with the note that both processes exited 0.
TrustNo1 manually merged commit fcac43055e into main 2026-12-05 04:45:52 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
TrustNo1/Darner!242
No description provided.