Skip to content

Launcher: the Wine path walk reaches the drive root; the host test follows LinuxRdna4Name - #197

Merged
phantoslayer21 merged 2 commits into
phantoslayer21:mainfrom
j0nsh1n:fix/wine-path-drive-root
Nov 14, 2026
Merged

phantoslayer21 merged 2 commits into
phantoslayer21:mainfrom
j0nsh1n:fix/wine-path-drive-root

Conversation

@j0nsh1n

@j0nsh1n j0nsh1n commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What this changes and why

Follow-up to #105, for the two points in its approval review. Two commits; each stands alone on main.

  1. PathForGamePrefix reaches the drive root. The review: "The path walk can miss the drive root. In util.cpp:259-263, with C:\missing\F\model.wgcm where only C:\ exists, the walk stops at C:\missing and never tries C:. The install then warns and writes the prefix-local path. Keeping the separator on the root, plus a test for that case, would fix it."
    • The walk now keeps the separator on the root (C:\) and tries it before giving up. The root's Unix name ends in /, so that is dropped when a tail follows, to avoid a doubled separator.
    • Only the UnderWine() branch changes. Windows behaviour is the same.
    • New test in wg_core_tests.cpp: C:\con\F\model.wgcm under Wine must come back as a Z: path with its tail. With GE-Proton 11-11's Wine, a single missing folder below C:\ converts on its own, so C:\missing\... is not enough to reach the bug. A DOS device name such as CON does not convert even though C:\ exists, so the walk gets stuck exactly as the review describes.
  2. The Wine test no longer probes cards itself. The review: "The host test stops at card15. wg_core_tests.cpp:237-246 still probes card0–15 itself, so it disagrees with LinuxRdna4Name() when the only card is card16 or later. Either drop that assertion or enumerate the same way."
    • I dropped the duplicate probe. A second enumerator in the test would only repeat the code under test. The DetectGpu check stays: when LinuxRdna4Name() names a card, DetectGpu must report an RDNA 4 AMD card.
    • Card16 and later are already checked on the made-up folder in the same file (card20, card17).
    • Test change only; no source changes.

What each new or substantially changed file is based on

clean/installer/src/wg_core/util.cpp: own design, using Wine's documented wine_get_unix_file_name. clean/installer/tests/wg_core_tests.cpp: own design; synthetic fixtures only, no game or model data.

How it was tested

CI runs the CPU tests. Under Wine, with clean/linux/run_wine_tests.py --tests launcher under GE-Proton 11-11, on main at 6622148 (wg-core-tests counts; the other three programs stay at 240, 187 and 18 checks):

State wg-core-tests
main 91
commit 1's test with its fix taken out FAILED: PathForGamePrefix under Wine: a Z: path when only the drive's root exists (after 81 checks)
commit 1 92
commit 1 + commit 2 91
commit 2 alone on main 90
  • The new check was seen to fail without the fix and pass with it.
  • Commit 2 drops one check. To confirm card16 and later stay covered, I limited the card list in DrmCards to card15 for one run: FAILED: LinuxRdna4Name: a card numbered 20, reported as not confirmed. I then reverted that.
  • check_wording.py, check_source_size.py, tools/ci/check_line_endings.py and reuse lint pass.
  • Not run: on Windows. This code is only reached under Wine; the MSVC build is CI's job.

