This repository was archived by the owner on Aug 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
368 lines (331 loc) · 19.8 KB
/
Copy pathci.yml
File metadata and controls
368 lines (331 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: CI
# Fast PR signal plus deeper compiler guards:
# - workflow/script hygiene catches broken automation;
# - Windows GCC runs the full ABI/runtime/regression suite and deterministic fuzz gate;
# - Windows Clang compile-only catches compiler portability warnings quickly;
# - Linux GCC/Clang exercise the ELF/SysV backend;
# - Linux sanitizers run the compiler under ASan/UBSan while compiling ELF programs.
# The heavy differential fuzz sweep lives in fuzz-nightly.yml.
on:
push:
branches: [main, development]
pull_request:
workflow_dispatch:
# A newer push to the same branch/PR cancels the in-flight run.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
quality:
name: Quality gates
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Validate GitHub Actions workflows
shell: bash
run: |
set -euo pipefail
version="1.7.7"
curl -fsSL -o "$RUNNER_TEMP/actionlint.tar.gz" \
"https://github.com/rhysd/actionlint/releases/download/v${version}/actionlint_${version}_linux_amd64.tar.gz"
tar -xzf "$RUNNER_TEMP/actionlint.tar.gz" -C "$RUNNER_TEMP" actionlint
"$RUNNER_TEMP/actionlint" -color
- name: Validate shell scripts
shell: bash
run: |
set -euo pipefail
bash -n install.sh
bash -n tools/test-elf-native.sh
if command -v shellcheck >/dev/null 2>&1; then
shellcheck install.sh tools/test-elf-native.sh
else
echo "::warning::shellcheck is not installed on this runner; bash -n completed"
fi
- name: Validate PowerShell scripts parse
shell: pwsh
run: |
$failed = $false
Get-ChildItem -Recurse -File -Include *.ps1 | ForEach-Object {
$tokens = $null
$errors = $null
[System.Management.Automation.Language.Parser]::ParseFile($_.FullName, [ref]$tokens, [ref]$errors) | Out-Null
if ($errors.Count -gt 0) {
$failed = $true
Write-Error "$($_.FullName): $($errors[0].Message)"
}
}
if ($failed) { exit 1 }
build-and-test:
name: Build & test (windows gcc)
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python (for differential fuzzer)
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Show toolchain versions
shell: pwsh
run: |
gcc --version
python --version
$PSVersionTable.PSVersion
# build.bat builds the compiler, bundles stdlib/runtime, then runs
# tests/run_tests.ps1 (full suite + 60-seed differential fuzz). It exits
# non-zero if the build OR any test fails, so this single step is the gate.
- name: Build and run test suite
shell: cmd
# METTLE_NO_CODEVIEW avoids a MinGW gcc ICE in the CodeView debug-info
# emitter on large functions (e.g. lexer_next_token); CI doesn't need
# the .pdb-backed ICE backtraces that flag provides.
env:
METTLE_NO_CODEVIEW: "1"
run: build.bat gcc
# run_tests.ps1 writes generated .s/.ir output to $env:TEMP\Mettle-test-artifacts.
# Surface that path so a failed run's codegen can be inspected from the UI.
- name: Resolve test artifact dir
if: failure()
id: artifacts
shell: pwsh
run: "echo \"dir=$env:TEMP\\Mettle-test-artifacts\" >> $env:GITHUB_OUTPUT"
- name: Upload assembly artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-test-output
path: ${{ steps.artifacts.outputs.dir }}/**
if-no-files-found: ignore
retention-days: 7
windows-clang:
name: Build (windows clang)
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up MSYS2 Clang
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true
install: >-
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-binutils
- name: Show toolchain versions
shell: pwsh
run: |
$env:Path = "C:\msys64\clang64\bin;$env:Path"
clang --version
$PSVersionTable.PSVersion
- name: Compile compiler with Clang
shell: pwsh
env:
METTLE_NO_CODEVIEW: "1"
run: |
$env:Path = "C:\msys64\clang64\bin;$env:Path"
cmd /c build.bat clang --skip-tests
- name: Smoke compiler
shell: pwsh
run: |
$env:Path = "C:\msys64\clang64\bin;$env:Path"
.\bin\mettle.exe --version
.\bin\mettle.exe tests\ok_global_int.mettle -o "$env:TEMP\ok_global_int.s"
if (-not (Test-Path "$env:TEMP\ok_global_int.s")) { throw "smoke assembly was not produced" }
# Exercises the native ELF/SysV backend on both major Linux compilers.
elf-native:
name: Build & test (linux ELF ${{ matrix.cc }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
run: |
${{ matrix.cc }} --version
ld --version | head -1
make --version | head -1
- name: Build compiler
run: |
make clean
make -j"$(nproc)" CC=${{ matrix.cc }}
- name: Runtime C harness
run: make test CC=${{ matrix.cc }}
- name: Native ELF backend tests
run: bash tools/test-elf-native.sh
# Native AArch64 gate for the DGX Spark toolchain path: compiler bootstrap,
# relocatable host objects and external linking, the 11-argument CUDA launch
# ABI, portable/GB10 PTX, SPIR-V, and the legacy self-contained smoke product.
# CUDA hardware execution remains in the DGX acceptance suite.
gpu-arm64:
name: GPU toolchain (linux arm64)
runs-on: ubuntu-24.04-arm
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Build compiler natively on AArch64
run: |
test "$(uname -m)" = "aarch64"
make -j"$(nproc)" CC=gcc
- name: Emit frontend-agnostic GPU modules
run: |
./bin/mettle --emit-ptx --gpu-arch=portable tests/gpu/compute_kernels.mettle -o /tmp/mettle-portable.ptx
grep -qx '.version 6.4' /tmp/mettle-portable.ptx
grep -qx '.target compute_75' /tmp/mettle-portable.ptx
./bin/mettle --emit-ptx --gpu-arch=gb10 tests/gpu/compute_kernels.mettle -o /tmp/mettle-gb10.ptx
grep -qx '.version 8.8' /tmp/mettle-gb10.ptx
grep -qx '.target sm_121a' /tmp/mettle-gb10.ptx
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_transfer.mettle -o /tmp/mettle-gb10-transfer.ptx
test "$(grep -c 'mtlc.tensor_transfer native-tma' /tmp/mettle-gb10-transfer.ptx)" -eq 2
test "$(grep -c 'mtlc.tensor_transfer cooperative-fallback' /tmp/mettle-gb10-transfer.ptx)" -eq 5
test "$(grep -c 'fence.proxy.async.shared::cta' /tmp/mettle-gb10-transfer.ptx)" -eq 2
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_sparse.mettle -o /tmp/mettle-gb10-sparse.ptx
test "$(grep -c 'mma.sp::ordered_metadata.*f32.f16.f16.f32' /tmp/mettle-gb10-sparse.ptx)" -eq 10
test "$(grep -c 'mma.sp::ordered_metadata.*f32.bf16.bf16.f32' /tmp/mettle-gb10-sparse.ptx)" -eq 2
test "$(grep -c 'popc.b32' /tmp/mettle-gb10-sparse.ptx)" -eq 48
test "$(grep -c 'mtlc.tensor_chain resident native-mma sparse-f16-2to4' /tmp/mettle-gb10-sparse.ptx)" -eq 1
test "$(grep -c 'mtlc.tensor_loop resident native-mma sparse-f16-2to4' /tmp/mettle-gb10-sparse.ptx)" -eq 1
if grep -q 'tcgen05' /tmp/mettle-gb10-sparse.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_tiled.mettle -o /tmp/mettle-gb10-tiled.ptx
test "$(grep -c 'mtlc.tensor_mma tiled' /tmp/mettle-gb10-tiled.ptx)" -eq 13
test "$(grep -c 'subtiles=4 reuse=A' /tmp/mettle-gb10-tiled.ptx)" -eq 12
test "$(grep -c 'subtiles=2 reuse=B' /tmp/mettle-gb10-tiled.ptx)" -eq 1
grep -q 'mtlc.tensor_chain resident tiles=2 subtiles=4 tuple_peak=56 budget=96' /tmp/mettle-gb10-tiled.ptx
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_epilogue.mettle -o /tmp/mettle-gb10-epilogue.ptx
test "$(grep -c 'mtlc.tensor_epilogue cooperative-memory' /tmp/mettle-gb10-epilogue.ptx)" -eq 5
test "$(grep -c 'bar.warp.sync' /tmp/mettle-gb10-epilogue.ptx)" -eq 8
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_epilogue_fused.mettle -o /tmp/mettle-gb10-epilogue-fused.ptx
test "$(grep -c 'mtlc.tensor_epilogue resident' /tmp/mettle-gb10-epilogue-fused.ptx)" -eq 4
test "$(grep -c 'mtlc.tensor_epilogue cooperative-memory' /tmp/mettle-gb10-epilogue-fused.ptx)" -eq 3
test "$(grep -c 'mtlc.tensor_epilogue resident handoff group=1 stable-wmma' /tmp/mettle-gb10-epilogue-fused.ptx)" -eq 2
grep -q 'mtlc.tensor_loop resident group=1 subtiles=4 tuple_peak=56 budget=96' /tmp/mettle-gb10-tiled.ptx
./bin/mettle -O --dump-ir --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_matmul.mettle -o /tmp/mettle-gb10-matmul.ptx
grep -q 'tensor_matmul region=m16n16 k_chunk=16' /tmp/mettle-gb10-matmul.ptx.ir
test "$(grep -c 'mtlc.tensor_matmul native interior runtime-K resident stable-wmma' /tmp/mettle-gb10-matmul.ptx)" -eq 5
test "$(grep -c 'mtlc.tensor_matmul cooperative-full exact M/N/K edge replay' /tmp/mettle-gb10-matmul.ptx)" -eq 5
test "$(grep -c 'mtlc.tensor_matmul cooperative-tail exact M/N/K edge replay' /tmp/mettle-gb10-matmul.ptx)" -eq 5
./bin/mettle -O --emit-ptx --gpu-arch=gb10 --gpu-tensor-tuple-budget=1 tests/gpu/tensor_matmul.mettle -o /tmp/mettle-gb10-matmul-budget1.ptx
test "$(grep -c 'mtlc.tensor_matmul cooperative-only: native accumulator exceeds tensor tuple budget' /tmp/mettle-gb10-matmul-budget1.ptx)" -eq 5
if grep -q 'wmma.mma' /tmp/mettle-gb10-matmul-budget1.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_matmul_transpose.mettle -o /tmp/mettle-gb10-matmul-transpose.ptx
test "$(grep -c 'mtlc.tensor_matmul native interior runtime-K resident stable-wmma' /tmp/mettle-gb10-matmul-transpose.ptx)" -eq 3
test "$(grep -c 'mtlc.tensor_matmul cooperative-full exact M/N/K edge replay' /tmp/mettle-gb10-matmul-transpose.ptx)" -eq 3
test "$(grep -c 'mtlc.tensor_matmul cooperative-tail exact M/N/K edge replay' /tmp/mettle-gb10-matmul-transpose.ptx)" -eq 3
test "$(grep -c 'wmma.mma.sync' /tmp/mettle-gb10-matmul-transpose.ptx)" -eq 6
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_matmul_fp8.mettle -o /tmp/mettle-gb10-matmul-fp8.ptx
test "$(grep -c 'mtlc.tensor_matmul native interior runtime-K resident direct-mma' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 2
test "$(grep -c 'mtlc.tensor_matmul cooperative-full exact M/N/K edge replay' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 2
test "$(grep -c 'mtlc.tensor_matmul cooperative-tail exact M/N/K edge replay' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 2
test "$(grep -c 'cvt.rn.f16x2.e4m3x2' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 4
test "$(grep -c 'cvt.rn.f16x2.e5m2x2' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 4
test "$(grep -c 'mma.sync' /tmp/mettle-gb10-matmul-fp8.ptx)" -eq 8
if grep -q 'wmma.mma' /tmp/mettle-gb10-matmul-fp8.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 --gpu-tensor-tuple-budget=1 tests/gpu/tensor_matmul_fp8.mettle -o /tmp/mettle-gb10-matmul-fp8-budget1.ptx
test "$(grep -c 'mtlc.tensor_matmul cooperative-only: native accumulator exceeds tensor tuple budget' /tmp/mettle-gb10-matmul-fp8-budget1.ptx)" -eq 2
if grep -Eq 'wmma.mma|mma.sync' /tmp/mettle-gb10-matmul-fp8-budget1.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_matmul_scaled.mettle -o /tmp/mettle-gb10-matmul-scaled.ptx
test "$(grep -c 'mtlc.tensor_matmul native interior runtime-K resident direct-mma' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mtlc.tensor_matmul cooperative-full exact M/N/K edge replay' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mtlc.tensor_matmul cooperative-tail exact M/N/K edge replay' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mtlc.tensor_matmul dense-subbyte byte-alignment guard' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mma.sync.aligned.m16n8k32.row.col.kind::mxf8f6f4.block_scale.scale_vec::1X.f32.e3m2.e2m3.f32.ue8m0' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
test "$(grep -c 'mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3' /tmp/mettle-gb10-matmul-scaled.ptx)" -eq 4
if grep -Eq 'cvt.rn.f16x2.(e2m1|e2m3|e3m2)x2|wmma.mma' /tmp/mettle-gb10-matmul-scaled.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 --gpu-tensor-tuple-budget=1 tests/gpu/tensor_matmul_scaled.mettle -o /tmp/mettle-gb10-matmul-scaled-budget1.ptx
test "$(grep -c 'mtlc.tensor_matmul cooperative-only: native accumulator exceeds tensor tuple budget' /tmp/mettle-gb10-matmul-scaled-budget1.ptx)" -eq 4
if grep -Eq 'wmma.mma|mma.sync' /tmp/mettle-gb10-matmul-scaled-budget1.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 tests/gpu/tensor_matmul_sparse.mettle -o /tmp/mettle-gb10-matmul-sparse.ptx
test "$(grep -c 'mtlc.tensor_matmul native interior runtime-K resident direct-mma' /tmp/mettle-gb10-matmul-sparse.ptx)" -eq 2
test "$(grep -c 'mtlc.tensor_matmul cooperative-full exact M/N/K edge replay' /tmp/mettle-gb10-matmul-sparse.ptx)" -eq 2
test "$(grep -c 'mtlc.tensor_matmul cooperative-tail exact M/N/K edge replay' /tmp/mettle-gb10-matmul-sparse.ptx)" -eq 2
test "$(grep -c 'mma.sp::ordered_metadata.sync.aligned.m16n8k16' /tmp/mettle-gb10-matmul-sparse.ptx)" -eq 8
test "$(grep -Ec '@%p[0-9]+ ld.global.b16' /tmp/mettle-gb10-matmul-sparse.ptx)" -eq 4
if grep -q 'wmma.mma' /tmp/mettle-gb10-matmul-sparse.ptx; then exit 1; fi
./bin/mettle -O --emit-ptx --gpu-arch=gb10 --gpu-tensor-tuple-budget=1 tests/gpu/tensor_matmul_sparse.mettle -o /tmp/mettle-gb10-matmul-sparse-budget1.ptx
test "$(grep -c 'mtlc.tensor_matmul cooperative-only: native accumulator exceeds tensor tuple budget' /tmp/mettle-gb10-matmul-sparse-budget1.ptx)" -eq 2
if grep -Eq 'wmma.mma|mma.sp' /tmp/mettle-gb10-matmul-sparse-budget1.ptx; then exit 1; fi
if command -v ptxas >/dev/null 2>&1; then
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 56 --require-zero-spills --pretty -o /tmp/mettle-gb10-sparse.resources.json /tmp/mettle-gb10-sparse.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 64 --require-zero-spills --pretty -o /tmp/mettle-gb10-tiled.resources.json /tmp/mettle-gb10-tiled.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 40 --require-zero-spills --pretty -o /tmp/mettle-gb10-matmul.resources.json /tmp/mettle-gb10-matmul.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 40 --require-zero-spills --pretty -o /tmp/mettle-gb10-matmul-transpose.resources.json /tmp/mettle-gb10-matmul-transpose.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 64 --require-zero-spills --pretty -o /tmp/mettle-gb10-matmul-fp8.resources.json /tmp/mettle-gb10-matmul-fp8.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 80 --require-zero-spills --pretty -o /tmp/mettle-gb10-matmul-scaled.resources.json /tmp/mettle-gb10-matmul-scaled.ptx
python3 tools/gpu/ptxas_profile.py --arch sm_121a --max-registers 56 --require-zero-spills --pretty -o /tmp/mettle-gb10-matmul-sparse.resources.json /tmp/mettle-gb10-matmul-sparse.ptx
fi
./bin/mettle --emit-spirv tests/gpu/compute_kernels.mettle -o /tmp/mettle-kernels.spv
test "$(od -An -tx4 -N4 /tmp/mettle-kernels.spv | tr -d ' ')" = "07230203"
- name: Upload offline GB10 resource evidence
uses: actions/upload-artifact@v4
with:
name: linux-arm64-gb10-offline-resources
path: /tmp/mettle-gb10-*.resources.json
if-no-files-found: ignore
- name: Compile the cross-host CUDA harness without loading CUDA
run: |
gcc -std=c11 -O2 -Wall -Wextra -Werror tests/gpu/hardware_harness.c -o /tmp/mettle-gpu-harness -ldl -lm
bash -n tests/gpu/run_hardware_tests.sh
- name: Run exact matrix-region semantics natively on AArch64 CPU
run: |
gcc -std=c11 -O2 -Wall -Wextra -Werror tests/tensor_matmul_oracle.c -o /tmp/mettle-tensor-matmul-oracle
/tmp/mettle-tensor-matmul-oracle | grep -q 'structured 2:4, FP8/FP6/FP4 block scales, packed streams, K=0, and no-op bounds OK'
- name: Execute AArch64 backend smoke test natively
run: |
./bin/mettle --emit-arm64 tests/arm64/sum.mettle -o /tmp/mettle-arm64-sum
chmod +x /tmp/mettle-arm64-sum
set +e
/tmp/mettle-arm64-sum
status=$?
set -e
test "$status" -eq 55
- name: Link native AArch64 objects and external libc calls
run: |
./bin/mettle tests/arm64/sum.mettle -o /tmp/mettle-arm64-sum.o
readelf -h /tmp/mettle-arm64-sum.o | grep -q 'Type:.*REL'
readelf -h /tmp/mettle-arm64-sum.o | grep -q 'Machine:.*AArch64'
gcc -no-pie /tmp/mettle-arm64-sum.o -o /tmp/mettle-arm64-sum-linked
set +e
/tmp/mettle-arm64-sum-linked
status=$?
set -e
test "$status" -eq 55
./bin/mettle tests/arm64/native_link.mettle -o /tmp/mettle-arm64-libc.o
readelf -r /tmp/mettle-arm64-libc.o | grep -q 'R_AARCH64_CALL26.*putchar'
gcc -no-pie /tmp/mettle-arm64-libc.o -o /tmp/mettle-arm64-libc
test "$(/tmp/mettle-arm64-libc)" = "A"
- name: Verify native GPU launch ABI without CUDA hardware
run: |
./bin/mettle tests/test_gpu_dispatch.mettle -o /tmp/mettle-arm64-gpu.o
readelf -r /tmp/mettle-arm64-gpu.o | grep -q 'R_AARCH64_CALL26.*cuLaunchKernel'
gcc -no-pie /tmp/mettle-arm64-gpu.o tests/arm64/cuda_launch_stub.c -o /tmp/mettle-arm64-gpu
/tmp/mettle-arm64-gpu
sanitize:
name: Sanitizers (linux gcc)
runs-on: ubuntu-latest
timeout-minutes: 25
env:
ASAN_OPTIONS: detect_leaks=0:abort_on_error=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
steps:
- uses: actions/checkout@v4
- name: Build compiler with ASan/UBSan
run: |
make clean
make -j"$(nproc)" \
EXTRA_CFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all" \
LDFLAGS="-rdynamic -pthread -ldl -lm -fsanitize=address,undefined"
# Keep the compiler binary instrumented, but bundle normal runtime
# objects for programs the compiler builds. Generated executables do
# not link the sanitizer runtimes, so sanitized helper objects would
# fail at link time before the compiler itself gets exercised.
make bundle-runtime EXTRA_CFLAGS=""
- name: Exercise sanitized compiler
run: |
./bin/mettle --version
bash tools/test-elf-native.sh