XCL_NETWORK=0: parse loopback IPs in local_name instead of matching any 127. prefix #808

Open
github-bot wants to merge 1 commit from github-bot/gh-808 into main AGit
Owner

@⁠mastrr9 on GitHub · 2026-11-24 05:41 UTC · original
mastrr9:fix/netoff-local-name-ip-parse → main · +17 −1 · 1 files · 1 commits · open

netoff::local_name checked name.starts_with("127."), which matched arbitrary non-IP hostnames such as "127.example.com" and allowed getaddrinfo / GetAddrInfoW / GetAddrInfoExW to issue real DNS queries when XCL_NETWORK=0.

What is in it

  • crates/xcl/src/hle/netoff.rs: replaces name.starts_with("127.") || name == "::1" with name.parse::<std::net::IpAddr>().is_ok_and(|ip| ip.is_loopback()), rejecting non-IP "127.*" hostnames while still permitting all IPv4 and IPv6 loopback literals (127.0.0.1, 127.255.255.254, ::1, 0:0:0:0:0:0:0:1), empty strings, "localhost", and the host's own hostname.
  • Regression test local_name_parses_loopback_ips.

Tested

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), D3D12 debug layer installed (d3d12SDKLayers.dll), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC from Windows SDK 10.0.26100.0, debug build.
  • Negative control (unmodified main d208e14): assert!(!local_name("127.example.com")) failed (local_name("127.example.com") returned true).
  • Command (identical tree at 38f42d4 / pushed head 76cfbf4): cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result: 705 passed, 0 failed, 41 ignored (0 new warnings).
  • SKIPPED (2): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run
Smoke run by @⁠Toons29 in comment below: #808
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: 13be36d054e81acc7f7df9fad85d371d47b37974
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14810 MB

Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; the tester checked the blocks before posting.

Not tested

  • By the author: AMD/wave64 hardware, and release build.
  • Whether the community regression run above reaches the code this PR changes.

AI use

  • Claude Opus 5.5 (via Claude Duet / Claude Code) spotted the 127. prefix issue from source review.
  • Antigravity (Gemini 4 Neon) implemented the IpAddr::is_loopback() fix and regression test, verified the negative control and full Windows RTX 5080 MSVC workspace suite, and drafted this PR description.
  • Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
**@⁠mastrr9** on GitHub · 2026-11-24 05:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/808) `mastrr9:fix/netoff-local-name-ip-parse` → `main` · +17 −1 · 1 files · 1 commits · open `netoff::local_name` checked `name.starts_with("127.")`, which matched arbitrary non-IP hostnames such as `"127.example.com"` and allowed `getaddrinfo` / `GetAddrInfoW` / `GetAddrInfoExW` to issue real DNS queries when `XCL_NETWORK=0`. **What is in it** - `crates/xcl/src/hle/netoff.rs`: replaces `name.starts_with("127.") || name == "::1"` with `name.parse::<std::net::IpAddr>().is_ok_and(|ip| ip.is_loopback())`, rejecting non-IP `"127.*"` hostnames while still permitting all IPv4 and IPv6 loopback literals (`127.0.0.1`, `127.255.255.254`, `::1`, `0:0:0:0:0:0:0:1`), empty strings, `"localhost"`, and the host's own hostname. - Regression test `local_name_parses_loopback_ips`. **Tested** - **Environment:** NVIDIA GeForce RTX 5080 (16 GB, wave32, driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), D3D12 debug layer installed (`d3d12SDKLayers.dll`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC from Windows SDK `10.0.26100.0`, debug build. - **Negative control (unmodified `main` `d208e14`):** `assert!(!local_name("127.example.com"))` **failed** (`local_name("127.example.com")` returned `true`). - **Command (identical tree at `38f42d4` / pushed head `76cfbf4`):** `cargo build --workspace && cargo test --workspace -- --test-threads=4` - **Result:** **705 passed, 0 failed, 41 ignored** (0 new warnings). - **SKIPPED (2):** `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`), `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`). **Regression run** Smoke run by @⁠Toons29 in comment below: https://git.gtahub.st/github/xcl-dev--xcl/pulls/808 Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: 13be36d054e81acc7f7df9fad85d371d47b37974 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14810 MB ``` Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; the tester checked the blocks before posting. **Not tested** - By the author: AMD/wave64 hardware, and release build. - Whether the community regression run above reaches the code this PR changes. **AI use** - Claude Opus 5.5 (via Claude Duet / Claude Code) spotted the `127.` prefix issue from source review. - Antigravity (Gemini 4 Neon) implemented the `IpAddr::is_loopback()` fix and regression test, verified the negative control and full Windows RTX 5080 MSVC workspace suite, and drafted this PR description. - Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:20 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 07:06 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head 76cfbf4 (on its base d208e14).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 705 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: local_name_parses_loopback_ips.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 07:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/808#issuecomment-7124619760) Full-suite run, since this PR has no test report yet. Tested exact head `76cfbf4` (on its base `d208e14`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **705 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `local_name_parses_loopback_ips`. **Not tested** - AMD, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 07:17 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head 76cfbf4 onto main beaa245, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 703 passed, 11 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. local_name_parses_loopback_ips and only_loopback_goes_through ok under Proton Experimental with XCL_NETWORK=0.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 07:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/808#issuecomment-7124832066) Linux / AMD RDNA3 datapoint. **Merged state:** head `76cfbf4` onto main `beaa245`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **703 passed, 11 failed, 41 ignored**. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. `local_name_parses_loopback_ips` and `only_loopback_goes_through` ok under Proton Experimental with `XCL_NETWORK=0`. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠OrangeCrane1738 on GitHub · 2026-11-24 16:57 UTC · original · edited 2026-11-24 17:53 UTC

Test report for 13be36d on the retail title: one 120 s smoke run without this PR and one with it.

Tested

  • Windows 11 Pro, NVIDIA GeForce RTX 5060 Ti, release builds, scripts/smoke.ps1 -Seconds 120 on the retail title, no input.
  • This PC has no Gaming Services, so plain main dies early on the XAsync routing that #235 fixes. Both builds therefore include #235: main 930e8b4 + #235, and the same + this PR (13be36d). Their commits are local merges, so the blocks below can't stand in for the main / PR-head pair the PR check needs.
  • The title: line is the game folder's name, shortened.
  • Nothing visible in 120 s, which is what this change should do on a working title: no lookup was refused in either run (no XCL_NETWORK=0: ... fails lines), so the local lookups the title makes at start still go through with the stricter check. The system hooks installed in both runs.
  • Otherwise the same: DirectStorage 9,767 requests / 650 MB / 0 failed in both runs, the same 6 refused online-ticket requests, frames and memory within run-to-run noise, no crashes and no device removals.

Smoke runs

main 930e8b4 + #235

xcl-smoke v1
commit: 3541e845d618340493a14ee1aff600a2d58e8829
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTA6.Xbox.v1.0.2.1
seconds: 120
exit: 0x0
frames shown: 1189 (PresentX 1189)
presents per 2 s (last 3): 22 20 24
device removals: 0
crashes: 0
peak commit: 15415 MB

main 930e8b4 + #235 + #808 (13be36d)

xcl-smoke v1
commit: 16103eea5c175e5461133807c0de4ad2f9990e69
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTA6.Xbox.v1.0.2.1
seconds: 120
exit: 0x0
frames shown: 1240 (PresentX 1240)
presents per 2 s (last 3): 24 24 23
device removals: 0
crashes: 0
peak commit: 15366 MB

Not tested

  • Runs of main and of this PR's head as they are (no Gaming Services here, see above).
  • A title that looks up a name like 127.example.com.
  • AMD; the cargo test suite (not run for this report).

AI use

  • Claude Opus 5.5 (in the Claude app): set up the test script, read the logs and wrote this report. The runs were made on my own machine with my own copy; nothing from the game is attached.
**@⁠OrangeCrane1738** on GitHub · 2026-11-24 16:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/808#issuecomment-7138468334) · edited 2026-11-24 17:53 UTC Test report for 13be36d on the retail title: one 120 s smoke run without this PR and one with it. **Tested** - Windows 11 Pro, NVIDIA GeForce RTX 5060 Ti, release builds, `scripts/smoke.ps1 -Seconds 120` on the retail title, no input. - This PC has no Gaming Services, so plain `main` dies early on the XAsync routing that #235 fixes. Both builds therefore include #235: `main` 930e8b4 + #235, and the same + this PR (13be36d). Their commits are local merges, so the blocks below can't stand in for the main / PR-head pair the PR check needs. - The `title:` line is the game folder's name, shortened. - Nothing visible in 120 s, which is what this change should do on a working title: no lookup was refused in either run (no `XCL_NETWORK=0: ... fails` lines), so the local lookups the title makes at start still go through with the stricter check. The system hooks installed in both runs. - Otherwise the same: DirectStorage 9,767 requests / 650 MB / 0 failed in both runs, the same 6 refused online-ticket requests, frames and memory within run-to-run noise, no crashes and no device removals. **Smoke runs** main 930e8b4 + #235 ``` xcl-smoke v1 commit: 3541e845d618340493a14ee1aff600a2d58e8829 gpu: NVIDIA GeForce RTX 5060 Ti title: GTA6.Xbox.v1.0.2.1 seconds: 120 exit: 0x0 frames shown: 1189 (PresentX 1189) presents per 2 s (last 3): 22 20 24 device removals: 0 crashes: 0 peak commit: 15415 MB ``` main 930e8b4 + #235 + #808 (13be36d) ``` xcl-smoke v1 commit: 16103eea5c175e5461133807c0de4ad2f9990e69 gpu: NVIDIA GeForce RTX 5060 Ti title: GTA6.Xbox.v1.0.2.1 seconds: 120 exit: 0x0 frames shown: 1240 (PresentX 1240) presents per 2 s (last 3): 24 24 23 device removals: 0 crashes: 0 peak commit: 15366 MB ``` **Not tested** - Runs of `main` and of this PR's head as they are (no Gaming Services here, see above). - A title that looks up a name like `127.example.com`. - AMD; the cargo test suite (not run for this report). **AI use** - Claude Opus 5.5 (in the Claude app): set up the test script, read the logs and wrote this report. The runs were made on my own machine with my own copy; nothing from the game is attached.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:01 UTC · original

Regression run of 13be36d0 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 13be36d054e81acc7f7df9fad85d371d47b37974
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14810 MB

Against the limits in CONTRIBUTING.md: 100 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/808#issuecomment-7151509411) Regression run of `13be36d0` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 13be36d054e81acc7f7df9fad85d371d47b37974 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14810 MB ``` Against the limits in CONTRIBUTING.md: 100 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:48 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 10:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/808#issuecomment-7160197266) 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!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/808/head:github-bot/gh-808'
git switch 'github-bot/gh-808'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-808'
git switch 'github-bot/gh-808'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-808'
git switch 'github-bot/gh-808'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-808'
git switch 'main'
git merge --squash 'github-bot/gh-808'
git switch 'main'
git merge --ff-only 'github-bot/gh-808'
git switch 'main'
git merge 'github-bot/gh-808'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.