-
Notifications
You must be signed in to change notification settings - Fork 6
191 lines (163 loc) · 6.21 KB
/
Copy pathci.yml
File metadata and controls
191 lines (163 loc) · 6.21 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
# EdgeVec CI Configuration
# ========================
# W18.2: CI Hardening — Documented timeouts and environment variables
# W45.6: CI Optimization — Added Rust dependency caching, Miri skip filters
# W46.2: Expanded Miri skips — hybrid::, quantization::product::, hnsw:: (all pure-safe, no UB risk)
# W48.0: Split Miri into parallel jobs (core + sparse) + skip proptests under Miri
# Root cause: proptest cases under Miri take 1-3min each (Miri interprets every op)
#
# Local Simulation:
# cargo xtask ci-check
#
# Environment Variables (see below):
# RUSTFLAGS: Prevents SIGILL on CI runners (x86-64-v2 baseline)
# PROPTEST_CASES: Reduced to 32 for faster CI (256 locally)
# NUM_VECTORS: Reduced to 1000 for faster integration tests
#
# Job Timeouts:
# test: 15 minutes (cargo test --verbose)
# lint: 5 minutes (cargo fmt + clippy)
# wasm-check: 5 minutes (cargo check --target wasm32-unknown-unknown)
# fuzz-check: 5 minutes (cargo +nightly check)
# miri-core: 20 minutes (cargo +nightly miri test, core features)
# miri-sparse: 20 minutes (cargo +nightly miri test, sparse feature)
name: EdgeVec CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
# Override .cargo/config.toml's target-cpu=native to prevent SIGILL on CI runners
# See: docs/RELEASE_CHECKLIST.md Phase 2 for rationale
RUSTFLAGS: "-C target-cpu=x86-64-v2"
# Reduce proptest cases in CI (full coverage runs locally)
# Default: 256, CI: 32 — configured in proptest.toml
PROPTEST_CASES: "32"
# Reduce vector count for slow integration tests
# Default: 10000, CI: 1000 — prevents timeout on large-scale tests
NUM_VECTORS: "1000"
jobs:
# Job 1: Correctness & Testing
test:
name: Test Suite (Linux)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run Unit Tests
run: cargo test --verbose
# Job 2: Code Quality
lint:
name: Clippy & Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Check Formatting
run: cargo fmt -- --check
- name: Run Clippy
run: cargo clippy --all-targets -- -D clippy::correctness -W clippy::suspicious -W clippy::style
# Job 3: WASM Compatibility Check
wasm-check:
name: WASM Compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust with WASM target
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Check WASM Build
run: cargo check --target wasm32-unknown-unknown
# Job 4: Fuzz Harness Verification — All 15 targets
fuzz-check:
name: Fuzz Harness Build (All Targets)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Nightly Rust
uses: dtolnay/rust-toolchain@nightly
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Check ALL Fuzz Targets Compile
run: cargo +nightly check --manifest-path fuzz/Cargo.toml --all-targets
# Job 5a: Miri Safety Audit — Core (UB detection)
# Focuses ONLY on unsafe-adjacent code: SIMD, persistence, storage binary ops
# Skipped modules (pure-safe, no unsafe, or too slow under Miri):
# - filter::, metadata:: — zero unsafe code
# - hybrid:: — pure-safe search/fusion logic, very slow under Miri
# - quantization::product:: — pure-safe k-means/PQ, extremely slow under Miri
# - hnsw:: — graph search is safe-only, slow under Miri instrumentation
# - proptests — property tests don't exercise unsafe, 1-3min/case under Miri
# - wasm — not available in Miri
# - test_bq_vs_f32_recall_comparison — slow integration test
miri-core:
name: Miri Safety Check (core)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install Nightly Rust with Miri
uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run Miri (core)
run: |
cargo +nightly miri test --lib --no-default-features -- \
--skip wasm \
--skip test_bq_vs_f32_recall_comparison \
--skip filter:: \
--skip metadata::validation:: \
--skip metadata::serialize:: \
--skip metadata::error:: \
--skip hybrid:: \
--skip quantization::product:: \
--skip hnsw:: \
--skip proptests
env:
MIRIFLAGS: "-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance"
# Job 5b: Miri Safety Audit — Sparse feature (runs in parallel with 5a)
# Skip rationale: see Job 5a comment block above
miri-sparse:
name: Miri Safety Check (sparse)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install Nightly Rust with Miri
uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run Miri (sparse feature)
run: |
cargo +nightly miri test --lib --no-default-features --features sparse -- \
--skip wasm \
--skip test_bq_vs_f32_recall_comparison \
--skip filter:: \
--skip metadata::validation:: \
--skip metadata::serialize:: \
--skip metadata::error:: \
--skip hybrid:: \
--skip quantization::product:: \
--skip hnsw:: \
--skip proptests
env:
MIRIFLAGS: "-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance"