ruvector/.github/workflows/thermorust-ci.yml
Claude f48e0d0165 feat(thermorust): add thermodynamic neural-motif crate
Implements energy-driven computation with Landauer dissipation and
Langevin/Metropolis noise.  Key components:

- State: activation vector + cumulative dissipated-joules counter
- EnergyModel trait + Ising (Hopfield) + SoftSpin (double-well) Hamiltonians
- Couplings: zeros, ferromagnetic ring, Hopfield memory factories
- Params: inverse temperature β, Langevin step η, Landauer cost per irreversible flip
- step_discrete: Metropolis-Hastings spin-flip with Boltzmann acceptance
- step_continuous: overdamped Langevin (central-difference gradient + FDT noise)
- anneal_discrete / anneal_continuous: traced annealing helpers
- inject_spikes: Poisson kick noise, clamp-aware
- Metrics: magnetisation, Hopfield overlap, binary entropy, free energy, Trace
- Motifs: IsingMotif (ring, fully-connected, Hopfield), SoftSpinMotif (random)
- 19 correctness tests: energy invariants, Metropolis, Langevin, Hopfield retrieval
- 4 Criterion benchmark groups: step, 10k-anneal, Langevin, energy eval
- GitHub Actions CI: fmt + clippy + test (ubuntu/macos/windows) + bench compile

https://claude.ai/code/session_019Lt11HYsW1265X7jB7haoC
2026-02-27 14:22:44 +00:00

62 lines
1.5 KiB
YAML

name: thermorust CI
on:
push:
paths:
- "crates/thermorust/**"
- ".github/workflows/thermorust-ci.yml"
pull_request:
paths:
- "crates/thermorust/**"
- ".github/workflows/thermorust-ci.yml"
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-thermorust-${{ hashFiles('crates/thermorust/Cargo.toml') }}
restore-keys: ${{ runner.os }}-cargo-thermorust-
- name: Check formatting
run: cargo fmt --package thermorust -- --check
- name: Clippy
run: cargo clippy --package thermorust --all-targets -- -D warnings
- name: Build
run: cargo build --package thermorust
- name: Run tests
run: cargo test --package thermorust
bench-check:
name: Benchmarks compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check benchmarks compile
run: cargo bench --package thermorust --no-run