Tests: shape of the generated D3D12 and GDK call tables #830

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

@⁠mastrr9 on GitHub · 2026-11-24 06:23 UTC · original
mastrr9:tests/generated-tables → main · +134 −0 · 1 files · 1 commits · open

Adds a test-only suite (crates/xcl/tests/generated_tables.rs) verifying structural COM invariants on the generated hle/d3d12_layout.rs and hle/xgameruntime/gdk_table.rs tables so regeneration cannot silently shift a live COM vtable slot:

  • Unique interface names and well-formed lower-case registry-format IIDs
  • Every vtable starts with IUnknown (QueryInterface, AddRef, Release), extends its parent's vtable prefix in order, and has no parent cycles
  • Unique method names within each vtable (matching slot() first-match semantics)
  • Numbered interface versions derive from the immediately preceding version and add methods
  • 21 hot-path D3D12 vtable slots (Draw*, Dispatch, Copy*Region, SetPipelineState, ResourceBarrier, SetDescriptorHeaps, ExecuteIndirect, DispatchRays, DispatchMesh, queue Signal/Wait, fence, resource Map/Unmap/GetGPUVirtualAddress) match d3d12.h
  • gdk_table::API: unique X* function names, non-zero class/interface GUIDs, all slots >= 3, and no two functions colliding on one (class, iface, slot)

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: c64508fcbab9f6b79f66ffa9cd0e8580f3e295ea
  • cargo build --workspace: clean (only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 719 passed, 0 failed, 41 ignored (generated_tables: 6 passed, 0 failed)
  • 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

Not tested

  • Test-only diff (crates/xcl/tests/generated_tables.rs); no runtime code changed and no retail title run performed.

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).
**@⁠mastrr9** on GitHub · 2026-11-24 06:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/830) `mastrr9:tests/generated-tables` → `main` · +134 −0 · 1 files · 1 commits · open Adds a test-only suite (`crates/xcl/tests/generated_tables.rs`) verifying structural COM invariants on the generated `hle/d3d12_layout.rs` and `hle/xgameruntime/gdk_table.rs` tables so regeneration cannot silently shift a live COM vtable slot: - Unique interface names and well-formed lower-case registry-format IIDs - Every vtable starts with `IUnknown` (`QueryInterface`, `AddRef`, `Release`), extends its parent's vtable prefix in order, and has no parent cycles - Unique method names within each vtable (matching `slot()` first-match semantics) - Numbered interface versions derive from the immediately preceding version and add methods - 21 hot-path D3D12 vtable slots (`Draw*`, `Dispatch`, `Copy*Region`, `SetPipelineState`, `ResourceBarrier`, `SetDescriptorHeaps`, `ExecuteIndirect`, `DispatchRays`, `DispatchMesh`, queue `Signal`/`Wait`, fence, resource `Map`/`Unmap`/`GetGPUVirtualAddress`) match `d3d12.h` - `gdk_table::API`: unique `X*` function names, non-zero class/interface GUIDs, all slots `>= 3`, and no two functions colliding on one `(class, iface, slot)` **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: `c64508fcbab9f6b79f66ffa9cd0e8580f3e295ea` - `cargo build --workspace`: clean (only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **719 passed, 0 failed, 41 ignored** (`generated_tables`: 6 passed, 0 failed) - `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` **Not tested** - Test-only diff (`crates/xcl/tests/generated_tables.rs`); no runtime code changed and no retail title run performed. **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).
d3d12_layout.rs and gdk_table.rs are regenerated from d3d12.h and
xgameruntime.lib, and a wrong slot calls the wrong method of a live COM
object. Check what COM guarantees: unique names and IIDs, every vtable
starting with IUnknown and repeating its parent's, unique method names
per vtable, numbered versions deriving from the previous one, the
hot-path slots as d3d12.h numbers them, and one GDK row per function on
its own slot past IUnknown.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:58 +00:00
Author
Owner

@⁠ettehn on GitHub · 2026-11-24 06:34 UTC · original

I checked d3d12_layout.rs at c64508f against d3d12.h from Windows SDK 10.0.26100.0. MSVC x64 compiled assertions for every method offset and the total vtable size of each interface present in both tables. All 2,302 method slots across 80 interfaces matched, and all 80 vtable sizes matched.

The SDK header has no definition for the remaining 22 XCL interfaces, so this check leaves those unverified. Coverage was limited to D3D12 interface layout.

OpenAI Codex (GPT-6) assisted with this verification.

**@⁠ettehn** on GitHub · 2026-11-24 06:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7124081369) I checked `d3d12_layout.rs` at `c64508f` against `d3d12.h` from Windows SDK `10.0.26100.0`. MSVC x64 compiled assertions for every method offset and the total vtable size of each interface present in both tables. All 2,302 method slots across 80 interfaces matched, and all 80 vtable sizes matched. The SDK header has no definition for the remaining 22 XCL interfaces, so this check leaves those unverified. Coverage was limited to D3D12 interface layout. OpenAI Codex (GPT-6) assisted with this verification.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 06:39 UTC · original

Verified on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100 stable (MSVC 14.44.35207), main at beaa245 + this PR's test file dropped in unchanged:

cargo build --workspace          # exit 0, before this
cargo test -p xcl --test generated_tables
test result: ok. 6 passed; 0 failed; 0 ignored

