XCL_NETWORK=0: a bind to a network address binds to loopback #565

Merged
tiagonleal merged 2 commits from upstream-pr/570 into main 2026-12-02 17:38:56 +00:00
tiagonleal commented 2026-11-24 01:56:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-24T01:56:38Z.


With XCL_NETWORK=0 a retail title still bound UDP 3074 on 0.0.0.0: netoff refused connect, sendto and name lookups, but not bind. Windows Firewall then asked to let the network in for xcl.exe (once per folder it runs from; "Allow" needs an administrator), and once allowed, the network reached the title's socket. Fixes #568.

A bind to a non-loopback IPv4 / IPv6 address now binds to 127.0.0.1 / ::1 on the same port. The bind succeeds as on a console without a network, the title's loopback traffic still reaches the socket, nothing from the network does, and Windows does not ask. IPv4-mapped addresses other than ::ffff:127.x.x.x end up on ::1 too. #619, merged since, makes ::ffff:127.x.x.x count as loopback, so a bind to such an address is left as it is; the rebase kept main's doc line on loopback under this PR's note_bind.

Rebased onto main 0fe06eb0; the second commit only adds tests and a doc comment. main's #612 added a hook, so the install_system_hooks array now has 20 entries. The bind is logged (note_bind) only after it succeeded: before, the 24-byte IPv6 form that Winsock refuses with WSAEFAULT was logged as bound to ::1.

What is in it

  • crates/xcl/src/hle/netoff.rs: a bind hook, in the title's ws2_32 imports (table(), ordinal 2) and in the system's ws2_32!bind (install_system_hooks), next to connect's; loopback binds go through unchanged.
  • Test a_bind_to_every_interface_stays_on_loopback: UDP and TCP binds to 0.0.0.0:0 end up on 127.0.0.1, loopback traffic reaches them, [::]:0 ends up on ::1 when the machine has IPv6.
  • Second commit, tests through the system's hooked ws2_32!bind on raw AF_INET6 sockets (port 0; skipped when the machine has no IPv6) and a doc comment:
    • an_ipv6_bind_stays_on_loopback: a 28-byte sockaddr_in6 for ::, for 2001:db8::1 and for :: with a scope id ends up on ::1 with the port kept; ::1 stays.
    • a_sockaddr_in6_under_28_bytes_is_left_alone: lengths 0, 2, 8, 20, 23 and 24, exact-size buffers and a null name are passed on as they are; Winsock itself refuses the older 24-byte form (WSAEFAULT), also for ::1, so that form fails as without the hook and the socket stays unbound.
    • a_dual_stack_bind_is_on_ipv6_loopback_only: an IPV6_V6ONLY=0 TCP listener bound to :: is on ::1 only: an IPv6 loopback connection reaches it, an IPv4 one to the same port is refused.

