Skip to content

RFC 0004 / RFC 0005: Refactor all remaining sampling logic from R / Python to C++ and standardize serialization#356

Open
andrewherren wants to merge 193 commits into
mainfrom
cpp_sampler_loop_refactor_rfc_0004
Open

RFC 0004 / RFC 0005: Refactor all remaining sampling logic from R / Python to C++ and standardize serialization#356
andrewherren wants to merge 193 commits into
mainfrom
cpp_sampler_loop_refactor_rfc_0004

Conversation

@andrewherren

Copy link
Copy Markdown
Collaborator

For a full overview of the design, see the RFC 0004 doc

@andrewherren andrewherren linked an issue Apr 9, 2026 that may be closed by this pull request
andrewherren and others added 30 commits June 30, 2026 09:49
… wrap a C++-owned BARTSamples object, and unpack into R as needed
…ram migration

R Package Unit Tests were failing on several fronts left over from the
single-owner ($samples) migration:

- Real-code accessor bugs read removed model fields: kernel.R
  (computeForestLeaf* -> $samples$leaf_scale_*_samples()) and bcf.R
  summary()/plot() (-> $samples$...()). The kernel path was the source of
  the `checking examples` failure.
- Five test files still used removed $-accessors; migrated to $samples$...().
- BCF serialization segfault: .migrateBcfJsonV0ToV1 was missing the
  parameter-trace renames, so legacy JSON reached the C++ layer with old
  names -> empty b0/b1 arrays -> predict() read out of bounds. Added the
  initial_sigma2->sigma2_init, b_0_samples->b0_samples, b_1_samples->b1_samples
  renames to the migration (no-ops when absent), so the migration owns all
  renames. Removed the now-dead read-time initial_sigma2 fallbacks in the
  loader, and rewrote the test to build a real v0 (schema_version 0) fixture.
- test-samples-container.R exercised a removed from_components R6 constructor
  and stale expect_error messages; rebuilt containers via
  create*SamplesFromJson and matched the current extractForest() message.
- test_json.cpp gtest: ToJson() -> AppendToJson() after the rename.

Full R suite green (0 failed / 934 passed); C++ json gtest builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…dling of missing test data in both R and Python
The branch predated main's post-tag / PyPI-detail / reproducibility additions to
RELEASING.md, so relative to main it read as removing them. Reset to main's version
so the overhaul PR carries no RELEASING.md change and the eventual merge stays clean.

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.

[TRACKING] Tracking Issue for RFC 0004

1 participant