Tests: pin GDK thunk table invariants #1561
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1571"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-24T17:47:21Z.
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
Tested
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))Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T18:52:05Z.
Full-suite run, since this PR has no test report yet. Tested exact head
071cf25(on its base9e3831e).Tested
cargo build --workspace, thenXCL_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.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.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_formwas skipped with--skip. It fails on main9e3831etoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWSunset). Reported as #1651.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:41:31Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:20:10Z.
Empirical test report (
071cf257)Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09). DXC:dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47).071cf257f80b9892daeee5b8c7c689652081d8b0in a clean detached checkout. Cargo used its unoptimized test profile with incremental compilation and debug info disabled.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables, includinggdk_table.cargo test -p xcl --test gdk_table -- --nocaptureexited 0 with 7 passed, 0 failed, 0 ignored, 0 skipped and 0 filtered out. The run usedXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both commands ran outsideInvoke-ArcTest.ps1without 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.logand published.Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T12:12:15Z.
Independent desktop NVIDIA verification of PR #1571 at head
071cf257f80b9892daeee5b8c7c689652081d8b0(1commit; exact parent & merge-base:9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted tests & build (
071cf257)cargo test --release -p xcl --test gdk_table -- --nocapture(3 consecutive runs)7 passed; 0 failed; 0 ignored; 0 filtered out× 3 (0.00s,0.00s,0.00s,0skipped;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)cargo build --release -p xcl1m 01s--testcompile +0.08sincremental--releasebuild, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)(Note:
scripts/smoke.ps1at9e3831e1predates9683e7a6and printed the local folder basename ontitle:; replaced below with the standard9683e7a6title hash29640639, with all measured fields verbatim.)Exact parent & merge-base (
9e3831e1f570d3646e53ab753b19ec07eb8f1485, cached baseline on the same machine):PR #1571 (
071cf257f80b9892daeee5b8c7c689652081d8b0):Limits of coverage
crates/xcl/tests/gdk_table.rs,0production-code changes); all7/7GDK thunk-table invariant tests passed3/3(0skipped).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T07:50:31Z.
merge-check claim
head:
071cf257f8Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T07:56:03Z.
merge-check
base:
d52ff48caahead:
071cf257f8merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2882 passed, 2 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base".
gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16fails on based52ff48cby itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:53:44Z.
merge-check claim
head:
071cf257f8Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:01:25Z.
merge-check
base:
9dfbe3ea66head:
071cf257f8merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2892 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. The new test binary
tests/gdk_table.rsran 7 tests, all passed.review: no blocking finding; one new file, read in full; test-only, no GPU, no file or process access. It pins the generated GDK thunk table: sorted by (class, interface, slot), unique non-empty names, no duplicate triples, non-zero ids, slot range, and the counts (396 rows, 24 classes, 34 interfaces, highest slot 83). By design the four constants must be updated whenever the generator adds a row, so a legitimate regeneration fails this test until they are; the messages name the expected values.
performance: none; tests only.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:09:18Z.
Triage (#1607) – head
071cf25#830 (opened earlier) also tests gdk_table::API in crates/xcl/tests/generated_tables.rs: unique names, no two functions on one (class, interface, slot), non-zero ids. This PR repeats those three checks and adds the sort order, the 32-hex source format and exact counts.
The exact pins (396 rows, 24 classes, 34 interfaces, max slot 83) make every legitimate regeneration of gdk_table.rs with scripts/gen_gdk_table.py fail until the constants are edited by hand; lower bounds would catch the same bad regenerations.
Consider dropping the checks #830 already has, or coordinating with #830.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.