RecipeStablesince v0.9.2

CI/CD integration

Gate a pull request on a fingerprint match against a reference artifact — a five-minute recipe with a real GitHub Actions workflow.

Audience: Teams shipping modelsRead: 7 min

A reference artifact lives in your repository (via git-LFS or a cloud bucket). Every PR re-records the same experiment and asserts a fingerprint match. When the two disagree, the job fails with a structured diff — never a mystery.

Goal

Fail the PR when a change to the model, the training script, or the pinned dependencies would silently alter recorded activations.

The workflow

.github/workflows/neuronscope.yml·
·yaml
name: neuronscope-gate
on: [pull_request]
jobs:
gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install "neuronscope[torch]==0.9.2" -r requirements.txt
- run: python scripts/record_reference.py --out current.nsz
- run: ns compare tests/fixtures/reference.nsz current.nsz --strict

Assertions

  1. ns compare --strict exits non-zero on any diff above the metric's noise floor.
  2. For per-layer thresholds, use ns compare --report compare.md and post the file as a PR comment.
  3. To assert exactly-equal artifacts (bit-identical bytes on the same CPU/GPU), pass --bit-exact.

Operational notes

Related