# Elja Lennard-Jones probe.
# Launch with the profile, which caps concurrency:
#   snakemake --profile profiles/elja --config sizes=75 seeds=0
# An empty config submits nothing. The build script refuses to write
# the cargo target onto /users/home.

configfile: "config/elja_lj.yaml"


import os

SIZES = [s.strip() for s in str(config.get("sizes", "")).split(",") if s.strip()]
SEEDS = [s.strip() for s in str(config.get("seeds", "")).split(",") if s.strip()]

# Default campaign stamps stay under /work. ANNEAL_STAMP_ROOT points a test
# or a second run at an empty directory so host stamps are not missing outputs.
STAMP_ROOT = os.environ.get("ANNEAL_STAMP_ROOT", "/work/anneal-snakemake")


rule all:
    input:
        expand("results/elja/n{n}/seed{seed}.log", n=SIZES, seed=SEEDS),


rule lj_seed:
    output:
        "results/elja/n{n}/seed{seed}.log",
    params:
        budget=config["budget"],
        arm=config["arm"],
    resources:
        runtime=480,
        mem_mb=16000,
        cpus_per_task=4,
    shell:
        """
        set -euo pipefail
        export LJ_ROOT="$PWD"
        bash scripts/elja_build_lj.sh
        source scripts/elja_scratch.sh
        elja_enter_scratch
        trap elja_leave_scratch EXIT
        SEED_OFFSET={wildcards.seed} \
          "$LJ_ROOT/target/release/examples/lj_cluster_search" \
          {wildcards.n} {params.budget} 1 {params.arm} \
          > "$ELJA_SCRATCH/seed.log" 2>&1
        elja_publish "$ELJA_SCRATCH/seed.log" {output}
        """


