Tests: verify D3D12.X guard, split, and tracer thunks for game callers #1497

Manually merged
github merged 1 commit from gh-pr/1497/head into gh-pr/1497/base 2026-11-26 04:55:40 +00:00
Owner

@⁠amazedturnip on GitHub · 2026-11-24 16:57 UTC · original
amazedturnip:xcl/tests-d3d12x-guard-thunks-and-game-caller-routin-164822 → main · +361 −0 · 1 files · 1 commits · merged 2026-11-25 19:24 UTC

Add integration contract tests for the raw x64 thunks emitted by crates/xcl/src/hle/d3d12x/guard.rs (make_guard, make_split, make_layout_split, make_tracer, and make_call_tracer). Existing inline unit tests only invoke these thunks from non-game runtime callers; this suite maps an executable x64 call trampoline as a MappedModule to verify game-image suppression, stub recording, dynamic layout routing, return-address preservation across nested thunks, and 12-argument integer/floating-point forwarding.

What is in it

  • crates/xcl/tests/d3d12x_guard_contract.rs: add contract tests using a mapped executable x64 call trampoline to exercise game-image and non-game caller paths for make_guard, make_split, make_layout_split, make_tracer, and make_call_tracer (including register, XMM0..3, and 8 stack arguments, dynamic layout toggling, return-address preservation across nested splits/guards, and full 64-bit integer and floating-point return preservation).

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=1 — 775 passed, 0 failed, 41 ignored (SKIPPED GPU tests: none)
  • Verification / negative control: new test suite — verified 3x deterministic

Not tested

  • retail Xbox Series X|S title (not available on this host)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 16:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1497) `amazedturnip:xcl/tests-d3d12x-guard-thunks-and-game-caller-routin-164822` → `main` · +361 −0 · 1 files · 1 commits · merged 2026-11-25 19:24 UTC Add integration contract tests for the raw x64 thunks emitted by `crates/xcl/src/hle/d3d12x/guard.rs` (`make_guard`, `make_split`, `make_layout_split`, `make_tracer`, and `make_call_tracer`). Existing inline unit tests only invoke these thunks from non-game runtime callers; this suite maps an executable x64 call trampoline as a `MappedModule` to verify game-image suppression, stub recording, dynamic layout routing, return-address preservation across nested thunks, and 12-argument integer/floating-point forwarding. **What is in it** - `crates/xcl/tests/d3d12x_guard_contract.rs`: add contract tests using a mapped executable x64 call trampoline to exercise game-image and non-game caller paths for `make_guard`, `make_split`, `make_layout_split`, `make_tracer`, and `make_call_tracer` (including register, XMM0..3, and 8 stack arguments, dynamic layout toggling, return-address preservation across nested splits/guards, and full 64-bit integer and floating-point return preservation). **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=1` — 775 passed, 0 failed, 41 ignored (SKIPPED GPU tests: none) - Verification / negative control: new test suite — verified 3x deterministic **Not tested** - retail Xbox Series X|S title (not available on this host) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
Add integration contract tests for the raw x64 thunks emitted by
crates/xcl/src/hle/d3d12x/guard.rs (make_guard, make_split,
make_layout_split, make_tracer, make_call_tracer) using a mapped
executable call trampoline so game-image caller paths are exercised
alongside non-game runtime callers.

Verified 3x via cargo test -p xcl --test d3d12x_guard_contract -- --test-threads=2 (5 passed, 0 failed, 0 ignored).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:55:38 +00:00
github manually merged commit 6e4ece42a8 into gh-pr/1497/base 2026-11-26 04:55:40 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 18:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1497#issuecomment-7141299477) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:24 UTC · original

Merging: guard, split and tracer thunks for title and runtime callers.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, main 2898511 with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (fuzz_validate_and_gpu_1 and _3, which fail the same way on main); hle::d3d12x on 16 threads 5 times, no failure. This file alone 8 times: no failure.

AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 19:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1497#issuecomment-7172252063) Merging: guard, split and tracer thunks for title and runtime callers. Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, `main` `2898511` with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (`fuzz_validate_and_gpu_1` and `_3`, which fail the same way on `main`); `hle::d3d12x` on 16 threads 5 times, no failure. This file alone 8 times: no failure. AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.
This discussion has been locked. Commenting is limited to contributors.
No description provided.