mod bfwt

module bfwt

Budget-Feasible Window Temperature (BFWT / D11).

Combines D6 descent ceiling T_hi = 2 gap / d with D7 escape floor T_lo = b_hat / ln(B + e) and design interior T_des = θ⋆ gap / d:

if T_lo < T_hi { T = clamp(T_des, T_lo, T_hi) } else { T = T_lo }

When b_hat 0, recovers GPMD (T = T_des). Not a dual-annealing global solver; local law under stated models only.

Variables

const EULER_E: f64

Euler e in T_lo = b / log(B + e).

const THETA_STAR: f64

Design θ⋆ = 1/2 (D6 residual-rate operating point).

Functions

fn bfwt_optimize<O, G>(obj: &O, grad: Option<&G>, budget: usize, seed: u64, barrier_hat: f64, x0: Option<ArrayView1<f64>>) -> BfwtResult
where
    O: Objective<f64>,
    G: Gradient<f64>

Run BFWT Metropolis under a work-unit budget.

barrier_hat is an external barrier-depth proxy (same units as f). When zero, temperature reduces to GPMD gap-proportional law.

fn budget_feasible_temp(f: f64, f_best: f64, dim: usize, budget_remaining: f64, barrier_hat: f64) -> (f64, BfwtMode)

BFWT law: clamp design temperature into the D6∩D7 window.

fn t_des(gap: f64, dim: usize) -> f64

Design interior: T_des = θ⋆ * gap / d.

fn t_hi(gap: f64, dim: usize) -> f64

D6 ceiling: T_hi = 2 * gap / d.

fn t_lo(barrier: f64, budget_remaining: f64) -> f64

D7 floor: T_lo = barrier / log(B + e).

fn window_nonempty(gap: f64, dim: usize, barrier: f64, budget_remaining: f64) -> bool

Window nonempty ⇔ barrier * d < 2 * gap * log(B + e).

Enums

enum BfwtMode

Operating mode returned with the temperature.

Design

T = T_des inside the D6∩D7 window.

EscapeFloor

T raised to escape floor (still below descent ceiling).

DescentCap

T capped at descent ceiling.

EscapeForced

Window empty: T forced to escape floor (T_lo ≥ T_hi).

Implementations

impl BfwtMode

Functions

fn as_str(self) -> &'static str

Stable string tag for logs / Python bindings.

Structs and Unions

struct BfwtResult

Result of one BFWT run.

best_pos: Array1<f64>

Best feasible position found.

best_val: f64

Objective at best_pos.

n_evals: usize

Objective evaluations charged.

n_grads: usize

Gradient evaluations charged (polish).

n_accept: usize

Metropolis accepts during the SA phase.

last_mode: BfwtMode

Last BFWT mode applied before polish.