Skip to content

ILGPU v2.0: New Test Environment#1580

Open
m4rs-mt wants to merge 172 commits into
masterfrom
new_tests
Open

ILGPU v2.0: New Test Environment#1580
m4rs-mt wants to merge 172 commits into
masterfrom
new_tests

Conversation

@m4rs-mt
Copy link
Copy Markdown
Owner

@m4rs-mt m4rs-mt commented Apr 20, 2026

Adds the complete test suite that exercises every stage of the new AOT compiler pipeline: from IR emission and backend codegen through to actually launching kernels on CPU/GPU. Replaces the retired legacy ILGPU.Tests, ILGPU.Tests.CPU, ILGPU.Tests.Cuda, and ILGPU.Algorithms.Tests projects with a single, layered suite aimed at the new compiler.

Also registers the Snapshots submodule that backs the IR snapshot tests, and ships a regeneration helper for updating those golden files. See ILGPU-Snapshots for more information.

The first commit is a PR placeholder for the runtime-library, AOT-compiler, compiler-bindings, and AI-readiness PRs; once those changes land on master they collapse into real merge commits.

A note on authorship - AI warning

Much of the test-infrastructure work in this PR was done with AI-assistant pair programming (Claude via Claude Code). Commits that genuinely reflect this shared authorship — the test framework itself, the Snapshots submodule registration, and the snapshot-regeneration helper script - carry a Co-Authored-By: Claude trailer so the credit is explicit.

What's in this PR

Test suite structure (Src/ILGPUC.Tests/, 309 files)

  • Framework (18 files) — TestBase, MsBuildRunner for subprocess builds, IntegrationProjectFixture to materialize fixture projects on disk, CompilerManagerFactory with per-backend env-var routing, KernelRegistry/KernelDiscovery, Availability / backend-probe gating, ExecutionTestBase, and a subprocess output harness.
  • Kernels (35 files) — representative kernels used as compilation fixtures across the suite (basic arithmetic, compare, convert, control flow, loops, lambdas, calls, arrays/views, memory buffers, shared memory, atomics, bitwise, warp/group/grid, reduce/scan/radix-sort, structures, enums, value tuples, interop).
  • IR snapshot tests (34 files) — compare emitted IR against golden .il fixtures provided by the Snapshots submodule. Covers every kernel family plus the pipeline-stage comparison harness.
  • Backend coverage tests (5 files) — cross-backend codegen coverage across CPU/CUDA/Metal/OpenCL/ROCm.
  • Non-kernel tests (6 files) — compiler-utility, IR transformation, and type-system tests.
  • Execution tests (38 files) — invoke each backend's native toolchain, load the resulting kernel binary, and verify the runtime output matches expectations.
  • Test programs (157 files) — the actual kernel samples used by IR and execution tests, organized by feature (if, loop, switch, jump, phi, call, lambda, binary/unary int op, compare int/float, convert int/float, reinterpret-cast, enum, structure, value tuple, fixed buffers, array/view, local array, memory buffer, shared memory, atomics, warp, group, grid, and the runtime variants of reduce/scan/radix-sort).
  • Integration tests (2 files) — MSBuild happy-path, multi-kernel, backend override, compile-error, incremental, and clean scenarios; NuGet pack/restore smoke test.
  • Integration-project templates (11 files) — the tiny .csproj fixtures the integration tests consume.
  • tests.md — describes the suite structure for contributors.

Snapshots submodule

Src/ILGPUC.Tests/Snapshots/ is registered as a submodule (.gitmodules added) providing the golden .il fixtures for the IR snapshot tests. Keeping them in a separate repo avoids bloating history with regeneration noise.

Snapshot-regeneration helper

Src/scripts/update-snapshots.sh — runs the IR test suite with ILGPU_UPDATE_IR=1, stages the resulting .il changes inside the submodule, and commits them.

Solution update

Src/ILGPU.sln registers the new ILGPUC.Tests project as the final commit.

CI coupling

The canonical .github/workflows/ci.yml was redesigned in the previous PR (new_ai_readiness) to include a build + tests + GPU Docker-run pipeline. This PR's final state matches that workflow expectation, so no workflow changes are needed here.

Scope boundary

No Docker, no CI workflow changes, no samples, no compiler-source changes.

Depends on

PR #1578.

Fixes

Closes #1249

Testing

Test runs

  • dotnet build Src/ILGPU.sln - builds cleanly on the tip of this PR.
  • dotnet test Src/ILGPUC.Tests/ILGPUC.Tests.csproj --blame-hang-timeout 360s

m4rs-mt and others added 30 commits February 1, 2026 19:13
…elper.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…sts.

Co-Authored-By: Claude <noreply@anthropic.com>
…r (part 1/2).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…rt 1/2).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…(part 1/3).

Co-Authored-By: Claude <noreply@anthropic.com>
…(part 2/3).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…part 1/2).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…alue-tuple kernel samples (part 1/4).

Co-Authored-By: Claude <noreply@anthropic.com>
m4rs-mt and others added 17 commits March 24, 2026 20:27
Co-Authored-By: Claude <noreply@anthropic.com>
…enerated artifacts.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…/2).

Co-Authored-By: Claude <noreply@anthropic.com>
…/2).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… transformed at build time.

Co-Authored-By: Claude <noreply@anthropic.com>
…ation.

Co-Authored-By: Claude <noreply@anthropic.com>
…t is available on this branch.

Co-Authored-By: Claude <noreply@anthropic.com>
@m4rs-mt m4rs-mt added this to the v2.0 milestone Apr 20, 2026
@m4rs-mt m4rs-mt marked this pull request as draft April 20, 2026 06:41
@m4rs-mt m4rs-mt marked this pull request as ready for review April 23, 2026 18:25
@m4rs-mt m4rs-mt marked this pull request as draft April 23, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant