-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (106 loc) · 5.96 KB
/
Copy pathci.yml
File metadata and controls
110 lines (106 loc) · 5.96 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
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ["3.11", "3.13"]
exclude:
- os: macos-14
python-version: "3.11"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install numpy pytest
- name: Run test suite (optional-engine deps excluded)
run: |
PYTHONPATH=src python -m pytest tests/ -q \
--ignore=tests/test_md_multiformat.py \
--deselect tests/test_afold.py::test_fetch_plddt_real
cross-verify:
runs-on: ubuntu-latest
name: verify ontos-generated streams with this oracle
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: usestemframework/ontos
path: ontos
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build ontos and verify its streams
run: |
set -e
cargo build --release --manifest-path ontos/Cargo.toml
ontos=ontos/target/release/ontos
verify() {
$ontos --ticks "$1" --seed "$2" "${@:3}" --out /tmp/case.stream
PYTHONPATH=src python -m simval.ontos /tmp/case.stream "$2" --ticks "$1" "${@:3}"
}
verify_ic() {
ic="$1"; t="$2"; s="$3"; shift 3
$ontos --ticks "$t" --seed "$s" "$@" --test-ic "$ic" --out /tmp/case.stream
PYTHONPATH=src python -m simval.ontos /tmp/case.stream "$s" --test-ic "$ic" --ticks "$t" "$@"
}
verify 64 42
verify 64 42 --demote 1 0
verify 200 7 --demote 1 0 --demote 0 1 --promote 1 0
verify 100 42 --mode gravity --bodies 8
verify 120 42 --mode gravity --bodies 8 --demote-at 20 0 0 --promote-at 80 0 0
verify 150 3 --mode gravity --bodies 10 --demote-at 10 0 1 --demote-at 40 0 1 --promote-at 100 0 1
verify 300 5 --mode gravity --bodies 10 --observer 777
verify 200 11 --mode gravity --bodies 10 --collapse-at 30 1 1 --expand-at 120 1 1
verify 240 17 --mode gravity --bodies 12 --collapse-at 20 0 0 --expand-at 90 0 0 --collapse-at 91 0 0 --expand-at 160 0 0 --collapse-at 40 1 1 --expand-at 120 1 1 --demote-at 60 0 1
verify 400 11 --mode gravity --bodies 32 --contacts
verify 400 11 --mode gravity --bodies 32 --contacts --collapse-at 100 0 0 --expand-at 250 0 0
verify 300 7 --mode gravity --bodies 24 --contacts --demote-at 50 1 1 --promote-at 150 1 1
verify 240 17 --mode gravity --bodies 12 --collapse-at 20 0 0 --expand-at 90 0 0 --collapse-at 91 0 0 --expand-at 160 0 0 --collapse-at 40 1 1 --expand-at 120 1 1 --demote-at 60 0 1 --radial
verify 240 17 --mode gravity --bodies 12 --collapse-at 20 0 0 --expand-at 90 0 0 --collapse-at 91 0 0 --expand-at 160 0 0 --collapse-at 40 1 1 --expand-at 120 1 1 --demote-at 60 0 1 --shells
verify 200 11 --mode gravity --bodies 10 --collapse-at 30 1 1 --expand-at 120 1 1 --radial
verify 150 3 --mode gravity --bodies 10 --demote-at 10 0 1 --collapse-at 30 0 1 --expand-at 100 0 1
verify 200 23 --mode gravity --bodies 10 --demote-at 20 1 1 --collapse-at 35 1 1 --expand-at 100 1 1
verify 150 3 --mode gravity --bodies 10 --demote-at 10 0 1 --collapse-at 30 0 1 --expand-at 100 0 1 --shells
verify 600 22 --mode gravity --bodies 24 --contacts --walls --collapse-at 5 0 1 --expand-at 200 0 1 --collapse-at 260 0 1
verify 400 11 --mode gravity --bodies 32 --contacts --restitution 0.5 --friction 0.25
verify 300 13 --mode gravity --bodies 16 --contacts --walls --restitution 0.8 --friction 0.1
verify_ic wallshot 800 3 --mode gravity --contacts --walls --restitution 0.7 --friction 0.3 --bodies 16
verify_ic coarsehit 500 11 --mode gravity --contacts --restitution 0.5 --friction 0.25 --demote-at 1 1 1 --bodies 8
- name: Cross-check modal audio (spec section 22)
run: |
set -e
LINE=$(ontos/target/release/ontos --mode gravity --contacts --ticks 400 --seed 11 --bodies 32 --out /tmp/contact.stream --wav /tmp/contact.wav)
echo "$LINE"
HASH=$(echo "$LINE" | grep -o 'audio=[0-9a-f]*' | cut -d= -f2)
PYTHONPATH=src python3 -m simval.ontos_audio /tmp/contact.stream --wav /tmp/ref.wav --expect "$HASH"
cmp /tmp/contact.wav /tmp/ref.wav
LINE=$(ontos/target/release/ontos --mode gravity --contacts --walls --ticks 600 --seed 22 --bodies 24 --collapse-at 5 0 1 --expand-at 200 0 1 --collapse-at 260 0 1 --out /tmp/walls.stream --wav /tmp/walls.wav)
echo "$LINE"
HASH=$(echo "$LINE" | grep -o 'audio=[0-9a-f]*' | cut -d= -f2)
PYTHONPATH=src python3 -m simval.ontos_audio /tmp/walls.stream --wav /tmp/ref_walls.wav --expect "$HASH"
cmp /tmp/walls.wav /tmp/ref_walls.wav
LINE=$(ontos/target/release/ontos --mode gravity --contacts --walls --restitution 0.7 --friction 0.3 --ticks 800 --seed 3 --bodies 16 --test-ic wallshot --out /tmp/wallshot.stream --wav /tmp/wallshot.wav)
echo "$LINE"
HASH=$(echo "$LINE" | grep -o 'audio=[0-9a-f]*' | cut -d= -f2)
PYTHONPATH=src python3 -m simval.ontos_audio /tmp/wallshot.stream --wav /tmp/ref_wallshot.wav --expect "$HASH"
cmp /tmp/wallshot.wav /tmp/ref_wallshot.wav
rebound-anchor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install numpy pytest "rebound>=3.27"
- name: REBOUND anchor check against ontos-generated streams
run: |
PYTHONPATH=src python -m pytest tests/test_ontos_gravity.py -q -p no:cacheprovider -k "rebound"