xtask: wine-test runs the Windows tests on a Linux host under Wine #1218
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1218
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1218"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@neonbyte1 on GitHub · 2026-11-24 16:28 UTC · original
neonbyte1:xtask/wine-test→main· +250 −0 · 3 files · 5 commits · openAdds
cargo xtask wine-test, which runs the Windows test suite on a Linux host under Wine. Several testers in #340 do this by hand today.What it does
x86_64-pc-windows-msvcwithclang-cl,llvm-libandlld-linkagainst anxwin splat(default~/.xwin). The toolchain is set through environment variables only, so Windows builds and.cargo/config.tomlare unchanged.wineas the target runner, in a Wine prefix of its own undertarget/wine-prefix. The user's~/.wineis not touched.--vkd3d-proton <dir>copies that folder'sd3d12.dllandd3d12core.dllinto the prefix and overrides Wine's own D3D12, which lacks shader model 6.6. vkd3d-proton's pipeline cache goes totarget/vkd3d-proton-cache; written to the crate directory, the asset policy would reject it.--workspace --exclude xtask --no-fail-fast. xtask runsgit, so it stays a host-only tool. Arguments after--replace the defaults.victory-loader'sload_probetest builds its fixture by runningcargo, which it cannot do inside Wine. It now takes a prebuilt fixture fromVICTORY_HLE_PROBE, which the xtask builds beforehand. Without the variable the test behaves as before.Result on this branch
Current
main, Wine 11.22, vkd3d-proton from GE-Proton11-14, RTX 5090: 334 passed, 4 failed, 6 ignored. The four failures are known Wine/vkd3d-proton gaps with open fixes:indirect::tests::argument_clamp_buildsmodules::net::tests::only_loopback_is_reachablepipeline::library::tests::a_rejected_blob_gives_an_empty_libraryemit::tests::stub_pipeline_is_createdWith those PRs merged locally, it was 343 passed, 0 failed, 6 ignored on both an RTX 5090 and an RX 7600. Each GPU was isolated with
VK_DRIVER_FILES.Checks
cargo clippy -p xtask --all-targets --locked -- -D warningsis clean,cargo test -p xtaskpasses (4 tests), andcargo xtask policyis OK.AI-assisted (Claude Code).
@Zipettte on GitHub · 2026-11-24 17:59 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
b3e39e7:cargo test -p victory-loaderpasses, 25 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@BaggyALPHA on GitHub · 2026-11-24 16:35 UTC · original
On
xtask/src/wine.rsline 44 (outdated):An
--xwindirectory containing spaces breaks the fixture build here. Cargo splits the space-separated target rustflags into separate arguments, including the spaces inside each SDK directory name. I reproduced this with the pinned Rust toolchain and the synthetic HLE probe. The build failed with the current flag encoding and succeeded with the same library-search argument passed throughCARGO_ENCODED_RUSTFLAGS.Could the three
-Lnative=...arguments be passed separately viaCARGO_ENCODED_RUSTFLAGS, joined with the unit separator? Including an xwin directory with spaces in the smoke test would also exercise the compiler include flags above.@neonbyte1 on GitHub · 2026-11-24 16:39 UTC · original
On
xtask/src/wine.rsline 44 (outdated):Thanks, fixed in
b3e39e7(xtask: wine-test keeps an xwin directory with spaces in one argument):-Lnative=arguments now go throughCARGO_ENCODED_RUSTFLAGS, joined with\x1f. Every cargo call in the xtask passes--target, so these flags don't reach host build scripts or proc macros./imsvcarguments are shell-quoted, andCC_SHELL_ESCAPED_FLAGS=1makes cc 1.11 parseCFLAGS/CXXFLAGSlike a shell command line. Your second point applied here too: cc split them on spaces the same way.Linux check of the runner itself, with
--xwin "/tmp/xwin dir with space"(a symlink to the splat), Wine 11.22 and vkd3d-proton from GE-Proton11-14:loads_binds_and_calls_probepasses.main: 334 passed, 4 failed, 6 ignored. The four failures are the known Wine/vkd3d-proton gaps listed in the description; #190, #217 and #347 fix three of them.cargo clippy -p xtask --all-targets --locked -- -D warningsis clean.AI-assisted (Claude Code).
@ -0,0 +27,4 @@let xwin = match o.xwin {Some(dir) => dir,None => PathBuf::from(std::env::var_os("HOME").context("HOME is not set")?).join(".xwin"),};@BaggyALPHA on GitHub · 2026-11-24 16:50 UTC · original
A relative
--xwinpath can pass this validation and then point somewhere else when Cargo runs. The directory check uses the invocation directory, while the child command sets its working directory to the repository root. I reproduced this by launching the xtask from another directory with a valid relative SDK path and capturing the child command. Both Cargo invocations received three library paths and four include paths that did not exist relative to their working directory.Could you resolve
xwinto an absolute path before validating it and emitting the flags?std::path::absolute(&xwin)preserves the SDK symlink and keeps the path anchored to the invocation directory.@ -0,0 +27,4 @@let xwin = match o.xwin {Some(dir) => dir,None => PathBuf::from(std::env::var_os("HOME").context("HOME is not set")?).join(".xwin"),};@neonbyte1 on GitHub · 2026-11-24 17:02 UTC · original
Thanks, fixed in
a19107b(xtask: wine-test anchors a relative xwin path to the invocation directory).xwinnow goes throughstd::path::absolutebefore the splat check, so the check, the flags and the error message all use the same absolute path, and the symlink is kept.Linux check: I launched the xtask from
/tmp/xwrelwith--xwin "xwin dir with space", a relative symlink to the splat, and ran-p victory-loader --test load_probe:b3e39e7, the splat check passed, and then building hle-probe failed because the library paths didn't resolve from the repository root.a19107b, the fixture builds and bothload_probetests pass under Wine 11.22.cargo clippy -p xtask --all-targets --locked -- -D warningsis clean,cargo test -p xtaskpasses, andcargo xtask policyis OK.AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 01:20 UTC · original · edited 2026-11-26 02:17 UTC
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. Re-reviewed at
6ceba60, which merges cleanly intomain. The new commit adds--dxvk <dir>, which copies DXVK'sdxgi.dllinto the prefix through the sharedcopy_dllshelper. It also adds twowine reg addcalls that turn off the crash debugger and the WineDbg dialog. By reading, those registry writes stay in the tool's ownWINEPREFIXundertarget/, becausecommand()sets it, and.cargo/and the Windows build are still untouched. The verdict has not changed:xtask/src/wine.rs(wine::run) starts external processes (wineboot,wine, a crosscargo test) and puts external DLLs into a prefix. Whether to add a tool like that is the maintainer's call.On your reply: the use case (one reproducible way for Linux testers to run the suite) is clear, and keeping skips as
cargo testarguments is workable. What would still help the maintainer decide: a short list of the known Wine/vkd3d-proton failures on currentmain, and theVICTORY_HLE_PROBEhook split into its own small PR.CI: passing.
Generated by Claude Code
@neonbyte1 on GitHub · 2026-11-25 23:26 UTC · original
Thanks for the review. On the three points:
cargo xtask wine-testgives them one reproducible way to run the existing tests under Wine + vkd3d-proton before posting results. It's opt-in, lives entirely inxtask/src/wine.rs, and doesn't touch the Windows build or CI. I'm happy to maintain it.VICTORY_HLE_PROBE: only that one test reads it. When unset, the test runs the existing fixture. I can move it to a separate PR if you prefer.main(842b0cb) with this PR merged (no conflicts), on an RTX 5090 with Wine 11.22 and vkd3d-proton from GE-Proton11-14.load_probepasses (2/2). The failures are all in code this PR doesn't touch: 30 invictory-gpu, 4 invictory-shader, 2 invictory-hle, 1 invictory-loader. They come from missing pieces in Wine and vkd3d-proton, for example Wine's HLSL compiler (argument_clamp_builds) and root-signature calls.queue::tests::aliased_present_planes_preserve_the_host_texture_statecrashes inside Wine's builtin dxgi, so I skipped it with-- --skip aliased_present_planes. Extra arguments go tocargo test, so known failures can be skipped the same way.AI-assisted (Claude); measured on my machine, no game data shared.
@neonbyte1 on GitHub · 2026-11-26 01:30 UTC · original
Pushed
6ceba60:--dxvk <dir>puts DXVK'sdxgi.dllinto the prefix next to vkd3d-proton's D3D12. That's the setup the title itself needs under Wine; Wine's own DXGI crashes inwined3don the first present.ShowCrashDialog = 0), so a crash no longer leaveswinedbgwaiting and the run hanging.With both DLL sets, one GPU test's process was SIGKILLed at exit on NVIDIA after passing. That's a vkd3d-proton/Wine race on the first present (HansKristian-Work/vkd3d-proton#3524); the fix for that test goes in with the other Wine test fixes.
AI-assisted (Claude).
@BaggyALPHA on GitHub · 2026-11-24 16:35 UTC · original · reviewed
Windows verification on this PR: both loader integration tests passed with the default fixture build and with a separately built synthetic probe supplied through
VICTORY_HLE_PROBE. The xtask tests, xtask Clippy with warnings denied, and asset-policy check also passed. The Linux/Wine runner itself still needs a Linux check.AI-assisted (Codex).
@BaggyALPHA on GitHub · 2026-11-24 16:50 UTC · original · reviewed
I rechecked the updated revision on Windows. Both loader integration tests pass with the default and prebuilt fixtures. The xtask tests, Clippy, and asset policy pass. Capturing the child process environment also confirms that all three library arguments and all four include arguments preserve an absolute SDK directory containing spaces and an apostrophe. The fixture builds with the captured Rust flags on Windows.
AI-assisted (Codex).
@mercuryVM on GitHub · 2026-11-24 18:11 UTC · original · approved these changes
Tested
a19107bdon Windows 11, RTX 5070, MSVC:cargo test -p xtask -p victory-loaderpasses on the head, andcargo xtask wine-test --helpparses.clippy -D warnings(default and all features) are all clean.wine-testitself, since this is a Windows host. My notes on that path are from reading.The Wine path looks careful:
--target, soCARGO_ENCODED_RUSTFLAGSnever reaches host build scripts.target/.VICTORY_HLE_PROBEis read only by the loader test.Small points:
HOMEis required even when--xwinis given? No, it's only read in theNonearm. Fine.wine_pathrelies on the defaultZ:mapping of/. A prefix that removed that mapping would fail later with an unclear error. Probably not worth handling, but a word in the README would help.AI-assisted (Claude Code).
@BaggyALPHA on GitHub · 2026-11-26 00:54 UTC · original · reviewed
Edited to correct my own framing: this is a partial review, not a verification of the feature. My first version led with a table of runs and implied more coverage than it had.
I am on Windows (Windows 11, RTX 3080) and cannot run Wine, so the whole
wine-testpath — the xwin cross-build,wineboot, the DLL overrides and the 334/4/6 figures — is unchecked by me and read only. That is roughly 154 of the 193 lines, and it is the point of the pull request.The notes below came from reading the code, not from this machine. Any reviewer on any OS could have found them; what the Windows host added was evidence for one consequence, not the insight.
I should also point at my own earlier passes on this PR rather than let this one look like fresh coverage: the Windows test results here largely repeat what I posted on 2026-11-24 in this review and this one. The second of those is the stronger piece of Windows evidence and is not superseded by anything below — it captured the child process environment and confirmed that all three library arguments and all four include arguments survive an absolute SDK directory containing spaces and an apostrophe, which is the real test of
shell_quoteandCC_SHELL_ESCAPED_FLAGS. I did not re-run that today. What is new here is the three notes, plus the clean merge onto currentmain.What I actually ran today
Merged onto
main63bcca4(clean merge; the PR's baseffe310eis well behind), separate build cache.cargo xtask policy: 192 files ok.vkd3d-proton.cachefile placed by hand in a crate directory: policy refuses it,file type not on the allowlist.load_probewith noVICTORY_HLE_PROBE: 2 passed. In fairness this is near-zero information — the early return makes it a no-op without the variable by inspection.load_probewithVICTORY_HLE_PROBEpointing at a real prebuilt fixture: 2 passed. This only shows the variable is not accidentally Wine-shaped; nobody will set it on Windows.1. A wrong
VICTORY_HLE_PROBEfails illegiblybuild_probereturns the variable unexamined and the first use isstd::fs::read(&dll).unwrap(), so a path that is not there gives (line numbers from the merge above):naming neither the path nor the variable that chose it, where the cargo path it replaces fails with
assert!(status.success(), "building hle-probe failed"). Insidewine-testthe path is always freshly built, so this only reaches someone running the tests by hand with a stale or mistyped value — the audience the variable adds. An existence check or anexpectnaming the path and the variable would keep the new failure mode as legible as the old one.Single call site,
load_probe.rs:111;maps_a_title_dll_the_title_loads_itselfdoes not use the fixture and still passes with a bogus value.Confidence: I reproduced this directly. I saw it on Windows rather than under Wine, but no Wine behaviour is involved in it.
2. The cache redirect is tied to copying the DLLs, not to vkd3d-proton being in use
VKD3D_SHADER_CACHE_PATHand itscreate_dir_allsit insideif let Some(overrides), andoverridesbecomesSomeonly when--vkd3d-proton <dir>is passed.What I verified: that conditional structure, and that the asset policy does refuse such a file.
What I did not verify, and what someone on Linux should confirm before trusting my conclusion — if any of these is false, this note is wrong:
VKD3D_SHADER_CACHE_PATHunset really writes its cache into the working directory;--vkd3d-protonrun, so a later run without the flag still uses it.The run that would settle it:
wine-testwithout--vkd3d-proton, on a prefix that has had it copied in once; then check whether a cache file appears in a crate directory and whethercargo xtask policyfails afterwards.If it holds, setting
VKD3D_SHADER_CACHE_PATHunconditionally closes it at no cost — it is simply an unused variable when vkd3d is not involved.3. Two of the three fixes the table credits are closed, and one deliberately
This is about the Wine side, but it needs no Wine to check — only the state of those pull requests, which has moved since you wrote the table:
indirect::tests::argument_clamp_builds)mainand it was closed insteadmodules::net::tests::only_loopback_is_reachable)pipeline::library::tests::a_rejected_blob_gives_an_empty_library)Neither closed one has a merge commit, so "known gaps with open fixes" now holds only for #347. #217 matters most: if Wine-only fallbacks are deliberately staying in a fork, then that failure is not a gap waiting on a merge — it is permanent on upstream
main, and sowine-teston a clean checkout will always report it alongside thestub_pipeline_is_createdone you already describe as expected.That is worth a line in the README paragraph or the command's output, so the next person does not read two or three expected failures as something they broke. It may also be an argument for marking the known-expected ones rather than leaving them to be rediscovered.
I may be behind here in the other direction: a closed pull request in this repository is often re-landed under a new number, and you know this area better than I do — so please check whether #190 or #217 has a successor before taking the table as stale. What I verified: only the PR states, the absent merge commits and the quoted closing comment. What I did not: whether those four tests still fail under Wine today, which needs your host.
Read, not run, and looking fine
CARGO_ENCODED_RUSTFLAGSreplaces rather than extends configured rustflags, but.cargo/config.tomlhere sets none (only thextaskalias), so nothing is silently dropped. The mixed{}/{0}in the xwinensure!is legal and both refer to the same argument.probe_dir.join(TARGET).join("debug")is the right output path for a--targetbuild.Not reviewed at all
For whoever picks this up: whether the cross-build produces working binaries, whether the prefix and DLL overrides take effect, whether the tests genuinely run under Wine rather than silently skipping, whether 334 passed / 4 failed / 6 ignored still reproduces on current
main, and whether each of the four failures is really the cited gap rather than something the harness causes. All of that needs a Linux host with a GPU, and none of it is covered here.Not approving, for the plain reason that I have reviewed the small Windows-facing part and only read the rest.
No game data: the fixture is the repository's own
hle-probe, and the figures are test counts plus one policy violation I induced on purpose.AI-assisted (Claude Code); every figure is from the runs described on this host.
@neonbyte1 on GitHub · 2026-11-26 15:14 UTC · original
Thanks for the triage. The
VICTORY_HLE_PROBEhook is now its own PR, #3270: one commit, the loader test only.This branch has a follow-up commit,
a7f16eb, that removes the fixture cross-build and the hook's environment variable instead of rewriting history. Until #3270 lands:cargo xtask wine-testwith no arguments after--skips exactly the two loader end-to-end tests that need the hook (they can't start the hostcargofrom inside Wine), and prints the reason.--still go straight tocargo test, and no skip is added whenVICTORY_HLE_PROBEis set.Once #3270 merges, I'll remove the skip.
Checked: with the hook from #3270, both loader tests pass under Wine. Windows-target clippy (with and without
--all-features) andcargo xtask policypass on this branch.AI-assisted (Claude); measured on my machine, no game data shared.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.