Add a cross-backend differential harness: evaluate one job at a fixed parameter set on every backend that can run it, and compare the simulated outputs and the objective value
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start by reading tests/test_experiment_independence.py, tests/test_preequilibration.py, tests/test_bngsim_sbml_bridge.py, and benchmarks/run_pybnf_fitting_jobs.py, then compare their entry points with bngsim's parity_checks/ design. Define how the shared manifest, runner, comparator, and outcomes fit PyBNF before building the cross-backend harness. Done means the stated disagreement regressions fail when their fixes are reverted, exercised open bugs are recorded as KNOWN, and the per-push subset meets a stated time budget.
Written by the indexing model from the issue text.
Description
PyBNF has no harness that takes one job, evaluates it at a fixed parameter set on every simulation backend able to run it, and compares the results. Backends that disagree are the largest class in the 2026-09-23 audit: 35 of the 106 silently-wrong-result bugs (#929). The test suite passed with all of them present.
bngsim has this for engines, in parity_checks/ (lanl/bngsim). It compares bngsim with libRoadRunner, the legacy BioNetGen stack and AMICI over committed manifests, with one comparison kernel and one outcome taxonomy. It stops at the engine on purpose: its README says "Fitting/sampling parity is PyBNF's, not ours", and its corpus leaves out .conf and .exp files. Everything between the engine and the objective value is PyBNF's to check: the bridges, the synthesized actions, conditions and mutants, pre-equilibration, normalization, and the scoring.
What PyBNF has today
- Per-feature tests on two backends.
tests/test_experiment_independence.pyandtests/test_preequilibration.pyrun tiny models onbionetgenandbngsimagainst closed forms.tests/test_bngsim_sbml_bridge.pyandtests/test_bngsim_ssa_replaces_rr.pycompare the bngsim SBML backend with RoadRunner on one model each. Each test covers the feature its author had in mind. - A name-level differential.
tests/_bngl_differential.pycompares the entity names the PEtab BNGL reader finds with BNG2.pl's. It compares no numbers. - A launch smoke test.
benchmarks/run_pybnf_fitting_jobs.pystarts twelve jobs on BNG2.pl and on bngsim. It checks that each one starts, not that the two agree. - No use of bngsim's golden references.
parity_checkspublishes them so that PyBNF can regenerate them through its own bridges with only a pinned bngsim installed. Nothing in PyBNF does. - A manual rule. #929 asks every PR that can change a number to run the shipped examples before and after at a fixed parameter set. No committed script does that.
How this relates to #929 phase 3
Phase 3 is a conformance suite: tiny models on every backend, judged against closed forms. That is the only way to catch two backends returning the same wrong number (#830). But it covers only models small enough to solve by hand, and only the cases someone thought to write.
A differential harness covers the other side: real jobs, with combinations of features nobody listed. It cannot catch a shared wrong number, and a disagreement does not say which backend is wrong. The two should share one runner, one comparator and one set of outcomes.
Proposal
- Manifest. One committed file with one entry per job: the conf, the parameter set, the backends that apply, and the tolerances.
- Runner. For each job and each backend, load the conf the way a fit does and evaluate once at the parameter set. Record every simulated output table and the objective value.
- Backend pairs.
- BNGL, ODE and SSA:
bngl_backend = bionetgenagainstbngsim. - BNGL, network-free: BNG2.pl with NFsim against bngsim
nffor legacy-edition jobs, and bngsimnfagainstrm. Edition-2 network-free experiments are to be refused underbngl_backend = bionetgen(#929). - SBML:
sbml_backend = roadrunneragainstbngsim. - Antimony runs only on bngsim. It has no pair unless it is compared with its SBML translation on RoadRunner.
- BNGL, ODE and SSA:
- Comparator. Deterministic output tables must agree within a numeric tolerance, and then the objective values within a relative tolerance. Stochastic and network-free outputs need a statistical comparison over seeds;
parity_checks/rr_parity/ssa_screen.pyhas one to follow. Two backends that report different column names are a failure. The comparator must not compare only the columns they share (#817). - Outcomes. PASSED, FAILED, KNOWN and REFUSED.
- REFUSED: one backend rejects the job at load. That is correct behaviour and is recorded as such.
- KNOWN: a disagreement tied to an open issue number. A KNOWN row that now passes fails the run, so a stale entry cannot stay.
- Missing backend. If a backend the manifest names is not installed, the run stops with an error. It does not skip the row.
- Corpus. Start with the shipped
examples/confs that evaluate in seconds, plustests/full_tests. Then regenerate bngsim's golden references through PyBNF's bridges. - CI. A fast subset on every push, and the full sweep in
integration.yml.
The same runner can later check the other sibling paths named in AGENTS.md: the gradient against finite differences of the recorded objective, a fit against job_type = ms, and a conf against its PEtab export and re-import. Those are follow-ups, not part of this issue.
Depends on
- #923.
job_type = checksimulates a BNGL model with BNG2.pl whateverbngl_backendsays. The single evaluation above is a check, so either #923 is fixed first or the runner needs its own entry point. - #816. BNG2.pl must be available in every CI run.
- The open backend bugs (#866, #868, #870, #872, #873, #926, #927, #941 and others). They will make rows fail on the first run. Each enters the manifest as KNOWN with its number.
Worked if
- Reverting the fix for a closed backend-disagreement bug turns a row FAILED. This is shown for at least three such bugs.
- Every open backend-disagreement issue that a shipped example exercises appears as a KNOWN row.
- The per-push subset has a stated time budget and meets it.
Open question
Whether to import bngsim's parity_checks/_core (the differ, the outcome taxonomy, the fingerprint) or to copy its contract. It is in the bngsim repository but not in the wheel.
Related: #929 (roadmap), #923, #816, #817.
- Dominant language
- Python
- Stars
- 25
- Forks
- 25
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/PyBNF
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day