egglog 3.0.0

egglog is a language that combines the benefits of equality saturation and datalog. It can be used for analysis, optimization, and synthesis of programs. It is the successor to the popular rust library egg.
Documentation
name: Build

on:
  push:
    branches:
      - "main"
  pull_request:
  issue_comment:
    types: [created]
  workflow_dispatch:
jobs:
  test:
    if: github.event_name != 'issue_comment'
    runs-on: ubuntu-latest
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v3
      - uses: taiki-e/install-action@v2
        with:
          tool: nextest,cargo-insta
      - uses: Swatinem/rust-cache@v2
      - run: make test
  # Build the library the way downstream crates consume it: no default
  # features (so `clap`/`clap_derive` are absent). This guards against
  # relying on another crate to unify a `syn` feature onto ours — the bug
  # that broke downstream builds when clap_derive moved to syn 3.x.
  no-default-features:
    if: github.event_name != 'issue_comment'
    runs-on: ubuntu-latest
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v3
      - uses: Swatinem/rust-cache@v2
      - run: cargo check -p egglog --no-default-features --lib
  coverage:
    if: github.event_name != 'issue_comment'
    runs-on: ubuntu-latest
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v3
      - uses: taiki-e/install-action@v2
        with:
          tool: nextest,cargo-llvm-cov
      - uses: Swatinem/rust-cache@v2
      - run: make coverage
      - uses: codecov/codecov-action@v7
        with:
          files: lcov.info
          fail_ci_if_error: true
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  nits:
    if: github.event_name != 'issue_comment'
    runs-on: ubuntu-latest
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v3
      - uses: Swatinem/rust-cache@v2
      - run: make nits
  benchmark:
    if: |
      github.event_name != 'issue_comment' ||
      (
        github.event.issue.pull_request &&
        contains(github.event.comment.body, '@codspeed walltime') &&
        (
          github.event.comment.author_association == 'OWNER' ||
          github.event.comment.author_association == 'MEMBER' ||
          github.event.comment.author_association == 'COLLABORATOR'
        )
      )
    permissions:
      contents: read
      id-token: write # OIDC auth for CodSpeed
    runs-on: ${{ matrix.runner }}
    strategy:
      matrix:
        runner: ${{ fromJSON(github.event_name == 'push' && '["codspeed-macro", "ubuntu-latest"]' || github.event_name == 'issue_comment' && '["codspeed-macro"]' || '["ubuntu-latest"]') }}
        benchmark:
          - math-microbenchmark
          - cykjson
          - eggcc-extraction
          - extract-vec-bench
          - herbie
          - python_array_optimize
          - repro-665-set-union
          - stresstest_large_expr
          - typeinfer
          - taylor51
          - luminal-llama
          - conv1d_32
          - conv1d_128
          - rectangle
          - proof_testing_eqsat-basic
          - proof_testing_unify
          - proof_testing_typecheck
          - eggcc-2mm
          - rust_rule_fib
          - rust_rule_match_overhead
          - rust_rule_match_with_serialize
          - rust_rule_insert_loop
          - rust_rule_tableaction_hot_path
          - factoring-multisets
          # CodSpeed filters by substring; `math` would also run
          # `math-microbenchmark` and `proof_testing_math`.
          - math_normal
          - proof_testing_math
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || github.ref }}
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-codspeed@4.0.1
      - uses: Swatinem/rust-cache@v2
      - run: cargo codspeed build
      - uses: CodSpeedHQ/action@v4
        with:
          run: cargo codspeed run ${{ matrix.benchmark }}
          mode: ${{ matrix.runner == 'ubuntu-latest' && 'simulation' || 'walltime' }}
  wasm:
    if: github.event_name != 'issue_comment'
    runs-on: ubuntu-latest
    steps:
      - run: echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
      - uses: actions/checkout@v4
      - uses: taiki-e/install-action@v2
        with:
          tool: wasm-pack
      - uses: Swatinem/rust-cache@v2
      - run: make test
        working-directory: wasm-example