Skip to content

Linux tests: run the D3D12 and launcher tests under Wine with a Proton install - #52

Merged
phantoslayer21 merged 4 commits into
phantoslayer21:mainfrom
j0nsh1n:test/linux-wine-runner
Nov 14, 2026
Merged

phantoslayer21 merged 4 commits into
phantoslayer21:mainfrom
j0nsh1n:test/linux-wine-runner

Conversation

@j0nsh1n

@j0nsh1n j0nsh1n commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What this changes and why

For #51 (the proposal), which also has the test results in more detail.

Adds a way to run WrongGPU's D3D12 tests on Linux, under Wine with the Direct3D 12 stack of a Proton install (vkd3d-proton, DXVK's dxgi, Wine's vkd3d libraries), which is what a game runs on in Steam on Linux. clean/linux/run_wine_tests.py --proton <Proton folder> runs four tests and prints PASS, FAIL or SKIP for each:

rr-leak and ags-layout need a vkd3d-proton built with dxil-spirv pull request #362 until a Proton release ships it (--vkd3d <folder>); the README says how.

Two commits, each usable alone: the D3D12 runner, then the launcher test. run-tests.sh gets -fms-extensions for clang-based MinGW (the __try in descriptor_publish.h) and WG_WINE to pick Proton's wine over a system wine64; nothing else outside clean/linux/ changes. Nothing here runs on Windows or in CI.

What each new or substantially changed file is based on

  • clean/linux/run_wine_tests.py, clean/linux/wine_env.py: own design. The prefix setup follows what Proton's own script puts into a game's prefix (the DLL folders of a Proton install) and Wine's documentation of WINEDLLOVERRIDES.
  • clean/linux/ags_layout.hlsl, clean/linux/ags_layout_host.cpp: own design, on AMD's public RDNA 4 ISA documentation for the WMMA register layout and the repository's wg_ags.hlsli.
  • clean/linux/README.md: own write-up.
  • clean/runtime/interop/tests/run-tests.sh: two small changes, own.

How it was tested

On an RX 9070 XT with Mesa RADV, llvm-mingw 20261104 and DXC 1.10.2605 for Linux, on main at c793823, with a wronggpu_runtime.dll built on Linux from main's source (Model M + RR; the runtime is unchanged since a8500cb). All data is synthetic.

  • With a vkd3d-proton built from vkd3d-proton 5b1089c8 plus dxil-spirv #362's three code commits, all four tests passed under GE-Proton 11-11: interop 31/31, rr-leak +37.2 MiB (limit 256), ags-layout 7/7, launcher 73 / 230 / 186 / 18 checks. interop, ags-layout and rr-leak also passed under Proton Experimental 11.0-20261105c, Proton-CachyOS 11.0-20260703, DW-Proton 11.0-15 and Proton 11.0.
  • Each test fails on what it targets:
  • The numbers in clean/linux/README.md (+2,635 MiB before the RR runtime: free released input copies while no RR instance exists #11 fix, +37 MiB after) are this test's own output; running it reproduces them.
  • tools/ci/check_line_endings.py passes. The REUSE lint was not run (not installed here).

Outside this PR, and not used to write or check it: I ran Model M and Ray Reconstruction in Cyberpunk 2077 under Proton as a player does, with the model files WrongGPU's launcher converts on my PC from my own copy of the game's upscaler files. None of that data, or anything computed from it, is in this PR or in its tests. I mention it so you can judge it against the clean-room statement.

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 added.)
  • Numbers in documents come with their measurement record. (The README's figures are this test's output.)
  • Kernel or runtime changes: none. ags_layout.hlsl is a test shader.

🤖 Generated with Claude Code

j0nsh1n and others added 2 commits November 13, 2026 11:16
clean/linux/run_wine_tests.py runs three tests in a Wine prefix set up
the way Proton sets up a game's (clean/linux/wine_env.py: vkd3d-proton
d3d12 / d3d12core, DXVK dxgi, Wine's vkd3d libraries for its builtin
d3dcompiler_47), with an optional self-built vkd3d-proton (--vkd3d):

- interop: the existing run-tests.sh (31 tests);
- rr-leak: the RR test host's tagloop job (pull request phantoslayer21#11) against a
  given wronggpu_runtime.dll with a synthetic RR model, with the 256 MiB
  limit of the Windows end-to-end test;
- ags-layout: wg_ags.hlsli's WMMA and conversion helpers on fixed
  register values against a CPU reference of the gfx12 semantics
  (new: ags_layout.hlsl, ags_layout_host.cpp).

run-tests.sh: -fms-extensions for clang-based MinGW (the __try in
descriptor_publish.h), and WG_WINE to pick Proton's wine over a system
wine64.

