Skip to content

Set up GitHub Actions CI - #2

Merged
maleadt merged 2 commits into
mainfrom
tb/ci
Sep 26, 2026
Merged

maleadt merged 2 commits into
mainfrom
tb/ci

Conversation

@maleadt

@maleadt maleadt commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Replaces the presubmit workflow inherited from upstream. That workflow only built the project and has never run on this fork. The new one tests spirv2clc the way it is actually used.

Job What it covers Time (measured locally, 4 cores)
Linux (GCC 10) lit suite, Release build with GCC 10, the compiler Yggdrasil uses for spirv2clc_jll ~2 min build, <1 s tests
Linux (ASan+UBSan) lit suite under the sanitizers ~2.5 min build, ~9 s tests
macOS AppleClang/libc++ build (Apple's OpenCL has no IL support, so macOS always goes through spirv2clc), then the tool is run over every test input to check it doesn't crash a few min
OpenCL.jl (PoCL, OpenCL C) OpenCL.jl's poclc/ tests (its own tests plus the GPUArrays suite) on PoCL through the OpenCL C source path, with a spirv2clc_path preference pointing spirv2clc_jll at this checkout's binary, and a check that fails if the preference isn't in effect. Once JuliaGPU/OpenCL.jl#507 is merged, the versioninfo at the top of the test log also shows the override. PoCL reports OpenCL C 3.0, so this covers the --spirv-version=1.4 --cl-std=CL3.0 translation OpenCL.jl does on modern devices, with the output compiled and run by a real OpenCL implementation. ~10 min locally with warm packages; expect 20–30 min on a runner
Formatting (PRs only) git clang-format-22 on the changed lines <1 min

Notes:

  • clang 22 is required for the lit suite. subgroup_shuffle_barrier.spt fails on clang 18–21 because they don't declare sub_group_shuffle* by default; that changed in [OpenCL] Add missing OpenCL 3.0 features to OpenCLExtensions.def; revert header-only macros llvm/llvm-project#168016. LLVM 22 comes from apt.llvm.org, the same setup as llvm-downgrade. llvm-22-tools also provides lit and FileCheck.
  • No lit on macOS or arm64. clang's AArch64 backend rejects OpenCL kernels ("unsupported calling convention") and doesn't enable fp64/fp16/subgroups by default, so 58/101 tests fail for an arm64 target. The README now says the tests need clang ≥ 22 on an x86-64 host.
  • Deliberately left out: Windows (the shipped binaries are cross-built with MinGW by Yggdrasil, not MSVC), a build-type × OS matrix, and ccache (a full build takes about a minute).
  • Also included: a fix for an spv_context leak on every translation, found by the ASan job. tests/check-format.sh now takes a base revision and checks .h files.

Found while checking OpenCL C versions, not addressed here: at --cl-std=CL3.0, OpenCL C atomics are emitted as atomic_load etc. Those need optional 3.0 features (__opencl_c_atomic_order_seq_cst/_scope_device) that a minimal 3.0 device like NVIDIA's may not have.

validate_module() created an spv_context for spvValidateBinary() but
never released it, leaking it on every translation. LeakSanitizer
reports this for every test in the lit suite.
Replace the presubmit workflow inherited from upstream, which only built
the project (and never ran here), with one that tests the translator the
way it is used:

- lit suite built with GCC 10, the compiler Yggdrasil builds the
  spirv2clc_jll binaries with;
- lit suite under ASan and UBSan;
- a macOS build (AppleClang/libc++) that runs the tool over every test
  input, since the lit suite needs an x86-64 clang;
- OpenCL.jl's `poclc` tests, which run its test suite and the GPUArrays
  one on PoCL through the OpenCL C source path, with spirv2clc_jll
  overridden to use the binary built from this checkout;
- a clang-format check of the lines a pull request changes.

The lit suite and format check use LLVM 22 from apt.llvm.org: the tests
rely on clang 22 declaring the cl_khr_subgroup_shuffle builtins by
default. Also let check-format.sh take the base revision and check
headers, and point the README badge at the new workflow.
@maleadt
maleadt merged commit 3d66765 into main Sep 26, 2026
5 checks passed
@maleadt
maleadt deleted the tb/ci branch September 26, 2026 10:05
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