Repository navigation
Launcher tests: never search the PC's own store libraries; --noscan reaches every library search - #243
Merged
Conversation
…eaches every library search The old test suite let the launcher's library searches (the AMD FSR 4 compare-DLL search and the model step) read the store library folders of the PC it ran on, because the CLI's --noscan did not reach them. - --noscan (every verb), the window's no-scan and an operation's noscan set ctx.noLibraryScan, which the AMD FSR 4 search and the other-model step read. - A WRONGGPU_TESTING build with WRONGGPU_TEST_LIBRARIES set takes its libraries from that folder only and reads nothing of the PC's stores (detect.h TestLibraries); every launcher test runner sets it to an empty work folder. - tests/launcher_isolation.py: any library-search log line naming a path outside the run's work folder stops the run; its self-test runs first in every launcher suite run. - launcher-core-tests: noscan reaches the AMD FSR 4 search; the test library list. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…eration (review) - util.h LibraryAccess / LibraryRegistryAccess: every read of store metadata asks first: Steam's library list and app manifests (also SteamAppId for Play and GameDisplayName), Epic's manifests (also EpicAppName for Play), the GOG registry, Steam's art cache, and every walk of a library game's folder (FindFilesNamed, DetectGames). A testing build with WRONGGPU_TEST_LIBRARIES set reads nothing outside the test run's folder and no store registry key, and logs "library access: <path>" (or "refused") to WRONGGPU_TEST_ACCESS_LOG before every read. - No-scan per operation: noScanAlways (--noscan, /NOSCAN, the window's) and an operation's own noscan; RunOp sets the flag for the operation and puts it back, so a job's noscan never reaches the next job. apply --noscan sets the job's noscan too; InstallOp's first model search follows the operation's flag. - /S /NOSCAN /FSR4 and /LIST search no library and say "libraries not searched (/NOSCAN)". - tests/launcher_isolation.py: check_isolation parses the access log after every call (raw ones and elevated jobs too) and stops the run on a read outside the work folder (also \?\ and UNC), a store registry read, a missing access log, or no access where a scan was expected; self_test runs first in every runner (launcher, coexistence, Model L / K, convert-ignore, installer) and aborts the run on failure; [isolation-verbs]: install, repair, update, uninstall, the window's refresh, the other model, a batch and /FSR4 / /LIST with and without no-scan against a non-empty test library. The 0.5.1 baseline installer runs only with --run-old-baseline. - launcher-core-tests: each store inside and outside the test folder, the per-operation no-scan, a normal job finding its compare DLL after a noscan job. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…t log is this run's Testing builds with WRONGGPU_TEST_LIBRARIES set now also check the resolved path of every store read: a path whose final form differs from its long form (a junction or link on the way), a reparse point, a file with a second name (a hard link) and a test folder that itself resolves elsewhere are refused. A read whose access-log line cannot be written is refused. A new log starts with "run <WRONGGPU_TEST_RUN_ID>"; the launcher and the restorer write a "process" line at every start. Every walked folder and every opened file of a library game gets its own line (FindFilesNamed, the game-exe, Unreal and art searches). The runners no longer create the access log. They set a new run id, and the guard stops the run on a missing log, a log of another run, or a call that added no line. Repair and update without no-scan are checked to search the test libraries; the other-model check reads only its own call's lines. Native installer runs need a WRONGGPU_TESTING build. Unit tests for a junction, a file symlink, a hard link, a junction test folder, an unwritable and an unset log, and the run-id line; two new guard self-test cases. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…ed comment back on it Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 15, 2026 17:57
phantoslayer21
added a commit
that referenced
this pull request
Nov 15, 2026
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
7 tasks done
phantoslayer21
added a commit
that referenced
this pull request
Nov 15, 2026
Conflicts: - launcher.cpp ApplyProfile: one state-lock hold covers #224's settings (validated first, then settings.ini through the state keys), the model choice record, OptiScaler.ini's entry and #224's RR state, in that order. WriteLauncherModelChoice / GuiApplyRequest sit next to #224's FrontEndStateKeys / WithFrontEndState. - record.cpp: #224's version (model-choice.ini is WrongGPU's by its stamp, not by its name). Follow-ups for main's changes: - The model choice record is written with wgstate::WriteStamped (#224's stamp for model-choice.ini and the install's id), so an uninstall knows it as WrongGPU's; a test covers the stamp, a parse of a stamped record and a write without an install id. - A create no entry names, whose record names a model this build lacks, runs Model M, never the persisted sr_model (which an earlier session may have left on another model); test case (16). - wronggpu.ini's reader for the upgrade migration is a named callable class, not a lambda capturing the path by copy. - run_model_k_tests: since #224 the uninstall also removes the seeded, unchanged wronggpu-asi.ini, so the game folder is byte for byte as before. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
j0nsh1n
added a commit
to j0nsh1n/wronggpu
that referenced
this pull request
Nov 17, 2026
…inux runs too 0.6.5's launcher suite runs a program only after checking it is a WRONGGPU_TESTING build (phantoslayer21#243): an identity resource, a matching PE checksum and the test hooks' strings, and negative controls (canaries) it must refuse. On Linux that check read PE structure only, so every launcher call was refused. The guard stays; Linux gets its own counterparts: - identity: a section .wg_testing_id in the testing launcher (src/platform/posix/testing_identity_linux.cpp, the same identity text as the Windows resource) and, after the link, the file's SHA-256 written into it with those 32 bytes counted as zero (tools/elf_testing_identity.py, a POST_BUILD step; what the PE checksum is on Windows: a byte changed, data appended or a strip after the link no longer matches); - launcher_build_facts.testing_identity reads an ELF file that way (wide strings are UTF-32 on Linux); the build list names WrongGPU and the canaries without .exe; - negative controls: tests/canary.cpp built for Linux too (its wmain through the POSIX layer; lstrcatW added there), a Linux load marker (tests/canary_dll_linux.cpp, writes <file>.loaded from a constructor); - self_checks on Linux: --native-linux as the entry point, host paths for programs and child suites, a symbolic link where Windows uses a junction, ctypes.CDLL for the load marker; the native launcher is checked before anything runs, as --launcher is. Verified: ctest 22/22 (launcher-native 425 passed, 0 failed, 5 skipped; its preflight and every negative control pass on Linux). The check accepts the testing launcher and refuses 42c933e's testing launcher, both canaries, and the launcher with a byte changed, data appended, stripped, the identity text changed (sum rewritten) or the sum never written; three ways of breaking the checker each let one of those through (red), restored green. The suite given a non-testing program refuses before it makes its work folder. The MinGW build of the Windows canaries is unchanged in behaviour (Wine tests as before). Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes and why
The old test suite let the launcher's library search and model step read store library folders of the PC it ran on: the CLI's
--noscandid not reach those searches, and nothing confined a test build to its own folders. This PR closes that in the product and in the tests.Product:
util.hLibraryAccess/LibraryRegistryAccess). Every read of store metadata asks first:SteamAppIdfor Play, andGameDisplayName);EpicAppNamefor Play);FindFilesNamed,DetectGames, the game-exe, Unreal and art searches).WRONGGPU_TESTINGbuild withWRONGGPU_TEST_LIBRARIESset takes its libraries from that folder only, and reads nothing outside the test run's folder and no store registry key.GetFinalPathNameByHandleW) differs from its long name, because of a junction or link on the way;library access: <path>(orrefused: <path> (<why>)) toWRONGGPU_TEST_ACCESS_LOG. A read whose line cannot be written is refused (fail closed).run <WRONGGPU_TEST_RUN_ID>. Every start of the launcher or the restorer writes aprocessline.--noscan(every verb),/NOSCANand the window's no-scan hold for the whole process.RunOpsets the flag and puts it back, so it never reaches the next job of a batch.apply --noscansets the job's noscan too./S /NOSCAN /FSR4and/S /NOSCAN /LISTsearch no library, and the report says "libraries not searched (/NOSCAN)".Tests:
New
tests/launcher_isolation.py. Every runner (launcher, coexistence, Model L / K, convert-ignore, installer) sets the variables to its work folder and a new run id. The runners never create the access log; the launcher does.After every launcher or installer call, including raw ones and elevated jobs,
check_isolationstops the whole run on:\\?\and UNC forms);A search line in the main log naming an outside path also stops it. Native installer runs need a
WRONGGPU_TESTINGbuild.self_testruns first in every runner's main, before any program call, and aborts the run if the guard is broken. It has 15 cases, including a log from another run and a call that logged nothing.[isolation-verbs]runs these with and without no-scan, against a non-empty test library:apply --noscan;/FSR4and/LIST.The 0.5.1 baseline installer predates this. It runs only with
--run-old-baseline, in a fully redirected sandbox.launcher-core-testscovers:\\?\;The README's Tests section describes the rule.
Follow-up (0.6.6): #245. The check and the read using the same handle, a log line for each later open of a found file (hash and convert), and a note and test for what still runs in release builds.
What each new or substantially changed file is based on
Own design.
tests/launcher_isolation.pyis new.How it was tested
Tested on this head (Windows, MSVC; APPDATA, LOCALAPPDATA, ProgramData and TMP redirected to scratch folders):
ci.ymlflags: Preset K off, and the release's model flags) with CI's ctest filter: 9/9 tests pass in each.launcher-core-tests,WRONGGPU_TESTINGbuild: 406 checks pass, the junction, symlink, hard-link, test-folder junction, unwritable-log and run-id cases included.run_launcher_tests.py, full suite, with this branch's testing launcher. The RR test game's rr-prepare was answered without the GPU.[isolation-verbs]: 15/15 pass, including repair and update searching when no-scan is off and the other-model check.Not tested:
Checklist
Signed-off-by:line (git commit -s; Developer Certificate of Origin 1.1).REUSE.toml.