Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/vardiff-sim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: vardiff_sim

on:
pull_request:
branches:
- main
paths:
- 'sv2/channels-sv2/sim/**'
- 'sv2/channels-sv2/src/vardiff/**'
- 'sv2/channels-sv2/src/target.rs'
- '.github/workflows/vardiff-sim.yaml'

jobs:
# Fast tests in the sim crate. Always run.
test-fast:
name: cargo test --lib
runs-on: ubuntu-latest
defaults:
run:
working-directory: sv2/channels-sv2/sim

steps:
- uses: actions/checkout@v4

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
id: toolchain

# The repo root's `rust-toolchain.toml` pins 1.75, but the sim
# crate's Cargo.lock is v4 format (needs newer rustup). Override
# explicitly so the sim crate gets the stable toolchain.
- name: Override toolchain
run: rustup override set ${{ steps.toolchain.outputs.name }}
working-directory: sv2/channels-sv2/sim

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
sv2/channels-sv2/sim/target
key: ${{ runner.os }}-vardiff-sim-${{ hashFiles('sv2/channels-sv2/sim/Cargo.lock') }}

- name: Build sim crate
run: cargo build --release --verbose

- name: Fast unit tests
run: cargo test --lib --verbose

# Slow regression check: `cargo test --release --lib -- --ignored` runs the
# three drift guards (~35s total), each with CI-aware tolerance budgets:
# - classic_algorithm_no_regression — the classic comparison anchor
# (baseline_classic.toml).
# - champion_algorithm_no_regression — the SHIPPED champion's typical-
# behavior grid (baseline_champion.toml).
# - champion_clears_decline_gate — the champion's decline-safety MARGIN
# (its selection criterion; not covered by the grid baselines).
test-regression:
name: regression vs checked-in baseline
runs-on: ubuntu-latest
defaults:
run:
working-directory: sv2/channels-sv2/sim

steps:
- uses: actions/checkout@v4

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
id: toolchain

# The repo root's `rust-toolchain.toml` pins 1.75, but the sim
# crate's Cargo.lock is v4 format (needs newer rustup). Override
# explicitly so the sim crate gets the stable toolchain.
- name: Override toolchain
run: rustup override set ${{ steps.toolchain.outputs.name }}
working-directory: sv2/channels-sv2/sim

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
sv2/channels-sv2/sim/target
key: ${{ runner.os }}-vardiff-sim-regression-${{ hashFiles('sv2/channels-sv2/sim/Cargo.lock') }}

- name: Slow regression test
run: cargo test --release --lib -- --ignored

# Verify that the binaries still build (compare-algorithms,
# generate-baseline, trace-trial, sweep-ewma-tau). Doesn't run them
# (full sweep takes ~150s).
build-binaries:
name: cargo build --release (all bins)
runs-on: ubuntu-latest
defaults:
run:
working-directory: sv2/channels-sv2/sim

steps:
- uses: actions/checkout@v4

- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
id: toolchain

# The repo root's `rust-toolchain.toml` pins 1.75, but the sim
# crate's Cargo.lock is v4 format (needs newer rustup). Override
# explicitly so the sim crate gets the stable toolchain.
- name: Override toolchain
run: rustup override set ${{ steps.toolchain.outputs.name }}
working-directory: sv2/channels-sv2/sim

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
sv2/channels-sv2/sim/target
key: ${{ runner.os }}-vardiff-sim-bins-${{ hashFiles('sv2/channels-sv2/sim/Cargo.lock') }}

- name: Build all binaries
run: cargo build --release --bins --verbose
46 changes: 46 additions & 0 deletions sv2/channels-sv2/sim/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Build artifacts (sim is its own Cargo workspace; root .gitignore
# covers the parent workspace's target/, this entry covers ours).
/target

# macOS finder noise
.DS_Store

# Editor swap files
*.swp
*.swo
*~

# Locally generated reports & traces — regenerate via `cargo run`, no
# need to track. The checked-in baselines are explicitly named.
/trace-*.txt
/scratch-*
# Sweep/comparison reports and charts (regenerate via the sweep / radar
# / trajectory bins; the analysis lives in commit messages / docs, not
# the raw output files).
/*_sweep.md
/*_sweep_big.md
/confirm_*.md
/champion_weights.md
/eta_sweep.md
/eta_z_joint_sweep.md
/iterative_eval.md
/pareto.md
/*.svg
/docs/*.svg
/compare_out*/
/sweep_out/

# Cross-algorithm comparison baselines are regenerated on demand by
# `compare-algorithms` (that binary is their archive). Only the two CI
# regression fixtures are tracked; ignore every other baseline_* so a
# comparison run does not re-stage the bulky frozen snapshots that used
# to be force-added here.
/baseline_*.toml
/baseline_*.md
!/baseline_classic.toml
!/baseline_classic.md
!/baseline_champion.toml
!/baseline_champion.md

# Optional: cargo-semver-checks scratch directory
.semver-checks/
Loading
Loading