Repository navigation
230 lines (222 loc) · 14.9 KB
/
Copy pathhyperinterval.yml
File metadata and controls
230 lines (222 loc) · 14.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
name: hyperinterval
on:
push:
branches: ["**"]
paths:
- "crates/hyperinterval/**"
- "crates/hyperlattice-interval/**"
- "scripts/check_interval_float_codegen.py"
- "scripts/check_interval_wasm.py"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/hyperinterval.yml"
pull_request:
paths:
- "crates/hyperinterval/**"
- "crates/hyperlattice-interval/**"
- "scripts/check_interval_float_codegen.py"
- "scripts/check_interval_wasm.py"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/hyperinterval.yml"
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
host:
name: Core (${{ matrix.os }}, Rust ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: ["1.88.0", "1.95.0", stable]
env:
INTERVAL_RUST: ${{ matrix.rust }}
INTERVAL_FEATURES: ${{ matrix.rust == '1.88.0' && 'integer,fixed,dyadic,float-proposal,float-enclosure,serde' || 'integer,fixed,real-ball,float-proposal,float-enclosure,serde,dispatch-trace' }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
run: rustup toolchain install "$INTERVAL_RUST" --profile minimal --component clippy --component rustfmt
- name: Check feature isolation and laws
run: |
for features in '' integer fixed integer,fixed serde integer,serde fixed,serde alloc std bigint dyadic dyadic,serde float-proposal float-proposal,serde float-enclosure float-enclosure,serde float-enclosure,dyadic; do
cargo +"$INTERVAL_RUST" test --locked -p hyperinterval --no-default-features --features "$features"
done
if [ "$INTERVAL_RUST" != 1.88.0 ]; then
cargo +"$INTERVAL_RUST" run --locked -p hyperinterval --features hyperreal --example real_to_dyadic
cargo +"$INTERVAL_RUST" run --locked -p hyperinterval --features rational,float-proposal --example proposal_replay
for features in rational rational,serde rational,dyadic fixed,rational hyperreal real-ball float-enclosure,rational; do
cargo +"$INTERVAL_RUST" test --locked -p hyperinterval --no-default-features --features "$features"
done
fi
cargo +"$INTERVAL_RUST" test --locked -p hyperinterval --all-targets --features "$INTERVAL_FEATURES"
cargo +"$INTERVAL_RUST" test --locked -p hyperinterval --doc --features "$INTERVAL_FEATURES"
cargo +"$INTERVAL_RUST" test --locked -p hyperinterval --release --features "$INTERVAL_FEATURES" --test float alternate_native_modes -- --nocapture
- name: Check formatting and lint
run: |
cargo +"$INTERVAL_RUST" fmt -p hyperinterval -- --check
cargo +"$INTERVAL_RUST" clippy --locked -p hyperinterval --all-targets --no-default-features -- -D warnings
cargo +"$INTERVAL_RUST" clippy --locked -p hyperinterval --all-targets --features "$INTERVAL_FEATURES" -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo +"$INTERVAL_RUST" doc --locked -p hyperinterval --no-deps --features "$INTERVAL_FEATURES"
- name: Inspect strict float release code
if: matrix.os == 'ubuntu-latest'
run: python3 scripts/check_interval_float_codegen.py --toolchain "$INTERVAL_RUST" --output "$RUNNER_TEMP/interval-float-codegen"
- name: Execute strict float WebAssembly conformance
if: matrix.os == 'ubuntu-latest'
run: |
rustup target add --toolchain "$INTERVAL_RUST" wasm32-unknown-unknown wasm32-wasip1
sudo apt-get update
sudo apt-get install --no-install-recommends -y binaryen nodejs
python3 scripts/check_interval_wasm.py --toolchain "$INTERVAL_RUST" --output "$RUNNER_TEMP/interval-float-wasm"
python3 scripts/check_interval_wasm.py --toolchain "$INTERVAL_RUST" --target wasm32-wasip1 --output "$RUNNER_TEMP/interval-float-wasip1"
- name: Exercise unqualified WASI targets
if: matrix.os == 'ubuntu-latest' && matrix.rust == '1.95.0'
run: |
for target in wasm32-wasip1 wasm32-wasip1-threads; do
rustup target add --toolchain "$INTERVAL_RUST" "$target"
cargo +"$INTERVAL_RUST" build --locked --release --target "$target" --target-dir "$RUNNER_TEMP/interval-wasi" --manifest-path crates/hyperinterval/conformance/wasm-float/Cargo.toml
node crates/hyperinterval/conformance/wasm-float/unqualified.mjs "$RUNNER_TEMP/interval-wasi/$target/release/interval_float_wasm_conformance.wasm"
done
cargo +"$INTERVAL_RUST" build --locked --release --target wasm32-wasip1-threads --target-dir "$RUNNER_TEMP/interval-wasi" --manifest-path crates/hyperinterval/conformance/wasm-float/Cargo.toml --features float-enclosure-wasip1
node crates/hyperinterval/conformance/wasm-float/unqualified.mjs "$RUNNER_TEMP/interval-wasi/wasm32-wasip1-threads/release/interval_float_wasm_conformance.wasm"
- name: Verify firmware dependency closure
run: |
cargo +"$INTERVAL_RUST" tree --locked -p hyperinterval --no-default-features --features integer,fixed --edges normal --prefix none > interval-dependencies.txt
test "$(wc -l < interval-dependencies.txt)" -eq 1
cargo +"$INTERVAL_RUST" tree --locked -p hyperinterval --no-default-features --features float-proposal --edges normal --prefix none > proposal-dependencies.txt
test "$(wc -l < proposal-dependencies.txt)" -eq 1
cargo +"$INTERVAL_RUST" tree --locked -p hyperinterval --no-default-features --features float-enclosure --edges normal --prefix none > float-dependencies.txt
test "$(wc -l < float-dependencies.txt)" -eq 1
- name: Check fuzz harness
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: |
cargo check --locked --manifest-path crates/hyperinterval/fuzz/Cargo.toml --bins
cargo check --locked --manifest-path crates/hyperinterval/fuzz/Cargo.toml --bins --features rational
cargo check --locked --manifest-path crates/hyperinterval/fuzz/Cargo.toml --features lattice-shapes --bin cartesian_shapes
rustfmt --edition 2024 --check crates/hyperinterval/fuzz/fuzz_targets/*.rs
aarch64-gnu:
name: Strict float (AArch64 GNU/Linux, Rust ${{ matrix.rust }})
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
rust: ["1.88.0", "1.95.0", stable]
env:
INTERVAL_RUST: ${{ matrix.rust }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install toolchain
run: rustup toolchain install "$INTERVAL_RUST" --profile minimal --component clippy
- name: Check unqualified ingress and qualified endpoint bits
run: |
cargo +"$INTERVAL_RUST" test --release --locked -p hyperinterval --features float-enclosure --test float target_gate_and_empty_are_explicit
cargo +"$INTERVAL_RUST" test --release --locked -p hyperinterval --features float-enclosure-aarch64-linux-gnu,dyadic,serde --test float --test float_format --test dyadic_float_egress
if [ "$INTERVAL_RUST" != 1.88.0 ]; then
cargo +"$INTERVAL_RUST" test --release --locked -p hyperinterval --features float-enclosure-aarch64-linux-gnu,hyperreal --test rational_float_projection
fi
cargo +"$INTERVAL_RUST" test --release --locked -p hyperlattice-interval --features fixed,float-enclosure-aarch64-linux-gnu --test cartesian --test affine --test no_alloc
cargo +"$INTERVAL_RUST" clippy --release --locked -p hyperinterval --all-targets --features float-enclosure-aarch64-linux-gnu,dyadic,serde -- -D warnings
python3 scripts/check_interval_float_codegen.py --toolchain "$INTERVAL_RUST" --output "$RUNNER_TEMP/interval-arm-codegen"
scalar-wasi:
name: Scalar oracles (WASI Preview 1, Rust ${{ matrix.rust }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
rust: ["1.88.0", "1.95.0", stable]
env:
INTERVAL_RUST: ${{ matrix.rust }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Execute scalar and MPFR oracles
run: |
rustup toolchain install "$INTERVAL_RUST" --profile minimal --target wasm32-wasip1
sudo apt-get update
sudo apt-get install --no-install-recommends -y clang-18 lld-18 libclang-rt-18-dev-wasm32 wasi-libc nodejs
python3 crates/hyperinterval/conformance/wasi-tests.py --toolchain "$INTERVAL_RUST" --cc /usr/bin/clang-18 --sysroot /usr --output "$RUNNER_TEMP/interval-scalar-wasi"
portable:
name: no_std (${{ matrix.target }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [wasm32-unknown-unknown, thumbv7em-none-eabihf]
env:
INTERVAL_TARGET: ${{ matrix.target }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install minimum compiler and target
run: rustup toolchain install 1.88.0 --profile minimal --target "$INTERVAL_TARGET"
- name: Build primitive and allocation-enabled no_std subsets
run: |
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features integer,fixed
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features integer,fixed,serde
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features dyadic,serde
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features fixed,dyadic
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features float-proposal,serde
cargo +1.88.0 check --locked -p hyperinterval --target "$INTERVAL_TARGET" --no-default-features --features float-enclosure,serde
sanitizer:
name: Bounded ASan interval campaigns
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: crates/hyperinterval
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install sanitizer toolchain and driver
run: |
rustup toolchain install nightly --profile minimal
cargo install cargo-fuzz --version 0.13.2 --locked
- name: Run constructor and arithmetic campaigns
run: |
mkdir -p "$RUNNER_TEMP/interval-constructors" "$RUNNER_TEMP/interval-arithmetic" "$RUNNER_TEMP/interval-dyadic" "$RUNNER_TEMP/interval-proposals" "$RUNNER_TEMP/interval-strict-float"
mkdir -p "$RUNNER_TEMP/interval-rational-powers" "$RUNNER_TEMP/interval-square-roots" "$RUNNER_TEMP/interval-primitive-roots" "$RUNNER_TEMP/interval-exponential" "$RUNNER_TEMP/interval-logarithm" "$RUNNER_TEMP/interval-arctangent" "$RUNNER_TEMP/interval-trigonometry" "$RUNNER_TEMP/interval-split-division" "$RUNNER_TEMP/interval-fractional-power" "$RUNNER_TEMP/interval-tangent"
cargo +nightly fuzz run constructors "$RUNNER_TEMP/interval-constructors" -- -runs=10000 -max_len=1024 -max_total_time=30 -seed=20261112
cargo +nightly fuzz run fixed_arithmetic "$RUNNER_TEMP/interval-arithmetic" -- -runs=100000 -max_len=32 -max_total_time=30 -seed=20261112
cargo +nightly fuzz run dyadic_arithmetic "$RUNNER_TEMP/interval-dyadic" -- -runs=100000 -max_len=14 -max_total_time=30 -seed=20261112
cargo +nightly fuzz run primitive_proposals "$RUNNER_TEMP/interval-proposals" -- -runs=100000 -max_len=32 -max_total_time=30 -seed=20261113
cargo +nightly fuzz run strict_float "$RUNNER_TEMP/interval-strict-float" -- -runs=100000 -max_len=32 -max_total_time=30 -seed=20261114
cargo +nightly fuzz run rational_powers --features rational "$RUNNER_TEMP/interval-rational-powers" -- -runs=100000 -max_len=10 -max_total_time=30 -seed=20261115
cargo +nightly fuzz run square_roots --features rational "$RUNNER_TEMP/interval-square-roots" -- -runs=100000 -max_len=10 -max_total_time=30 -seed=20261116
cargo +nightly fuzz run primitive_roots "$RUNNER_TEMP/interval-primitive-roots" -- -runs=100000 -max_len=16 -max_total_time=30 -seed=20261117
cargo +nightly fuzz run exponential --features rational "$RUNNER_TEMP/interval-exponential" -- -runs=10000 -max_len=8 -max_total_time=30 -seed=20261118
cargo +nightly fuzz run logarithm --features rational "$RUNNER_TEMP/interval-logarithm" -- -runs=10000 -max_len=8 -max_total_time=30 -seed=20261119
cargo +nightly fuzz run arctangent --features rational "$RUNNER_TEMP/interval-arctangent" -- -runs=10000 -max_len=8 -max_total_time=30 -seed=20261120
cargo +nightly fuzz run trigonometry --features rational "$RUNNER_TEMP/interval-trigonometry" -- -runs=10000 -max_len=8 -max_total_time=30 -seed=20261121
cargo +nightly fuzz run split_division "$RUNNER_TEMP/interval-split-division" -- -runs=100000 -max_len=16 -max_total_time=30 -seed=20261122
cargo +nightly fuzz run fractional_power "$RUNNER_TEMP/interval-fractional-power" --features rational -- -runs=10000 -max_len=12 -max_total_time=30 -seed=20261123
cargo +nightly fuzz run tangent --features rational "$RUNNER_TEMP/interval-tangent" -- -runs=10000 -max_len=8 -max_total_time=120 -seed=20261124
mkdir -p "$RUNNER_TEMP/interval-conversions"
cargo +nightly fuzz run conversions --features rational "$RUNNER_TEMP/interval-conversions" -- -runs=100000 -max_len=64 -max_total_time=30 -seed=20261125
mkdir -p "$RUNNER_TEMP/interval-atanh"
cargo +nightly fuzz run atanh "$RUNNER_TEMP/interval-atanh" -- -runs=10000 -max_len=8 -max_total_time=30 -seed=20261126
mkdir -p "$RUNNER_TEMP/interval-integer-affine"
cargo +nightly fuzz run integer_affine "$RUNNER_TEMP/interval-integer-affine" -- -runs=100000 -max_len=64 -max_total_time=30 -seed=20261127
mkdir -p "$RUNNER_TEMP/interval-cartesian-shapes"
cp ../hyperlattice-interval/tests/fixtures/shapes/*.bin "$RUNNER_TEMP/interval-cartesian-shapes/"
cargo +nightly fuzz run cartesian_shapes --features lattice-shapes "$RUNNER_TEMP/interval-cartesian-shapes" -- -runs=10000 -max_len=532 -max_total_time=60 -seed=20261128