feat(tools): ✨ capture and diff a golden baseline - #302
Open
robertodr wants to merge 1 commit into
Open
Conversation
robertodr
requested review from
diagonal-hamiltonian,
fpietra and
ludmilaasb
as code owners
August 29, 2026 14:31
5 tasks
robertodr
enabled auto-merge (squash)
August 29, 2026 14:34
robertodr
force-pushed
the
split/01-baseline-tool
branch
from
August 29, 2026 14:35
e637c4c to
bafd43b
Compare
|
Docs preview: https://pr-302.monoprop-docs.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #302 +/- ##
=======================================
Coverage 97.70% 97.70%
=======================================
Files 14 14
Lines 742 742
Branches 98 98
=======================================
Hits 725 725
Misses 12 12
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. |
robertodr
disabled the stack merge
August 29, 2026 14:58
A refactor that must not move a term is checked against a captured baseline rather than by reading the diff. capture-baseline.py propagates every msgpack fixture at a spread of cutoffs and cutoff types plus a few native qubit problems, and dumps each run's term count, its full (monomial indices, coefficient) set and its expectation value. Terms are dumped in the engine's own returned order and `just diff-baseline` is a byte-wise diff, because that order runs from SplitmixHash through probe order, MPI owner routing and insertion order into floating-point accumulation order -- a silent reorder is the regression this exists to catch. `--compare --tol` is the other mode, for a change that reorders on purpose: term set and count exact, coefficients and energies to a relative tolerance. Assisted-by: ClaudeCode:claude-opus-5
robertodr
force-pushed
the
split/01-baseline-tool
branch
from
August 29, 2026 14:59
bafd43b to
fb9454e
Compare
|
9 tasks
matteoacrossi
approved these changes
Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



🤖 AI text below 🤖
Summary
First of five PRs carved out of #226. Adds a standalone tool that captures a golden baseline of Majorana propagation results and diffs a later run against it, so the refactors that follow can be shown to be byte-inert rather than asserted to be.
tools/capture-baseline.pywalks everytests/data/*.msgpackfixture, runs every (cutoff_type, cutoff) combination throughMajoranaPropagator, and records the evolved term set and energies to a labelled directory under.baseline-capture/. A later capture is compared byte-wise, or with--compare --tolwhen a change is expected to preserve values but not accumulation order.No library code is touched; nothing in the build or the test suite depends on this.
Changes
tools/capture-baseline.py: capture and diff driver, MPI-aware, one directory per label.justfile:capture-baseline LABEL='golden'anddiff-baseline AGAINST='golden'..gitignore: ignore.baseline-capture/**.docs/content/docs/testing.mdx: new "Golden baselines" section covering both recipes.Checklist
docs/,CONTRIBUTING.md) if neededCHANGELOG/ release notes updated if applicableThe tool is itself a test instrument and has no unit tests; it is exercised by running it.
AI/LLM disclosure