Tested

  • NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro build 26300, rustc 1.100.0 MSVC, debug for the tests, release for the runs.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, run twice at 8948d93d: 1429 passed, 4 failed, 47 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0 to _3 (CreateComputePipelineState, E_OUTOFMEMORY on this GPU), in code this PR does not touch; The lower_dxil barrier test that failed at the earlier head passes after the rebase.
  • cargo test -p xcl --lib netoff -- --test-threads=1 at a65cf2de: 7 passed, 0 failed. With the bind hook returning at once to the original bind: 3 failed, 4 passed (a_bind_to_every_interface_stays_on_loopback: left: 0.0.0.0, right: 127.0.0.1; an_ipv6_bind_stays_on_loopback and a_dual_stack_bind_is_on_ipv6_loopback_only: left all zeros, right ::1).
  • SKIPPED (25 lines, no wave64 and the like), as at the earlier head: the wave64 GPU tests, three lower_dxil f16 / conversion forms refused as unsupported, and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Retail title (1.0.2.1), Get-NetUDPEndpoint 25 s into each smoke run: main 0.0.0.0:3074; this PR 127.0.0.1:3074, and the log says XCL_NETWORK=0: a bind to a network address is bound to 127.0.0.1 instead (no network) (measured on the earlier head eaf034e4; not repeated on the later heads, and the hook has changed since only in when the log line is written).
  • After the rebase onto main 0fe06eb0 (head ddcf5394): cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4: 2741 passed, 0 failed, 49 ignored (27 SKIPPED lines); main 0fe06eb0 on this machine: 2737 passed, 0 failed, 49 ignored. This is the second run on this head: in the first the lib test binary of main ended early inside uma_driver::tests (the abort #3187 is open for). The other results in this section are from the earlier heads named in them.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (Newer Retail Game), release builds of both commits in clean trees, run again after the rebase onto main 0fe06eb0. Both runs had XCL_PREPARE=0 and the same warm DXIL cache, one after the other in the same session, main first, one run each. A warm-up run of main came before them and is not shown.

main (0fe06eb0):

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1687 (PresentX 1687)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15383 MB

This PR (ddcf5394):

xcl-smoke v1
commit: ddcf5394727050919e53aecbc0860be30e9eb2f6
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1697 (PresentX 1697)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15172 MB

Not tested

  • A title that binds a dual-stack socket on :: and expects IPv4 loopback connections to it (after this it is on ::1 only; pinned by a test, no real title run).
  • A bind with AF_UNSPEC, and UDP dual-stack delivery (only the TCP listener is tested).
  • AMD / Intel GPUs (the change has no GPU part), Windows 10, a machine without IPv6 (the new tests skip).
  • The log line after a refused bind (the 24-byte IPv6 form) has no test.

AI use

  • Claude Code with Claude Opus 5.5: found the socket during test runs, wrote the hook, its first test and the first version of this description.
  • Claude Code with Claude Sonnet 5.5: wrote the three added tests and ran the validation (suite, hook-removed run, both smoke runs) on my machine.
  • Claude Fable 5.2: reviewed the diff and coordinated the work.
<!-- greyfinch-sync:ivall/xcl:issue:5464607140 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-24T01:56:38Z. --- With `XCL_NETWORK=0` a retail title still bound UDP 3074 on `0.0.0.0`: `netoff` refused `connect`, `sendto` and name lookups, but not `bind`. Windows Firewall then asked to let the network in for `xcl.exe` (once per folder it runs from; "Allow" needs an administrator), and once allowed, the network reached the title's socket. Fixes #568. A bind to a non-loopback IPv4 / IPv6 address now binds to `127.0.0.1` / `::1` on the same port. The bind succeeds as on a console without a network, the title's loopback traffic still reaches the socket, nothing from the network does, and Windows does not ask. IPv4-mapped addresses other than `::ffff:127.x.x.x` end up on `::1` too. #619, merged since, makes `::ffff:127.x.x.x` count as loopback, so a bind to such an address is left as it is; the rebase kept `main`'s doc line on `loopback` under this PR's `note_bind`. Rebased onto `main` `0fe06eb0`; the second commit only adds tests and a doc comment. `main`'s #612 added a hook, so the `install_system_hooks` array now has 20 entries. The bind is logged (`note_bind`) only after it succeeded: before, the 24-byte IPv6 form that Winsock refuses with `WSAEFAULT` was logged as bound to `::1`. **What is in it** - `crates/xcl/src/hle/netoff.rs`: a `bind` hook, in the title's ws2_32 imports (`table()`, ordinal 2) and in the system's `ws2_32!bind` (`install_system_hooks`), next to `connect`'s; loopback binds go through unchanged. - Test `a_bind_to_every_interface_stays_on_loopback`: UDP and TCP binds to `0.0.0.0:0` end up on `127.0.0.1`, loopback traffic reaches them, `[::]:0` ends up on `::1` when the machine has IPv6. - Second commit, tests through the system's hooked `ws2_32!bind` on raw `AF_INET6` sockets (port 0; skipped when the machine has no IPv6) and a doc comment: - `an_ipv6_bind_stays_on_loopback`: a 28-byte `sockaddr_in6` for `::`, for `2001:db8::1` and for `::` with a scope id ends up on `::1` with the port kept; `::1` stays. - `a_sockaddr_in6_under_28_bytes_is_left_alone`: lengths 0, 2, 8, 20, 23 and 24, exact-size buffers and a null name are passed on as they are; Winsock itself refuses the older 24-byte form (WSAEFAULT), also for `::1`, so that form fails as without the hook and the socket stays unbound. - `a_dual_stack_bind_is_on_ipv6_loopback_only`: an `IPV6_V6ONLY=0` TCP listener bound to `::` is on `::1` only: an IPv6 loopback connection reaches it, an IPv4 one to the same port is refused. **Tested** - NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1742), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro build 26300, rustc 1.100.0 MSVC, debug for the tests, release for the runs. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, run twice at `8948d93d`: 1429 passed, 4 failed, 47 ignored both times (25 `SKIPPED` lines). The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0` to `_3` (`CreateComputePipelineState`, E_OUTOFMEMORY on this GPU), in code this PR does not touch; The `lower_dxil` barrier test that failed at the earlier head passes after the rebase. - `cargo test -p xcl --lib netoff -- --test-threads=1` at `a65cf2de`: 7 passed, 0 failed. With the `bind` hook returning at once to the original `bind`: 3 failed, 4 passed (`a_bind_to_every_interface_stays_on_loopback`: `left: 0.0.0.0`, `right: 127.0.0.1`; `an_ipv6_bind_stays_on_loopback` and `a_dual_stack_bind_is_on_ipv6_loopback_only`: `left` all zeros, `right` `::1`). - SKIPPED (25 lines, no wave64 and the like), as at the earlier head: the `wave64` GPU tests, three `lower_dxil` f16 / conversion forms refused as unsupported, and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Retail title (1.0.2.1), `Get-NetUDPEndpoint` 25 s into each smoke run: `main` `0.0.0.0:3074`; this PR `127.0.0.1:3074`, and the log says `XCL_NETWORK=0: a bind to a network address is bound to 127.0.0.1 instead (no network)` (measured on the earlier head `eaf034e4`; not repeated on the later heads, and the hook has changed since only in when the log line is written). - After the rebase onto `main` `0fe06eb0` (head `ddcf5394`): `cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4`: 2741 passed, 0 failed, 49 ignored (27 `SKIPPED` lines); `main` `0fe06eb0` on this machine: 2737 passed, 0 failed, 49 ignored. This is the second run on this head: in the first the lib test binary of `main` ended early inside `uma_driver::tests` (the abort #3187 is open for). The other results in this section are from the earlier heads named in them. **Regression run** `scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e` (Newer Retail Game), release builds of both commits in clean trees, run again after the rebase onto `main` `0fe06eb0`. Both runs had `XCL_PREPARE=0` and the same warm DXIL cache, one after the other in the same session, `main` first, one run each. A warm-up run of `main` came before them and is not shown. `main` (`0fe06eb0`): ``` xcl-smoke v1 commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1687 (PresentX 1687) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15383 MB ``` This PR (`ddcf5394`): ``` xcl-smoke v1 commit: ddcf5394727050919e53aecbc0860be30e9eb2f6 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1697 (PresentX 1697) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15172 MB ``` **Not tested** - A title that binds a dual-stack socket on `::` and expects IPv4 loopback connections to it (after this it is on `::1` only; pinned by a test, no real title run). - A bind with `AF_UNSPEC`, and UDP dual-stack delivery (only the TCP listener is tested). - AMD / Intel GPUs (the change has no GPU part), Windows 10, a machine without IPv6 (the new tests skip). - The log line after a refused bind (the 24-byte IPv6 form) has no test. **AI use** - Claude Code with Claude Opus 5.5: found the socket during test runs, wrote the hook, its first test and the first version of this description. - Claude Code with Claude Sonnet 5.5: wrote the three added tests and ran the validation (suite, hook-removed run, both smoke runs) on my machine. - Claude Fable 5.2: reviewed the diff and coordinated the work.
copilot-pull-request-reviewer[bot] commented 2026-11-24 02:11:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T02:11:08Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:ivall/xcl:review:6032589452 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#pullrequestreview-6032589452). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T02:11:08Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
FelipeCRamos commented 2026-11-24 07:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by FelipeCRamos on 2026-11-24T02:08:05Z.


claude code session is invalid anyway, might as well remove it ;)

