Skip to content

Add predict() coverage to float32 test suite#391

Merged
andrewherren merged 1 commit into
mainfrom
worktree-float32-fix-backport-0.4.3
May 27, 2026
Merged

Add predict() coverage to float32 test suite#391
andrewherren merged 1 commit into
mainfrom
worktree-float32-fix-backport-0.4.3

Conversation

@andrewherren
Copy link
Copy Markdown
Collaborator

Summary

  • All 12 existing TestBARTFloat32 and TestBCFFloat32 tests now also call predict() with float32 inputs after sampling, verifying that the predict path is equally robust to non-float64 dtypes
  • The "runs" tests add a shape assertion on predict() output
  • The _matches_float64 tests add a numerical comparison of predict output between float32 and float64 inputs (rtol=1e-5 for BART, rtol=1e-4 for BCF)

Context

Commit 14137970 fixed float32 handling in sampling by adding forcecast to the C++ bindings and an explicit y_train dtype cast. The ColumnMatrix constructor does a full element-by-element copy, so forcecast is safe for the Python MCMC path. This PR extends the test coverage to verify prediction is equally safe.

Test plan

  • All 12 float32 tests pass locally (macOS)
  • No other tests affected — only additions to existing test classes

🤖 Generated with Claude Code

Each existing TestBARTFloat32 and TestBCFFloat32 test now also exercises
the predict() code path with float32 inputs, verifying that sampling and
prediction are both robust to non-float64 input dtypes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andrewherren andrewherren merged commit 7fb469c into main May 27, 2026
16 checks passed
@andrewherren andrewherren deleted the worktree-float32-fix-backport-0.4.3 branch May 27, 2026 23:05
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.

1 participant