Tests: pin GDK thunk table invariants #1571

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

@⁠amazedturnip on GitHub · 2026-11-24 17:47 UTC · original
amazedturnip:xcl/tests-gdk-table-invariants-173547 → main · +98 −0 · 1 files · 1 commits · open

crates/xcl/src/hle/xgameruntime/gdk_table.rs is the generated source of truth for every XGameRuntime QueryApiImpl thunk (396 rows / 24 classes / 34 interfaces, sorted by (class, interface, slot)) and had no inline or external test. This PR adds crates/xcl/tests/gdk_table.rs pinning its invariants so a bad regeneration fails loudly. Verified: 7/7 green on this machine; negative control (duplicated row) -> 4/7 tests fail. No existing tests were touched and no runtime source is modified.

What is in it

  • crates/xcl/tests/gdk_table.rs: new test suite pinning gdk_table::API invariants (sorted order, unique non-empty names, no duplicate (class, interface, slot), 396 rows / 24 classes / 34 interfaces, slot <= 83, non-zero ids, source-format 32-lowercase-hex).

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=2 — 783 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows))
  • Verification / negative control: Temporarily duplicated the first data row in crates/xcl/src/hle/xgameruntime/gdk_table.rs; cargo test --test gdk_table failed 4/7 tests (no_duplicate_class_interface_slot_triples, row_and_id_counts_are_stable, function_names_are_unique_and_non_empty, source_format_is_32_lowercase_hex_chars) with 'expected 396 rows' and 'duplicate function name XUserDuplicateHandle' style panics. Reverted with git checkout -- and re-ran 3x green.

