WIP: fix(game): find title-skip saves in UTF-8 Windows paths #3050
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3050
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Longshot:codex/skip-title-utf8"
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?
Summary
Skip title screen can stay on the title even when a profile contains a save. On Windows, enable the setting and start with a save stored in a path longer than 259 UTF-8 bytes, such as a profile in a deeply nested or multibyte folder. The save lookup truncates the path and misses the file.
Use Windows wide-character enumeration and modification times, build complete UTF-8 paths, and keep returning the newest save's timestamp in Unix seconds. The game continues to choose and load its own file. This extracts the save-lookup fix from #1539, crediting the original patch author and keeping that PR's other work separate.
Testing
Tested: On Windows with llvm-mingw, a synthetic test of the real title-skip input entry point passes the ASCII/no-save controls and fails on main for Unicode and deep paths. With the production UTF-8 manifest linked, main handles the short Unicode path but still misses both the multibyte path over 259 bytes and the extended Windows path. The fix finds the newest of two files, returns the full name, rejects an undersized output buffer, and starts the normal automatic button sequence. Both game translation units compile with warnings treated as errors. The filesystem UTF-8 and Skip opening fixtures also pass. The host/game boundary test reports the same existing
host/mouse_native.chos_oot_map_momentfailure on both trees. Independent exact-revision source review found no remaining blockers after the Linux path capacity was restored.On Windows 11 with an RTX 4070 and driver 621.01, exact stock and the candidate host relink ran headless with the same copied repository checkpoint in separate disposable profiles. Each progress file's path was 343 UTF-8 bytes and 199 UTF-16 units. Stock reported no saved game. The patched host found the checkpoint, sent the normal title and confirmation inputs, and the bridge reached play at frame 1547 without manual input. Both exited 0. The linked host used retained unchanged build objects and the stock renderer.
The matched full Windows game-free runs on
455b0837and120f01ffeach reported 634 passed, 114 failed and 193 skipped across the same 941 checks. All 113 shared failures had matching diagnostics. The unchanged control-bridge fixturetest_longshot_ctl.pypassed on this run after failing on the control. The unchangedtest_pipeline_cache_save.pytimed out on the candidate while waiting for its synthetic save counter. In two paired follow-ups the same timeout occurred once on each revision, and the second run passed on both. There is no remaining reproducible candidate-only failure in this comparison.The full-run setup used normal discovery and skipped unavailable tools. A separate strict GCC run passed the title-skip regression. The existing native filesystem fixture hit the same GCC
-Werror=format-truncationfailure on both revisions and passed under llvm-mingw Clang.Main advanced to
b6e38a13via the separate Vulkan depth-comparison fix in #3032. The local merge preview is clean and leaves both title-skip patch files byte-for-byte identical to the tested head. The Windows comparison above remains pinned to the tested455b0837base.Still to test:
Measurements
Verdict: The fix restores save discovery and the first automatic press in both long Windows path cases. The lookup runs once at startup.
Setup: native Windows fixture with the game executable's UTF-8 manifest. Both build variants use the same two synthetic saves per path.
455b0837120f01ffRisks
The Windows lookup uses the profile path already admitted by the host and returns no match for an invalid path. The change reads filenames and modification times only, and adds no per-frame work. The Linux code follows the original path sizing and selection rules.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11, NVIDIA RTX 4070 with driver 621.01: with the same repository checkpoint in matching disposable profiles at a 343-byte UTF-8 path, stock stayed on the title and the patched host entered play at frame 1547 without manual input. Both exited cleanly.
Possibly related, for context:
@review
Recommendation: Approve. The reported Windows run shows that the fix restores title skipping for the tested long path, but the new fixture has Windows path-handling failures that can make the checks fail on supported setups. Final checks are also still outstanding. Nothing blocking is left. Recommend approval; not approved on the forge.
The change discovers saves through Windows wide-character APIs and preserves the full UTF-8 path, allowing title skipping to start for the reported long-path cases. It adds bounded path assembly and a Windows fixture; Linux save lookup is unchanged.
Should fix (3): not blocking, but worth doing before merging.
tests/test_skip_title.py:482: The fixture creates a path that requires the extended Windows prefix, but TemporaryDirectory later cleans it up through the unprefixed root. (more on the line) Do: Remove the long fixture through an extended-length path before TemporaryDirectory cleanup, including on failure.tests/test_skip_title.py:106: The Windows harness treats its narrow argv root as UTF-8 without linking the production UTF-8 manifest or converting wide arguments. (more on the line) Do: Link the production UTF-8 manifest to the harness or obtain and convert its Windows arguments from UTF-16.tests/test_skip_title.py:484: The extended-path construction assumes the temporary directory is on a drive and produces an invalid device path for a UNC temporary directory. (more on the line) Do: Construct the UNC extended form separately from the drive-letter form.@fixcan do L1, L2 and L3.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the PR reports that 0 of 2 long-path fixture cases worked on base
455b0837and 2 of 2 worked on head120f01ff. In a matched Windows game run, stock stayed on the title while the patched host entered play at frame 1547.Other systems: The lookup runs once at startup and does not depend on the GPU. Linux retains its prior 260-byte path capacity and selection logic; the requested native Linux build and UTF-8 profile run remain outstanding. Windows drive paths were exercised in the reported run; network shares and fixture cleanup with system-wide long-path support disabled were not reported.
Switches: None.
Reviewed:
120f01ff46against455b083738: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, both changed files in full, the commits and both diffs. Read the relevant save-root, filesystem conversion, profile-path and test-runner code; skimmed the source-check references and CI workflow. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no project code, builds, scripts, or tests were run. The PR reports Windows fixture and game runs; its Linux run and final suite are outstanding, and CI is still running.
Overlaps and merge order: The PR identifies #1539 as the source of this extracted fix; its other work is stated to be separate. No independent network check was available.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -81,2 +103,4 @@CHECK(hos_oot_newest_save(argv[2], path, sizeof path) == 0);#ifdef _WIN32/* Build UTF-8 here so the narrow Windows argv conversion cannot change these names. */L2 (should fix): The Windows harness treats its narrow argv root as UTF-8 without linking the production UTF-8 manifest or converting wide arguments.
When: When the temporary directory contains a character encoded by the Windows ANSI code page, the harness receives ANSI bytes in argv; the new strict UTF-8 conversion rejects them or addresses a different path, so the controls and new cases fail despite a working lookup.
Do: Link the production UTF-8 manifest to the harness or obtain and convert its Windows arguments from UTF-16.
@ -441,0 +479,4 @@if windows:for user in (root / "user" / "🦊", root / "user" / ("測" * 85),root / "user" / ("a" * 125) / ("b" * 125)):# Create long paths even when system-wide long-path support is off.L1 (should fix): The fixture creates a path that requires the extended Windows prefix, but TemporaryDirectory later cleans it up through the unprefixed root.
When: With Windows long-path support disabled, the deep fixture exceeds MAX_PATH. Creation succeeds through the prefixed path, but recursive cleanup reaches the same files through the unprefixed temporary directory and fails, leaving the fixture behind and failing the check.
Do: Remove the long fixture through an extended-length path before TemporaryDirectory cleanup, including on failure.
@ -441,0 +481,4 @@root / "user" / ("a" * 125) / ("b" * 125)):# Create long paths even when system-wide long-path support is off.extended = Path("\\\\?\\" + str(user))for profile, slot, timestamp in (("older", "slot_00", 1700000000), ("設定", "slot_測", 1700000060)):L3 (should fix): The extended-path construction assumes the temporary directory is on a drive and produces an invalid device path for a UNC temporary directory.
When: If TEMP points to a network share, prefixing its absolute path with \?\ produces \?\server\share instead of the required \?\UNC\server\share, so fixture creation fails before the lookup is tested.
Do: Construct the UNC extended form separately from the drive-letter form.
The matched full Windows comparison on
455b0837and120f01ffhad the same 941 checks and totals on both revisions: 634 passed, 114 failed, 193 skipped. The 113 shared failures have matching diagnostics. The two changed outcomes are in byte-identical fixtures: the control-bridge test passed on this run and the pipeline-cache test timed out waiting for its synthetic save counter. A paired rerun is queued. Native Linux and the strict suite remain open.Follow-up: the pipeline-cache fixture reproduced the same timeout on both
455b0837and120f01ff; a second pair passed on both. The strict GCC title-skip fixture passed. The unchanged filesystem fixture reports identical GCC format-truncation diagnostics on both revisions and passes with llvm-mingw Clang. No reproducible candidate-only failure remains in the matched Windows runs. Native Linux and the strict full suite remain open.Main advanced via the independent Vulkan fix in #3032. A clean preview against
b6e38a13leaves both title-skip patch files byte-identical to tested120f01ff. The matched Windows results remain pinned to455b0837.Superseded by #2822, which replaced the C title-skip lookup. At
d984fd70, a focused native Windows check of the Rust selector passed short Unicode, a 328-byte UTF-8 path and a 317-unit extended path, including newest and explicit slot selection. Closing this draft and preserving its branch and prior test evidence.Pull request closed