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

Merged
amazedturnip merged 1 commit from upstream-pr/1497 into main 2026-11-25 19:24:27 +00:00
amazedturnip commented 2026-11-24 16:57:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-24T16:57:43Z.


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).
<!-- greyfinch-sync:ivall/xcl:issue:6587053853 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1497). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-24T16:57:43Z. --- 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).
DavidM1911 commented 2026-11-24 19:07:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:53:36Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7141299477 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1497#issuecomment-7141299477). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:53:36Z. --- 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!
upstream-sync closed this pull request 2026-11-25 20:07:01 +00:00
ivall commented 2026-11-25 20:08:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-25T19:24:29Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7172252063 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1497#issuecomment-7172252063). Originally posted by [ivall](https://github.com/ivall) on 2026-11-25T19:24:29Z. --- 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.
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!1487
No description provided.