Repository navigation
Conversation
Cross-builds the test binaries with clang-cl, lld-link and an xwin splat and runs them in a Wine prefix under target/. --vkd3d-proton puts that folder's D3D12 in the prefix instead of Wine's own. The loader's end-to-end test cannot start cargo inside Wine, so its fixture is built beforehand and named by VICTORY_HLE_PROBE.
ghost
left a comment
There was a problem hiding this comment.
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).
| /imsvc{x}/crt/include /imsvc{x}/sdk/include/ucrt /imsvc{x}/sdk/include/um /imsvc{x}/sdk/include/shared" | ||
| ); | ||
| let rustflags = format!( | ||
| "-Lnative={x}/crt/lib/x86_64 -Lnative={x}/sdk/lib/um/x86_64 -Lnative={x}/sdk/lib/ucrt/x86_64" |
There was a problem hiding this comment.
An --xwin directory 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 through CARGO_ENCODED_RUSTFLAGS.
Could the three -Lnative=... arguments be passed separately via CARGO_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.
There was a problem hiding this comment.
Thanks, fixed in b3e39e7 (xtask: wine-test keeps an xwin directory with spaces in one argument):
- Library paths: the three
-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. - Include paths: the four
/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:
- blake3's C code compiled, and the hle-probe fixture linked.
loads_binds_and_calls_probepasses.- Workspace total on current
main: 334 passed, 4 failed, 6 ignored. The four failures are the known Wine/vkd3d-proton gaps listed in the description; GPU: build the indirect-argument clamp with our own writer (no shader compiler at run time) #190, Wine: fall back where ws2_32 lacks exports; hook and cfg fixes #217 and GPU: ask for an empty pipeline library with a null blob #347 fix three of them. cargo clippy -p xtask --all-targets --locked -- -D warningsis clean.
AI-assisted (Claude Code).
Library paths go through CARGO_ENCODED_RUSTFLAGS and include paths are shell-quoted for cc (CC_SHELL_ESCAPED_FLAGS), so a path with spaces is no longer split.
ghost
left a comment
There was a problem hiding this comment.
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).
| let xwin = match o.xwin { | ||
| Some(dir) => dir, | ||
| None => PathBuf::from(std::env::var_os("HOME").context("HOME is not set")?).join(".xwin"), | ||
| }; |
There was a problem hiding this comment.
A relative --xwin path 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 xwin to 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.
There was a problem hiding this comment.
Thanks, fixed in a19107b (xtask: wine-test anchors a relative xwin path to the invocation directory). xwin now goes through std::path::absolute before 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/xwrel with --xwin "xwin dir with space", a relative symlink to the splat, and ran -p victory-loader --test load_probe:
- On b3e39e7, the splat check passed, and then building hle-probe failed because the library paths didn't resolve from the repository root.
- On a19107b, the fixture builds and both
load_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).
…tory The cargo calls run from the repository root, so a relative --xwin was checked against one directory and used from another. It is now made absolute first; std::path::absolute keeps the splat symlink.
mercuryVM
left a comment
There was a problem hiding this comment.
Tested a19107b on Windows 11, RTX 5070, MSVC:
cargo test -p xtask -p victory-loaderpasses on the head, andcargo xtask wine-test --helpparses.- Merged into our fork: workspace tests, shader tests and
clippy -D warnings(default and all features) are all clean. - I didn't run
wine-testitself, since this is a Windows host. My notes on that path are from reading.
The Wine path looks careful:
- The toolchain goes through env vars only, and every cargo call passes
--target, soCARGO_ENCODED_RUSTFLAGSnever reaches host build scripts. - The prefix is its own one under
target/. - The vkd3d-proton DLLs are copied after a remove, so read-only sources work.
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).
…sts on a Linux host under Wine Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ux host under Wine
…ux host under Wine
There was a problem hiding this comment.
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-test path — 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_quote and CC_SHELL_ESCAPED_FLAGS. I did not re-run that today. What is new here is the three notes, plus the clean merge onto current main.
What I actually ran today
Merged onto main 63bcca4 (clean merge; the PR's base ffe310e is well behind), separate build cache.
cargo xtask policy: 192 files ok.- A
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_PROBE fails illegibly
build_probe returns the variable unexamined and the first use is std::fs::read(&dll).unwrap(), so a path that is not there gives (line numbers from the merge above):
panicked at crates\victory-loader\tests\load_probe.rs:112:40:
called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }
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"). Inside wine-test the 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 an expect naming 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_itself does 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_PATH and its create_dir_all sit inside if let Some(overrides), and overrides becomes Some only 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:
- that vkd3d-proton with
VKD3D_SHADER_CACHE_PATHunset really writes its cache into the working directory; - that the working directory is the crate's when tests run through the Wine runner;
- that a prefix keeps vkd3d-proton after one
--vkd3d-protonrun, so a later run without the flag still uses it.
The run that would settle it: wine-test without --vkd3d-proton, on a prefix that has had it copied in once; then check whether a cache file appears in a crate directory and whether cargo xtask policy fails afterwards.
If it holds, setting VKD3D_SHADER_CACHE_PATH unconditionally 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:
| Credited fix | State now |
|---|---|
#190 (indirect::tests::argument_clamp_builds) |
closed, not merged — triage asked for a rebase against main and it was closed instead |
#217 (modules::net::tests::only_loopback_is_reachable) |
closed, not merged — and its author said the ws2_32 fallbacks "only matter under Wine, and real Windows hosts have the exports. I'll keep them in my fork" |
#347 (pipeline::library::tests::a_rejected_blob_gives_an_empty_library) |
still open |
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 so wine-test on a clean checkout will always report it alongside the stub_pipeline_is_created one 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_RUSTFLAGS replaces rather than extends configured rustflags, but .cargo/config.toml here sets none (only the xtask alias), so nothing is silently dropped. The mixed {} / {0} in the xwin ensure! is legal and both refer to the same argument. probe_dir.join(TARGET).join("debug") is the right output path for a --target build.
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.
|
Pushed
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). |
…ux host under Wine
|
Thanks for the triage. The This branch has a follow-up commit,
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 AI-assisted (Claude); measured on my machine, no game data shared. |
- The wine-test example filters one top-level module (`resource::`) and skips `resource::tests::a_list_waiting_for_another_queues_write_reads_what_it_wrote`, as the doc's own warning and gaps table require. - The prefix copy expands both vkd3d-proton DLLs instead of relying on brace expansion inside a POSIX `sh` block. - The launch example assigns `VICTORY_EXE`, `GAME_DIR` and `TITLE_EXE`, runs from a directory outside the repository (vkd3d-proton's cache lands in the working directory), checks the paths with `victory config`, and states the AVX2 requirement. The building section names the `x86_64-pc-windows-msvc` target (`rustup target add`), and the tests section says where `VICTORY_DXIL` comes from under Wine. - Both mentions of `cargo xtask wine-test` say it needs unmerged PR Marvisak#1218.
ghost
left a comment
There was a problem hiding this comment.
Re-reading at a7f16eb, which is newer than my earlier passes on this PR — the loader hook has been split out since then, and the code that replaced it is what this note is about.
To be clear about what is mine and what is new: my passes of 2026-11-24 (one, two) and 2026-11-26 covered an earlier revision, and the second of those is still the stronger Windows evidence — it captured the child process environment and confirmed the library and include arguments survive an SDK path with spaces and an apostrophe. I have not re-run it and nothing below supersedes it. I am on Windows and still cannot run Wine, so the cross-build, wineboot, the DLL overrides and the 334/4/6 figures remain unchecked by me. One finding below is new, and it is in code that did not exist at my last pass.
The default path exits before running anything
With the loader hook moved to pr/hle-probe, wine-test now skips the two tests instead. When VICTORY_HLE_PROBE is unset the command assembles to:
cargo test --target x86_64-pc-windows-msvc --workspace --exclude xtask --no-fail-fast \
--skip loads_binds_and_calls_probe --skip maps_a_title_dll_the_title_loads_itself
There is no --, so --skip is read as a cargo option, and cargo has none:
$ cargo test --locked -p xtask --no-run --skip some_test_name
error: unexpected argument '--skip' found
tip: to pass '--skip' as a value, use '-- --skip'
Usage: cargo.exe test --locked --package [<SPEC>] --no-run [TESTNAME] [-- [ARGS]...]
cargo test ... -- --skip some_test_name is accepted. Checked on cargo 1.98.1, the pinned toolchain; it is cargo argument parsing, so no Wine or Linux behaviour is involved and the result should hold on a Linux host.
That makes a bare cargo xtask wine-test fail on any host where VICTORY_HLE_PROBE is not set, which is every host that does not also have pr/hle-probe — the default experience for anyone trying this for the first time. --no-fail-fast is a cargo option and stays put; only the skips move behind a separator:
test.args([
"--",
"--skip", "loads_binds_and_calls_probe",
"--skip", "maps_a_title_dll_the_title_loads_itself",
]);I would treat this as blocking, since it is the path the README tells people to use.
A guess at why it has not bitten: with pr/hle-probe checked out and the variable set, the branch never runs, so the skip path is the one part of the change that no run exercises. A run with the variable deliberately unset would catch it.
Confidence: high on the cargo behaviour (reproduced directly, above). I have not run wine-test itself at all.
The description still describes the pre-split shape
Minor, but it will mislead whoever merges. The body says:
It now takes a prebuilt fixture from
VICTORY_HLE_PROBE, which the xtask builds beforehand. Without the variable the test behaves as before.
At this head the diff touches three files — README.md, xtask/src/main.rs, xtask/src/wine.rs — and no victory-loader file; load_probe.rs on main has build_probe but no VICTORY_HLE_PROBE. The xtask does not build the fixture, and without the variable the two tests are skipped rather than behaving as before. The code comment and the README are both already accurate ("are skipped with a message"); only the body was left behind when the hook was split out. Worth a one-line edit, or landing pr/hle-probe first and making this depend on it — the latter would also let the skip disappear.
The 334 passed, 4 failed, 6 ignored table presumably predates the split too, so it is worth saying which revision it came from.
Two small things, neither blocking
wine_pathbuildsZ:\...by prefixing, which assumes an absolute path; a relativetarget_dirwould giveZ:plus a relative tail. Everything reaching it today comes from an absolutetarget_dir, so this is latent rather than live.- The skips are by test name, so a rename silently un-skips them. Naming the file in the comment would help whoever renames them.
Happy to re-read once the separator is in. The feature is clearly worth having, and it still needs what my earlier note asked for: a Linux host with a GPU to confirm the cross-build produces working binaries, that the tests genuinely run rather than silently skipping, and that each of the four failures is the cited gap rather than something the harness causes.
AI use: Claude Code (Claude Opus 5). Static review on Windows; the cargo argument behaviour above was reproduced locally with the pinned toolchain, the Wine path was not run.
The skips are libtest options, so they go after `--`; cargo has no `--skip` and refused the default run. wine_path makes a relative path absolute before naming it on Z:.
|
@BaggyALPHA thanks, the separator bug was real and blocking. Fixed in
Clippy ( AI-assisted (Claude); measured on my machine, no game data shared. |
ghost
left a comment
There was a problem hiding this comment.
Re-read at 48cd0336. The separator fix is right, and I checked it end to end rather than by eye.
The fix
--no-fail-fast stays a cargo option and the two skips moved behind --, so the command wine-test assembles with VICTORY_HLE_PROBE unset is now:
cargo test --target x86_64-pc-windows-msvc --workspace --exclude xtask --no-fail-fast \
-- --skip loads_binds_and_calls_probe --skip maps_a_title_dll_the_title_loads_itself
I ran that exact invocation with --no-run added, on this branch, pinned toolchain (cargo 1.98.1), Windows host: cargo accepts it and builds the Windows-target test binaries. Two --skip options after one separator are fine. So the default path no longer exits early, which was the whole of the blocking finding.
Your other claims, checked here independently
| Claim | Result |
|---|---|
clippy -p xtask --all-targets -D warnings |
clean |
cargo test -p xtask |
4 passed, 0 failed |
| rustfmt | no diffs in xtask |
cargo xtask policy |
ok (155 files in my checkout) |
#3270 is the hook PR |
resolves to "Loader: VICTORY_HLE_PROBE names a prebuilt hle-probe fixture" |
| Body updated | yes — names tests/load_probe.rs, cites #3270, and says the 334/4/6 run predates the split |
wine_path absolute |
std::path::absolute before the Z: prefix; compiles on the pinned toolchain |
| Test names in the comment | the comment now names victory-loader's tests/load_probe.rs |
Flagging the 334/4/6 figure as pre-split is the part I would have asked for anyway, so that reads well now.
One leftover, trivial
The body cites #3270, but the code and README still point at the branch: wine.rs:163 and wine.rs:169 (the latter is the message a user actually sees when the skips kick in) and README.md:96 all say pr/hle-probe. A branch name is not something a reader can look up; #3270 is. Worth swapping if you touch this again — not worth a push on its own.
What I did not verify
The substance of the PR. I am on Windows and cannot run Wine, so the xwin cross-build, wineboot, the DLL overrides, --dxvk, the vkd3d-proton cache redirect in practice, and whether the tests genuinely run under Wine rather than silently skipping are all still unchecked by me. You ran the default path on Linux and reported cargo accepting it with the tests running; I am taking that at your word, and it matches what I see of the command's shape here.
What I have is: the blocking bug I raised is fixed and verified on the toolchain, the surrounding claims hold up, and nothing else in the diff changed (still three files, +255/-0, which I have now read in full).
Approving on that basis. The earlier note still stands for whoever has a Linux host — confirming each of the four known failures is really the cited gap rather than something the harness causes is worth doing before anyone treats 334/4/6 as a baseline.
AI use: Claude Code (Claude Opus 5). Verification on Windows with the pinned toolchain; no Wine, no game data.
|
@BaggyALPHA thanks for the approval and the end-to-end check. Took the leftover too: AI-assisted (Claude); no game data shared. |
Adds
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's two end-to-end tests intests/load_probe.rsbuild their fixture by runningcargo, which they cannot do inside Wine. The default run skips them (-- --skip ...) and says so. The prebuilt-fixture hook (VICTORY_HLE_PROBE) is split out into Loader: VICTORY_HLE_PROBE names a prebuilt hle-probe fixture #3270; with it set, the skips are left out.Result on this branch
Measured before the hook was split out (the run included the two loader tests through the hook), on
mainof that day, 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).