Not tested

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

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 17:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/1571) `amazedturnip:xcl/tests-gdk-table-invariants-173547` → `main` · +98 −0 · 1 files · 1 commits · open crates/xcl/src/hle/xgameruntime/gdk_table.rs is the generated source of truth for every XGameRuntime QueryApiImpl thunk (396 rows / 24 classes / 34 interfaces, sorted by (class, interface, slot)) and had no inline or external test. This PR adds crates/xcl/tests/gdk_table.rs pinning its invariants so a bad regeneration fails loudly. Verified: 7/7 green on this machine; negative control (duplicated row) -> 4/7 tests fail. No existing tests were touched and no runtime source is modified. **What is in it** - crates/xcl/tests/gdk_table.rs: new test suite pinning gdk_table::API invariants (sorted order, unique non-empty names, no duplicate (class, interface, slot), 396 rows / 24 classes / 34 interfaces, slot <= 83, non-zero ids, source-format 32-lowercase-hex). **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=2` — 783 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows)) - Verification / negative control: Temporarily duplicated the first data row in crates/xcl/src/hle/xgameruntime/gdk_table.rs; cargo test --test gdk_table failed 4/7 tests (no_duplicate_class_interface_slot_triples, row_and_id_counts_are_stable, function_names_are_unique_and_non_empty, source_format_is_32_lowercase_hex_chars) with 'expected 396 rows' and 'duplicate function name XUserDuplicateHandle' style panics. Reverted with git checkout -- and re-ran 3x green. **Not tested** - retail Xbox Series X|S title (not available on this host) - other GPU families / adapters (only AMD Radeon native wave64 on this machine) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
Add crates/xcl/tests/gdk_table.rs. The generated table (396 rows, 24 classes, 34 interfaces, max slot 83) is the source of truth for every QueryApiImpl thunk (api.rs maps 396 rows to (class, interface, slot)) and had zero inline tests and no external test. The new suite asserts, over gdk_table::API: (a) non-decreasing (class, interface, slot) order, matching the generator's sort key; (b) unique non-empty function names; (c) no duplicate (class, interface, slot) triples; (d) 396 rows / 24 distinct classes / 34 distinct interfaces; (e) every slot <= 83 (u8); (f) every class/interface u128 non-zero; (g) every source row line holds a 32-lowercase-hex class and interface, empty names and non-hex values fail loudly. Verified: on unpatched HEAD this passes; duplicated row fails 4/7 tests; restored and re-ran 3x green.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:50 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 18:52 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head 071cf25 (on its base 9e3831e).

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, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 782 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: rows_are_sorted_by_class_interface_slot, function_names_are_unique_and_non_empty, no_duplicate_class_interface_slot_triples, row_and_id_counts_are_stable, every_slot_is_within_u8_and_the_known_range, every_class_and_interface_is_non_zero, source_format_is_32_lowercase_hex_chars.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 783 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as #1651.

Not tested

  • 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 18:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1571#issuecomment-7141263773) Full-suite run, since this PR has no test report yet. Tested exact head `071cf25` (on its base `9e3831e`). **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, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form`: **782 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: `rows_are_sorted_by_class_interface_slot`, `function_names_are_unique_and_non_empty`, `no_duplicate_class_interface_slot_triples`, `row_and_id_counts_are_stable`, `every_slot_is_within_u8_and_the_known_range`, `every_class_and_interface_is_non_zero`, `source_format_is_32_lowercase_hex_chars`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **783 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip`. It fails on main `9e3831e` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (`XCL_HEAP_WINDOWS` unset). Reported as #1651. **Not tested** - 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

@⁠DavidM1911 on GitHub · 2026-11-24 19:41 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 19:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1571#issuecomment-7142454356) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

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

Empirical test report (071cf257)

Hardware / environment

  • Windows 11 Enterprise Evaluation x64 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, unused by the CPU-only tests).
  • Rust: rustc 1.100.0 (0ef1bc386 2026-11-09). DXC: dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47).
  • Tested PR #1571 at commit 071cf257f80b9892daeee5b8c7c689652081d8b0 in a clean detached checkout. Cargo used its unoptimized test profile with incremental compilation and debug info disabled.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test executables, including gdk_table.
  • cargo test -p xcl --test gdk_table -- --nocapture exited 0 with 7 passed, 0 failed, 0 ignored, 0 skipped and 0 filtered out. The run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Both commands ran outside Invoke-ArcTest.ps1 without acquiring the Arc GPU mutex.

Observed behavior

The tests checked the generated table's 396 rows, 24 distinct classes, and 34 distinct interfaces. They confirmed sort order by class, interface, and slot, unique nonempty function names, unique class/interface/slot triples, nonzero IDs, and slots at or below 83. The source-format test checked the lowercase 32-digit hexadecimal IDs and decimal slot fields. The target reads the static table and its Rust source using CPU-only code.

Not tested

The full GPU workspace suite and game smoke runs 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 pr1571-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1571#issuecomment-7153672165) ### Empirical test report (071cf257) **Hardware / environment** - Windows 11 Enterprise Evaluation x64 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, unused by the CPU-only tests). - Rust: `rustc 1.100.0 (0ef1bc386 2026-11-09)`. DXC: `dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47)`. - Tested PR #1571 at commit `071cf257f80b9892daeee5b8c7c689652081d8b0` in a clean detached checkout. Cargo used its unoptimized test profile with incremental compilation and debug info disabled. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built the workspace test executables, including `gdk_table`. - `cargo test -p xcl --test gdk_table -- --nocapture` exited 0 with **7 passed, 0 failed, 0 ignored, 0 skipped** and 0 filtered out. The run used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. Both commands ran outside `Invoke-ArcTest.ps1` without acquiring the Arc GPU mutex. **Observed behavior** The tests checked the generated table's 396 rows, 24 distinct classes, and 34 distinct interfaces. They confirmed sort order by class, interface, and slot, unique nonempty function names, unique class/interface/slot triples, nonzero IDs, and slots at or below 83. The source-format test checked the lowercase 32-digit hexadecimal IDs and decimal slot fields. The target reads the static table and its Rust source using CPU-only code. **Not tested** The full GPU workspace suite and game smoke runs 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 `pr1571-focused.log` and published.
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/1571/head:github-bot/gh-1571'
git switch 'github-bot/gh-1571'

Merge

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