-
Notifications
You must be signed in to change notification settings - Fork 6
549 lines (459 loc) · 20.1 KB
/
Copy pathci.yml
File metadata and controls
549 lines (459 loc) · 20.1 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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
name: CI
on:
push:
pull_request:
jobs:
workspace-compat:
name: Workspace Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install protoc (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf
- name: Install protoc (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: choco install protoc -y
- name: Install OpenBLAS (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev
- name: Install OpenBLAS (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
vcpkg install openblas:x64-windows
$vcpkg = "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows"
echo "OPENBLAS_PATH=$vcpkg\lib" >> $env:GITHUB_ENV
echo "$vcpkg\bin" >> $env:GITHUB_PATH
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Check Workspace
run: cargo check --workspace --all-targets
- name: Test Workspace
run: cargo test --workspace --release
# blas is off by default now; keep the OpenBLAS path (and the vcpkg
# OpenBLAS + MSVC numerical regression test) covered explicitly.
- name: BLAS feature check + kernel tests
if: runner.os != 'macOS'
run: |
cargo check --workspace --features blas
cargo test -p yscv-kernels --features blas --release --lib
- name: GPU feature compilation check
if: runner.os == 'Linux'
run: cargo check -p yscv-kernels --features gpu
- name: GPU feature workspace compilation check
if: runner.os == 'Linux'
run: cargo check --workspace --features gpu
- name: GPU feature clippy (yscv-kernels)
if: runner.os == 'Linux'
run: cargo clippy -p yscv-kernels --features gpu --all-targets -- -D warnings
- name: GPU feature clippy (yscv-onnx)
if: runner.os == 'Linux'
run: cargo clippy -p yscv-onnx --features gpu --all-targets -- -D warnings
- name: GPU feature tests
if: runner.os == 'Linux'
run: |
cargo test -p yscv-kernels --features gpu --lib
cargo test -p yscv-onnx --features gpu --lib
- name: RKNN feature compilation check
if: runner.os == 'Linux'
run: cargo check -p yscv-kernels --features rknn
- name: RKNN feature clippy
if: runner.os == 'Linux'
run: cargo clippy -p yscv-kernels --features rknn --all-targets -- -D warnings
- name: RKNN feature tests
if: runner.os == 'Linux'
run: cargo test -p yscv-kernels --features rknn --lib
# Cross-check on Linux ARM64 from macOS to catch cfg(target_os = "linux")
# bugs that pure macOS check would miss.
- name: Install Linux ARM64 cross target (macOS)
if: runner.os == 'macOS'
run: rustup target add aarch64-unknown-linux-gnu
- name: RKNN feature cross-check (Linux ARM64 from macOS)
if: runner.os == 'macOS'
run: cargo check -p yscv-kernels --features rknn --target aarch64-unknown-linux-gnu
- name: RKNN feature cross-clippy (Linux ARM64 from macOS)
if: runner.os == 'macOS'
run: cargo clippy -p yscv-kernels --features rknn --target aarch64-unknown-linux-gnu -- -D warnings
- name: Metal backend compilation check
if: runner.os == 'macOS'
run: cargo check --workspace --features metal-backend
- name: Metal backend clippy (yscv-kernels)
if: runner.os == 'macOS'
run: cargo clippy -p yscv-kernels --features metal-backend --all-targets -- -D warnings
- name: Metal backend clippy (yscv-onnx)
if: runner.os == 'macOS'
run: cargo clippy -p yscv-onnx --features metal-backend --all-targets -- -D warnings
- name: Metal backend + profile clippy (yscv-onnx)
if: runner.os == 'macOS'
run: cargo clippy -p yscv-onnx --features "metal-backend profile" --all-targets -- -D warnings
- name: Metal backend tests
if: runner.os == 'macOS'
run: cargo test --workspace --release --features metal-backend
- name: Metal backend feature-scoped tests
if: runner.os == 'macOS'
run: |
cargo test -p yscv-kernels --features metal-backend --lib
cargo test -p yscv-onnx --features metal-backend --lib
- name: Native camera compile smoke
run: cargo check -p yscv-video --features native-camera
- name: Native camera clippy
run: cargo clippy -p yscv-video --features native-camera --all-targets -- -D warnings
- name: Native camera tests
run: cargo test -p yscv-video --features native-camera --lib
aarch64-linux:
name: ARM64 Linux (aarch64)
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install protoc (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf
- name: Install protoc (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: choco install protoc -y
- name: Install OpenBLAS
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Build & Test
run: cargo test --workspace
- name: Benchmark (u8 ops)
run: cargo run --release -p yscv-bench 2>&1 | grep "u8_"
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install protoc (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf
- name: Install protoc (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: choco install protoc -y
- name: Install OpenBLAS
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --check
- name: Clippy (default features)
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Clippy (gpu feature)
run: cargo clippy --workspace --all-targets --features gpu -- -D warnings
- name: Clippy (gpu + rknn + native-camera)
run: cargo clippy --workspace --all-targets --features "gpu rknn native-camera" -- -D warnings
- name: Clippy (profile feature)
run: cargo clippy -p yscv-onnx --all-targets --features "gpu profile" -- -D warnings
- name: Test Workspace (default)
run: cargo test
- name: Test Workspace (proptest extended)
env:
PROPTEST_CASES: "4096"
run: cargo test --workspace --lib
- name: Doc counts gate
run: bash scripts/check-doc-counts.sh
- name: SAFETY comments gate
run: bash scripts/check-safety-comments.sh
- name: Runtime dispatch gate
run: bash scripts/check-runtime-dispatch.sh
- name: Verify Camera Listing UX (No Native Feature)
run: |
cargo run -p yscv-cli --bin yscv-cli -- --list-cameras
cargo run -p yscv-cli --bin yscv-cli -- --list-cameras --device-name cam
cargo run -p camera-face-tool -- --list-cameras
cargo run -p camera-face-tool -- --list-cameras --device-name cam
- name: Verify Camera Diagnostics UX (No Native Feature)
run: |
mkdir -p artifacts
cargo run -p yscv-cli --bin yscv-cli -- \
--diagnose-camera --diagnose-frames 5 --diagnose-report artifacts/yscv-cli-diagnostics.json
cargo run -p camera-face-tool -- \
--diagnose-camera --diagnose-frames 5 --diagnose-report artifacts/camera-face-tool-diagnostics.json
test -s artifacts/yscv-cli-diagnostics.json
test -s artifacts/camera-face-tool-diagnostics.json
- name: Verify Event Log Output
run: |
mkdir -p artifacts
cargo run -p yscv-cli --bin yscv-cli -- \
--max-frames 3 \
--event-log artifacts/events.jsonl
test -s artifacts/events.jsonl
- name: Verify Dataset Eval Mode
run: |
set -o pipefail
mkdir -p artifacts
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-jsonl benchmarks/eval-detection-sample.jsonl \
--eval-tracking-jsonl benchmarks/eval-tracking-sample.jsonl \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-coco-gt benchmarks/eval-detection-coco-gt-sample.json \
--eval-detection-coco-pred benchmarks/eval-detection-coco-pred-sample.json \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-openimages-gt benchmarks/eval-detection-openimages-gt-sample.csv \
--eval-detection-openimages-pred benchmarks/eval-detection-openimages-pred-sample.csv \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-yolo-manifest benchmarks/eval-detection-yolo-manifest-sample.txt \
--eval-detection-yolo-gt-dir benchmarks/eval-detection-yolo-gt \
--eval-detection-yolo-pred-dir benchmarks/eval-detection-yolo-pred \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-voc-manifest benchmarks/eval-detection-voc-manifest-sample.txt \
--eval-detection-voc-gt-dir benchmarks/eval-detection-voc-gt \
--eval-detection-voc-pred-dir benchmarks/eval-detection-voc-pred \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-kitti-manifest benchmarks/eval-detection-kitti-manifest-sample.txt \
--eval-detection-kitti-gt-dir benchmarks/eval-detection-kitti-gt \
--eval-detection-kitti-pred-dir benchmarks/eval-detection-kitti-pred \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-detection-widerface-gt benchmarks/eval-detection-widerface-gt-sample.txt \
--eval-detection-widerface-pred benchmarks/eval-detection-widerface-pred-sample.txt \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
cargo run -p yscv-cli --bin yscv-cli -- \
--eval-tracking-mot-gt benchmarks/eval-tracking-mot-gt-sample.txt \
--eval-tracking-mot-pred benchmarks/eval-tracking-mot-pred-sample.txt \
--eval-iou 0.5 \
--eval-score 0.0 \
2>&1 | tee -a artifacts/eval-dataset-output.txt
test -s artifacts/eval-dataset-output.txt
- name: Verify Diagnostics Report Validation Mode
run: |
cargo run -p yscv-cli --bin yscv-cli -- \
--validate-diagnostics-report benchmarks/diagnostics-sample-ok.json \
--validate-diagnostics-min-frames 2 \
--validate-diagnostics-max-drift-pct 25 \
--validate-diagnostics-max-dropped 0
- name: Run Deterministic Benchmark Gate
run: |
mkdir -p artifacts
cargo run -p yscv-cli --bin yscv-cli -- \
--benchmark \
--max-frames 3 \
--benchmark-report artifacts/benchmark.txt \
--benchmark-baseline benchmarks/ci-baseline-people.txt
- name: Run Deterministic Face Benchmark Gate
run: |
cargo run -p yscv-cli --bin yscv-cli -- \
--detect-target face \
--benchmark \
--max-frames 3 \
--benchmark-report artifacts/benchmark-face.txt \
--benchmark-baseline benchmarks/ci-baseline-face.txt
- name: Export Runtime Trend Snapshot
run: |
bash benchmarks/export-runtime-trend.sh \
artifacts/benchmark-runtime-trend.tsv \
artifacts/benchmark.txt \
artifacts/benchmark-face.txt \
artifacts/eval-dataset-output.txt
- name: Compare Runtime Trend Snapshot
env:
YSCV_TREND_MAX_REGRESSION_PCT_RUNTIME: ${{ vars.YSCV_TREND_MAX_REGRESSION_PCT_RUNTIME }}
run: |
bash benchmarks/compare-trend-snapshots.sh \
runtime \
benchmarks/trend-baseline-runtime.tsv \
artifacts/benchmark-runtime-trend.tsv \
artifacts/benchmark-runtime-trend-diff.tsv
- name: Run Detect Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-detect \
detect_heatmap_scratch \
artifacts/benchmark-detect-micro.txt \
benchmarks/ci-baseline-detect-micro.txt
- name: Run Track Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-track \
tracker_update \
artifacts/benchmark-track-micro.txt \
benchmarks/ci-baseline-track-micro.txt
- name: Run Recognize Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-recognize \
recognize_slice_vs_tensor \
artifacts/benchmark-recognize-micro.txt \
benchmarks/ci-baseline-recognize-micro.txt
- name: Run Video Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-video \
normalize_rgb8 \
artifacts/benchmark-video-micro.txt \
benchmarks/ci-baseline-video-micro.txt
- name: Run Tensor Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-tensor \
tensor_elementwise_modes \
artifacts/benchmark-tensor-micro.txt \
benchmarks/ci-baseline-tensor-micro.txt
- name: Run Kernels Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-kernels \
kernels_cpu_ops \
artifacts/benchmark-kernels-micro.txt \
benchmarks/ci-baseline-kernels-micro.txt
- name: Run Model Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-model \
model_runtime_ops \
artifacts/benchmark-model-micro.txt \
benchmarks/ci-baseline-model-micro.txt
- name: Run Imgproc Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-imgproc \
imgproc_ops \
artifacts/benchmark-imgproc-micro.txt \
benchmarks/ci-baseline-imgproc-micro.txt
- name: Run Autograd Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-autograd \
autograd_graph_ops \
artifacts/benchmark-autograd-micro.txt \
benchmarks/ci-baseline-autograd-micro.txt
- name: Run Eval Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-eval \
eval_metrics_ops \
artifacts/benchmark-eval-micro.txt \
benchmarks/ci-baseline-eval-micro.txt
- name: Run CLI Runtime Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
yscv-cli \
cli_runtime_ops \
artifacts/benchmark-cli-micro.txt \
benchmarks/ci-baseline-cli-micro.txt
- name: Run Camera Face Tool Runtime Microbench Gate
run: |
bash benchmarks/run-criterion-gate.sh \
camera-face-tool \
camera_face_runtime_ops \
artifacts/benchmark-camera-face-tool-micro.txt \
benchmarks/ci-baseline-camera-face-tool-micro.txt
- name: Export Microbench Trend Snapshot
run: |
bash benchmarks/export-criterion-trend.sh \
artifacts/benchmark-micro-trend.tsv \
artifacts/benchmark-detect-micro.txt \
artifacts/benchmark-track-micro.txt \
artifacts/benchmark-recognize-micro.txt \
artifacts/benchmark-video-micro.txt \
artifacts/benchmark-tensor-micro.txt \
artifacts/benchmark-kernels-micro.txt \
artifacts/benchmark-model-micro.txt \
artifacts/benchmark-imgproc-micro.txt \
artifacts/benchmark-autograd-micro.txt \
artifacts/benchmark-eval-micro.txt \
artifacts/benchmark-cli-micro.txt \
artifacts/benchmark-camera-face-tool-micro.txt
- name: Compare Microbench Trend Snapshot
env:
YSCV_TREND_MAX_REGRESSION_PCT_MICRO: ${{ vars.YSCV_TREND_MAX_REGRESSION_PCT_MICRO }}
run: |
bash benchmarks/compare-trend-snapshots.sh \
micro \
benchmarks/trend-baseline-micro.tsv \
artifacts/benchmark-micro-trend.tsv \
artifacts/benchmark-micro-trend-diff.tsv
- name: Check Trend Baseline Freshness
env:
YSCV_TREND_BASELINE_MAX_AGE_DAYS: ${{ vars.YSCV_TREND_BASELINE_MAX_AGE_DAYS }}
YSCV_TREND_BASELINE_ENFORCE: ${{ vars.YSCV_TREND_BASELINE_ENFORCE }}
run: |
bash benchmarks/check-trend-baseline-freshness.sh \
benchmarks/trend-baseline-micro.tsv \
"${YSCV_TREND_BASELINE_MAX_AGE_DAYS:-14}"
bash benchmarks/check-trend-baseline-freshness.sh \
benchmarks/trend-baseline-runtime.tsv \
"${YSCV_TREND_BASELINE_MAX_AGE_DAYS:-14}"
- name: Upload Benchmark Artifact
uses: actions/upload-artifact@v4
with:
name: yscv-benchmark-reports
path: |
artifacts/*.txt
artifacts/*.tsv
artifacts/*.json
artifacts/*.jsonl
miri:
name: Miri (unsafe soundness)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Nightly + Miri
uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Miri — yscv-tensor
run: cargo +nightly miri test -p yscv-tensor --lib
env:
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks
# yscv-kernels and yscv-autograd skipped:
# • yscv-kernels: 170+ heavy numerical tests at Miri's 100-1000×
# interpreter slowdown blow past the 6-hour Actions ceiling.
# The actual unsafe surface is SIMD intrinsics + inline asm,
# which Miri can't run anyway (those tests are
# `#[cfg_attr(miri, ignore)]`'d); what's left is safe-Rust
# scalar fallbacks where Miri has no work to do.
# • yscv-autograd: uses rayon (via yscv-kernels), which triggers
# a known crossbeam-epoch Stacked Borrows false positive
# (crossbeam-rs/crossbeam#545).
# Race-prone unsafe code (yscv-threadpool/src/section.rs) is
# validated separately via ThreadSanitizer (nightly
# -Zsanitizer=thread build-std) and Valgrind helgrind in the
# section-race-fix work — both more useful here than Miri.