HLE: Winsock overrides work when the host lacks newer exports (Wine) #3091
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!3091
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3091"
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-26 07:29 UTC · original
neonbyte1:pr/winsock→main· +265 −17 · 1 files · 1 commits · openSplit out of #2973, as asked in its review.
victory-hle's Winsock overrides resolveWSAConnectByListandGetAddrInfoExAfrom the host'sws2_32.dllwhen the module loads. Wine'sws2_32doesn't export them, so loading failed and every test that goes through the overrides failed with it. They are now looked up on first use. When the host has no export, the override refuses the call the way an unreachable network does (WSAENETUNREACHfor the connect, the existing blocked-lookup result for the name lookup).The loopback and
resolvablechecks still run before that fallback, so the offline guards are not loosened: nothing reaches the network that couldn't before.When the host lacks these exports, the call is refused even for loopback targets (
127.0.0.1,localhost): there is nothing to forward it to. On Windows both exports exist, so nothing changes there.Tested (Linux, GE-Proton11-14 Wine, RTX 5090):
victory-hletests undercargo xtask wine-test(#1218), 152 passed, 1 failed. The one failure isxgamesave::tests::a_kept_blob_past_the_link_limit_is_copied, an NTFS hard-link limit that Wine's filesystem doesn't have; #2973 skips it under Wine. I have no Windows machine; on Windows the exports exist, so the overrides behave as before.AI-assisted (Claude); measured on my machine, no game data shared.
@Dukestar69 on GitHub · 2026-11-26 07:49 UTC · original · approved these changes
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-hle net::tests: all tests passed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Marvisak on GitHub · 2026-11-26 08:19 UTC · original
Automated triage for the maintainers.
Merge candidate. In
crates/victory-hle/src/modules/net.rs,WSAConnectByListandGetAddrInfoExAnow look up the host export through an optionalLazyLockand refuse the call (WSAENETUNREACH/blocked_lookup) when the host lacks it, instead of thehost!macro's panic. I checked that the loopback (reachable) andresolvablechecks still run first, so the offline guards are not loosened; on Windows, where both exports exist, behaviour is unchanged. The export test now skips only these named exports when absent.One small correction to the description: on
mainthehost!macro (modules/files.rs) already resolves on first call, not at module load; what fails under Wine is the panic on that call and the export-check test.CI: failing, but in
victory-gpu(frame::tests::waits_end_on_ticks_and_count_frames), which this PR does not touch; a re-run should settle whether it is a flake.Generated by Claude Code
@YaBulochka on GitHub · 2026-11-26 08:39 UTC · original
Tested on Wine: the Winsock fix works, but one test that passes on
mainfails deterministically on this branch.Environment: CachyOS kernel 7.3.5, Ryzen 5 9600X, RX 7600 XT, Wine 11.22,
x86_64-pc-windows-gnu,--features diagnostics,cargo test -p victory-hle --test-threads=1through Wine.main63bcca4modules::net::tests::only_loopback_is_reachablemodules::xgamesave::tests::a_kept_blob_past_the_link_limit_is_copiedmodules::xpackage::tests::completed_installation_unregisters_progress_immediatelyIsolated runs,
--exact, three times each:xpackage::completed_installation_unregisters_progress_immediately—main: ok, ok, ok; this branch: FAILED, FAILED, FAILED.net::only_loopback_is_reachable—main: FAILED; this branch: ok.So the lazy lookup does fix the WinSock override on Wine (that test goes from red to green), and the
xgamesavefailure is ours (no NTFS), not yours. Thexpackageone is new and stable:mainpasses it every time, this branch fails it every time.Is that expected from the change — the override module now loading where it used to fail the load, so a path that previously short-circuited now runs — or is it a real coupling to look at before merge? I can run any specific test or add logging if it helps.
No game files or dumps, numbers only.
@fuzeofficlal on GitHub · 2026-11-26 08:41 UTC · original · reviewed
Verified
9b872b7alocally on Windows 11 x64:cargo clippy --all-targets --locked -- -D warnings: clean (1.64s).cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed (0.32s).cargo test -p victory-hle --locked: 154 passed, 0 failed (152lib +1fidelityfx +1no_dll_planting,15.51s).rustfmt --edition 2024 --check crates/victory-hle/src/modules/net.rs: clean.The optional lookup fallbacks look sound:
reachable/resolvablepolicy checks still run before theLazyLockexport lookups, and theGetAddrInfoExAmissing-export path setsWSAHOST_NOT_FOUND, clears*resultviablocked_lookup(result), and returns the same error code.One coverage gap worth addressing: the existing
blocked.invalidtest returns before export lookup, andonly_loopback_is_reachabledoes not exerciseWSAConnectByList, so neither new missing-export branch is directly covered by tests. Adding direct tests for the missing-export paths (and noting in the PR description that loopback inputs such as127.0.0.1/localhostare also refused when the host lacks these two exports) would make the fallback behavior verifiable.9b872b7ab3to9096166b6c@neonbyte1 on GitHub · 2026-11-26 10:01 UTC · original
Thanks both.
@fuzeofficlal: I've added direct tests for the missing-export paths (amended, still one commit,
9096166). The two overrides now take the export lookup as a parameter. Production passes the same lazy lookups as before, so the loopback andresolvablechecks still run first. The tests passNone:WSAConnectByListwith a loopback list returnsWSAENETUNREACH;GetAddrInfoExAforlocalhostand127.0.0.1returnsWSAHOST_NOT_FOUND, sets the last error and clears*result;With both fallbacks broken on purpose, exactly the two new tests fail. The description now says that loopback targets are refused too when the exports are missing.
@YaBulochka: I couldn't reproduce the
xpackagefailure.xpackage::tests::completed_installation_unregisters_progress_immediatelypassed every time, onmainand on this branch: with and withoutdiagnostics, run on its own and in the full suite, three runs each (24 runs). That's Wine 11.22 with thex86_64-pc-windows-msvctarget on an RTX 5090. I don't have the gnu target installed. The change is confined tonet.rs: the new lazy lookups only run inside the two overrides, and that test only touches xpackage's own table, so I don't see a path from this PR to it. Could you post the assertion message and line from your gnu run? That should show whether it's toolchain-specific.AI-assisted (Claude); measured on my machine, no game data shared.
@fuzeofficlal on GitHub · 2026-11-26 11:53 UTC · original · approved these changes
Reviewed
9096166band verified on Windows 11:reachable/resolvablechecks still execute before the optionalLazyLockexport lookups (crates/victory-hle/src/modules/net.rs:299-379, 630-709), missingWSAConnectByList/GetAddrInfoExAexports fall back toWSAENETUNREACHandWSAHOST_NOT_FOUND(clearing*resultviablocked_lookup), present exports forward as before, and the new injected unit tests cover both missing-export and forwarding paths.rustfmt --edition 2024 --check,xtask policy(191 files ok),cargo clippy -p victory-hle --all-targets -- -D warnings(default and--all-features),modules::net::tests(5/5), and the fullvictory-hletest suite (155 unit + 2 integration tests) all pass.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.