Determinism (arm64 + wasm32) #1
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
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| # Cross-platform determinism check: x86_64 vs arm64. | |
| # | |
| # The committed insta snapshots in rust/geometry/tests/snapshots/ were | |
| # generated on x86_64 and pin rounded per-fixture mesh stats (mesh count, | |
| # vertex/triangle totals, bbox, surface area, per-type counts). Running the | |
| # SAME harness on GitHub's free arm64 runner and asserting the SAME | |
| # byte-identical snapshots IS the determinism check — no arm-specific test | |
| # code exists or is needed. A snapshot mismatch here means the geometry | |
| # kernel produced platform-dependent output (a real bug — likely an exact- | |
| # predicate or float-ordering regression), not flake. | |
| # | |
| # Cost: deliberately NOT a per-PR job. `ubuntu-24.04-arm` GitHub-hosted | |
| # runners are free for public repos, so a weekly schedule costs wall-clock | |
| # only. `workflow_dispatch` lets us run it on demand before merging | |
| # kernel-sensitive changes (CSG, exact predicates, triangulation order). | |
| name: Determinism (arm64) | |
| on: | |
| schedule: | |
| # Weekly, Monday 03:17 UTC — off-peak, minute offset avoids the | |
| # top-of-the-hour scheduler pileup that delays/drops cron runs. | |
| - cron: '17 3 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| arm64-determinism: | |
| name: arm64 mesh-stat parity vs committed x86_64 snapshots | |
| # Free GitHub-hosted arm64 runner (public repo). NOT Depot — this job is | |
| # weekly + non-blocking, so slow cold builds are fine and cost nothing. | |
| runs-on: ubuntu-24.04-arm | |
| # Generous: a cold cargo build (incl. the Manifold/Clipper2 C++ kernel | |
| # via cmake) on arm takes ~15-25 min before the cache warms up. | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| lfs: false | |
| persist-credentials: false | |
| - name: Setup Rust (pinned by rust-toolchain.toml) | |
| run: rustup show | |
| - name: Cargo cache | |
| # Swatinem on the free GitHub cache (10 GB LRU) — acceptable for a | |
| # weekly job; only per-PR Rust jobs justify Depot's uncapped cache. | |
| uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 | |
| with: | |
| prefix-key: ci-arm64-determinism | |
| # node + pnpm only for the fixture fetch script (`pnpm fixtures`); | |
| # no `pnpm install` needed — the script has no npm deps. | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| - name: Cache test fixtures | |
| id: fixtures-cache | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: tests/models | |
| # Arch-specific suffix keeps this key out of the x86_64 jobs' | |
| # cache namespace (`ci-fixtures-Linux-…` in test.yml). | |
| key: ci-fixtures-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('tests/models/manifest.json') }} | |
| - name: Fetch fixtures | |
| if: steps.fixtures-cache.outputs.cache-hit != 'true' | |
| run: pnpm fixtures | |
| # exact_predicate_determinism pins exact-predicate signs across | |
| # platforms; geometry_correctness_harness asserts the committed | |
| # x86_64-generated .snap files byte-for-byte against the pure-Rust | |
| # exact kernel (the only CSG kernel since M9). | |
| - name: Determinism tests (exact predicates + snapshot parity) | |
| run: cargo test -p ifc-lite-geometry --test exact_predicate_determinism --test geometry_correctness_harness |