Skip to content

R1: no in-game route to HIP; GPU identity from the driver; other cards use the front end's upscaler - #225

Merged
phantoslayer21 merged 20 commits into
mainfrom
r1/non-rdna4
Nov 15, 2026
Merged

phantoslayer21 merged 20 commits into
mainfrom
r1/non-rdna4

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Refs #15 (R1 of the 0.6.5 release plan: in a game every model runs on the D3D12 runtime). Based on main with the Model K runtime (#215) merged; the branch is rebased on main (20 commits, no merge commit, every commit signed off).

On a GPU that is not an RX 9000-series card, WrongGPU's networks cannot run (their kernels are built for RDNA 4 only), yet "auto" tried the HIP executor first and failed at kernel load before the front end handed the game to AMD FSR. And on an RX 9000 card several routes still led to HIP in a game. This PR sends other cards to the front end's own upscaler at once, identifies the card by the driver's PCI ids, and closes every in-game route to HIP: nothing in a game starts HIP, in any release build, whatever the game's files say.

What changes

  • No HIP in a game (executor_select.h, backend.cpp, build.py):
    • executor=hip (profile, wronggpu.ini, WG_RUNTIME_OPTIONS) and capture_dir (also together with executor=dx12) are developer diagnostics. A release build ignores both, with one warning line each (executor=hip ignored: diagnostic key, release build; ..., capture_dir ignored: ...), and the context stays on Direct3D 12 (with capture_dir dropped before anything is made).
    • They work only in a developer build, made with the compile-time define WG_DEV_DIAGNOSTICS (clean/runner/build.py --dev-diagnostics). The define is off in the default build and in every CI job and release path; the runtime library says which kind it is (wgBuildMarker: wg-build dev-diagnostics=0|1), clean/tests/check_no_dev_diagnostics.py <library or folder> fails on a library that says =1, has no marker, or on a path with no library, and clean/tests/test_dev_diagnostics_off.py (in the CI Python tests) checks that the build script adds the define only on request, that no CI, release or installer file turns it on, and the checker itself. The package cannot carry it, and the gate rests on the build, not on marker bytes. build.py writes a build manifest next to the runtime library (wronggpu_runtime.build.json: the configuration, dev_diagnostics, and the SHA-256 of the library). The payload packager (clean/installer/tools/make_payload.py) accepts a runtime library only when its SHA-256 matches a manifest that says dev_diagnostics is false, its marker says dev-diagnostics=0, and none of the texts that exist only in the diagnostics' code is found in it (those texts, the executor=hip and frame-capture lines, are compiled only into a developer build, so a release library has none); otherwise it refuses the payload, failing closed (no manifest, a manifest of another file or another build, a library changed after its build, a stripped library, a developer build, a forged =0 marker). The manifest is read for the gate and is not shipped. The checker also reads zip files and executables, and tools/release/check_package_diagnostics.py <final zip | folder | launcher exe> runs the marker and code-text checks on the final package (a path with no runtime found fails). CI builds the real runtime library in the release configuration (Model L and K on) and as a developer build (tools/ci/check_release_runtime.py, in the release-models job: build.py --runtime-only --no-embed, the C++ runtime without the GPU code objects) and checks those libraries: the release one passes the real packager; the developer one, the same with its marker forged to =0, a release library stripped of its marker, one changed after its build and one without its manifest are refused. Threat model, in one sentence: the gate stops an accidental developer build from shipping; a person who forges a library and its manifest on the build machine defeats any local check, so release provenance is the CI build and the tested record. The release script must keep each runtime's .build.json next to the library it packages, and must not change the library after the build (signing or stripping after the build breaks the match and refuses the payload: regenerate through build.py).
    • hip_switch=on (it moved a model M or L context to HIP after a refused frame) is ignored for every model with one line; the switch code is removed.
    • The sparkle guard (HIP only) is turned off for every model with one line; Quality 5 / Quality 9 (HIP only) fall back to the default output filter with one line: for a context on the D3D12 executor the runtime drops the option, the last output_filter wins as in the runtime.
  • A refused frame always goes back to the front end (backend.cpp): a frame the D3D12 executor does not take is answered WG_ERROR_UNSUPPORTED for every model and every executor choice, also a forced executor=dx12 (it used to take a bilinear path there); the front end gives it to AMD's FSR, else the stand-in. No substitute image is made here.
  • A refused create always goes to the front end's upscaler (frontend.cpp, config.h/.cpp): a create the runtime answers WG_ERROR_UNSUPPORTED (an adapter that is not RDNA 4, a build without its D3D12 kernel set, a D3D12 executor that cannot take the context) is a hard incompatibility, not a runtime failure: the context goes to AMD's FSR whatever fallback_to_amd says (the option keeps governing runtime failures). With no AMD provider the answer is NO_PROVIDER, explicit (documented in clean/fsr/README.md). The wait that was unbounded when nothing could upscale meanwhile (fallback_to_amd = 0, or a custom slot without an AMD DLL of its own) is bounded by create_giveup_ms (default 30000): on timeout the create is refused, logged, and the context goes to AMD's FSR for now (a late result takes over, as for a create that outlasts create_wait_ms). The same bounded asynchronous path serves the retry without the split service (when the hooks cannot be installed after a successful first create), so a stalled retry hands over too. A retry that is still running when the call returns stores no session failure (a custom slot would otherwise refuse every later create of these options), and a late success clears any stored one. A remembered refusal (custom slot) keeps its classification: a hard incompatibility hands over to the available provider on a repeat exactly as on the first create, also with fallback_to_amd = 0 and without a new attempt; a runtime failure stays an error. The create worker owns the device: a COM reference on the game's D3D12 device is taken on the game's thread before the worker starts and released by the worker as its last step, also after a timeout (the FidelityFX route and the FSR 3.0 route), so a late worker never meets a released device. The reference is owned by an RAII object (ScopedRelease, built before the reference is taken, so an allocation that throws leaks nothing; its callable is a named class, not a lambda, because MSVC's /Zc:lambda, which /permissive- turns on in the CI builds, terminates the process when the copy of a lambda's capture throws; tests observe the order and drive a throwing copy, which now reaches the caller as an exception): given back when the worker finishes, at once when the worker could not be started (the create then fails with WG_ERROR_DEVICE; nothing is thrown into the game's thread), and when anything between taking it and starting the worker throws.
  • GPU identity: the driver's PCI ids, nothing else, failing closed (rdna4.h, rdna4_win.h, device_d3d12.cpp, backend.cpp, rr_runtime.cpp): an adapter is RDNA 4 when the kernel-mode driver's vendor and device id for the game device's LUID say so (D3DKMTQueryAdapterInfo, resolved from gdi32 at run time); the system's own DXGI is read for the log line only and a description never accepts or rejects an adapter. The id list holds every RX 9000-series id known today (7550, 7551, 7590, 7591); an unknown AMD id gets AMD FSR and the message, with the ids in the line. No AMD AGS library in 0.6.5: TODO for 0.6.6, an AGS family check (decide on bundling the library, then add its answer as a second source through AdapterSources; never accepting alone). The native device and the RR runtime use the same rule.
  • Launcher: executor=hip is no game setting: a profile.ini or wronggpu.ini that holds it loses the key when it is read (executor is auto|dx12; the next Apply writes wronggpu.ini without it), and install, repair and update log the removal (executor=hip removed: ...). "Runs on" offers Auto and Direct3D 12 only. Quality 5 / 9 and the sparkle guard are shown greyed with "Not available on the DX12 runtime yet". The toolbar's GPU line says "detected" and gives the RX 9000 / AMD FSR sentence for another card.

