Skip to content

Conversation

@sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Dec 2, 2025

This PR introduces on-demand generation of log density functions for JuliaBUGS models.

The skip_source_generation parameter has been removed from compile() and BUGSModel(). Instead, log density functions are now generated on-demand when set_evaluation_mode(model, UseGeneratedLogDensityFunction()) is called. All models start with UseGraph() mode.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

JuliaBUGS.jl documentation for PR #416 is available at:
https://TuringLang.github.io/JuliaBUGS.jl/previews/PR416/

@TuringLang TuringLang deleted a comment from github-actions bot Dec 2, 2025
@sunxd3 sunxd3 changed the title Implement lazy log density function generation Make log density function generation on-demand Dec 2, 2025
@coveralls
Copy link

coveralls commented Dec 3, 2025

Pull Request Test Coverage Report for Build 19886678447

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 19 of 22 (86.36%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.007%) to 83.867%

Changes Missing Coverage Covered Lines Changed/Added Lines %
JuliaBUGS/src/serialization.jl 0 1 0.0%
JuliaBUGS/src/model/bugsmodel.jl 16 18 88.89%
Files with Coverage Reduction New Missed Lines %
JuliaBUGS/src/serialization.jl 2 0.0%
Totals Coverage Status
Change from base Build 19866622348: -0.007%
Covered Lines: 3301
Relevant Lines: 3936

💛 - Coveralls

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Benchmark Results

Julia 1.11.7 on AMD EPYC 7763 64-Core Processor (Linux)

Ratio = JuliaBUGS/Stan (lower is better for JuliaBUGS)

Model Stan Params JBUGS Params LD Ratio Grad Ratio
rats 65 65 0.35x 1.71x
pumps 12 12 0.64x 1.85x
bones 13 33 0.67x 4.36x
oxford 244 244 1.73x 4.37x
epil 303 303 0.51x 1.60x
lsat 1006 1006 0.65x 2.01x
schools 133 133 0.23x 1.45x
beetles 2 2 1.16x 4.09x
air 5 5 0.54x 1.45x

Note: Stan benchmarks use hand-optimized Stan models, not direct BUGS translations. Comparison is illustrative only.

@sunxd3 sunxd3 merged commit acb8bf5 into main Dec 3, 2025
28 checks passed
@sunxd3 sunxd3 deleted the sunxd/lazy_logdensity_generation branch December 3, 2025 08:17
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.86%. Comparing base (5208959) to head (79b350c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
JuliaBUGS/src/model/bugsmodel.jl 88.88% 2 Missing ⚠️
JuliaBUGS/src/serialization.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #416      +/-   ##
==========================================
- Coverage   83.87%   83.86%   -0.01%     
==========================================
  Files          31       31              
  Lines        3944     3936       -8     
==========================================
- Hits         3308     3301       -7     
+ Misses        636      635       -1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants