Skip to content

Conversation

@ErikDanielsson
Copy link

This PR adds TreePPL support via the stdio interface for non-Julian MCMC. TreePPL is a universal probabilistic programming language aimed at phylogeneticists.

I've tried to follow the BlangTarget closely in implementing this bridge both here and on the TreePPL side, but tried to keep the API as slim as possible. The API gives access to all relevant flags in TreePPL via the tppl_compile_model function. I have however deferred the installation to the TreePPL installation guide since installation of it along with all dependencies is too complicated to maintain here in my opinion.

This PR depends on two PRs on the TreePPL side:

Miking CorePPL is a somewhat low level functional PPL that TreePPL compiles to. Both PRs are in the merge pipeline on the TreePPL/Miking side -- I thought I would keep this PR in a draft state until they are merged.

Note on sampling at temperature 0.0
Many models that are familiar in TreePPL contain hard constraints which means that there would be a discontinuity in the tempering path at temperature zero if we were to temper from the prior. Since I believe that this is not desired I have allowed two different options for sampling at temperature 0.0:

  • Global independence sampling of the prior: Draw the program globally from the prior but only accept samples that respect hard constraints.
  • Local kernels at temperature 0.0: Use the same local kernels at temperature 0.0 as for other temperatures. This option would be most relevant if it is very hard to generate samples that respect the hard constraints.

These option is controlled via the use_global::Bool argument in tppl_compile_model function. Please let me know if you have any other suggestions for addressing this problem!

@alexandrebouchard
Copy link
Member

That's awesome, let's talk in detail during today's meeting.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.14%. Comparing base (f3854c0) to head (d60dd22).

Files with missing lines Patch % Lines
src/targets/TreePPLTarget.jl 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #374      +/-   ##
==========================================
- Coverage   87.82%   87.14%   -0.69%     
==========================================
  Files         107      108       +1     
  Lines        2654     2675      +21     
==========================================
  Hits         2331     2331              
- Misses        323      344      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -0,0 +1,111 @@
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should crash on CI, maybe remove new line after?

output_dir::AbstractString
end

java_seed_32bit(rng::AbstractRNG) = rand(rng, UInt32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to redefined it if it's identical to the one in the blang file.

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