-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more detailed explanation of Matrix/TMB compatibility requirements? #387
Comments
I don't remember the exact details, but the motivation for making the Matrix package version test was definitely a binary incompatibility issue (perhaps in Good news is that the problem is hard to reproduce today. If I install TMB using Based on this, I think the version test isn't justified anymore and can be omitted by default. |
- Use options("TMB.check.Matrix"=TRUE) to re-enable
@bbolker I was wrong - we really need to keep the version test. Here's an example: I start out with consistent build from source of the 3 packages: install.packages(c("Matrix","TMB","glmmTMB"))
## trying URL 'https://cloud.r-project.org/src/contrib/Matrix_1.6-1.1.tar.gz'
## trying URL 'https://cloud.r-project.org/src/contrib/TMB_1.9.6.tar.gz'
## trying URL 'https://cloud.r-project.org/src/contrib/glmmTMB_1.1.8.tar.gz' I can run
Now TMB is broken: > library(glmmTMB)
Warning message:
In checkMatrixPackageVersion() : Package version inconsistency detected.
TMB was built with Matrix version 1.6.1.1
Current Matrix version is 1.6.2
Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
> example(glmmTMB)
glmTMB> ## No test:
glmTMB> (m1 <- glmmTMB(count ~ mined + (1|site),
glmTMB+ zi=~mined,
glmTMB+ family=poisson, data=Salamanders))
Error in fitTMB(TMBStruc) :
negative log-likelihood is NaN at starting parameter values I follow the advice of the warning: install.packages('TMB', type = 'source') and it fixes the problem! (i.e. |
…lt) #387 - options("TMB.check.Matrix"=FALSE)
Thanks. It would still be nice to know why it fails, as I don't ... although at least this nice reproducible example will make it a little easier to investigate? (There's nothing obvious in the Matrix devel-version NEWS file that indicates API breakage ...) |
There's no API change. That is demonstrated by the fact that I can recompile TMB and make things work again. In case of the Matrix package, the 'API' contains a number of macros e.g. |
Yes, Matrix 1.6-2 fixes some bugs in its headers, resulting in ABI changes. Here are the
So, indeed, 1.6-2 breaks a long run of Matrix releases without ABI changes. But that does not imply that TMB should continue to warn about any version mismatch by default. When we release new versions of Matrix, it is our responsibility to notify the CRAN team about ABI changes and to ask for rev. dep. binaries to be rebuilt. And we will do that when we submit 1.6-2. But rebuilds do not affect package versions: currently, users must "know" to use The updates serve only to ensure that This whole situation should be considered exceptional, happening only if we update SuiteSparse or discover bugs and only until CRAN starts tagging builds. For as long as I am/have been a co-author, we do not change the ABI without determining and consulting affected rev. dep. maintainers. (And had I not seen this thread I'd have notified you about the 1.6-2 changes. Well, you might still receive an e-mail.) I am really not convinced that TMB and others should continue defending against problems that arise only exceptionally and which should be handled as much as possible by the maintainers introducing ABI changes (by asking CRAN for rebuilds, rev. dep. maintainers for version bumps) and as little as possible by end users. |
Perhaps TMB could change to warning about version mismatch only when the mismatch involves Matrix versions known to introduce an ABI change. For now, the list would contain only 1.6-2, unless you recall the much older (and now probably irrelevant) instances. When we update SuiteSparse in 1.7-0, we may ask you to add 1.7-0, and so on ... |
@jaganmn Thanks for dealing so thoroughly with this issue! I'm going to follow your advice to only check the few versions that might cause trouble. |
Eventually (actually TODO for 1.6-2), Matrix will associate with three "versions" detectable from C and R code: a package version, a SuiteSparse version, and an ABI version. The ABI version will obviate the need for a hard-coded list of ABI-breaking package versions. |
Done now, with
So you can start comparing ABI versions defined backwards compatibly as:
Edit: I've just changed to |
As a reminder for myself, the new
In the future we should store and test on Matrix 'abi' rather than 'package version' (there is no way to lookup ABI from package version). |
Just to add a further data point in how far this strict versioned dependency is unfortunate for consumers of this code. In Debian there is a bug report about this where we are discussing the consequences for the Debian distribution. It would be great if some well designed tests inside TMB the strict compatibility requirements could be dropped. |
And ideally TMB would maintain its own ABI version for use by its reverse dependencies. Then they can stop depending so strictly on package versions, too, assuming that TMB is a good citizen and does not change its ABI with every release. |
This would be extremely helpful. |
Add check on package attachment to see if dependencies have udpated. These updates may cause runtime binary breaks in SeuratObject, but still allow SeuratObject to be loaded, so this check happens at attachment
Point taken - there should ideally be an identifier (let's call it ABI version) to signify when reverse |
Perfectly understandable - thanks for working on making this less frequently. Andreas. |
Just wanted to bump this - would be nice to have a |
@bbolker Just added However, it seems to me like a lot of machinery to solve an almost non-existing problem: The list of ABI breaking versions |
Hi,
I'm well aware of the need for Matrix/TMB compatibility, as added in this commit.
This is a continuing source of friction in packages/stacks that use TMB (e.g. wham, macpan2, glmmTMB. It's very easy to make the warning go away if you have development tools installed and you know what to do, but despite our attempts to document this in glmmTMB (e.g. here, here), it continues to be a source of concern and confusion for end-users. When this comes up on the r-devel list, we've tried to suggest that there be a way to ask CRAN to re-build binary packages when a new version of a lower-level package (Matrix > TMB > glmmTMB) is posted, but we haven't had much response. The other alternative is to make sure that we bump the versions ourselves and re-post to CRAN as necessary, but so far this also seems to be a source of friction (i.e. in order to do this we have to at least make sure that we are up to date on all CRAN checks, run tests on
r-hub
etc., check downstream packages for breakage ...)We could try to reduce developer friction, e.g. by making it easier for ourselves to push new
glmmTMB
versions (e.g. we could maintain a tag/branch with the HEAD equal to the last CRAN submission, or even keep the last-submitted tarball around, so that we could resubmit it without doing any more checks).However, it would be really useful to me at least to understand the exact reason why this incompatibility arises, to be able to do a better job explaining and resolving the issue ...
If this is more suited for the
glmmTMB
issues list, or the TMB mailing list, please let me know.The text was updated successfully, but these errors were encountered: