Skip to content

Fix: nb default space - #306

Open
docxology wants to merge 3 commits into
ReactiveBayes:mainfrom
docxology:fix/nb-default-space
Open

Fix: nb default space#306
docxology wants to merge 3 commits into
ReactiveBayes:mainfrom
docxology:fix/nb-default-space

Conversation

@docxology

Copy link
Copy Markdown
Contributor

[Verified audit fix] — branch fix/nb-default-space.

Commit: fix(NegativeBinomial): repair DefaultParametersSpace helpers

Changes

src/distributions/negative_binomial.jl | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Verification

Confirmed against main in the ReactiveBayes audit (Julia 1.12.6); sources verified read-only. See the branch diff.

docxology and others added 2 commits August 1, 2026 17:30
- isproper: return a real Bool (was a truthy Pair)
- getgradlogpartition: use closure arg θ (was undefined η); correct to -r/p
- getlogpartition: use -r*log(p) to agree with the natural-space partition
…es#291)

Cover the three DefaultParametersSpace defects: isproper returns a Bool and
enforces p>0; default-vs-natural log-partition agreement; gradlogpartition no
longer crashes and matches ForwardDiff.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bvdmitri

bvdmitri commented Sep 2, 2026

Copy link
Copy Markdown
Member

Confirmed, all three defects:

  • !isnan(p) && !isinf(p) && (1 => p > 0) — the 1 => p > 0 is a Pair, always truthy, so p > 0 was never enforced.
  • the gradient closure referenced an undefined η (its arg is θ) — an UndefVarError crash.
  • default-space -r·log(1-p) disagreed with natural-space -r·log(p).

All three fixes are correct. Pushed a regression test covering the Bool return, default-vs-natural agreement, and the gradient.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.06%. Comparing base (a72e447) to head (b76493f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   83.91%   84.06%   +0.14%     
==========================================
  Files          45       45              
  Lines        4078     4078              
==========================================
+ Hits         3422     3428       +6     
+ Misses        656      650       -6     

☔ View full report in Codecov by Harness.
📢 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.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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