Skip to content

Support nimble2 with various features#212

Merged
perrydv merged 11 commits into
mainfrom
support-nimble2
Jul 17, 2026
Merged

Support nimble2 with various features#212
perrydv merged 11 commits into
mainfrom
support-nimble2

Conversation

@perrydv

@perrydv perrydv commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR brings in features for supporting a new version of nimble with nimbleModel. These include:

  • renovated system for managing compile-time information on nClass inheritance in the project_env.
  • fixed determination of nested types, multiple levels in (A$B$C) when there were TBD types to be resolved.
  • fleshed out get_interface_ptr feature of the generic interface in C++.
  • add C++ classes RuntimeFlatView and RuntimeFlatViewGroup to support nimble's values() keyword.
  • other bug fixes and details

@paciorek I don't think this needs a rebase. OK to merge and then you can rebase your TBB branch (again)?

@perrydv
perrydv merged commit f1416d1 into main Jul 17, 2026
5 checks passed
@perrydv
perrydv deleted the support-nimble2 branch July 17, 2026 13:48
@paciorek

paciorek commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@perrydv I think this has broken nimbleModel master branch. Not sure if I need to switch to the branch of nimbleModel with the nimble2 changes?

code <- quote({
        tau ~ dunif(0, 100)
        mu ~ dnorm(0,1)
        for(i in 1:5) {
            y[i] ~ dnorm(mu, var = tau)
        }
    })

    inits <- list(tau = 25, mu = 0)
    data <- list(y = rnorm(5))

    ## Manual workflow
    mclass <- nimbleModel(code, inits = inits, data = data, returnClass = TRUE)
    m <- mclass$new()
    cmclass <- nCompile(mclass)
    cm <- cmclass$new()
Error in NCint$process_inherit(inheritInfo = inheritInfo, symbolTable = symbolTable,  : 
  unused arguments (inheritInfo = inheritInfo, symbolTable = symbolTable, project_env = project_env)

@perrydv

perrydv commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@paciorek have you tried rebuilding nimbleModel with the updated nCompiler installed? There is the issue that calls to nClass in nimbleModel will bake in nClass features from nCompiler, so if nCompiler updates, nimbleModel can break for that reason. Eventually we may want many or all nClasses created in a package like nimbleModel to be created in .onLoad.

@paciorek

Copy link
Copy Markdown
Contributor

@perrydv thanks; that resolved the problem. You've probably told me about this before but I haven't absorbed it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants