Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2da00a6
Remove legacy c++ standalone debug program
andrewherren Apr 9, 2026
8080c8c
Add more C++ and VSCode infrastructure for RFC 0004
andrewherren Apr 9, 2026
c329608
Added clang formatting and linting settings
andrewherren Apr 9, 2026
0e00513
Auto-formatted C++ headers to the style standardized in `.clang-format`
andrewherren Apr 9, 2026
d843d3f
Auto-formatted C++ source files to match style standardized in `.clan…
andrewherren Apr 9, 2026
b8e299d
Some clang-tidy low-hanging fruit fixes
andrewherren Apr 9, 2026
638f658
Added `.clangd` and updated cmakepresets and `.gitignore`
andrewherren Apr 9, 2026
00ddf31
Updated build infrastructure
andrewherren Apr 9, 2026
3714c2e
Added probit function
andrewherren Apr 9, 2026
de4c5c0
Added probit to debug program
andrewherren Apr 9, 2026
4abac76
Updated build infrastructure
andrewherren Apr 9, 2026
a8b35d6
Fixed probit bugs
andrewherren Apr 9, 2026
8a21de8
Added comments
andrewherren Apr 9, 2026
02e9511
Updated BCF and BART programs
andrewherren Apr 9, 2026
d3d598c
Updated BART and BCF debug programs to use a test set for evaluations
andrewherren Apr 9, 2026
4fa70bb
Added probit BCF
andrewherren Apr 9, 2026
0cca384
Added linear regression and tests
andrewherren Apr 9, 2026
c003b71
Formatted C++ test code
andrewherren Apr 9, 2026
c6fd61b
Refactored Eigen out of debug programs
andrewherren Apr 9, 2026
f91b765
Added initial BART data structures
andrewherren Apr 9, 2026
7321b45
Updated debug program to use new BART data structures
andrewherren Apr 9, 2026
b3cced0
Initial (non-working) implementation of BARTSampler
andrewherren Apr 10, 2026
2c05a32
Working implementation of BARTSampler
andrewherren Apr 10, 2026
65d4d54
Updated sampler and debug program
andrewherren Apr 10, 2026
35c8f6f
Updated probit and leaf scale initialization
andrewherren Apr 10, 2026
d7c3741
Correctly reference variance model terms
andrewherren Apr 10, 2026
4390de1
Initial implementation of R wrapper around the new BARTSampler interface
andrewherren Apr 10, 2026
78d1c25
Mostly-working R implementation
andrewherren Apr 10, 2026
ec0e4c9
Fixed sigma2_leaf bug
andrewherren Apr 11, 2026
92b4485
Fixed sweep_update_indices bug
andrewherren Apr 11, 2026
35020b1
Updated R package to default to no cpp loop for now (unit tests crash…
andrewherren Apr 11, 2026
455ac9d
Initial python wrapper around C++ interface
andrewherren Apr 11, 2026
2f3a3c0
Fixed none-type initialization bugs in the python to C++ interface
andrewherren Apr 11, 2026
77b88d1
Explicitly convert numpy arrays to column-major ("Fortran style")
andrewherren Apr 11, 2026
312b563
Fix logic inversion bug
andrewherren Apr 12, 2026
fca909a
Fix std::move bug with ForestContainerCpp
andrewherren Apr 12, 2026
f8d67af
Fix result unpacking bugs
andrewherren Apr 12, 2026
b9a6ea6
Add GHA debugging step to show `00install.out` from R check workflows
andrewherren Apr 12, 2026
bbbdf90
Fix unpacking bugs
andrewherren Apr 12, 2026
c8f7b4a
Fix reshape bug
andrewherren Apr 12, 2026
2b47fa4
Always show install log
andrewherren Apr 12, 2026
e090dde
Avoid truncation in install log printing
andrewherren Apr 12, 2026
6e43105
Update windows makevars template
andrewherren Apr 12, 2026
74d7df5
Remove install log debug statement in R GHA workflow and add two debu…
andrewherren Apr 12, 2026
c7f3695
Refactored BARTSampler to store config and data references internally
andrewherren Apr 12, 2026
0bc70b2
Pre-reserve forest predictions
andrewherren Apr 12, 2026
8e5410f
Run test set predictions after the fact
andrewherren Apr 13, 2026
9667ec3
Added keep_gfr and keep_burnin to bart C++ interface
andrewherren Apr 13, 2026
a516391
Pass through num_features_subsample to GFR in C++
andrewherren Apr 13, 2026
1ddc788
Propagate keep_gfr and fix bugs in the bart_debug program
andrewherren Apr 13, 2026
4be1e9c
Make probit and predict work in R
andrewherren Apr 14, 2026
f1a50fc
Updated python interface to ensure probit and predict work
andrewherren Apr 14, 2026
4e366d2
Unpack more fields from the python C++ interface
andrewherren Apr 15, 2026
1dbcafc
Extract calibrated fields from the python C++ BART interface
andrewherren Apr 15, 2026
00473ee
Non-working model type dispatch refactor and cloglog implementation
andrewherren Apr 16, 2026
62a528a
Working cloglog implementation (with two R-path bug fixes)
andrewherren Apr 16, 2026
349de20
Fixed python cloglog test failures
andrewherren Apr 16, 2026
481cb4a
Fix bug in python cloglog warm-start sampling
andrewherren Apr 16, 2026
c9fbcee
Added unit tests for warm start cloglog in python and updated cloglog…
andrewherren Apr 16, 2026
1ffe7c7
Updated cloglog benchmark scripts
andrewherren Apr 17, 2026
107d887
Support heteroskedasticity with no mean model and add errors when cas…
andrewherren Apr 17, 2026
17379b3
Fix heteroskedasticity-only code path and add heteroskedasticity benc…
andrewherren Apr 17, 2026
182c0a5
Adding initialization routines for univariate leaf regression
andrewherren Apr 17, 2026
db1c823
Added benchmarking scripts for univariate leaf regression
andrewherren Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: Google
IndentWidth: 2
AccessModifierOffset: -1
ColumnLimit: 0
SortIncludes: false
32 changes: 32 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# Conservative clang-tidy config for stochtree.
# Focuses on real bugs and performance issues; style is handled by clang-format.
# To run manually: clang-tidy <file> -- (or via clangd in the editor)

Checks: >
clang-analyzer-*,
bugprone-branch-clone,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-incorrect-roundings,
bugprone-infinite-loop,
bugprone-redundant-branch-condition,
bugprone-suspicious-include,
bugprone-use-after-move,
modernize-redundant-void-arg,
modernize-use-emplace,
modernize-use-nullptr,
modernize-use-override,
performance-for-range-copy,
performance-move-const-arg,
performance-unnecessary-copy-initialization,
-clang-analyzer-optin.performance.Padding

# Leave empty to warn only, not fail the build.
WarningsAsErrors: ""

# Only surface warnings for project headers, not dependencies.
HeaderFilterRegex: "include/stochtree/.*"

# Respect .clang-format for any fixes clang-tidy applies.
FormatStyle: file
14 changes: 14 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# Fallback compile flags for files not captured by compile_commands.json
# (e.g. R wrapper files when BUILD_PYTHON=OFF, or before cmake has been run).
# Files compiled by cmake use compile_commands.json and ignore these flags.
CompileFlags:
Add:
- "-std=c++17"
- "-Iinclude"
- "-Ideps/boost_math/include"
- "-Ideps/eigen"
- "-Ideps/fast_double_parser/include"
- "-Ideps/fmt/include"
- "-Ideps/pybind11/include"
Compiler: clang++
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update -y && \
valgrind && \
rm -rf /var/lib/apt/lists/*

ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.29.3"

# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/
Expand Down
39 changes: 25 additions & 14 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "C++",
"name": "stochtree C++ Dev",
"build": {
"dockerfile": "Dockerfile"
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb"
],
"settings": {
"clangd.path": "/usr/bin/clangd",
"clangd.arguments": ["--compile-commands-dir=${workspaceFolder}/build"],
"cmake.configureOnOpen": true,
"cmake.defaultConfigurePreset": "dev-quick",
"cmake.defaultBuildPreset": "dev-quick"
}
}
},

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Configure dev build (no test download) on container creation.
// Switch to the "dev" preset and re-run cmake when you need GoogleTest.
"postCreateCommand": "cmake --preset dev-quick && cmake --build --preset dev-quick"
}
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
*.DS_Store
lib/
build/
.vscode/
build-release*/
.vscode/positron/
xcode/
*.json
!.vscode/extensions.json
!.vscode/tasks.json
!.vscode/launch.json
!CMakePresets.json
!test/R/testthat/fixtures/*.json
!test/python/fixtures/*.json
.vs/
Expand All @@ -15,7 +20,7 @@ cpp_docs/doxyoutput/xml
cpp_docs/doxyoutput/latex
stochtree_cran
*.trace
*.clangd
.cache/clangd/
*.claude

## R gitignore
Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-vscode.cmake-tools",
"vadimcn.vscode-lldb",
"llvm-vs-code-extensions.vscode-clangd",
"Posit.air-vscode"
]
}
107 changes: 107 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "bart_debug (macOS)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/bart_debug",
"args": ["--scenario", "1", "--n", "500", "--n_test", "100", "--p", "5", "--num_trees", "200", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: Build (dev-quick)"
},
{
"name": "bcf_debug (macOS)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/bcf_debug",
"args": ["--scenario", "1", "--n", "200", "--n_test", "100", "--p", "5", "--num_trees_mu", "200", "--num_trees_tau", "50", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: Build (dev-quick)"
},
{
"name": "teststochtree (macOS)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/teststochtree",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: Build (dev)"
},
{
"name": "bart_debug (Linux/Container)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bart_debug",
"args": ["--scenario", "1", "--n", "500", "--n_test", "100", "--p", "5", "--num_trees", "200", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"preLaunchTask": "CMake: Build (dev-quick)"
},
{
"name": "bcf_debug (Linux/Container)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bcf_debug",
"args": ["--scenario", "1", "--n", "200", "--n_test", "100", "--p", "5", "--num_trees_mu", "200", "--num_trees_tau", "50", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"preLaunchTask": "CMake: Build (dev-quick)"
},
{
"name": "teststochtree (Linux/Container)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/teststochtree",
"args": [],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"preLaunchTask": "CMake: Build (dev)"
},
{
"name": "bart_debug (macOS, Release)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-release-drivers/bart_debug",
"args": ["--scenario", "1", "--n", "500", "--n_test", "100", "--p", "5", "--num_trees", "200", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: Build (release-drivers)"
},
{
"name": "bart_debug (Linux/Container, Release)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-release-drivers/bart_debug",
"args": ["--scenario", "1", "--n", "500", "--n_test", "100", "--p", "5", "--num_trees", "200", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"preLaunchTask": "CMake: Build (release-drivers)"
},
{
"name": "bcf_debug (macOS, Release)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build-release-drivers/bcf_debug",
"args": ["--scenario", "1", "--n", "200", "--n_test", "100", "--p", "5", "--num_trees_mu", "200", "--num_trees_tau", "50", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: Build (release-drivers)"
},
{
"name": "bcf_debug (Linux/Container, Release)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build-release-drivers/bcf_debug",
"args": ["--scenario", "1", "--n", "200", "--n_test", "100", "--p", "5", "--num_trees_mu", "200", "--num_trees_tau", "50", "--num_gfr", "10", "--num_mcmc", "100", "--seed", "-1"],
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"preLaunchTask": "CMake: Build (release-drivers)"
},
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
77 changes: 77 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake: Configure (dev)",
"type": "shell",
"command": "cmake --preset dev",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Configure (dev-quick)",
"type": "shell",
"command": "cmake --preset dev-quick",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Build (dev)",
"type": "shell",
"command": "cmake --preset dev && cmake --build --preset dev",
"group": { "kind": "build", "isDefault": true },
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Build (dev-quick)",
"type": "shell",
"command": "cmake --preset dev-quick && cmake --build --preset dev-quick",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Build (release)",
"type": "shell",
"command": "cmake --preset release && cmake --build --preset release",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Build (release-drivers)",
"type": "shell",
"command": "cmake --preset release-drivers && cmake --build --preset release-drivers",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "CMake: Build (sanitizer)",
"type": "shell",
"command": "cmake --preset sanitizer && cmake --build --preset sanitizer",
"group": "build",
"problemMatcher": ["$gcc"],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "Test: Run All",
"type": "shell",
"command": "${workspaceFolder}/build/teststochtree",
"group": { "kind": "test", "isDefault": true },
"problemMatcher": [],
"presentation": { "reveal": "always", "panel": "shared" }
},
{
"label": "Test: Run All (sanitizer)",
"type": "shell",
"command": "${workspaceFolder}/build/teststochtree",
"group": "test",
"problemMatcher": [],
"presentation": { "reveal": "always", "panel": "shared" }
}
]
}
Loading