Verified on an RX 9070 XT, RADV, GE-Proton 11-11, with a vkd3d-proton
built with dxil-spirv PR #362: interop 31/31, rr-leak +37 MiB (limit
256), ags-layout 7/7. Each test fails on the bug it targets: interop
29/31 with "Unknown modifier globallycoherent" before pull request phantoslayer21#12,
rr-leak +2636 MiB with a runtime from before pull request phantoslayer21#11,
ags-layout at CreateComputePipelineState on stock vkd3d-proton; its
comparison rejects lane-swapped and half-swapped results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
run_wine_tests.py gains a `launcher` test: a WRONGGPU_TESTING MinGW
build of clean/installer with the installer suite's generated payload
and test map, its four unit-test programs (wg-core-tests,
launcher-core-tests, coexist-core-tests, wizard-policy-tests) run in
the Proton prefix, the way Linux players run the launcher.

Verified with llvm-mingw and GE-Proton 11-11 on main: PASS (73, 230,
186, 18 checks). With one wg-core check broken on purpose, the test
reported FAIL (exit 1) naming that check; restored, PASS.

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

@phantoslayer21 phantoslayer21 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, and for the careful description: the "what each file is based on" section and the note about your own game runs are exactly what the clean-room statement is for.

I read all six files. The scripts are safe to run as far as I can see: no network access, no shell=True, an explicit WINEPREFIX under --work, the Proton install only read, and everything removed or overwritten stays inside --work. The tests decide PASS / FAIL / SKIP the way the README says, the 256 MiB limit is enforced in the host and again in the runner, and the ags-layout expectations are computed on the CPU independently of the shader. The run-tests.sh change does nothing for existing GCC or wine64 users. The code can go in as it is.

What I'd like changed before merging is all in clean/linux/README.md, plus one comment:

  1. Line 18 says globallycoherent "failed all 31"; line 59 and the description say 29 of 31. Please make them agree.
  2. The MiB figures. The README has +2,635 and +37, the commit message +2636, the description +2636 / +37.2. The project's rule is that a number in a document names its measurement (CONTRIBUTING.md). Please either drop the figures from the README, or label them as one run of this test on your setup (RX 9070 XT, RADV, GE-Proton 11-11, the vkd3d-proton build) with one consistent value. Line 59 also says "with the 0.6.0 RR runtime"; the description says "a runtime from before #11". Please use whichever is what you ran.
  3. Lines 61-62 say launcher fails in coexist-core-tests when the vkd3d-proton rule in coexist.cpp is reverted. That rule isn't on main (it is #50), and the description records a different check (one broken wg-core check). Please replace the sentence with what was done.
  4. Lines 45-46 say the patched DLLs next to the game exe "make Model M and Ray Reconstruction run". Nothing in this pull request tests that, and it reads as install advice for players. Please take it out here; your Linux guide in #10 is the right place for it until a Proton release has the fix. For the same reason, could the opening lines say the tests check WrongGPU's D3D12 code on that stack, without implying Linux is a supported platform yet?
  5. ags_layout.hlsl:33 calls wg_ags_call(0x1cu, ...) for the F16 conversion. That opcode isn't in wg_ags.hlsli; it is used by the RR kernels (for example clean/rr_f/kernels/rr_in_math.hlsli). Please say in a comment which file of this repository it comes from, so the test's sources are complete.

Optional, your call:

  • A bare wineboot -i can pop up Wine's Mono/Gecko dialog and write menu entries under ~/.local/share. Adding mscoree,mshtml=;winemenubuilder.exe=d to DLL_OVERRIDES avoids both.
  • If --work/prefix already is a Wine prefix, the script reuses it and overwrites its d3d12 / dxgi DLLs. A line in the README, or a marker file the script checks for, would make that explicit.
  • rr-leak would pass if the stack reported a constant CurrentUsage. Failing when before and after are identical closes that.
  • ags_layout_host.cpp:64 takes the default adapter; on a machine with two GPUs it could test the wrong one (it would fail, not falsely pass).
  • The README's example commit 0bb64c5 differs from the 5b1089c8 you tested with.
  • A --work path with spaces breaks the job file.