The hard rule, and where it is enforced

A refused D3D12 route never falls back silently to HIP or to a reference path in a release build. The selector enforces it: choose_executor can return the HIP executor only inside a WG_DEV_DIAGNOSTICS block (a release library does not contain that code or its texts); a test runs it over every executor word (auto, dx12, hip, an unknown word, a reference-like word), every model, the capture and the sparkle guard, an RDNA 4 board, another board and an unidentified one, in both configurations, and finds no release choice that is HIP (the only other answers are the D3D12 executor, no context so that the front end's upscaler takes the game, and the explicit offline test executor). After the choice: a create the D3D12 executor refuses ends in one loud line and no context (the front end's upscaler), and a refused frame is answered WG_ERROR_UNSUPPORTED for every model; neither builds an executor of its own, no substitute image is made (source pins in test_executor_select.py). A failure inside a network frame that has already started returns an error to the front end (it records no success); the front end's upscaler then takes the frame, with a log line.

Every route from an RX 9000 card to HIP in a game, and where it stands

  • executor=hip / capture_dir (also with executor=dx12): closed in release builds (ignored, one line, D3D12). Developer builds only.
  • H2, the D3D12 executor refusing a context at create: closed as the loud safety net: one warning line, no context, no HIP, the front end's upscaler keeps the game (even with fallback_to_amd = 0); the matrix below proves no supported context reaches it. Remaining: the in-game overlay message (the overlay status carries no executor yet): front end, owner a8.
  • H3 Quality 5 / 9: closed (greyed in the launcher; an ini that asks anyway gets the default filter and one line). Remaining: the D3D12 port of the two filters (param).
  • H4 sparkle guard: closed as off for every model. Remaining: its D3D12 port (kern3 / param).
  • H5 launcher "Runs on: HIP": closed (not offered, key removed on read). The game page's read-only "Runs on" row shows what the log says ("Direct3D 12").
  • H7 hip_switch=on: closed. R1-b / R1-c (capture as a loud diagnostic, the selector tests' level and comments): superseded by the ignore rule; the selector tests assert the release configuration and the developer one. H8 identity: closed.

Tested

  • test_executor_select.cpp (ROCm clang++), run by clean/tests/test_executor_select.py in both configurations (a release build and one with WG_DEV_DIAGNOSTICS; 9 tests with the source pins) and test_dev_diagnostics_off.py (11 tests: build.py writes the manifest of what it built; the build flag; no CI, release or installer file turns the diagnostics on; the checker; and the real packager: a release runtime with its manifest is packaged (the manifest is not shipped); no manifest, a developer build, a diagnostics build with a forged =0 marker (refused by the code-text scan and by the manifest), a stripped library, a library changed after its manifest, another library's manifest, an unreadable manifest, a second library and any other file carrying the developer runtime or its code text each refuse the payload, and nothing is written for a refused payload; the final-package check on zips, launcher executables and folders): for models M, L and K, in the developer configuration the old diagnostic routes, in the release configuration executor=hip and capture_dir (alone, with executor=dx12, together) ignored with the right lines and the context on D3D12 (also on another board: the front end's upscaler); the sparkle guard, hip_switch, the Quality 5 / 9 fallback, the identity rule and lookup, the create-refusal line. Pins on the source of Context::create: the ignored keys are logged and capture_dir dropped before anything is made, a refused frame returns WG_ERROR_UNSUPPORTED with no policy function and no bilinear branch, hip_switch reaches no model-specific code.
  • test_frontend.cpp (1409 checks, 0 failures; ROCm clang++): a create answered WG_ERROR_UNSUPPORTED goes to AMD's FSR with fallback_to_amd on and off (the line says the option did not apply); a runtime failure still returns the error with fallback_to_amd = 0; no AMD provider: NO_PROVIDER with and without the fallback; a create that never finishes with fallback_to_amd = 0 returns after create_giveup_ms with AMD's FSR (waited for the bound, not longer than a few seconds in the test) and the late create is cleaned up on destroy. Device lifetime: with a stalled worker past the timeout (with an AMD context, and with NO_PROVIDER) and the host's device reference released meanwhile, the worker runs on a live device and gives its reference back (retains = releases); the same sequence without the hold is caught by the harness (negative control). Split retry: the first create works, the hooks cannot be installed, the second create stalls: the call returns after the bound with AMD's FSR and the first worker's reference is released while the stalled one still holds its own (both with and without fallback_to_amd). Pending retry stores nothing: custom slot, the retry past the wait limit then succeeding: no failure is remembered while it runs, WrongGPU takes the context over, and the next create is a real attempt that uses WrongGPU. Launch failure: a worker that cannot be started (an injected launcher that throws) is a failed create without an exception, the device reference is given back at once (retains = releases), with and without fallback_to_amd; ScopedRelease releases exactly once through moves and repeated calls. Remembered refusal: custom slot, an AMD provider, fallback_to_amd = 0: an UNSUPPORTED create hands over three times in a row with one real attempt; a runtime failure stays ERROR_RUNTIME_ERROR on the repeats with one real attempt.
  • MSVC syntax check of the Windows-only front-end files this PR changes (Visual Studio 2026 cl /Zs /std:c++17, no errors and no warnings: dllmain.cpp, dll_fsr3.cpp, dll_fsr3upscaler.cpp, win_util.cpp, fsr30_hook.cpp, frontend.cpp, async_create.cpp: the device reference of the FidelityFX and FSR 3.0 create routes). CI is CPU-only and cannot run these DLL entry points; a clang syntax pass and the fake-backend tests cover the same code.
  • launcher_core_tests (426 checks) and wg_core_tests (92 checks), built with the ROCm clang++: executor=hip in profile.ini is removed and reported, the saved profile no longer holds it, the same for an imported wronggpu.ini (and the next Apply writes it without the key), it is not offered as a change made outside the launcher, set refuses it, executor=dx12 is still kept; NeedsHipRuntime and the help texts. The launcher files this PR edits pass an MSVC syntax-only compile; the full launcher target is built by CI.
  • H2 on an RX 9000 card, every model, release build of the runtime (built from this tree with Model L; its marker says dev-diagnostics=0; test_interop_d3d12 matrix, driver clean/k/runner/k_refusal_matrix.py, official ROCm 7.2, one GPU slot per run). Each run creates default-executor contexts for one output height (1080, 1440 or 2160) with each of the five upscaler-mode ratios (1.0, 0.667, 0.58, 0.5, 0.333), the declared maximum render size both a little above the render size and equal to the output, and HDR (RGBA16F) and LDR (RGBA8) output: 20 contexts, each given one frame. A context passes only when it logs network runtime ready: executor dx12, its frame returns OK, and there is no create-refusal line and no HIP start-up line.
    • Model M (converted model file, sha256 bfbd9dad238721fb51ed60e85ceb9789ddb3468c3538efb651d09f8ca820c350), Model L (converted model file, sha256 d3c040191ec7ab0164efc03ee76413277e7fb54e6e6d2b168f2c0202aa1ad806), Model K (synthetic model from random parameters): for each, 1080, 1440 and 2160: 60 contexts, 60 on D3D12, 0 create refusals.
    • hip_switch=on leg (1080, 20 contexts per model): the one hip_switch=on is ignored line each, still D3D12.
    • Diagnostic-keys leg (executor=hip and capture_dir=<folder> in the options, 1080, 20 contexts per model): each context logs both ignored: diagnostic key, release build lines and stays on D3D12, 0 refusals (the case fails on a developer build).
    • Negative control (earlier run of the case): against a build folder without the D3D12 kernel set all 20 contexts of the run were refused with the create-refusal line (no context, no HIP) and the case failed.
    • The model files were read in place from local folders, which were not modified; only their hashes are named here.
  • public_gates.py: the must-pass gates pass; the LOOK counts equal main's (leak-plain 42, leak-layout 29, numbers 143).

Not tested

  • A game session per model: the matrix drives the runtime with the test harness's synthetic frames, not a game; the in-game proof per model is the release lead's C3 record. The front end's handover rules are tested with fake backends, not with the real runtime and AMD's FSR together.
  • The real, signed package: the gate is tested on the libraries built from this tree (a CI step builds them without the GPU code objects) and on synthetic files; running tools/release/check_package_diagnostics.py on the package that is published, and keeping each library's manifest next to it, is the release step (release lead). CI has no runtime library to build, so no CI step builds the real one.
  • The launcher UI by eye: the greyed items and the two-segment "Runs on" are syntax-checked and covered through the settings logic, not looked at in a running launcher; the launcher end-to-end suite was not run.
  • The overlay message for a create refusal (the front end's status carries no executor yet): not in this PR, owner a8.
  • rr_runtime.cpp's set-device identity check was syntax-checked and is built in the CI plugin job; no RR run with it. A real spoofed game session: the ids are read where the spoof cannot change them, but no game was run with the switch on. A GPU that is not an RX 9000: none is available here; the other-card paths are covered by the lookup and selector tests with the ids such a card gives.
  • The D3D12 ports of the Quality 5 / 9 filters and of the sparkle guard (owners above).

@phantoslayer21
phantoslayer21 marked this pull request as draft November 15, 2026 01:56
@phantoslayer21 phantoslayer21 changed the title R1: non-RDNA-4 adapters use the front end's upscaler; GPU identity from the driver R1: no in-game route to HIP; GPU identity from the driver; other cards use the front end's upscaler Nov 15, 2026
@phantoslayer21
phantoslayer21 force-pushed the r1/non-rdna4 branch 2 times, most recently from 4dc2e6f to f08ce3c Compare November 15, 2026 18:13
…om the driver

Executor choice (executor_select.h, backend.cpp): "auto" on an adapter that is not
an RDNA 4 Radeon RX 9000-series card, or one that cannot be identified, no longer
tries the HIP executor (its kernels are RX 9000-only and the attempt only failed at
kernel load): the context is not created, one warning line says "WrongGPU's models
need an RX 9000-series GPU; using AMD FSR (adapter ...)", and the front end's own
upscaler takes the game. The same for every model. RDNA 4 auto is unchanged
(models M, L, K on the D3D12 executor); explicit executor=hip stays a loud diagnostic;
the sparkle guard (M, L) and the frame capture choose HIP with a warning line.

GPU identity (rdna4.h, new rdna4_win.h, device_d3d12.cpp): the adapter is identified
from the system's own dxgi.dll (loaded by its full path, not the proxy a game
folder may hold under that name) and from the kernel-mode driver's vendor and device
id, never from the description OptiScaler's GPU spoofing can rewrite. A real
RX 9000 keeps WrongGPU under any displayed name; another board does not become one.
The native D3D12 device uses the same rule, so a spoofed name no longer makes it
refuse a real RX 9000.

Launcher: the toolbar's GPU line and the first-run check say the same sentence on
other cards (GpuRuntimeLine, NeedsRx9000Sentence in wg_core, with tests); the old
"HIP" and "Not supported" words are gone.

Tests: test_executor_select.cpp (non-RDNA-4, unidentified, spoofed name on a real
RX 9000 id, real non-RDNA-4 id, RDNA 4 auto unchanged, warning levels),
wg_core_tests.cpp (the launcher line).

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…for any model; RR uses it too (REVIEW-225)

Identity (rdna4.h, rdna4_win.h): an adapter is RDNA 4 when the kernel-mode driver's
vendor and device id for the game device's LUID say so, and for no other reason. The
description never accepts or rejects (not even "KMT failed but the name says RX
9070"); ids that cannot be read, or are not RDNA 4's, are refused with the one line,
which carries the description and the ids so that a board missing from the id list
shows in a log. The lookup takes its two sources as functions (AdapterSources), so the
CPU tests cover several adapters with the game's LUID selecting one, a spoofed name on
an RX 9000 id, a supported-looking name on another id, and a failing driver query or
DXGI. The AMD AGS library is not part of this project's build (the "AGS" in the
repository is the WMMA intrinsic channel of the shaders), so the id list is the only
source; it is noted in the pull request.

Executor choice (executor_select.h, backend.cpp): a D3D12 refusal at create (driver
probe, device preparation, network init) is the front end's fallback for every model,
one line, never the HIP executor; the sparkle guard is turned off for every model with
one line and the model stays on D3D12; HIP only with an explicit executor=hip or the
frame capture, both loud. hip_switch=on for models M and L (an explicit ini option) is
unchanged.

RR (rr_runtime.cpp): set-device identifies the game device's adapter by the same ids
before anything is created and refuses an unknown or unsupported one with the shared
sentence; its other adapter checks use the same rule.

Launcher: the toolbar line is worded "detected" and shows the sentence for no card and
for an unidentified one too (GpuToolbarLine).

Tests: clean/tests/test_executor_select.py builds and runs the selector test in the
Python tests (CI) and pins the order of Context::create from the source; the GPU
interop harness expects WG_TEST_EXPECT=refused instead of a HIP context.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…in a game

The 0.6.0 option hip_switch=on moved a model M or L context to the HIP executor
for good. Under R1 the only HIP left is an explicit executor=hip and the frame
capture, so the option is ignored for models M, L and K alike, with one log line
at create. The switch code, its retired-executor bookkeeping and the policy
type are gone; the selector tests and a source pin cover the three models.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…ows HIP-only choices as not available

The runtime drops output_filter=quality5|quality9 for a context on the D3D12
executor (default filter, one line, no HIP). The launcher offers Auto and
Direct3D 12 only under Runs on, greys the two filters and the sparkle guard
with 'Not available on the DX12 runtime yet'. Selector tests and source pins
cover the filter fallback.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…al (H2)

launcher_core_tests: NeedsHipRuntime and the help texts. test_interop_d3d12:
matrix case (every DLSS-style ratio x output x declared maximum x HDR/LDR gets a
default-executor context and a frame; none may reach the create refusal or a
HIP line); clean/k/runner/k_refusal_matrix.py drives it with a synthetic model K.
ui_activate: Runs on has two segments.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…tch=on case

The matrix case reads the output with the any-format readback (the LDR output is
RGBA8), recognises a HIP executor by its ready line and the switch line by its
text, and with hip_switch=on in the options requires the one 'ignored' line per
context. The driver takes --hip-switch-on.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
--model M|L --model-dir <folder> runs the same contexts with the files the caller
names (M: model.wgcm in the folder; L: L/model.wgcm); K keeps the synthetic model.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…the front end

Release builds ignore executor=hip and capture_dir with one logged line each
('ignored: diagnostic key, release build') and keep the context on Direct3D 12; the
two diagnostics exist only in a developer build (WG_DEV_DIAGNOSTICS, build.py
--dev-diagnostics). The library says which kind it is (wgBuildMarker) and
check_no_dev_diagnostics.py checks it. A profile.ini or wronggpu.ini that holds
executor=hip loses the key (install, repair and update log it).

A refused frame is answered WG_ERROR_UNSUPPORTED for every model and every executor
choice, also a forced executor=dx12: no bilinear substitute. A create the runtime
refuses as a hard incompatibility (WG_ERROR_UNSUPPORTED) goes to the front end's
upscaler whatever fallback_to_amd says; a create that does not finish in
create_giveup_ms (30 s) is refused and handed over instead of waiting for ever.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
A release build of the runtime ignores both keys (one line each) and every context
stays on Direct3D 12; --diag-keys in the driver adds them. The case fails on a
developer build, which runs them.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
… the device; bounded retry; remembered refusals keep their class

make_payload.py runs check_no_dev_diagnostics on every embedded file and refuses the
payload for a runtime that says dev-diagnostics=1 or has no marker; the checker reads
zips and executables; tools/release/check_package_diagnostics.py runs it on the final
package; a CI step runs the real packager on both markers.

The create worker takes a COM reference on the game's D3D12 device before it starts and
releases it as its last step (also after a timeout), for the FidelityFX route and the
FSR 3.0 route. The retry without the split service goes through the same bounded
asynchronous path as the first create. A remembered custom-slot refusal keeps its
classification: a hard incompatibility hands over to the available provider on a repeat
exactly as on the first create.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…ailures; owned device reference

build.py writes <library>.build.json (configuration, SHA-256 of the library). The payload
packager accepts a runtime library only when its SHA-256 matches a manifest that says
dev_diagnostics is false, the marker says =0 and none of the texts that exist only in the
diagnostics' code is found (those texts are now compiled only into a developer build); the
manifest itself is not shipped. tools/ci/check_release_runtime.py builds the runtime in
release and developer configuration and checks both, with a forged marker, a stripped
library and a changed library.

A split retry that is still running stores no session failure and a late success clears one.
The create worker's device reference is owned by an RAII object: given back when the worker
finishes, when it could not be started (the create then fails, nothing throws) and on any
exception before it starts.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…manifest only when the library exists

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…f an allocation throws)

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

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…guration aborted on one)

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…wing copy terminates under /Zc:lambda

