fix(ontos): ONT-019 - bare contact mode gates both static pair orient… #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |