Skip to content

Commit 5d7a3f0

Browse files
committed
fix cmdstan test failures
1 parent f147881 commit 5d7a3f0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

R/adaptive_run.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,7 @@ adaptive_rank_run_live <- function(state,
24612461
)
24622462
btl_cfg <- .adaptive_btl_resolve_config(state, btl_config)
24632463
btl_cfg$refit_pairs_target <- .adaptive_refit_pairs_target(state, btl_cfg)
2464+
state$config$btl_config <- btl_cfg
24642465
cfg$refit_pairs_target <- btl_cfg$refit_pairs_target
24652466
cfg$stop_thresholds <- btl_cfg
24662467
state$refit_meta$refit_pairs_target_current <- as.integer(btl_cfg$refit_pairs_target)
@@ -2600,6 +2601,7 @@ adaptive_rank_run_live <- function(state,
26002601

26012602
refit_out <- maybe_refit_btl(state, config = btl_cfg, fit_fn = fit_fn)
26022603
state <- refit_out$state
2604+
state$config$btl_config <- refit_out$config
26032605
if (isTRUE(refit_out$refit_performed)) {
26042606
state <- .adaptive_linking_refit_update_state(
26052607
state = state,

tests/testthat/test-5026-adaptive-rank-wrapper.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ test_that("adaptive_rank wrapper supports link_one_spoke import flow", {
614614
expect_true(nrow(out$logs$link_stage_log) >= 1L)
615615
expect_true(all(c("link_transform_policy", "link_transform_state", "reliability_link_global") %in%
616616
names(out$logs$link_stage_log)))
617+
expect_true(is.function(out$state$config$btl_config$cmdstan_fit_fn))
617618
expect_true("rank_link" %in% names(out$items))
618619
})
619620

@@ -659,6 +660,7 @@ test_that("adaptive_rank wrapper supports link_multi_spoke concurrent flow", {
659660
expect_true(nrow(out$logs$link_stage_log) >= 2L)
660661
expect_true(all(c("link_transform_policy", "link_transform_state", "link_epoch_id") %in%
661662
names(out$logs$link_stage_log)))
663+
expect_true(is.function(out$state$config$btl_config$cmdstan_fit_fn))
662664
})
663665

664666
test_that("adaptive_rank wrapper falls back to rank_raw when linked ranks are unavailable", {

0 commit comments

Comments
 (0)