<!-- greyfinch-sync:ivall/xcl:comment:7119788721 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/570#issuecomment-7119788721). Originally posted by [FelipeCRamos](https://github.com/FelipeCRamos) on 2026-11-24T02:08:05Z. --- claude code session is invalid anyway, might as well remove it ;)
MesshM commented 2026-11-24 07:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T03:33:18Z.


Test run of fc1e7a99f186a028bda6d02b1067b330f98fb4a4 on AMD RDNA4. I merged it onto current main 91f9a5e locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 693 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 653 passed, 0 failed, 21 ignored
  • 0 SKIPPED; a_bind_to_every_interface_stays_on_loopback passes.

Review: A bind to a network address (or to every interface) is moved to loopback with its port kept, so a title's sockets still bind and the firewall prompt from #568 no longer comes up; loopback binds go to the original. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7121206191 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/570#issuecomment-7121206191). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T03:33:18Z. --- Test run of `fc1e7a99f186a028bda6d02b1067b330f98fb4a4` on AMD RDNA4. I merged it onto current `main` `91f9a5e` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **693 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 653 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `a_bind_to_every_interface_stays_on_loopback` passes. **Review:** A bind to a network address (or to every interface) is moved to loopback with its port kept, so a title's sockets still bind and the firewall prompt from #568 no longer comes up; loopback binds go to the original. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
upipibi commented 2026-11-24 07:06:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T04:03:01Z.


Merge-order note for the three XCL_NETWORK=0 PRs that touch crates/xcl/src/hle/netoff.rs. I merged each pair onto main f4ce27ceb6, heads #570 fc1e7a99f1, #612 bbf3174694 and #619 2970626721:

result
#619 + #612 clean in either order; the hooks array ends up […; 19] with 19 entries
#570 + #619 conflict in either order: note_bind is inserted right above the loopback doc comment that #619 rewrites
#570 + #612 conflict in either order: O_BIND next to O_WSA_SEND_MSG, and both change hooks: [...; 18] to 19
#570 alone clean

So the simplest order is #619 and #612 first, then a rebase of #570. Its hooks array then becomes 20, with both the bind and WSASendMsg entries.

I also read #619 and #612:

  • #619's mapped check (a[..10] zero, a[10..12] == ff ff, a[12] == 127) is the RFC 4291 IPv4-mapped layout at the sockaddr_in6 address offset.
  • #612 reads WSAMSG.name at offset 0 and namelen at offset 8, which is the x64 layout.

(Above: read only, not built.)


