Rework readme and website #927
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: test | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.svg' | |
| - '**/*.html' | |
| - '.work/**' | |
| - 'LICENSE' | |
| - 'CONTRIBUTING.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.svg' | |
| - '**/*.html' | |
| - '.work/**' | |
| - 'LICENSE' | |
| - 'CONTRIBUTING.md' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Core suite under every compiler configuration: default = level 2, | |
| # opt0/opt3 the level extremes, wasi the standalone host. Level- and | |
| # host-specific assertions are guarded by belowOpt()/onWasi() in | |
| # test/_matrix.js, so all legs are green — a miscompile that only surfaces | |
| # at opt0 or under wasi is caught in CI, not just locally. opt1 (light size | |
| # passes only) is omitted as low-signal between opt0 and opt2 — the fuzz | |
| # job below still exercises opt1 numerically; `npm run test:opt1` runs it | |
| # ad-hoc. | |
| variant: [default, opt0, opt3, wasi] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: npm install | |
| - name: test (${{ matrix.variant }}) | |
| run: | | |
| case "${{ matrix.variant }}" in | |
| default) npm test ;; | |
| opt0) npm run test:opt0 ;; | |
| opt3) npm run test:opt3 ;; | |
| wasi) npm run test:wasi ;; | |
| esac | |
| # Smoke test: every example still compiles. Output wasm is built + deployed by | |
| # pages.yml (not committed), so there's no drift gate — just confirm they build. | |
| - run: npm run build:examples | |
| if: matrix.variant == 'default' | |
| # Extended differential fuzz: `npm test`'s in-suite `fuzz` test gates only seeds | |
| # 1..200; this runs the full 5000-seed pass (jz-wasm vs JS at opt {0,1,2,3}, | |
| # contract-aware oracle that skips inputs exceeding jz's documented i32 range, | |
| # shrinking on mismatch) so a miscompile on a shape the curated suite misses is | |
| # caught in CI. ~4 min. | |
| fuzz: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: npm install | |
| # JZ_DEBUG_INVARIANTS=1 turns on the per-phase structural checks (ctx | |
| # invariants + verifyFn on optimizer output) so a malformed-IR bug surfaces | |
| # as a localized "[ir verify] … in $fn: duplicate local $x" here instead of | |
| # an opaque watr error. ~free on this job; not on by default (no per-compile | |
| # tax for library users — watr is the production backstop). | |
| - run: npm run test:fuzz | |
| env: | |
| JZ_DEBUG_INVARIANTS: '1' | |
| # Committed-evidence claims gate (audit 2026-07-27: wired to CI, not only | |
| # prepublishOnly). HONESTLY RED until the reference dataset is fresh, | |
| # complete (every rival contested), and winning (strict + band) — the red is | |
| # the point: the claim cannot silently regress or silently ship. | |
| claims: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: npm install | |
| - run: node test/bench-claims.js |