Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
3bfbc68
Part 4 session 4: symbolic expression trees
claude Aug 24, 2026
518ac9b
Part 4 session 5: primes, sieves, factorization and prime counting
claude Aug 24, 2026
f9c213e
Part 4 session 5: elementary and analytic number theory
claude Aug 24, 2026
e13d106
Fix verify.yml: invalid YAML and contradictory clippy flags
claude Aug 24, 2026
5c2a88a
Part 4 session 6: counting, partitions, sequences, and union-find
claude Aug 24, 2026
83b5f6c
Stop Miri failing on float exactness, and bound both slow jobs
claude Aug 24, 2026
7347664
Part 4 session 7: graphs, shortest paths, spanning trees and tours
claude Aug 24, 2026
c12c8a7
Address the review findings on the discrete and symbolic code
claude Aug 24, 2026
5b6729e
Fix an unwind bound that made a Kani harness fail from the start
claude Aug 24, 2026
168eeb2
Part 4 session 8: network flow and matchings
claude Aug 24, 2026
0cf7bd0
Make the Kani job green by measuring every harness
claude Aug 24, 2026
c5039ca
graph: spectral graph theory, centrality, and community detection
claude Aug 24, 2026
ed3ffb0
graph: colouring, cliques, independent sets, and covers
claude Aug 24, 2026
f7c3cca
graph: layout, drawing, and planarity
claude Aug 24, 2026
91feb16
tests: cross-module properties for graph structure
claude Aug 24, 2026
f24927c
codes: checksums and check digits
claude Aug 24, 2026
f1576bc
codes: binary linear block codes
claude Aug 24, 2026
4ae7133
codes: Reed-Solomon, BCH, convolutional and turbo codes
claude Aug 24, 2026
0707fe5
codes: compression, and the arithmetic under public-key cryptography
claude Aug 24, 2026
c1be69b
stochastic: finite Markov chains and Markov chain Monte Carlo
claude Aug 24, 2026
a306579
stochastic: hidden Markov models, smoothing, and particle filters
claude Aug 24, 2026
5691a87
stochastic: stochastic differential equations and point processes
claude Aug 24, 2026
3df1fd6
ci: anchor the Miri filter to the top-level core module
claude Aug 24, 2026
e517a64
stochastic: queueing theory and time series analysis
claude Aug 25, 2026
59b42e5
stochastic: random matrix ensembles and extreme value theory
claude Aug 25, 2026
b618205
optimization: linear programming
claude Aug 25, 2026
49af7a3
optimization: integer programming, network models, and a Miri fix
claude Aug 25, 2026
60f170d
optimization: use the stable bit idiom so Kani can still build
claude Aug 25, 2026
1fdc1ad
optimization: population and direct-search methods
claude Aug 25, 2026
b7d670b
optimization: convex methods and continuous-optimisation properties
claude Aug 25, 2026
0284b11
optimization: game theory
claude Aug 25, 2026
0ccfac4
quantum: wavefunctions and the Schrodinger solvers
claude Aug 25, 2026
4cda87d
quantum: circuit simulator and algorithms
claude Aug 25, 2026
fd29ea8
quantum: spin chains, magnetic resonance, and solid state
claude Aug 25, 2026
94637d6
statmech: Ising family, lattice models, and their property tests
claude Aug 25, 2026
34e016e
statmech: molecular dynamics, and the property tests for it
claude Aug 25, 2026
43a0bc0
statmech: chemical kinetics, and the property tests for it
claude Aug 25, 2026
52a1125
bio: epidemic models, network spread, and estimation from case data
claude Aug 25, 2026
936bbac
bio: population dynamics and population genetics
claude Aug 25, 2026
3729ad2
bio: sequence alignment and sequence analysis
claude Aug 25, 2026
25e8643
bio: phylogenetic trees, distance and character methods
claude Aug 25, 2026
468c93b
bio: neurons, spike trains, synapses and the networks they make
claude Aug 25, 2026
b44b14c
finance: option pricing by closed form, lattice, simulation and PDE
claude Aug 25, 2026
a7b8a17
finance: discounting, bonds, curves and short-rate models
claude Aug 25, 2026
a1de02c
finance: portfolio construction and risk measurement
claude Aug 25, 2026
4393890
astro: Kepler's equation, anomalies and two-body propagation
claude Aug 25, 2026
bf1218d
astro: Lambert's problem, porkchop grids and orbital manoeuvres
claude Aug 25, 2026
f68ae09
astro: time systems, coordinate frames and low-precision ephemerides
claude Aug 25, 2026
cee8ef3
fem: one-dimensional finite elements for -(p u')' + q u = f
claude Aug 25, 2026
1fad3b9
fem: triangular meshes and the two-dimensional Poisson problem
claude Aug 25, 2026
96ac5f9
fem: Helmholtz and the drum eigenproblem
claude Aug 25, 2026
6f74795
fem: plane-stress elasticity and the transient heat equation
claude Aug 25, 2026
7fff238
fem: one-dimensional FDTD and the photonic band gap
claude Aug 25, 2026
062a3a9
fem: two-dimensional FDTD with a matched layer, and the waveguide cutoff
claude Aug 25, 2026
9d6e269
fem: spectral methods, completing section 19c
claude Aug 25, 2026
32def5b
learn: feed-forward networks and backpropagation
claude Aug 25, 2026
e67b208
learn: Gaussian process regression
claude Aug 25, 2026
9beeb77
learn: clustering, mixtures and nearest neighbours; fix an LCG low-bi…
claude Aug 25, 2026
566d8d6
learn: decision trees, random forests and gradient boosting
claude Aug 25, 2026
935fd14
units: dimensions, quantities and Buckingham's theorem
claude Aug 25, 2026
a5e86ce
units: dimensional checking of symbolic formulas, and one constants t…
claude Aug 25, 2026
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
99 changes: 67 additions & 32 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Verify

# Deeper checks than ci.yml (which builds, tests and reports coverage):
# randomized property tests, Kani model checking, and a strict lint pass.
# randomized property tests, Kani model checking, Miri, and a strict lint
# pass.
#
# Every `run:` here is quoted. An unquoted value containing a colon
# followed by a space is parsed as a nested mapping, which makes the whole
# file invalid and fails the run before any job starts.

on:
push:
Expand All @@ -21,55 +26,85 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run the property suite in release mode
run: cargo test --release --test properties
run: "cargo test --release --test properties"

clippy-strict:
name: Clippy (strict)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
# Default lints are errors.
#
# The float-accuracy lints (float_cmp, lossy_float_literal,
# imprecise_flops, suboptimal_flops) are deliberately NOT enabled
# here. They are allow-by-default, and naming them with -W does not
# make them advisory: -D warnings denies the whole warning level, so
# every one they raise becomes an error. Enabling them alongside
# -D warnings produced 3429 errors, suboptimal_flops accounting for
# most of them. Rewriting those expressions as mul_add changes
# rounding, so they need review one at a time rather than a blanket
# gate. Run them manually when doing that work:
# cargo clippy --all-targets -- -W clippy::suboptimal_flops
- name: Clippy
run: "cargo clippy --all-targets -- -D warnings"

kani:
name: Kani model checking
runs-on: ubuntu-latest
# Thirteen harnesses at 24 to 68 seconds each, run in parallel with -j.
# Sequentially that is seven minutes; the bound is generous against a
# slower runner while still failing rather than holding a runner for the
# six-hour job default.
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
# The seven harnesses CBMC cannot decide in a CI-sized budget are behind
# the `kani-slow` feature and are not enabled here. Every harness was
# timed individually against a five-minute budget; the split and the
# measured times are recorded in src/verification/mod.rs. Briefly:
# asserting panic-freedom or finiteness lands in well under a minute,
# while asserting a numeric relation between symbolic float expressions
# exceeds five minutes, because CBMC has to bit-blast the full mantissa
# of every intermediate.
- uses: model-checking/kani-github-action@v1
with:
args: --output-format terse
args: "-j --output-format terse"

miri:
name: Miri (UB check)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
- run: cargo miri setup
# The crate contains no `unsafe`, so Miri is a backstop rather than the
# primary check, and interpreting all 2700+ tests would dominate CI
# time. Scope it to the modules doing the heaviest index and slice
# arithmetic, where an out-of-bounds or aliasing mistake would surface.
- run: "cargo miri setup"
# The crate contains no `unsafe`, so Miri is a backstop rather than
# the primary check. It interprets at roughly a hundredth of native
# speed -- these 27 tests take twelve minutes -- so it is scoped to
# core::, the interval and dual-number arithmetic where index and slice
# reasoning is densest, rather than to the whole suite.
#
# Five tests in there carry #[cfg_attr(miri, ignore)]. Miri evaluates
# sin, exp and powi with its own implementations rather than the host's,
# and deliberately randomises the result within the slack the language
# allows, so a test asserting an exact float value fails under Miri
# whatever the code does. Those five are exactness assertions and are
# skipped here; they run everywhere else.
#
# A libtest filter is a substring match, not a path prefix, so a bare
# `core::` also selects `graph::core::` and `verification::core::` --
# brute-force combinatorial tests that Miri needs tens of minutes for.
# Skipping `::core::` anchors the filter to the top-level module: a
# top-level path starts with `core::` and so has nothing before it to
# match, while every nested one does.
- name: Run core numerics tests under Miri
run: cargo miri test --lib -- core:: linalg:: spatial::
run: "cargo miri test --lib -- core:: --skip ::core::"
env:
MIRIFLAGS: "-Zmiri-strict-provenance"

clippy-strict:
name: Clippy (strict)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
# Default lints are enforced as errors. The float-accuracy lints are
# advisory: `suboptimal_flops` alone fires ~2800 times across the
# numerics, and rewriting those expressions as `mul_add` changes
# rounding, so each one needs a deliberate review rather than a blanket
# denial.
- name: Clippy
run: >
cargo clippy --all-targets --
-D warnings
-W clippy::float_cmp
-W clippy::lossy_float_literal
-W clippy::imprecise_flops
-W clippy::suboptimal_flops
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ exclude = ["assets/", ".github/", "*.profraw"]

[dependencies]

[features]
# Enables the Kani harnesses that CBMC cannot decide in a CI-sized budget.
# See src/verification/mod.rs for the measured times and the reason for the
# split. Off by default so `cargo kani` runs only the harnesses that finish.
kani-slow = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(kani)"] }
Loading
Loading