Repository navigation
Launcher suite: green on a fresh clone - #253
Merged
Merged
Conversation
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>
…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>
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 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.exeis the restorer, not the launcher. It is compared byte for byte with the build'sWrongGPU-Restore.exenext 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.0.3.0-testgives0.2.9), not a fixed0.5.1. The roll-back and repair checks after it use the same version.WrongGPU\wronggpu.ini) and its record line, case-insensitively. Windows names are case-insensitive, so the payload's ownwronggpu\folder is the same folder; its kernels are allowed.Checks that depend on the build:
http://to another host).--launcher. On both routes it checks the download, cache and address rules: the download refused, nothing cached, no partial file; plainhttp://to another host never used.-DWRONGGPU_DIRECT_ROUTE=OFF, as releases), it is refused (exit 2) with the words.--no-direct-launcher <WrongGPU.exe>runs the section again with such a build, in a pass of its own.LOCALAPPDATAkept. Both run under a test build's driver answer (WRONGGPU_TEST_RR_DRIVER), so they work on any PC.--rr-prepare-gpu.The suite's own isolation (review fixes)
WRONGGPU_TESTINGbuild links in a named resource that only such builds have (WRONGGPU_TESTING_BUILD), plus, with MSVC, a PE checksum (/RELEASE).--launcher,--no-direct-launcher), their copies, theuninstall.exethey 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.wg-test-canaryandwg-test-canary-strings(the second carries the hooks' strings) are not testing builds and leave a start marker. They are built with the testingWrongGPUtarget, which then writeswg-test-build.sha256: the SHA-256 of thatWrongGPU.exeand of the canaries.T.raw),--launcherand--no-direct-launcher.TEMPandTMPin the work folder, and no inheritedWRONGGPU_TEST_*orWG_*variable.WRONGGPU_HIP_RUNTIMEcomes only from--hip, which must be an existing plain file, named at the start.WRONGGPU_TEST_HIP_CANDIDATES, which the suite sets: the--hipmock, or in a default run a file in the work folder that is not there. A default run never loads a real HIP runtime.--workmust 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.--work(run-<UTC time>-<pid>) and writes everything there: the isolation self-test's logs, the access log,tmpand the absent HIP candidate. The nested test instances get new folders of their own, each with its own freshtmp. Nothing that was in--workbefore is written to, followed or loaded.library-access.logand a load-marker DLL (tests/canary_dll.cpp, in the build list) atno-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.--startup-only: the run's real start and the HIP check, then stop) makes one new run folder.run_launcher_tests.pyandrun_installer_tests.pysetsys.dont_write_bytecodebefore any local import, and the suite's child Python programs getPYTHONDONTWRITEBYTECODE=1. The;and empty--hip=refusals change nothing in the tests folder; the self-check compares a snapshot.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.-municodeunder 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.LOCALAPPDATA, and starts only when allowed.rrprep.cppRrHelperEnvironment). It gets the real one only withWRONGGPU_TEST_REAL_DRIVER_CACHE=1, which only the opt-in--rr-prepare-gpupass sets. The core tests check both build types and clear and restore that variable; CI runs them in itsWRONGGPU_TESTINGbuild too. The stand-in case starts from a caller environment that has the variable set, and checks theLOCALAPPDATAthe helper really started with.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.--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.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 inlauncher_build_facts.py.run_installer_tests.pynames its stand-in runtime as installed (STAND_IN_RUNTIME, with the release marker that #249'sstand_in_runtimegives 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.pyis new.launcher_rr_prepare_cases.pyis the section moved out ofrun_launcher_tests.py, reworked as described. The test hooks inrrprep.cpp(WRONGGPU_TEST_RR_DRIVER,WRONGGPU_TEST_HELPER_ENV_LOG,WRONGGPU_TEST_REAL_DRIVER_CACHE) exist only inWRONGGPU_TESTINGbuilds.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):
tests/run_installer_tests.py --prepare-only.WRONGGPU_TESTINGlauncher (targetsWrongGPU,WrongGPU-Restoreandlauncher-core-testsonly: the canaries and the build list came withWrongGPU), and one without the direct route (-DWRONGGPU_DIRECT_ROUTE=OFF).launcher-core-testsof 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-launcherpointing at the second build, as the installer README documents it (no--hip), started from an environment withWRONGGPU_TEST_REAL_DRIVER_CACHE=1and a conflictingWRONGGPU_HIP_RUNTIMEandWRONGGPU_TEST_HIP_CANDIDATESset: 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.LOCALAPPDATAkept 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.--rr-prepare-gpu), and the 0.5.1 upgrade (no 0.5.1 installer given).--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 realLOCALAPPDATA, the escape being fixed).Checklist
Signed-off-by:line (git commit -s; Developer Certificate of Origin 1.1).REUSE.toml.