# Gupta zinc and Cu19Au19 against the ASE genetic algorithm.
# Not part of `rule all`. One serial session, both arms, Cambridge budgets:
#   snakemake -s workflow/Snakefile metal_h2h
rule metal_h2h:
    output:
        touch(STAMP_ROOT + "/metal_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_bench.sh
        """

# Darby Cu-Au against GMIN's binary Gupta, at the paper call budgets.
# Not part of `rule all`. Run it by name:
#   snakemake -s workflow/Snakefile metal_darby_h2h
rule metal_darby_h2h:
    output:
        touch(STAMP_ROOT + "/metal_darby_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_darby.sh
        """


# Reduced Sutton–Chen against GMIN. Not part of `rule all`.
#   snakemake -s workflow/Snakefile sc_h2h
rule sc_h2h:
    output:
        touch(STAMP_ROOT + "/sc_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_sc.sh
        """


# Twelve-seed Sutton–Chen against GMIN. Appends rows. The six-seed
# table above is left as it is. Not part of `rule all`.
#   snakemake -s workflow/Snakefile sc_h2h_n12 --cores 1 --force
rule sc_h2h_n12:
    shell:
        """
        set -euo pipefail
        bash scripts/metal_h2h/enter_sc_n12.sh
        """


# Raw Sutton-Chen rows from the anneal binary. Finished seeds are kept.
# Not part of `rule all`.
#   snakemake -s workflow/Snakefile sc_search_rows
rule sc_search_rows:
    output:
        touch(STAMP_ROOT + "/sc_search_rows.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_sc_rows.sh restart pop
        """


# Medians of the whole-walk restart trials. Reads the twelve-seed anneal
# rows and the restart runs; it does not launch a search. Not part of
# `rule all`.
#   snakemake -s workflow/Snakefile sc_restart_summary
rule sc_restart_summary:
    input:
        "bench/metal-cluster-h2h/sc-n12/seeds.csv",
        "bench/metal-cluster-h2h/sc-restart/rows.csv",
    output:
        touch(STAMP_ROOT + "/sc_restart_summary.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        python3 scripts/metal_h2h/summarise_sc_restart.py
        """


# Medians of the two-walker population. Reads the twelve-seed anneal
# rows and the population runs; it does not launch a search. Not part
# of `rule all`.
#   snakemake -s workflow/Snakefile sc_pop_summary
rule sc_pop_summary:
    input:
        "bench/metal-cluster-h2h/sc-n12/seeds.csv",
        "bench/metal-cluster-h2h/sc-pop/rows.csv",
    output:
        touch(STAMP_ROOT + "/sc_pop_summary.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        python3 scripts/metal_h2h/summarise_sc_pop.py
        """


# Medians of the half-budget chain. Reads the twelve-seed anneal rows
# and the chain runs; it does not launch a search. Not part of `rule all`.
#   snakemake -s workflow/Snakefile sc_chain_summary
rule sc_chain_summary:
    input:
        "bench/metal-cluster-h2h/sc-n12/seeds.csv",
        "bench/metal-cluster-h2h/sc-chain/rows.csv",
    output:
        touch(STAMP_ROOT + "/sc_chain_summary.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        python3 scripts/metal_h2h/summarise_sc_chain.py
        """


# Medians of the record-share portfolio. Reads the twelve-seed anneal
# rows and the portfolio runs; it does not launch a search. Not part of
# `rule all`.
#   snakemake -s workflow/Snakefile sc_portfolio_summary
rule sc_portfolio_summary:
    input:
        "bench/metal-cluster-h2h/sc-n12/seeds.csv",
        "bench/metal-cluster-h2h/sc-portfolio/rows.csv",
    output:
        touch(STAMP_ROOT + "/sc_portfolio_summary.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        python3 scripts/metal_h2h/summarise_sc_portfolio.py
        """


# anneal, openconf and CREST iMTD-GC on drug-like molecules, MMFF94 for the
# two RDKit arms and GFN-FF for CREST. Not part of `rule all`. The budgets
# come from the openconf pilot (`enter_bench.sh pilot`):
#   snakemake -s workflow/Snakefile openconf_h2h
rule openconf_h2h:
    input:
        "bench/openconf-h2h/molecules.csv",
        "bench/openconf-h2h/budgets.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/openconf_h2h/enter_bench.sh campaign
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh score
        """


# anneal against openconf alone, seeds 2000-2011, MMFF94 for both. anneal
# may make as many energy plus gradient calls as openconf made on the same
# seed. Rows are appended with code_revision and host. Not part of `rule all`:
#   snakemake -s workflow/Snakefile openconf_h2h_n12
rule openconf_h2h_n12:
    input:
        "bench/openconf-h2h/molecules.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h_n12.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        OPENCONF_H2H_CREST=0 bash scripts/openconf_h2h/enter_bench.sh paired
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score
        """


# The paired n=12 run with a third arm, anneal at develop 92bc5805, at the
# same budget as the branch's anneal arm. Not part of `rule all`:
#   snakemake -s workflow/Snakefile openconf_h2h_conf_fix
rule openconf_h2h_conf_fix:
    input:
        "bench/openconf-h2h/molecules.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h_conf_fix.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        OPENCONF_H2H_CREST=0 OPENCONF_H2H_BASELINE=92bc5805b476b529c90ab3b2c1db4b48c97ab93a \
            bash scripts/openconf_h2h/enter_bench.sh paired --tree conf-fix \
            --baseline /work/openconf-h2h/baseline
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score \
            --tree conf-fix --baseline /work/openconf-h2h/baseline \
            --results bench/openconf-h2h/conf-fix
        """


# The same three arms with the stereocentre hold on, develop
# at 7d8fa6ea, and xld alone again at 24 seeds. Not part of `rule all`:
#   snakemake -s workflow/Snakefile openconf_h2h_conf_fix3
rule openconf_h2h_conf_fix3:
    input:
        "bench/openconf-h2h/molecules.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h_conf_fix3.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        OPENCONF_H2H_CREST=0 OPENCONF_H2H_BASELINE=7d8fa6ea6ec819a197b5390d87abab28423fd967 \
            bash scripts/openconf_h2h/enter_bench.sh paired --tree conf-fix3 \
            --baseline /work/openconf-h2h/baseline
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired \
            --tree conf-fix3-xld24 --baseline /work/openconf-h2h/baseline \
            --molecules xld --seeds $(seq 2000 2023)
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score \
            --tree conf-fix3 --baseline /work/openconf-h2h/baseline \
            --results bench/openconf-h2h/conf-fix3
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score \
            --tree conf-fix3-xld24 --baseline /work/openconf-h2h/baseline \
            --results bench/openconf-h2h/conf-fix3/xld24
        """


# The same three arms with the measured energy scale on, develop at
# 7d8fa6ea. Not part of `rule all`:
#   snakemake -s workflow/Snakefile openconf_h2h_conf_fix4
rule openconf_h2h_conf_fix4:
    input:
        "bench/openconf-h2h/molecules.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h_conf_fix4.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        OPENCONF_H2H_CREST=0 OPENCONF_H2H_BASELINE=7d8fa6ea6ec819a197b5390d87abab28423fd967 \
            bash scripts/openconf_h2h/enter_bench.sh paired --tree conf-fix4 \
            --baseline /work/openconf-h2h/baseline
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score \
            --tree conf-fix4 --baseline /work/openconf-h2h/baseline \
            --results bench/openconf-h2h/conf-fix4
        """



# The molecules whose hits moved in conf-fix4, again at 24 seeds in the
# same session. Not part of `rule all`:
#   snakemake -s workflow/Snakefile openconf_h2h_conf_fix4_n24
rule openconf_h2h_conf_fix4_n24:
    input:
        "bench/openconf-h2h/conf-fix4/stats-develop.csv",
    output:
        touch(STAMP_ROOT + "/openconf_h2h_conf_fix4_n24.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        OPENCONF_H2H_CREST=0 OPENCONF_H2H_BASELINE=7d8fa6ea6ec819a197b5390d87abab28423fd967 \
            bash scripts/openconf_h2h/enter_bench.sh paired --tree conf-fix4-n24 \
            --baseline /work/openconf-h2h/baseline \
            --molecules 915 xld fluvastatin z34 lopinavir lorlatinib --seeds $(seq 2000 2023)
        OPENCONF_H2H_SKIP_BUILD=1 bash scripts/openconf_h2h/enter_bench.sh paired-score \
            --tree conf-fix4-n24 --baseline /work/openconf-h2h/baseline \
            --results bench/openconf-h2h/conf-fix4/n24
        """

# Gradients per GFN2 quench: anneal L-BFGS and TRIC against geomeTRIC.
# Not part of `rule all`:
#   snakemake -s workflow/Snakefile tric_quench
rule tric_quench:
    output:
        touch(STAMP_ROOT + "/tric_quench.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/tric_quench/enter_bench.sh
        """


# Cleri–Rosato Pt–Cu against GMIN. Not part of `rule all`.
#   snakemake -s workflow/Snakefile ptcu_h2h
rule ptcu_h2h:
    output:
        touch(STAMP_ROOT + "/ptcu_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_ptcu.sh
        """


# GMIN against the recommended preset on Cambridge Morse clusters.
# Not part of `rule all`. Run it by name:
#   snakemake -s workflow/Snakefile morse_h2h
rule morse_h2h:
    output:
        touch(STAMP_ROOT + "/morse_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/morse_h2h/enter_bench.sh
        """


# M55, M70 and M80 against GMIN at rho 3, 6, 10 and 14.
# Not part of `rule all`. Twelve seeds, paper budgets:
#   snakemake -s workflow/Snakefile morse_panel
rule morse_panel:
    output:
        touch(STAMP_ROOT + "/morse_panel.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/morse_panel/enter_bench.sh
        """


# Time spent between quenches on M80 at rho = 3. Not part of `rule all`.
#   snakemake -s workflow/Snakefile morse_hop
rule morse_hop:
    output:
        touch(STAMP_ROOT + "/morse_hop.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/morse_hop/enter_bench.sh
        """


# Morse against GMIN: M30, M38, M55 and M80 at rho 6 and 14, plus
# M80 at rho 3. Not part of `rule all`. Twelve seeds, paper budgets.
# A stored GMIN row is kept when the source revision still matches.
#   snakemake -s workflow/Snakefile morse_gmin
rule morse_gmin:
    output:
        touch(STAMP_ROOT + "/morse_gmin.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/morse_gmin/enter_bench.sh
        """


# Morse rho = 14, M55 and M80, twelve seeds, paper budgets.
# Not part of `rule all`. GMIN rows already stored at these budgets
# are kept, and each seed outside that table is appended.
#   snakemake -s workflow/Snakefile morse14_h2h
rule morse14_h2h:
    output:
        touch(STAMP_ROOT + "/morse14_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/morse14_h2h/enter_bench.sh
        """


# Gupta Au55, twelve seeds, paper budget. The sphere and the neighbor
# shell follow a physical opening quench. Not part of `rule all`.
#   snakemake -s workflow/Snakefile au55_scale
rule au55_scale:
    output:
        touch(STAMP_ROOT + "/au55_scale.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/au55_scale/enter_bench.sh
        """


# Stillinger-Weber silicon and Tersoff carbon, anneal against GMIN and ASE
# basin hopping: the third panel, twelve seeds, the paper budgets, serial
# on core 0. The "v2" arms are develop's build at 7da10659. Needs rgpot's
# covalent library and ASE (paths in the scripts). Not part of `rule all`.
#   snakemake -s workflow/Snakefile covalent_h2h
rule covalent_h2h:
    output:
        touch(STAMP_ROOT + "/covalent_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        BENCH_OUT=v3 BEFORE_REV=7da10659 bash scripts/covalent_h2h/enter_bench.sh
        """


# GFN2-xTB Si10 and C10 at twelve seeds, and Si13 and C20 at six seeds:
# anneal's general arm against CREST 3.0.2, 1e5 calls, 3000 K electronic
# temperature. Si20 runs once it has a reference. Needs xtb 6.7.1, CREST and rgpot's
# libxtb_engine.so (paths in the script). Not part of `rule all`.
# Rows and summaries are appended to bench/covalent-h2h/gfn2/rows.csv and
# summaries.csv; the output is a stamp under /work, because Snakemake
# deletes declared outputs before a job and would take the rows with it.
#   snakemake -s workflow/Snakefile covalent_gfn2_crest --cores 1 --force
rule covalent_gfn2_crest:
    output:
        touch("/work/covalent-h2h/gfn2/stamps/panel.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/covalent-h2h/gfn2
        GFN2_ROWS=/work/covalent-h2h/gfn2/rows.csv \
        GFN2_SUMMARY=/work/covalent-h2h/gfn2/summaries.csv \
        GFN2_SESSIONS=/work/covalent-h2h/gfn2/sessions.jsonl \
        GFN2_HISTORY=/work/covalent-h2h/gfn2/seeds.csv \
          bash scripts/covalent_h2h/gfn2_enter_bench.sh
        """


# Serial recommended CuH2 slab on the FCC fixture, budget 2500, seeds 0-7.
# Writes /work/cuh2-fcc-rec/cuh2_fcc_rec_*.out and its hardware receipt.
# Not part of `rule all`.
#   snakemake -s workflow/Snakefile cuh2_fcc_rec --cores 1 --force
rule cuh2_fcc_rec:
    output:
        touch("/work/cuh2-fcc-rec/stamps/rec.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/cuh2-fcc-rec/stamps
        bash scripts/run_cuh2_fcc_rec.sh
        """


# Full 192-seed water-hexamer CREST comparison in the sealed anneal_repro
# workflow. The runner verifies workflow commit 56160f2d and its tree before
# invoking its locked Pixi environment. ANNEAL_REPRO_ROOT, or
# --config anneal_repro=PATH, names the checkout; the default is the sibling
# directory ../anneal_repro. Not part of `rule all`.
#   ANNEAL_REPRO_ROOT=../anneal_repro snakemake -s workflow/Snakefile water_crest_fair --cores 8 --force
rule water_crest_fair:
    output:
        touch("/work/anneal-repro/stamps/water-crest-fair-n192.stamp"),
    threads: 8
    params:
        repro=config.get("anneal_repro", ""),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/anneal-repro/stamps
        if [ -n {params.repro:q} ]; then export ANNEAL_REPRO_ROOT={params.repro:q}; fi
        WATER_CREST_CORES={threads} bash scripts/water_crest_fair.sh
        """


# CREST's Si10 seeds 2004-2011, bringing the arm to the twelve seeds of the
# anneal arm. Same stamp rule as above; GFN2_CORE picks the core.
#   snakemake -s workflow/Snakefile covalent_gfn2_crest_si10_n12
rule covalent_gfn2_crest_si10_n12:
    output:
        touch("/work/covalent-h2h/gfn2/stamps/si10-crest-n12.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/covalent-h2h/gfn2
        GFN2_CODES=crest \
        GFN2_ROWS=/work/covalent-h2h/gfn2/rows.csv \
        GFN2_SUMMARY=/work/covalent-h2h/gfn2/summaries.csv \
        GFN2_SESSIONS=/work/covalent-h2h/gfn2/sessions.jsonl \
        GFN2_HISTORY=/work/covalent-h2h/gfn2/seeds.csv \
          bash scripts/covalent_h2h/gfn2_enter_bench.sh \
          --systems si10 --crest-seeds 2004 2005 2006 2007 2008 2009 2010 2011
        """


# Gupta gold against GMIN at 38, 75 and 98.
# Not part of `rule all`. One serial session, hostname bench:
#   snakemake -s workflow/Snakefile gold_gupta_h2h
rule gold_gupta_h2h:
    output:
        touch(STAMP_ROOT + "/gold_gupta_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/metal_h2h/enter_gold.sh
        """


# GMIN against the paper preset at the paper force-call budgets, LJ98
# and LJ104. Not part of `rule all`. Run it by name:
#   snakemake -s workflow/Snakefile gmin_h2h
rule gmin_h2h:
    output:
        touch(STAMP_ROOT + "/gmin_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/gmin_h2h/enter_bench.sh
        """

# `Config::branch_on_stall` against develop on the paper panel: LJ38, LJ55,
# LJ75, LJ98, LJ102, LJ103, LJ104, LJ150, Au55, M55 rho 6 and 14, and M80
# rho 6 and 14. Seeds 2000-2011. One session on core 0 with hostname bench;
# for each system and seed the develop build (`develop_rev`, default c2de652d)
# runs, then this checkout's build with H2H_BRANCH=1. Rows are appended to
# bench/branch-gate/rows.csv, which is not a declared output. Not part of
# `rule all`:
#   snakemake -s workflow/Snakefile branch_gate [--config develop_rev=<sha>]
rule branch_gate:
    params:
        develop=config.get("develop_rev", "c2de652dca0bc75e2b0cb4afffac91fd656404e4"),
    output:
        touch(STAMP_ROOT + "/branch_gate.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/branch_gate
        BRANCH_GATE_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/branch_gate \
          DEVELOP_REV={params.develop} bash scripts/branch_gate/enter_bench.sh
        """
# Fiorentino and Marzari RPQA against the paper preset on LJ38.
# Not part of `rule all`. One serial session, both arms, core 0:
#   snakemake -s workflow/Snakefile pimc_lj38
rule pimc_lj38:
    output:
        touch(STAMP_ROOT + "/pimc_lj38.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/pimc_lj38/enter_bench.sh
        """


# LJ38 RPQA at the published 32-replica, 40-round schedule.
# Not part of `rule all`. Does not replace the 400_000-call rows:
#   snakemake -s workflow/Snakefile pimc_lj38_paper
rule pimc_lj38_paper:
    output:
        touch(STAMP_ROOT + "/pimc_lj38_paper.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/pimc_lj38/enter_bench.sh paper
        """


# GrowPAL against the paper preset at the paper evaluation budgets.
# Not part of `rule all`. One serial session, both arms, core 0:
#   snakemake -s workflow/Snakefile growpal_h2h
rule growpal_h2h:
    output:
        touch(STAMP_ROOT + "/growpal_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/growpal_h2h/enter_bench.sh
        """


# GrowPAL 0.1.6, built from source, against the recommended preset on
# LJ38, LJ55, LJ75, LJ98, and Morse M38 at rho = 6, at the paper call
# budgets. Rows are appended, never rewritten. Not part of `rule all`:
#   snakemake -s workflow/Snakefile growpal_h2h_v2
rule growpal_h2h_v2:
    output:
        touch(STAMP_ROOT + "/growpal_h2h_v2.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/growpal_h2h_v2/enter_bench.sh
        """


# Calls the deterministic GrowPAL loop needs with no budget, one run per
# system. A diagnostic beside growpal_h2h_v2, not part of it:
#   snakemake -s workflow/Snakefile growpal_h2h_v2_uncapped
rule growpal_h2h_v2_uncapped:
    output:
        touch(STAMP_ROOT + "/growpal_h2h_v2_uncapped.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/growpal_h2h_v2/enter_bench.sh --uncapped
        """


# Depth-posterior ablation on LJ38, LJ55, LJ75, LJ98, and LJ104.
# Not part of `rule all`. One serial session, both arms, paper budgets:
#   snakemake -s workflow/Snakefile depth_posterior_ablation
# Rows are appended to bench/depth-posterior-ablation/results.csv.
rule depth_posterior_ablation:
    output:
        touch(STAMP_ROOT + "/depth_posterior_ablation.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/depth_posterior_ablation/enter_bench.sh
        """


# The posterior and uniform arms of the held-out panel, seeds 7000-7005 on
# LJ75, LJ98 and LJ104, appended to results/size-tiered-selection.csv, with
# code_revision and host appended to its provenance sidecar. The tiered arm
# has no committed code and is not run.
# Not part of `rule all`.
#   snakemake -s workflow/Snakefile size_tiered_selection --cores 1 --force
rule size_tiered_selection:
    output:
        "/work/depth-posterior-ablation/held-out.stamp",
    shell:
        """
        set -euo pipefail
        bash scripts/depth_posterior_ablation/enter_bench.sh --held-out
        touch {output}
        """


# Lennard-Jones head-to-head against the published bonobo initialiser.
# Not part of `rule all`. Run it by name:
#   snakemake -s workflow/Snakefile lj_bonobo_h2h
rule lj_bonobo_h2h:
    output:
        touch(STAMP_ROOT + "/lj_bonobo_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/lj_bonobo_h2h/enter_bench.sh
        """


# GFN2-xTB (H2O)20 anneal versus CREST. Not part of `rule all`.
# Write bench/water-h2o20-goat/reference.csv with
# scripts/h2o20_goat_reference.sh before this rule. GOAT rows are
# skipped unless `orca` is on PATH.
#   snakemake -s workflow/Snakefile water_h2o20_goat
rule water_h2o20_goat:
    input:
        "bench/water-h2o20-goat/reference.csv",
    output:
        touch(STAMP_ROOT + "/water_h2o20_goat.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/h2o20-goat
        H2O_OUT_CSV=/work/h2o20-goat/results.csv \
          bash scripts/h2o20_goat_campaign.sh
        """


# Paper minima dumps, xyz dumps, and raw runs listed in data/hf-files.csv.
# Dataset: HaoZeke/anneal-paper-data (repo type dataset).
# Not part of `rule all`. Scripts that read those files call the same
# program before they open them.
#   snakemake -s workflow/Snakefile fetch_paper_data
rule fetch_paper_data:
    output:
        "build/hf-fetch.ok",
    shell:
        """
        set -euo pipefail
        python3 scripts/data/fetch_data.py
        mkdir -p build
        : > build/hf-fetch.ok
        """


# GMIN's rigid-body TIP4P basin-hopping against anneal develop on the
# Cambridge sizes (H2O)8, 15, 20, 21 and, scored against the pooled best,
# (H2O)25. Twelve seeds, 2_000_000 charged evaluations, one serial session,
# sudo unshare --uts with hostname bench. Not part of `rule all`:
#   snakemake -s workflow/Snakefile tip4p_h2h --cores 1 --force
rule tip4p_h2h:
    shell:
        """
        set -euo pipefail
        bash scripts/tip4p_h2h/enter_h2h.sh
        """


# (H2O)8, 12, 16, 20 and 21 against GMIN's rigid-body TIP4P basin-hopping
# (pinned aac1548a) on anneal's default preset, Cambridge headers as the
# target, twelve seeds, 2_000_000 charged evaluations, one serial session,
# sudo unshare --uts with hostname bench. Rows append to rows.csv with
# code_revision and host; a stored row is reused only at the same revision.
# Not part of `rule all`:
#   snakemake -s workflow/Snakefile water_gmin
rule water_gmin:
    output:
        touch(STAMP_ROOT + "/water_gmin.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/water-gmin/output
        WATER_GMIN_OUT=/work/water-gmin/output \
          bash scripts/tip4p_h2h/enter_water_gmin.sh
        """


# (H2O)21 against GMIN on anneal develop's default preset across a budget
# sweep: 2M, 4M and 8M charged evaluations, twelve seeds, the same serial arm
# as tip4p_h2h. GMIN at a (budget, seed) pair is deterministic, so the rows
# the 2M head-to-head and the 4M/8M runs already stored are reused through
# H2H_GMIN_ROWS; GMIN runs each remaining pair. Not part of
# `rule all`:
#   snakemake -s workflow/Snakefile tip4p21_budget_h2h
rule tip4p21_budget_h2h:
    output:
        touch(STAMP_ROOT + "/tip4p21_budget_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/tip4p_h2h/enter_budget.sh
        """


# TIP4P (H2O)10, 15 and 20 on the paper preset. Not part of `rule all`.
#   snakemake -s workflow/Snakefile tip4p_rates
rule tip4p_rates:
    output:
        touch(STAMP_ROOT + "/tip4p_rates.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/tip4p_rates
        TIP4P_RATES_CSV=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/tip4p_rates/rates.csv \
          bash scripts/tip4p_rates/enter_bench.sh
        """


# Paper preset against ASE basin hopping. Not part of `rule all`.
#   snakemake -s workflow/Snakefile ase_bh_h2h
rule ase_bh_h2h:
    output:
        touch(STAMP_ROOT + "/ase_bh_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/ase_gofee_h2h/enter_bench.sh --comparison ase_bh
        """


# Paper preset against ASE minima hopping. Not part of `rule all`.
#   snakemake -s workflow/Snakefile ase_mh_h2h
rule ase_mh_h2h:
    output:
        touch(STAMP_ROOT + "/ase_mh_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/ase_gofee_h2h/enter_bench.sh --comparison ase_mh
        """


# Guided Adaptive Diffusion rerun (CondEvo CHARLES with the deposited
# settings) against the recommended preset and GMIN on LJ31 and LJ38,
# seeds 2000-2011, plus the deposited run. The zip is downloaded here and
# is not a committed output. Rows are appended to
# bench/gad-published/rows.csv, which is not declared as an output because
# Snakemake removes declared outputs before a job runs. Not part of
# `rule all`:
#   snakemake -s workflow/Snakefile gad_published
rule gad_published:
    output:
        touch("/work/gad-published/rows-appended.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/gad-published
        zip=/work/gad-published/supplementary_data.zip
        if [[ ! -s $zip ]]; then
          curl -fL --retry 3 -o "$zip" \\
            https://zenodo.org/api/records/19001618/files/supplementary_data.zip/content
        fi
        echo "e140fde0c62c71f08b326b12ac50d77e  $zip" | md5sum -c -
        GAD_ZIP="$zip" bash scripts/gad_published/enter_bench.sh --summary /work/gad-published/rows.csv
        """


# Gupta, covalent and TIP4P against ASE and GOFEE. Not part of `rule all`.
#   snakemake -s workflow/Snakefile asg2_h2h
rule asg2_h2h:
    output:
        touch(STAMP_ROOT + "/asg2_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/ase_gofee_h2h/enter_bench.sh --panel asg2
        """


# Paper preset against AGOX GOFEE. Not part of `rule all`.

# OCCat against anneal and GMIN at the paper evaluation budgets.
# Not part of `rule all`. One serial session, hostname bench:
#   snakemake -s workflow/Snakefile occat_h2h
rule occat_h2h:
    output:
        touch(STAMP_ROOT + "/occat_h2h.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/occat_h2h/enter_bench.sh
        """


#   snakemake -s workflow/Snakefile agox_gofee_h2h --cores 1 --force
rule agox_gofee_h2h:
    shell:
        """
        set -euo pipefail
        bash scripts/ase_gofee_h2h/enter_bench.sh --comparison agox_gofee
        """


# LJ98 current AGOX, documented AGOX, and anneal. Not part of `rule all`.
# The script rewrites the summary from the committed rows and does not
# start a search.
#   snakemake -s workflow/Snakefile agox_lj98
rule agox_lj98:
    input:
        "bench/agox-lj98/rows.csv",
    output:
        touch(STAMP_ROOT + "/agox_lj98.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/agox_lj98/enter_bench.sh
        """


# LJ75 current AGOX, documented AGOX, and anneal. Not part of `rule all`.
# The script rewrites the summary from the committed rows and does not
# start a search. A seed run appends one row and leaves an existing row
# in place.
#   snakemake -s workflow/Snakefile agox_lj75
rule agox_lj75:
    input:
        "bench/agox-lj75/rows.csv",
    output:
        touch(STAMP_ROOT + "/agox_lj75.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/agox_lj75/enter_bench.sh
        """


# LJ75 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search. A seed run appends one row
# and leaves an existing row in place. An ASE seed stops at the paper
# call budget or at three times the slowest anneal wall.
#   snakemake -s workflow/Snakefile ase_lj75
rule ase_lj75:
    input:
        "bench/ase-lj75/rows.csv",
    output:
        touch(STAMP_ROOT + "/ase_lj75.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/ase_lj75/enter_bench.sh
        """


# LJ38 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search.
#   snakemake -s workflow/Snakefile ase_lj38
rule ase_lj38:
    input:
        "bench/ase-lj38/rows.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_lj38.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system lj38
        """


# LJ55 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search.
#   snakemake -s workflow/Snakefile ase_lj55
rule ase_lj55:
    input:
        "bench/ase-lj55/rows.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_lj55.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system lj55
        """


# LJ98 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search.
#   snakemake -s workflow/Snakefile ase_lj98
rule ase_lj98:
    input:
        "bench/ase-lj98/rows.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_lj98.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system lj98
        """


# LJ104 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search.
#   snakemake -s workflow/Snakefile ase_lj104
rule ase_lj104:
    input:
        "bench/ase-lj104/rows.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_lj104.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system lj104
        """


# LJ150 ASE basin hopping and minima hopping against Config::for_cluster.
# Not part of `rule all`. The script rewrites the summary from the
# committed rows and does not start a search.
#   snakemake -s workflow/Snakefile ase_lj150
rule ase_lj150:
    input:
        "bench/ase-lj150/rows.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_lj150.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system lj150
        """


# Au55 ASE basin hopping and minima hopping against Config::for_cluster.
# Gupta is Gupta::copper_gold through asg_eval. Not part of `rule all`.
# The script rewrites the summary from the committed rows and does not
# start a search.
#   snakemake -s workflow/Snakefile ase_au55
rule ase_au55:
    input:
        "bench/ase-au55/rows.csv",
        "bench/ase-au55/rows-for-cluster.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_au55.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel
        ASE_PANEL_OUT=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/ase-panel \
          bash scripts/ase_panel/enter_bench.sh --system au55
        """


# Config::recommended on the ASE panel: LJ38, LJ55, LJ98, LJ104, LJ150
# and Au55, seeds 2000-2011, the paper budgets. The ASE rows stay as
# committed. This rule reprints the summaries, the README tables and
# tab:ase in the manuscript. Not part of `rule all`.
#   snakemake -s workflow/Snakefile ase_recommended
rule ase_recommended:
    input:
        "bench/ase-lj38/rows.csv",
        "bench/ase-lj55/rows.csv",
        "bench/ase-lj98/rows.csv",
        "bench/ase-lj104/rows.csv",
        "bench/ase-lj150/rows.csv",
        "bench/ase-au55/rows.csv",
        "bench/ase-au55/rows-for-cluster.csv",
        "scripts/ase_panel/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_recommended.stamp"),
    shell:
        """
        set -euo pipefail
        python3 scripts/ase_panel/summarize.py --all
        """


# Non-LJ ASE head-to-head on Cambridge Morse clusters: M38 and M55 at
# rho = 6 and rho = 14, seeds 2000-2011, paper budgets, one core, host
# bench. Both Config::for_cluster and Config::recommended run against ASE
# basin hopping and minima hopping. Not part of `rule all`.
#   snakemake -s workflow/Snakefile ase_nonlj
rule ase_nonlj:
    input:
        "bench/ase-nonlj/rows.csv",
        "bench/ase-nonlj/identity.csv",
        "scripts/ase_nonlj/summarize.py",
    output:
        touch(STAMP_ROOT + "/ase_nonlj.stamp"),
    shell:
        """
        set -euo pipefail
        bash scripts/ase_nonlj/enter_bench.sh
        python3 scripts/ase_nonlj/summarize.py
        """


# The paper headline panel on the 0.12.0 release build 07f89cad: LJ38,
# LJ55, LJ75, LJ98, LJ102, LJ103, LJ104, LJ150, Au55 and M80 at rho 6 and
# 14, seeds 2000-2011, paper budgets, one process on core 0, sudo unshare
# --uts with hostname bench. Rows are appended to
# bench/paper-0120/rows.csv with code_revision and host; that file is not
# declared as an output because Snakemake removes declared outputs before
# a job runs. Not part of `rule all`:
#   snakemake -s workflow/Snakefile paper_0120
rule paper_0120:
    output:
        touch(STAMP_ROOT + "/paper_0120.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/paper-0120/output
        PAPER_0120_OUT=/work/paper-0120/output \
          bash scripts/paper_0120/enter_bench.sh
        """


# anneal develop c2de652d against GMIN aac1548a on LJ38, LJ55, LJ75, LJ98,
# LJ102, LJ103, LJ104, LJ150, Gupta Au55 and Morse M55 and M80 at rho 6
# and 14: seeds 2000-2011, paper budgets, both arms in one session, one
# process on core 0, sudo unshare --uts with hostname bench. Rows are
# appended to bench/gmin-panel/rows.csv with code_revision and host; that
# file is not declared as an output because Snakemake removes declared
# outputs before a job runs. The summary, the README table and tab:gmin
# are rewritten from the rows. Not part of `rule all`:
#   snakemake -s workflow/Snakefile gmin_panel
rule gmin_panel:
    input:
        "bench/gmin-panel/rows.csv",
        "scripts/gmin_panel/enter_bench.sh",
        "scripts/gmin_panel/build_gmin.sh",
        "scripts/gmin_panel/run_panel.py",
        "examples/h2h_gmin_lj.data",
        "examples/h2h_gmin_morse.data",
    output:
        touch(STAMP_ROOT + "/gmin_panel.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p /work/gmin-panel/output
        GMIN_PANEL_OUT=/work/gmin-panel/output \
          bash scripts/gmin_panel/enter_bench.sh
        GMIN_PANEL_OUT=/work/gmin-panel/output \
          bash scripts/gmin_panel/enter_bench.sh --summarize --tex \
          --summary /work/gmin-panel/output/summary.csv \
          --readme /work/gmin-panel/output/README.md \
          --manuscript /work/gmin-panel/output/manuscript.tex
        """


# Paired (H2O)16 rows. Not part of `rule all`. The script rewrites the
# summary from the committed seeds and does not start a search.
#   snakemake -s workflow/Snakefile h2o16_crest
rule h2o16_crest:
    input:
        "bench/h2o16-crest/seeds.csv",
    output:
        touch(STAMP_ROOT + "/h2o16_crest.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/h2o16_crest
        H2O16_CREST_SUMMARY=${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}/h2o16_crest/summary.csv \
          python3 scripts/h2o16_crest/summarize.py
        """


# (H2O)16 under GFN2 plus the O-H wall, anneal against CREST 3.0.2 with
# the same evaluator (CREST's xtb runs through a driver into anneal's
# objective), the same start per seed, 280305 calls, seeds 2000-2011.
# Needs xtb 6.7.1, CREST and rgpot's libxtb_engine.so (paths in the
# script). Rows and summaries are appended to bench/h2o16-crest/
# capped-rows.csv and capped-summary.csv; the output is a stamp under
# /work so Snakemake cannot delete them. Not part of `rule all`.
#   snakemake -s workflow/Snakefile h2o16_crest_capped
rule h2o16_crest_capped:
    output:
        touch("/work/h2o16-crest-capped/stamps/panel.stamp"),
    shell:
        """
        set -euo pipefail
        bash scripts/h2o16_crest/enter_capped.sh
        """


# AGOX GOFEE on LJ98, LJ102, LJ103, LJ104 and LJ150, seeds 2000-2005.
# Not part of `rule all`. Rows are appended to bench/ase-gofee-h2h/lj-large.csv
# with code_revision and host; that file is not an output because Snakemake
# removes declared outputs before a job runs. The stamp only marks a finished
# append. An existing system and arm is left as written.
#   snakemake -s workflow/Snakefile agox_gofee_lj_large
rule agox_gofee_lj_large:
    output:
        touch("/work/ase-gofee-h2h/stamps/lj-large.stamp"),
    shell:
        """
        set -euo pipefail
        bash scripts/ase_gofee_h2h/enter_bench.sh --comparison agox_gofee --no-paper \\
          --systems lj98,lj102,lj103,lj104,lj150
        """


# Pair-scaled Morse against the parent preset and GMIN, on the paper
# panel. Rows and the summary are written under /work or $OUTPUT. The
# output is a stamp there: Snakemake deletes a declared output before a
# job, and a tracked table must not be one. Not part of `rule all`.
#   snakemake -s workflow/Snakefile gmin_losses2
rule gmin_losses2:
    output:
        touch("/work/gmin-losses2/stamps/panel.stamp"),
    shell:
        """
        set -euo pipefail
        export OUTPUT=/work/gmin-losses2
        bash scripts/gmin_panel/enter_losses2.sh
        """


# Current-code regeneration of the six landfold panels whose v7 source
# tables were not deposited. The runner is resumable in /work and publishes
# landscape.ld and fes.csv only after every declared seed has finished.
# Not part of `rule all`.
#   snakemake -s workflow/Snakefile landfold_maps_current --cores 1
rule landfold_maps_current:
    input:
        "examples/landfold_campaign.rs",
        "paper/jctc/scripts/run_landfold_campaign.py",
    output:
        touch("/work/anneal-landfold-current/complete.stamp"),
    threads: 1
    resources:
        mem_mb=16000,
    shell:
        """
        set -euo pipefail
        python3 paper/jctc/scripts/run_landfold_campaign.py \\
          --work /work/anneal-landfold-current \\
          --publish paper/jctc/data/landfold_maps_v7
        """


# (H2O)6 at GFN2 plus the O-H wall. Anneal at the 4000-call ledger,
# CREST 3.0.2 at -mquick -len 0.90 ps and at -len 0.11 ps, seeds 2000-2011.
# Rows are appended under bench/crest-equal. Not part of `rule all`.
#   snakemake -s workflow/Snakefile crest_equal --cores 1 --force
rule crest_equal:
    output:
        touch(STAMP_ROOT + "/crest_equal.stamp"),
    shell:
        """
        set -euo pipefail
        mkdir -p ${{ANNEAL_STAMP_ROOT:-/work/anneal-snakemake}}
        bash scripts/crest_equal/enter_bench.sh
        """