Nothing else of the tree was touched, and the suite passes natively on Windows (no Wine, no prefix). AI-assisted (opencode): copied the file, built and ran the target.

**@⁠dcastell1** on GitHub · 2026-11-24 06:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7124165618) Verified on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100 stable (MSVC 14.44.35207), `main` at `beaa245` + this PR's test file dropped in unchanged: ``` cargo build --workspace # exit 0, before this cargo test -p xcl --test generated_tables test result: ok. 6 passed; 0 failed; 0 ignored ``` Nothing else of the tree was touched, and the suite passes natively on Windows (no Wine, no prefix). AI-assisted (opencode): copied the file, built and ran the target.
Author
Owner

@⁠milas6669 on GitHub · 2026-11-24 07:02 UTC · original

Test report on c64508f (PR head; its base is main beaa245, which is still main; no merge conflict).

Tested

  • NVIDIA GeForce RTX 3070 (32-lane waves), Intel i9-10900KF, Windows 11 Pro 10.0.26200, rustc 1.100.0 x86_64-pc-windows-msvc, debug

  • cargo test --workspace --no-fail-fast -- --test-threads=4; the same command on main beaa245 (this PR's base): 713 passed, 0 failed, 41 ignored

  • on this head: 719 passed, 0 failed, 41 ignored (+6 over main: the six new tests in generated_tables.rs, e.g. every_vtable_extends_its_parents, hot_path_slots_match_d3d12_h)

  • SKIPPED (no wave64) on this GPU: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware

Not tested

  • that the tests fail on a broken table (I did not break one), AMD / wave64 hardware, scripts/smoke.ps1 (test-only diff)

AI use

  • Claude Code, Claude Sonnet 5.5, ran the commands and wrote this report. I did not review the diff beyond reading it.
**@⁠milas6669** on GitHub · 2026-11-24 07:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7124551150) Test report on `c64508f` (PR head; its base is `main` beaa245, which is still `main`; no merge conflict). **Tested** - NVIDIA GeForce RTX 3070 (32-lane waves), Intel i9-10900KF, Windows 11 Pro 10.0.26200, rustc 1.100.0 `x86_64-pc-windows-msvc`, debug - `cargo test --workspace --no-fail-fast -- --test-threads=4`; the same command on `main` beaa245 (this PR's base): **713 passed, 0 failed, 41 ignored** - on this head: **719 passed, 0 failed, 41 ignored (+6 over main: the six new tests in `generated_tables.rs`, e.g. `every_vtable_extends_its_parents`, `hot_path_slots_match_d3d12_h`)** - SKIPPED (no wave64) on this GPU: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` **Not tested** - that the tests fail on a broken table (I did not break one), AMD / wave64 hardware, `scripts/smoke.ps1` (test-only diff) **AI use** - Claude Code, Claude Sonnet 5.5, ran the commands and wrote this report. I did not review the diff beyond reading it.
Author
Owner

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

Linux / AMD RDNA3 datapoint.

Merged state: head c64508f onto main beaa245, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 709 passed, 10 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. Call-table shape tests ok, including the D3D12/GDK table sweeps and the console-library layout comparisons (resource_tiling_matches_the_console_library, subresource_copies_match_the_console_library, volume_layouts_and_texels_match_the_console_library, render_target_and_depth_layouts_match).

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/830#issuecomment-7124832897) Linux / AMD RDNA3 datapoint. **Merged state:** head `c64508f` onto main `beaa245`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **709 passed, 10 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. Call-table shape tests ok, including the D3D12/GDK table sweeps and the console-library layout comparisons (`resource_tiling_matches_the_console_library`, `subresource_copies_match_the_console_library`, `volume_layouts_and_texels_match_the_console_library`, `render_target_and_depth_layouts_match`). **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

@⁠ettehn on GitHub · 2026-11-24 12:48 UTC · original

Follow-up on b27bd53 on native Windows x64 (Rust 1.97.1 MSVC). The six generated_tables.rs tests passed in a standalone harness using the PR’s test source and its unmodified table files. Two deliberately broken copies then failed as expected:

  • Swapping the D3D12 command-list Close and Reset slots tripped hot_path_slots_match_d3d12_h (slot 10 instead of 9 for Close).
  • Moving GDK XUserDuplicateHandle from slot 3 to slot 2 tripped gdk_rows_are_unique_and_past_iunknown.

These are targeted table tests. OpenAI Codex (GPT-6.2 Sol) assisted with verification.

**@⁠ettehn** on GitHub · 2026-11-24 12:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7131945428) Follow-up on `b27bd53` on native Windows x64 (Rust 1.97.1 MSVC). The six `generated_tables.rs` tests passed in a standalone harness using the PR’s test source and its unmodified table files. Two deliberately broken copies then failed as expected: - Swapping the D3D12 command-list `Close` and `Reset` slots tripped `hot_path_slots_match_d3d12_h` (slot 10 instead of 9 for `Close`). - Moving GDK `XUserDuplicateHandle` from slot 3 to slot 2 tripped `gdk_rows_are_unique_and_past_iunknown`. These are targeted table tests. OpenAI Codex (GPT-6.2 Sol) assisted with verification.
Author
Owner

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

Merge

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