Dsxir.Optimizer.GEPA.Pareto (dsxir v0.2.0)

Copy Markdown

Per-example Pareto frontier and parent selection for GEPA.

Dominance is over the per-example score axis. nil slots (a failed evaluation on that example) act as -:infinity so an individual that errors on any example is strictly worse than any non-erroring competitor on that axis.

Summary

Functions

Returns the list of individual ids that are best on at least one devset example. Ties are broken by birth order (oldest wins, deterministic).

Weighted random parent: weight ∝ number of devset examples this individual is best on. Falls back to uniform sample from frontier_ids if all weights are zero (impossible by construction but defensive).

Same as frontier/1 but answers whether candidate would join when added. Computes a synthetic frontier including candidate against pop's current members and checks membership.

Functions

dominates?(individual1, individual2)

frontier(pop)

Returns the list of individual ids that are best on at least one devset example. Ties are broken by birth order (oldest wins, deterministic).

select_parent(pop, frontier_ids, rng_state)

Weighted random parent: weight ∝ number of devset examples this individual is best on. Falls back to uniform sample from frontier_ids if all weights are zero (impossible by construction but defensive).

would_join_frontier?(pop, candidate)

Same as frontier/1 but answers whether candidate would join when added. Computes a synthetic frontier including candidate against pop's current members and checks membership.