Skip to content

test(dispatch): check the dispatch surface declaration with cmake fixtures - #491

Open
ahuber21 wants to merge 1 commit into
mainfrom
dev/isa-dispatching-cmake
Open

ahuber21 wants to merge 1 commit into
mainfrom
dev/isa-dispatching-cmake

Conversation

@ahuber21

@ahuber21 ahuber21 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #395. Adds configure-time tests for the dispatch surface declaration, split out of #372.

It adds a bunch of cmake files that define valid- and invalid- tests. valid = no failure expected, should compile. invalid = cmake configure failure expected. A shell script pulls the files in one by one and reports if all produced the expected result. A CI job was added that executes this script.

…tures

Bring in the configure-time fixtures, checker script, pre-commit hook and
workflow from PR 372, adapted to main's validator. Main has no VNNI level and
no mandatory-level rule, so that fixture is dropped and the VNNI lines are
replaced with legal levels. The multi-arch probe tests stay for a later PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ahuber21
ahuber21 marked this pull request as ready for review November 26, 2026 13:48
@ahuber21
ahuber21 requested a balanced review from Copilot November 26, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The override job lacks assertions that would catch the runtime dimension table disagreeing with the reduced surface, rejecting 32/384 while accepting removed extents such as 160.

1 open issue
What changed in this PR

Adds dispatch-surface validation tests following #395, bringing fixture-based checks from #372 into the CMake test setup.

Changes:

  • Adds valid declarations and invalid fixtures with expected diagnostics.
  • Adds a shell runner and pre-commit hook for declaration validation.
  • Adds CI checks for default configuration and reduced-surface builds and tests.
File Description
tests/​cmake/​dispatch-surface/​valid-reduced.cmake Defines a surface with non-default dimensions.
tests/​cmake/​dispatch-surface/​valid-minimal.cmake Defines a single-fixed-dimension surface.
tests/​cmake/​dispatch-surface/​invalid-zero-extent.cmake Checks rejection of zero dimensions.
tests/​cmake/​dispatch-surface/​invalid-unknown-level.cmake Checks rejection of unknown ISA levels.
tests/​cmake/​dispatch-surface/​invalid-non-numeric-extent.cmake Checks rejection of nonnumeric dimensions.
tests/​cmake/​dispatch-surface/​invalid-no-levels.cmake Checks rejection of an empty ISA list.
tests/​cmake/​dispatch-surface/​invalid-no-extents.cmake Checks rejection of an empty dimension list.
tests/​cmake/​dispatch-surface/​invalid-missing-extents.cmake Checks rejection of an unset dimension list.
tests/​cmake/​dispatch-surface/​invalid-level-without-tu.cmake Checks rejection of missing kernel translation units.
tests/​cmake/​dispatch-surface/​invalid-level-none.cmake Checks rejection of the NONE sentinel.
tests/​cmake/​dispatch-surface/​invalid-level-missing-field.cmake Checks rejection of incomplete ISA entries.
tests/​cmake/​dispatch-surface/​invalid-level-empty-field.cmake Checks rejection of empty architecture fields.
tests/​cmake/​dispatch-surface/​invalid-dynamic-listed.cmake Checks rejection of explicitly listed Dynamic dimensions.
tests/​cmake/​dispatch-surface/​invalid-duplicate-level.cmake Checks rejection of duplicate ISA levels.
tests/​cmake/​dispatch-surface/​invalid-duplicate-infix.cmake Checks rejection of duplicate translation-unit infixes.
tests/​cmake/​dispatch-surface/​invalid-duplicate-extent.cmake Checks rejection of duplicate dimensions.
tests/​cmake/​dispatch-surface/​invalid-duplicate-arch.cmake Checks rejection of shared architecture targets.
.pre-commit-config.yaml Runs validation on relevant file changes.
.github/​workflows/​dispatch-surface.yml Adds declaration and reduced-surface CI jobs.
.github/​scripts/​check_dispatch_surface.sh Checks fixture outcomes and expected diagnostics.

Review effort: Balanced

-DCMAKE_BUILD_TYPE=Release \
-DSVS_BUILD_TESTS=YES \
-DSVS_BUILD_BINARIES=NO \
-DSVS_DISPATCH_SURFACE_FILE="${GITHUB_WORKSPACE}/tests/cmake/dispatch-surface/valid-reduced.cmake"

This branch has not been deployed

No deployments
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.

2 participants