Compare multi-seed runs

Use python -m qdpy.reporting to inspect a result directory from a seed sweep. Give each method or configuration its own group and list the expected seeds. The command reads manifests produced by qdpy.simple.run or QDExperiment and checks the archive SHA-256.

python -m qdpy.reporting --group map=results/map \
    --group cma=results/cma --seeds 7 13 23 --output results/comparison.json

The report marks missing, duplicate, incomplete, and failed runs. An absent manifest appears as missing. Manifests that cannot be assigned to a seed appear separately with their parse errors. Each paired difference subtracts the reference group’s value from the comparison group’s value. Only pairs at the same budget and with matching reporting geometry and objective scales enter the medians.

Sliding Boundaries runs must share the same saved bin edges for a native comparison. A two-objective ParetoGrid uses the worst raw bound of each objective as the hypervolume reference when both are finite. The report includes per-cell sum and global hypervolume, and pairs runs by their per-cell sum. Ordinary QD score is unavailable for a native ParetoGrid. A shared Grid or CVTGrid template instead compares one representative per reporting cell.

Pass --reporting-grid path/to/archive.json to use an existing portable Grid or CVTGrid as the common geometry. Its contents are ignored during projection. This lets you compare archives that use different cells during search. Use the same task and compatible measurement scales across all groups.

Plan retries for a sweep

Supply the resolved YAML configuration for each named group to write a retry plan alongside the report.

python -m qdpy.reporting --group pilot=build/pilot --seeds 7 13 23 \
    --retry-config pilot=examples/rundra/pilot.yaml \
    --retry-plan build/retry-plan.json --output build/sweep-report.json

Each run ID derives from the group name, settings and seed. The plan omits verified completions, marks missing or invalid results for restart, and selects resume when both checkpoint.pkl and evaluations.jsonl are beside the manifest. Duplicate manifests, mismatched configurations, and full-budget runs without a supported portable archive are reported under blocked for inspection. Inspect invalid_manifests in the sweep report for files whose seed could not be established. Paths are absolute on the machine that creates the plan.

See Run a QDpy seed sweep with Rundra for an example that consumes the plan.

Measure once and report on several grids

qdpy.reporting.audit_archive() uses a separate seeded evaluator and takes one best elite per occupied source cell. It aggregates fresh measurements and offers each candidate to every reporting grid. A different choice of geometry therefore uses the same measurements and spends the same audit budget.

from qdpy.benchmarks import illumination_rastrigin_normalised
from qdpy.reporting import audit_archive
from qdpy.results import load_grid

source = load_grid("results/source/archive.json")
rectangular = load_grid("results/templates/rectangular.json")
voronoi = load_grid("results/templates/voronoi.json")

def measure(candidate, seed):
    return illumination_rastrigin_normalised(candidate)

result = audit_archive(source, measure, {"grid": rectangular, "cvt": voronoi},
                       samples=8, seed=101, estimator="mean")
print(result.metrics, result.rollouts, result.failed_rollouts)

For a stochastic evaluator, use the supplied seed to initialize its random generator. The result holds live archives suitable for plotting in addition to coverage and QD scores. See Compare MAP-Elites, CVT-MAP-Elites, and CMA-MAE for a geometry comparison and Run a QDpy seed sweep with Rundra for collecting sweep outputs.

qdpy.reporting.compare_runs(groups, seeds, *, reporting_grid=None)[source]

Return run status and paired metric differences for named directories.

Each directory is scanned for run.json and run_*.json files. Missing, incomplete, duplicate, and invalid runs receive explicit statuses. Successful pairs must have matching grid geometry and objective scale. Two-objective Pareto grids report hypervolume using the worst raw bound of each objective as the common reference when both bounds are finite. A common Grid or CVTGrid reporting template reprojects source archives to one representative per reporting cell.

qdpy.reporting.make_retry_plan(groups, seeds, configurations)[source]

Return a JSON-ready retry plan for one resolved configuration per group.

Each run is identified by its group, configuration fingerprint, and seed. Successful runs are omitted. Duplicate seeds, configuration mismatches, and full-budget runs that cannot export an archive are reported separately. An incomplete or failed run with a checkpoint and journal next to its manifest gets a resume action. Paths are resolved on the planning machine.

qdpy.reporting.audit_archive(archive, evaluate, reporting, *, samples=32, seed=0, estimator='median', executor=None)[source]

Reevaluate one best elite per occupied source cell in a scalar-objective archive.

evaluate(candidate, seed) is the native noisy-QD evaluation interface. reporting maps names to Grid or CVTGrid templates. Each template contributes its geometry and fitness bounds. Its existing elites are ignored. All targets share one set of fresh measurements and keep one elite per cell. The source archive and reporting templates are read-only for the operation.

class qdpy.reporting.ArchiveComparison(archives: dict, metrics: dict, rollouts: int, failed_rollouts: int)[source]

Audited archives, per-geometry metrics, and shared rollout counts.