Added 20:44Z: whole workspace at the current head 3449a3f (as is, base 3f27770), RTX 3070 8 GB (Ampere), driver 616.56, Windows 11, debug, after cargo build --workspace, cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2 --skip gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: 1351 passed, 0 failed, 46 ignored. The end-to-end title tests pass.

  • Skipped a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (this head's base has that test but not its fix, #2420) and hle::xaudio2 (fails or hangs on this machine on main too). The PR touches neither.
  • SKIPPED lines: 26: 21 no wave64, 3 f16/f32 forms the per-lane path refuses, 1 no heap windows, 1 PSO measurement that needs Developer Mode.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

<!-- greyfinch-sync:ivall/xcl:comment:7121659891 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7121659891). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T04:03:01Z. --- Merge-order note for the three `XCL_NETWORK=0` PRs that touch `crates/xcl/src/hle/netoff.rs`. I merged each pair onto `main` `f4ce27ceb6`, heads #570 `fc1e7a99f1`, #612 `bbf3174694` and #619 `2970626721`: | | result | |---|---| | #619 + #612 | clean in either order; the hooks array ends up `[…; 19]` with 19 entries | | #570 + #619 | conflict in either order: `note_bind` is inserted right above the `loopback` doc comment that #619 rewrites | | #570 + #612 | conflict in either order: `O_BIND` next to `O_WSA_SEND_MSG`, and both change `hooks: [...; 18]` to `19` | | #570 alone | clean | So the simplest order is #619 and #612 first, then a rebase of #570. Its hooks array then becomes `20`, with both the `bind` and `WSASendMsg` entries. I also read #619 and #612: - #619's mapped check (`a[..10]` zero, `a[10..12] == ff ff`, `a[12] == 127`) is the RFC 4291 IPv4-mapped layout at the `sockaddr_in6` address offset. - #612 reads `WSAMSG.name` at offset 0 and `namelen` at offset 8, which is the x64 layout. (Above: read only, not built.) --- **Added 20:44Z: whole workspace at the current head `3449a3f`** (as is, base `3f27770`), RTX 3070 8 GB (Ampere), driver 616.56, Windows 11, debug, after `cargo build --workspace`, `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2 --skip gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`: **1351 passed, 0 failed, 46 ignored**. The end-to-end title tests pass. - Skipped `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (this head's base has that test but not its fix, #2420) and `hle::xaudio2` (fails or hangs on this machine on `main` too). The PR touches neither. - SKIPPED lines: 26: 21 `no wave64`, 3 f16/f32 forms the per-lane path refuses, 1 no heap windows, 1 PSO measurement that needs Developer Mode. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
tiagonleal commented 2026-11-24 12:05:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-24T11:45:28Z.


@FelipeCRamos dropped the session trailer; the commit is otherwise unchanged.

@upipibi thanks for checking the merge order. Rebased onto main 47efa2e (clean, same diff). If #612 and #619 go in first I'll rebase again and the hooks array becomes 20 with both the bind and WSASendMsg entries. New test counts and both smoke blocks are in the description; Get-NetUDPEndpoint 25 s in: main 0.0.0.0:3074, this PR 127.0.0.1:3074.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7130507417 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/570#issuecomment-7130507417). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-24T11:45:28Z. --- @FelipeCRamos dropped the session trailer; the commit is otherwise unchanged. @upipibi thanks for checking the merge order. Rebased onto `main` `47efa2e` (clean, same diff). If #612 and #619 go in first I'll rebase again and the hooks array becomes 20 with both the `bind` and `WSASendMsg` entries. New test counts and both smoke blocks are in the description; `Get-NetUDPEndpoint` 25 s in: `main` `0.0.0.0:3074`, this PR `127.0.0.1:3074`. AI-assisted (Claude Code).
zorde23 commented 2026-11-24 16:07:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by zorde23 on 2026-11-24T15:49:13Z.


AMD RX 6750 XT data point for #570 (RDNA2, driver 32.0.21045.29003; Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200; release builds)

eaf034e cherry-picks cleanly onto current main 930e8b4 (local commit 4b7356a, which is the commit in the PR smoke block below). Both builds came from fresh worktrees, so each xcl.exe was at a path Windows Firewall had never seen. Retail title of #505, XCL_NETWORK=0, 60 s smoke each, with the UDP endpoints of the xcl.exe processes polled every 2 s (Get-NetUDPEndpoint -OwningProcess):

UDP endpoint of the title's host process Windows Firewall prompt firewall rules created for that xcl.exe
main 930e8b4 0.0.0.0:3074 (first seen ~8 s into the run) yes, opened in the same second as the bind 2 (Inbound Block, TCP and UDP, Private profile; Windows added them while the prompt was unanswered)
#570 on 930e8b4 127.0.0.1:3074 for the whole run none 0
  • The PR log line appears once: XCL_NETWORK=0: a bind to a network address is bound to 127.0.0.1 instead (no network), 5.6 s in. No other listening socket (TCP or UDP) on either run.
  • The title ran normally with the bind moved to loopback: no crash, no device removal, frames at 83% of main and peak commit at 100% (one run each, so the frame gap is within single-run noise as far as I can tell; the change only touches bind).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: main 748 passed, 3 failed, 41 ignored; #570 749 passed, 3 failed, 41 ignored (the +1 is netoff::a_bind_to_every_interface_stays_on_loopback, which passes). The 3 failures (title_textures::placed_title_textures_share_vram_and_preserve_pixels, title_textures::transitions_apply_when_their_list_is_submitted, vram::d32s8_targets_take_their_own_size_of_video_memory) fail on this GPU on main too.
  • Not tested: IPv6 binds from the title (it only bound IPv4 here), the ordinal-2 import path vs the system hook separately, and #570 together with the other open netoff PRs (#462, #612, #619, #807, #808, #821), which touch the same file.

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1406 (PresentX 1406)
presents per 2 s (last 3): 1 0 0
device removals: 0
crashes: 0
peak commit: 54309 MB

