Skip to content

Commit c1d9522

Browse files
committed
SLOTHY: Add CI that runs the optimization in CI
Signed-off-by: Matthias J. Kannwischer <[email protected]>
1 parent 2a55d69 commit c1d9522

File tree

3 files changed

+55
-10
lines changed

3 files changed

+55
-10
lines changed

.github/workflows/all.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
needs: [ base, nix ]
6666
uses: ./.github/workflows/ct-tests.yml
6767
secrets: inherit
68+
slothy:
69+
name: SLOTHY
70+
permissions:
71+
contents: 'read'
72+
id-token: 'write'
73+
needs: [ base, nix ]
74+
uses: ./.github/workflows/slothy.yml
75+
secrets: inherit
6876
baremetal:
6977
name: Baremetal
7078
permissions:

.github/workflows/ci_ec2_reusable.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,24 @@ jobs:
192192
nix-verbose: ${{ inputs.verbose }}
193193
mldsa_parameter_set: ${{ inputs.cbmc_mldsa_parameter_set }}
194194
gh_token: ${{ secrets.AWS_GITHUB_TOKEN }}
195-
# - name: SLOTHY
196-
# if: ${{ inputs.slothy }}
197-
# uses: ./.github/actions/setup-shell
198-
# with:
199-
# gh_token: ${{ secrets.AWS_GITHUB_TOKEN }}
200-
# nix-cache: true
201-
# nix-shell: ci-slothy
202-
# script: |
203-
# autogen --slothy
204-
# tests all --opt opt
195+
- name: SLOTHY
196+
if: ${{ inputs.slothy }}
197+
uses: ./.github/actions/setup-shell
198+
with:
199+
gh_token: ${{ secrets.AWS_GITHUB_TOKEN }}
200+
nix-cache: true
201+
nix-shell: ci-slothy
202+
script: |
203+
autogen --slothy
204+
tests all --opt opt
205+
# Force testing of SLOTHY-optimized Keccak variants
206+
# We can't run the examples here because some of them also specify the backend
207+
make clean
208+
tests all --no-examples --opt opt --cflags="-DMLD_CONFIG_FIPS202_BACKEND_FILE=\\\"fips202/native/aarch64/x1_scalar.h\\\""
209+
make clean
210+
tests all --no-examples --opt opt --cflags="-DMLD_CONFIG_FIPS202_BACKEND_FILE=\\\"fips202/native/aarch64/x4_v8a_scalar.h\\\""
211+
make clean
212+
tests all --no-examples --opt opt --cflags="-march=armv8.4-a+sha3 -DMLD_CONFIG_FIPS202_BACKEND_FILE=\\\"fips202/native/aarch64/x4_v8a_v84a_scalar.h\\\""
205213
stop-ec2-runner:
206214
name: Stop instance (${{ inputs.ec2_instance_type }})
207215
permissions:

.github/workflows/slothy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) The mlkem-native project authors
2+
# Copyright (c) The mldsa-native project authors
3+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4+
5+
name: SLOTHY re-optimization tests
6+
permissions:
7+
contents: read
8+
on:
9+
workflow_call:
10+
workflow_dispatch:
11+
12+
jobs:
13+
slothy:
14+
name: SLOTHY
15+
if: ${{ github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork }}
16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
uses: ./.github/workflows/ci_ec2_reusable.yml
20+
with:
21+
name: SLOTHY
22+
ec2_instance_type: c8g.8xlarge
23+
ec2_ami: ubuntu-latest (aarch64)
24+
ec2_volume_size: 20
25+
lint: false
26+
test: false
27+
cbmc: false
28+
slothy: true
29+
secrets: inherit

0 commit comments

Comments
 (0)