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

Open
mastrr9 wants to merge 1 commit from upstream-pr/830 into main
mastrr9 commented 2026-11-24 06:23:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T06:23:11Z.


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).
<!-- greyfinch-sync:ivall/xcl:issue:5467225444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/830). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T06:23:11Z. --- 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).
ettehn commented 2026-11-24 07:06:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T06:34:58Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124081369 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/830#issuecomment-7124081369). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-24T06:34:58Z. --- 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.
dcastell1 commented 2026-11-24 07:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T06:39:55Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124165618 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/830#issuecomment-7124165618). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T06:39:55Z. --- 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.
milas6669 commented 2026-11-24 07:06:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by milas6669 on 2026-11-24T07:02:30Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7124551150 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/830#issuecomment-7124551150). Originally posted by [milas6669](https://github.com/milas6669) on 2026-11-24T07:02:30Z. --- 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.
SlopTart commented 2026-11-24 08:03:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T07:17:45Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124832897 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/830#issuecomment-7124832897). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T07:17:45Z. --- 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.
ettehn commented 2026-11-24 13:03:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T12:48:29Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7131945428 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/830#issuecomment-7131945428). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-24T12:48:29Z. --- 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.
DavidM1911 commented 2026-11-25 11:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:38:34Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7159974815 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7159974815). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:38:34Z. --- 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!
github-actions[bot] commented 2026-11-29 20:41:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:00Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262274831 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7262274831). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:41:00Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:15:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:15:07Z.


Triage (#1607) – head b27bd53

No open PR tests d3d12_layout::IFACES. #1571 (open) adds invariants for gdk_table::API that partly overlap gdk_rows_are_unique_and_past_iunknown (unique names, unique (class, interface, slot), nonzero ids); the rest of this PR is the D3D12 vtable table.
I checked every assertion against the tables on main (102 interfaces, 396 GDK rows) with a script: all hold, and the hot-path slots match d3d12.h. The failing CI job fails in an unrelated existing lib test, before this binary runs.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300536160 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/830#issuecomment-7300536160). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:15:07Z. --- **Triage (#1607)** – head b27bd53 No open PR tests `d3d12_layout::IFACES`. #1571 (open) adds invariants for `gdk_table::API` that partly overlap `gdk_rows_are_unique_and_past_iunknown` (unique names, unique (class, interface, slot), nonzero ids); the rest of this PR is the D3D12 vtable table. I checked every assertion against the tables on main (102 interfaces, 396 GDK rows) with a script: all hold, and the hot-path slots match d3d12.h. The failing CI job fails in an unrelated existing lib test, before this binary runs. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/830:upstream-pr/830'
git switch 'upstream-pr/830'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/830'
git switch 'upstream-pr/830'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/830'
git switch 'upstream-pr/830'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/830'
git switch 'main'
git merge --squash 'upstream-pr/830'
git switch 'main'
git merge --ff-only 'upstream-pr/830'
git switch 'main'
git merge 'upstream-pr/830'
git push origin 'main'
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!824
No description provided.