PR:

xcl-smoke v1
commit: 4b7356abc555b709401fb54b4eef35dae1204077
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1172 (PresentX 1172)
presents per 2 s (last 3): 1 1 1
device removals: 0
crashes: 0
peak commit: 54245 MB

Written with Claude Code from runs on this machine.

<!-- greyfinch-sync:ivall/xcl:comment:7136666799 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/570#issuecomment-7136666799). Originally posted by [zorde23](https://github.com/zorde23) on 2026-11-24T15:49:13Z. --- **AMD RX 6750 XT data point for #570** (RDNA2, driver 32.0.21045.29003; Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200; release builds) `eaf034e` cherry-picks cleanly onto current main `930e8b4` (local commit `4b7356a`, which is the commit in the PR smoke block below). Both builds came from fresh worktrees, so each `xcl.exe` was at a path Windows Firewall had never seen. Retail title of #505, `XCL_NETWORK=0`, 60 s smoke each, with the UDP endpoints of the `xcl.exe` processes polled every 2 s (`Get-NetUDPEndpoint -OwningProcess`): | | UDP endpoint of the title's host process | Windows Firewall prompt | firewall rules created for that `xcl.exe` | |---|---|---|---| | main 930e8b4 | `0.0.0.0:3074` (first seen ~8 s into the run) | yes, opened in the same second as the bind | 2 (Inbound Block, TCP and UDP, Private profile; Windows added them while the prompt was unanswered) | | #570 on 930e8b4 | `127.0.0.1:3074` for the whole run | none | 0 | - The PR log line appears once: `XCL_NETWORK=0: a bind to a network address is bound to 127.0.0.1 instead (no network)`, 5.6 s in. No other listening socket (TCP or UDP) on either run. - The title ran normally with the bind moved to loopback: no crash, no device removal, frames at 83% of main and peak commit at 100% (one run each, so the frame gap is within single-run noise as far as I can tell; the change only touches `bind`). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: main 748 passed, 3 failed, 41 ignored; #570 749 passed, 3 failed, 41 ignored (the +1 is `netoff::a_bind_to_every_interface_stays_on_loopback`, which passes). The 3 failures (`title_textures::placed_title_textures_share_vram_and_preserve_pixels`, `title_textures::transitions_apply_when_their_list_is_submitted`, `vram::d32s8_targets_take_their_own_size_of_video_memory`) fail on this GPU on main too. - Not tested: IPv6 binds from the title (it only bound IPv4 here), the ordinal-2 import path vs the system hook separately, and #570 together with the other open netoff PRs (#462, #612, #619, #807, #808, #821), which touch the same file. main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: AMD Radeon RX 6750 XT title: retail-a seconds: 60 exit: 0x0 frames shown: 1406 (PresentX 1406) presents per 2 s (last 3): 1 0 0 device removals: 0 crashes: 0 peak commit: 54309 MB ``` PR: ``` xcl-smoke v1 commit: 4b7356abc555b709401fb54b4eef35dae1204077 gpu: AMD Radeon RX 6750 XT title: retail-a seconds: 60 exit: 0x0 frames shown: 1172 (PresentX 1172) presents per 2 s (last 3): 1 1 1 device removals: 0 crashes: 0 peak commit: 54245 MB ``` Written with Claude Code from runs on this machine.
tiagonleal commented 2026-11-24 16:07:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-24T15:52:01Z.


@zorde23 thanks for the RDNA2 run. For your last "not tested" point: #570 merged with the other eight open netoff PRs (#462, #612, #619, #807, #808, #821, #494, #299) builds and passes the whole suite on the RTX 5070 Ti (758 passed, 0 failed, 41 ignored; 7 netoff tests); the merge order and resolutions are in my comment on #568.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7136745292 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/570#issuecomment-7136745292). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-24T15:52:01Z. --- @zorde23 thanks for the RDNA2 run. For your last "not tested" point: #570 merged with the other eight open netoff PRs (#462, #612, #619, #807, #808, #821, #494, #299) builds and passes the whole suite on the RTX 5070 Ti (758 passed, 0 failed, 41 ignored; 7 netoff tests); the merge order and resolutions are in my comment on #568. AI-assisted (Claude Code).
JJAutoCompare commented 2026-11-25 07:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:58:59Z.


Independent Windows x64 test report on commit eaf034e43c2273b2a409cb92788449991a332b4f.

Environment

  • OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0)
  • CPU: AMD Ryzen 7 3800X
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09)
  • Note: CPU-only targeted run (XCL_ADAPTER=NONE_CPU_ONLY)

Command

xcl-77aca8ccb20e299f.exe --exact --nocapture --test-threads=1 `
  hle::netoff::tests::a_bind_to_every_interface_stays_on_loopback `
  hle::netoff::tests::only_loopback_goes_through

Results

  • Passed: 2, Failed: 0, Ignored: 0, Skipped: 0 (0.02s, exit code 0)
  • hle::netoff::tests::a_bind_to_every_interface_stays_on_loopback: ok
  • hle::netoff::tests::only_loopback_goes_through: ok