On credit: the repository's REUSE rule puts the default copyright line on every file. If you'd like your own copyright line on the files you wrote, add an annotation for clean/linux/** in REUSE.toml in this pull request and I'll take it.

CI is running, and the maintainer-side clean-room scan is in progress; I'll note here when both are done. One push with the README changes and this is ready to merge.

@phantoslayer21

Copy link
Copy Markdown
Owner

The maintainer-side clean-room scan of b81f607 is done: no hits in the contribution, and your clean-room statement and sign-offs are in order. So the README points in my review are all that is left; CI will show on the pull request when it finishes.

From the review of phantoslayer21#52:

- README: the globallycoherent count now agrees (29 of 31, before
  phantoslayer21#12). The leak figures are named as one run on an RX 9070 XT, RADV,
  GE-Proton 11-11 and vkd3d-proton 5b1089c8 + dxil-spirv #362: +2636 MiB
  with a runtime built before phantoslayer21#11, +37.2 MiB with the fix. The launcher
  red check describes what was run (a wg-core check broken on purpose).
  The player advice about DLLs next to the game exe is gone, and the
  opening says the tests don't make Linux a supported platform. The
  vkd3d-proton commit named is the one tested (5b1089c8). It also says
  that --work/prefix is reused if it already is a Wine prefix.
- ags_layout.hlsl: the FloatConversion opcode 0x1c names its source in
  this repository (f2h_hw in clean/rr_f/kernels/rr_fast.hlsli).
- wine_env.py: mscoree / mshtml off and winemenubuilder disabled, so a
  new prefix shows no Mono / Gecko dialog and writes no menu entries.
- run_wine_tests.py: rr-leak fails when video memory does not change at
  all (a stack reporting a constant CurrentUsage), and --work with a
  space is refused (the RR host's job file is split on spaces).

Verified on main c793823 + this branch, GE-Proton 11-11 with a fresh
--work: interop 31/31, rr-leak +37.2 MiB, ags-layout 7/7, launcher
73/230/186/18 checks. No new entries under ~/.local/share/applications.

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

j0nsh1n commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review. Everything is in 1ac6672:

  1. The globallycoherent count now agrees everywhere: 29 of 31 before Interop: declare the spin pass's buffer without globallycoherent #12.
  2. The leak figures name their run: one run on an RX 9070 XT, RADV, GE-Proton 11-11, vkd3d-proton 5b1089c8 plus dxil-spirv #362. That gives +2636 MiB with a runtime built from source before RR runtime: free released input copies while no RR instance exists #11 (not the 0.6.0 release runtime) and +37.2 MiB with the fix. The table row points there instead of repeating them.
  3. The launcher sentence now says what was done: one wg-core-tests check broken on purpose, reported as FAIL with its name.
  4. The player advice is gone, and the opening says the tests check WrongGPU's D3D12 code on Proton's stack without making Linux a supported platform.
  5. ags_layout.hlsl names the opcode's source. It's f2h_hw in clean/rr_f/kernels/rr_fast.hlsli, which uses 0x1c with the same arguments; rr_in_math.hlsli only has the constant.

From the optional list:

  • DLL_OVERRIDES now includes mscoree,mshtml=;winemenubuilder.exe=d. A fresh prefix wrote no menu entries.
  • rr-leak fails when video memory doesn't change at all.
  • A --work path with a space is refused.
  • The README says an existing --work/prefix is reused and has its DLLs overwritten.
  • The README's example commit is now the tested 5b1089c8.

I left the two-GPU adapter choice in ags_layout_host.cpp as it is, since it fails rather than passing falsely.

Rerun on c793823 + this branch with a fresh --work: interop 31/31, rr-leak +37.2 MiB, ags-layout 7/7, launcher 73/230/186/18.

The maintainer offered it in the review of phantoslayer21#52. Files under clean/linux now
carry both "2026 phantoslayer21" and "2026 j0nsh1n"; every other file is
unchanged.

Verified with reuse 5.0.2 (the CI's version): reuse lint compliant, and
reuse spdx shows both lines on clean/linux files and only the project's
line elsewhere. tools/ci/check_line_endings.py: 0 problems.

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

j0nsh1n commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the offer. 16c1d17 adds a clean/linux/** annotation to REUSE.toml with both lines, "2026 phantoslayer21" and "2026 j0nsh1n". It lists both because a later annotation replaces the default line rather than adding to it. reuse lint (5.0.2) passes, reuse spdx shows both lines on the runner's files and only the project's line on everything else, and the line-endings check is clean.

@phantoslayer21

Copy link
Copy Markdown
Owner

Sorry for the wait. Your fixes in 1ac6672 and the REUSE.toml commit came in hours ago and I hadn't come back to them. CI was also held for a maintainer approval because you're a first-time contributor. That's approved now and running on 16c1d17. I'm re-reading it today against my earlier review and will reply here.

@phantoslayer21 phantoslayer21 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All five points from my earlier review are resolved:

  • the 29-of-31 count;
  • the leak figures, which now name their run;
  • the description of the deliberately broken check;
  • the player advice is gone, and the Linux-support wording is fixed;
  • the f2h_hw source comment in ags_layout.hlsl.

The REUSE.toml annotation only matches clean/linux/** and leaves every other path as it was.

Two things I found on a second read. Neither blocks this:

  1. run-tests.sh ends with grep -q on result.txt, so the Wine pipeline's exit status is lost. A crash after ALL TESTS PASSED would still count as a pass. That line was already on main before your change, so I'll fix it in a separate PR rather than ask you to.
  2. The launcher tests use GetTempPathW, and wine_env.py doesn't set TEMP/TMP. In a reused prefix, their temp folders might not sit under --work as the README says. If you want, setting TEMP/TMP inside the work folder in a follow-up would make that claim hold everywhere.

Approving once CI finishes green.

@phantoslayer21
phantoslayer21 merged commit c7317a4 into phantoslayer21:main Nov 14, 2026
9 checks passed
@j0nsh1n
j0nsh1n deleted the test/linux-wine-runner branch November 14, 2026 18:33
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