-
Notifications
You must be signed in to change notification settings - Fork 0
299 lines (268 loc) · 11.9 KB
/
Copy pathsmoke.yml
File metadata and controls
299 lines (268 loc) · 11.9 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
name: smoke
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
inputs:
run_extended_smoke:
description: Run extended hot-loop runtime smoke profile
required: false
default: false
type: boolean
concurrency:
group: smoke-${{ github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
CMAKE_GENERATOR: Ninja
WEBVULKAN_CACHE_VERSION: v3
WEBVULKAN_BENCH_REQUIRED_PROFILES: dispatch_overhead,balanced_grid
WEBVULKAN_BENCH_MIN_SPEEDUP: "2.0"
LLVM_PREBUILT_URL: ${{ vars.WEBVULKAN_LLVM_PREBUILT_URL || 'https://github.com/Devsh-Graphics-Programming/llvmpipe2wasm/releases/download/llvm-wasm-prebuilt-latest/llvm-wasm-install.zip' }}
LLVM_PREBUILT_SHA256: ${{ vars.WEBVULKAN_LLVM_PREBUILT_SHA256 || '' }}
DXC_WASM_PREBUILT_URL: ${{ vars.WEBVULKAN_DXC_WASM_PREBUILT_URL || 'https://github.com/Devsh-Graphics-Programming/llvmpipe2wasm/releases/download/dxc-wasm-prebuilt-latest/dxc-wasm-prebuilt.zip' }}
DXC_WASM_PREBUILT_SHA256: ${{ vars.WEBVULKAN_DXC_WASM_PREBUILT_SHA256 || '' }}
jobs:
in_tree_add_subdirectory:
name: in-tree add_subdirectory
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build flex bison python3-pip glslang-tools
python3 -m pip install --upgrade pip
python3 -m pip install meson mako
python3 -m pip install cmake==4.2.0
- name: Resolve prebuilt bundle checksums
shell: bash
run: |
set -euo pipefail
llvm_sha="$(curl -L --fail "${LLVM_PREBUILT_URL}.sha256" | awk 'NR==1 {print $1}')"
dxc_sha="$(curl -L --fail "${DXC_WASM_PREBUILT_URL}.sha256" | awk 'NR==1 {print $1}')"
if [ -z "${llvm_sha}" ] || [ -z "${dxc_sha}" ]; then
echo "Failed to resolve prebuilt checksums from release sidecar files."
exit 1
fi
echo "LLVM_PREBUILT_SHA256=${llvm_sha}" >> "${GITHUB_ENV}"
echo "DXC_WASM_PREBUILT_SHA256=${dxc_sha}" >> "${GITHUB_ENV}"
- name: Restore third-party cache
id: cache_thirdparty
uses: actions/cache/restore@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ env.LLVM_PREBUILT_SHA256 }}-${{ env.DXC_WASM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Restore Mesa wasm build cache
id: cache_webvulkan_build
uses: actions/cache/restore@v4
with:
path: |
build/_webvulkan
build/.webvulkan_llvmpipe.stamp
key: ${{ runner.os }}-webvulkan-build-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ hashFiles('CMakeLists.txt', 'cmake/BuildMesaLlvmpipeWasm.cmake', 'tests/CMakeLists.txt', 'tests/RunLavapipeRuntimeSmoke.cmake') }}-${{ env.LLVM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-build-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Bootstrap DXC Wasm prebuilt
shell: bash
run: |
set -euo pipefail
dxc_dir="${GITHUB_WORKSPACE}/.3rdparty/dxc-wasm"
dxc_js="${dxc_dir}/dxc.js"
dxc_wasm="${dxc_dir}/dxc.wasm"
dxc_sha_stamp="${dxc_dir}/.sha256"
download_dxc=0
if [ ! -f "${dxc_js}" ] || [ ! -f "${dxc_wasm}" ]; then
download_dxc=1
elif [ ! -f "${dxc_sha_stamp}" ] || [ "$(cat "${dxc_sha_stamp}")" != "${DXC_WASM_PREBUILT_SHA256}" ]; then
download_dxc=1
fi
if [ "${download_dxc}" -eq 1 ]; then
mkdir -p "${dxc_dir}"
rm -f "${dxc_js}" "${dxc_wasm}" "${dxc_sha_stamp}"
curl -L --fail "${DXC_WASM_PREBUILT_URL}" -o "${RUNNER_TEMP}/dxc-wasm-prebuilt.zip"
echo "${DXC_WASM_PREBUILT_SHA256} ${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" | sha256sum -c -
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])" \
"${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" "${dxc_dir}"
printf '%s' "${DXC_WASM_PREBUILT_SHA256}" > "${dxc_sha_stamp}"
fi
test -f "${dxc_js}"
test -f "${dxc_wasm}"
echo "WEBVULKAN_DXC_WASM_JS=${dxc_js}" >> "${GITHUB_ENV}"
- name: Configure root project
run: |
cmake -S . -B build -G "${CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DWEBVULKAN_BUILD_TESTS=ON \
-DWEBVULKAN_DXC_WASM_JS="${WEBVULKAN_DXC_WASM_JS}" \
-DWEBVULKAN_ALLOW_DEP_UPDATES=OFF \
-DLLVM_PROVIDER=prebuilt \
-DLLVM_PREBUILT_URL="${LLVM_PREBUILT_URL}" \
-DLLVM_PREBUILT_SHA256="${LLVM_PREBUILT_SHA256}"
- name: Build and run in-tree smoke
shell: bash
run: |
set -euo pipefail
cmake --build build --target runtime_smoke --config "${BUILD_TYPE}" 2>&1 | tee build/runtime_smoke.log
- name: Report in-tree runtime benchmark JSON
shell: bash
run: |
set -euo pipefail
node_bin="$(ls -1d "${GITHUB_WORKSPACE}/.3rdparty/emsdk"/node/*/bin/node | sort -V | tail -n1)"
"${node_bin}" tests/wasm/tools/validate_dispatch_bench.mjs \
build/runtime_smoke.log \
--emit-json \
--json-out build/runtime_benchmark_report.json \
--no-validate
- name: Validate in-tree runtime benchmark gate
shell: bash
run: |
set -euo pipefail
node_bin="$(ls -1d "${GITHUB_WORKSPACE}/.3rdparty/emsdk"/node/*/bin/node | sort -V | tail -n1)"
"${node_bin}" tests/wasm/tools/validate_dispatch_bench.mjs build/runtime_smoke.log
- name: Build and run extended in-tree smoke
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_extended_smoke }}
run: |
cmake --build build --target lavapipe_runtime_smoke_hot_loop --config "${BUILD_TYPE}"
- name: Install relocatable package
run: |
cmake --install build --prefix "${GITHUB_WORKSPACE}/package"
- name: Upload relocatable package
uses: actions/upload-artifact@v4
with:
name: webvulkan-package
path: package
if-no-files-found: error
- name: Save Mesa wasm build cache
if: always() && steps.cache_webvulkan_build.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
build/_webvulkan
build/.webvulkan_llvmpipe.stamp
key: ${{ steps.cache_webvulkan_build.outputs.cache-primary-key }}
- name: Save third-party cache
if: always() && steps.cache_thirdparty.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.3rdparty
key: ${{ steps.cache_thirdparty.outputs.cache-primary-key }}
package_sparse_tests:
name: package sparse-tests
runs-on: ubuntu-latest
timeout-minutes: 180
needs:
- in_tree_add_subdirectory
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: tests-only
sparse-checkout: |
tests
sparse-checkout-cone-mode: false
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install cmake==4.2.0
- name: Resolve prebuilt bundle checksums
shell: bash
run: |
set -euo pipefail
llvm_sha="$(curl -L --fail "${LLVM_PREBUILT_URL}.sha256" | awk 'NR==1 {print $1}')"
dxc_sha="$(curl -L --fail "${DXC_WASM_PREBUILT_URL}.sha256" | awk 'NR==1 {print $1}')"
if [ -z "${llvm_sha}" ] || [ -z "${dxc_sha}" ]; then
echo "Failed to resolve prebuilt checksums from release sidecar files."
exit 1
fi
echo "LLVM_PREBUILT_SHA256=${llvm_sha}" >> "${GITHUB_ENV}"
echo "DXC_WASM_PREBUILT_SHA256=${dxc_sha}" >> "${GITHUB_ENV}"
- name: Restore third-party cache
id: cache_thirdparty
uses: actions/cache/restore@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ env.LLVM_PREBUILT_SHA256 }}-${{ env.DXC_WASM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Download relocatable package
uses: actions/download-artifact@v4
with:
name: webvulkan-package
path: package
- name: Validate cached emsdk
shell: bash
run: |
if [ ! -x "${GITHUB_WORKSPACE}/.3rdparty/emsdk/upstream/emscripten/emcc" ]; then
echo "emsdk is missing in cache. Re-run workflow after in-tree job saves cache."
exit 1
fi
- name: Bootstrap DXC Wasm prebuilt
shell: bash
run: |
set -euo pipefail
dxc_dir="${GITHUB_WORKSPACE}/.3rdparty/dxc-wasm"
dxc_js="${dxc_dir}/dxc.js"
dxc_wasm="${dxc_dir}/dxc.wasm"
dxc_sha_stamp="${dxc_dir}/.sha256"
download_dxc=0
if [ ! -f "${dxc_js}" ] || [ ! -f "${dxc_wasm}" ]; then
download_dxc=1
elif [ ! -f "${dxc_sha_stamp}" ] || [ "$(cat "${dxc_sha_stamp}")" != "${DXC_WASM_PREBUILT_SHA256}" ]; then
download_dxc=1
fi
if [ "${download_dxc}" -eq 1 ]; then
mkdir -p "${dxc_dir}"
rm -f "${dxc_js}" "${dxc_wasm}" "${dxc_sha_stamp}"
curl -L --fail "${DXC_WASM_PREBUILT_URL}" -o "${RUNNER_TEMP}/dxc-wasm-prebuilt.zip"
echo "${DXC_WASM_PREBUILT_SHA256} ${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" | sha256sum -c -
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])" \
"${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" "${dxc_dir}"
printf '%s' "${DXC_WASM_PREBUILT_SHA256}" > "${dxc_sha_stamp}"
fi
test -f "${dxc_js}"
test -f "${dxc_wasm}"
echo "WEBVULKAN_DXC_WASM_JS=${dxc_js}" >> "${GITHUB_ENV}"
- name: Configure sparse tests against package
run: |
cmake -S tests-only/tests -B tests-only/build -G "${CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DWEBVULKAN_TEST_MODE=package \
-DWEBVULKAN_TEST_PACKAGE_PREFIX="${GITHUB_WORKSPACE}/package" \
-DWEBVULKAN_DXC_WASM_JS="${WEBVULKAN_DXC_WASM_JS}" \
-DEMSDK_ROOT="${GITHUB_WORKSPACE}/.3rdparty/emsdk" \
-DWEBVULKAN_EMSCRIPTEN_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}/.3rdparty/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
- name: Build and run package smoke
shell: bash
run: |
set -euo pipefail
cmake --build tests-only/build --target runtime_smoke --config "${BUILD_TYPE}" 2>&1 | tee tests-only/build/runtime_smoke.log
- name: Report package runtime benchmark JSON
shell: bash
run: |
set -euo pipefail
node_bin="$(ls -1d "${GITHUB_WORKSPACE}/.3rdparty/emsdk"/node/*/bin/node | sort -V | tail -n1)"
"${node_bin}" tests-only/tests/wasm/tools/validate_dispatch_bench.mjs \
tests-only/build/runtime_smoke.log \
--emit-json \
--json-out tests-only/build/runtime_benchmark_report.json \
--no-validate
- name: Validate package runtime benchmark gate
shell: bash
run: |
set -euo pipefail
node_bin="$(ls -1d "${GITHUB_WORKSPACE}/.3rdparty/emsdk"/node/*/bin/node | sort -V | tail -n1)"
"${node_bin}" tests-only/tests/wasm/tools/validate_dispatch_bench.mjs tests-only/build/runtime_smoke.log