MSVC's /Zc:lambda (on with /permissive-, as in the CI builds) terminates the process when the
copy of a lambda's capture throws, instead of unwinding. AcquireHold's lambda captured a
std::function by copy, so a failed allocation while the owner is built (std::bad_alloc from
copying a large callable) would have been a std::terminate in a release build. The callable is
now a class whose constructor does the copy (that unwinds normally), and the test that drives a
throwing copy is back: it passes in the CI configuration.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 15, 2026 21:32
@phantoslayer21
phantoslayer21 merged commit bf0654e into main Nov 15, 2026
10 checks passed
@phantoslayer21
phantoslayer21 deleted the r1/non-rdna4 branch November 15, 2026 21:32
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>
phantoslayer21 added a commit that referenced this pull request Nov 15, 2026
Since the payload gate (#225), a WRONGGPU_TESTING launcher built from the mock payload stopped at
"Embedding the payload": the stand-in runtime had no "wg-build dev-diagnostics=0" marker and no
build manifest.

- The suite's prepare step (run_installer_tests.py --prepare-only) writes the stand-in runtime
  with the marker and a build manifest for its exact bytes that says stand_in.
- make_payload.py embeds a stand-in runtime only with --testing, which CMake passes in
  WRONGGPU_TESTING builds; any other build refuses it at the payload step. A real payload is
  checked exactly as before. The release path never passes --testing or WRONGGPU_TESTING.
- build-mingw.sh (the Wine runner's build) is a WRONGGPU_TESTING build; RELEASE=1 makes a
  release-type build that refuses the stand-in.
- CI builds the testing launcher from the stand-in payload and checks that a release build with
  the same payload refuses it (the negative control). The packager tests cover the stand-in with
  and without --testing.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 16, 2026
… text offers HIP (#250)

Three test_ui_dump checks failed on main since #225. The launcher's behaviour did not regress:
the dump's probes drove controls #225 disabled or removed.

- Discard from the keyboard and Space on key-up acted on Sparkle guard, which is now off and
  disabled (no Direct3D 12 port); a disabled switch takes no focus and no Space. Both probes now
  use Pre-exposure's Original.
- Advanced settings opening for a saved value off its default saved Runs on as HIP, which is no
  longer a Runs on value (auto|dx12). The probe now saves Direct3D 12; the unsaved case changes
  Pre-exposure.
- No launcher text offers HIP as a choice any more: the first-run check and Settings' HIP runtime
  row say Model M runs on Direct3D 12 without it, the note about another HIP tool says WrongGPU
  doesn't use HIP in a game, and the installer README lists executor as auto | dx12.

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 16, 2026
…driver's id query is not implemented (#252)

Wine and Proton answer the driver's PCI id query (D3DKMTQueryAdapterInfo type 31) with
STATUS_NOT_IMPLEMENTED, so #225's RDNA 4 check refused every board there.

- Only when the query returns exactly STATUS_NOT_IMPLEMENTED and the process runs under Wine
  (ntdll exports wine_get_version), the system DXGI's vendor and device id of the adapter with
  the game device's LUID stand in, against the same vendor and RDNA 4 id list.
- Any other status, a query that could not be made, the same status outside Wine, or DXGI not
  answering: refused as before. When the driver's ids are read, they alone decide.
- One log line when the fallback accepts an adapter (the executor choice and the Ray
  Reconstruction runtime).
- Tests with injected query results, including that the Windows path never asks the fallback's
  sources; the test's MSVC build uses /permissive-.

Fixes #248

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
…hantoslayer21#225's no-name-rule pin

clean/tests/test_executor_select.py (CreateOrder.test_no_name_rule_left, phantoslayer21#225) requires that clean/runtime/rdna4.h
contains no find( outside comments, so that no GPU name rule can come back into the identity code. The parser of the
WG_DEV_GFX11_NATIVE_K list (developer builds only) used std::string::find to split at commas and broke that pin. It now
walks the characters; the entries, the exact-name match and the treatment of stray commas are unchanged.

Verified: test_executor_select and test_dev_gfx11_native_k (the host build of the list cases with and without
WG_DEV_GFX11): 20 tests OK. With the separator changed to ';' on purpose the list cases fail ("a listed port switches",
"the first and the last entry switch", "a list selects only its names"); restored, green.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
j0nsh1n added a commit to j0nsh1n/wronggpu that referenced this pull request Nov 18, 2026
…hantoslayer21#225's no-name-rule pin

clean/tests/test_executor_select.py (CreateOrder.test_no_name_rule_left, phantoslayer21#225) requires that clean/runtime/rdna4.h
contains no find( outside comments, so that no GPU name rule can come back into the identity code. The parser of the
WG_DEV_GFX11_NATIVE_K list (developer builds only) used std::string::find to split at commas and broke that pin. It now
walks the characters; the entries, the exact-name match and the treatment of stray commas are unchanged.

Verified: test_executor_select and test_dev_gfx11_native_k (the host build of the list cases with and without
WG_DEV_GFX11): 20 tests OK. With the separator changed to ';' on purpose the list cases fail ("a listed port switches",
"the first and the last entry switch", "a list selects only its names"); restored, green.

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.

1 participant