Architecture Overview#
This section describes Panobbgo’s architecture, explaining how the components fit together and interact during optimization.
High-Level Design#
Panobbgo follows an event-driven, modular architecture where independent components
communicate through an EventBus. This design enables:
Extensibility: Add new heuristics or analyzers without modifying existing code
Composability: Mix and match components to create custom optimization strategies
Decoupling: Components don’t depend directly on each other
Parallelism: Events processed asynchronously in separate threads
Data Flow Diagram#
┌─────────────────────────────────────────────────────────────┐
│ Strategy │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐│
│ │ Heuristic │─────▶│ Point Queue │────▶│ Evaluator ││
│ │ (generates) │ │ │ │ ││
│ └─────────────┘ └──────────────┘ └──────┬──────┘│
│ ▲ │ │
│ │ │ │
│ │ ▼ │
│ ┌──────┴──────┐ ┌──────────────┐ ┌──────────┐ │
│ │ Analyzer │◀──────│ EventBus │◀───│ Results │ │
│ │ (processes) │ │ (publishes) │ │ Database │ │
│ └─────────────┘ └──────────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
Core Components#
StrategyBase#
StrategyBase is the main orchestrator that:
Manages the optimization loop
Coordinates heuristics, analyzers, and evaluators
Tracks budget (number of evaluations)
Manages parallel evaluation of objective functions
Key methods:
__init__(problem, **kwargs): Initialize with problem definitionadd(Heuristic, **kwargs): Register a heuristicadd_analyzer(Analyzer, **kwargs): Register an analyzerstart(): Run the optimization loopexecute(): Abstract method to get next points (implemented by subclasses)
Properties:
best: Current best resultresults: The results databaseheuristics: List of registered heuristicsanalyzers: List of registered analyzers
Results Database#
Results stores all evaluated points in a pandas DataFrame.
Structure:
The DataFrame uses MultiIndex columns:
\((x_0, x_1, \ldots, x_{n-1})\): Coordinate values
\(fx\): Objective function value
\((cv_0, cv_1, \ldots, cv_{m-1})\): Individual constraint violations
\(cv\): Total constraint violation (L2 norm)
\(who\): Name of heuristic that generated this point
\(error\): Estimated error margin
Methods:
add_results(new_results): Add new results and publishnew_resultsevent__len__(): Number of evaluations performed
EventBus#
EventBus implements the publisher-subscriber pattern.
How it works:
Modules define methods named
on_<event_name>(self, **kwargs)EventBus automatically discovers these methods via introspection
When an event is published, one delivery per subscriber is appended to a single FIFO
One dispatcher thread calls the handlers serially, in subscription order
Common events:
Event |
Published By |
Common Subscribers |
|---|---|---|
|
Strategy |
All modules (initialization) |
|
Results |
Analyzers (Best, Splitter, Sensitivity, Restart) |
|
Best analyzer |
Heuristics (NelderMead, Nearby) |
|
Best analyzer |
UI, statistics collectors |
|
Splitter analyzer |
Heuristics (Random) |
|
Sensitivity analyzer |
Heuristics (Nearby — scales perturbations by dimension importance) |
|
Restart analyzer |
Heuristics (reset and re-explore) |
|
Strategy |
All modules (cleanup) |
Module Base Classes#
Module is the abstract parent for Heuristic
and Analyzer.
Lifecycle:
__init__(strategy, **kwargs): Construction with parameter storage__start__(): Called before optimization beginsEvent handlers:
on_<event>()methods invoked during optimization__stop__(): Called when optimization terminates
Properties:
strategy: Reference to the strategyconfig: Configuration objecteventbus: EventBus instanceproblem: Problem definitionresults: Results databaselogger: Logger for this module
Heuristics (Point Generators)#
Heuristic extends Module to generate candidate points.
Architecture#
Each heuristic maintains:
Output queue: FIFO queue with configurable capacity (default: 20)
Active state: Whether it’s still generating points
Performance score: Tracked by StrategyRewarding for adaptive selection
Key methods:
emit(x)oremit([x1, x2, ...]): queue coordinate vectors (numpy arrays; they are projected into the box and wrapped in aPoint)get_points(limit): Drain up tolimitpoints from queueactive: Property indicating if heuristic has more points
Typical pattern:
class MyHeuristic(Heuristic):
def on_start(self):
# Generate initial points
for i in range(10):
x = self.problem.random_point(rng=self.rng)
self.emit(x)
def on_new_best(self, best):
# React to improvements
x_new = best.x + 0.1 * self.rng.standard_normal(self.problem.dim)
x_new = self.problem.project(x_new)
self.emit(x_new)
Implemented Heuristics#
Initialization:
Space-filling:
LatinHypercube: Stratified sampling with parameterdivSobol: Low-discrepancy Sobol’ quasi-random sequence with parametern(powers of two preferred); Owen-scrambled by default so different reps see independent point setsExtremal: Samples from box boundariesRandom: Uniform sampling in best leaf box
Local refinement:
Nearby: Perturbations around best; sensitivity-aware whenSensitivityis active — scales perturbations along each dimension proportionally to its importance scoreWeightedAverage: Averages points in best region
Model-based (surrogate):
QuadraticWlsModel: Weighted least-squares quadratic surrogateGaussianProcessHeuristic: Gaussian Process surrogate with EI / UCB / PI acquisition functions (scikit-learn backend). Supports constrained Expected Improvement (EIC) when the problem has active constraint violations. Gold standard for expensive black-box optimization — builds an accurate probabilistic model and queries it via the acquisition function.ClaudeHeuristic: Mixture of Gaussians over elite points (cluster-based adaptive search)
Classical optimizers:
NelderMead: Randomized simplex methodLBFGSB: Multi-start, bound-constrained quasi-Newton (L-BFGS-B) local optimizer in a subprocess. The only gradient-based arm (finite-difference gradients); restarts from fresh random points across the budget and warm-starts at the Restart analyzer’s centre. Excels on smooth ill-conditioned valleys (Rosenbrock) where a single dedicated descent reaches the optimum in a fraction of a population method’s budget.COBYQA: Powell-family derivative-free trust-region local optimizer (Ragonneau-Zhang 2023) — curvature-aware quadratic-model refinement in a subprocess.
Population-based (global search):
CMAES: Covariance Matrix Adaptation Evolution Strategy with IPOP and BIPOP restart support. The gold standard for derivative-free optimization of continuous functions. Maintains a multivariate Gaussian search distribution N(m, σ²C) and adapts both the step size σ and covariance matrix C online. Invariant under order-preserving objective transformations and orthogonal search-space transformations; excels on ill-conditioned and ridge-following problems such as Rosenbrock. Implemented in pure NumPy with asynchronous generation tracking that is compatible with panobbgo’s threaded evaluation model.When paired with the
Restartanalyzer, the heuristic supports two restart schemes selected byrestart_mode:"ipop"— IPOP-CMA-ES (Increasing Population CMA-ES; Auger & Hansen, CEC 2005): each restart multiplies the population size λ →ipop_factor· λ (default 2.0), resets the covariance to identity, and moves the search mean to a new diverse center. Good for moderately multimodal problems."bipop"— BIPOP-CMA-ES (Hansen, GECCO 2009): alternates between two restart regimes — a large regime with geometric population growth (λ_l = 2^k · λ_default) and a small regime with a small population and a random small step size (σ_s = σ_default · 10^(-2·U[0,1])). After each restart, the regime that has consumed fewer cumulative evaluations is selected next, balancing exploitation (large regime fits the local geometry) with exploration (small regime probes diverse regions cheaply). This is the BBOB-2009 winning algorithm and the de-facto gold standard for highly multimodal problems with limited evaluation budget.
Both schemes preserve the accumulated result history; only the CMA-ES distribution state is reset.
DifferentialEvolution: Differential Evolution mutation/crossover/selection operators (DE/rand/1/binwith fixedF = 0.8andCR = 0.9) run against the accumulated result database. Excels on multimodal landscapes such as Rastrigin and Schwefel where purely local methods get trapped.LSHADE: Linear-population-reduction Success-History Adaptive Differential Evolution (Tanabe & Fukunaga, CEC 2014 winner). AdaptsFandCRper-trial via per-bin Cauchy / Normal memories that update each generation by the weighted Lehmer mean of successful triples; uses thecurrent-to-pbest/1mutation (Zhang & Sanderson 2009) with an external archive of replaced parents. The population shrinks linearly fromNP_init(default"auto", budget-adaptive) down toNP_min(default 4) over the strategy’s evaluation budget — broad exploration early, focused exploitation late. Strictly stronger than the basic DE on multimodal benchmarks; opt-in (strategy.add(...)). Also supports IPOP-style warm restarts viaRestart.JSO: jSO refinement of L-SHADE (Brest, Maučec & Bošković, CEC 2017 winner). Direct subclass ofLSHADEthat adds three literature-best refinements: a weightedcurrent-to-pbest-w/1mutation (the pbest direction is re-weighted by a phase-dependentF_wfactor —0.7·Fearly,0.8·Fmid,1.2·Flate); a linearp_bestschedule (0.25 → 0.125); and Cauchy-F clamping that limits sampledFto0.7whileprogress < 0.6; CR floors (CR ≥ 0.7whileprogress < 0.25,≥ 0.6while< 0.5). Thep_bestschedule and the rest follow the authors’ reference code where it differs from the paper text (the paper’spformula rises0.125 → 0.25, the code’s falls). The history memory usesM_F = 0.3/M_CR = 0.8initial values, averages each update with the old value (M ← (mean_WL + M) / 2, from iL-SHADE) and reserves the last bin (H − 1) as an anchor sampled as0.9 / 0.9. Inherits L-SHADE’s asynchronous pipeline (per-slot pending dict, generation-by-count book-keeping, archive trimming, LPSR shrinking, warm restart) unchanged. Add L-SHADE and jSO side by side and a bandit strategy picks whichever DE-family variant wins on the current battery.NLSHADE_RSP: NL-SHADE-RSP (Stanovov, Akhmedova & Semenkin, CEC 2021 winner), a direct subclass ofLSHADEfollowing the authors’ reference code: Non-Linear Population Size Reduction (NP(r) = round((NP_min − NP_init)·r^(1−r) + NP_init)); rank-based selective pressure on the population draw ofr2(weightsexp(−i/NP), best first;r1uniform); an archive of2.1·NPused forr2with an adaptive probabilityp_A(from the archive vs. population success of the last generation, clipped to[0.1, 0.9]); a per-generation coin between binomial (CR_b = 0, then2(r − 0.5)in the second half) and exponential crossover with the sampledCRhanded out sorted by fitness;pbestshare rising0.2 → 0.4;H = 20·Dbins at0.2; plain Lehmer memory; uniform resampling of out-of-box components. None of jSO’s machinery (F cap, anchor bin,F_w, CR floors, memory averaging). Deviations:NP_init="auto"(measured) and the asynchronous generation model.NLSHADE_LBC: NL-SHADE-LBC (Stanovov, Akhmedova & Semenkin, CEC 2022 winner), a subclass ofNLSHADE_RSPwith Linear Bias Change in the success-history memory update: the F / CR Lehmer-mean orderpis linearly scheduled across budget progress (p_F: 3.5 → 1.5,p_CR: 1.0 → 1.5) with spreadm_lbc = 1.5; atp = 2, m = 1the formula recovers the standard weighted Lehmer mean. Otherwise per the paper: rank pressureexp(−4i/NP)onr2, fixedp_A = 0.5, archive1.0·NPwith fitness-probed replacement,pbestshare0.2 → 0.3, binomial crossover only (sortedCR), out-of-bounds trials regenerated up to 100 times before the midpoint repair,H = 20·Dbins atM_F = 0.5/M_CR = 0.9. Deviations:NP_init="auto"with coefficient4(measured) and the asynchronous generation model.LSHADE_EpSin: LSHADE-EpSin refinement of L-SHADE (Awad, Ali & Suganthan, CEC 2016). Direct subclass ofLSHADEthat replaces the SHADE Cauchy-from-memoryFsampler with an ensemble of two sinusoidal candidates during the first half of the search. Sinusoid 1 uses a fixed frequency (0.5) with a decreasing amplitude envelope(G_max − g) / G_max; Sinusoid 2 draws its frequency from an adaptiveCauchy(μ_freq, 0.1)clamped to(0, 1]and pairs it with an increasing envelopeg / G_maxand a+πphase shift. Each trial picks one of the two sinusoids with probabilityp_supdated each generation from a Laplace-smoothed Sinusoid-1 success rate;μ_frequpdates via the unweighted Lehmer mean of successful Sinusoid-2 frequencies. In the second half (progress ≥ 0.5) EpSin reverts to the SHADE Cauchy-from-memoryFsampling — byte-identical to L-SHADE.CRis always sampled from a SHADE Normal bin (unchanged in both phases). Different branch of the DE family tree from jSO / NL-SHADE-RSP — all the other DE arms adaptFvia the Cauchy memory; EpSin’s deterministic-amplitude sinusoid is algorithmically distinct. All six DE-family arms (DE / L-SHADE / jSO / NL-SHADE-RSP / NL-SHADE-LBC / LSHADE-EpSin) are opt-in; add several and a bandit strategy picks whichever wins on the current battery. Direct precursor of the CEC-2017 co-winner LSHADE-cnEpSin (the same ensemble plus a covariance-matrix step — not ported here; CMA-ES is a separate Panobbgo heuristic).PSO: Asynchronous Particle Swarm Optimization with the canonical Clerc–Kennedy (2002) constriction-coefficient parameters (w = χ ≈ 0.7298,c1 = c2 ≈ 1.49618). Each particle carries a position, a velocity, and a memory of its personal best; on every step the velocity is pulled toward the personal best and toward the swarm best the particle is allowed to see with random per-component weights. Three swarm topologies select that visible attractor:"gbest"(default) — every particle sees the single global best;"lbest"— a wrap-around ring of width2·k_neighbors + 1(Kennedy & Mendes 2002), trading slower information diffusion for stronger multimodal exploration;"vonneumann"— a 4-connected 2-D toroidal grid (Kennedy & Mendes 2003; Mendes 2004) that sits between the two, widely cited as a stable middle ground that wins on a broader range of problem classes; or"random"— a stochastic informer graph (Mendes 2004; Clerc 2007 / SPSO 2011) where each particle is connected to itself plusk_neighborsrandom informers re-sampled aton_startandon_restart, a structure-free middle ground whose diffusion speed depends on the realised graph. Undertopology="random", an optionalstagnation_threshold(Clerc 2007 / SPSO 2011 stochastic-K) re-samples the informer graph mid-run when the swarm fails to lift its global best forstagnation_thresholdconsecutive incoming results — a finer-grained stagnation rebuild than restart-gated re-sampling alone (under theRestartanalyzer restarts are rare, so a bad realised graph can otherwise stay locked in for hundreds of iterations).stagnation_threshold=None(default) preserves the static-between-restarts behaviour. An opt-inw_endargument enables the Shi–Eberhart (1998) linearly-decreasing inertia schedule paced by the strategy’s evaluation budget; the default constantwreproduces the original Clerc-Kennedy behaviour. PSO’s momentum and social dynamics are markedly different from CMA-ES (covariance re-sampling) and DE (recombination of three random members) — fast contraction once a basin is found, while inertia retains the prior search direction. Velocities are clamped to a configurable fraction of each box dimension to prevent the swarm from exploding outside the search box. Supports IPOP-style warm restarts via theRestartanalyzer: on arestartevent the swarm is scattered around the suggested center and the global memory is wiped while the strategy keeps its accumulated result history. Withwarm_startset the swarm re-seeds from the shared archive instead, but only when the archive’s best point lies outside the stagnated basin (the bounding box of the swarm’s positions and evaluated personal bests); otherwise it restarts around the center like a cold swarm.
Constraint-focused:
FeasibleSearch: Beta(2,1)-biased line search between the last feasible and last infeasible point; efficiently locates the constraint boundary.ConstraintGradient: Approximate constraint gradient via finite-differences; perturbs the best infeasible point in the direction that most reduces constraint violation.LocalPenaltySearch: Local search with an adaptive penalty function to steer towards feasibility while minimising the objective.ConstraintRepair: Repairs infeasible points by projecting them back into the feasible region using nearest-feasible-point logic.
Analyzers (Result Processors)#
Analyzer extends Module to process results and maintain derived information.
Architecture#
Analyzers typically:
Subscribe to
new_resultseventMaintain internal state (Pareto front, spatial decomposition, statistics)
Publish derived events to trigger heuristics or other analyzers
Implemented Analyzers#
Best Tracker
Best maintains:
Best feasible point (\(CV(x) = 0\), minimum \(f(x)\))
Best infeasible point (minimum \(CV(x)\))
Pareto front of \((f(x), CV(x))\) pairs
Events published:
new_best: New best point (considering constraints)new_min: New minimum \(f(x)\) among feasible pointsnew_cv: New minimum \(CV(x)\)new_pareto: Pareto front updated
Splitter
Splitter manages hierarchical box decomposition.
Best and Convergence are installed by every strategy; the Splitter
only when a module declares that it reads it, via the class attribute
requires_analyzers = ("Splitter",) (Random, NelderMead,
QuadraticWlsModel, WeightedAverage, RegionUCB, MetaAnalyst) or,
for heuristics whose need depends on arguments, by overriding
required_analyzers() (every heuristic with a warm_start does). A custom
module that calls strategy.analyzer("Splitter") must declare it too.
Maintains tree of boxes splitting the search space
Splits boxes when they contain sufficient points — the threshold is derived from a target leaf population (
leaf_size,min_leaf_size,max_leaves), so the resolution scales with the evaluation budget;split_rule/cut_rulechoose the cut, andlegacy=Truerestores the pre-2026-09-10 fixed-resolution treeIdentifies “best leaf box” containing current best point
See Splitter Resolution in Usage Guide for the knobs and the measured effect on the consumers that read the tree.
Events published:
new_split: A box was split into children
Sensitivity
Sensitivity estimates per-dimension importance from
evaluation history using rank correlation. Publishes new_sensitivity events that heuristics
can use to focus search on the most influential dimensions.
Events published:
new_sensitivity: Importance scores for each dimension (array in [0, 1])
Restart
Restart detects search stagnation (no improvement in
patience evaluations) and publishes restart events with a suggested new center point.
Enables multi-start optimization without losing accumulated results.
Events published:
restart: New center point and reason string
Strategies (Orchestration)#
Strategy subclasses implement the execute() method to determine which points to evaluate next.
StrategyRoundRobin#
StrategyRoundRobin cycles through heuristics in fixed order:
def execute(self):
points = []
for h in self.heuristics:
points.extend(h.get_points(batch_size))
return points
Characteristics:
Predictable, deterministic
No adaptation to problem
Good baseline for comparison
StrategyRewarding#
StrategyRewarding implements multi-armed bandit:
def execute(self):
points = []
# Calculate selection probabilities based on performance
for h in self.heuristics:
prob = (h.performance + smooth) / (total_performance + smooth * |H|)
nb_points = round(target * prob)
points.extend(h.get_points(nb_points))
return points
Characteristics:
Adaptive: learns which heuristics work
Probabilistic: maintains exploration
Reward function: \(R(x) = 1 - e^{-(f_{best} - f(x))}\)
Discount factor: causes old successes to fade
StrategyUCB#
StrategyUCB extends the multi-armed bandit with an Upper
Confidence Bound selection rule (UCB1 / UCB-tuned variant):
where \(\bar{r}_h\) is the average reward, \(N\) is total selections, \(n_h\) is selections of heuristic \(h\), and \(C\) is an exploration constant. UCB provides a principled exploration–exploitation trade-off with theoretical regret bounds.
StrategyThompsonSampling#
StrategyThompsonSampling uses Thompson Sampling (Beta–
Bernoulli bandit) to select heuristics. Each heuristic maintains a Beta posterior
\(\text{Beta}(\alpha_h, \beta_h)\) over its success probability. At each step, an arm is
selected by drawing a sample from each posterior and picking the largest.
Advantages: Naturally balances exploration and exploitation; often outperforms UCB in practice.
StrategyLinUCB#
StrategyLinUCB implements a contextual bandit using
disjoint linear UCB models. Each heuristic has its own linear reward model:
where \(s\) is a feature vector capturing budget progress, recent success rate, and a bias term. LinUCB adapts selection to the current optimization context, not just historical averages.
StrategyPhased#
StrategyPhased divides the evaluation budget into phases.
Each phase can use a different sub-strategy or heuristic portfolio. The phase transitions are
triggered by evaluation count, enabling a two-stage approach (e.g., initial exploration followed
by focused exploitation).
Typical usage: Phase 1 = LatinHypercube global exploration → Phase 2 = GP-guided exploitation.
Execution Flow#
Initialization Phase#
User creates Strategy with Problem:
strategy = StrategyRewarding(problem, max_evaluations=1000)User registers heuristics and analyzers:
strategy.add(LatinHypercube, div=5) strategy.add(Random) strategy.add_analyzer(Best) strategy.add_analyzer(Splitter)
User calls
strategy.start()
Startup#
Strategy initializes the evaluation environment
Strategy calls
__start__()on all modulesEventBus publishes
starteventModules initialize (e.g., LatinHypercube generates initial grid)
Main Loop#
While budget remaining:
Generate points:
points = strategy.execute() # Get points from heuristicsEvaluate in parallel:
# Send points to evaluation environment results = strategy._evaluate(points)
Store results:
results_db.add_results(results)Publish event:
eventbus.publish("new_results", results=results)Analyzers process:
Best checks for improvements → publishes
new_bestif foundSplitter updates box tree → publishes
new_splitif box split
Heuristics react:
NelderMead starts simplex on
new_bestRandom updates sampling region on
new_split
Check termination:
if len(results_db) >= max_evaluations: break
Termination#
EventBus publishes
finishedeventModules call
__stop__()for cleanupStrategy returns
bestresult
Threading Model#
Event Handling#
Events are delivered serially by one dispatcher thread:
Non-blocking: publishing returns immediately; the event is queued
Ordered: handlers run one after the other, in the order the events were published
Handlers must return promptly — a module reacts to events, it never loops, sleeps or waits inside a handler. Subprocess bridges such as
LBFGSBobey this by storing the result in their handler and doing the pipe round trip inproduce(), on the strategy’s own thread — no private thread is involvedFire-and-forget: a handler’s return value, if any, is passed to
emit
Because no two handlers ever run at the same time, module state needs no
locking. The sequence of handler calls is a pure function of the sequence of
publish calls, which is what makes a seeded run reproducible:
wait_idle() blocks until every queued event
(and the events those handlers published) has been handled, and the
synchronous evaluation mode (config.sync_evaluation) waits for that before
every draw of new points.
Randomness: every module owns a numpy.random.Generator
(self.rng) derived from the strategy’s master seed and the module’s
name (spawn_rng()), so adding or removing
one module does not change another’s stream; modules never touch the global
numpy.random state.
Parallel Evaluation#
Function evaluations can run in parallel using different engines:
Threaded (Default): Evaluations run in a local thread pool. Suitable for lightweight functions or when running on a single machine.
Dask Distributed: Connects to a Dask cluster for large-scale distributed evaluation. All Dask-specific code lives in
panobbgo.dask_evaluationand is imported lazily — install the optional extra (pip install panobbgo[dask]oruv sync --extra dask) to use it.
Dask setup (optional):
# Start local cluster with 4 workers
dask scheduler &
dask worker localhost:8786 --nworkers 4 &
Configuration#
The evaluation and Dask settings are read from config.yaml in the
working directory only; ~/.panobbgo/config.ini has no section for them.
evaluation:
method: threaded # or 'processes' or 'dask'
timeout: 60 # optional per-call limit in seconds (see below)
dask: # top level, not under 'evaluation'
cluster_type: remote # 'local' (default) starts a LocalCluster
remote:
scheduler_address: tcp://localhost:8786
local: # used when cluster_type is 'local'
n_workers: 2
threads_per_worker: 1
processes evaluates in a pool of spawned worker processes
(panobbgo.local_pool): the problem must be picklable, and the script
needs an if __name__ == "__main__": guard (Scripts That Start Worker Processes: the __main__ Guard). Each worker evaluates its own
copy of the problem, so state the problem object accumulates while
evaluating (evaluation counters, traces, caches, loggers) lives in the
workers and is not visible on the caller’s object. A worker that crashes
fails only its own evaluation, which still counts against max_eval.
evaluation.timeout (seconds, default unset = no limit) is a per-call
limit that applies to every evaluation in every backend and is enforced
where the evaluation runs. The clock starts when the call starts — time
spent queued never counts. An evaluation past the limit becomes a regular
result with fx = NaN and cv = inf (infeasible; the violations are
unknown, so cv_vec is None and the frame’s cv_vec columns are
NaN), marked Result.timed_out and in the ("timed_out", 0)
column of the results frame; it is recorded, charged once against
max_eval and published through new_results like any result, so
heuristics see a bad point and every ranking puts it last.
processes: exactly the worker process running that call is killed (a fresh one replaces it); every other in-flight evaluation keeps running.dask: the task on the dask worker runs the objective in a child process (panobbgo.timeout_call.call_with_timeout()) and kills that child when the call runs too long, so a hung objective never holds its worker. The problem must be serializable and importable in a fresh interpreter on the worker (checked once before the first task). Each call evaluates a fresh copy of the problem, so state it accumulates while evaluating does not carry over between calls — e.g. aNoisyProblemwithresample=Truedraws the same noise on every re-evaluation (a warning says so). Without a timeout the objective runs in the worker itself, as before.threaded: a thread cannot be killed — a timed-out call is abandoned: it keeps running in the background and its result is discarded; abandoned threads are counted and warned about. Useprocessesor dask for objectives that can hang. Withevaluation.sync, a timeout routes each batch through the thread pool, harvested in submission order.
An objective that raises is still a failed evaluation (no result,
failed_evaluations event).
Long evaluations and the deadlock backstop. Evaluations may take hours
and run remotely; the main loop then sits idle, waiting, and that is not a
stall. Any outstanding evaluation counts as progress for as long as it
takes: a running thread, a process task that has started or is queued for
live workers, and any outstanding dask future — the client cannot reliably
tell queued from running, so every one is treated as “waiting”. One
evaluation’s run time is limited only by the opt-in evaluation.timeout.
core.deadlock_seconds (default 600) is an error backstop for a bug and
fires only when there is nothing to wait for: no evaluation outstanding
anywhere, yet the run reports itself alive (a heuristic claims a point it
never gives, an event handler never returns, queued evaluations have no live
worker) and nothing has changed for that long. Tripping it is logged at
ERROR level and ends the run. Waiting is not silent either: while
evaluations are outstanding and none finishes, a WARNING every
deadlock_seconds reports how many are outstanding, how long ago the
oldest started (or was submitted) and the evaluation.timeout setting;
for dask it also warns when the cluster reports zero workers.
The heuristic queue size can be set in either file (YAML
heuristic: capacity: 20, or in config.ini):
[heuristic]
capacity = 20 # Heuristic queue size
Extension Points#
To extend Panobbgo:
Add a heuristic: Subclass
HeuristicAdd an analyzer: Subclass
AnalyzerAdd a strategy: Subclass
StrategyBaseDefine a problem: Subclass
ProblemCreate custom events: Publish with
eventbus.publish(event_name, **kwargs)
See Extending Panobbgo for detailed examples.
Design Principles#
The architecture follows these principles:
- Modularity
Components are independent and interchangeable
- Event-driven
Loose coupling through EventBus
- Composability
Mix and match heuristics, analyzers, strategies
- Extensibility
Add new components without modifying existing code
- Parallelism
Designed for distributed evaluation from the start
- Transparency
All events and data flows are observable and logged