Checklist

  • I make the clean-room statement of
    CONTRIBUTING.md
    for this and all my contributions (required once, in my first pull request). (Made in Launcher: install for Proton games from under Wine #105.)
  • Every commit has a Signed-off-by: line (git commit -s; Developer Certificate of Origin 1.1).
  • New source files carry the SPDX licence line for MIT, or are covered in REUSE.toml. (No new files.)
  • No files of the original upscaler (see CONTRIBUTING.md), no model data, game files, captures, screenshots or
    binaries; no paths, user or machine names of my PC.
  • Any new third-party component is under a permitted licence and listed in THIRD-PARTY-NOTICES and REUSE.toml. (None added.)
  • Numbers in documents come with their measurement record. (No document changes.)
  • Kernel or runtime changes: none.

🤖 Generated with Claude Code

j0nsh1n and others added 2 commits November 14, 2026 10:37
…r does not convert

The walk that converts the deepest existing folder to a Z: path stopped at
the first folder below the drive (cut < 3) and returned the path unchanged,
so C:\<first>\F\model.wgcm with only C:\ convertible never tried C:\. The
install then warned and wrote the prefix-local path.

The walk now keeps the separator on the root ("C:\") and tries it before
giving up, and drops the root's trailing '/' so the tail's own separator does
not double. Only the UnderWine() branch changes; outside Wine the function
still returns the path as it is.

Test: wg_core_tests converts C:\con\F\model.wgcm under Wine. Wine converts a
single missing folder but not a DOS device name like CON, so the first folder
fails while C:\ exists. Before the fix: FAILED: PathForGamePrefix under Wine:
a Z: path when only the drive's root exists (wg-core-tests, after 81 checks).
After: wg-core-tests 92 checks passed (main: 91).

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad of probing cards itself

The under-Wine part of wg_core_tests.cpp probed card0 to card15 on its own
to decide whether Linux reports an RDNA 4 card, and compared that with
LinuxRdna4Name(). LinuxRdna4Name looks at every card in the folder, so the two
disagreed when the only RDNA 4 card is card16 or later.

The duplicate probe is dropped rather than made to enumerate the same way:
a second enumerator in the test would only repeat the code under test. Which
cards LinuxRdna4Name looks at is already checked on the made-up folder (card20
and card17 in the same file). The under-Wine block now only checks that
DetectGpu follows LinuxRdna4Name: when it names a card, DetectGpu reports an
RDNA 4 AMD card.

The made-up folder's card20 check was seen to fail with DrmCards limited to
card15 (FAILED: LinuxRdna4Name: a card numbered 20, reported as not
confirmed), so card16 and later stay covered; the change was reverted. The
probe's check is gone, so wg-core-tests counts one less: 91 on main, 90 with
this commit alone, 91 on top of the drive-root commit (92 -> 91).

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phantoslayer21
phantoslayer21 merged commit d268de0 into phantoslayer21:main Nov 14, 2026
9 checks passed
@j0nsh1n
j0nsh1n deleted the fix/wine-path-drive-root branch November 14, 2026 23:13
j0nsh1n added a commit to j0nsh1n/wronggpu that referenced this pull request Nov 15, 2026
Brings the launcher branch up to upstream main (217 commits: phantoslayer21#47, phantoslayer21#105,
phantoslayer21#196, phantoslayer21#197, phantoslayer21#209, Model K/L, frame generation, ...). Changes beyond
resolving the three conflicts (CMakeLists.txt project(), util.h's includes,
the restorer test):

- POSIX layer: the Win32 calls main's handle-based restore uses
  (SetFileInformationByHandle with FileBasicInfo, FileDispositionInfo and
  FileDispositionInfoEx's POSIX delete, GetFileInformationByHandleEx
  FileBasicInfo, SetEndOfFile, ExitProcess, GetProcessHeap/HeapFree, CDECL,
  ERROR_TOO_MANY_LINKS/FILE_CORRUPT/READ_FAULT), with posix-layer tests.
- run_launcher_tests.py stays below the 256 KB source limit: the edition
  section moves unchanged to launcher_edition_cases.py and the Linux run's
  plumbing to native_linux.NativeT.
- launcher-native runs only in a -DWRONGGPU_PRESET_K=OFF build (like CI's
  launcher build: the suite expects no seeded wronggpu-asi.ini); its two
  checks that fail on main's own launcher too (phantoslayer21#219) are skipped while
  they fail (native_linux.KNOWN_ON_MAIN).

Verified: fresh build, ctest 22/22 (launcher-native 365 passed, 0 failed,
6 skipped: 4 Windows-only sections, the 2 phantoslayer21#219 checks); reuse lint passes.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants