Skip to content

Fix MethodError in tvtcdf from pre-1.0 Vector constructor - #243

Open
devmotion wants to merge 5 commits into
masterfrom
dmw/fix-tvtcdf-undef
Open

devmotion wants to merge 5 commits into
masterfrom
dmw/fix-tvtcdf-undef

Conversation

@devmotion

@devmotion devmotion commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #242.

adonet allocated its work arrays with Vector{Float64}(100), which needs undef since Julia 1.0. tvtcdf calls adonet whenever no special case applies, so most inputs threw a MethodError.

Tests added for tvtcdf with nu = 0, 1, 3, 30:

  • with h = 1e-15 (just large enough that the h ≈ 0 shortcut is skipped and the numerical integration runs), the result matches the orthant probability 1/8 + Σ asin(r) / 4π to rtol = 1e-13;
  • with h3 = 1e15, the result matches bvtcdf of the remaining two variables to rtol = 1e-13 (for nu ≥ 1, bvtcdf uses a separate closed-form algorithm);
  • relabeling the variables leaves the probability unchanged to rtol = 1e-14.

The new tests error without the fix.

JET already flagged this bug, but test/qa.jl called JET.report_package, which only prints its findings. It now calls JET.test_package, which runs the same analysis and fails the test on any report. JET reports nothing on this branch, and the test fails if the bug is reintroduced.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (b4b6b37) to head (a320877).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #243       +/-   ##
===========================================
+ Coverage   77.22%   93.27%   +16.05%     
===========================================
  Files          24       24               
  Lines        1190     1190               
===========================================
+ Hits          919     1110      +191     
+ Misses        271       80      -191     

☔ 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.

devmotion and others added 2 commits November 16, 2026 13:54
adonet allocated its work arrays with `Vector{Float64}(100)`, which
requires `undef` since Julia 1.0, so tvtcdf threw for most inputs.
Add tvtcdf tests against the orthant probability and for invariance
under relabeling the variables.

Fixes #242

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`JET.report_package` in the QA tests only printed its findings, so it
did not catch #242 even though JET flags it. Use `JET.test_package`,
which runs the same analysis and records a test failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devmotion
devmotion force-pushed the dmw/fix-tvtcdf-undef branch from f5f9017 to 24c1586 Compare November 16, 2026 12:54
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.

tvtcdf throws MethodError from Vector{Float64}(100) in adonet

1 participant