Not tested

  • Full workspace suite and game smoke run.

AI use

  • Verified and published with T3 Code / Antigravity (gemini-4-neon).
<!-- greyfinch-sync:ivall/xcl:comment:7155361316 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7155361316). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:58:59Z. --- Independent Windows x64 test report on commit `eaf034e43c2273b2a409cb92788449991a332b4f`. **Environment** - OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0) - CPU: AMD Ryzen 7 3800X - Toolchain: `rustc 1.100.0 (0ef1bc386 2026-11-09)` - Note: CPU-only targeted run (`XCL_ADAPTER=NONE_CPU_ONLY`) **Command** ```powershell xcl-77aca8ccb20e299f.exe --exact --nocapture --test-threads=1 ` hle::netoff::tests::a_bind_to_every_interface_stays_on_loopback ` hle::netoff::tests::only_loopback_goes_through ``` **Results** - Passed: 2, Failed: 0, Ignored: 0, Skipped: 0 (0.02s, exit code 0) - `hle::netoff::tests::a_bind_to_every_interface_stays_on_loopback`: ok - `hle::netoff::tests::only_loopback_goes_through`: ok **Not tested** - Full workspace suite and game smoke run. **AI use** - Verified and published with T3 Code / Antigravity (`gemini-4-neon`).
DavidM1911 commented 2026-11-25 14:09:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:18:34Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7163589537 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7163589537). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T13:18:34Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
thehollowedone commented 2026-11-26 00:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T23:39:42Z.


Independent Windows/NVIDIA check of head 3449a3f, plus a local, uncommitted integration with current main 08db802.

Tested

  • Windows 11 Pro build 26300; NVIDIA GeForce RTX 3080 Ti, driver 621.35; AMD Ryzen 7 9800X3D; Rust 1.99.1 MSVC; DXC/DXIL 1.8.2502.11; debug profile.
  • On the exact PR head, cargo test -p xcl --lib netoff -- --test-threads=1 --nocapture: 6 passed, 0 failed, no IPv6 skip. IPv4, IPv6 and dual-stack loopback binding tests ran.
  • On that head, cargo build --workspace passed; cargo test --workspace --no-fail-fast -- --test-threads=4: 1,360 passed, 1 failed, 46 ignored, with 25 explicit SKIPPED notices. The sole failure was a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (3 barriers versus its old expected count of 1); it failed again alone.
  • The same barrier test passed alone on clean current main (1/0). Since this PR's base, main changed that test's assertion to count barriers after the entry branch. A conflict-free git merge --no-commit of this head into 08db802 changed only netoff.rs; cargo build --workspace and the full workspace test then passed: 1,433 passed, 0 failed, 47 ignored, with 25 explicit skips (21 no native wave64, three refused per-lane cases, one unavailable heap-window case). No merge commit or push was made.

Rebasing this PR onto current main should bring in the updated barrier assertion. The clean rebased head would still need its own suite and paired smoke run under the PR rules. One small diagnostic detail: the 24-byte IPv6 bind case fails with WSAEFAULT as tested, but note_bind prints that it was bound to ::1 before Winsock returns; logging only after a successful bind would make that message accurate.

Not tested

  • A retail title or firewall UI on this machine; AMD hardware. The integration result is an uncommitted local merge, not a test of a rebased PR head.

AI use

  • Codex (GPT-6.2 Sol) reviewed the diff and test change, ran the checks above, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7177873862 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7177873862). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T23:39:42Z. --- Independent Windows/NVIDIA check of [head `3449a3f`](https://github.com/xcl-dev/xcl/commit/3449a3f383f40e935de7705769187d8109ef0054), plus a local, uncommitted integration with current [`main` `08db802`](https://github.com/xcl-dev/xcl/commit/08db8020d323bf478964fcc586152cce54959cfc). **Tested** - Windows 11 Pro build 26300; NVIDIA GeForce RTX 3080 Ti, driver 621.35; AMD Ryzen 7 9800X3D; Rust 1.99.1 MSVC; DXC/DXIL 1.8.2502.11; debug profile. - On the exact PR head, `cargo test -p xcl --lib netoff -- --test-threads=1 --nocapture`: **6 passed, 0 failed**, no IPv6 skip. IPv4, IPv6 and dual-stack loopback binding tests ran. - On that head, `cargo build --workspace` passed; `cargo test --workspace --no-fail-fast -- --test-threads=4`: **1,360 passed, 1 failed, 46 ignored**, with 25 explicit `SKIPPED` notices. The sole failure was `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (3 barriers versus its old expected count of 1); it failed again alone. - The same barrier test passed alone on clean current `main` (`1/0`). Since this PR's base, [main changed that test's assertion](https://github.com/xcl-dev/xcl/commit/c828d8c) to count barriers after the entry branch. A conflict-free `git merge --no-commit` of this head into `08db802` changed only `netoff.rs`; `cargo build --workspace` and the full workspace test then passed: **1,433 passed, 0 failed, 47 ignored**, with 25 explicit skips (21 no native wave64, three refused per-lane cases, one unavailable heap-window case). No merge commit or push was made. Rebasing this PR onto current `main` should bring in the updated barrier assertion. The clean rebased head would still need its own suite and paired smoke run under the PR rules. One small diagnostic detail: the 24-byte IPv6 bind case fails with `WSAEFAULT` as tested, but `note_bind` prints that it was bound to `::1` before Winsock returns; logging only after a successful bind would make that message accurate. **Not tested** - A retail title or firewall UI on this machine; AMD hardware. The integration result is an uncommitted local merge, not a test of a rebased PR head. **AI use** - Codex (GPT-6.2 Sol) reviewed the diff and test change, ran the checks above, and drafted this report.
DavidM1911 commented 2026-11-26 03:06:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:00:09Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7181307048 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7181307048). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:00:09Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
tiagonleal commented 2026-11-26 12:07:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T11:53:40Z.


