Skip to content

Launcher suite: green on a fresh clone - #253

Merged
phantoslayer21 merged 8 commits into
mainfrom
test/suite-fresh-clone
Nov 16, 2026
Merged

phantoslayer21 merged 8 commits into
mainfrom
test/suite-fresh-clone

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

What this changes and why

The launcher suite (clean/installer/tests/run_launcher_tests.py) should pass on a fresh clone with the suite's own test build. Six checks failed there because they assumed a release build. Each check now follows the build under test, or skips with the reason when what it needs is missing. No check is skipped without a reason, and none unconditionally.

Outdated checks, now checking what they meant to:

  • uninstall.exe is the restorer, not the launcher. It is compared byte for byte with the build's WrongGPU-Restore.exe next to the launcher. Without that file, it must be smaller than the launcher and not its bytes. The old size ratio (a quarter of the launcher) measured the test payload, not which program was installed.
  • An older record: update available. The faked earlier record uses a version below the launcher's own (read from the record: 0.3.0-test gives 0.2.9), not a fixed 0.5.1. The roll-back and repair checks after it use the same version.
  • A game without RR: no RR file. It checks the RR settings file itself (WrongGPU\wronggpu.ini) and its record line, case-insensitively. Windows names are case-insensitive, so the payload's own wronggpu\ folder is the same folder; its kernels are allowed.

Checks that depend on the build:

  • The edition download's three refusals (hash mismatch, offline without the player's own download, plain http:// to another host).
    • The section always runs with --launcher. On both routes it checks the download, cache and address rules: the download refused, nothing cached, no partial file; plain http:// to another host never used.
    • Only how a repair without any OptiScaler ends depends on the route: it goes on through the direct route (exit 0), or, without it (-DWRONGGPU_DIRECT_ROUTE=OFF, as releases), it is refused (exit 2) with the words.
    • The new --no-direct-launcher <WrongGPU.exe> runs the section again with such a build, in a pass of its own.
  • rr-prepare. The default run stays in its work folder and prepares nothing on the GPU:
    • the no-card path, with a fresh data folder;
    • with the suite's stand-in runtime, the helper's expected failure to load it, with its code and log in the reason, and with the suite's LOCALAPPDATA kept. Both run under a test build's driver answer (WRONGGPU_TEST_RR_DRIVER), so they work on any PC.
    • The checks of kernels really prepared need a payload with the real runtime. They fill the user's real graphics driver cache, so they run only with the new opt-in --rr-prepare-gpu.

