Skip to contents

Load an adaptive session from disk.

Usage

load_adaptive_session(session_dir)

Arguments

session_dir

Directory containing session artifacts.

Value

An adaptive_state object ready for resume.

Details

Restores a persisted Adaptive state and revalidates basic invariants such as schema version, required state fields, and index ranges in step_log. If per-refit item logs are found on disk, they are loaded into state$item_log and persistence is marked as enabled. Resume uses strict schema validation for canonical logs; incompatible saved schemas abort with explicit errors.

Legacy sessions without a saved predictive mode migrate to cold when no predictive prior exists, and btl_only otherwise. An absent pairing strategy migrates to hybrid. Saved TrueSkill values, the connected bootstrap policy, frozen queue and its index, and round progress remain authoritative; loading never recomputes predictions or initializes TrueSkill again.

Predictive-distribution sessions also record a versioned TrueSkill mapping, SD provenance, and integrity digests in state and session metadata. Loading validates their agreement without recomputing predictions or resetting ratings. Legacy sessions retain their existing migration rules and fixed-sigma policy.

metadata.rds records effective warm_start_mode and pairing_strategy, plus bootstrap policy/version and the predictive SHA-256 identity for session-level audit. Predictive queues are verified from frozen inputs and the digest without repeating graph selection. Missing legacy bootstrap policy fields retain shuffled behavior. summarize_adaptive() with include_bootstrap = TRUE exposes the saved bootstrap audit. Direct step logs record pairing_strategy, the presented A-over-B TrueSkill probability p_ij, and target_distance (missing for random pairing). Predictive vectors and provenance are retained once in state$predictive_prior.

Examples

dir <- tempfile("pwllm-session-")
state <- adaptive_rank_start(c("a", "b", "c"), seed = 1)
save_adaptive_session(state, dir, overwrite = TRUE)
restored <- load_adaptive_session(dir)
summarize_adaptive(restored)
#> # A tibble: 1 × 6
#>   n_items steps_attempted committed_pairs n_refits last_stop_decision
#>     <int>           <int>           <int>    <int> <lgl>             
#> 1       3               0               0        0 FALSE             
#> # ℹ 1 more variable: last_stop_reason <chr>