Release notes for sbmlsim 0.38.0
The parameter fit of a real model package runs in the engine core. A fit whose mappings read several models, a value at a change which the engine evaluates from its own state instead of a number which goes stale as the optimizer moves, a pointwise observable of a simulation experiment, a measurement which carries no information and every objective a fit can express, a likelihood of any noise distribution of PEtab, a noise whose scale the fit estimates or which reads the simulation and the posterior with its priors, are all fits of the engine now: every one of the 81 fit problems of pkdb_models runs there, and two ways in which such a fit could answer the residuals of another problem without an error are closed, both of them reachable on 0.37.0. Around that work the three switches of the engine reach the run layer and the records of a fit say where it ran, a Fisher information stores its decomposition so a record does not depend on the LAPACK of the machine which reads it, an identifiability analysis is bounded instead of hanging on one stuck scan, a simulation of the engine core has no wall clock deadline any more, and the fit report, the service of the panels, the app of a model and the release of a package each lose a limit of their own.
What the fit of the engine covers
The fit of a problem in the engine (the contract fit/1, sbmlsim.fit.fit_core) reached the fits of the HCTZ example of this repository and little of a model package of its size: the data of a real study is measured at the times of a shifted simulation, its protocol sets a collection or a dose by a formula at a change, its observables are formulas of its own experiments and its mappings read the builds of a model under more than one key. Every one of those is a fit of the engine now, and the two of them which the engine answered wrongly rather than refusing are closed. Measured over the 81 fit problems of pkdb_models, each built and initialized with the settings of its definition, all 81 are fits of the engine.
-
A likelihood of a fixed noise is a fit of the engine (#616, part of #613). The objective was a blanket gap in 0.37.0: only a weighted least squares ran in the engine and every likelihood and posterior kept the optimizer in python. The negative log-likelihood of a measurement is half the square of
(y - m) / sigmaplus a term of the scale of its noise, and that term has no derivative when the scale is a number of the data, so the optimum, the gradient and the jacobian are the ones of a curve whosenoiseis that scale and only the reported cost needs a shift:likelihood_constantis that shift andfixed_noisedecides whether a noise is one. A log-normal noise, whose residual is the difference of the logarithms, readslog(column)off the model of the fit, written there as an assignment rule by the machinery ofobservable_sbml, so the engine needs no transform of its own. 27 of the 31 cases of the PEtab v2 test suite were a likelihood fit of the engine at that point, each of them the residuals of the problem bitwise, and the section below closes the rest of the objective. -
observable_modelkeeps the tolerances of the fit (#616). It loads the model of a fit again from the SBML with the observables written into it and left it with the integrator settings of the engine instead of the tolerances of theFitSettings, so a fit with a formula observable integrated at a relative tolerance of 1e-6 where the fit asked for 1e-12. It carries the integrator state of the model of the problem now. This is a defect of every fit of the engine with anObservableModel, not only of the log column of a log-normal noise, so a fit of 0.37.0 whose observable is a formula of the selections integrated at the tolerances of the engine and not at its own. -
A curve measures at the output times of its condition (#617). A curve of a request carried the times of its data where its condition carries the output times of its plan:
Plan.time_shiftis applied to the time of a result on the way back and a request carries no shift, so the two frames differ by exactly the shift and the engine refused the request withthe curve 24 measures at t = 36.0, which is no output time of its condition. Every fit of a simulation with a shift was out, 186 of the 522 points of thePKfit and 58 of the 166 points of thePDfit of the HCTZ model of pkdb_models lying at such times.OptimizationProblem._x_planis the output time of every data point in the time of the plan, the merged time ofmerge_times, which_curvewrites into the request, so the points of such a fit land on the rows of their condition and its residuals are the ones of the problem. 0.37.0 carries the defect, where a fit of the engine of a shifted simulation raises rather than falling back to python, so it fails visibly and answers no wrong number. -
A formula at a change which reads a value the search moves is no longer folded silently (#617). A formula at a change is folded into a number by the executor by simulating the segment which ends at the change and reading the state there, so the number of a request is the one of the point it was built at:
-0.5 * FLUID__na_urineof a urine collection which is halved reads a state the optimizer moves, the engine held the change where the fit started and answered the residuals of another problem without an error. Measured on thePDfit of the HCTZ model of pkdb_models at 1.2 times the fitted values, once the times of its curves were right, the cost of the engine was 326.118884821 against python's 86.1969803441, while the two agree to 1.2e-13 at the point the request was built at, which is the signature of the defect and why no check made at the start values could see it._gaps_at_the_foldsreports such a formula as the gapchange_value, so the fit runs in python, and_constant_at_the_changeskeeps the engine for a formula whose symbols are constants of the simulation, which folds into the same number at every point of the search. One gap is reported per formula, naming its first change and how many changes carry it, since the gaps of a problem are logged as one message, which turned the 105 gaps of thePKfit into 3. -
A parameter whose target a value of the plan holds is a gap (#618).
Plan.with_valuesreplaces the assignment of a target wherever the plan has one, so the fitted value of a parameter lands in a change of the plan and in the pre-initialization of its steady state as well, and the engine sets the parameters of a request on the model before every simulation, which overrides the pre-initialization of a condition but not a value the plan applies later: such a parameter reached the engine frozen at the number of the point the request was built at and the engine computed the residuals of another problem without an error, with no formula needed, a plain numeric dose which the fit estimates being enough. Measured before the fix,gaps_ofwas empty while the cost in python moved from 60.2845 to 3138.82 and the cost of the engine sat at 8828.95 whatever the parameter._gaps_of_the_valuesreports the gapparameter_valuefor every parameter whose target a change or the pre-initialization of a steady state of the plan sets (_held_values), one gap per parameter with its first place and the number of them, so a protocol of many doses of an estimated dose is one message.The fold of a change formula and the parameter whose target a value of the plan holds are released defects, which the profile of a likelihood under Fixes below is not: 0.37.0 has no gap for either of them, since it folds every formula at a change,
_gaps_of_the_valuesread only the assignments which carry a formula and_gaps_of_the_targetsnever read the plan, sogaps_ofcalled such a problem clean and its fit of the engine minimized another objective. A fit of the engine on 0.37.0 whose simulation sets an entity at a change by a formula over the state, or whose parameters estimate a target a change or the pre-initialization of a presimulation sets, should be run again on this release, which either carries that value as a form the engine evaluates or names the gap and fits in python. The fits of the HCTZ example have neither and stayed in the engine throughout. -
A change of a linear formula is a form the engine evaluates from its own state (#618, sbmlsim-core 0.20.0). The field
formsof the contractsimulation/1carries a change asconstant + Σ factor * target, which the engine evaluates at the change from its own state instead of a number a fold would hold, so a collection which is halved follows the state the optimizer moves.executor_core.form_ofreads the form of an assignment whose symbols are all parameters, compartments or species of the model andis_formed(plan, model)is the single predicate the request builder and the gap check share, so the two cannot disagree about what is carried; the conversion is all or nothing per plan, a plan with one formula which is no linear form folding every one of them, so a form and a fold never meet in one request. Measured engine against python on the test problem withreads_change_formsforced false to reproduce the fold: 0 at the parameter factor 1.0, the point the request was built at, against 0 with the form, 0.307 against 0 at 1.2 and 1.505 against 0 at 0.7. On the real fits of the HCTZ model of pkdb_models the largest absolute difference of a residual is 4.4e-16 at the factors 1.0, 1.2 and 0.7 for both subsets, the costs agreeing to 14 or more digits, withformscarried 33 times forPDand 101 times forPK, and both run in the engine (PD55.4707 in 12.9 s,PK56.8562 in 13.5 s).The gap
change_valueis what is left, decided in three ordered gates: a formula of constants of the simulation folds to the same number everywhere and is no gap, a formula the engine can carry as a form is no gap, every other one is the gap. A formula which is not linear (Aurine * Aurine), which reads a concentration ([C]), the time or the rate of a reaction is no form and still folds.timeis the time of the change and no value of the model, which is why it is no term of a form: on the model of case 01820 of the SBML Test Suite, which declares an entity namedtime, the fold of2 * timeat the time 2 is 4 where a form over that entity reads 20. A form of a factor which is not dyadic or of three or more terms is the fold within a unit in the last place, since a form evaluatesconstant + Σ factor * valuewhereapply_changesevaluates the formula as written:x / 90becomesfl(1/90) * x, which disagrees withfl(x / 90)for about a quarter of the doubles of[1e-3, 1e3], far below the tolerance of the integrator and recorded in the known differences ofexecutor_core, while the single dyadic factor of the real protocols is exact._form_termsis cached on the text of the formula and the names of the entities of its model, which is all the answer depends on, so a protocol of 97 doses of one formula reads one form instead of 291: 141 ms per simulation group become 1.2 ms with a cold cache and 0.3 ms with a warm one. -
A measurement which carries no information is no gap (#619, sbmlsim-core 0.21.0).
_noise_ofgives a point of the weight zero the standard deviationreference / sqrt(0), a positive infinity, which the engine refused: its residual is the difference over infinity and its row of the jacobian is zeros, so the point adds nothing to the cost and nothing to the gradient while it keeps its place in the residual vector of the request, which is what keeps that vector and the jacobian aligned with the ones of the problem. The two sources of a zero weight are a measurement of zero underERROR_WEIGHTING, a zero baseline, and aFitMappingof the weight zero, which zeroes every point of its mapping; theweightsgap is a NaN, an infinite or a negative weight now and no longer a weight of exactly zero, while an infinite weight stays a gap, its standard deviation being0.0, which no standard deviation can be.INFINITE_NOISE_VERSIONandreads_infinite_noiseare the gate, in the shape ofreads_change_forms: an older binding refuses the request, which_gaps_of_the_requestreports asunsupported, so the gate buys a clear message and not safety. -
A pointwise formula observable of an experiment is a column of the model of the fit (#619). A group whose data reads an observable of its experiment was always a gap. An observable whose value at a time of the data does not depend on the other output times, a
Formulawhich is a timecourse without a reduction (OptimizationProblem._group_pointwise), is written into the model of the fit as a parameter of an assignment rule, as the observable of a PEtab problem already was: the id of the parameter carries the group (_group_observable), so two experiments which define an observable of one id with different formulas keep their columns apart,add_formulaand_names_oftake thenamesof their caller so an observable which reads another one reads its parameter and nothing of a formula is substituted as text,FormulaNode.factoris one multiplication of the parameter so the column is the value python computes, and the condition of the group selects it (_observable_column). A group whose data needs the output of its simulation keeps the gap: a value per simulation, a reduction such asmax(Aurine), aPKparameter or aCustomfunction. -
A fit of several models runs in the engine (#621, sbmlsim-core 0.22.0). A problem whose fit mappings read more than one model, e.g. the two builds of a model of a drug or a study which measures two species, kept the gap
modelsand was fitted by the optimizer in python, a request offit/1carrying one model and a condition per simulation. A condition names the model of its simulation now:model_idsare the ids the conditions of a problem name its models by, the key of the task which reads a model and its position among the models of the problem where two experiments read different models under one key, so the ids of a request are distinct whatever the experiments are called;fit_modelsandloaded_modelsare the models and the loaded models by that id, each of them with the observables of the mappings which read it, whilefit_modelandloaded_modelstay the model of a fit of one model;engine_fitandengine_problemare the fit and the objective of a request,LoadedModel.fit/fit_problemfor a problem of one model andsbmlsim_core.fit_models/fit_problem_of_modelsfor one of several, so a request of one model is the one of before, its conditions carrying nomodel; and the checks of the values at the changes and of the folds read the plan of a group against the model which simulates it (_models_of_the_groups). The parameters of a fit are the same in every model it reads, each applied to its target in the model of every condition it reaches, and the gap stays for bindings older thanMULTI_MODEL_VERSION(reads_several_models), which fit one model, and for a problem whose mappings read no model at all. All 81 fit problems of pkdb_models are fits of the engine with it, against 72 before it, the nine which were left being exactly the problems whose mappings read two models (apixaban.PK,creatinine.PK,creatinine.PK_CR,creatinine.PK_CRTN,gdeobdtpa.PK,glimepiride.PK,inulin.PK,lenvatinib.PKandtorasemide.PK). -
A problem of several models says so instead of blaming the bindings (#620).
gaps_ofread the loaded model of a problem through_loaded_of, which answersNonefor a problem which has not exactly one model, and the version gate of the bindings took thatNonefor bindings which cannot fit a request at all, so every such problem was told that the installed sbmlsim-core does not fit a request offit/1and that 0.12.0 is the first which does, which is false of every binding since then. The gap of such a problem is its own now and is reported before the version of the bindings, andfits_requestsis asked about the loaded model of the one model of the problem. 0.37.0 gives the wrong reason for all nine of the problems above, which is a defect of the message and not of the fit. -
26 of the 31 cases of the PEtab v2 test suite are a fit of the engine, each of them bitwise the residuals of the problem, and 26 of the 31 are a likelihood fit of it as well. The count of 0.37.0 was 30, and four of those thirty (0016, 0028, 0030 and 0031) set a concentration at a change by a formula which reads one: such a formula is no linear form, since the parser of the math of PEtab does not read the brackets of a concentration as a term, and a fold of it holds the value where the fit started, so the gap
change_valueabove is correct behaviour for them and they are fitted in python. The fifth has parameters which have a prior and no bounds of their own, which no optimizer of bounds can search.ENGINE_GAPSandENGINE_LIKELIHOOD_GAPSoftests/fit/test_petab_testsuite.pyrecord every one of the five with the code of its gap, so the count cannot drift again: between #617 and #618 neither table had been told about the four cases and the eight tests of them failed behind the markerpetab_testsuite, whichaddoptsdeselects, so a normal run and continuous integration never showed it.
The objective of a fit runs in the engine
sbmlsim.fit.fit_core sent a weighted least squares and, since #616, which 0.37.0 does not carry either, a likelihood of a normal or log-normal noise whose scale the fit does not move; a Laplace noise, a noise the fit moves and a posterior kept the optimizer in python, and the jacobian of every likelihood took the central differences (#613). All four are closed (#626, the contract fit/1 of sbmlsim-core 0.24.0), so a fit which named no place runs in the engine where it ran in python before. engine_fit=False, --no-engine-fit and the field engine_fit of the spec of the kind fit keep the optimizer in python, which evaluates its points through the engine as before, and OptimizationResult.optimizer_of records where a fit ran.
-
A curve carries the distribution of its noise. The negative log-likelihood of a measurement is
0.5 data**2 + 0.5 scale**2 - 0.5 cwith the residuals oflikelihood_residuals, which are two rows of a curve and not one, and thelikelihoodof a curve of the contract is the distribution those rows are computed from (_likelihood_of,_sends_likelihood). A Laplace and a log-Laplace noise, whose residual issign(r) sqrt(2 |r|)and no difference over a standard deviation, are such a curve. A normal or log-normal noise whose scale the fit does not move sends no field at all: its scale row is a constant of the data, so the curve is the weighted one of #616 bitwise, andlikelihood_constantcarries that constant onto the cost as before. -
The scale of a noise the fit moves is a column of the model of the fit. A scale which follows the parameters of the fit, e.g. the estimated
sd_obs, or the state of the simulation is no number of a curve: it is an observable of the model of the fit (_noise_entities,NOISE_PREFIX) which the curve names as itsnoise_columnand the engine reads in the row of every measurement, exactly where python evaluates the formula. The formula is written as the math of SBML and nothing of it is substituted as text, as an observable of a formula already is: the symbol of the observable becomes a helper parameter of the linear column of the mapping, since python evaluates the noise at the linear prediction, and every placeholder a helper parameter of its one value. The PEtab v2 cases 0015, 0021 and 0024, whose noise reads an estimated parameter or a parameter of the model, are fits of the engine now. -
A fit of the posterior sends its priors. The priors of the parameters are functions of the parameters alone, which the engine evaluates without a simulation: the prior of a parameter of its own is one row of the request (
_priors_of, the kind with the parameters of PEtab, the offset which keeps the row positive, the bounds of the parameter and thenormalizer, the logarithm of the mass of the prior between those bounds, which the engine subtracts from the density of its kind since a distribution function is no term of a density), and the correlated priors are one block, the multivariate normal of their scores, whose rows are the whitened scoresL⁻¹ zand one more per log-normal prior.priors.untruncated_log_densityis the density of a kind term for term as the engine writes it,prior_medianthe value the normalization is read at, where the density is largest or next to it and its logarithm loses the fewest digits, andJointPrior.offsetthe constant of the cost whichlikelihood_constanttakes off a run. -
The rows of the priors come after every row of the curves, and
_residual_rowsis the one map between the rows of a request and the residual vector of a problem: per training mapping its data rows and then, for a curve which sends them, the rows of the scales of its noise, and the prior rows last.residual_jacobiandrops them with itsrows < totalmask, asfisher.data_residualsdrops their residuals, so aFisherInformationstays the information of the data and the curvature of the priors belongs to the Laplace posterior. -
The jacobian of a likelihood is the forward sensitivities.
gaps_of_a_jacobianrefused every likelihood, so the Fisher information of a likelihood fit took the central differences of python where a fit of least squares took the sensitivities of the engine. It has no objective branch any more: the row of the scale of a noise the fit does not move is zero whichever way it comes, whichresidual_jacobianleaves it, the engine answers that row itself for a fixed Laplace noise, and the scale of a noise the fit moves is a column of the model whose sensitivities the engine carries into both rows of a measurement.tests/fit/test_fisher.pypins the standard errors of the HCTZ iv fit as a likelihood against the ones of the central differences, to within 5 %, and the jacobian of a fixed Laplace noise is pinned analytically against the chain rule of its normal problem,(du/dp) / sqrt(2 |u|), rather than against a difference quotient of the cusp of a square root. -
The rows of the data stay bitwise. The noise column of the model is the number python computes, as a column of a formula observable is, so the data rows of the engine are the data rows of the problem bitwise (
numpy.testing.assert_array_equal). The row of the scale of a noise and the row of a prior are the rows whose logarithm the engine evaluates itself,lnof rust, where python evaluates the one ofnumpyor reads a density off the distribution ofpetab, an exponential followed by a logarithm: a scale row and the row of a log-normal prior agree with python to within an ulp and not bitwise (LOGARITHM_RTOL,1e-15), the row of a prior whose bounds cut it far from its median, whose normalization is then read at the midpoint of the bounds, to within1e-14(measured at3.9e-15), and every other prior row is bitwise. -
The gate of the bindings. Neither
FitRequestnorCurveRequestdenies a field it does not know, so a binding before sbmlsim-core 0.24.0 would ignore alikelihoodand the priors of a request and minimize another objective without an error of any kind.reads_objectivecompares the installed bindings withOBJECTIVE_VERSIONand keeps such a problem in python as the gapbindings, so the gate buys safety and not only a message. -
What is left of the gap
objective. A placeholder of a noise formula whose value differs between the measurements of its mapping, which is no one column of the simulation; a noise formula the model of the fit cannot carry as an observable of its own, e.g. one which reads a symbol which is no entity of the model, or one which reads the observable of a mapping that is more than one curve; a measurement of a log kind which is not positive, whose logarithm is no value of a curve; a prior of a kind the engine does not evaluate, i.e. thecauchy,chisquare,exponential,gammaandrayleighof PEtab, sinceENGINE_PRIORSis the six kinds whose log density is an expression of the contract; a prior of a parameter whose unit factor is not 1, since a prior is a distribution of the value of the parameter while the engine holds the value of its target; and a prior whose support does not cover the bounds of its parameter, below.
Fixes
-
The cost of a profile point of the engine is the cost of the problem (#626).
profile_pointsanswered the cost of a point as the engine reports it, the half sum of the squares of the rows of its request, while the optimum and the threshold of an identifiability analysis areOptimizationProblem.cost_least_square: the two arelikelihood_constantapart, so the points of a likelihood lay above the threshold from the first step, the crossing was interpolated between the optimum and the first point, and every parameter came outidentifiablewith a hairline interval. Measured on a two parameter posterior, the interval ofp1was [1.272, 1.328] against the [0.908, 1.692] of python, about fourteen times too narrow, with no error and no warning, and both parameters were still reportedidentifiable. A profile of a fit of least squares was never affected, the constant being zero there, which is why the comparison oftests/fit/test_fit_core.pydid not see it.No released version of sbmlsim can produce such an interval. The defect needs a profile walked in the engine and a non-zero
likelihood_constantat the same time: the walk has shipped since 0.32.0, butlikelihood_constantcame with #616 after 0.37.0 was tagged and no tag contains it, and every release up to and including 0.37.0 reports the gapobjectivefor every objective which is not least squares, so the engine fitted least squares alone and there was no constant to be on the wrong side of. It is reachable only on an installation from unreleaseddevelopbetween #616 and this change, and anyone in that position should run a profile of a likelihood or of a posterior fitted in the engine again; a walk in python (engine_profiles=False,--no-engine-profiles) was always on the scale of the problem.profile_pointsshifts the cost of a point as_fit_ofshifts the cost of a run, the two places a value of the engine becomes an object of python; a jacobian keeps its rows, the constant having no derivative. -
A prior whose density is zero between the bounds of its parameter keeps a fit in python (#626).
_prior_residualsof a problem replaces theNaNof such a row withLIKELIHOOD_FAILURE_RESIDUAL, a penalty an optimizer walks out of, while the same row of a request isNaNand every run of the engine then answers a cost ofNaNand the values it started from: the fit of a uniform prior narrower than the bounds of its parameter converged to the optimum in python and answeredNaNin the engine.priors.prior_supportis the interval the density of a kind is positive on, the lower end of a log kind the smallest positive double and not0, and a prior whose support does not cover the bounds is the gapobjective. -
The
engine_fitadmonition of Parameter fitting listed a Laplace noise and a noise the fit moves as gaps of the objective, which the section above it no longer did.
Changed numbers
-
A correlated posterior shifts in its last bits.
_Correlated.whitenedsolvedL w = zwithscipy.linalg.solve_triangularand now stores the inverse of the Cholesky factor and multiplies it out,iouter andjinner with one addition perjin ascending order from0.0, no LAPACK call and no reduction ofnumpy, so the order of the floating point operations is fixed and the engine evaluates the same loop over the same numbers. That is what makes the whitened rows of a request and the ones of the problem comparable at all; the price is that the residuals of a correlated prior, and with them the cost of a posterior and its Laplace approximation, differ in the last bits. Unlike the profile above, this one does reach a release: 0.37.0 whitens withsolve_triangularand fits a posterior with a correlated prior in python, so an upgrade from it moves those numbers.tests/fit/test_priors_whitening.pychecks the product against an independent triangular solve, so the values stay the ones ofL⁻¹ z. -
A fit of a likelihood whose noise the fit moves, of a Laplace noise or of a posterior now runs its optimizer in the engine where it ran in python, so its optimum is the one of the optimizer of the engine and agrees with the one of scipy to the tolerances of the fit and not bitwise, as a fit of least squares in the engine does.
Where a fit ran is recorded, and a run can require the engine
-
The three switches of the engine reach every layer (#623).
run_optimization(engine_fit=),profile_likelihood(engine_profiles=)andfisher_information(engine_jacobian=)were arguments of the python API only, so a run of the run layer or of simrun took the engine where it could and fell back to python without a word. They are the fieldsengine_fitofFitSpec,engine_profilesofProfileSpecandengine_jacobianof the newJacobianSpec, whichFitSpec,IdentifiabilitySpecandFisherSpecinherit, and the flags--engine-fit,--engine-profilesand--engine-jacobianof the command lines of a fit, each with its--no-counterpart, so a spec or a command requires the fit of the engine and fails naming the gaps instead of optimizing in python silently.run_fittakesengine_fitand records it in the provenance of the fit. -
Where a fit ran is recorded with it (#623).
OptimizationResult.optimizer_ofandIdentifiabilityResult.profiles_ofareengineorpython,mixedfor a result whose pieces did not all run in one place and nothing for a record of sbmlsim 0.27 or earlier, next to thejacobian_ofaFisherInformationalready carried;run_placeoffit/options.pycombines the parts of acombine, and neither field is part of the definition the parts of an analysis share, so parts which ran apart still combine. The overview of a report names where the optimizer ran and the summary of a run of the kinds carries all three. The summary of a Fisher information writes a non-finite condition number asnull, as its file does, so the summary a merge returns equals the one it wrote, and the row ofpetabin the table of the specs of Analyses is in the table again instead of behind the paragraph ofadopt. -
The pages say which engine a fit runs on (#622). Every fit has run on the engine core since it became the default engine in 0.37.0: a problem without an engine takes
DEFAULT_ENGINE, aFitDefinitionwithout one takes the engine of the simulator of its project, and the engine simulates the residuals in the calling process and in every worker of a pool. Simulations still said that a definition without an engine takes roadrunner. Two gates a fit can hit were missing from the pages as well, a differential evolution of more than one run, whose population the engine draws from one seed, so the runs of the fit would be the same run (the gaprunsofgaps_of_a_fit), in Parameter fitting, and a fit of a single parameter, whose profile point holds that one parameter and has none left to fit again (the gapparametersofgaps_of_the_profiles), in Identifiability.
A record of a fit does not depend on the LAPACK of its machine, and an identifiability analysis is bounded
-
The decomposition of a Fisher information is stored with it (#614, #523).
FisherInformationcomputed its pseudo-inverse and its eigenvalues at every read, so the standard errors, the covariance, the correlations, the confidence intervals and the rank of a record were the ones of the LAPACK of the reader: the SVD and the eigenvalue decomposition depend on the kernels of the CPU, so a factory which writes the standard errors into its SBML did not rebuild byte for byte on another machine (0.00764768541514242against...44) andProject.changed_outputs, the kindfactoryand therebuildcheck of the battery reported a change where there was none. The mechanism was reproduced before it was fixed, on a matrix of the shape of a real fit: the same matrix gives a pseudo-inverse which differs when the order of the operations changes, and with nearly collinear parameters the standard errors differ by 7e-3 relative, so this is not the last bit alone. The decomposition is stored with the information (inverseandspectrumoffisher.json) and read back, so every number derived from it is the number of the record on every machine; it is the inverse and not the standard errors which is stored, since everything a reader needs derives from it and one stored array keeps the standard errors, the correlations and the intervals consistent with each other. A record written before them has neither and computes them as before, a matrix which is changed after the information was created drops them, since they belong to the matrix they were computed from, and the Laplace posterior already stored its covariance, so it was never affected. The records of a model package are written again once, after which its rebuild is byte for byte. -
An identifiability analysis has a timeout (#614, #522). The analysis ran its scans through
FitPool.runpassing neithertimeoutnordeadline, although the pool offers both, so a scan which never returned stopped the whole analysis with no message and no partial result and the run had to be killed from outside, observed on 35 parameters of the machine perfusion model where the same analysis in series finished in about 2 h.ProfileSettingshasscan_timeout, the seconds without any scan finishing after which the scans which run or wait are given up, andtimeout, the seconds after which the whole analysis is given up, which a serial analysis checks before every scan as well, so that path's jacobian pool is bounded too; both default to no limit, which is what every earlier record ran with, and both are fields ofProfileSpecof the run layer, whichtests/run/test_fit_kinds.pyrequires of every setting of the profiles. A scan which is given up no longer raises: its parameter has no profile, the reason is recorded per parameter inIdentifiabilityResult.incomplete, the other scans run to the end and the analysis writes the profiles it has, the console logs which parameters are missing and the HTML report names them above the table, so a parameter which timed out is visible instead of silently absent.incompleteis no part of what makes two results parts of one analysis, so a part which gave a scan up still combines and a parameter which one part gave up and another profiled keeps its profile; every other exception of a scan raises as before, so a real error is not swallowed.
The engine core
-
The engine is named after its package (#616). It is
sbmlsim-coreeverywhere it is named: the pages, the docstrings the API reference is rendered from, the tables and the figure of Benchmarks (engine_label, so the committed measurement keeps its numbers and gains its label) and the README. The value of the setting is unchanged,Simulator(engine="core")andEngine.CORE. -
A simulation has no wall clock deadline (#616, #581). The bindings give their runtime a deadline of 30 seconds by default and nothing passed a value, so a simulation which needed longer was interrupted mid-flight with
wasm trap: interrupt: the result of a simulation does not depend on the load of the machine, and with a deadline whether it completes does, so the same model with the same parameters answered on an idle machine and failed next to other work, while the work of an integration is bounded bymaximum_num_stepswhatever the clock does.TIMEOUT_MSis 0 now andSBMLSIM_CORE_TIMEOUT_MSgives a deadline to a caller which wants one, e.g. a service which simulates models it does not control; one runtime holds the compiled models of a process, so a deadline belongs to the process and is no setting of aSimulator, and one which fires names itself, how long it was and what to do instead of the trap. -
The threads of a batch are measured (#615, #612).
test_the_batch_of_the_engine_core_scales_over_its_threadsmeasures the batch on its own: the requests are built once and the same batch of 1000 points runs on one, two, four and eight threads, so the numbers are of the engine and not of the python of a run. Pinned withtasksetto eight performance cores of a 12th Gen Core i7-12700, one per thread, one batch ofkthreads reaches 88 % of two, 78 % of four and 58 % of eight,kpython threads each driving a batch of one thread reach 91, 88 and 68 %, andkprocesses of one thread each pinned to a core of its own 100, 96 and 91 %: about 10 points of the loss are in the pool of a batch and about 23 in sharing the process, and the machine accounts for neither, which the issue had assumed it did. The hypotheses it listed were measured and are ruled out, so they need not be tried again: the speedup does not depend on the output per point (27.5k cells scale like 47.8M), overlapping the conversion of a slice with the next simulation is 3 to 10 % slower in all six A/B pairs, since the converting thread then competes with the simulation threads for the cores,SLICE_PER_THREADof 8, 64 and 512 give 58014, 57930 and 51671 points/s on eight threads, the whole batch makes 622mmapcalls, the arenas of glibc move it by under 2 %, and the busiest cores run at 4427 MHz against 4531 MHz at one thread. What is left is in the engine and is reported as sbmlsim-core#63 with the measurement and the next step. A measurement of this has to pin, since a single thread on an E-core is 1.9 times slower than on a P-core (146.9 ms against 76.6 ms for the same batch); a pool of processes each running a single-threaded batch, which the numbers imply, costs 0.9 to 1.1 s per worker and 0.18 s to compile the model in each, so it breaks even around 150000 points per session and is not worth doing on today's numbers. -
Three benchmarks of the scan core name roadrunner (#615).
test_a_simulation[repressilator],test_a_simulation[midazolam]andtest_the_serial_time_of_a_scan_of_1e3_pointscomparedSimulator.simulateandSimulator.runwithexecutor.execute, the executor of roadrunner, through a simulator of the default engine, which is the engine core since 0.37.0, so they have measured the python of the scan core against another engine's executor since then and failed with +2627 %, +3200 % and +292 % against a budget of 5 %. They name roadrunner now (roadrunner_simulator), which is what they compare against, sopytest -m benchmark -n 0 -s tests/simulator/test_benchmark.pyis 6 passed where it was 3 failed, 3 passed; the marker is deselected by default, which is why continuous integration never showed it. The two benchmarks of the pool measure whether parallelism pays at all and keep the default engine.
The reports, the service, the app and the release
All five come with #616 and are independent of the engine work above.
-
Every study of a fit report is visible (#511). The figure legend of the summary plots was one column which did not grow the figure, so a fit of 35 studies showed 29 of them and cut the rest and the entries of the band with them, and the colors of the studies cycled through nine, so the first, the tenth and the nineteenth study shared one and could not be told apart in a panel. The legend takes as many columns as it needs to fit the height of the figure, the figure grows by what the legend needs beyond the width the panels keep free for it, so the panels keep their size, and it grows in height rather than cut an entry.
category_colorgives the categorical colors while they are enough, so a report of few studies keeps its colors, and samples as many colors as there are categories fromturbobeyond them, which varies the hue and the lightness, so the neighbours of a large sample are told apart. -
The service keeps its bounds and its event loop (#521). The slot of the runner was released when the scan returned, before the body of the answer was built, so one model could hold about twice the threads its bound allows while the answers were built:
PanelRunner.admittedis public and re-entrant per thread, and the simulate route holds it over the run and over the body. A cache hit served the response model, which FastAPI serialized on the event loop for every hit, about 0.28 s of a blocked loop at the declared limits: the cache keeps the encoded body (encode_response), the body of a miss is encoded in the thread of its request and inside that bound, and both routes answer the bytes as they are, so the loop serializes nothing and the bound of the cache measures the bodies it serves instead of estimating the objects it kept. -
An app declares the scenarios of a variant (#524). The scenarios of an app were declared per page and checked against the knobs of every variant, so a model whose builds offer different stops of a knob, e.g. the renal function of the studies of each build, could only declare scenarios of values every build offers, and a scenario named after a study of one build was shown on the page of the other.
AppVariant.scenariosis the scenarios of a page in that variant, by the id of the page, which replace the ones the page declares, andApp.scenarios_of(variant)is the one place they are resolved, which the delivery and the checks of the service share, so a scenario is checked against the knobs of its own variant and the app route answers the scenarios of the variant it serves, which is what a shell reads. The contractapp/1takes the field additively, the pages keep theirs, and every variant of the body carries what it declares, so a shell can show what another build offers without fetching it. -
A figure group which is too large is split (#591).
panels_from_figurerefused a key with more thanMAX_CURVESreadouts of one unit and group, which the liver of a model of about six substances reaches, and refused it while the declaration of a package was being built, so such a model had no figure app and no way to ask for one. A part of more than that many readouts becomes several panels of at most that many curves, numbered after the id of the part (li_plasma_1) with the title saying which one it is (Liver, plasma (1 of 2)). The limit stays and a part which fits keeps the id and the title it had. -
A release checks the citation of its app (#525). An
Appcites its release in its footer with an explicit year, so the footer does not change on New Year, and nothing raised that year with a release in a new one: the README would cite 2027 while the footer kept 2026.prepare_releaserefuses a project whose app cites something other than the citation of this release, before anything is built, and names both (_check_app_citation).
Dependencies
-
sbmlsim-core>=0.24.0, the release whose curve offit/1reads thelikelihoodof its measurements and the column of the scale of a noise the fit moves, and whose request reads thepriorsof its parameters and theirprior_correlation. NeitherFitRequestnorCurveRequestdenies an unknown field, so an older binding would ignore the block and minimize another objective: the floor is raised andreads_objectivegates the fields on top of it, the wayreads_after_changeandreads_derivedgate theirs, so an environment which is older than the floor says so instead of answering the wrong numbers. -
The floors on the way to it, each of them with the lock, where 0.37.0 locked
sbmlsim-core>=0.18.0: 0.19.0 (#616), which divides the residual of a measurement by its standard deviation instead of multiplying it by the reciprocal (sbmlsim-core#64), so the residuals and the cost of a fit of the engine are the ones of the problem to the last bit for a noise which is no power of two, which is every likelihood (0.9 / 2.5is0.36where0.9 * (1.0 / 2.5)is0.36000000000000004; the suites agreed before because their measurements carry the deviation 1), and whose native engine answers every call of the bindings (sbmlsim-core#65), so the initial values of a DAE or delay model and the plan of a prepared request come from the engine which runs them; 0.20.0 (#618) for theformsof a change ofsimulation/1(CHANGE_FORMS_VERSION), which an older binding fails on rather than ignoring, sinceChangedenies unknown fields, so that gate buys a clear message and no safety; 0.21.0 (#619) for the infinite standard deviation of a measurement which carries no information (INFINITE_NOISE_VERSION); and 0.22.0 (#621) for a condition which names the model of its simulation (MULTI_MODEL_VERSION), which is what a fit of several models needs. -
The releases of the libraries of the day, each of them with the lock.
pymetadata>=0.9.0movespymetadata.omexontopymetadata-core, a Rust extension, so pymetadata is no longer pure python and neither is the dependency tree of sbmlsim, which reads and writes the COMBINE archive of a release through it (sbmlsim.release.archive). What it buys is speed: reading an archive is about 8 to 25 times faster and writing one faster still, since a read no longer extracts the archive into a temporary directory and a member nobody touched is copied compressed instead of being inflated and compressed again. The public API ofOmex,ManifestandManifestEntryis unchanged and the one behaviour change which reaches a caller is compatible with what a caller catches, aPasswordErrorwherezipfileraised aRuntimeError, which is aValueError. What it costs is the install on a platform without a wheel:pymetadata-coreships one abi3 wheel per platform, which every CPython from 3.11 on installs, for linux with glibc on x86_64 and aarch64, macOS on x86_64 and arm64, andwin_amd64, and on every other platform, i.e. musl based linux such as Alpine, linux on armv7, ppc64le or s390x, FreeBSD, 32 bit or ARM windows, or an implementation other than CPython such as PyPy,pip installfalls back to the source distribution of the core and compiles it, which needs a Rust toolchain, i.e.cargo, and fails without one. The five platforms with a wheel are the ones the tests and the documentation of sbmlsim run on, so nothing of this release changes for them.pkpdutils>=1.7.1is the floor which lets the rust kernel of the non-compartmental analysis resolve,pkpdutils-core>=0.7.0,<0.8where 1.7.0 still required<0.7; nothing of pkpdutils itself changes. And the vendored sbmlsim-web of the web app of a model is 0.7.0 (scripts/web_assets.py, itsVERSION.jsonand the checked integrity of the tarball), the release which draws the table of the pharmacokinetic parameters under the figure of a panel which declaresPanel.pk- the peak, its time, the area under the curve over the window of the plot and the half-life of the terminal phase, read off the curves at the state the knobs are at - so the flag 0.35.0 declared has the renderer it named. The floor ofsbmlsim-coreis the one above.