Thanks. The branch is now rebased on main 08db8020, in two commits (75b301b8, 8948d93d). note_bind now logs only after the bind succeeds, so the 24-byte IPv6 case, which Winsock refuses with WSAEFAULT, no longer says it was bound to ::1. That change has no test of its own.

Run on 8948d93d: cargo test -p xcl --lib netoff -- --test-threads=1, 6 passed, 3 of 3 runs. With the bind hook taken out, 3 fail and 3 pass (the same three that fail without the fix). cargo test --workspace --no-fail-fast -- --test-threads=4, twice: 1429 passed, 4 failed, 47 ignored, 25 SKIPPED lines; the 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY on this machine). The barrier test you saw failing passes after the rebase. 60 s smoke runs on 08db8020 and 8948d93d: both exit 0, no device removals, 1603 and 1618 frames shown.

Not run: a retail title with the firewall prompt on this machine, AMD hardware, and the four fuzz tests on main today.

<!-- greyfinch-sync:ivall/xcl:comment:7191301566 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7191301566). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T11:53:40Z. --- Thanks. The branch is now rebased on `main` 08db8020, in two commits (75b301b8, 8948d93d). `note_bind` now logs only after the bind succeeds, so the 24-byte IPv6 case, which Winsock refuses with `WSAEFAULT`, no longer says it was bound to `::1`. That change has no test of its own. Run on 8948d93d: `cargo test -p xcl --lib netoff -- --test-threads=1`, 6 passed, 3 of 3 runs. With the `bind` hook taken out, 3 fail and 3 pass (the same three that fail without the fix). `cargo test --workspace --no-fail-fast -- --test-threads=4`, twice: 1429 passed, 4 failed, 47 ignored, 25 SKIPPED lines; the 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (E_OUTOFMEMORY on this machine). The barrier test you saw failing passes after the rebase. 60 s smoke runs on 08db8020 and 8948d93d: both exit 0, no device removals, 1603 and 1618 frames shown. Not run: a retail title with the firewall prompt on this machine, AMD hardware, and the four fuzz tests on `main` today.
BBareth commented 2026-11-30 23:29:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T23:29:30Z.


merge-check claim
head: ddcf539472

<!-- greyfinch-sync:ivall/xcl:comment:7295178770 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7295178770). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T23:29:30Z. --- merge-check claim head: ddcf5394727050919e53aecbc0860be30e9eb2f6
BBareth commented 2026-11-30 23:38:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T23:38:08Z.


merge-check
base: d0832e614f
head: ddcf539472
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, run earlier today on the same commit: 2890 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The four new tests ran and passed, the IPv6 ones included (this machine has IPv6): a_bind_to_every_interface_stays_on_loopback, an_ipv6_bind_stays_on_loopback, a_sockaddr_in6_under_28_bytes_is_left_alone, a_dual_stack_bind_is_on_ipv6_loopback_only.
review: no blocking finding; one file (+213/-1), every line read. Only with XCL_NETWORK=0 (the hooks are not installed otherwise): bind (ws2_32 ordinal 2 in the import table, and the system hook) rewrites a non-loopback sockaddr_in to 127.0.0.1 and a 28-byte sockaddr_in6 to ::1 with the scope id cleared, keeps the port, copies into a local buffer of the right size and never reads past len; loopback binds, other families, short or null names go to the original unchanged. Limits the description already states and the tests pin down: a dual-stack socket bound to :: no longer accepts IPv4 loopback connections, and a title that expects network traffic on the socket gets none (that is the point of the switch). Not tested here: a retail title with XCL_NETWORK=0; whether the Windows firewall prompt at start goes away with it was not checked in this run.
performance: none by default (opt-in switch); with it, one address copy per bind.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7295351901 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7295351901). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T23:38:08Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: ddcf5394727050919e53aecbc0860be30e9eb2f6 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2894 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, run earlier today on the same commit: 2890 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The four new tests ran and passed, the IPv6 ones included (this machine has IPv6): `a_bind_to_every_interface_stays_on_loopback`, `an_ipv6_bind_stays_on_loopback`, `a_sockaddr_in6_under_28_bytes_is_left_alone`, `a_dual_stack_bind_is_on_ipv6_loopback_only`. review: no blocking finding; one file (+213/-1), every line read. Only with `XCL_NETWORK=0` (the hooks are not installed otherwise): `bind` (ws2_32 ordinal 2 in the import table, and the system hook) rewrites a non-loopback `sockaddr_in` to 127.0.0.1 and a 28-byte `sockaddr_in6` to ::1 with the scope id cleared, keeps the port, copies into a local buffer of the right size and never reads past `len`; loopback binds, other families, short or null names go to the original unchanged. Limits the description already states and the tests pin down: a dual-stack socket bound to `::` no longer accepts IPv4 loopback connections, and a title that expects network traffic on the socket gets none (that is the point of the switch). Not tested here: a retail title with `XCL_NETWORK=0`; whether the Windows firewall prompt at start goes away with it was not checked in this run. performance: none by default (opt-in switch); with it, one address copy per bind. verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Foniass commented 2026-12-01 03:44:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:44:02Z.