The suite's own isolation (review fixes)

  • Only testing builds run, by their identity. A WRONGGPU_TESTING build links in a named resource that only such builds have (WRONGGPU_TESTING_BUILD), plus, with MSVC, a PE checksum (/RELEASE).
    • Before any program runs, the suite parses it: the resource must be in its resource directory, the checksum must match, and the test hooks' strings must be inside its sections. A program changed by one byte, or with data appended after its link, fails the checksum.
    • Checked: every launcher given (--launcher, --no-direct-launcher), their copies, the uninstall.exe they write, and the junction test's direct calls. Anything else is refused unrun: a release launcher could reach the real download page, the PC's stores and the real uninstall registry root.
  • Runnable negative controls. wg-test-canary and wg-test-canary-strings (the second carries the hooks' strings) are not testing builds and leave a start marker. They are built with the testing WrongGPU target, which then writes wg-test-build.sha256: the SHA-256 of that WrongGPU.exe and of the canaries.
    • The suite starts only canaries that list verifies as this build's, by their full path, with its own child environment. Any other file with those names is never started.
    • Each starts when run directly. The suite then refuses each, unstarted and with nothing logged, through a launcher call, the junction test's call, a program run as it is (T.raw), --launcher and --no-direct-launcher.
    • Also refused: copies of the launcher with one byte changed or data appended, and a canary with the strings and a valid checksum but no identity resource.
    • CI checks that the launcher and restorer are accepted and both canaries refused.
  • No inherited test overrides, and a temporary folder of its own. Every launcher call gets TEMP and TMP in the work folder, and no inherited WRONGGPU_TEST_* or WG_* variable. WRONGGPU_HIP_RUNTIME comes only from --hip, which must be an existing plain file, named at the start.
    • The HIP check tries only WRONGGPU_TEST_HIP_CANDIDATES, which the suite sets: the --hip mock, or in a default run a file in the work folder that is not there. A default run never loads a real HIP runtime.
    • A self-check reads the probe's own log lines: only that candidate is tried, never an inherited value (a safe stand-in file at those paths).
    • --work must be a plain folder: no junction or link in it or above it, and no ;. A self-check passes a junction as --work, and its target stays untouched.
    • Each run makes a NEW folder of its own in --work (run-<UTC time>-<pid>) and writes everything there: the isolation self-test's logs, the access log, tmp and the absent HIP candidate. The nested test instances get new folders of their own, each with its own fresh tmp. Nothing that was in --work before is written to, followed or loaded.
    • A self-check plants a symbolic link (to user data) at library-access.log and a load-marker DLL (tests/canary_dll.cpp, in the build list) at no-hip\amdhip64_7.dll. They go in a simulated work root inside the run's own folder, never in the real --work, and both are checked to work.
      • A child suite run against that root (--startup-only: the run's real start and the HIP check, then stop) makes one new run folder.
      • The link, its target and the DLL stay unchanged, with no load marker.
    • The suite writes no bytecode: run_launcher_tests.py and run_installer_tests.py set sys.dont_write_bytecode before any local import, and the suite's child Python programs get PYTHONDONTWRITEBYTECODE=1. The ; and empty --hip= refusals change nothing in the tests folder; the self-check compares a snapshot.
    • A test build's WRONGGPU_TEST_HIP_CANDIDATES, once set, is the whole candidate list: empty means no candidate, and a value too long for the old reader is still the whole list. It never falls back to the system search. An explicit empty --hip= is refused.
  • The installer README gives the complete fresh-clone commands. The canaries link with -municode under MinGW. The launcher logs where it unpacks an OptiScaler archive, and both edition passes check that folder is the run's own; the junction logs are read from it too.
  • The rr-prepare helper keeps the tests' LOCALAPPDATA, and starts only when allowed.
    • A test build's helper keeps the redirected folder (rrprep.cpp RrHelperEnvironment). It gets the real one only with WRONGGPU_TEST_REAL_DRIVER_CACHE=1, which only the opt-in --rr-prepare-gpu pass sets. The core tests check both build types and clear and restore that variable; CI runs them in its WRONGGPU_TESTING build too. The stand-in case starts from a caller environment that has the variable set, and checks the LOCALAPPDATA the helper really started with.
    • A test build starts no helper unless the test allows it (WRONGGPU_TEST_ALLOW_RR_HELPER=1: the stand-in case and the opt-in pass only). A negative control shows a game the in-game classification doesn't stop gets no helper, so a regression of RE Requiem's classification can't start one either. That control runs only with the suite's stand-in runtime; with any other runtime the helper checks are skipped, and the GPU checks need --rr-prepare-gpu.
  • One route stays outside the isolation guarantee: --run-old-baseline. It runs the 0.5.1 installer, which predates the test hooks and is not preflighted. It needs that explicit option, is documented as only for a disposable, fully redirected sandbox, and says so when it runs.
  • Follow-up for 0.6.6 (Launcher test suite: trusted build identity for executables it runs, and run the suite in CI #255): a keyed build identity, and running the launcher suite in CI.

To stay below the suite's 256 KB source limit, the rr-prepare and rr-recheck section moved to launcher_rr_prepare_cases.py, with the changes above. The build facts, the preflight and the suite's self-checks are in launcher_build_facts.py. run_installer_tests.py names its stand-in runtime as installed (STAND_IN_RUNTIME, with the release marker that #249's stand_in_runtime gives it) so the suite can recognise it. The payload it writes is byte for byte the same as before. The installer README describes the option and the skips.

What each new or substantially changed file is based on

Own design. launcher_build_facts.py is new. launcher_rr_prepare_cases.py is the section moved out of run_launcher_tests.py, reworked as described. The test hooks in rrprep.cpp (WRONGGPU_TEST_RR_DRIVER, WRONGGPU_TEST_HELPER_ENV_LOG, WRONGGPU_TEST_REAL_DRIVER_CACHE) exist only in WRONGGPU_TESTING builds.

How it was tested

On a clean clone of this branch (Windows, MSVC; APPDATA, LOCALAPPDATA, ProgramData and TMP redirected to scratch folders), with nothing else in the clone (no untracked or ignored files):

  • Prepared the stand-in payload from the clone: tests/run_installer_tests.py --prepare-only.
  • Built two launchers from the clone with that payload: a WRONGGPU_TESTING launcher (targets WrongGPU, WrongGPU-Restore and launcher-core-tests only: the canaries and the build list came with WrongGPU), and one without the direct route (-DWRONGGPU_DIRECT_ROUTE=OFF).
  • launcher-core-tests of the testing build: 485 checks pass, including the helper's environment in a test build and the HIP candidate list's fail-closed cases.
  • run_launcher_tests.py, full suite, with --no-direct-launcher pointing at the second build, as the installer README documents it (no --hip), started from an environment with WRONGGPU_TEST_REAL_DRIVER_CACHE=1 and a conflicting WRONGGPU_HIP_RUNTIME and WRONGGPU_TEST_HIP_CANDIDATES set: 491 pass, 0 fail. The suite wrote only into its new run folder in --work. Every HIP check of the run (116, nested instances included) tried only its run folder's placeholder, never a system, PATH or ROCm runtime.
    • The self-checks pass. Both canaries start when run directly and are refused, unstarted, through all four paths. Changed and appended launcher copies are refused. The RR-free check finds the settings file in the lower-case folder.
    • Both edition passes pass: the direct-route launcher's repairs end with exit 0, the other launcher's refusals with exit 2. Each pass asserts the download, cache and address rules.
    • rr-prepare: the no-card path with a fresh data folder; no helper without the test's permission; the helper failing to load the stand-in, with the suite's LOCALAPPDATA kept although the caller's environment asked for the real one. The edition archive is unpacked in the run's own temporary folder in both passes.
    • Skipped, with their reasons: the RR data conversion (no synthetic preset-F folder), the checks of RR's kernels really prepared (stand-in runtime; they need a real runtime, an RDNA 4 card and --rr-prepare-gpu), and the 0.5.1 upgrade (no 0.5.1 installer given).
    • Store paths in the suite's logs: none. The only store access outside the test folders was the Steam registry key, and it was refused.
  • Not run: --rr-prepare-gpu (it fills the real driver cache by design), and the old build against the new checks (its rr-prepare helper would use the real LOCALAPPDATA, the escape being fixed).

Checklist

  • I make the clean-room statement of CONTRIBUTING.md for this and all my contributions (required once, in my first pull request).
  • 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 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.)
  • Numbers in documents come with their measurement record. (None added.)
  • Kernel or runtime changes: none (tests only).

The checks that assumed a release build now follow the build under test:
- uninstall.exe is compared byte for byte with the build's WrongGPU-Restore.exe (the
  size ratio measured the test payload, not which program was installed);
- the faked earlier record uses a version below the launcher's own, not 0.5.1;
- the RR-free game checks the exact-case WrongGPU folder (the payload's wronggpu\ folder
  matched the case-insensitive check);
- the edition refusals run with a launcher built without the direct route
  (--no-direct-launcher), and skip with the reason when none is given;
- rr-prepare's GPU checks skip with the reason when the installed runtime is the suite's
  stand-in (moved to launcher_rr_prepare_cases.py: the suite stays below 256 KB).

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21 phantoslayer21 added this to the 0.6.5 milestone Nov 16, 2026
@phantoslayer21 phantoslayer21 added area: launcher Launcher and installer area: build-ci Build scripts, CI and repository tooling labels Nov 16, 2026
…folder, check both edition routes

Review findings on the fresh-clone suite change:

- The suite runs only WRONGGPU_TESTING builds with the test isolation hooks (store libraries,
  access log, edition download, the test Apps & features root). Every launcher it is given,
  their copies and the uninstall.exe they write are checked before they run; anything else is
  refused unrun. A self-check runs a program without the hooks and expects the refusal.
- A test build's rr-prepare helper keeps the tests' redirected LOCALAPPDATA; the user's real
  folder only with WRONGGPU_TEST_REAL_DRIVER_CACHE=1 (release builds unchanged). The core tests
  check the helper's environment in both build types, and CI runs them in a testing build too.
  The suite asserts the LOCALAPPDATA the helper really started with (WRONGGPU_TEST_HELPER_ENV_LOG).
- rr-prepare in the default run: the no-card path with a fresh data folder (the helper's run
  folder not made: an absent folder counts as empty), and the helper's expected failure to
  load the suite's stand-in runtime (result 3, exit 1, its code and log in the reason), both
  under a test driver version (WRONGGPU_TEST_RR_DRIVER), so on any PC. The checks of kernels
  really prepared need a real runtime and fill the real driver cache: only with --rr-prepare-gpu.
- The edition section always runs with --launcher. The download, cache and address rules are
  checked on both routes; only the end of a repair without any OptiScaler depends on the route
  (exit 0 through the direct route, exit 2 without it). --no-direct-launcher runs the section
  again in a pass of its own.
- The RR-free check looks for WrongGPU\wronggpu.ini itself and its record line,
  case-insensitively (the payload's lower-case wronggpu\ folder is the same folder on Windows);
  a self-check puts the file in that folder.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…verrides, no helper without permission

Re-check findings on the fresh-clone suite change:

- A WRONGGPU_TESTING build links in a named resource (WRONGGPU_TESTING_BUILD) and, with MSVC,
  a PE checksum (/RELEASE). The suite's preflight parses the program: the resource in its
  resource directory, a checksum that matches (a byte changed or data appended after the link
  fails) and the hooks' strings inside its sections.
- Negative controls: wg-test-canary and wg-test-canary-strings (testing-build CMake targets;
  not testing builds, the second carrying the hooks' strings) leave a start marker. They start
  when run directly and are refused by a launcher call, --launcher and --no-direct-launcher;
  changed and appended copies of the launcher are refused too. CI checks the identity of the
  launcher and restorer and the refusal of both canaries. The junction test's direct calls go
  through the preflight.
- Every launcher call gets TEMP and TMP in the work folder and no inherited WRONGGPU_TEST_* or
  WG_* variable; the opt-in pass alone sets the real driver cache. The core test clears and
  restores that variable; the stand-in helper case starts from a caller environment that has it
  set and still sees the redirected LOCALAPPDATA.
- A test build starts no rr-prepare helper unless the test allows it
  (WRONGGPU_TEST_ALLOW_RR_HELPER=1: the stand-in case and --rr-prepare-gpu). A negative control
  shows a game the in-game classification does not stop gets no helper.
- The launcher logs where it unpacks an OptiScaler archive; the edition passes check that it is
  the run's own temporary folder.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…st's call

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
… temporary folder

Re-check findings on the fresh-clone suite change:

- WRONGGPU_HIP_RUNTIME is stripped from the inherited environment and set only from --hip;
  a self-check starts with a conflicting inherited value and checks hipcheck's library.
- The canaries are built with the testing WrongGPU target (a dependency), which then writes
  wg-test-build.sha256: the SHA-256 of that WrongGPU.exe and of the canaries. The suite starts
  only canaries that list verifies as this build's, by full path, with its own child
  environment; they are also refused through T.raw now. CI builds the launcher target alone.
- The helper-permission negative control runs only with the suite's stand-in runtime; with any
  other runtime, rr-prepare's helper checks are skipped and its GPU checks need --rr-prepare-gpu.
- <work>\tmp is removed and made anew at the start; a junction or link in its place or above it
  stops the run (a self-check puts a junction there).
- --run-old-baseline is documented as running the 0.5.1 installer outside the suite's
  isolation guarantee, and says so when it runs.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…hecked first

Re-check findings on the fresh-clone suite change:

- Every launcher call gets WRONGGPU_TEST_HIP_CANDIDATES (a test build tries only those, never the
  system's, PATH's or ROCm's runtime): the --hip mock, else a file in the work folder that is
  not there, so a default run never loads a real HIP runtime. A self-check reads the probe's own
  lines: only that candidate is tried, never an inherited WRONGGPU_HIP_RUNTIME or candidate list
  (a safe stand-in file at those paths).
- --hip must be an existing plain file, and the suite names it at the start.
- --work and the folders above it are checked for junctions and links before the isolation
  self-test or anything is made or removed; a self-check gives the suite a junction as --work and
  finds its target untouched.
- The canaries link with -municode under MinGW, as the launcher and restorer.
- The installer README gives the complete fresh-clone commands: the mock payload, the testing
  WrongGPU target (with and without the direct route) and the suite.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
… fail-closed

Re-check findings on the fresh-clone suite change:

- Each run makes a NEW folder of its own in --work (run-<UTC time>-<pid>, never an existing one)
  and writes everything there: the isolation self-test's logs, the access log, tmp, the absent
  HIP candidate; nested test instances (the junction regression, convert-ignore) get new
  folders of their own with their own fresh tmp. Nothing that was in --work before is written
  to, followed or loaded: a self-check plants a link at <--work>\library-access.log and a
  load-marker DLL (tests/canary_dll.cpp, in the build list) at <--work>\no-hip, and finds the
  target, the link and the DLL unchanged and no load marker.
- A test build's WRONGGPU_TEST_HIP_CANDIDATES, once set, is the whole candidate list even when
  it is empty (no candidate) or longer than EnvVar reads; never the system, PATH or ROCm search.
  The core tests check both.
- --work holding ';' and an explicit empty --hip= are refused before anything is made.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…; no bytecode writes

Re-check findings on the fresh-clone suite change:

- The control plants both fixtures (a link at library-access.log to user data and the
  load-marker DLL at no-hip\amdhip64_7.dll) in a simulated work root inside the run's own
  folder, never in the real --work, and checks both work. A child suite run against that root
  (--startup-only: the run's real start and the HIP check, then stop) makes one new run folder
  and leaves the link, its target and the DLL unchanged, with no load marker.
- run_launcher_tests.py and run_installer_tests.py set sys.dont_write_bytecode before any local
  import, and the suite's child Python programs get PYTHONDONTWRITEBYTECODE=1: the ';' and
  empty --hip= refusals change nothing in the tests folder, which the self-check compares.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 16, 2026 04:48
@phantoslayer21
phantoslayer21 merged commit 69cd2ab into main Nov 16, 2026
10 checks passed
@phantoslayer21
phantoslayer21 deleted the test/suite-fresh-clone branch November 16, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-ci Build scripts, CI and repository tooling area: launcher Launcher and installer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant