XGameRuntime: XNetworking configuration settings and statistics #843

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

@⁠mastrr9 on GitHub · 2026-11-24 06:39 UTC · original
mastrr9:feat/xgameruntime-xnetworking-config-stats → main · +106 −0 · 3 files · 1 commits · open

Implements XNetworkingQueryConfigurationSetting, XNetworkingSetConfigurationSetting, and XNetworkingQueryStatistics (slots 18–20 of bf2346b2 in gdk_table.rs, previously returning E_NOTIMPL) and wires them into both api.rs and mod.rs exports:

  • Initializes the three XNetworkingConfigurationSetting values (Title / System / Tools max TCP queued receive buffer size) to the documented console defaults (32 MiB, 4 MiB, UINT64_MAX), persists any u64 written by the title, and rejects unknown settings or null pointers with E_INVALIDARG.
  • XNetworkingQueryStatistics writes only the 40-byte zeroed XNetworkingTcpQueuedReceivedBufferUsageStatistics substructure for statistics types 0–2 (leaving trailing union bytes untouched) and returns E_INVALIDARG on invalid kind or null pointer.
  • Adds unit tests configuration_settings_keep_what_the_title_sets and statistics_write_only_the_substructure plus the 40-byte layout assertion.

Tested

  • Hardware/OS: NVIDIA RTX 5080 (driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC debug, DXC Windows SDK 10.0.26100.0, d3d12SDKLayers.dll installed
  • Commit tested: 3c0958146b51432ef95de52f9ad1f40cc77c20f9
  • cargo build --workspace: clean (only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 715 passed, 0 failed, 41 ignored (new tests configuration_settings_keep_what_the_title_sets and statistics_write_only_the_substructure passed)
  • SKIPPED GPU tests: 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: #843
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: 743723717ea05fabe5ebbb6653afe828dead202f
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1625 (PresentX 1625)
presents per 2 s (last 3): 60 60 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

  • No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known.

AI use

  • Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
  • 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 06:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/843) `mastrr9:feat/xgameruntime-xnetworking-config-stats` → `main` · +106 −0 · 3 files · 1 commits · open Implements `XNetworkingQueryConfigurationSetting`, `XNetworkingSetConfigurationSetting`, and `XNetworkingQueryStatistics` (slots 18–20 of `bf2346b2` in `gdk_table.rs`, previously returning `E_NOTIMPL`) and wires them into both `api.rs` and `mod.rs` exports: - Initializes the three `XNetworkingConfigurationSetting` values (Title / System / Tools max TCP queued receive buffer size) to the documented console defaults (`32 MiB`, `4 MiB`, `UINT64_MAX`), persists any `u64` written by the title, and rejects unknown settings or null pointers with `E_INVALIDARG`. - `XNetworkingQueryStatistics` writes only the 40-byte zeroed `XNetworkingTcpQueuedReceivedBufferUsageStatistics` substructure for statistics types 0–2 (leaving trailing union bytes untouched) and returns `E_INVALIDARG` on invalid kind or null pointer. - Adds unit tests `configuration_settings_keep_what_the_title_sets` and `statistics_write_only_the_substructure` plus the 40-byte layout assertion. **Tested** - Hardware/OS: NVIDIA RTX 5080 (driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC debug, DXC Windows SDK `10.0.26100.0`, `d3d12SDKLayers.dll` installed - Commit tested: `3c0958146b51432ef95de52f9ad1f40cc77c20f9` - `cargo build --workspace`: clean (only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **715 passed, 0 failed, 41 ignored** (new tests `configuration_settings_keep_what_the_title_sets` and `statistics_write_only_the_substructure` passed) - `SKIPPED` GPU tests: `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/843 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: 743723717ea05fabe5ebbb6653afe828dead202f gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1625 (PresentX 1625) presents per 2 s (last 3): 60 60 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** - No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known. **AI use** - Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5). - 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.
XNetworking is XCL's own class, so the three functions it did not have
(XNetworkingQueryConfigurationSetting, XNetworkingSetConfigurationSetting
and XNetworkingQueryStatistics, slots 18 to 20 of interface bf2346b2)
answered E_NOTIMPL even where the system runtime has them.

Per the public GDK reference: the three XNetworkingConfigurationSetting
values (title, system and tools TCP queued receive buffer limits) start
at the console defaults (32 MiB, 4 MiB, UINT64_MAX), keep any u64 the
title sets and refuse an unknown setting with E_INVALIDARG. The limit is
kept and reported, not enforced: the sockets are the host's.
XNetworkingQueryStatistics writes only the 40-byte
XNetworkingTcpQueuedReceivedBufferUsageStatistics for the three
statistics types, all zero (nothing is queued per partition on the host),
and leaves the rest of the caller's union alone.

Also exported by name with the other XNetworking functions.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:34: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 3c09581 (on its base beaa245).

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: 715 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: configuration_settings_keep_what_the_title_sets, statistics_write_only_the_substructure.

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/843#issuecomment-7124622785) Full-suite run, since this PR has no test report yet. Tested exact head `3c09581` (on its base `beaa245`). **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`: **715 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: `configuration_settings_keep_what_the_title_sets`, `statistics_write_only_the_substructure`. **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 08:09 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head 3c09581 onto main 1ec4c98, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 706 passed, 11 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes (new flake, see #718 addendum). XNetworking settings/statistics tests green.

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. My 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 08:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/843#issuecomment-7125795746) Linux / AMD RDNA3 datapoint. **Merged state:** head `3c09581` onto main `1ec4c98`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **706 passed, 11 failed, 41 ignored**. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` (new flake, see #718 addendum). XNetworking settings/statistics tests green. **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`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

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

Regression run of 74372371 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: 743723717ea05fabe5ebbb6653afe828dead202f
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1625 (PresentX 1625)
presents per 2 s (last 3): 60 60 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:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/843#issuecomment-7151542354) Regression run of `74372371` 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: 743723717ea05fabe5ebbb6653afe828dead202f gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1625 (PresentX 1625) presents per 2 s (last 3): 60 60 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

@⁠JJAutoCompare on GitHub · 2026-11-25 05:57 UTC · original

Empirical test report (74372371)

Tested PR #843 at 743723717ea05fabe5ebbb6653afe828dead202f from a clean checkout.

Hardware / environment

  • Windows x64 build 26200 on AMD64 (AuthenticAMD, family 23, model 113, stepping 0).
  • rustc 1.100.0 (0ef1bc386 2026-11-09), host x86_64-pc-windows-msvc. DXC 1.9.2609.5 (01b62ad47). Cargo test profile was unoptimized with debug info and incremental compilation disabled.
  • The focused run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Both commands ran directly, with zero Arc GPU mutex hold.

Commands and results

  • cargo test --workspace --no-run exited 0 and produced 16 test executables.
  • cargo test -p xcl --lib -- --nocapture --exact hle::xgameruntime::networking::tests::struct_layouts_match_gdk_abi hle::xgameruntime::networking::tests::configuration_settings_keep_what_the_title_sets hle::xgameruntime::networking::tests::statistics_write_only_the_substructure exited 0. The log recorded 3 passed, 0 failed, 0 ignored, 0 skipped and 692 filtered out. The selected tests call CPU code and do not initialize D3D12 or a GPU adapter.

Observed behavior

  • The configuration test verified the system default of 4 MiB and tools default of u64::MAX. It round-tripped title values of 0, 1 MiB, u64::MAX, and 32 MiB, and checked E_INVALIDARG for unknown query and set selectors and a null query output.
  • The ABI test verified the statistics structure is 40 bytes. For all three supported statistics selectors, the statistics test verified that the first 40 bytes became zero and the next eight bytes retained their sentinel values. It also checked E_INVALIDARG for an unknown selector and a null output.

Not tested

The full GPU workspace suite and the game smoke runs on main and PR head were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr843-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/843#issuecomment-7154296997) ### Empirical test report (74372371) Tested PR #843 at `743723717ea05fabe5ebbb6653afe828dead202f` from a clean checkout. **Hardware / environment** - Windows x64 build 26200 on AMD64 (AuthenticAMD, family 23, model 113, stepping 0). - `rustc 1.100.0 (0ef1bc386 2026-11-09)`, host `x86_64-pc-windows-msvc`. DXC `1.9.2609.5 (01b62ad47)`. Cargo test profile was unoptimized with debug info and incremental compilation disabled. - The focused run used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. Both commands ran directly, with zero Arc GPU mutex hold. **Commands and results** - `cargo test --workspace --no-run` exited 0 and produced 16 test executables. - `cargo test -p xcl --lib -- --nocapture --exact hle::xgameruntime::networking::tests::struct_layouts_match_gdk_abi hle::xgameruntime::networking::tests::configuration_settings_keep_what_the_title_sets hle::xgameruntime::networking::tests::statistics_write_only_the_substructure` exited 0. The log recorded **3 passed, 0 failed, 0 ignored, 0 skipped** and 692 filtered out. The selected tests call CPU code and do not initialize D3D12 or a GPU adapter. **Observed behavior** - The configuration test verified the system default of 4 MiB and tools default of `u64::MAX`. It round-tripped title values of 0, 1 MiB, `u64::MAX`, and 32 MiB, and checked `E_INVALIDARG` for unknown query and set selectors and a null query output. - The ABI test verified the statistics structure is 40 bytes. For all three supported statistics selectors, the statistics test verified that the first 40 bytes became zero and the next eight bytes retained their sentinel values. It also checked `E_INVALIDARG` for an unknown selector and a null output. **Not tested** The full GPU workspace suite and the game smoke runs on main and PR head were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr843-focused.log` and published.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:27 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:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/843#issuecomment-7159728367) 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/843/head:github-bot/gh-843'
git switch 'github-bot/gh-843'

Merge

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