Triage (#1607) – head ddcf539

#1532 hooked bind the same way (rewrite a non-loopback bind to 127.0.0.1 / ::1) and is closed; this PR was opened first. Main has no bind hook in netoff.rs. The rewrite keeps the port, passes loopback binds and short sockaddr_in6 forms through unchanged, and the tests cover IPv4, IPv6, short lengths and the dual-stack :: case. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300008785 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7300008785). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:44:02Z. --- **Triage (#1607)** – head ddcf539 #1532 hooked `bind` the same way (rewrite a non-loopback bind to 127.0.0.1 / ::1) and is closed; this PR was opened first. Main has no `bind` hook in `netoff.rs`. The rewrite keeps the port, passes loopback binds and short `sockaddr_in6` forms through unchanged, and the tests cover IPv4, IPv6, short lengths and the dual-stack `::` case. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 10:11:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T10:11:31Z.


merge-check
base: 1c8b551475
head: ddcf539472
merge: clean (trial-merge commit f98e2f74eca30d725acfad4d5b6758fbffee7783, git diff --check clean)
build: cargo build --workspace ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2913 passed, 0 failed, 51 ignored (+4 new tests vs main baseline). Targeted hle::netoff::tests passed 7/7 with 0 skips, including all 4 new Winsock tests (a_bind_to_every_interface_stays_on_loopback, an_ipv6_bind_stays_on_loopback, a_sockaddr_in6_under_28_bytes_is_left_alone, a_dual_stack_bind_is_on_ipv6_loopback_only). 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: Read the full merged diff (+213/-1 in crates/xcl/src/hle/netoff.rs). Adds ws2_32.dll bind (ordinal 2) to both the import table and install_system_hooks under XCL_NETWORK=0. Already-loopback addresses pass through unchanged; non-loopback AF_INET (len >= 16) binds are rewritten to 127.0.0.1 preserving port, and non-loopback AF_INET6 (len >= 24) binds copy len.min(28) bytes without reading past len, rewrite the address to ::1 with scope id zeroed, and forward n bytes so Winsock still rejects 24-byte sockaddr_in6 with WSAEFAULT. Null/short/other families forward unchanged to orig_bind, and note_bind caps info logs at 16 entries. The four new unit tests exercise IPv4, IPv6, truncated/null sockaddr_in6, and dual-stack IPV6_V6ONLY=0 behavior against real Winsock sockets. No scope creep or UB.
performance: not applicable (Tier 1 — XCL_NETWORK=0 Winsock bind hook only, off hot rendering/GPU paths).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7342101708 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/570#issuecomment-7342101708). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T10:11:31Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: ddcf5394727050919e53aecbc0860be30e9eb2f6 merge: clean (trial-merge commit f98e2f74eca30d725acfad4d5b6758fbffee7783, git diff --check clean) build: cargo build --workspace ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2913 passed, 0 failed, 51 ignored (+4 new tests vs main baseline). Targeted hle::netoff::tests passed 7/7 with 0 skips, including all 4 new Winsock tests (a_bind_to_every_interface_stays_on_loopback, an_ipv6_bind_stays_on_loopback, a_sockaddr_in6_under_28_bytes_is_left_alone, a_dual_stack_bind_is_on_ipv6_loopback_only). 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)). review: Read the full merged diff (+213/-1 in crates/xcl/src/hle/netoff.rs). Adds `ws2_32.dll` `bind` (ordinal 2) to both the import table and `install_system_hooks` under `XCL_NETWORK=0`. Already-loopback addresses pass through unchanged; non-loopback `AF_INET` (`len >= 16`) binds are rewritten to `127.0.0.1` preserving port, and non-loopback `AF_INET6` (`len >= 24`) binds copy `len.min(28)` bytes without reading past `len`, rewrite the address to `::1` with scope id zeroed, and forward `n` bytes so Winsock still rejects 24-byte `sockaddr_in6` with `WSAEFAULT`. Null/short/other families forward unchanged to `orig_bind`, and `note_bind` caps info logs at 16 entries. The four new unit tests exercise IPv4, IPv6, truncated/null `sockaddr_in6`, and dual-stack `IPV6_V6ONLY=0` behavior against real Winsock sockets. No scope creep or UB. performance: not applicable (Tier 1 — `XCL_NETWORK=0` Winsock `bind` hook only, off hot rendering/GPU paths). verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!565
No description provided.