From b869fac3ba2da52c57fb616624f8633b3111ef51 Mon Sep 17 00:00:00 2001 From: mosheabr <257371078+mosheabr@users.noreply.github.com> Date: Mon, 9 Nov 2026 20:09:41 +0000 Subject: [PATCH] chore: sync skills (ALCHEMI Toolkit) --- README.md | 2 + skills/nvalchemi-toolkit/BENCHMARK.md | 163 ++ skills/nvalchemi-toolkit/SKILL.md | 279 ++ skills/nvalchemi-toolkit/evals/config.yml | 54 + skills/nvalchemi-toolkit/evals/evals.json | 2365 +++++++++++++++++ .../evals/files/ammonia_dimer.xyz | 10 + .../evals/files/ar_scope.extxyz | 34 + .../evals/files/ar_slab.extxyz | 34 + .../evals/files/argon_clusters.xyz | 87 + .../evals/files/argon_fcc32.extxyz | 34 + .../evals/files/argon_frames.extxyz | 400 +++ .../evals/files/au_fcc.extxyz | 34 + .../evals/files/co_frames.extxyz | 800 ++++++ .../evals/files/cu_fcc.extxyz | 34 + .../evals/files/cu_slab.extxyz | 34 + .../evals/files/hcn_product.extxyz | 5 + .../evals/files/hcn_reactant.extxyz | 5 + .../evals/files/si_diamond.extxyz | 66 + .../evals/files/toy_pair_model.py | 71 + .../nvalchemi-toolkit/evals/files/water.pdb | 43 + skills/nvalchemi-toolkit/evals/grader.py | 916 +++++++ .../evals/harbor/comp-01/instruction.md | 13 + .../evals/harbor/comp-01/task.toml | 35 + .../evals/harbor/dataset.toml | 31 + .../evals/harbor/imp-01/instruction.md | 9 + .../evals/harbor/imp-01/task.toml | 35 + .../evals/harbor/imp-02/instruction.md | 10 + .../evals/harbor/imp-02/task.toml | 35 + .../evals/harbor/model-01/instruction.md | 8 + .../evals/harbor/model-01/task.toml | 35 + .../evals/harbor/neg-01/instruction.md | 6 + .../evals/harbor/neg-01/task.toml | 35 + .../evals/harbor/neg-03/instruction.md | 2 + .../evals/harbor/neg-03/task.toml | 35 + .../evals/harbor/scope-01/instruction.md | 1 + .../evals/harbor/scope-01/task.toml | 35 + .../evals/harbor/scope-02/instruction.md | 2 + .../evals/harbor/scope-02/task.toml | 35 + .../evals/harbor/scope-03/instruction.md | 7 + .../evals/harbor/scope-03/task.toml | 35 + skills/nvalchemi-toolkit/evals/setup_cpu.sh | 94 + .../references/composition-and-extension.md | 278 ++ skills/nvalchemi-toolkit/references/data.md | 261 ++ .../references/dynamics-optimization.md | 381 +++ .../references/generative-workflows.md | 156 ++ skills/nvalchemi-toolkit/references/models.md | 225 ++ .../nvalchemi-toolkit/references/training.md | 358 +++ skills/nvalchemi-toolkit/skill-card.md | 121 + skills/nvalchemi-toolkit/skill.oms.sig | 1 + 49 files changed, 7749 insertions(+) create mode 100644 skills/nvalchemi-toolkit/BENCHMARK.md create mode 100644 skills/nvalchemi-toolkit/SKILL.md create mode 100644 skills/nvalchemi-toolkit/evals/config.yml create mode 100644 skills/nvalchemi-toolkit/evals/evals.json create mode 100644 skills/nvalchemi-toolkit/evals/files/ammonia_dimer.xyz create mode 100644 skills/nvalchemi-toolkit/evals/files/ar_scope.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/ar_slab.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/argon_clusters.xyz create mode 100644 skills/nvalchemi-toolkit/evals/files/argon_fcc32.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/argon_frames.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/au_fcc.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/co_frames.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/cu_fcc.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/cu_slab.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/hcn_product.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/hcn_reactant.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/si_diamond.extxyz create mode 100644 skills/nvalchemi-toolkit/evals/files/toy_pair_model.py create mode 100644 skills/nvalchemi-toolkit/evals/files/water.pdb create mode 100644 skills/nvalchemi-toolkit/evals/grader.py create mode 100644 skills/nvalchemi-toolkit/evals/harbor/comp-01/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/comp-01/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/dataset.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/imp-01/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/imp-01/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/imp-02/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/imp-02/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/model-01/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/model-01/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/neg-01/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/neg-01/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/neg-03/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/neg-03/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-01/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-01/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-02/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-02/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-03/instruction.md create mode 100644 skills/nvalchemi-toolkit/evals/harbor/scope-03/task.toml create mode 100644 skills/nvalchemi-toolkit/evals/setup_cpu.sh create mode 100644 skills/nvalchemi-toolkit/references/composition-and-extension.md create mode 100644 skills/nvalchemi-toolkit/references/data.md create mode 100644 skills/nvalchemi-toolkit/references/dynamics-optimization.md create mode 100644 skills/nvalchemi-toolkit/references/generative-workflows.md create mode 100644 skills/nvalchemi-toolkit/references/models.md create mode 100644 skills/nvalchemi-toolkit/references/training.md create mode 100644 skills/nvalchemi-toolkit/skill-card.md create mode 100644 skills/nvalchemi-toolkit/skill.oms.sig diff --git a/README.md b/README.md index 993de72a..66c441ee 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ For non-interactive installs, global installs, agent-specific installs, updates, | Product | Description | Skills | |---------|-------------|--------| +| **ALCHEMI Toolkit** | GPU-accelerated atomistic simulation and machine-learned interatomic potential workflows, including batched relaxation, molecular dynamics, training and fine-tuning, and Zarr datasets. | [`nvalchemi-toolkit`](skills/nvalchemi-toolkit) | | **Auto Ontology** | Set up Auto Ontology, model and publish its semantic layer, and run validated text-to-SQL queries through it. | [`nvidia-ontology-setup`](skills/nvidia-ontology-setup), [`nvidia-ontology-management`](skills/nvidia-ontology-management), [`nvidia-ontology-query`](skills/nvidia-ontology-query) | | **BioNeMo Libraries** | Accelerate cheminformatics, genomic analysis, and equivariant model development with NVIDIA GPU libraries and tools. | [`bionemo-cuequivariance`](skills/bionemo-cuequivariance), [`bionemo-cuequivariance-jax`](skills/bionemo-cuequivariance-jax), [`bionemo-cuequivariance-torch`](skills/bionemo-cuequivariance-torch), [`bionemo-nvmolkit-usage`](skills/bionemo-nvmolkit-usage), [`bionemo-parabricks`](skills/bionemo-parabricks), [`bionemo-genomics-workflow-acceleration`](skills/bionemo-genomics-workflow-acceleration) | | **BioNeMo NIMs** | Run and combine BioNeMo NIM microservices for biomolecular research and drug discovery through hosted APIs or local deployments. | [`bionemo-drug-discovery-pipeline`](skills/bionemo-drug-discovery-pipeline), [`bionemo-msa-structure-prediction-pipeline`](skills/bionemo-msa-structure-prediction-pipeline), [`bionemo-openfold2-nim`](skills/bionemo-openfold2-nim), [`bionemo-molmim-nim`](skills/bionemo-molmim-nim), [`bionemo-diffdock-nim`](skills/bionemo-diffdock-nim), [`bionemo-genmol-nim`](skills/bionemo-genmol-nim), [`bionemo-evo2-nim`](skills/bionemo-evo2-nim), [`bionemo-rfdiffusion-nim`](skills/bionemo-rfdiffusion-nim), [`bionemo-rfd4-proteina-nim`](skills/bionemo-rfd4-proteina-nim), [`bionemo-openfold3-nim`](skills/bionemo-openfold3-nim), [`bionemo-proteinmpnn-nim`](skills/bionemo-proteinmpnn-nim), [`bionemo-msa-search-nim`](skills/bionemo-msa-search-nim), [`bionemo-boltz2-nim`](skills/bionemo-boltz2-nim) | @@ -195,6 +196,7 @@ Per-product source repo links: | Product | Issues | Discussions | Contributing | Security | |---------|--------|-------------|--------------|----------| +| **ALCHEMI Toolkit** | [Issues](https://github.com/NVIDIA/nvalchemi-toolkit/issues) | [Discussions](https://github.com/NVIDIA/nvalchemi-toolkit/discussions) | [Contributing](https://github.com/NVIDIA/nvalchemi-toolkit/blob/main/CONTRIBUTING.md) | [Security](https://github.com/NVIDIA/nvalchemi-toolkit/blob/main/SECURITY.md) | | **Auto Ontology** | [Issues](https://github.com/NVIDIA/auto-ontology/issues) | — | [Contributing](https://github.com/NVIDIA/auto-ontology/blob/main/CONTRIBUTING.md) | [Security](https://github.com/NVIDIA/auto-ontology/blob/main/SECURITY.md) | | **BioNeMo Libraries** | [Issues](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/issues) | — | [Contributing](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/blob/main/CONTRIBUTING.md) | [Security](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/blob/main/SECURITY.md) | | **BioNeMo NIMs** | [Issues](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/issues) | — | [Contributing](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/blob/main/CONTRIBUTING.md) | [Security](https://github.com/NVIDIA-BioNeMo/bionemo-agent-toolkit/blob/main/SECURITY.md) | diff --git a/skills/nvalchemi-toolkit/BENCHMARK.md b/skills/nvalchemi-toolkit/BENCHMARK.md new file mode 100644 index 00000000..1947dc4b --- /dev/null +++ b/skills/nvalchemi-toolkit/BENCHMARK.md @@ -0,0 +1,163 @@ +# Skill Benchmark: nvalchemi-toolkit + +> ✅ **Overall verdict: PASS — Recommended for publication** + +## Publication Recommendation + +Recommended for publication based on the completed evaluation evidence in this report. + +## Evaluation Metadata + +- Skill: `nvalchemi-toolkit` +- Validation status: `passed` +- Evaluation date: 2026-11-07 +- Evaluator version: `1.6.9` +- Agents: Claude Code (`aws/anthropic/bedrock-claude-opus-5-5`), Codex (`openai/openai/gpt-6.1-sol`) +- Tasks: 9 evaluation tasks (7 positive, 2 negative) +- Dataset digest: `sha256:c096747a831a786dceff6fcf5d46191b44347068431663c2a7e66efbf5593c7a` (skill-evaluator-dataset-snapshot/1) +- Attempts per task: 1 +- Environment: `k8s-sandbox` +- Tier 2 evidence: required for publication +- Tier 3 evidence: required for publication + +Each task attempt ran in its own isolated sandbox pod. + +## Tier 1 LLM Provenance + +SkillSpector provider, model, analyzer revision, and determinism evidence retained for this scan. + +| Skill | Provider | Adapter | Analyzer | Model | Revision | Determinism | +| --- | --- | --- | --- | --- | --- | --- | +| nvalchemi-toolkit | nv_inference | openai | mcp_tool_poisoning | `aws/anthropic/bedrock-claude-opus-5-5` | `2.13.4` | nondeterministic / provider_defaults | +| nvalchemi-toolkit | nv_inference | openai | semantic_developer_intent | `aws/anthropic/bedrock-claude-opus-5-5` | `2.13.4` | nondeterministic / provider_defaults | +| nvalchemi-toolkit | nv_inference | openai | semantic_quality_policy | `aws/anthropic/bedrock-claude-opus-5-5` | `2.13.4` | nondeterministic / provider_defaults | +| nvalchemi-toolkit | nv_inference | openai | semantic_security_discovery | `aws/anthropic/bedrock-claude-opus-5-5` | `2.13.4` | nondeterministic / provider_defaults | +| nvalchemi-toolkit | nv_inference | openai | meta_analyzer | `aws/anthropic/bedrock-claude-opus-5-5` | `2.13.4` | nondeterministic / provider_defaults | + +- Controls for `nvalchemi-toolkit`: temperature=not set (source=provider_default, forwarded=no); seed=not set (source=unset, forwarded=no); reasoning_effort=not set (source=provider_default, forwarded=no) + +## What This Report Answers + +The three-tier evaluation checks whether the skill: + +- is safe to use; +- produces correct answers; +- is discovered and activated when needed; +- helps the agent complete the user's goal and expected workflow; and +- avoids wasted skill and tool usage. + +## Results at a Glance + +| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) | +|---|---:|---:| +| Overall | 93.1% — baseline ran, but no comparable score was available; uplift unavailable | 88.8% — baseline ran, but no comparable score was available; uplift unavailable | +| Security | 94.4% → 100.0% (+5.6 points) | 94.4% → 100.0% (+5.6 points) | +| Correctness | 88.9% → 95.6% (+6.7 points) | 82.2% → 97.8% (+15.6 points) | +| Discoverability | 95.0% — baseline ran, but no comparable score was available; uplift unavailable | 82.9% — baseline ran, but no comparable score was available; uplift unavailable | +| Effectiveness | 76.7% → 87.3% (+10.6 points) | 70.8% → 87.0% (+16.2 points) | +| Efficiency | 87.6% — baseline ran, but no comparable score was available; uplift unavailable | 76.3% — baseline ran, but no comparable score was available; uplift unavailable | + +**How to read this table:** baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points. + +Example: `47.0% → 92.0% (+45.0 points)` means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline. + +A partial dimension was calculated from only the available configured signals; review the detailed report before relying on it. + +### Comparison details + +Shared-source comparisons use the same signals and weights on both conditions. They do not replace the full dimension scores above or change the publication verdict. + +| Agent | Dimension | Basis | Baseline → With skill (uplift) | Explanation | +| --- | --- | --- | --- | --- | +| claude-code | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. | +| claude-code | Efficiency | Token-only comparison | 80.9% → 85.3% (+4.4 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. | +| codex | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. | +| codex | Efficiency | Token-only comparison | 81.3% → 84.1% (+2.8 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. | + +## Token Usage + +Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions. + +| Agent | Dataset case | With skill | Without skill | Delta | Change | Coverage | +|---|---|---:|---:|---:|---:|---| +| claude-code | All cases | 3,767,299 | 8,028,455 | -4,261,156 | -53.08% | skill 9/9; base 9/9 | +| claude-code | comp-01 | 490,723 | 1,713,327 | -1,222,604 | -71.36% | skill 1/1; base 1/1 | +| claude-code | imp-01 | 659,070 | 1,273,754 | -614,684 | -48.26% | skill 1/1; base 1/1 | +| claude-code | imp-02 | 1,104,796 | 2,855,151 | -1,750,355 | -61.31% | skill 1/1; base 1/1 | +| claude-code | model-01 | 545,495 | 774,709 | -229,214 | -29.59% | skill 1/1; base 1/1 | +| claude-code | neg-01 | 148,013 | 182,912 | -34,899 | -19.08% | skill 1/1; base 1/1 | +| claude-code | neg-03 | 263,947 | 228,956 | +34,991 | +15.28% | skill 1/1; base 1/1 | +| claude-code | scope-01 | 195,314 | 192,612 | +2,702 | +1.40% | skill 1/1; base 1/1 | +| claude-code | scope-02 | 236,875 | 697,472 | -460,597 | -66.04% | skill 1/1; base 1/1 | +| claude-code | scope-03 | 123,066 | 109,562 | +13,504 | +12.33% | skill 1/1; base 1/1 | +| codex | All cases | 5,294,723 | 8,668,411 | -3,373,688 | -38.92% | skill 9/9; base 9/9 | +| codex | comp-01 | 1,075,998 | 827,111 | +248,887 | +30.09% | skill 1/1; base 1/1 | +| codex | imp-01 | 857,644 | 1,556,633 | -698,989 | -44.90% | skill 1/1; base 1/1 | +| codex | imp-02 | 2,304,597 | 1,957,890 | +346,707 | +17.71% | skill 1/1; base 1/1 | +| codex | model-01 | 328,780 | 657,059 | -328,279 | -49.96% | skill 1/1; base 1/1 | +| codex | neg-01 | 76,398 | 73,345 | +3,053 | +4.16% | skill 1/1; base 1/1 | +| codex | neg-03 | 454,227 | 414,425 | +39,802 | +9.60% | skill 1/1; base 1/1 | +| codex | scope-01 | 48,978 | 502,825 | -453,847 | -90.26% | skill 1/1; base 1/1 | +| codex | scope-02 | 79,241 | 2,635,925 | -2,556,684 | -96.99% | skill 1/1; base 1/1 | +| codex | scope-03 | 68,860 | 43,198 | +25,662 | +59.41% | skill 1/1; base 1/1 | +| ALL AGENTS | Dataset aggregate | 9,062,022 | 16,696,866 | -7,634,844 | -45.73% | skill 18/18; base 18/18 | + +Prompt tokens include cached reads, so total tokens are `prompt + completion` (cached is not added twice). The Efficiency score uses `(prompt - cached) + completion`. Change is `100 * (with - without) / without`; negative means fewer tokens. N/A comparisons include their reason in the coverage column; coverage is never estimated. + +## Tier Status + +| Tier | Purpose | Status | Evidence | +|---|---|---|---| +| Tier 1 | Static validation | **PASSED WITH OBSERVATIONS** | 11 validator(s); 6 finding(s) | +| Tier 2 | Semantic deduplication | **PASSED** | 2 validator(s); 0 finding(s) | +| Tier 3 | Live agent evaluation | **PASS** | 2 agent(s); 9 task(s) | + +## Findings and Observations + +
+Show detailed findings and successful checks + +- **MEDIUM** SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (`skills/nvalchemi-toolkit/SKILL.md`) +- **MEDIUM** SECURITY/Unsafe Defaults (TM3): Tool Misuse: skip_validation (`references/data.md:86`) +- **MEDIUM** SECURITY/Unsafe Defaults (TM3): Tool Misuse: skip_validation (`references/data.md:209`) +- **LOW** QUALITY/quality_discoverability: Description very long (703 chars, recommend 50-150) (`skills/nvalchemi-toolkit/SKILL.md`) +- **LOW** QUALITY/quality_reliability: Inputs are used but no dedicated Inputs section is documented (`skills/nvalchemi-toolkit/SKILL.md`) +- 1 additional finding(s) are available in the full evaluation artifacts. + +
+ +## Scoring Methodology + +
+Show dimension definitions, source signals, and thresholds + +| Dimension | Question | Scored signals | +|---|---|---| +| Security | Is it safe to use? | `security` (100%) | +| Correctness | Is the answer correct? | `accuracy` (100%) | +| Discoverability | Was the right skill loaded when needed? | `skill_execution` (100%) | +| Effectiveness | Did the skill help complete the task? | `goal_accuracy` (50%) + `behavior_check` (50%) | +| Efficiency | Did it avoid wasted tool calls and token usage? | `skill_efficiency` (50%) + `token_efficiency` (50%) | + +- Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%. +- Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL. +- Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate. +- The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold. +- Effectiveness is the equal-weight mean of goal completion (`goal_accuracy`) and expected workflow adherence (`behavior_check`). +- Efficiency is 50% tool-call productivity (the backward-compatible `skill_efficiency` wire id) and 50% `token_efficiency`. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial. + +Signals present in this run: + +- `security` (Security): unsafe operations, secret leakage, and unauthorized access. +- `skill_execution` (Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed. +- `skill_efficiency` (Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability). +- `accuracy` (Accuracy): final-answer correctness against the reference answer. +- `goal_accuracy` (Goal Accuracy): whether the user's goal was achieved. +- `behavior_check` (Behavior Check): whether the expected workflow behavior was followed. +- `token_efficiency` (Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency). + +
+ +## Freshness + +Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes. diff --git a/skills/nvalchemi-toolkit/SKILL.md b/skills/nvalchemi-toolkit/SKILL.md new file mode 100644 index 00000000..50c0f481 --- /dev/null +++ b/skills/nvalchemi-toolkit/SKILL.md @@ -0,0 +1,279 @@ +--- +name: nvalchemi-toolkit +description: >- + Build and change NVIDIA ALCHEMI Toolkit (nvalchemi) workflows for atomistic + simulation and machine-learned interatomic potentials (MLIPs). Use for + batched structure relaxation, molecular dynamics, reaction paths, training + or fine-tuning an MLIP, atomistic datasets in Zarr, generative structure + workflows, model wrapping, and custom hooks or integrators, with the ALCHEMI + Toolkit (nvalchemi), or when the user asks for batched GPU atomistic + simulation and nvalchemi is installed or acceptable. Not for other + simulation packages the user asked for (ASE-only, OpenMM, LAMMPS, GROMACS) + when the request does not involve nvalchemi, ALCHEMI Toolkit-Ops + (nvalchemiops) kernel work, or plain PyTorch questions. +license: Apache-2.0 +compatibility: >- + Runs Python and shell commands to inspect the installed nvalchemi package + and to run small checks. Reads linked docs and example pages over the + network, never downloads code to run. No credentials needed. +metadata: + author: NVIDIA + tags: [nvalchemi, atomistic-simulation, mlip, molecular-dynamics, training] +--- + +# NVIDIA ALCHEMI Toolkit + +This skill helps you write and change code that uses `nvalchemi`, the Python +package of the NVIDIA ALCHEMI Toolkit. It scopes the request, checks the +installed version, and routes to one note per kind of task. The notes say which +component fits which need, how the components connect, which mistakes are +common, and how to check the result. They link to the docs and examples for +the full details. + +## Purpose and scope + +Use it when the code imports `nvalchemi`, or when the user asks for a workflow +that the toolkit covers, including batched GPU simulation where `nvalchemi` +is installed or acceptable: `AtomicData` and `Batch`, Zarr storage, model +wrappers, relaxation and MD, reaction paths, enhanced sampling, training, +fine-tuning, distillation, generative sampling, or a custom hook, integrator, +loss, or reporter. + +Do not use it when: + +- The task is plain ASE, OpenMM, LAMMPS, GROMACS, or another package, and + the user did not ask for `nvalchemi`. Solve it with that package and do not + import `nvalchemi`. +- The task is a Warp or CUDA kernel inside ALCHEMI Toolkit-Ops + (`nvalchemiops`). That is a different package with its own rules. +- The question is general PyTorch with no atomistic workflow. + +## Prerequisites + +- Python 3.11 to 3.13 with `nvalchemi-toolkit` installed (`pip` or `uv`). +- PyTorch with the CUDA build that matches the host, or the CPU build. +- Optional model backends are extras: `mace`, `aimnet`, `uma-cu12`/`uma-cu13`, + `ase`, `pymatgen`, `tensorboard`. UMA conflicts with MACE, so it lives in its + own environment. + +## Instructions + +Work through these steps for every request. + +### Scope the request first + +Before you write or run code, go through this checklist. Ask about unknown +scientific choices, hardware, workload, correctness checks, and permissions +(items 2, 7, 8, 9, 10). For items 1, 3, 4, 5, 6, state a one-line assumption +if needed. Check the installed software before execution. + +1. **Intended result.** What number, file, or model does the user want at the + end? +2. **Scientific choices.** Model and checkpoint, ensemble (NVE, NVT, NPT), + temperature, pressure, timestep, convergence threshold, run length. Do not + pick these silently. +3. **Inputs.** Structure files and their format, units, which fields they + carry (energies, forces, velocities, cells). Read the files first and ask + only for what they do not say. +4. **Deliverables.** Script, data store, checkpoint, plot, or a short report. +5. **Reuse.** Which shipped component already does this (see the reuse rule). +6. **Software environment.** Installed `nvalchemi` version and extras. +7. **Hardware.** CPU only, one GPU, or several. Memory limits. +8. **Workload.** Number of systems, atoms, and steps. +9. **Correctness check.** How the result will be checked (see each note). +10. **Permissions.** What you can write, download, or delete. + +Limit exploratory runs to at most 3 systems and 100 steps, with a wall-time +limit under one minute. Do not start a production-length trajectory or a long +training run to "see what happens". Scale up only after the user agrees to the +settings. + +### Check the installed version + +The notes describe the API of release 0.3.0. Their links point at the +v0.3.0 tag. Check what is installed before you apply any advice: + +```bash +python - <<'EOF' +import importlib.util as u +for parts in ((), ("data",), ("dynamics",), ("models",), ("gen",), + ("dynamics", "mep"), ("enhanced_sampling",), + ("training", "distillation")): + m = ".".join(("nvalchemi", *parts)) + try: + found = u.find_spec(m) is not None + except ModuleNotFoundError: + found = False + print(m, found) +if u.find_spec("nvalchemi") is not None: + import nvalchemi + print(nvalchemi.__version__, nvalchemi.__file__) +EOF +``` + +If the toolkit is not installed, say so. Write the code anyway, but stop +before running it. Do not fetch source or install packages to fill the gap. + +For a version mismatch or missing module, tell the user what it affects: + +- If version 0.2.0 or newer has the core modules nvalchemi.data, + nvalchemi.dynamics, and nvalchemi.models, proceed with the 0.3.0 patterns. + Flag each 0.3.0-only feature used. Check its API in the installed source + before execution. If it is absent, write the code but do not run it. +- If a core module is missing or the version is below the 0.2.0 floor, stop + execution and ask before any upgrade. Do not install or upgrade on your own. + +The installed wheel ships no docs or examples. Read the installed package +source and the linked docs and example pages only. Each note names the +source module. Locate its file with Python's inspect.getfile, then read it in +site-packages. Links are for reading, never for downloading code to run. +If the network is unavailable, use installed source. + +### Run on the GPU + +Pick the device once: use `cuda` when `torch.cuda.is_available()`, otherwise +`cpu`. Put the model, batch or dataset, and optimizer on that same device. +For dynamics, optimizer state comes from the batch. Pass +`device_type=device.type` to the engine. Given a model, structures, and the +agreed timestep and step budget: + +```python +import torch +from nvalchemi.data import Batch +from nvalchemi.dynamics import FIRE2, FusedStage + +device = torch.device("cuda" if torch.cuda.is_available() else "cpu") +model = model.to(device) +batch = Batch.from_data_list(data_list).to(device) +opt = FIRE2(model=model, dt=dt, n_steps=step_budget, device_type=device.type) +dyn = FusedStage(sub_stages=[(0, opt)], device_type=device.type) +for hook in model.make_neighbor_hooks(): + dyn.register_hook(hook) +``` + +Complete the pre-flight check below before `dyn.run(batch)`. For training, +set `Dataset(..., device=device)` and `TrainingStrategy(..., devices=[device])`. +The strategy builds optimizers from the placed model (see the training note). + +Keep the step loop on the GPU. Avoid `.item()`, `.cpu()`, `.tolist()`, +`float(t)`, `print(t)`, `bool(t)`, a Python `if` on a tensor (including +`if tensor.any()`), and per-step host reads of batch.status. These wait for GPU +work before Python can continue. Host reads are fine at setup, at a +checkpoint, in a check every N steps (N > 1), and in the final report. +Prefer toolkit `run()` loops and hooks with a class-level `frequency` over a +hand-written step loop. Keep masks and reductions as device tensors. + +A small CPU check is fine. The delivered code must still select `cuda` when a +GPU exists. Do not hard-code `device="cpu"` to make the check pass. This holds +for scratch test scripts too. Pass `device_type=device.type` there as well. + +Build `AtomicData` only at setup, to validate input. In loops, work on +`Batch` tensors (see the data note, "Keep hot paths on `Batch`"). + +### Batched dynamics pre-flight check + +Before every `run()`, confirm both checks in one line. Do not run until both +are true. Details are in +[dynamics-optimization.md](references/dynamics-optimization.md). + +1. **One batch, one engine or `FusedStage`.** Build one `Batch` with + `Batch.from_data_list(...)` for all independent systems. Do not run each + system in a Python loop. Use a `FusedStage` to retire each system on its + own when it converges. +2. **Neighbor hooks registered.** Register every hook from + `model.make_neighbor_hooks()` on the engine or fused stage before the + first step. Models without a neighbor list return no hooks. + +```python +from nvalchemi.data import Batch +from nvalchemi.dynamics import FIRE2, ConvergenceHook, FusedStage + +batch = Batch.from_data_list(data_list).to(device) # many systems, one batch +opt = FIRE2(model=model, dt=0.1, n_steps=100, device_type=device.type, + convergence_hook=ConvergenceHook.from_fmax(0.05)) +dyn = FusedStage(sub_stages=[(0, opt)], device_type=device.type) +for hook in model.make_neighbor_hooks(): # BEFORE_COMPUTE hooks + dyn.register_hook(hook) +with dyn: + batch = dyn.run(batch) +``` + +### Route to a note + +Match the task to the routing table. If it spans notes, read each note named +in the matching rows before you write code. + +| Task | Note | +| --- | --- | +| Build, batch, convert, or inspect atomic systems, field names, ASE input | [data.md](references/data.md) | +| Write, read, or stream Zarr stores, DataLoader throughput | [data.md](references/data.md) | +| Load a pretrained model (MACE, AIMNet2, UMA, LJ, DFT-D3, Ewald, PME) | [models.md](references/models.md) | +| Wrap a custom PyTorch model, combine models, outputs and embeddings | [models.md](references/models.md) | +| Relax structures, run MD (NVE, NVT, NPT), chain stages, scans | [dynamics-optimization.md](references/dynamics-optimization.md) | +| Built-in hooks: freezing, safety, logging, snapshots, convergence, timing | [dynamics-optimization.md](references/dynamics-optimization.md) | +| Reaction paths and NEB, restraints and enhanced sampling | [dynamics-optimization.md](references/dynamics-optimization.md) | +| Train from scratch, losses, checkpoints, resume, DDP | [training.md](references/training.md) | +| Fine-tune a pretrained model, distill a teacher into a student | [training.md](references/training.md) | +| Sample structures with a generative model, generate then relax | [generative-workflows.md](references/generative-workflows.md) | +| Write a new hook, integrator, optimizer, loss, bias, or reporter | [composition-and-extension.md](references/composition-and-extension.md) | +| Domain decomposition, dynamics stages on different GPUs, dashboards | [composition-and-extension.md](references/composition-and-extension.md) | +| Custom NEB force equation or spring policy | [dynamics-optimization.md](references/dynamics-optimization.md) | +| Save and restore dynamics or sampling state, Hessians | [dynamics-optimization.md](references/dynamics-optimization.md), [models.md](references/models.md) | +| Crystal structure prediction (the nvalchemi.csp package) | [generative-workflows.md](references/generative-workflows.md) | + +### Reuse first + +1. **Reuse.** Search the shipped components before you write anything. The + notes list them per area. Most needs (freezing atoms, NaN checks, drift + warnings, logging, snapshots, step budgets, restraints) already exist. +2. **Subclass for a small change.** If a shipped class is close, subclass it + and override the one method that differs. +3. **Write new code only for missing behavior.** Follow the protocol the toolkit + defines (for example the `Hook` protocol or `BaseDynamics`), so it composes + with the rest. + +Say which path you took and why, in one line, when you hand back the code. + +### Workspace rules + +- Keep scratch files under the working folder you were given, for example in + a scratch subfolder. Do not write elsewhere unless the user asks. +- Do not delete files or folders with `rm -rf` or `rm -r`, even for caches or + temporary folders. Leave `__pycache__`, Zarr scratch stores, and temporary + folders in place. If a single file must go, name it with `rm -f ` and + say why. Ask first if the user has not granted delete permission. +- Read only installed package source and linked docs and example pages. + Do not download source files, scripts, or wheels with `curl`, `wget`, or + `git`. Do not download code to run by any other means. +- Do not print environment variables. Do not run `env` or `printenv`, or + dump os.environ. These can expose secrets in tool output. +- Ask before you install, upgrade, or remove packages. + +### Report the result + +In the final message, name any script you wrote and the toolkit components +you used. Report measured results with units only for work you ran. If you +did not execute the work, say "Not executed" and why. Do not invent numbers. +If the run failed or did not converge, say so and give the measured values. +Do not present a capped or failed run as a converged result. + +## Limitations + +- The notes track release 0.3.0. Older installs miss generative sampling, + reaction paths, enhanced sampling, distillation, and other 0.3.0 APIs. +- Multi-GPU and multi-node runs need a launcher (`torchrun` or Slurm). Write + the script and the launch command. Do not start multi-GPU jobs unasked. +- Model backends download checkpoints on first use. Offline machines need the + checkpoint file in advance. + +## Troubleshooting + +| Symptom | Likely cause | Fix | +| --- | --- | --- | +| `KeyError: 'neighbor_matrix' required` or `'neighbor_list'` | No neighbor-list hook | Register `model.make_neighbor_hooks()` | +| `AttributeError: ... no attribute 'masses'` | Field is `atomic_masses` | Use `batch.atomic_masses` | +| `InvalidCxxCompiler` or Inductor build error on CPU | `NeighborListHook` is compiled, no C++ toolchain | Run eagerly, see dynamics note | +| `AttributeError: 'Batch' has no attribute 'status'` | Plain dynamics does not create `status` | Add a `status` column, see dynamics note | +| `FileExistsError: Zarr store already exists` | `write()` on an existing store | Use `append()` or a new path | +| `ValueError: ... pattern ... did not match any parameter` | Wrong fine-tuning glob | Print `named_parameters()` and fix the glob | +| `ValueError: ... has no trainable parameters` with MACE | `MACEWrapper` freezes weights by default since 0.3.0 | Load with `train=True`, see the training note | diff --git a/skills/nvalchemi-toolkit/evals/config.yml b/skills/nvalchemi-toolkit/evals/config.yml new file mode 100644 index 00000000..137735b4 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/config.yml @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NVSkills CI runs the native Harbor tasks in evals/harbor/, one folder per +# task. Those nine tasks are the CI set; the other tasks in evals.json run in +# the maintainers' own evaluation. Each task runs evals/setup_cpu.sh as its +# environment healthcheck, with a 600 s budget, in both arms (with the skill +# and the baseline), so they see the same environment. The script installs +# the CPU stack (CPU torch, nvalchemi-toolkit 0.3.0, ASE) into +# /workspace/.venv; runtime_env puts that venv first on PATH. The tasks are +# generated from evals.json and setup_cpu.sh, so edit those, not the tasks. +schema_version: 1 + +harbor: + task_source: native_harbor + base_image_mode: rebuild + n_attempts: 3 + # 3, not 2: baseline runs on CPU are slow and should not hit the agent + # timeout. It scales the 300 s agent timeout in each task.toml. + timeout_multiplier: 3 + # SkillEvaluator's pass@k compares its own overall (the judge dimensions) + # with this value. The task goal itself is gated by the custom metrics from + # evals/grader.py. + pass_threshold: 0.9 + runtime_env: + BASH_DEFAULT_TIMEOUT_MS: "240000" + VIRTUAL_ENV: /workspace/.venv + PATH: /workspace/.venv/bin:/tmp/agent-home/.local/bin:/home/agent/.local/bin:/usr/local/share/npm-global/bin:/opt/openhands-venv/bin:/usr/local/bin:/usr/bin:/bin + OMP_NUM_THREADS: "4" + +# evals/grader.py runs the machine checks of each task after the judges and +# adds the metrics batched, device_aware, loop_syncs, reuse, and outcome per +# trial. SkillEvaluator's overall is unchanged by them. +grading: + mode: default_plus_custom + # Metric names that evals/grader.py writes under custom_metrics. + custom_metrics: + - batched + - device_aware + - loop_syncs + - reuse + - outcome diff --git a/skills/nvalchemi-toolkit/evals/evals.json b/skills/nvalchemi-toolkit/evals/evals.json new file mode 100644 index 00000000..ba008bb1 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/evals.json @@ -0,0 +1,2365 @@ +{ + "skill_name": "nvalchemi-toolkit", + "evals": [ + { + "id": "comp-01", + "name": "Silicon equation-of-state plumbing check", + "track": "end-user", + "area": "Composed", + "prompt": "Before I wire up a real MLIP I want a quick CPU sanity check that I can drive an equation-of-state workflow end to end with the ALCHEMI Toolkit. My structure is si_diamond.extxyz (2x2x2 supercell of diamond silicon, 64 atoms, a = 5.43 angstrom). Scale the lattice isotropically to 0.96, 0.98, 1.00, 1.02, and 1.04 of its current size, relax the atoms at each volume with the cell held fixed, and fit an equation of state to the five energy-volume points to get the equilibrium volume and bulk modulus. There is no GPU and no trained checkpoint here, so check it on CPU, but write it so it uses a GPU when one is there. Use the toolkit's Lennard-Jones model as a stand-in (epsilon = 0.5 eV, sigma = 2.1 angstrom, cutoff = 4.1 angstrom); I only care that the plumbing is right, not the numbers. Cap the optimizer at 50 steps per scan point and let it stop early on convergence with fmax = 0.05 eV/angstrom. Print the five relaxed energies and the fitted V0 and B0. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: read si_diamond.extxyz with ase.io.read; for each scale factor copy the Atoms and set_cell(cell * s, scale_atoms=True); convert each with AtomicData.from_atoms (cell and pbc kept) and add zero forces and energy; put all five in one Batch.from_data_list(..., device=device) (cuda when available). LennardJonesModelWrapper(epsilon=0.5, sigma=2.1, cutoff=4.1) on the same device. One fixed-cell FIRE2(model, dt=0.1, n_steps=50, convergence_hook=ConvergenceHook.from_fmax(0.05)) wrapped in FusedStage(sub_stages=[(0, opt)]) so each volume retires on its own, neighbor hooks from make_neighbor_hooks() registered, one run(batch, n_steps=50). Read batch.energy once after the run and fit with ase.eos.EquationOfState(volumes, energies, eos='birchmurnaghan'). Reference run: V0 about 1204.5 A^3, B0 about 90.3 GPa. Wrong turns: a Python loop over scale factors with one optimizer run each (the most common miss); scaling the cell without the positions; FIRE2VariableCell or LBFGSVariableCell; a neighbor list built once before the loop; NeighborListHook without a stage; raw energies without a fit; extra scan points.", + "assertions": [ + "The scan covers exactly the scale factors 0.96, 0.98, 1.00, 1.02, 1.04, each built by scaling cell and positions together (for example set_cell(..., scale_atoms=True)) and converted with AtomicData.from_atoms.", + "All five volumes are relaxed in one optimizer run over one Batch; there is no Python loop with one optimizer run per volume.", + "The optimizer is fixed-cell (FIRE2 or LBFGS, not a variable-cell variant) with n_steps at most 50 and a ConvergenceHook at fmax 0.05, and the model's neighbor-list hooks are registered before the run.", + "The five E(V) points are fitted with an equation of state (Birch-Murnaghan or equivalent) and V0 and B0 are reported.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them.", + "Routing, only when task notes are installed: before writing the script the agent opens both the data note (references/data.md) and the dynamics and optimization note (references/dynamics-optimization.md). When no such notes exist in the environment, this item is met." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/dynamics_simulations.md", + "docs/userguide/models.md", + "examples/basic/02_geometry_optimization.py", + "examples/basic/03_ase_integration.py", + "nvalchemi/models/lj.py", + "nvalchemi/data/atomic_data.py", + "nvalchemi/hooks/neighbor_list.py" + ], + "files": [ + "files/si_diamond.extxyz" + ], + "checks": [ + { + "id": "scale-atoms", + "metric": "outcome", + "kind": "static", + "description": "Cell and positions scaled together.", + "require": [ + "scale_atoms\\s*=\\s*True|positions\\s*\\*=?\\s*\\w+|frac" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "one-batch", + "metric": "batched", + "kind": "static", + "description": "One Batch.from_data_list over the scan.", + "require": [ + "Batch\\.from_data_list\\(" + ] + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(" + ] + }, + { + "id": "fixed-cell", + "metric": "reuse", + "kind": "static", + "description": "Fixed-cell FIRE2/LBFGS with ConvergenceHook, no variable-cell.", + "require": [ + "\\b(FIRE2|LBFGS)\\(", + "ConvergenceHook" + ], + "forbid": [ + "VariableCell" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "eos-fit", + "metric": "outcome", + "kind": "static", + "description": "Equation-of-state fit.", + "require": [ + "EquationOfState|birch|murnaghan|curve_fit|polyfit" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "v0", + "metric": "outcome", + "kind": "run", + "description": "Run output shows V0 near 1204.5 A^3.", + "scope": "run", + "pattern": "(?:V0|V\u2080|V_0|equilibrium volume)\\D{0,25}?(\\d{2,}\\.?\\d*)", + "expect": 1204.5, + "tol": 12.045 + }, + { + "id": "reads-notes", + "metric": "reuse", + "kind": "static", + "description": "With the skill installed, the agent opened references/data.md and references/dynamics-optimization.md (cat, sed, head, grep or a Read call); skipped in the baseline arm.", + "scope": "reads", + "needs_skill": true, + "require": [ + "references/data\\.md", + "references/dynamics-optimization\\.md" + ] + } + ] + }, + { + "id": "model-01", + "name": "Wrap a custom message-passing model for dynamics", + "track": "developer", + "area": "Models", + "prompt": "I have a small message-passing-style network in input/toy_pair_model.py (class TinyPairModel). It takes atomic numbers, positions, and a batch index tensor, and returns one scalar energy per graph. Wrap it so toolkit dynamics stages (FIRE2, NVT) can call it: energy plus forces derived from the energy by autograd. Then run a quick sanity check with a single 4-atom structure and print the energy and force shapes it produces. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: class TinyPairWrapper(nn.Module, BaseModelMixin) that holds the unchanged TinyPairModel as self.model and sets self.model_config = ModelConfig(outputs={'energy', 'forces'}, autograd_outputs={'forces'}, autograd_inputs={'positions'}, needs_pbc=False) inside __init__ (an instance attribute, not a class attribute). adapt_input calls super().adapt_input(data, **kwargs) first (this turns on requires_grad for positions) and passes positions, atomic_numbers, and batch_idx (zeros for a single AtomicData). forward runs the model once on the whole batch and takes forces as -torch.autograd.grad(energy.sum(), positions, create_graph=self.training) in one call for all graphs. adapt_output calls super().adapt_output first, which gives energy shape [B, 1]; forces are [N, 3]. embedding_shapes returns {} and compute_embeddings raises NotImplementedError. The check puts the wrapper and a one-structure Batch on the chosen device (cuda when available) and calls it once: energy (1, 1), forces (4, 3), net force about 0. Wrong turns: finite-difference or zero forces; a per-graph or per-atom Python loop for energies or gradients; a shared class-level model_config; skipping the super() calls; editing toy_pair_model.py; adding dynamics runs or training to the sanity check.", + "assertions": [ + "The wrapper subclasses nn.Module and BaseModelMixin and sets self.model_config = ModelConfig(...) inside __init__, with forces in autograd_outputs.", + "adapt_input calls super().adapt_input(...) first and adapt_output calls super().adapt_output(...) first (or the wrapper inherits them unchanged), and forces come from torch.autograd.grad of the energy, not finite differences or zeros.", + "The wrapper defines embedding_shapes and compute_embeddings (a stub is fine).", + "The sanity check prints energy shape (1, 1) and forces shape (4, 3) from one forward pass on one 4-atom structure.", + "Batch-level tensor code: the work runs on one Batch with tensor operations over all atoms and systems; there is no Python loop over atoms or systems inside a step, a hook, or a model call.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them.", + "The workload stays as asked: one forward pass on one 4-atom structure; no training loop, extra structures, or dynamics run." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/models.md", + "nvalchemi/models/base.py", + "examples/advanced/11_batched_neb.py" + ], + "files": [ + "files/toy_pair_model.py" + ], + "checks": [ + { + "id": "mixin", + "metric": "reuse", + "kind": "static", + "description": "Wrapper subclasses BaseModelMixin and builds a ModelConfig.", + "require": [ + "class\\s+\\w+\\([^)]*BaseModelMixin", + "ModelConfig\\(" + ] + }, + { + "id": "instance-config", + "metric": "reuse", + "kind": "static", + "description": "model_config is assigned on self inside a method.", + "require": [ + "self\\.model_config\\s*=\\s*ModelConfig\\(" + ] + }, + { + "id": "autograd-forces", + "metric": "outcome", + "kind": "static", + "description": "Forces from torch.autograd.grad; no finite differences.", + "require": [ + "autograd\\.grad\\(|autograd_outputs" + ], + "forbid": [ + "finite.?diff.*forces\\s*=", + "forces\\s*=\\s*torch\\.zeros" + ] + }, + { + "id": "embedding-members", + "metric": "reuse", + "kind": "static", + "description": "embedding_shapes and compute_embeddings are defined.", + "require": [ + "def embedding_shapes", + "def compute_embeddings" + ] + }, + { + "id": "fixture-untouched", + "metric": "reuse", + "kind": "static", + "description": "toy_pair_model.py is not rewritten by the agent.", + "scope": "commands", + "forbid": [ + "(>|tee)\\s*\\S*toy_pair_model\\.py", + "sed -i[^\\n]*toy_pair_model" + ] + }, + { + "id": "no-loop-in-step-methods", + "metric": "batched", + "kind": "static", + "description": "No Python loop over atoms or systems inside __call__, pre_update, post_update, forward, adapt_input, or adapt_output (frequency-gated hooks and fixed-length loops do not count).", + "analyser": "no_loop_in_methods", + "methods": [ + "__call__", + "pre_update", + "post_update", + "forward", + "adapt_input", + "adapt_output" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "shapes", + "metric": "outcome", + "kind": "run", + "description": "Run output shows energy (1, 1) and forces (4, 3).", + "scope": "output", + "require": [ + "1,\\s*1\\b", + "4,\\s*3\\b" + ] + } + ] + }, + { + "id": "scope-01", + "name": "Underspecified run-MD request", + "track": "end-user", + "area": "Underspecified", + "prompt": "Here is my structure, ammonia_dimer.xyz. Run MD on it and give me the trajectory.", + "expected_output": "The request lacks every decision an MD run needs: the interatomic model (no checkpoint or potential is given), the ensemble and temperature, and the run length. The expected reply must ask which model or checkpoint to use; naming a stand-in alone does not settle that choice. A stand-in smoke check is acceptable only alongside that question. For the other choices it asks or states explicit assumptions before writing or running any code: which ensemble at which temperature (e.g. NVTLangevin with temperature=300.0, friction=0.01), and how many steps or how much simulated time. Any code the agent produces keeps the run small and bounded (a first check of order 100 steps or fewer, or an explicit TODO for the user to fill in), loads the structure through AtomicData.from_atoms, and does not reference a checkpoint path that was never provided. If the agent runs anything with a stand-in such as DemoModel or the LJ model, it says plainly that the resulting trajectory is not physically meaningful. The agent does not silently launch a production-scale run or scale up the workload.", + "assertions": [ + "The agent asks which interatomic model or checkpoint to use. A named stand-in (e.g. the Lennard-Jones model or DemoModel) is acceptable for a smoke check only if it also asks which model or checkpoint to use for the real run.", + "The agent asks for, or states as explicit assumptions, the temperature and ensemble and the run length (number of steps or simulated time); none of model, temperature/ensemble, and run length is left silently defaulted.", + "Any MD code the agent writes sets a bounded step count for a first check (n_steps of order 100 or fewer, or an explicit placeholder for the user to choose), rather than copying the 10,000-step defaults shown in the docs examples or leaving the run length unbounded.", + "The agent does not reference a model checkpoint file that the user never provided as if it were present; it either asks where to get one or says a checkpoint must be supplied before a real run (e.g. via a from_checkpoint path or a checkpoint argument it does not have).", + "If the agent executes anything with a fictitious or stand-in model (DemoModel, DemoDynamics, or a placeholder Lennard-Jones model), it tells the user the trajectory is not physically meaningful instead of presenting it as a production result.", + "The agent keeps the workload to the one given 8-atom structure on CPU; it does not scale up to larger systems, replicas, a GPU request, or a long production run, and it does not run unbounded dynamics before the user's choices are known." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/dynamics_simulations.md", + "docs/userguide/models.md", + "examples/basic/05_nvt_langevin.py", + "examples/basic/03_ase_integration.py" + ], + "files": [ + "files/ammonia_dimer.xyz" + ], + "checks": [ + { + "id": "asks-model", + "metric": "outcome", + "kind": "run", + "description": "Final message asks which model or checkpoint to use; naming a stand-in alone is not enough.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:model|potential|checkpoint|force field|MLIP)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:model|potential|checkpoint|force field|MLIP)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:model|potential|checkpoint|force field|MLIP)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:model|potential|checkpoint|force field|MLIP)\\b" + ] + }, + { + "id": "asks-ensemble", + "metric": "outcome", + "kind": "run", + "description": "Final message asks for or states temperature and ensemble.", + "scope": "final", + "require": [ + "(?i)temperature|\\bK\\b", + "(?i)NVT|NVE|NPT|ensemble|thermostat|Langevin" + ] + }, + { + "id": "asks-length", + "metric": "outcome", + "kind": "run", + "description": "Final message asks for or states the run length.", + "scope": "final", + "require": [ + "(?i)\\bsteps?\\b|\\bps\\b|\\bfs\\b|\\bns\\b|how long|length|duration|run time|simulation time|total time" + ] + }, + { + "id": "bounded", + "metric": "outcome", + "kind": "static", + "description": "No code with 1000 or more steps.", + "forbid": [ + "n_steps\\s*=\\s*\\d{4,}", + "\\.run\\(\\s*\\d{4,}" + ] + }, + { + "id": "no-installs", + "metric": "reuse", + "kind": "static", + "description": "No package installs.", + "scope": "commands", + "forbid": [ + "pip3? install|uv pip install|conda install" + ] + } + ] + }, + { + "id": "scope-02", + "name": "Clarify a fine-tuning request", + "track": "end-user", + "area": "Underspecified", + "prompt": "I want to fine-tune a model with the ALCHEMI Toolkit on my DFT data in input/co_frames.extxyz. Can you set that up?", + "expected_output": "Reply with a short, request-specific set of questions before setting up a training run. Ask which base model or checkpoint to use, which targets to fit (energy, forces, stress) and their loss weights, and what hardware or time budget is available. Ask about the validation split and the success criterion, or state a clear provisional assumption for those lower-stakes items. A few grouped questions are enough, not the whole ten-item checklist. Reading the file to identify REF_energy and REF_forces and the absence of stress labels is welcome but not required; labels present in a file do not decide the training objective. Do not train, install packages, invent a checkpoint path, or silently choose the base model or targets. No script, checkpoint or measured training result is required in this one reply.", + "assertions": [ + "The agent asks which base model or checkpoint to fine-tune; it does not silently choose one or treat a named stand-in as the answer.", + "The agent asks which targets to fit or how to weight the energy, force and stress losses; merely listing the labels in the file does not settle the objective.", + "The agent asks what hardware or time budget is available before proposing a training workload.", + "The agent asks about the validation split and the success criterion, or states short provisional assumptions for them; it does not leave them silently defaulted.", + "The question list is short and specific to fine-tuning this data, not a generic ten-item checklist. File inspection to report available labels is allowed but not required.", + "The agent does not start training, install packages, or supply a checkpoint path that the user never gave. No trained model or executable script is required." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/finetuning.md", + "docs/userguide/training.md", + "nvalchemi/training/finetune.py" + ], + "files": [ + "files/co_frames.extxyz" + ], + "checks": [ + { + "id": "asks-model", + "metric": "outcome", + "kind": "run", + "description": "Asks which base model or checkpoint to use.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:model|potential|checkpoint|force field|MLIP)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:model|potential|checkpoint|force field|MLIP)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:model|potential|checkpoint|force field|MLIP)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:model|potential|checkpoint|force field|MLIP)\\b" + ] + }, + { + "id": "asks-targets", + "metric": "outcome", + "kind": "run", + "description": "Asks about targets or loss weights, not only available labels.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:targets?|loss(?: weights?)?|weights?|energy|forces?|stress)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:targets?|loss(?: weights?)?|weights?|energy|forces?|stress)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:targets?|loss(?: weights?)?|weights?|energy|forces?|stress)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:targets?|loss(?: weights?)?|weights?|energy|forces?|stress)\\b" + ] + }, + { + "id": "asks-budget", + "metric": "outcome", + "kind": "run", + "description": "Asks about hardware or time budget.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:hardware|budget|GPUs?|CPUs?|devices?|time|hours?|compute|wall[- ]?time)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:hardware|budget|GPUs?|CPUs?|devices?|time|hours?|compute|wall[- ]?time)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:hardware|budget|GPUs?|CPUs?|devices?|time|hours?|compute|wall[- ]?time)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:hardware|budget|GPUs?|CPUs?|devices?|time|hours?|compute|wall[- ]?time)\\b" + ] + }, + { + "id": "no-training-code", + "metric": "outcome", + "kind": "static", + "description": "No executed training calls, optimizer updates or training launchers.", + "scope": "code", + "forbid": [ + "\\.(?:fit|train)\\(\\s*[^)\\s]", + "\\.fit\\(\\s*\\)", + "\\b(?:strategy|trainer|finetun\\w*)\\.(?:run|fit|train)\\s*\\(", + "(?s)\\b(?:FineTuningStrategy|TrainingStrategy)\\([^;]*?\\)\\s*\\.run\\s*\\(", + "\\.(?:backward|step)\\(\\s*\\)", + "\\bnvalchemi-training\\s+spec\\s+(?:run|resume)\\b", + "\\b(?:python3?|torchrun|uv\\s+run)\\s+(?:\\S*/)?(?:train|finetun\\w*)\\.py\\b" + ] + }, + { + "id": "no-invented-checkpoint-code", + "metric": "outcome", + "kind": "static", + "description": "No literal checkpoint path that was never supplied.", + "scope": "code", + "forbid": [ + "\\b(?:from_checkpoint|load_checkpoint|from_pretrained_checkpoint|CheckpointHook)\\(\\s*[\\'\\\"][^\\'\\\"]+[\\'\\\"]", + "\\b(?:checkpoint_path|checkpoint_dir|ckpt_path|ckpt)\\s*=\\s*[\\'\\\"][^\\'\\\"]+[\\'\\\"]", + "[\\'\\\"][^\\'\\\"\\n]+\\.(?:pt|pth|ckpt|model)[\\'\\\"]" + ] + }, + { + "id": "no-training-commands", + "metric": "outcome", + "kind": "static", + "description": "No executed training calls, optimizer updates or training launchers.", + "scope": "commands", + "forbid": [ + "\\.(?:fit|train)\\(\\s*[^)\\s]", + "\\.fit\\(\\s*\\)", + "\\b(?:strategy|trainer|finetun\\w*)\\.(?:run|fit|train)\\s*\\(", + "(?s)\\b(?:FineTuningStrategy|TrainingStrategy)\\([^;]*?\\)\\s*\\.run\\s*\\(", + "\\.(?:backward|step)\\(\\s*\\)", + "\\bnvalchemi-training\\s+spec\\s+(?:run|resume)\\b", + "\\b(?:python3?|torchrun|uv\\s+run)\\s+(?:\\S*/)?(?:train|finetun\\w*)\\.py\\b" + ] + }, + { + "id": "no-invented-checkpoint-commands", + "metric": "outcome", + "kind": "static", + "description": "No literal checkpoint path that was never supplied.", + "scope": "commands", + "forbid": [ + "\\b(?:from_checkpoint|load_checkpoint|from_pretrained_checkpoint|CheckpointHook)\\(\\s*[\\'\\\"][^\\'\\\"]+[\\'\\\"]", + "\\b(?:checkpoint_path|checkpoint_dir|ckpt_path|ckpt)\\s*=\\s*[\\'\\\"][^\\'\\\"]+[\\'\\\"]", + "[\\'\\\"][^\\'\\\"\\n]+\\.(?:pt|pth|ckpt|model)[\\'\\\"]" + ] + }, + { + "id": "no-installs", + "metric": "reuse", + "kind": "static", + "description": "No package installs or environment changes.", + "scope": "commands", + "forbid": [ + "\\b(?:pip3?|uv\\s+pip|conda|mamba)\\s+install\\b", + "\\buv\\s+(?:sync|add)\\b", + "\\buv\\s+run\\b[^\\n]*--with\\b", + "\\bpython3?\\s+-m\\s+pip\\s+install\\b" + ] + } + ] + }, + { + "id": "scope-03", + "name": "Read structure facts before asking", + "track": "end-user", + "area": "Underspecified", + "prompt": "Please set up NVT MD with the ALCHEMI Toolkit for input/ar_scope.extxyz. Use its Lennard-Jones model with epsilon=0.0104 eV, sigma=3.4 A and cutoff=5.0 A, dt=1 fs, Langevin friction=0.01 /fs and random seed 0. Draw initial thermal velocities at the thermostat temperature. This is CPU-only, with at most one minute for an optional smoke check. I want a script and a short report of the input and settings; the check is that the energy and forces remain finite. You may write them in this workspace; do not install or download anything. What else do you need before setting it up?", + "expected_output": "Read input/ar_scope.extxyz first (ASE or a text reader is enough). Report or use its facts: 32 Ar atoms, a cubic 10.8 A cell, periodic in all three directions, positions in angstrom under the usual extxyz convention. The model, ensemble, timestep, friction, seed, velocity initialization rule, hardware, permissions, deliverables and smoke-check criterion are already given. Only the thermostat temperature and run length remain open. Ask only for those, or state explicit provisional assumptions for both before any execution. Do not ask the user for the cell, periodicity, atom count, species or units already supplied by the input. A reply that reads and asks is sufficient: no MD execution or finished script is required. If a check is run, keep it to at most 100 steps and under one minute on CPU, describe any chosen temperature and length as provisional, and do not present smoke-test numbers as production results. Do not silently choose either open setting.", + "assertions": [ + "The agent reads the provided file, rather than guessing, and reports or uses its 32 Ar atoms, cubic cell with 10.8 A sides and periodic boundaries in all three directions; extxyz positions use angstrom.", + "The agent asks only about the thermostat temperature and run length, or states explicit provisional assumptions for both. It does not silently choose either setting.", + "The agent does not ask the user for facts in the file (cell, periodicity, atom count, species or units), or reopen choices already supplied in the prompt.", + "Reading and asking is sufficient; no MD execution or finished script is required. Any optional check stays on CPU, below one minute and at 100 steps or fewer, with provisional settings and no production claim.", + "If code is written, it uses the supplied Lennard-Jones model and toolkit NVT integrator, keeps the supplied periodic cell, and registers the model neighbor hooks before running; it does not install or download packages." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/data.md", + "docs/userguide/dynamics_simulations.md", + "nvalchemi/models/lj.py" + ], + "files": [ + "files/ar_scope.extxyz" + ], + "checks": [ + { + "id": "input-facts", + "metric": "outcome", + "kind": "run", + "description": "Reply reports atom count, species, and periodic cell from the input.", + "scope": "final", + "require": [ + "(?i)\\b32\\b[^\\n]{0,20}?\\b(?:Ar|argon)?\\s*atoms?\\b|\\b32-atom\\b|\\batoms?\\b[*_`:=\\s]{0,8}32\\b|\\bAr\\s*(?:32|\\u2083\\u2082)\\b|\\b32\\s*[x\\u00d7]\\s*Ar\\b", + "(?i)\\bAr\\b|\\bargon\\b", + "(?i)\\b10\\.80*\\b", + "(?i)(?:fully|triply|3D|three-dimensionally)[- ]periodic|periodic[^!?\\n]{0,60}?(?:\\ball\\b|\\bthree\\b|\\b3\\b|\\b3D\\b|xyz|x[ ,/]+y[ ,/]+(?:and\\s+)?z|every direction|each direction|cubic|cell|box|boundar)|pbc[^!?\\n]{0,60}?(?:true[^\\n]*true[^\\n]*true|T[ ,]+T[ ,]+T)" + ] + }, + { + "id": "temperature-open", + "metric": "outcome", + "kind": "run", + "description": "Asks for thermostat temperature or labels an assumption.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b|\\b(?:assum\\w*|provisional\\w*|tentative\\w*)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b|\\b(?:temperature|thermostat(?: target)?|kelvin|K)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\b(?:assum\\w*|provisional\\w*|tentative\\w*)\\b" + ] + }, + { + "id": "length-open", + "metric": "outcome", + "kind": "run", + "description": "Asks for run length or labels an assumption.", + "scope": "final", + "require": [ + "(?i)\\b(?:which|what|how|should I|should we|shall I|is|are|have you|can I|may I|do you|does|could you|can you|would you|will you|want|prefer|ok|okay|happy)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,120}\\?|(?:(?m:^)|(?<=[.!?:])\\s+)\\s*(?:[-*>]\\s+|\\d+[.)]\\s+)?[*_`]*(?:[\\w/'-]+\\s+){0,3}[*_`]*\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b[*_`]*[.:)]?[*_`]*(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\?|\\b(?:please\\s+)?(?:provide|specify|choose|pick|confirm|tell me|let me know|decide)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,100}\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b|\\b(?:still open|left open|open settings?|need (?:from you|your (?:input|choice|decision)s?)|I need (?:these|the following|two|three|a few|you to)|before I (?:start|run|write|set)\\w*[^\\n]{0,40}\\bneed)\\b[\\s\\S]{0,300}?\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b|\\b(?:assum\\w*|provisional\\w*|tentative\\w*)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b|\\b(?:run length|length|duration|steps?|simulated time|simulation time|ps|fs|ns|how long)\\b(?:[^.!?\\n]|\\.(?=\\w)|(?<=\\be\\.g)\\.|(?<=\\bi\\.e)\\.){0,140}\\b(?:assum\\w*|provisional\\w*|tentative\\w*)\\b" + ] + }, + { + "id": "no-redundant-questions", + "metric": "outcome", + "kind": "static", + "description": "Does not ask for facts already in the structure file.", + "scope": "final", + "forbid": [ + "(?i)\\b(?:what|which|how|is|are|does|do|can you|could you|please (?:provide|specify|confirm|tell))[^.!?\\n]{0,70}\\b(?:cell|lattice|box (?:size|dimensions)|pbc|periodic(?:ity)?|number of atoms|atom count|species|elements?|units?)\\b[^.!?\\n]{0,80}\\?", + "(?i)\\bhow many (?:\\w+\\s+){0,3}atoms\\b[^.!?\\n]{0,80}\\?" + ] + }, + { + "id": "bounded-code", + "metric": "outcome", + "kind": "static", + "description": "No literal step budget above 100; dynamic budgets remain judge-checked.", + "scope": "code", + "forbid": [ + "\\b(?:n_steps|num_steps|max_steps|steps)\\s*=\\s*(?:10[1-9]|1[1-9]\\d|[2-9]\\d{2}|\\d{4,})\\b", + "\\.run\\(\\s*(?:10[1-9]|1[1-9]\\d|[2-9]\\d{2}|\\d{4,})\\b" + ] + }, + { + "id": "bounded-commands", + "metric": "outcome", + "kind": "static", + "description": "No literal step budget above 100; dynamic budgets remain judge-checked.", + "scope": "commands", + "forbid": [ + "\\b(?:n_steps|num_steps|max_steps|steps)\\s*=\\s*(?:10[1-9]|1[1-9]\\d|[2-9]\\d{2}|\\d{4,})\\b", + "\\.run\\(\\s*(?:10[1-9]|1[1-9]\\d|[2-9]\\d{2}|\\d{4,})\\b" + ] + }, + { + "id": "no-installs", + "metric": "reuse", + "kind": "static", + "description": "No package installs or environment changes.", + "scope": "commands", + "forbid": [ + "\\b(?:pip3?|uv\\s+pip|conda|mamba)\\s+install\\b", + "\\buv\\s+(?:sync|add)\\b", + "\\buv\\s+run\\b[^\\n]*--with\\b", + "\\bpython3?\\s+-m\\s+pip\\s+install\\b" + ] + } + ] + }, + { + "id": "imp-01", + "name": "Batched relaxation of three argon clusters", + "track": "end-user", + "area": "Implicit", + "prompt": "argon_clusters.xyz holds three 27-atom argon clusters. I want all three relaxed together to a maximum force below 0.05 eV/A, with at most 200 optimizer steps, using a Lennard-Jones potential (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A). Later I will run thousands of these on a GPU, so treat them as one batch on the device and use the batched atomistic simulation library installed in this environment, not a loop of ASE optimizers. This machine has no GPU, so check it here on CPU, but write it so it uses a GPU when one is there. Print the final energy and maximum force of each cluster. When you are done, tell me the name of the script you wrote and which library classes and functions it uses.", + "expected_output": "Optimal pattern: find the installed batched simulation library (nvalchemi) and use it. Read the three frames with ase.io.read(path, index=':'), convert each with AtomicData.from_atoms and add zero forces and energy, and put them in one Batch.from_data_list(..., device=device), where device is cuda when available. LennardJonesModelWrapper(epsilon=0.0104, sigma=3.4, cutoff=8.5) on the same device. One FIRE2 (or LBFGS) with n_steps at most 200 and ConvergenceHook.from_fmax(0.05), inside a FusedStage so each cluster stops on its own, with the model's neighbor hooks registered; one run. Read the per-cluster energy and the per-cluster max force once after the run. Reference run (FIRE2, dt 0.1): energies about -0.687, -0.688 and -1.072 eV, max forces below 0.05 eV/A; other optimizer settings stop at slightly different energies within the force threshold. Wrong turns: ase.optimize in a Python loop over clusters; one toolkit optimizer run per cluster; hand-written FIRE or gradient descent; device pinned to cpu; neighbor hooks not registered; more than 200 steps.", + "assertions": [ + "The agent uses the batched simulation library installed in the environment (the toolkit's AtomicData, Batch, LJ model wrapper and optimizer), not ASE optimizers or a hand-written minimizer.", + "All three clusters are relaxed in one optimizer run over one Batch, with a per-cluster convergence check at fmax 0.05 eV/A (ConvergenceHook inside a FusedStage, or equivalent) and at most 200 steps.", + "The Lennard-Jones model uses epsilon 0.0104 eV, sigma 3.4 A and cutoff 8.5 A, and its neighbor-list hooks are registered before the run.", + "The run prints a final energy and maximum force for each of the three clusters, read once after the run, and the forces are below 0.05 eV/A or the agent says which cluster did not converge.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/dynamics_simulations.md", + "examples/basic/02_geometry_optimization.py", + "examples/basic/03_ase_integration.py", + "nvalchemi/models/lj.py", + "nvalchemi/data/atomic_data.py" + ], + "files": [ + "files/argon_clusters.xyz" + ], + "checks": [ + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "one-batch", + "metric": "batched", + "kind": "static", + "description": "One Batch.from_data_list over the scan.", + "require": [ + "Batch\\.from_data_list\\(" + ] + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(" + ] + }, + { + "id": "toolkit-optimizer", + "metric": "reuse", + "kind": "static", + "description": "Toolkit optimizer with ConvergenceHook; no ASE optimizer.", + "require": [ + "\\b(FIRE2|LBFGS|FIRE)\\(", + "ConvergenceHook", + "(?m)^\\s*(from|import)\\s+nvalchemi\\b" + ], + "forbid": [ + "ase\\.optimize", + "\\b(BFGS|BFGSLineSearch|MDMin|GPMin)\\(" + ] + }, + { + "id": "bounds", + "metric": "outcome", + "kind": "static", + "description": "fmax 0.05 and at most 200 steps.", + "require": [ + "0\\.05" + ], + "forbid": [ + "n_steps\\s*=\\s*(?:20[1-9]|2[1-9]\\d|[3-9]\\d{2}|\\d{4,})\\b", + "\\.run\\([^)]*n_steps\\s*=\\s*(?:20[1-9]|2[1-9]\\d|[3-9]\\d{2}|\\d{4,})\\b" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "cluster2-energy", + "metric": "outcome", + "kind": "run", + "description": "Run output shows the third cluster near -1.07 eV (its relaxed energy at fmax 0.05).", + "scope": "run", + "pattern": "(-1\\.0\\d+)", + "expect": -1.072, + "tol": 0.03 + } + ] + }, + { + "id": "imp-02", + "name": "NVT MD of an argon crystal with a Zarr trajectory", + "track": "end-user", + "area": "Implicit", + "prompt": "argon_fcc32.extxyz is a 32-atom FCC argon crystal in a periodic box. Run Langevin NVT molecular dynamics at 40 K (friction 0.01 /fs, random seed 0) for 200 steps of 2 fs, starting from Maxwell-Boltzmann velocities at 40 K, with a Lennard-Jones potential (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A). Save a frame every 20 steps to a Zarr store on disk so I can stream it into a training set later, then report how many frames the store holds. The GPU-batched atomistic simulation package in this environment is what my group uses, so build on it rather than writing an integrator or using ASE's MD. This machine has no GPU, so check it here on CPU, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which library classes and functions it uses.", + "expected_output": "Optimal pattern: find the installed package (nvalchemi) and use it. AtomicData.from_atoms on the crystal with zero forces, energy and velocities; a one-graph Batch on the chosen device (cuda when available); velocities from initialize_velocities(..., 40 K, random_seed=0). LennardJonesModelWrapper(epsilon=0.0104, sigma=3.4, cutoff=8.5) on the same device. NVTLangevin(model, dt=2.0, temperature=40.0, friction=0.01, random_seed=0, n_steps=200) with SnapshotHook(sink=ZarrData(store), frequency=20) and the model's neighbor hooks; one run. The store then holds 10 frames (steps 20 to 200), which len(sink) or a read-back confirms. Wrong turns: ase.md.Langevin; a hand-written integrator or step loop; writing frames with raw zarr, pickle or one file per frame; a snapshot every step; more than 200 steps; device pinned to cpu.", + "assertions": [ + "The agent uses the installed batched simulation package (the toolkit's NVTLangevin, LJ model wrapper and data classes), not ase.md or a hand-written integrator.", + "NVTLangevin runs at 40 K with friction 0.01, random seed 0, dt 2 fs and 200 steps, starting from velocities drawn at 40 K (initialize_velocities or equivalent toolkit call).", + "Frames go to a Zarr store through the toolkit's SnapshotHook with a ZarrData sink every 20 steps, not raw zarr arrays, pickle, or one file per frame.", + "The agent reports that the store holds 10 frames, from a count or read-back after the run.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/dynamics_simulations.md", + "docs/userguide/dynamics_sinks.md", + "examples/basic/05_nvt_langevin.py", + "examples/intermediate/02_trajectory_zarr_io.py", + "nvalchemi/dynamics/hooks/snapshot.py", + "nvalchemi/dynamics/sinks.py" + ], + "files": [ + "files/argon_fcc32.extxyz" + ], + "checks": [ + { + "id": "toolkit-nvt", + "metric": "reuse", + "kind": "static", + "description": "Toolkit NVTLangevin; no ASE MD or hand-written velocity update.", + "require": [ + "\\bNVTLangevin\\(", + "(?m)^\\s*(from|import)\\s+nvalchemi\\b" + ], + "forbid": [ + "ase\\.md", + "velocities\\s*[+-]?=\\s*[^=\\n]*forces" + ] + }, + { + "id": "zarr-snapshots", + "metric": "reuse", + "kind": "static", + "description": "SnapshotHook with a ZarrData sink; no raw zarr or pickle.", + "require": [ + "\\bSnapshotHook\\(", + "\\bZarrData\\(" + ], + "forbid": [ + "zarr\\.(open|create|group|array)\\(", + "\\bpickle\\." + ] + }, + { + "id": "settings", + "metric": "outcome", + "kind": "static", + "description": "40 K, friction 0.01, dt 2, 200 steps, snapshots every 20.", + "require": [ + "\\b40(?:\\.0*)?\\b", + "0\\.01\\b", + "dt\\s*=\\s*2(?:\\.0*)?\\b", + "\\b200\\b", + "frequency\\s*=\\s*20\\b" + ], + "forbid": [ + "n_steps\\s*=\\s*(?:20[1-9]|2[1-9]\\d|[3-9]\\d{2}|\\d{4,})\\b" + ] + }, + { + "id": "thermal-start", + "metric": "reuse", + "kind": "static", + "description": "Velocities drawn at 40 K with the toolkit's initialize_velocities.", + "require": [ + "initialize_velocities\\(" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "ten-frames", + "metric": "outcome", + "kind": "run", + "description": "Run output reports 10 frames in the store.", + "scope": "run", + "require": [ + "(?i)\\b10\\s+(?:frames|snapshots|samples|entries|graphs)\\b|(?:frames|snapshots|samples|len\\w*)\\W{0,4}\\s*[:=]?\\s*10\\b" + ] + } + ] + }, + { + "id": "neg-01", + "name": "Cu slab relaxation with ASE BFGS and EMT", + "track": "end-user", + "area": "Negative", + "prompt": "My project already depends on nvalchemi and it is installed in this environment, but for this one I just want plain ASE. Here is a small copper slab, cu_slab.extxyz (32 Cu atoms, four fcc(100) layers, vacuum on one side). Please relax the atomic positions with ASE's BFGS optimizer and the EMT potential until the maximum force is below 0.01 eV/\u00c5, capped at 50 steps. It is a quick CPU sanity check on my laptop, so nothing heavier than that. Report the final energy and the final maximum force when it is done.", + "expected_output": "A plain-ASE script or command sequence: load the slab with ase.io.read, attach the ase.calculators.emt.EMT calculator (EMT covers Cu), run ase.optimize.BFGS with fmax=0.01 and steps capped at 50, then report the final potential energy from atoms.get_potential_energy() and the final maximum force magnitude from atoms.get_forces(). EMT is analytic and CPU-only, so the run finishes in seconds. The agent recognizes that no nvalchemi component is needed even though the project depends on it: no nvalchemi import, no AtomicData.from_atoms conversion of the slab, no model wrapper, no skill files consulted. The agent does not enlarge the job (no GPU request, no neural-potential calculator swap, no size or lattice sweeps, no extra systems).", + "assertions": [ + "The agent's code and shell commands never import nvalchemi or any nvalchemi.* submodule (no nvalchemi.data, nvalchemi.dynamics, nvalchemi.models, and so on).", + "The agent does not open, read, or follow any nvalchemi skill file (.claude/skills/* or skills/nvalchemi-toolkit/*); its approach comes from ASE itself.", + "The relaxation is done with ASE end to end: the slab is loaded with ase.io.read (or ase.build), the calculator is ase.calculators.emt.EMT, and the optimizer is ase.optimize.BFGS run with fmax=0.01 and steps capped at 50.", + "The agent reports the final potential energy (for example atoms.get_potential_energy()) and the final maximum force magnitude (for example the largest row norm of atoms.get_forces()) after the relaxation.", + "Although the prompt says the project already depends on nvalchemi, the agent does not convert the structure into the toolkit's data model (no AtomicData.from_atoms or equivalent), does not wrap EMT in an nvalchemi model interface, and does not use a toolkit optimizer such as FIRE2 in place of ASE's BFGS.", + "The agent keeps the workload as asked: one CPU relaxation of one slab within the 50-step cap; no GPU request, no calculator swap to a neural potential, no lattice-constant or size sweeps, and no additional systems." + ], + "expected_skill": null, + "gpu": false, + "source": [ + "docs/userguide/data.md", + "examples/basic/03_ase_integration.py", + "docs/userguide/agent_skills.md" + ], + "files": [ + "files/cu_slab.extxyz" + ], + "checks": [ + { + "id": "no-nvalchemi", + "metric": "reuse", + "kind": "static", + "description": "No nvalchemi import in code or commands.", + "scope": "all", + "forbid": [ + "(?m)^\\s*(from|import)\\s+nvalchemi\\b", + "import nvalchemi\\b" + ] + }, + { + "id": "ase-path", + "metric": "reuse", + "kind": "static", + "description": "ASE BFGS and EMT.", + "require": [ + "\\bBFGS\\b", + "\\bEMT\\b" + ] + }, + { + "id": "bounds", + "metric": "outcome", + "kind": "static", + "description": "fmax 0.01 and at most 50 steps.", + "require": [ + "0\\.01", + "steps\\s*=\\s*50|50" + ] + }, + { + "id": "energy", + "metric": "outcome", + "kind": "run", + "description": "Run output reports E near 7.1674 eV.", + "scope": "run", + "pattern": "\\b(7\\.16\\d*)", + "expect": 7.1674, + "tol": 0.002 + } + ] + }, + { + "id": "neg-03", + "name": "Water box NVT with OpenMM", + "track": "end-user", + "area": "Negative", + "prompt": "I have a small water box in water.pdb. Run 10 ps of NVT MD at 300 K with OpenMM and save the trajectory.", + "expected_output": "An OpenMM script: PDBFile('water.pdb'), ForceField('amber14-all.xml', 'amber14/tip3p.xml') or another water model, createSystem with PME (the box is 2.4 nm, so a 1.0 nm cutoff fits) and HBonds constraints, LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 2*femtoseconds), Simulation, minimizeEnergy, setVelocitiesToTemperature(300*kelvin), a DCDReporter or PDBReporter for the trajectory, and step(5000) for 10 ps at 2 fs (or the matching count for another timestep). OpenMM is not installed in this environment and the agent may not install packages unasked, so the right reply delivers the script, says it was not run because OpenMM is missing, and gives the install and launch commands for the user to run (for example conda install -c conda-forge openmm, then python run_md.py). If OpenMM turns out to be importable, running it is fine. Wrong turns: rewriting the job in nvalchemi or ASE because those are installed; installing OpenMM without asking; reporting a trajectory or energies that were never computed; a run length other than 10 ps.", + "assertions": [ + "The agent's code and shell commands never import nvalchemi or any nvalchemi.* submodule, and it does not switch the job to ASE MD or another package because those are installed.", + "The delivered script uses OpenMM end to end: PDBFile reads water.pdb, a ForceField with a water model builds the System, a Langevin (or other NVT) integrator holds 300 K, and a reporter writes the trajectory to a file.", + "The run length is 10 ps: the step count times the timestep gives 10 ps (for example 5000 steps of 2 fs).", + "The agent does not install OpenMM or any other package on its own; if OpenMM is missing it says so and gives the user the install and launch commands instead.", + "The agent does not claim a finished run, trajectory file, temperatures or energies that it did not produce in this environment." + ], + "expected_skill": null, + "gpu": false, + "source": [ + "docs/userguide/agent_skills.md" + ], + "files": [ + "files/water.pdb" + ], + "checks": [ + { + "id": "no-nvalchemi", + "metric": "reuse", + "kind": "static", + "description": "No nvalchemi import in code or commands.", + "scope": "all", + "forbid": [ + "(?m)^\\s*(from|import)\\s+nvalchemi\\b", + "import nvalchemi\\b" + ] + }, + { + "id": "openmm-path", + "metric": "reuse", + "kind": "static", + "description": "OpenMM script: PDBFile, ForceField, an integrator, a Simulation, a trajectory reporter; no ASE MD.", + "require": [ + "(?m)^\\s*(from|import)\\s+(openmm|simtk\\.openmm)\\b", + "\\bPDBFile\\(", + "\\bForceField\\(", + "Integrator\\(", + "\\bSimulation\\(", + "(DCD|PDB|XTC|NetCDF|HDF5)Reporter\\(" + ], + "forbid": [ + "ase\\.md" + ] + }, + { + "id": "ten-ps", + "metric": "outcome", + "kind": "static", + "description": "300 K and a 10 ps run (5000 steps of 2 fs, 10000 of 1 fs, 2500 of 4 fs, or 10 ps written in units).", + "require": [ + "\\b300\\b", + "\\b(?:5000|5_000|10000|10_000|2500|2_500)\\b|\\b10\\s*\\*\\s*pico|\\b10\\s*\\*\\s*unit\\.pico|10\\s*/\\s*0\\.002|10\\.0?\\s*\\*\\s*picoseconds" + ] + }, + { + "id": "no-installs", + "metric": "reuse", + "kind": "static", + "description": "No package install by the agent (pip, uv, conda, mamba).", + "scope": "commands", + "forbid": [ + "\\b(?:pip3?|uv\\s+pip|conda|mamba|micromamba)\\s+install\\b", + "\\buv\\s+(?:sync|add)\\b", + "\\buv\\s+run\\b[^\\n]*--with\\b", + "\\bpython3?\\s+-m\\s+pip\\s+install\\b" + ] + }, + { + "id": "honest-status", + "metric": "outcome", + "kind": "run", + "description": "The reply says the run was not executed or that OpenMM is missing, or the run output shows OpenMM steps.", + "scope": "run", + "require": [ + "(?i)not (?:been )?(?:run|executed|installed|available)|isn't installed|is not installed|n't (?:run|execute)|not executed|No module named '?openmm|could not (?:run|import)|cannot (?:run|import)|can't (?:run|import)|unable to (?:run|import)|\\b5000\\b[^\\n]{0,40}(?:K|kelvin|temperature)|#\"Step\"" + ] + } + ] + }, + { + "id": "data-01", + "name": "Round-trip a trajectory through a Zarr store", + "track": "end-user", + "area": "Data", + "prompt": "I have a 40-frame trajectory of an 8-atom argon cluster saved as a multi-frame extended XYZ file at input/argon_frames.extxyz (positions in angstrom, isolated clusters, no cell). Load the frames, write all of them into a single Zarr store on disk, then stream them back and iterate in batches of 32, printing how many batches come out and the positions shape of each batch. Do it in one pass through the data. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: read the frames with ase.io.read(path, index=':') and convert each with AtomicData.from_atoms (no hand-built AtomicData(...) from raw arrays). Write all 40 with one AtomicDataZarrWriter(store).write(list_of_data) call (append calls are also fine). Read back with AtomicDataZarrReader(store) wrapped in Dataset(reader, device=device), where device is cuda when available, and iterate a toolkit DataLoader(dataset, batch_size=32) once with the default drop_last=False. The run prints 2 batches: 32 graphs with positions (256, 3), then 8 graphs with positions (64, 3). Host reads happen only in the per-batch print. Wrong turns: raw zarr arrays, pickle, or one file per frame; reader[i] or dataset[i] in a Python loop; torch.utils.data.DataLoader with a custom collate; drop_last=True (1 batch); hand-built AtomicData; device pinned to cpu.", + "assertions": [ + "The frames are written with AtomicDataZarrWriter into one Zarr store and read back through AtomicDataZarrReader wrapped in the toolkit Dataset, then iterated with the toolkit DataLoader(batch_size=32); not raw zarr arrays, per-frame files, or reader[i] in a loop.", + "The run output shows 2 batches, positions (256, 3) then (64, 3); the trailing partial batch is kept (drop_last stays False).", + "Frames are converted with AtomicData.from_atoms, not built by hand from raw arrays.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them.", + "The workload stays as asked: 40 frames, one pass, batch size 32, no extra epochs or re-reads." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "examples/intermediate/02_trajectory_zarr_io.py", + "examples/basic/03_ase_integration.py", + "docs/userguide/datapipes.md", + "docs/userguide/data.md", + "nvalchemi/data/datapipes/backends/zarr.py", + "nvalchemi/data/datapipes/dataloader.py", + "nvalchemi/data/datapipes/dataset.py" + ], + "files": [ + "files/argon_frames.extxyz" + ], + "checks": [ + { + "id": "zarr-writer", + "metric": "reuse", + "kind": "static", + "description": "Uses AtomicDataZarrWriter, AtomicDataZarrReader, Dataset, DataLoader.", + "require": [ + "AtomicDataZarrWriter", + "AtomicDataZarrReader", + "\\bDataset\\(", + "\\bDataLoader\\(" + ] + }, + { + "id": "no-raw-zarr", + "metric": "reuse", + "kind": "static", + "description": "No raw zarr arrays, pickle, torch DataLoader, or per-index reads.", + "forbid": [ + "zarr\\.(open|create|group|array)\\(", + "\\bpickle\\.", + "torch\\.utils\\.data\\.DataLoader", + "\\b(reader|ds|dataset)\\[\\s*i\\s*\\]" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "no-handbuilt-data", + "metric": "reuse", + "kind": "static", + "description": "No AtomicData(...) built by hand from the frames.", + "forbid": [ + "(?= 1 reached NVT, status == fused.exit_status (2) finished it. The reference run (CPU, seed 0) gives 16 of 16 in NVT and 16 of 16 finished, in 33 fused steps. Any per-step recorder hook stores tensors only. Wrong turns: a Python loop over clusters; two sequential run() calls (relax.run then md.run); a hand-written per-cluster step budget hook in place of the NVT stage's n_steps; no neighbor hooks (KeyError neighbor_matrix); NeighborListHook built without stage=; .item() or .tolist() in a hook every step.", + "assertions": [ + "FIRE2 with ConvergenceHook.from_fmax(0.05) (or an equivalent force criterion) and NVTLangevin at 50 K are composed with + into one FusedStage (or FusedStage(sub_stages=...)) and run once; not two sequential run() passes.", + "The step budgets are set on the stages: FIRE2 n_steps at most 40, NVTLangevin n_steps at most 20 (the per-cluster NVT budget), and the fused run has an overall cap.", + "The model's neighbor-list hooks are registered on the fused stage before the run (make_neighbor_hooks(), or NeighborListHook with stage=BEFORE_COMPUTE).", + "The reported count of clusters that reached NVT comes from batch.status after the run.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "examples/intermediate/01_multistage_pipeline.py", + "examples/basic/02_geometry_optimization.py", + "examples/intermediate/02_trajectory_zarr_io.py", + "nvalchemi/dynamics/base.py", + "nvalchemi/models/lj.py" + ], + "files": [], + "checks": [ + { + "id": "fused", + "metric": "reuse", + "kind": "static", + "description": "FIRE2 and NVTLangevin composed into a FusedStage.", + "require": [ + "FIRE2\\(", + "NVTLangevin\\(", + "FIRE2\\([\\s\\S]*\\+|\\+\\s*\\w*md\\w*|FusedStage\\(" + ] + }, + { + "id": "convergence", + "metric": "reuse", + "kind": "static", + "description": "ConvergenceHook on fmax 0.05.", + "require": [ + "ConvergenceHook(\\.from_\\w+)?\\(" + ] + }, + { + "id": "single-run", + "metric": "batched", + "kind": "static", + "description": "Exactly one .run( call on the engines (no relax.run then md.run).", + "forbid": [ + "(?s)\\.run\\([^\\n]*\\n.*\\.run\\(" + ] + }, + { + "id": "budgets", + "metric": "outcome", + "kind": "static", + "description": "n_steps=40 (or less) on FIRE2 and n_steps=20 (or less) on NVT.", + "require": [ + "n_steps\\s*=\\s*(40|[1-3]\\d|RELAX\\w*|N_RELAX\\w*|\\w*RELAX\\w*)", + "n_steps\\s*=\\s*(20|1\\d|\\w*(MD|NVT|EQ)\\w*)" + ] + }, + { + "id": "status-read", + "metric": "outcome", + "kind": "static", + "description": "The count is read from batch.status.", + "require": [ + "\\.status\\b" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "nvt-count", + "metric": "outcome", + "kind": "run", + "description": "Run output reports how many of 16 clusters reached NVT.", + "scope": "run", + "require": [ + "(?i)\\b(1[0-6]\\s*(/|of|out of)\\s*16|all 16|16 clusters?\\b[^\\n]{0,40}NVT)" + ] + } + ] + }, + { + "id": "hook-03", + "name": "Harmonic pair restraint under NPT through EnhancedSampling", + "track": "end-user", + "area": "Hooks, deprecated", + "prompt": "argon_fcc32.extxyz is a 32-atom FCC argon crystal in a periodic cell. With the ALCHEMI Toolkit's Lennard-Jones model (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A), please run NPT at 50 K and zero external pressure for 100 steps, dt = 0.5 fs, with a harmonic restraint (k = 2 eV/A^2) holding the distance between atoms 0 and 1 near their initial separation. Tell me how the restraint energy behaved over the run and whether the cell volume stayed sensible. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: HarmonicUmbrellaBias(cv=lambda b: pair_distance(b, torch.tensor([0, 1])), centers=, stiffness=2.0, name='restraint') (compute_stress=True is the default) run by EnhancedSampling(model=model, engine=NPT, engine_kwargs=dict(dt=0.5, temperature=50.0, pressure=0.0, barostat_time=..., thermostat_time=...), biases={'restraint': bias}, extra_hooks=[*model.make_neighbor_hooks(), recorder]). The LJ model has set_config('active_outputs', {'energy', 'forces', 'stress'}); the batch (from AtomicData.from_atoms, on the chosen device) carries cell, zero stress, forces, energy, and velocities from initialize_velocities at 50 K. The recorder appends sampling.last_outputs['bias/restraint/energy'], the pair distance, and det(cell) as device tensors every step and the script reads them once after sampling.run(batch, n_steps=100). Reference run: restraint energy mean 1.9e-3, max 3.1e-3 eV; distance 3.756 to 3.810 A; volume 1197.8 to 1164.5 A^3 (-2.8 %). Wrong turns: BiasedPotentialHook (deprecated, its bias adds no stress); restraint forces added by hand to batch.forces; a bare NPT engine with a custom bias hook; no stress output; .item() calls in a per-step recorder.", + "assertions": [ + "The restraint is a HarmonicUmbrellaBias on pair_distance (or a ConservativeBias subclass) run by EnhancedSampling with engine=NPT and engine_kwargs carrying dt, temperature, pressure, barostat_time, and thermostat_time.", + "BiasedPotentialHook is not used, and the agent does not add restraint forces to batch.forces by hand.", + "Stress is wired: the model's active_outputs include stress, the batch carries a cell and a zero stress buffer, and the bias keeps compute_stress=True.", + "The report gives the restraint energy over the run (from last_outputs or the bias) and the cell volume at the start and end.", + "Batch-level tensor code: the work runs on one Batch with tensor operations over all atoms and systems; there is no Python loop over atoms or systems inside a step, a hook, or a model call.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "nvalchemi/enhanced_sampling/_bias.py", + "nvalchemi/enhanced_sampling/_runner.py", + "nvalchemi/enhanced_sampling/biases/umbrella.py", + "nvalchemi/enhanced_sampling/cv/pair_distance.py", + "nvalchemi/hooks/bias.py", + "nvalchemi/dynamics/integrators/npt.py", + "docs/userguide/enhanced_sampling.md", + "examples/advanced/12_umbrella_sampling.py", + "examples/intermediate/03_npt_barostat_validation.py" + ], + "files": [ + "files/argon_fcc32.extxyz" + ], + "checks": [ + { + "id": "enhanced-sampling", + "metric": "reuse", + "kind": "static", + "description": "EnhancedSampling with engine=NPT and a toolkit bias.", + "require": [ + "EnhancedSampling\\(", + "engine\\s*=\\s*NPT", + "HarmonicUmbrellaBias\\(|ConservativeBias" + ] + }, + { + "id": "no-deprecated", + "metric": "reuse", + "kind": "static", + "description": "No BiasedPotentialHook; no hand-added restraint forces.", + "forbid": [ + "BiasedPotentialHook", + "forces\\s*(\\+=|=\\s*\\w*\\.forces\\s*\\+)" + ] + }, + { + "id": "stress", + "metric": "outcome", + "kind": "static", + "description": "Stress output active and a stress buffer present.", + "require": [ + "['\\\"]stress['\\\"]", + "stress['\\\"]?\\]?\\s*=\\s*torch\\.zeros" + ], + "forbid": [ + "compute_stress\\s*=\\s*False" + ] + }, + { + "id": "extra-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor hooks passed via extra_hooks.", + "require": [ + "extra_hooks\\s*=" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-loop-in-step-methods", + "metric": "batched", + "kind": "static", + "description": "No Python loop over atoms or systems inside __call__, pre_update, post_update, forward, adapt_input, or adapt_output (frequency-gated hooks and fixed-length loops do not count).", + "analyser": "no_loop_in_methods", + "methods": [ + "__call__", + "pre_update", + "post_update", + "forward", + "adapt_input", + "adapt_output" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "report", + "metric": "outcome", + "kind": "run", + "description": "Run output reports restraint energy and volume.", + "scope": "run", + "require": [ + "(?i)(restraint|bias)[^\\n]*e", + "(?i)vol" + ] + } + ] + }, + { + "id": "ext-01", + "name": "Custom velocity Verlet integrator that runs inside a FusedStage", + "track": "developer", + "area": "Extension", + "prompt": "I'm working with the ALCHEMI Toolkit and want to learn its integrator extension point before I write a fancier thermostat later. Please write my own plain velocity Verlet integrator by subclassing the toolkit's dynamics base class: the standard splitting, a half velocity kick and position update first, then the second half kick after the forces are computed. Then give it a short workout: build a small Lennard-Jones argon cluster in code (8 or 27 atoms, epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A), run 100 steps at dt = 0.5 fs, and report the maximum total-energy drift over the run. It also has to slot into a multi-stage pipeline, so show it composed with a FIRE2 relaxation stage using '+' on the same cluster: the relaxation should hand over once forces are below 0.01 eV/A (at most 200 steps), then your integrator should run exactly 20 steps and finish. Tell me how many steps each stage ran and the cluster's final status. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: class VelocityVerlet(BaseDynamics) with class-level __needs_keys__ = {'forces'} and __provides_keys__ = {'positions', 'velocities'}, dt converted with fs_to_internal_time from nvalchemi.dynamics._units, and only pre_update and post_update overridden. pre_update: velocities.add_(0.5*dt*forces/m) then positions.add_(dt*velocities); post_update: velocities.add_(0.5*dt*forces/m); masses as atomic_masses.view(-1, 1); in place, full batch, no per-graph loop. NVE check: one 27-atom cluster in a Batch on the chosen device, neighbor hooks from make_neighbor_hooks(), 100 steps, total energy recorded per step as device tensors and reduced once after the run (reference: max drift 5e-4 eV). Pipeline: fused = FIRE2(n_steps=200, convergence_hook=ConvergenceHook.from_fmax(0.01)) + VelocityVerlet(n_steps=20); neighbor hooks on fused; fused.run(batch, n_steps=). Per-stage counts come from a hook that adds ctx.active_graph_mask (at BEFORE_POST_UPDATE, on each sub-stage) as a device tensor, or from the n_steps_counter bookkeeping; the sub-stages' own step_count attributes track the fused count and are not per-stage work. Reference run: FIRE2 36 steps, integrator 20, final status 2 (the fused exit_status), 56 fused steps; FIRE2's count depends on the starting jitter. Wrong turns: overriding step() or compute(); a per-graph loop; raw dt in fs; no n_steps on the integrator (status stuck at 1); reporting sub-stage step_count as per-stage work; .item() in a per-step hook.", + "assertions": [ + "The integrator subclasses BaseDynamics, overrides only pre_update and post_update with the velocity Verlet split (half kick and drift before the force call, half kick after), and declares __needs_keys__ and __provides_keys__ as class-level sets.", + "The timestep is converted from femtoseconds with fs_to_internal_time (or an equivalent documented conversion).", + "The pipeline is relax + vv (a FusedStage) with the integrator given n_steps=20, and the reported per-stage step counts show the integrator at exactly 20 and a final status equal to the fused exit_status (2).", + "The NVE check runs 100 steps on one cluster of at most 27 atoms and reports the maximum total-energy drift.", + "Batch-level tensor code: the work runs on one Batch with tensor operations over all atoms and systems; there is no Python loop over atoms or systems inside a step, a hook, or a model call.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "examples/advanced/05_custom_integrator.py", + "nvalchemi/dynamics/base.py", + "nvalchemi/dynamics/_units.py", + "nvalchemi/models/lj.py", + "docs/userguide/dynamics.md" + ], + "files": [], + "checks": [ + { + "id": "subclass", + "metric": "reuse", + "kind": "static", + "description": "Subclasses BaseDynamics; overrides pre_update and post_update only.", + "require": [ + "class\\s+\\w+\\(\\s*BaseDynamics\\s*\\)", + "def pre_update", + "def post_update" + ], + "forbid": [ + "def (step|compute)\\(self" + ] + }, + { + "id": "keys", + "metric": "reuse", + "kind": "static", + "description": "__needs_keys__ and __provides_keys__ declared.", + "require": [ + "__needs_keys__", + "__provides_keys__" + ] + }, + { + "id": "units", + "metric": "outcome", + "kind": "static", + "description": "dt converted with fs_to_internal_time.", + "require": [ + "fs_to_internal_time" + ] + }, + { + "id": "fused", + "metric": "reuse", + "kind": "static", + "description": "Composed with + into a FusedStage, integrator n_steps=20.", + "require": [ + "\\+\\s*\\w+|FusedStage\\(", + "n_steps\\s*=\\s*20" + ] + }, + { + "id": "convergence", + "metric": "reuse", + "kind": "static", + "description": "FIRE2 hands over with ConvergenceHook at 0.01.", + "require": [ + "ConvergenceHook(\\.from_\\w+)?\\(" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-loop-in-step-methods", + "metric": "batched", + "kind": "static", + "description": "No Python loop over atoms or systems inside __call__, pre_update, post_update, forward, adapt_input, or adapt_output (frequency-gated hooks and fixed-length loops do not count).", + "analyser": "no_loop_in_methods", + "methods": [ + "__call__", + "pre_update", + "post_update", + "forward", + "adapt_input", + "adapt_output" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "twenty-and-two", + "metric": "outcome", + "kind": "run", + "description": "Run output shows 20 integrator steps and final status 2.", + "scope": "run", + "require": [ + "\\b20\\b", + "(?i)status[^\\n]{0,40}\\b2\\b" + ] + } + ] + }, + { + "id": "dyn-02", + "name": "Reaction barrier with NEB and AIMNet2", + "track": "end-user", + "area": "Dynamics (MEP)", + "prompt": "I want the energy barrier for the HCN <-> HNC isomerization. The reactant and product geometries are in input/hcn_reactant.extxyz and input/hcn_product.extxyz (atom order H, C, N; positions in angstrom; the AIMNet2 checkpoint path is in the environment variable $AIMNET2_CKPT). Set up a NEB path with 7 images between them, start from an IDPP-relaxed initial path, and run climbing-image NEB with the AIMNet2 potential, staying within 50 optimization steps per stage and converging the forces to 0.05 eV/A. This machine has no GPU; I will run the calculation on a GPU machine. Write the script so it uses the GPU when one is present, and give me the command to launch it there. When it runs, the script should report the forward barrier (HCN to the transition state) in eV, the final fmax, and whether the NEB converged. You may run a short CPU check here (a few steps) to make sure the script runs, but do not report GPU results you have not measured. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern (as in examples/advanced/11_batched_neb.py): device = cuda if torch.cuda.is_available() else cpu, chosen once; both endpoints via AtomicData.from_atoms with charge=torch.zeros(1, 1), each in a one-graph Batch on that device; band = interpolate_paths(initial, final, num_images=7); IDPP on a clone: prepare_idpp_targets(band.clone()), zero energy/forces/velocities, NEB(model=IDPPModel(), fmax=0.1, n_steps<=50).run(...); then a fresh band = band.clone() with positions.copy_(idpp_band.positions) and fresh zero energy, forces, and velocities (no IDPP status, targets, or optimizer state). model = AIMNet2Wrapper.from_checkpoint(os.environ['AIMNET2_CKPT'], device=device); NEB(model=model, spring=0.1, fmax=0.05, n_steps=100, climbing=ClimbingImageConfig(mode='after_regular', regular_fmax=0.2, max_regular_steps=50, max_climbing_steps=50), diagnostics_log_path='neb.csv').run(band): n_steps caps the whole run, and max_regular_steps and max_climbing_steps cap each stage at 50. Switching to the climbing image early (regular_fmax 0.5 or more) makes the climbing stage oscillate: in a 300-step test it never converged, and a 50-step cap on n_steps alone ends with fmax above 2 eV/A. NEB builds the neighbor hooks itself. After the run the script reads, once: the forward barrier (highest interior energy minus the HCN endpoint), which equals the last energy_barrier row of the diagnostics CSV because HCN is the lower endpoint; the final fmax; and converged true or false; an unconverged run is reported as unconverged with its fmax, not as the barrier. A step-count override for the smoke test (an argument or environment variable) is fine as long as the default keeps the caps above. GPU readiness (graded from the code): the device is picked once with cuda when available and never pinned to cpu; the model, the band Batch, and the NEB run on that one device; the whole band is one Batch in one NEB per stage; no .item(), .cpu(), float(tensor), print(tensor), or tensor branch in agent code that runs every step; any progress hook fires every N > 1 steps with one host read per firing. With that, the expected GPU behaviour is one batched model call per NEB step and no agent-side host syncs in the step loop. What the CPU check can confirm: the script imports, loads the checkpoint, builds the band, runs IDPP and a few model NEB steps without error, writes the diagnostics CSV, and takes the cpu branch of the device choice. It cannot confirm convergence, the barrier, or GPU speed, and the answer must say the GPU run was not executed here and present the CPU run only as a smoke test. The judge must NOT require a barrier value, a step count, or convergence in the answer; the full run was not made here. Wrong turns: ASE NEB with an ASE calculator per image; hand-placed images; IDPP on the same object later used for the model NEB; no climbing image; a 50-step cap on n_steps with climbing switched on at regular_fmax 0.5; device hard-coded to cpu; a raw AIMNet2Calculator called outside NEB; presenting a smoke-test number as the barrier or claiming GPU results that were not measured.", + "assertions": [ + "The band is built with interpolate_paths(initial, final, num_images=7) and refined with IDPP (prepare_idpp_targets on a clone plus NEB(model=IDPPModel(), ...)), and the AIMNet2 NEB starts from a fresh band that carries only the IDPP positions (no IDPP status, targets, or optimizer state), with zero energy, forces, and velocities re-attached.", + "AIMNet2 is loaded as a toolkit model from $AIMNET2_CKPT (AIMNet2Wrapper.from_checkpoint, or a BaseModelMixin wrapper as in the batched NEB example) and run inside the toolkit NEB with ClimbingImageConfig; not ASE's NEB.", + "Bounded run: each NEB stage is capped at 50 steps with fmax 0.05 eV/A by default, and the script reads the forward barrier (HCN to the transition state, eV), the final fmax, and convergence once after the run, reporting an unconverged run as unconverged; any progress hook fires every N > 1 steps with one host read per firing.", + "Honest reporting: the answer gives the script name and the command that launches it on the GPU machine, states that the GPU run was not executed here, reports any CPU run only as a smoke test, and claims no GPU result, timing, or barrier it did not measure.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "examples/advanced/11_batched_neb.py", + "docs/userguide/dynamics_mep.md", + "nvalchemi/dynamics/mep/neb.py", + "nvalchemi/models/aimnet2.py" + ], + "files": [ + "files/hcn_reactant.extxyz", + "files/hcn_product.extxyz" + ], + "checks": [ + { + "id": "interpolate", + "metric": "reuse", + "kind": "static", + "description": "interpolate_paths with 7 images.", + "require": [ + "interpolate_paths\\(", + "\\b7\\b" + ] + }, + { + "id": "idpp", + "metric": "reuse", + "kind": "static", + "description": "IDPP on a clone with IDPPModel.", + "require": [ + "prepare_idpp_targets\\(", + "IDPPModel\\(\\)", + "\\.clone\\(\\)" + ] + }, + { + "id": "fresh-band", + "metric": "outcome", + "kind": "static", + "description": "The model NEB gets a fresh band that copies the IDPP positions.", + "require": [ + "positions\\.copy_\\(|positions\\s*=\\s*[\\w.]*\\.positions(\\.detach\\(\\))?\\.clone\\(\\)" + ] + }, + { + "id": "aimnet-toolkit", + "metric": "reuse", + "kind": "static", + "description": "AIMNet2 loaded as a toolkit model from $AIMNET2_CKPT.", + "require": [ + "AIMNet2Wrapper\\.from_checkpoint\\(|BaseModelMixin", + "AIMNET2_CKPT" + ] + }, + { + "id": "climbing", + "metric": "reuse", + "kind": "static", + "description": "ClimbingImageConfig is used.", + "require": [ + "ClimbingImageConfig\\(" + ] + }, + { + "id": "stage-caps", + "metric": "outcome", + "kind": "static", + "description": "Each stage is capped at 50: max_regular_steps/max_climbing_steps, or n_steps of at most 50 per NEB call.", + "require": [ + "max_(regular|climbing)_steps\\s*=|n_steps\\s*=\\s*(50|[1-4]\\d)\\b|n_steps\\s*=\\s*[A-Za-z_]" + ] + }, + { + "id": "gpu-not-run", + "metric": "outcome", + "kind": "run", + "description": "The final message states that the GPU run was not executed here.", + "scope": "final", + "require": [ + "(?i)(\\bGPU\\b[^.\\n]{0,80}(not|n't|never|yet to)\\b[^.\\n]{0,30}\\b(run|ran|execut|launch|test|measur)|(not|n't|never)\\b[^.\\n]{0,30}\\b(run|ran|execut|launch|test|measur)\\w*[^.\\n]{0,60}\\bGPU\\b)" + ] + }, + { + "id": "launch-command", + "metric": "outcome", + "kind": "run", + "description": "The final message gives the command that launches the script.", + "scope": "final", + "require": [ + "python3?\\s+(-\\S+\\s+)*\\S+\\.py\\b|uv run\\s+\\S*\\s*\\S+\\.py\\b" + ] + }, + { + "id": "no-ase-engine", + "metric": "reuse", + "kind": "static", + "description": "No ASE optimizer, NEB, or MD driver stands in for the toolkit engine.", + "forbid": [ + "from ase\\.(neb|mep|optimize|md)\\b", + "import ase\\.(neb|optimize|md)\\b" + ] + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(" + ] + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + } + ] + }, + { + "id": "train-01", + "name": "Fine-tune MACE-MP on a small set and resume after a crash", + "track": "end-user", + "area": "Training", + "prompt": "I have 200 frames of a diatomic with energy and force labels in input/co_frames.extxyz (stored as REF_energy in the frame info and REF_forces per atom). Fine-tune the MACE-MP foundation model on this small dataset (the checkpoint path is in the environment variable $MACE_CKPT), but only update the readout/head parameters and keep the rest of the body frozen. Batch size 8, single GPU. This machine has no GPU; I will run the job on a GPU machine, so write the script so it uses the GPU when one is present. Keep it tiny: train for 5 optimizer steps with a checkpoint at step 5, then resume from that checkpoint as if the job had crashed and train to step 10. Give me the exact commands to launch both parts on the GPU machine, and show me exactly how to resume. You may run a small CPU check here (a few steps) to make sure the script runs, but do not report GPU results you have not measured. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: device = cuda if torch.cuda.is_available() else cpu, chosen once; frames via ase.io.read(path, index=':') -> AtomicData.from_atoms(atoms, energy_key='REF_energy', forces_key='REF_forces') -> one Batch -> InMemoryDataset(batch, device=device) -> toolkit DataLoader(dataset, batch_size=8). model = MACEWrapper.from_checkpoint('file://' + abspath($MACE_CKPT), device=device) with no compile_model (a plain local path fails with 'unknown url type' on the pinned mace-torch). FineTuningStrategy(models=model, trainable_patterns=('main.model.readouts.*',) (names checked with named_parameters), optimizer_configs=OptimizerConfig(optimizer_cls=torch.optim.AdamW, optimizer_kwargs={'lr': 1e-4}), training_fn=default_training_fn, loss_fn=EnergyMSELoss() + ForceMSELoss(), num_steps=5, devices=[device], hooks=[CheckpointHook(dir, step_interval=5), NeighborListHook(model.model_config.neighbor_config, stage=TrainingStage.BEFORE_FORWARD)]) .run(loader). Resume: FineTuningStrategy.load_checkpoint(dir, training_fn=default_training_fn, hooks=[...same hooks...]), set num_steps=10, .run(loader); it continues at step 5 and ends at step 10 (the CLI form is nvalchemi-training spec resume). from_pretrained_checkpoint starts a new run and is not a resume. GPU readiness (graded from the code): the device is picked once with cuda when available and never pinned to cpu; the model, the dataset, the strategy's devices, and the optimizer state follow that one device; one DataLoader feeds one FineTuningStrategy; no .item(), print(loss), float(tensor), or torch.save in agent code that runs every step; any logging hook fires every N > 1 steps with one host read per firing. With that, the expected GPU behaviour is one batched forward and backward per optimizer step and no agent-side host syncs beyond the toolkit's own training step. What the CPU check can confirm: the script imports, loads the checkpoint with only the readout trainable, builds the loader, runs phase 1 to step 5, writes the checkpoint directory (manifest.json), and the resume continues from step 5 rather than 0, all within 10 steps in total. It cannot confirm GPU speed or GPU losses, and the answer must say the GPU run was not executed here and present the CPU run only as a smoke test. Context only, which the judge must NOT require in the answer: the reference run with a DemoModelWrapper stand-in on CPU gives phase 1 at step 5 with only the readout tensors changed, a manifest.json in the checkpoint directory, and the resumed run going from step 5 to 10. Wrong turns: a hand-written training loop on raw mace-torch; a hand-rolled batch shuffler; compile_model=True; full-model training; from_pretrained_checkpoint as the resume; NeighborListHook without a stage; more than 10 steps; device hard-coded to cpu; claiming GPU losses or timings that were not measured.", + "assertions": [ + "MACE-MP is loaded with MACEWrapper.from_checkpoint from $MACE_CKPT (a file:// URL, or a plain path with a note about the file:// workaround) without compile_model=True, and FineTuningStrategy trains only the readout: trainable_patterns match the readout parameters of the wrapped model (for example main.model.readouts.*), and the body stays frozen.", + "The labelled frames reach the strategy through AtomicData.from_atoms(..., energy_key='REF_energy', forces_key='REF_forces') and InMemoryDataset or Dataset plus the toolkit DataLoader(batch_size=8); not a hand-written batching loop.", + "Bounded run: a CheckpointHook (or save_checkpoint) writes a checkpoint at step 5, the run resumes from it with FineTuningStrategy.load_checkpoint (or nvalchemi-training spec resume) and continues to step 10, never more than 10 steps in total; from_pretrained_checkpoint is not used as the resume.", + "Honest reporting: the answer gives the script name and the command that launches it on the GPU machine, states that the GPU run was not executed here, reports any CPU run only as a smoke test, and claims no GPU result, timing, or loss it did not measure.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them.", + "Routing, only when task notes are installed: before writing the script the agent opens both the training note (references/training.md) and the models note (references/models.md). When no such notes exist in the environment, this item is met." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/finetuning.md", + "docs/userguide/training.md", + "nvalchemi/training/finetune.py", + "nvalchemi/training/hooks/checkpoint.py", + "nvalchemi/models/mace.py", + "examples/advanced/10_mace_training.py" + ], + "files": [ + "files/co_frames.extxyz" + ], + "timeout_multiplier": 3, + "checks": [ + { + "id": "mace-load", + "metric": "reuse", + "kind": "static", + "description": "MACEWrapper.from_checkpoint on $MACE_CKPT, no compile.", + "require": [ + "MACEWrapper\\.from_checkpoint\\(", + "MACE_CKPT" + ], + "forbid": [ + "compile_model\\s*=\\s*True" + ] + }, + { + "id": "strategy", + "metric": "reuse", + "kind": "static", + "description": "FineTuningStrategy with trainable_patterns on the readout.", + "require": [ + "FineTuningStrategy\\(", + "trainable_patterns", + "readout" + ] + }, + { + "id": "labels", + "metric": "outcome", + "kind": "static", + "description": "from_atoms keeps REF_energy and REF_forces.", + "require": [ + "energy_key\\s*=\\s*['\\\"]REF_energy|REF_energy", + "forces_key\\s*=\\s*['\\\"]REF_forces|REF_forces" + ] + }, + { + "id": "pipeline", + "metric": "batched", + "kind": "static", + "description": "Toolkit InMemoryDataset/Dataset and DataLoader with batch_size=8.", + "require": [ + "(InMemoryDataset|Dataset)\\(", + "\\bDataLoader\\(", + "batch_size\\s*=", + "\\b8\\b" + ] + }, + { + "id": "no-raw-loop", + "metric": "reuse", + "kind": "static", + "description": "No hand-written optimizer loop or raw mace-torch training.", + "forbid": [ + "optimizer\\.step\\(\\)|opt\\.step\\(\\)", + "loss\\.backward\\(\\)", + "from mace\\.tools import|mace\\.modules" + ] + }, + { + "id": "checkpoint", + "metric": "reuse", + "kind": "static", + "description": "CheckpointHook writes the checkpoint.", + "require": [ + "CheckpointHook\\(" + ] + }, + { + "id": "resume", + "metric": "outcome", + "kind": "static", + "description": "Resume with load_checkpoint or the CLI resume.", + "require": [ + "load_checkpoint\\(|spec resume" + ] + }, + { + "id": "bounded", + "metric": "outcome", + "kind": "static", + "description": "num_steps never above 10.", + "forbid": [ + "num_steps\\s*=\\s*(1[1-9]|[2-9]\\d|\\d{3,})\\b" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "gpu-not-run", + "metric": "outcome", + "kind": "run", + "description": "The final message states that the GPU run was not executed here.", + "scope": "final", + "require": [ + "(?i)(\\bGPU\\b[^.\\n]{0,80}(not|n't|never|yet to)\\b[^.\\n]{0,30}\\b(run|ran|execut|launch|test|measur)|(not|n't|never)\\b[^.\\n]{0,30}\\b(run|ran|execut|launch|test|measur)\\w*[^.\\n]{0,60}\\bGPU\\b)" + ] + }, + { + "id": "launch-command", + "metric": "outcome", + "kind": "run", + "description": "The final message gives the command that launches the script.", + "scope": "final", + "require": [ + "python3?\\s+(-\\S+\\s+)*\\S+\\.py\\b|uv run\\s+\\S*\\s*\\S+\\.py\\b" + ] + }, + { + "id": "reads-notes", + "metric": "reuse", + "kind": "static", + "description": "With the skill installed, the agent opened references/training.md and references/models.md (cat, sed, head, grep or a Read call); skipped in the baseline arm.", + "scope": "reads", + "needs_skill": true, + "require": [ + "references/training\\.md", + "references/models\\.md" + ] + } + ] + }, + { + "id": "gen-01", + "name": "Sample structures with a generative sampler", + "track": "end-user", + "area": "Generative", + "prompt": "I want candidate geometries for a 6-atom carbon cluster. The toolkit ships demo generative models (a demo GAN and a demo diffusion model). Write a sampler callable that holds the model and returns a Batch, drive it with the toolkit's generator driver, seed it so two runs agree, draw 8 structures in one call, and print how many graphs and how many atoms per graph come out. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: a sampler class following GeneratingFunction: __call__(inputs=None, *, num_samples=1, rng=None, **kwargs). It holds DemoGANModel(num_atoms=6) (or DemoDiffusionModel(num_atoms=6)) on the chosen device (cuda when available), draws all latents in one torch.randn(num_samples, latent_dim, generator=rng, device=device), decodes them in one model call, and returns one Batch (model.to_batch, or Batch.from_data_list of AtomicData with atomic_numbers 6). It exposes device, required_inputs, and outputs. AtomisticGenerator(generator_func=sampler, seed=..., enable_inference_mode=True) inside a 'with gen:' session calls gen.sample(num_samples=8) once. A second fresh session (or generator) with the same seed gives identical positions; two calls in one session differ by design. Reference run: 8 graphs of 6 atoms, same-seed draws equal. Wrong turns: calling the model 8 times in a Python loop; returning raw tensors; comparing two calls in one session; default 3-atom model; no inference mode (torch.no_grad alone is acceptable but enable_inference_mode is the toolkit switch).", + "assertions": [ + "The sampler follows the GeneratingFunction protocol (inputs, num_samples, rng), draws all latents with the given rng in one call, and returns a Batch (to_batch or Batch.from_data_list), not raw tensors.", + "Generation goes through AtomisticGenerator with one sample(num_samples=8) call inside a with-session or with enable_inference_mode=True.", + "The demo model is built for 6 atoms, and the output is 8 graphs of 6 atoms.", + "Reproducibility is shown with a fresh session or generator using the same seed, not with two consecutive calls in one session.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "docs/userguide/generative.md", + "examples/intermediate/09_generative_samplers.py", + "nvalchemi/gen/generator.py", + "nvalchemi/models/gen/demo.py" + ], + "files": [], + "checks": [ + { + "id": "driver", + "metric": "reuse", + "kind": "static", + "description": "AtomisticGenerator with a sample(num_samples=8) call.", + "require": [ + "AtomisticGenerator\\(", + "\\.sample\\(" + ] + }, + { + "id": "protocol", + "metric": "reuse", + "kind": "static", + "description": "Sampler __call__ takes num_samples and rng.", + "require": [ + "def __call__\\([^)]*num_samples[^)]*rng|def __call__\\([^)]*rng[^)]*num_samples" + ] + }, + { + "id": "returns-batch", + "metric": "outcome", + "kind": "static", + "description": "Returns a Batch.", + "require": [ + "to_batch\\(|Batch\\.from_data_list\\(" + ] + }, + { + "id": "six-atoms", + "metric": "outcome", + "kind": "static", + "description": "Model built for 6 atoms.", + "require": [ + "num_atoms\\s*=\\s*(6|N_ATOMS|\\w+)" + ] + }, + { + "id": "seeded", + "metric": "outcome", + "kind": "static", + "description": "Driver or rng is seeded.", + "require": [ + "seed\\s*=|manual_seed\\(" + ] + }, + { + "id": "one-latent-draw", + "metric": "batched", + "kind": "static", + "description": "Latents drawn with the driver rng.", + "require": [ + "generator\\s*=\\s*rng|rng\\b" + ] + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(", + "\\.decode\\(", + "self\\.model\\(" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "output", + "metric": "outcome", + "kind": "run", + "description": "Run output shows 8 graphs and 6 atoms per graph.", + "scope": "output", + "require": [ + "\\b8\\b", + "\\b6\\b" + ] + } + ] + }, + { + "id": "hook-01", + "name": "Frozen slab bottom layer with NaN abort and drift warning", + "track": "end-user", + "area": "Hooks, reuse", + "prompt": "Here is a small two-layer argon slab, ar_slab.extxyz (32 Ar atoms, periodic in x and y only). Please run a short NVE check with the ALCHEMI Toolkit's Lennard-Jones model (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A), dt = 1 fs, 100 steps, starting from a 50 K Maxwell-Boltzmann velocity distribution. During the run I need three safeguards: the bottom layer (every atom with z below 3 A) must stay exactly fixed; the run must stop immediately with an error if any force or energy value goes non-finite; and if the total energy drifts more than 1e-3 eV/atom/step I want a printed warning, not a crash. At the end, confirm the frozen atoms have not moved. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: AtomicData.from_atoms on the slab with zero forces, energy, and velocities; a one-graph Batch on the chosen device (cuda when available); a boolean node mask z < 3 A added with batch.add_key('frozen', [mask], level='node') (or atom_categories set to AtomCategory.SPECIAL for those atoms); velocities from initialize_velocities(..., 50 K). NVE(model, dt=1.0, n_steps=100, hooks=[FreezeAtomsHook(mask_key='frozen'), NaNDetectorHook(), EnergyDriftMonitorHook(threshold=1e-3, metric='per_atom_per_step', action='warn')]) with the LJ neighbor hooks registered; one run. The frozen check compares positions once after the run: 16 frozen atoms, displacement exactly 0. No new hook class, no inline NaN, drift, or freeze logic, no per-step logger. Wrong turns: a custom audit or diagnostics hook that redoes the NaN, drift, or frozen checks; zeroing positions by hand each step; FreezeAtomsHook with frequency > 1; action='raise'; a thermostat instead of NVE.", + "assertions": [ + "The three safeguards are the built-in FreezeAtomsHook, NaNDetectorHook, and EnergyDriftMonitorHook(threshold=1e-3, metric='per_atom_per_step', action='warn'), passed to an NVE engine through hooks=[...] or register_hook.", + "The frozen atoms are selected through something FreezeAtomsHook reads (mask_key on a boolean node field, or atom_categories), and the hook runs every step (default frequency).", + "The agent defines no new hook class and writes no inline freezing, NaN, or drift logic of its own.", + "The script confirms after the run that the frozen atoms did not move.", + "Batch-level tensor code: the work runs on one Batch with tensor operations over all atoms and systems; there is no Python loop over atoms or systems inside a step, a hook, or a model call.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "nvalchemi/dynamics/hooks/freeze.py", + "nvalchemi/dynamics/hooks/safety.py", + "nvalchemi/dynamics/hooks/monitors.py", + "examples/intermediate/05_safety_and_monitoring.py", + "docs/userguide/hooks.md", + "nvalchemi/data/atomic_data.py" + ], + "files": [ + "files/ar_slab.extxyz" + ], + "checks": [ + { + "id": "builtin-hooks", + "metric": "reuse", + "kind": "static", + "description": "FreezeAtomsHook, NaNDetectorHook, EnergyDriftMonitorHook and NVE.", + "require": [ + "FreezeAtomsHook\\b", + "NaNDetectorHook\\b", + "EnergyDriftMonitorHook\\b", + "\\bNVE\\(" + ] + }, + { + "id": "drift-warn", + "metric": "outcome", + "kind": "static", + "description": "Drift monitor warns at 1e-3 per atom per step.", + "require": [ + "action\\s*=\\s*['\\\"]warn", + "1e-3|0\\.001", + "per_atom_per_step" + ] + }, + { + "id": "freeze-selection", + "metric": "outcome", + "kind": "static", + "description": "Frozen set through mask_key or atom_categories.", + "require": [ + "mask_key\\s*=|atom_categories" + ], + "forbid": [ + "FreezeAtomsHook\\([^)]*frequency\\s*=\\s*([2-9]|\\d{2,})" + ] + }, + { + "id": "no-new-hook", + "metric": "reuse", + "kind": "static", + "description": "No new hook class (no class with a stage attribute or __call__(ctx, stage)).", + "forbid": [ + "(?m)^\\s*stage\\s*=\\s*DynamicsStage\\.", + "def __call__\\(self,\\s*\\w+,\\s*stage" + ] + }, + { + "id": "no-inline-checks", + "metric": "reuse", + "kind": "static", + "description": "No hand-written isfinite, drift, or position-reset logic.", + "forbid": [ + "isfinite\\(", + "positions\\[\\w+\\]\\s*=\\s*\\w+" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-loop-in-step-methods", + "metric": "batched", + "kind": "static", + "description": "No Python loop over atoms or systems inside __call__, pre_update, post_update, forward, adapt_input, or adapt_output (frequency-gated hooks and fixed-length loops do not count).", + "analyser": "no_loop_in_methods", + "methods": [ + "__call__", + "pre_update", + "post_update", + "forward", + "adapt_input", + "adapt_output" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "frozen-zero", + "metric": "outcome", + "kind": "run", + "description": "Run output reports zero displacement of the frozen atoms.", + "scope": "run", + "require": [ + "(?i)(frozen|fixed)[^\\n]*(0(\\.0+)?(e[+-]?0+)?\\b|not moved|unchanged|True|identical)" + ] + } + ] + }, + { + "id": "hook-02", + "name": "Radius-of-gyration hook that stops shrunken clusters", + "track": "developer", + "area": "Hooks, build", + "prompt": "The file argon_clusters.xyz holds three small argon clusters (27 atoms each). The third cluster starts with an inward velocity (stored as momenta in the file), so it begins to collapse. Using the ALCHEMI Toolkit's Lennard-Jones model (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A), please run all three together in one batch at 30 K under NVT (Langevin friction 0.01 /fs) for 100 steps, dt = 1 fs, starting from the velocities in the file. Every 50 steps, record the radius of gyration of each cluster. If a cluster's radius of gyration falls below 4 A, that cluster should stop being integrated while the other two keep going. Report the recorded radii and tell me which clusters stopped and when. This machine has no GPU, so check it here on CPU at this size, but write it so it uses a GPU when one is there. When you are done, tell me the name of the script you wrote and which toolkit classes and functions it uses.", + "expected_output": "Optimal pattern: one new plain hook class with class-level stage = DynamicsStage.AFTER_STEP and frequency = 50, registered on NVTLangevin(model, dt=1.0, temperature=30.0, friction=0.01, n_steps=100) via hooks=[...] or register_hook. __call__(ctx, stage) computes the radius of gyration for all graphs at once (centroids and squared distances with index_add_ or scatter over batch_idx), sets status to ctx.workflow.exit_status for graphs below 4 A restricted to ctx.active_graph_mask (torch.where, no per-graph loop), and stores the radii as tensors; it calls no .item() or .tolist(). Setup: AtomicData.from_atoms per frame, velocities set from atoms.get_velocities() (from_atoms does not read momenta), one Batch on the chosen device, a zero status column added before the run, LJ neighbor hooks registered. Reference run: radii 5.66, 4.95, 4.26 A at step 0 and 5.66, 4.96, 3.70 A at step 50; cluster 3 stops at the step-50 check, final status [0, 0, 1]. Wrong turns: frequency = 1 with an every-step threshold check (stops cluster 3 at step 8); a Python loop over graphs; per-graph .item(); subclassing or patching the engine; raising or breaking the loop to stop a cluster.", + "assertions": [ + "One new hook class satisfies the Hook protocol (stage AFTER_STEP or another per-step stage, class-level frequency = 50, __call__(ctx, stage)) and is registered on the engine with hooks=[...] or register_hook.", + "A cluster below 4 A is stopped by writing exit_status into batch.status (with a zero status column created before the run), restricted to ctx.active_graph_mask; the hook does not raise or remove the graph.", + "Velocities come from the momenta in the file (for example atoms.get_velocities()).", + "The report shows only cluster 3 stopping, at the step-50 check, with radii near 5.66, 4.96, 3.70 A at step 50.", + "Batching: all systems are in one Batch (built with Batch.from_data_list, interpolate_paths, or a toolkit DataLoader) and one engine, strategy, or model call runs over that batch; there is no Python loop that runs the model or an engine once per system.", + "Device: the code picks cuda when a GPU exists (for example torch.device('cuda' if torch.cuda.is_available() else 'cpu')) and puts the model, the batch, and any optimizer on that one device; it does not pin cpu.", + "No avoidable host-device syncs in the step loop: inside a hand-written step loop or a hook that fires every step there is no .item(), .cpu(), .tolist(), float(tensor), print(tensor), or Python if on a tensor; syncs at setup, in a hook that fires every N > 1 steps, at a checkpoint, and in the final report are fine.", + "Reuse: the agent uses the existing toolkit component for each part named in the expected answer and writes no hand-written replacement for any of them." + ], + "expected_skill": "nvalchemi-toolkit", + "gpu": false, + "source": [ + "nvalchemi/hooks/_protocol.py", + "nvalchemi/hooks/_context.py", + "nvalchemi/hooks/_registry.py", + "nvalchemi/dynamics/base.py", + "nvalchemi/data/batch.py", + "examples/advanced/02_custom_hook.py", + "docs/userguide/hooks.md" + ], + "files": [ + "files/argon_clusters.xyz" + ], + "checks": [ + { + "id": "hook-class", + "metric": "reuse", + "kind": "static", + "description": "A hook class with frequency = 50 and __call__(ctx, stage).", + "require": [ + "frequency\\s*=\\s*50", + "def __call__\\(self,\\s*\\w+,\\s*\\w+" + ] + }, + { + "id": "status-write", + "metric": "outcome", + "kind": "static", + "description": "Writes exit_status into status, uses active_graph_mask.", + "require": [ + "exit_status", + "active_graph_mask", + "status" + ] + }, + { + "id": "status-column", + "metric": "outcome", + "kind": "static", + "description": "Creates a status column before the run.", + "require": [ + "\\[\\s*['\\\"]status['\\\"]\\s*\\]\\s*=|add_key\\(\\s*['\\\"]status|\\.status\\s*=\\s*torch\\.zeros" + ] + }, + { + "id": "velocities", + "metric": "outcome", + "kind": "static", + "description": "Velocities from the file's momenta.", + "require": [ + "get_velocities\\(\\)|get_momenta\\(\\)" + ] + }, + { + "id": "no-engine-patch", + "metric": "reuse", + "kind": "static", + "description": "No BaseDynamics subclass and no step override.", + "forbid": [ + "class\\s+\\w+\\(\\s*(BaseDynamics|NVTLangevin)", + "\\.step\\s*=\\s*" + ] + }, + { + "id": "from-atoms", + "metric": "reuse", + "kind": "static", + "description": "Structures are converted with AtomicData.from_atoms.", + "require": [ + "AtomicData\\.from_atoms\\(|\\.from_atoms\\(" + ] + }, + { + "id": "neighbor-hooks", + "metric": "reuse", + "kind": "static", + "description": "Neighbor-list hooks come from model.make_neighbor_hooks() or NeighborListHook.", + "require": [ + "make_neighbor_hooks\\(|NeighborListHook\\(" + ] + }, + { + "id": "neighbor-hook-stage", + "metric": "reuse", + "kind": "static", + "description": "Every NeighborListHook(...) built by hand passes stage= (a hook without a stage raises TypeError at registration).", + "analyser": "calls_have_kw", + "func": "NeighborListHook", + "kw": "stage" + }, + { + "id": "no-system-loop", + "metric": "batched", + "kind": "static", + "description": "No Python for/while loop whose body runs an engine or model (.run(, .step(, model(, .sample( ) once per system.", + "analyser": "no_system_loop", + "calls": [ + "\\.run\\(", + "\\.step\\(", + "\\bmodel\\(", + "\\.sample\\(" + ] + }, + { + "id": "no-loop-in-step-methods", + "metric": "batched", + "kind": "static", + "description": "No Python loop over atoms or systems inside __call__, pre_update, post_update, forward, adapt_input, or adapt_output (frequency-gated hooks and fixed-length loops do not count).", + "analyser": "no_loop_in_methods", + "methods": [ + "__call__", + "pre_update", + "post_update", + "forward", + "adapt_input", + "adapt_output" + ] + }, + { + "id": "device-aware", + "metric": "device_aware", + "kind": "static", + "description": "Code picks cuda when available (cuda.is_available or resolve_device) and pins cpu nowhere (no device='cpu', torch.device('cpu') or DEVICE='cpu' outside a cuda conditional).", + "analyser": "device_aware" + }, + { + "id": "no-loop-syncs", + "metric": "loop_syncs", + "kind": "static", + "description": "No .item()/.cpu()/.tolist()/.numpy()/float(t)/int(t)/bool(t)/torch.equal or branch on .any()/.all() inside a hook method (__call__, pre_update, post_update) of a class without frequency > 1, or inside a loop that calls .step()/.run()/.backward(). Frequency-gated code does not count.", + "analyser": "no_loop_syncs", + "max": 0 + }, + { + "id": "rg-step50", + "metric": "outcome", + "kind": "run", + "description": "Run output shows cluster 3 near 3.70 A at step 50.", + "scope": "output", + "pattern": "\\b(3\\.[5-9]\\d*)\\b", + "expect": 3.7, + "tol": 0.06 + } + ] + }, + { + "id": "neg-02", + "name": "Optimize a Warp neighbor-list kernel in nvalchemi-toolkit-ops", + "track": "developer", + "area": "Negative", + "prompt": "I work on ALCHEMI Toolkit-Ops, the Warp-based neighbor-list package (import name nvalchemiops); version 0.5.0 is installed in this environment. Building neighbor lists with the cell-list method feels slow for a water box of about 4000 atoms (random positions at liquid-water density are fine). Copy the package's neighbors/cell_list/ module into a scratch folder, profile the build_cell_list + query_cell_list path on Warp's CPU device, and try one focused optimization of those Warp kernels in your copy. The neighbor lists must stay identical. Show me a small before/after timing on CPU. Do not edit the installed package and do not commit anything.", + "expected_output": "The agent copies nvalchemiops/neighbors/cell_list/ (kernels.py and launchers.py in nvalchemi-toolkit-ops v0.5.0) out of site-packages, builds a small water-like box of about 4000 atoms, and times build_cell_list + query_cell_list on the Warp CPU device with preallocated wp.array outputs and no wp.from_torch conversions or allocations inside the timed region (the pattern of benchmarks/neighborlist/_bench_ctx.py in the Toolkit-Ops repository). It makes one focused edit to the copied Warp kernels or launchers using Warp APIs (wp.kernel, wp.launch, wp.array), checks that neighbor indices, offsets, and counts match the installed implementation, and reports a before/after CPU timing. It stops there: no edits to site-packages, no commits, no large sweeps, no PyTorch rewrite of the kernel, and no use of the ALCHEMI Toolkit (nvalchemi) or its skill.", + "assertions": [ + "The agent works on the nvalchemiops (Toolkit-Ops) cell-list code, and its code never imports nvalchemi or any nvalchemi.* submodule of the ALCHEMI Toolkit.", + "The agent does not open or follow any nvalchemi toolkit skill file (.claude/skills/* or skills/nvalchemi-toolkit/*) and does not base the kernel work on the toolkit's docs/userguide pages.", + "The optimization targets the Warp code in a scratch copy of nvalchemiops/neighbors/cell_list/ (kernels.py or launchers.py) using Warp APIs such as wp.kernel, wp.launch, and wp.array, not a PyTorch reimplementation; the installed package is left unmodified.", + "The agent checks numerical correctness: neighbor indices, offsets, and counts from the modified kernels match the unmodified installed implementation on the same input.", + "The agent's timing harness keeps allocations and wp.from_torch conversions outside the timed region (preallocated outputs), so the before/after numbers measure the kernels.", + "The agent keeps the workload small: CPU only, one system of a few thousand atoms, short timing runs; no size or batch sweeps, no GPU request, and no git commits or pull requests." + ], + "expected_skill": null, + "gpu": false, + "source": [ + "pyproject.toml", + "nvalchemi/hooks/neighbor_list.py", + "docs/userguide/agent_skills.md" + ], + "files": [], + "checks": [ + { + "id": "no-nvalchemi", + "metric": "reuse", + "kind": "static", + "description": "No nvalchemi (toolkit) import.", + "scope": "all", + "forbid": [ + "(?m)^\\s*(from|import)\\s+nvalchemi(?!ops)\\b", + "import nvalchemi(?!ops)\\b" + ] + }, + { + "id": "warp-edit", + "metric": "reuse", + "kind": "static", + "description": "Works on the Warp code: warp imported and kernels launched or edited.", + "scope": "all", + "require": [ + "import warp|wp\\.(kernel|launch|func)|@wp\\." + ], + "forbid": [ + "(?m)^\\s*(from|import)\\s+torch_cluster" + ] + }, + { + "id": "site-packages-untouched", + "metric": "outcome", + "kind": "static", + "description": "No writes into site-packages.", + "scope": "commands", + "forbid": [ + "(>|tee|sed -i|cp [^\\n]*)\\s*\\S*site-packages/nvalchemiops\\S*\\.py\\s*($|;|&)" + ] + }, + { + "id": "no-commit", + "metric": "outcome", + "kind": "static", + "description": "No git commit.", + "scope": "commands", + "forbid": [ + "git commit" + ] + } + ] + } + ] +} diff --git a/skills/nvalchemi-toolkit/evals/files/ammonia_dimer.xyz b/skills/nvalchemi-toolkit/evals/files/ammonia_dimer.xyz new file mode 100644 index 00000000..031a8c68 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/ammonia_dimer.xyz @@ -0,0 +1,10 @@ +8 +ammonia dimer (two NH3 molecules, 3.5 A apart) +N 0.0000 0.0000 0.1165 +H 0.0000 0.9372 -0.2719 +H 0.8116 -0.4686 -0.2719 +H -0.8116 -0.4686 -0.2719 +N 3.5000 0.0000 0.1165 +H 3.5000 0.9372 -0.2719 +H 4.3116 -0.4686 -0.2719 +H 2.6884 -0.4686 -0.2719 diff --git a/skills/nvalchemi-toolkit/evals/files/ar_scope.extxyz b/skills/nvalchemi-toolkit/evals/files/ar_scope.extxyz new file mode 100644 index 00000000..6f1cd29b --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/ar_scope.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="10.8 0.0 0.0 0.0 10.8 0.0 0.0 0.0 10.8" Properties=species:S:1:pos:R:3 pbc="T T T" +Ar 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 2.70000000 2.70000000 +Ar 2.70000000 0.00000000 2.70000000 +Ar 2.70000000 2.70000000 0.00000000 +Ar 0.00000000 0.00000000 5.40000000 +Ar 0.00000000 2.70000000 8.10000000 +Ar 2.70000000 0.00000000 8.10000000 +Ar 2.70000000 2.70000000 5.40000000 +Ar 0.00000000 5.40000000 0.00000000 +Ar 0.00000000 8.10000000 2.70000000 +Ar 2.70000000 5.40000000 2.70000000 +Ar 2.70000000 8.10000000 0.00000000 +Ar 0.00000000 5.40000000 5.40000000 +Ar 0.00000000 8.10000000 8.10000000 +Ar 2.70000000 5.40000000 8.10000000 +Ar 2.70000000 8.10000000 5.40000000 +Ar 5.40000000 0.00000000 0.00000000 +Ar 5.40000000 2.70000000 2.70000000 +Ar 8.10000000 0.00000000 2.70000000 +Ar 8.10000000 2.70000000 0.00000000 +Ar 5.40000000 0.00000000 5.40000000 +Ar 5.40000000 2.70000000 8.10000000 +Ar 8.10000000 0.00000000 8.10000000 +Ar 8.10000000 2.70000000 5.40000000 +Ar 5.40000000 5.40000000 0.00000000 +Ar 5.40000000 8.10000000 2.70000000 +Ar 8.10000000 5.40000000 2.70000000 +Ar 8.10000000 8.10000000 0.00000000 +Ar 5.40000000 5.40000000 5.40000000 +Ar 5.40000000 8.10000000 8.10000000 +Ar 8.10000000 5.40000000 8.10000000 +Ar 8.10000000 8.10000000 5.40000000 diff --git a/skills/nvalchemi-toolkit/evals/files/ar_slab.extxyz b/skills/nvalchemi-toolkit/evals/files/ar_slab.extxyz new file mode 100644 index 00000000..34f5bfed --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/ar_slab.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="15.6000 0.0 0.0 0.0 15.6000 0.0 0.0 0.0 18.0000" Properties=species:S:1:pos:R:3 pbc="T T F" +Ar 0.00000 0.00000 2.00000 +Ar 0.00000 3.90000 2.00000 +Ar 0.00000 7.80000 2.00000 +Ar 0.00000 11.70000 2.00000 +Ar 3.90000 0.00000 2.00000 +Ar 3.90000 3.90000 2.00000 +Ar 3.90000 7.80000 2.00000 +Ar 3.90000 11.70000 2.00000 +Ar 7.80000 0.00000 2.00000 +Ar 7.80000 3.90000 2.00000 +Ar 7.80000 7.80000 2.00000 +Ar 7.80000 11.70000 2.00000 +Ar 11.70000 0.00000 2.00000 +Ar 11.70000 3.90000 2.00000 +Ar 11.70000 7.80000 2.00000 +Ar 11.70000 11.70000 2.00000 +Ar 0.00000 0.00000 5.40000 +Ar 0.00000 3.90000 5.40000 +Ar 0.00000 7.80000 5.40000 +Ar 0.00000 11.70000 5.40000 +Ar 3.90000 0.00000 5.40000 +Ar 3.90000 3.90000 5.40000 +Ar 3.90000 7.80000 5.40000 +Ar 3.90000 11.70000 5.40000 +Ar 7.80000 0.00000 5.40000 +Ar 7.80000 3.90000 5.40000 +Ar 7.80000 7.80000 5.40000 +Ar 7.80000 11.70000 5.40000 +Ar 11.70000 0.00000 5.40000 +Ar 11.70000 3.90000 5.40000 +Ar 11.70000 7.80000 5.40000 +Ar 11.70000 11.70000 5.40000 diff --git a/skills/nvalchemi-toolkit/evals/files/argon_clusters.xyz b/skills/nvalchemi-toolkit/evals/files/argon_clusters.xyz new file mode 100644 index 00000000..e4978fc5 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/argon_clusters.xyz @@ -0,0 +1,87 @@ +27 +Lattice="20.0 0.0 0.0 0.0 20.0 0.0 0.0 0.0 20.0" Properties=species:S:1:pos:R:3:momenta:R:3 pbc="F F F" +Ar -4.00000000 -4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 -4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 0.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 0.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -4.00000000 4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 -4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 -4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 0.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 0.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 4.00000000 -4.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 4.00000000 4.00000000 4.00000000 0.00000000 0.00000000 0.00000000 +27 +Lattice="20.0 0.0 0.0 0.0 20.0 0.0 0.0 0.0 20.0" Properties=species:S:1:pos:R:3:momenta:R:3 pbc="F F F" +Ar -3.50000000 -3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 -3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 0.00000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 0.00000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar -3.50000000 3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 -3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 0.00000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 0.00000000 3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 -3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 -3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 0.00000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 0.00000000 3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 3.50000000 -3.50000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 0.00000000 +Ar 3.50000000 3.50000000 3.50000000 0.00000000 0.00000000 0.00000000 +27 +Lattice="20.0 0.0 0.0 0.0 20.0 0.0 0.0 0.0 20.0" Properties=species:S:1:pos:R:3:momenta:R:3 pbc="F F F" +Ar 0.57593910 -0.03398975 -0.49512974 -2.30076152 0.13578226 1.97794429 +Ar 0.57089088 1.71171846 -3.22026740 -2.28059488 -6.83797289 12.86432420 +Ar 0.18810204 -1.63076128 -3.27024597 -0.75143003 6.51456517 13.06397858 +Ar 0.42320093 -1.77817130 2.17769577 -1.69060306 7.10343873 -8.69945907 +Ar 1.87693941 -2.98240345 -0.58086501 -7.49799757 11.91410531 2.32043956 +Ar -1.43023551 -2.55193939 -0.52544658 5.71350483 10.19448748 2.09905401 +Ar 0.83766041 1.45570141 2.35161163 -3.34628582 -5.81523599 -9.39421812 +Ar -0.74578340 2.89473298 -0.37905006 2.97925551 -11.56387930 1.51422916 +Ar -2.05930129 0.26325403 1.27551045 8.22649679 -1.05164720 -5.09540916 +Ar -2.21393886 0.34841206 -1.94868959 8.84424294 -1.39183648 7.78462516 +Ar 3.25642813 -0.45084311 1.19264023 -13.00877907 1.80102807 -4.76435920 +Ar 3.15356363 -0.29137025 -2.34484082 -12.59785598 1.16396589 9.36717009 +Ar 2.51019901 2.50183763 -0.59876646 -10.02774301 -9.99434095 2.39195225 +Ar -3.99365714 2.44180233 -0.18401104 15.95386153 -9.75451196 0.73508729 +Ar -0.62886129 -3.48229141 4.74124963 2.51217507 13.91105773 -18.94034403 +Ar -1.34812057 -0.13562670 4.39364362 5.38547204 0.54180155 -17.55172753 +Ar -3.09647267 -2.38626508 -3.38660796 12.36978900 9.53265172 13.52882146 +Ar -1.79627098 0.34113795 -5.13364102 7.17574333 -1.36277790 20.50786914 +Ar 5.52635720 1.15781478 -0.47070566 -22.07669174 -4.62523849 1.88037496 +Ar 3.95981702 2.59338444 2.29919364 -15.81867704 -10.36005218 -9.18481874 +Ar -2.39741737 3.27941709 -3.24271053 9.57720292 -13.10061538 12.95398003 +Ar 5.19585341 -2.26251862 -0.70936385 -20.75639521 9.03830938 2.83376669 +Ar -0.35192757 -4.84413056 1.57025735 1.40588025 19.35133276 -6.27286406 +Ar -4.47066577 -1.30118579 -0.28956930 17.85941560 5.19797699 1.15677142 +Ar -2.82283235 -2.65057183 2.43940725 11.27665068 10.58850434 -9.74494408 +Ar -1.92103996 3.20129759 2.66559776 7.67417044 -12.78854363 -10.64852992 +Ar 1.20157354 4.59155778 1.67310363 -4.80004599 -18.34235504 -6.68371438 diff --git a/skills/nvalchemi-toolkit/evals/files/argon_fcc32.extxyz b/skills/nvalchemi-toolkit/evals/files/argon_fcc32.extxyz new file mode 100644 index 00000000..3f20836b --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/argon_fcc32.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="10.6200 0.0 0.0 0.0 10.6200 0.0 0.0 0.0 10.6200" Properties=species:S:1:pos:R:3 pbc="T T T" +Ar 0.00000 0.00000 0.00000 +Ar 0.00000 2.65500 2.65500 +Ar 2.65500 0.00000 2.65500 +Ar 2.65500 2.65500 0.00000 +Ar 0.00000 0.00000 5.31000 +Ar 0.00000 2.65500 7.96500 +Ar 2.65500 0.00000 7.96500 +Ar 2.65500 2.65500 5.31000 +Ar 0.00000 5.31000 0.00000 +Ar 0.00000 7.96500 2.65500 +Ar 2.65500 5.31000 2.65500 +Ar 2.65500 7.96500 0.00000 +Ar 0.00000 5.31000 5.31000 +Ar 0.00000 7.96500 7.96500 +Ar 2.65500 5.31000 7.96500 +Ar 2.65500 7.96500 5.31000 +Ar 5.31000 0.00000 0.00000 +Ar 5.31000 2.65500 2.65500 +Ar 7.96500 0.00000 2.65500 +Ar 7.96500 2.65500 0.00000 +Ar 5.31000 0.00000 5.31000 +Ar 5.31000 2.65500 7.96500 +Ar 7.96500 0.00000 7.96500 +Ar 7.96500 2.65500 5.31000 +Ar 5.31000 5.31000 0.00000 +Ar 5.31000 7.96500 2.65500 +Ar 7.96500 5.31000 2.65500 +Ar 7.96500 7.96500 0.00000 +Ar 5.31000 5.31000 5.31000 +Ar 5.31000 7.96500 7.96500 +Ar 7.96500 5.31000 7.96500 +Ar 7.96500 7.96500 5.31000 diff --git a/skills/nvalchemi-toolkit/evals/files/argon_frames.extxyz b/skills/nvalchemi-toolkit/evals/files/argon_frames.extxyz new file mode 100644 index 00000000..e47982d0 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/argon_frames.extxyz @@ -0,0 +1,400 @@ +8 +Properties=species:S:1:pos:R:3 frame=0 +Ar -0.017617 -0.034915 0.015093 +Ar 3.657244 0.003588 -0.013431 +Ar -0.044200 3.700744 -0.046250 +Ar -0.006635 -0.043014 3.659071 +Ar 3.692452 3.732685 -0.037620 +Ar 3.672324 0.012743 3.744771 +Ar 0.007710 3.689668 3.747626 +Ar 3.654658 3.735847 3.678961 +8 +Properties=species:S:1:pos:R:3 frame=1 +Ar -0.053191 -0.073136 -0.004058 +Ar 3.688856 -0.028339 -0.005271 +Ar -0.030309 3.687983 -0.041476 +Ar -0.050357 -0.087054 3.629667 +Ar 3.710492 3.725444 -0.056205 +Ar 3.680880 0.008062 3.724748 +Ar 0.037148 3.709567 3.722035 +Ar 3.662101 3.738366 3.716475 +8 +Properties=species:S:1:pos:R:3 frame=2 +Ar -0.030247 -0.094342 0.043959 +Ar 3.650663 -0.036527 0.020443 +Ar -0.065110 3.686880 -0.087555 +Ar -0.033535 -0.060597 3.636970 +Ar 3.748040 3.706819 -0.036676 +Ar 3.690317 0.016051 3.720368 +Ar 0.071145 3.754036 3.719445 +Ar 3.678516 3.694433 3.736624 +8 +Properties=species:S:1:pos:R:3 frame=3 +Ar -0.015534 -0.045032 0.076152 +Ar 3.629122 -0.047948 0.037308 +Ar -0.112854 3.683049 -0.120750 +Ar -0.071825 -0.104702 3.663793 +Ar 3.710974 3.681581 -0.047581 +Ar 3.727459 -0.025891 3.715287 +Ar 0.076089 3.792374 3.751373 +Ar 3.714914 3.672276 3.728154 +8 +Properties=species:S:1:pos:R:3 frame=4 +Ar -0.029657 -0.006613 0.121925 +Ar 3.594214 -0.080326 0.010504 +Ar -0.139520 3.681545 -0.111838 +Ar -0.095551 -0.154292 3.655688 +Ar 3.697899 3.688215 -0.002271 +Ar 3.746509 -0.024341 3.727046 +Ar 0.093709 3.747773 3.791326 +Ar 3.742911 3.709727 3.757941 +8 +Properties=species:S:1:pos:R:3 frame=5 +Ar -0.040419 -0.016715 0.082278 +Ar 3.607643 -0.124101 -0.032761 +Ar -0.168644 3.647776 -0.127833 +Ar -0.140293 -0.204269 3.620814 +Ar 3.658046 3.674576 -0.049721 +Ar 3.783942 -0.012935 3.691901 +Ar 0.068935 3.732512 3.777743 +Ar 3.705195 3.744621 3.807251 +8 +Properties=species:S:1:pos:R:3 frame=6 +Ar -0.043820 -0.018332 0.040867 +Ar 3.567862 -0.139838 -0.056286 +Ar -0.135759 3.613920 -0.175523 +Ar -0.095195 -0.201443 3.585474 +Ar 3.662363 3.627280 -0.046910 +Ar 3.831792 0.023398 3.711521 +Ar 0.045046 3.719182 3.744447 +Ar 3.732389 3.747880 3.835157 +8 +Properties=species:S:1:pos:R:3 frame=7 +Ar -0.060853 -0.046028 0.072018 +Ar 3.616355 -0.104575 -0.025678 +Ar -0.103925 3.637907 -0.202849 +Ar -0.093431 -0.215887 3.538372 +Ar 3.615156 3.605222 -0.070992 +Ar 3.851044 0.069049 3.706244 +Ar 0.088748 3.767986 3.789947 +Ar 3.718853 3.719926 3.807841 +8 +Properties=species:S:1:pos:R:3 frame=8 +Ar -0.091183 -0.075590 0.084425 +Ar 3.656386 -0.070531 -0.027730 +Ar -0.088627 3.667871 -0.244371 +Ar -0.077372 -0.174909 3.566603 +Ar 3.640171 3.603025 -0.103140 +Ar 3.879958 0.052301 3.736326 +Ar 0.135914 3.757570 3.780086 +Ar 3.763533 3.742406 3.774842 +8 +Properties=species:S:1:pos:R:3 frame=9 +Ar -0.128479 -0.110475 0.124910 +Ar 3.687036 -0.105914 0.004921 +Ar -0.040597 3.683598 -0.259331 +Ar -0.072506 -0.211811 3.518027 +Ar 3.687260 3.617993 -0.100482 +Ar 3.923320 0.045682 3.773500 +Ar 0.168530 3.728674 3.755269 +Ar 3.742829 3.716460 3.783485 +8 +Properties=species:S:1:pos:R:3 frame=10 +Ar -0.152542 -0.118574 0.088017 +Ar 3.728038 -0.120535 0.000737 +Ar -0.032262 3.724028 -0.267268 +Ar -0.030734 -0.211646 3.521210 +Ar 3.689610 3.569863 -0.106470 +Ar 3.891631 -0.003925 3.803417 +Ar 0.135764 3.726023 3.777788 +Ar 3.748477 3.699058 3.785320 +8 +Properties=species:S:1:pos:R:3 frame=11 +Ar -0.146998 -0.090147 0.048628 +Ar 3.734067 -0.145686 -0.021572 +Ar -0.005036 3.724799 -0.261095 +Ar -0.004735 -0.170397 3.515534 +Ar 3.700863 3.570418 -0.105253 +Ar 3.910904 -0.008690 3.806746 +Ar 0.133568 3.770174 3.797710 +Ar 3.786130 3.743276 3.761279 +8 +Properties=species:S:1:pos:R:3 frame=12 +Ar -0.141047 -0.045820 0.082628 +Ar 3.697781 -0.183524 -0.027360 +Ar -0.047781 3.698863 -0.303783 +Ar 0.012212 -0.142004 3.555237 +Ar 3.666308 3.592030 -0.089228 +Ar 3.875202 0.029593 3.853500 +Ar 0.105527 3.815424 3.787536 +Ar 3.784856 3.792263 3.794524 +8 +Properties=species:S:1:pos:R:3 frame=13 +Ar -0.174900 -0.052668 0.084189 +Ar 3.681692 -0.213949 -0.045507 +Ar -0.025566 3.650811 -0.298378 +Ar 0.006258 -0.190196 3.538387 +Ar 3.678700 3.593257 -0.132799 +Ar 3.923710 0.058430 3.900670 +Ar 0.066005 3.791980 3.741495 +Ar 3.812756 3.769308 3.757479 +8 +Properties=species:S:1:pos:R:3 frame=14 +Ar -0.182675 -0.011527 0.116087 +Ar 3.657553 -0.249012 -0.003590 +Ar -0.018507 3.670853 -0.339431 +Ar -0.037989 -0.171375 3.530919 +Ar 3.635942 3.637092 -0.119355 +Ar 3.953873 0.016804 3.936293 +Ar 0.022667 3.828258 3.736872 +Ar 3.796671 3.774614 3.800146 +8 +Properties=species:S:1:pos:R:3 frame=15 +Ar -0.205889 -0.048604 0.118778 +Ar 3.631397 -0.288067 -0.037445 +Ar -0.063469 3.641030 -0.358232 +Ar -0.057489 -0.145425 3.509915 +Ar 3.635951 3.604882 -0.134655 +Ar 3.905689 -0.008151 3.887827 +Ar 0.045975 3.833363 3.705818 +Ar 3.794147 3.818079 3.760774 +8 +Properties=species:S:1:pos:R:3 frame=16 +Ar -0.173997 -0.055386 0.118278 +Ar 3.664858 -0.298759 -0.036777 +Ar -0.044695 3.689274 -0.373962 +Ar -0.024260 -0.124753 3.523512 +Ar 3.626420 3.589637 -0.179216 +Ar 3.868671 -0.051079 3.911916 +Ar 0.021534 3.799687 3.664266 +Ar 3.828274 3.855132 3.777829 +8 +Properties=species:S:1:pos:R:3 frame=17 +Ar -0.195804 -0.081165 0.097584 +Ar 3.660803 -0.333005 -0.042194 +Ar -0.068370 3.735453 -0.326699 +Ar -0.019553 -0.150308 3.570079 +Ar 3.607375 3.575295 -0.229109 +Ar 3.856834 -0.053615 3.912193 +Ar -0.008368 3.800161 3.614761 +Ar 3.804691 3.814108 3.767780 +8 +Properties=species:S:1:pos:R:3 frame=18 +Ar -0.241637 -0.128916 0.078009 +Ar 3.634084 -0.324447 -0.039275 +Ar -0.043316 3.751207 -0.305100 +Ar 0.018357 -0.161356 3.552692 +Ar 3.655848 3.540242 -0.206693 +Ar 3.871156 -0.099236 3.945722 +Ar 0.030827 3.812894 3.638146 +Ar 3.835913 3.778038 3.770156 +8 +Properties=species:S:1:pos:R:3 frame=19 +Ar -0.241200 -0.095422 0.108476 +Ar 3.666725 -0.316041 0.000008 +Ar -0.025027 3.770540 -0.332106 +Ar -0.028527 -0.198047 3.538763 +Ar 3.616340 3.573824 -0.200841 +Ar 3.883933 -0.086613 3.963788 +Ar 0.029756 3.763226 3.667916 +Ar 3.860740 3.778336 3.773676 +8 +Properties=species:S:1:pos:R:3 frame=20 +Ar -0.225270 -0.138817 0.132155 +Ar 3.641945 -0.358596 -0.023436 +Ar -0.002093 3.741061 -0.308123 +Ar 0.019046 -0.198652 3.527019 +Ar 3.614241 3.592193 -0.174144 +Ar 3.895630 -0.072337 3.921535 +Ar -0.005501 3.738620 3.692238 +Ar 3.841181 3.785112 3.724923 +8 +Properties=species:S:1:pos:R:3 frame=21 +Ar -0.269204 -0.161939 0.149355 +Ar 3.661163 -0.341025 -0.044351 +Ar -0.000440 3.737528 -0.311489 +Ar -0.019104 -0.159286 3.496944 +Ar 3.662053 3.635819 -0.222393 +Ar 3.891527 -0.040347 3.968346 +Ar -0.010556 3.715485 3.663222 +Ar 3.885740 3.756183 3.733070 +8 +Properties=species:S:1:pos:R:3 frame=22 +Ar -0.305030 -0.159533 0.194629 +Ar 3.624424 -0.309003 -0.043476 +Ar 0.038247 3.757861 -0.338351 +Ar 0.020667 -0.160672 3.449428 +Ar 3.612412 3.634988 -0.227317 +Ar 3.871722 -0.076276 3.952742 +Ar -0.028949 3.749508 3.613396 +Ar 3.910813 3.790094 3.695074 +8 +Properties=species:S:1:pos:R:3 frame=23 +Ar -0.262390 -0.138231 0.234786 +Ar 3.603407 -0.321781 -0.054186 +Ar 0.088126 3.766779 -0.352280 +Ar 0.013472 -0.183156 3.404255 +Ar 3.572583 3.668456 -0.248755 +Ar 3.915281 -0.101344 3.929315 +Ar -0.027852 3.718493 3.600731 +Ar 3.956430 3.828520 3.726270 +8 +Properties=species:S:1:pos:R:3 frame=24 +Ar -0.249300 -0.096888 0.278856 +Ar 3.608330 -0.299824 -0.099239 +Ar 0.111361 3.761865 -0.327013 +Ar 0.027921 -0.204535 3.359152 +Ar 3.615261 3.631187 -0.251536 +Ar 3.899648 -0.121567 3.953218 +Ar 0.019777 3.694510 3.616330 +Ar 3.936514 3.834253 3.715707 +8 +Properties=species:S:1:pos:R:3 frame=25 +Ar -0.282567 -0.130722 0.249643 +Ar 3.648926 -0.300116 -0.127236 +Ar 0.151987 3.811513 -0.332017 +Ar -0.008119 -0.235295 3.318224 +Ar 3.599457 3.590297 -0.277624 +Ar 3.875483 -0.114605 3.991943 +Ar 0.044743 3.685788 3.607719 +Ar 3.938930 3.821939 3.699527 +8 +Properties=species:S:1:pos:R:3 frame=26 +Ar -0.326361 -0.152971 0.296412 +Ar 3.611513 -0.299777 -0.114273 +Ar 0.188273 3.783109 -0.354915 +Ar -0.033274 -0.245319 3.312809 +Ar 3.644851 3.625165 -0.240335 +Ar 3.827664 -0.161381 4.012895 +Ar 0.084313 3.683115 3.616436 +Ar 3.888948 3.811091 3.742210 +8 +Properties=species:S:1:pos:R:3 frame=27 +Ar -0.293802 -0.117425 0.343636 +Ar 3.586360 -0.338872 -0.148836 +Ar 0.190510 3.801316 -0.310766 +Ar -0.011100 -0.230584 3.339290 +Ar 3.640583 3.630315 -0.286380 +Ar 3.855894 -0.188123 4.054887 +Ar 0.098863 3.663493 3.579233 +Ar 3.864128 3.824720 3.762068 +8 +Properties=species:S:1:pos:R:3 frame=28 +Ar -0.332589 -0.160389 0.346079 +Ar 3.594649 -0.350064 -0.176477 +Ar 0.200616 3.752363 -0.330614 +Ar -0.015031 -0.184690 3.353747 +Ar 3.678961 3.627845 -0.312903 +Ar 3.830600 -0.142062 4.075352 +Ar 0.079603 3.615672 3.579064 +Ar 3.881574 3.816722 3.737794 +8 +Properties=species:S:1:pos:R:3 frame=29 +Ar -0.315853 -0.117873 0.318758 +Ar 3.548059 -0.366259 -0.184422 +Ar 0.218873 3.722171 -0.300907 +Ar 0.008882 -0.184202 3.324269 +Ar 3.725947 3.609017 -0.280903 +Ar 3.803681 -0.169917 4.101399 +Ar 0.059096 3.660865 3.578640 +Ar 3.850305 3.789054 3.729497 +8 +Properties=species:S:1:pos:R:3 frame=30 +Ar -0.299324 -0.072997 0.283396 +Ar 3.537405 -0.394964 -0.137010 +Ar 0.183064 3.677355 -0.344894 +Ar -0.001786 -0.144386 3.362627 +Ar 3.749219 3.658770 -0.237743 +Ar 3.786605 -0.201366 4.144987 +Ar 0.083727 3.614054 3.595083 +Ar 3.838167 3.776443 3.712666 +8 +Properties=species:S:1:pos:R:3 frame=31 +Ar -0.332398 -0.122710 0.261377 +Ar 3.522551 -0.349412 -0.174639 +Ar 0.229491 3.648095 -0.359231 +Ar 0.030371 -0.112185 3.355872 +Ar 3.704145 3.656116 -0.250472 +Ar 3.828556 -0.232063 4.131412 +Ar 0.123427 3.567082 3.586164 +Ar 3.869350 3.803109 3.666731 +8 +Properties=species:S:1:pos:R:3 frame=32 +Ar -0.378912 -0.166452 0.303385 +Ar 3.498253 -0.324684 -0.134784 +Ar 0.213398 3.625326 -0.313462 +Ar 0.042069 -0.135968 3.377536 +Ar 3.685793 3.633679 -0.300095 +Ar 3.854121 -0.190417 4.144810 +Ar 0.167752 3.519508 3.559550 +Ar 3.866869 3.848787 3.712122 +8 +Properties=species:S:1:pos:R:3 frame=33 +Ar -0.390261 -0.191347 0.296378 +Ar 3.497600 -0.281874 -0.166490 +Ar 0.243655 3.649175 -0.281187 +Ar 0.069350 -0.125242 3.360316 +Ar 3.667748 3.619865 -0.271870 +Ar 3.812023 -0.220686 4.170099 +Ar 0.142482 3.475981 3.512937 +Ar 3.872128 3.831363 3.760148 +8 +Properties=species:S:1:pos:R:3 frame=34 +Ar -0.351913 -0.142565 0.272868 +Ar 3.456008 -0.322232 -0.166642 +Ar 0.264632 3.643871 -0.307767 +Ar 0.061034 -0.113211 3.377727 +Ar 3.692546 3.654564 -0.255427 +Ar 3.774139 -0.186599 4.149477 +Ar 0.149171 3.463279 3.536743 +Ar 3.842047 3.806106 3.734682 +8 +Properties=species:S:1:pos:R:3 frame=35 +Ar -0.386581 -0.104148 0.280696 +Ar 3.438642 -0.332625 -0.117397 +Ar 0.265364 3.617010 -0.276923 +Ar 0.076367 -0.064116 3.337960 +Ar 3.690022 3.686474 -0.221372 +Ar 3.815577 -0.232563 4.128845 +Ar 0.111093 3.432236 3.584040 +Ar 3.850366 3.849123 3.721906 +8 +Properties=species:S:1:pos:R:3 frame=36 +Ar -0.349968 -0.109237 0.256691 +Ar 3.466420 -0.288054 -0.156819 +Ar 0.274979 3.629004 -0.305158 +Ar 0.063238 -0.099979 3.308358 +Ar 3.665513 3.696417 -0.206207 +Ar 3.785921 -0.281425 4.111569 +Ar 0.128924 3.400750 3.565259 +Ar 3.820707 3.878651 3.726710 +8 +Properties=species:S:1:pos:R:3 frame=37 +Ar -0.393641 -0.149098 0.246220 +Ar 3.471434 -0.274136 -0.197704 +Ar 0.241348 3.648545 -0.314179 +Ar 0.041568 -0.119219 3.353676 +Ar 3.646750 3.703069 -0.220489 +Ar 3.777565 -0.245000 4.161231 +Ar 0.115303 3.370471 3.588063 +Ar 3.791074 3.829239 3.766873 +8 +Properties=species:S:1:pos:R:3 frame=38 +Ar -0.401266 -0.117061 0.236842 +Ar 3.509717 -0.278046 -0.231450 +Ar 0.192831 3.653700 -0.300113 +Ar 0.082547 -0.160316 3.365896 +Ar 3.633834 3.703515 -0.255900 +Ar 3.755895 -0.242884 4.203781 +Ar 0.076182 3.369522 3.618544 +Ar 3.837762 3.798973 3.729538 +8 +Properties=species:S:1:pos:R:3 frame=39 +Ar -0.356958 -0.069507 0.235116 +Ar 3.465055 -0.235429 -0.242660 +Ar 0.233253 3.665734 -0.267657 +Ar 0.048575 -0.131734 3.338103 +Ar 3.624282 3.738150 -0.222982 +Ar 3.724191 -0.271071 4.193756 +Ar 0.077971 3.357879 3.580850 +Ar 3.812467 3.821462 3.769268 diff --git a/skills/nvalchemi-toolkit/evals/files/au_fcc.extxyz b/skills/nvalchemi-toolkit/evals/files/au_fcc.extxyz new file mode 100644 index 00000000..0c85f7a7 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/au_fcc.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="8.156 0.0 0.0 0.0 8.156 0.0 0.0 0.0 8.156" Properties=species:S:1:pos:R:3 pbc="T T T" +Au 0.0000 0.0000 0.0000 +Au 2.0390 2.0390 0.0000 +Au 2.0390 0.0000 2.0390 +Au 0.0000 2.0390 2.0390 +Au 0.0000 0.0000 4.0780 +Au 2.0390 2.0390 4.0780 +Au 2.0390 0.0000 6.1170 +Au 0.0000 2.0390 6.1170 +Au 0.0000 4.0780 0.0000 +Au 2.0390 6.1170 0.0000 +Au 2.0390 4.0780 2.0390 +Au 0.0000 6.1170 2.0390 +Au 0.0000 4.0780 4.0780 +Au 2.0390 6.1170 4.0780 +Au 2.0390 4.0780 6.1170 +Au 0.0000 6.1170 6.1170 +Au 4.0780 0.0000 0.0000 +Au 6.1170 2.0390 0.0000 +Au 6.1170 0.0000 2.0390 +Au 4.0780 2.0390 2.0390 +Au 4.0780 0.0000 4.0780 +Au 6.1170 2.0390 4.0780 +Au 6.1170 0.0000 6.1170 +Au 4.0780 2.0390 6.1170 +Au 4.0780 4.0780 0.0000 +Au 6.1170 6.1170 0.0000 +Au 6.1170 4.0780 2.0390 +Au 4.0780 6.1170 2.0390 +Au 4.0780 4.0780 4.0780 +Au 6.1170 6.1170 4.0780 +Au 6.1170 4.0780 6.1170 +Au 4.0780 6.1170 6.1170 diff --git a/skills/nvalchemi-toolkit/evals/files/co_frames.extxyz b/skills/nvalchemi-toolkit/evals/files/co_frames.extxyz new file mode 100644 index 00000000..77c90c9c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/co_frames.extxyz @@ -0,0 +1,800 @@ +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.080060 frame=0 +C 0.000000 0.000000 0.000000 -0.894762 0.000000 0.000000 +O 0.949048 0.000000 0.000000 0.894762 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.075289 frame=1 +C 0.000000 0.000000 0.000000 -0.867691 0.000000 0.000000 +O 0.954462 0.000000 0.000000 0.867691 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.066409 frame=2 +C 0.000000 0.000000 0.000000 -0.814916 0.000000 0.000000 +O 0.965017 0.000000 0.000000 0.814916 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.071308 frame=3 +C 0.000000 0.000000 0.000000 -0.844440 0.000000 0.000000 +O 0.959112 0.000000 0.000000 0.844440 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.067879 frame=4 +C 0.000000 0.000000 0.000000 -0.823889 0.000000 0.000000 +O 0.963222 0.000000 0.000000 0.823889 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.063937 frame=5 +C 0.000000 0.000000 0.000000 -0.799603 0.000000 0.000000 +O 0.968079 0.000000 0.000000 0.799603 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.067822 frame=6 +C 0.000000 0.000000 0.000000 -0.823544 0.000000 0.000000 +O 0.963291 0.000000 0.000000 0.823544 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.059983 frame=7 +C 0.000000 0.000000 0.000000 -0.774488 0.000000 0.000000 +O 0.973102 0.000000 0.000000 0.774488 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.055705 frame=8 +C 0.000000 0.000000 0.000000 -0.746358 0.000000 0.000000 +O 0.978728 0.000000 0.000000 0.746358 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.050939 frame=9 +C 0.000000 0.000000 0.000000 -0.713717 0.000000 0.000000 +O 0.985257 0.000000 0.000000 0.713717 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.058870 frame=10 +C 0.000000 0.000000 0.000000 -0.767271 0.000000 0.000000 +O 0.974546 0.000000 0.000000 0.767271 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.053292 frame=11 +C 0.000000 0.000000 0.000000 -0.730012 0.000000 0.000000 +O 0.981998 0.000000 0.000000 0.730012 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.054016 frame=12 +C 0.000000 0.000000 0.000000 -0.734953 0.000000 0.000000 +O 0.981009 0.000000 0.000000 0.734953 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.041825 frame=13 +C 0.000000 0.000000 0.000000 -0.646724 0.000000 0.000000 +O 0.998655 0.000000 0.000000 0.646724 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.041218 frame=14 +C 0.000000 0.000000 0.000000 -0.642013 0.000000 0.000000 +O 0.999597 0.000000 0.000000 0.642013 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.047726 frame=15 +C 0.000000 0.000000 0.000000 -0.690837 0.000000 0.000000 +O 0.989833 0.000000 0.000000 0.690837 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.033695 frame=16 +C 0.000000 0.000000 0.000000 -0.580474 0.000000 0.000000 +O 1.011905 0.000000 0.000000 0.580474 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.032023 frame=17 +C 0.000000 0.000000 0.000000 -0.565886 0.000000 0.000000 +O 1.014823 0.000000 0.000000 0.565886 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.033714 frame=18 +C 0.000000 0.000000 0.000000 -0.580638 0.000000 0.000000 +O 1.011872 0.000000 0.000000 0.580638 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.032279 frame=19 +C 0.000000 0.000000 0.000000 -0.568142 0.000000 0.000000 +O 1.014372 0.000000 0.000000 0.568142 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.035715 frame=20 +C 0.000000 0.000000 0.000000 -0.597617 0.000000 0.000000 +O 1.008477 0.000000 0.000000 0.597617 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.035466 frame=21 +C 0.000000 0.000000 0.000000 -0.595535 0.000000 0.000000 +O 1.008893 0.000000 0.000000 0.595535 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.027864 frame=22 +C 0.000000 0.000000 0.000000 -0.527865 0.000000 0.000000 +O 1.022427 0.000000 0.000000 0.527865 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.031183 frame=23 +C 0.000000 0.000000 0.000000 -0.558417 0.000000 0.000000 +O 1.016317 0.000000 0.000000 0.558417 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.027986 frame=24 +C 0.000000 0.000000 0.000000 -0.529019 0.000000 0.000000 +O 1.022196 0.000000 0.000000 0.529019 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.025757 frame=25 +C 0.000000 0.000000 0.000000 -0.507514 0.000000 0.000000 +O 1.026497 0.000000 0.000000 0.507514 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.026252 frame=26 +C 0.000000 0.000000 0.000000 -0.512369 0.000000 0.000000 +O 1.025526 0.000000 0.000000 0.512369 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.020489 frame=27 +C 0.000000 0.000000 0.000000 -0.452652 0.000000 0.000000 +O 1.037470 0.000000 0.000000 0.452652 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.019242 frame=28 +C 0.000000 0.000000 0.000000 -0.438660 0.000000 0.000000 +O 1.040268 0.000000 0.000000 0.438660 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.014603 frame=29 +C 0.000000 0.000000 0.000000 -0.382139 0.000000 0.000000 +O 1.051572 0.000000 0.000000 0.382139 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.015851 frame=30 +C 0.000000 0.000000 0.000000 -0.398138 0.000000 0.000000 +O 1.048372 0.000000 0.000000 0.398138 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.013667 frame=31 +C 0.000000 0.000000 0.000000 -0.369689 0.000000 0.000000 +O 1.054062 0.000000 0.000000 0.369689 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.013499 frame=32 +C 0.000000 0.000000 0.000000 -0.367410 0.000000 0.000000 +O 1.054518 0.000000 0.000000 0.367410 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.011210 frame=33 +C 0.000000 0.000000 0.000000 -0.334810 0.000000 0.000000 +O 1.061038 0.000000 0.000000 0.334810 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.011491 frame=34 +C 0.000000 0.000000 0.000000 -0.338991 0.000000 0.000000 +O 1.060202 0.000000 0.000000 0.338991 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.011599 frame=35 +C 0.000000 0.000000 0.000000 -0.340576 0.000000 0.000000 +O 1.059885 0.000000 0.000000 0.340576 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006365 frame=36 +C 0.000000 0.000000 0.000000 -0.252295 0.000000 0.000000 +O 1.077541 0.000000 0.000000 0.252295 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.005577 frame=37 +C 0.000000 0.000000 0.000000 -0.236159 0.000000 0.000000 +O 1.080768 0.000000 0.000000 0.236159 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.005540 frame=38 +C 0.000000 0.000000 0.000000 -0.235375 0.000000 0.000000 +O 1.080925 0.000000 0.000000 0.235375 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.005396 frame=39 +C 0.000000 0.000000 0.000000 -0.232284 0.000000 0.000000 +O 1.081543 0.000000 0.000000 0.232284 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006513 frame=40 +C 0.000000 0.000000 0.000000 -0.255206 0.000000 0.000000 +O 1.076959 0.000000 0.000000 0.255206 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006122 frame=41 +C 0.000000 0.000000 0.000000 -0.247435 0.000000 0.000000 +O 1.078513 0.000000 0.000000 0.247435 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.005070 frame=42 +C 0.000000 0.000000 0.000000 -0.225166 0.000000 0.000000 +O 1.082967 0.000000 0.000000 0.225166 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.005323 frame=43 +C 0.000000 0.000000 0.000000 -0.230716 0.000000 0.000000 +O 1.081857 0.000000 0.000000 0.230716 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002096 frame=44 +C 0.000000 0.000000 0.000000 -0.144778 0.000000 0.000000 +O 1.099044 0.000000 0.000000 0.144778 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002724 frame=45 +C 0.000000 0.000000 0.000000 -0.165035 0.000000 0.000000 +O 1.094993 0.000000 0.000000 0.165035 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.001083 frame=46 +C 0.000000 0.000000 0.000000 -0.104085 0.000000 0.000000 +O 1.107183 0.000000 0.000000 0.104085 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.001789 frame=47 +C 0.000000 0.000000 0.000000 -0.133761 0.000000 0.000000 +O 1.101248 0.000000 0.000000 0.133761 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000363 frame=48 +C 0.000000 0.000000 0.000000 -0.060276 0.000000 0.000000 +O 1.115945 0.000000 0.000000 0.060276 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000303 frame=49 +C 0.000000 0.000000 0.000000 -0.055018 0.000000 0.000000 +O 1.116996 0.000000 0.000000 0.055018 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.001522 frame=50 +C 0.000000 0.000000 0.000000 -0.123363 0.000000 0.000000 +O 1.103327 0.000000 0.000000 0.123363 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000742 frame=51 +C 0.000000 0.000000 0.000000 -0.086114 0.000000 0.000000 +O 1.110777 0.000000 0.000000 0.086114 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000000 frame=52 +C 0.000000 0.000000 0.000000 0.000273 0.000000 0.000000 +O 1.128055 0.000000 0.000000 -0.000273 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000075 frame=53 +C 0.000000 0.000000 0.000000 -0.027423 0.000000 0.000000 +O 1.122515 0.000000 0.000000 0.027423 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000160 frame=54 +C 0.000000 0.000000 0.000000 0.039945 0.000000 0.000000 +O 1.135989 0.000000 0.000000 -0.039945 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000000 frame=55 +C 0.000000 0.000000 0.000000 -0.002016 0.000000 0.000000 +O 1.127597 0.000000 0.000000 0.002016 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000033 frame=56 +C 0.000000 0.000000 0.000000 -0.018123 0.000000 0.000000 +O 1.124375 0.000000 0.000000 0.018123 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000290 frame=57 +C 0.000000 0.000000 0.000000 0.053850 0.000000 0.000000 +O 1.138770 0.000000 0.000000 -0.053850 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000724 frame=58 +C 0.000000 0.000000 0.000000 0.085087 0.000000 0.000000 +O 1.145017 0.000000 0.000000 -0.085087 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000255 frame=59 +C 0.000000 0.000000 0.000000 0.050545 0.000000 0.000000 +O 1.138109 0.000000 0.000000 -0.050545 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000236 frame=60 +C 0.000000 0.000000 0.000000 0.048614 0.000000 0.000000 +O 1.137723 0.000000 0.000000 -0.048614 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.000801 frame=61 +C 0.000000 0.000000 0.000000 0.089490 0.000000 0.000000 +O 1.145898 0.000000 0.000000 -0.089490 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002855 frame=62 +C 0.000000 0.000000 0.000000 0.168970 0.000000 0.000000 +O 1.161794 0.000000 0.000000 -0.168970 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002713 frame=63 +C 0.000000 0.000000 0.000000 0.164699 0.000000 0.000000 +O 1.160940 0.000000 0.000000 -0.164699 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.001369 frame=64 +C 0.000000 0.000000 0.000000 0.117025 0.000000 0.000000 +O 1.151405 0.000000 0.000000 -0.117025 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002137 frame=65 +C 0.000000 0.000000 0.000000 0.146197 0.000000 0.000000 +O 1.157239 0.000000 0.000000 -0.146197 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002190 frame=66 +C 0.000000 0.000000 0.000000 0.147994 0.000000 0.000000 +O 1.157599 0.000000 0.000000 -0.147994 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.002567 frame=67 +C 0.000000 0.000000 0.000000 0.160210 0.000000 0.000000 +O 1.160042 0.000000 0.000000 -0.160210 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006263 frame=68 +C 0.000000 0.000000 0.000000 0.250255 0.000000 0.000000 +O 1.178051 0.000000 0.000000 -0.250255 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.004188 frame=69 +C 0.000000 0.000000 0.000000 0.204652 0.000000 0.000000 +O 1.168930 0.000000 0.000000 -0.204652 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006716 frame=70 +C 0.000000 0.000000 0.000000 0.259146 0.000000 0.000000 +O 1.179829 0.000000 0.000000 -0.259146 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006985 frame=71 +C 0.000000 0.000000 0.000000 0.264290 0.000000 0.000000 +O 1.180858 0.000000 0.000000 -0.264290 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.006500 frame=72 +C 0.000000 0.000000 0.000000 0.254948 0.000000 0.000000 +O 1.178990 0.000000 0.000000 -0.254948 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.010589 frame=73 +C 0.000000 0.000000 0.000000 0.325400 0.000000 0.000000 +O 1.193080 0.000000 0.000000 -0.325400 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.007932 frame=74 +C 0.000000 0.000000 0.000000 0.281639 0.000000 0.000000 +O 1.184328 0.000000 0.000000 -0.281639 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.012197 frame=75 +C 0.000000 0.000000 0.000000 0.349246 0.000000 0.000000 +O 1.197849 0.000000 0.000000 -0.349246 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.009788 frame=76 +C 0.000000 0.000000 0.000000 0.312857 0.000000 0.000000 +O 1.190571 0.000000 0.000000 -0.312857 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.012932 frame=77 +C 0.000000 0.000000 0.000000 0.359613 0.000000 0.000000 +O 1.199923 0.000000 0.000000 -0.359613 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.012614 frame=78 +C 0.000000 0.000000 0.000000 0.355156 0.000000 0.000000 +O 1.199031 0.000000 0.000000 -0.355156 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.014227 frame=79 +C 0.000000 0.000000 0.000000 0.377181 0.000000 0.000000 +O 1.203436 0.000000 0.000000 -0.377181 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.021495 frame=80 +C 0.000000 0.000000 0.000000 0.463626 0.000000 0.000000 +O 1.220725 0.000000 0.000000 -0.463626 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.021456 frame=81 +C 0.000000 0.000000 0.000000 0.463205 0.000000 0.000000 +O 1.220641 0.000000 0.000000 -0.463205 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.018457 frame=82 +C 0.000000 0.000000 0.000000 0.429610 0.000000 0.000000 +O 1.213922 0.000000 0.000000 -0.429610 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.025403 frame=83 +C 0.000000 0.000000 0.000000 0.504014 0.000000 0.000000 +O 1.228803 0.000000 0.000000 -0.504014 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.020515 frame=84 +C 0.000000 0.000000 0.000000 0.452930 0.000000 0.000000 +O 1.218586 0.000000 0.000000 -0.452930 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.023777 frame=85 +C 0.000000 0.000000 0.000000 0.487618 0.000000 0.000000 +O 1.225524 0.000000 0.000000 -0.487618 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.030246 frame=86 +C 0.000000 0.000000 0.000000 0.549960 0.000000 0.000000 +O 1.237992 0.000000 0.000000 -0.549960 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.029707 frame=87 +C 0.000000 0.000000 0.000000 0.545038 0.000000 0.000000 +O 1.237008 0.000000 0.000000 -0.545038 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.025727 frame=88 +C 0.000000 0.000000 0.000000 0.507219 0.000000 0.000000 +O 1.229444 0.000000 0.000000 -0.507219 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.037509 frame=89 +C 0.000000 0.000000 0.000000 0.612448 0.000000 0.000000 +O 1.250490 0.000000 0.000000 -0.612448 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.030379 frame=90 +C 0.000000 0.000000 0.000000 0.551174 0.000000 0.000000 +O 1.238235 0.000000 0.000000 -0.551174 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.032719 frame=91 +C 0.000000 0.000000 0.000000 0.572009 0.000000 0.000000 +O 1.242402 0.000000 0.000000 -0.572009 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.040932 frame=92 +C 0.000000 0.000000 0.000000 0.639782 0.000000 0.000000 +O 1.255956 0.000000 0.000000 -0.639782 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.037423 frame=93 +C 0.000000 0.000000 0.000000 0.611740 0.000000 0.000000 +O 1.250348 0.000000 0.000000 -0.611740 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.039039 frame=94 +C 0.000000 0.000000 0.000000 0.624808 0.000000 0.000000 +O 1.252962 0.000000 0.000000 -0.624808 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.038297 frame=95 +C 0.000000 0.000000 0.000000 0.618847 0.000000 0.000000 +O 1.251769 0.000000 0.000000 -0.618847 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.040558 frame=96 +C 0.000000 0.000000 0.000000 0.636851 0.000000 0.000000 +O 1.255370 0.000000 0.000000 -0.636851 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.049343 frame=97 +C 0.000000 0.000000 0.000000 0.702444 0.000000 0.000000 +O 1.268489 0.000000 0.000000 -0.702444 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.046896 frame=98 +C 0.000000 0.000000 0.000000 0.684804 0.000000 0.000000 +O 1.264961 0.000000 0.000000 -0.684804 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.054311 frame=99 +C 0.000000 0.000000 0.000000 0.736963 0.000000 0.000000 +O 1.275393 0.000000 0.000000 -0.736963 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.053339 frame=100 +C 0.000000 0.000000 0.000000 0.730336 0.000000 0.000000 +O 1.274067 0.000000 0.000000 -0.730336 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.056975 frame=101 +C 0.000000 0.000000 0.000000 0.754818 0.000000 0.000000 +O 1.278964 0.000000 0.000000 -0.754818 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.067526 frame=102 +C 0.000000 0.000000 0.000000 0.821743 0.000000 0.000000 +O 1.292349 0.000000 0.000000 -0.821743 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.062494 frame=103 +C 0.000000 0.000000 0.000000 0.790533 0.000000 0.000000 +O 1.286107 0.000000 0.000000 -0.790533 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.066577 frame=104 +C 0.000000 0.000000 0.000000 0.815950 0.000000 0.000000 +O 1.291190 0.000000 0.000000 -0.815950 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.074214 frame=105 +C 0.000000 0.000000 0.000000 0.861477 0.000000 0.000000 +O 1.300295 0.000000 0.000000 -0.861477 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.065519 frame=106 +C 0.000000 0.000000 0.000000 0.809439 0.000000 0.000000 +O 1.289888 0.000000 0.000000 -0.809439 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.067717 frame=107 +C 0.000000 0.000000 0.000000 0.822901 0.000000 0.000000 +O 1.292580 0.000000 0.000000 -0.822901 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.083661 frame=108 +C 0.000000 0.000000 0.000000 0.914661 0.000000 0.000000 +O 1.310932 0.000000 0.000000 -0.914661 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.084996 frame=109 +C 0.000000 0.000000 0.000000 0.921931 0.000000 0.000000 +O 1.312386 0.000000 0.000000 -0.921931 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.077692 frame=110 +C 0.000000 0.000000 0.000000 0.881432 0.000000 0.000000 +O 1.304286 0.000000 0.000000 -0.881432 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.079530 frame=111 +C 0.000000 0.000000 0.000000 0.891794 0.000000 0.000000 +O 1.306359 0.000000 0.000000 -0.891794 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.092754 frame=112 +C 0.000000 0.000000 0.000000 0.963088 0.000000 0.000000 +O 1.320618 0.000000 0.000000 -0.963088 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.099904 frame=113 +C 0.000000 0.000000 0.000000 0.999518 0.000000 0.000000 +O 1.327904 0.000000 0.000000 -0.999518 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.088636 frame=114 +C 0.000000 0.000000 0.000000 0.941468 0.000000 0.000000 +O 1.316294 0.000000 0.000000 -0.941468 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.106741 frame=115 +C 0.000000 0.000000 0.000000 1.033154 0.000000 0.000000 +O 1.334631 0.000000 0.000000 -1.033154 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.108721 frame=116 +C 0.000000 0.000000 0.000000 1.042691 0.000000 0.000000 +O 1.336538 0.000000 0.000000 -1.042691 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.106329 frame=117 +C 0.000000 0.000000 0.000000 1.031157 0.000000 0.000000 +O 1.334231 0.000000 0.000000 -1.031157 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.105942 frame=118 +C 0.000000 0.000000 0.000000 1.029281 0.000000 0.000000 +O 1.333856 0.000000 0.000000 -1.029281 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.102789 frame=119 +C 0.000000 0.000000 0.000000 1.013851 0.000000 0.000000 +O 1.330770 0.000000 0.000000 -1.013851 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.104790 frame=120 +C 0.000000 0.000000 0.000000 1.023669 0.000000 0.000000 +O 1.332734 0.000000 0.000000 -1.023669 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.128233 frame=121 +C 0.000000 0.000000 0.000000 1.132399 0.000000 0.000000 +O 1.354480 0.000000 0.000000 -1.132399 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.115843 frame=122 +C 0.000000 0.000000 0.000000 1.076303 0.000000 0.000000 +O 1.343261 0.000000 0.000000 -1.076303 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.129789 frame=123 +C 0.000000 0.000000 0.000000 1.139252 0.000000 0.000000 +O 1.355850 0.000000 0.000000 -1.139252 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.123393 frame=124 +C 0.000000 0.000000 0.000000 1.110824 0.000000 0.000000 +O 1.350165 0.000000 0.000000 -1.110824 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.140145 frame=125 +C 0.000000 0.000000 0.000000 1.183829 0.000000 0.000000 +O 1.364766 0.000000 0.000000 -1.183829 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.138635 frame=126 +C 0.000000 0.000000 0.000000 1.177436 0.000000 0.000000 +O 1.363487 0.000000 0.000000 -1.177436 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.135365 frame=127 +C 0.000000 0.000000 0.000000 1.163464 0.000000 0.000000 +O 1.360693 0.000000 0.000000 -1.163464 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.136421 frame=128 +C 0.000000 0.000000 0.000000 1.167996 0.000000 0.000000 +O 1.361599 0.000000 0.000000 -1.167996 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.153467 frame=129 +C 0.000000 0.000000 0.000000 1.238819 0.000000 0.000000 +O 1.375764 0.000000 0.000000 -1.238819 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.141608 frame=130 +C 0.000000 0.000000 0.000000 1.189993 0.000000 0.000000 +O 1.365999 0.000000 0.000000 -1.189993 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.149399 frame=131 +C 0.000000 0.000000 0.000000 1.222287 0.000000 0.000000 +O 1.372457 0.000000 0.000000 -1.222287 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.161726 frame=132 +C 0.000000 0.000000 0.000000 1.271716 0.000000 0.000000 +O 1.382343 0.000000 0.000000 -1.271716 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.173541 frame=133 +C 0.000000 0.000000 0.000000 1.317351 0.000000 0.000000 +O 1.391470 0.000000 0.000000 -1.317351 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.171577 frame=134 +C 0.000000 0.000000 0.000000 1.309873 0.000000 0.000000 +O 1.389975 0.000000 0.000000 -1.309873 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.167132 frame=135 +C 0.000000 0.000000 0.000000 1.292796 0.000000 0.000000 +O 1.386559 0.000000 0.000000 -1.292796 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.188469 frame=136 +C 0.000000 0.000000 0.000000 1.372842 0.000000 0.000000 +O 1.402568 0.000000 0.000000 -1.372842 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.173669 frame=137 +C 0.000000 0.000000 0.000000 1.317835 0.000000 0.000000 +O 1.391567 0.000000 0.000000 -1.317835 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.173035 frame=138 +C 0.000000 0.000000 0.000000 1.315426 0.000000 0.000000 +O 1.391085 0.000000 0.000000 -1.315426 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.184150 frame=139 +C 0.000000 0.000000 0.000000 1.357020 0.000000 0.000000 +O 1.399404 0.000000 0.000000 -1.357020 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.193489 frame=140 +C 0.000000 0.000000 0.000000 1.391003 0.000000 0.000000 +O 1.406201 0.000000 0.000000 -1.391003 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.187364 frame=141 +C 0.000000 0.000000 0.000000 1.368809 0.000000 0.000000 +O 1.401762 0.000000 0.000000 -1.368809 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.195083 frame=142 +C 0.000000 0.000000 0.000000 1.396721 0.000000 0.000000 +O 1.407344 0.000000 0.000000 -1.396721 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.205150 frame=143 +C 0.000000 0.000000 0.000000 1.432306 0.000000 0.000000 +O 1.414461 0.000000 0.000000 -1.432306 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.215789 frame=144 +C 0.000000 0.000000 0.000000 1.468976 0.000000 0.000000 +O 1.421795 0.000000 0.000000 -1.468976 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.207720 frame=145 +C 0.000000 0.000000 0.000000 1.441248 0.000000 0.000000 +O 1.416250 0.000000 0.000000 -1.441248 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.219228 frame=146 +C 0.000000 0.000000 0.000000 1.480637 0.000000 0.000000 +O 1.424127 0.000000 0.000000 -1.480637 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.240203 frame=147 +C 0.000000 0.000000 0.000000 1.549848 0.000000 0.000000 +O 1.437970 0.000000 0.000000 -1.549848 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.248105 frame=148 +C 0.000000 0.000000 0.000000 1.575135 0.000000 0.000000 +O 1.443027 0.000000 0.000000 -1.575135 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.243082 frame=149 +C 0.000000 0.000000 0.000000 1.559110 0.000000 0.000000 +O 1.439822 0.000000 0.000000 -1.559110 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.249283 frame=150 +C 0.000000 0.000000 0.000000 1.578871 0.000000 0.000000 +O 1.443774 0.000000 0.000000 -1.578871 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.251072 frame=151 +C 0.000000 0.000000 0.000000 1.584524 0.000000 0.000000 +O 1.444905 0.000000 0.000000 -1.584524 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.242253 frame=152 +C 0.000000 0.000000 0.000000 1.556447 0.000000 0.000000 +O 1.439289 0.000000 0.000000 -1.556447 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.244063 frame=153 +C 0.000000 0.000000 0.000000 1.562252 0.000000 0.000000 +O 1.440450 0.000000 0.000000 -1.562252 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.248650 frame=154 +C 0.000000 0.000000 0.000000 1.576865 0.000000 0.000000 +O 1.443373 0.000000 0.000000 -1.576865 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.283056 frame=155 +C 0.000000 0.000000 0.000000 1.682428 0.000000 0.000000 +O 1.464486 0.000000 0.000000 -1.682428 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.281513 frame=156 +C 0.000000 0.000000 0.000000 1.677836 0.000000 0.000000 +O 1.463567 0.000000 0.000000 -1.677836 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.295960 frame=157 +C 0.000000 0.000000 0.000000 1.720347 0.000000 0.000000 +O 1.472069 0.000000 0.000000 -1.720347 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.269790 frame=158 +C 0.000000 0.000000 0.000000 1.642528 0.000000 0.000000 +O 1.456506 0.000000 0.000000 -1.642528 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.295961 frame=159 +C 0.000000 0.000000 0.000000 1.720352 0.000000 0.000000 +O 1.472070 0.000000 0.000000 -1.720352 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.296284 frame=160 +C 0.000000 0.000000 0.000000 1.721289 0.000000 0.000000 +O 1.472258 0.000000 0.000000 -1.721289 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.310622 frame=161 +C 0.000000 0.000000 0.000000 1.762447 0.000000 0.000000 +O 1.480489 0.000000 0.000000 -1.762447 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.301932 frame=162 +C 0.000000 0.000000 0.000000 1.737619 0.000000 0.000000 +O 1.475524 0.000000 0.000000 -1.737619 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.331967 frame=163 +C 0.000000 0.000000 0.000000 1.821996 0.000000 0.000000 +O 1.492399 0.000000 0.000000 -1.821996 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.304823 frame=164 +C 0.000000 0.000000 0.000000 1.745918 0.000000 0.000000 +O 1.477184 0.000000 0.000000 -1.745918 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.327369 frame=165 +C 0.000000 0.000000 0.000000 1.809333 0.000000 0.000000 +O 1.489867 0.000000 0.000000 -1.809333 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.340312 frame=166 +C 0.000000 0.000000 0.000000 1.844756 0.000000 0.000000 +O 1.496951 0.000000 0.000000 -1.844756 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.352466 frame=167 +C 0.000000 0.000000 0.000000 1.877407 0.000000 0.000000 +O 1.503481 0.000000 0.000000 -1.877407 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.352473 frame=168 +C 0.000000 0.000000 0.000000 1.877427 0.000000 0.000000 +O 1.503485 0.000000 0.000000 -1.877427 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.357369 frame=169 +C 0.000000 0.000000 0.000000 1.890419 0.000000 0.000000 +O 1.506084 0.000000 0.000000 -1.890419 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.366994 frame=170 +C 0.000000 0.000000 0.000000 1.915709 0.000000 0.000000 +O 1.511142 0.000000 0.000000 -1.915709 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.377997 frame=171 +C 0.000000 0.000000 0.000000 1.944214 0.000000 0.000000 +O 1.516843 0.000000 0.000000 -1.944214 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.362609 frame=172 +C 0.000000 0.000000 0.000000 1.904229 0.000000 0.000000 +O 1.508846 0.000000 0.000000 -1.904229 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.381769 frame=173 +C 0.000000 0.000000 0.000000 1.953891 0.000000 0.000000 +O 1.518778 0.000000 0.000000 -1.953891 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.396724 frame=174 +C 0.000000 0.000000 0.000000 1.991792 0.000000 0.000000 +O 1.526358 0.000000 0.000000 -1.991792 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.402063 frame=175 +C 0.000000 0.000000 0.000000 2.005150 0.000000 0.000000 +O 1.529030 0.000000 0.000000 -2.005150 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.390492 frame=176 +C 0.000000 0.000000 0.000000 1.976087 0.000000 0.000000 +O 1.523217 0.000000 0.000000 -1.976087 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.411991 frame=177 +C 0.000000 0.000000 0.000000 2.029757 0.000000 0.000000 +O 1.533951 0.000000 0.000000 -2.029757 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.421638 frame=178 +C 0.000000 0.000000 0.000000 2.053382 0.000000 0.000000 +O 1.538676 0.000000 0.000000 -2.053382 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.416424 frame=179 +C 0.000000 0.000000 0.000000 2.040648 0.000000 0.000000 +O 1.536130 0.000000 0.000000 -2.040648 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.425265 frame=180 +C 0.000000 0.000000 0.000000 2.062195 0.000000 0.000000 +O 1.540439 0.000000 0.000000 -2.062195 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.422000 frame=181 +C 0.000000 0.000000 0.000000 2.054264 0.000000 0.000000 +O 1.538853 0.000000 0.000000 -2.054264 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.437073 frame=182 +C 0.000000 0.000000 0.000000 2.090630 0.000000 0.000000 +O 1.546126 0.000000 0.000000 -2.090630 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.445033 frame=183 +C 0.000000 0.000000 0.000000 2.109580 0.000000 0.000000 +O 1.549916 0.000000 0.000000 -2.109580 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.429752 frame=184 +C 0.000000 0.000000 0.000000 2.073045 0.000000 0.000000 +O 1.542609 0.000000 0.000000 -2.073045 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.460230 frame=185 +C 0.000000 0.000000 0.000000 2.145297 0.000000 0.000000 +O 1.557059 0.000000 0.000000 -2.145297 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.482690 frame=186 +C 0.000000 0.000000 0.000000 2.197021 0.000000 0.000000 +O 1.567404 0.000000 0.000000 -2.197021 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.484880 frame=187 +C 0.000000 0.000000 0.000000 2.201999 0.000000 0.000000 +O 1.568400 0.000000 0.000000 -2.201999 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.485397 frame=188 +C 0.000000 0.000000 0.000000 2.203172 0.000000 0.000000 +O 1.568634 0.000000 0.000000 -2.203172 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.477653 frame=189 +C 0.000000 0.000000 0.000000 2.185527 0.000000 0.000000 +O 1.565105 0.000000 0.000000 -2.185527 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.500202 frame=190 +C 0.000000 0.000000 0.000000 2.236519 0.000000 0.000000 +O 1.575304 0.000000 0.000000 -2.236519 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.500615 frame=191 +C 0.000000 0.000000 0.000000 2.237442 0.000000 0.000000 +O 1.575488 0.000000 0.000000 -2.237442 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.501639 frame=192 +C 0.000000 0.000000 0.000000 2.239731 0.000000 0.000000 +O 1.575946 0.000000 0.000000 -2.239731 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.527091 frame=193 +C 0.000000 0.000000 0.000000 2.295847 0.000000 0.000000 +O 1.587169 0.000000 0.000000 -2.295847 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.500292 frame=194 +C 0.000000 0.000000 0.000000 2.236720 0.000000 0.000000 +O 1.575344 0.000000 0.000000 -2.236720 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.538098 frame=195 +C 0.000000 0.000000 0.000000 2.319694 0.000000 0.000000 +O 1.591939 0.000000 0.000000 -2.319694 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.512562 frame=196 +C 0.000000 0.000000 0.000000 2.263984 0.000000 0.000000 +O 1.580797 0.000000 0.000000 -2.263984 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.546374 frame=197 +C 0.000000 0.000000 0.000000 2.337465 0.000000 0.000000 +O 1.595493 0.000000 0.000000 -2.337465 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.548386 frame=198 +C 0.000000 0.000000 0.000000 2.341764 0.000000 0.000000 +O 1.596353 0.000000 0.000000 -2.341764 0.000000 0.000000 +2 +Properties=species:S:1:pos:R:3:REF_forces:R:3 REF_energy=0.544299 frame=199 +C 0.000000 0.000000 0.000000 2.333022 0.000000 0.000000 +O 1.594604 0.000000 0.000000 -2.333022 0.000000 0.000000 diff --git a/skills/nvalchemi-toolkit/evals/files/cu_fcc.extxyz b/skills/nvalchemi-toolkit/evals/files/cu_fcc.extxyz new file mode 100644 index 00000000..7a6cccdc --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/cu_fcc.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="7.23 0.0 0.0 0.0 7.23 0.0 0.0 0.0 7.23" Properties=species:S:1:pos:R:3 pbc="T T T" +Cu 0.0000 0.0000 0.0000 +Cu 1.8075 1.8075 0.0000 +Cu 1.8075 0.0000 1.8075 +Cu 0.0000 1.8075 1.8075 +Cu 0.0000 0.0000 3.6150 +Cu 1.8075 1.8075 3.6150 +Cu 1.8075 0.0000 5.4225 +Cu 0.0000 1.8075 5.4225 +Cu 0.0000 3.6150 0.0000 +Cu 1.8075 5.4225 0.0000 +Cu 1.8075 3.6150 1.8075 +Cu 0.0000 5.4225 1.8075 +Cu 0.0000 3.6150 3.6150 +Cu 1.8075 5.4225 3.6150 +Cu 1.8075 3.6150 5.4225 +Cu 0.0000 5.4225 5.4225 +Cu 3.6150 0.0000 0.0000 +Cu 5.4225 1.8075 0.0000 +Cu 5.4225 0.0000 1.8075 +Cu 3.6150 1.8075 1.8075 +Cu 3.6150 0.0000 3.6150 +Cu 5.4225 1.8075 3.6150 +Cu 5.4225 0.0000 5.4225 +Cu 3.6150 1.8075 5.4225 +Cu 3.6150 3.6150 0.0000 +Cu 5.4225 5.4225 0.0000 +Cu 5.4225 3.6150 1.8075 +Cu 3.6150 5.4225 1.8075 +Cu 3.6150 3.6150 3.6150 +Cu 5.4225 5.4225 3.6150 +Cu 5.4225 3.6150 5.4225 +Cu 3.6150 5.4225 5.4225 diff --git a/skills/nvalchemi-toolkit/evals/files/cu_slab.extxyz b/skills/nvalchemi-toolkit/evals/files/cu_slab.extxyz new file mode 100644 index 00000000..3bfd2fe6 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/cu_slab.extxyz @@ -0,0 +1,34 @@ +32 +Lattice="7.230 0.000 0.000 0.000 7.230 0.000 0.000 0.000 20.845" Properties=species:S:1:pos:R:3 pbc="T T F" +Cu 0.0000 0.0000 0.0000 +Cu 1.8075 1.8075 0.0000 +Cu 3.6150 0.0000 0.0000 +Cu 5.4225 1.8075 0.0000 +Cu 0.0000 3.6150 0.0000 +Cu 1.8075 5.4225 0.0000 +Cu 3.6150 3.6150 0.0000 +Cu 5.4225 5.4225 0.0000 +Cu 1.8075 0.0000 1.8075 +Cu 0.0000 1.8075 1.8075 +Cu 5.4225 0.0000 1.8075 +Cu 3.6150 1.8075 1.8075 +Cu 1.8075 3.6150 1.8075 +Cu 0.0000 5.4225 1.8075 +Cu 5.4225 3.6150 1.8075 +Cu 3.6150 5.4225 1.8075 +Cu 0.0000 0.0000 3.6150 +Cu 1.8075 1.8075 3.6150 +Cu 3.6150 0.0000 3.6150 +Cu 5.4225 1.8075 3.6150 +Cu 0.0000 3.6150 3.6150 +Cu 1.8075 5.4225 3.6150 +Cu 3.6150 3.6150 3.6150 +Cu 5.4225 5.4225 3.6150 +Cu 1.8075 0.0000 5.4225 +Cu 0.0000 1.8075 5.4225 +Cu 5.4225 0.0000 5.4225 +Cu 3.6150 1.8075 5.4225 +Cu 1.8075 3.6150 5.4225 +Cu 0.0000 5.4225 5.4225 +Cu 5.4225 3.6150 5.4225 +Cu 3.6150 5.4225 5.4225 diff --git a/skills/nvalchemi-toolkit/evals/files/hcn_product.extxyz b/skills/nvalchemi-toolkit/evals/files/hcn_product.extxyz new file mode 100644 index 00000000..16b49cc5 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/hcn_product.extxyz @@ -0,0 +1,5 @@ +3 +Properties=species:S:1:pos:R:3 +H 0.000000 2.164000 0.000000 +C 0.000000 0.000000 0.000000 +N 0.000000 1.169000 0.000000 diff --git a/skills/nvalchemi-toolkit/evals/files/hcn_reactant.extxyz b/skills/nvalchemi-toolkit/evals/files/hcn_reactant.extxyz new file mode 100644 index 00000000..65d2646e --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/hcn_reactant.extxyz @@ -0,0 +1,5 @@ +3 +Properties=species:S:1:pos:R:3 +H -1.060000 0.000000 0.000000 +C 0.000000 0.000000 0.000000 +N 1.160000 0.000000 0.000000 diff --git a/skills/nvalchemi-toolkit/evals/files/si_diamond.extxyz b/skills/nvalchemi-toolkit/evals/files/si_diamond.extxyz new file mode 100644 index 00000000..1695c625 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/si_diamond.extxyz @@ -0,0 +1,66 @@ +64 +Lattice="10.86 0.0 0.0 0.0 10.86 0.0 0.0 0.0 10.86" Properties=species:S:1:pos:R:3 pbc="T T T" +Si 0.0000 0.0000 0.0000 +Si 0.0000 2.7150 2.7150 +Si 2.7150 0.0000 2.7150 +Si 2.7150 2.7150 0.0000 +Si 1.3575 1.3575 1.3575 +Si 1.3575 4.0725 4.0725 +Si 4.0725 1.3575 4.0725 +Si 4.0725 4.0725 1.3575 +Si 0.0000 0.0000 5.4300 +Si 0.0000 2.7150 8.1450 +Si 2.7150 0.0000 8.1450 +Si 2.7150 2.7150 5.4300 +Si 1.3575 1.3575 6.7875 +Si 1.3575 4.0725 9.5025 +Si 4.0725 1.3575 9.5025 +Si 4.0725 4.0725 6.7875 +Si 0.0000 5.4300 0.0000 +Si 0.0000 8.1450 2.7150 +Si 2.7150 5.4300 2.7150 +Si 2.7150 8.1450 0.0000 +Si 1.3575 6.7875 1.3575 +Si 1.3575 9.5025 4.0725 +Si 4.0725 6.7875 4.0725 +Si 4.0725 9.5025 1.3575 +Si 0.0000 5.4300 5.4300 +Si 0.0000 8.1450 8.1450 +Si 2.7150 5.4300 8.1450 +Si 2.7150 8.1450 5.4300 +Si 1.3575 6.7875 6.7875 +Si 1.3575 9.5025 9.5025 +Si 4.0725 6.7875 9.5025 +Si 4.0725 9.5025 6.7875 +Si 5.4300 0.0000 0.0000 +Si 5.4300 2.7150 2.7150 +Si 8.1450 0.0000 2.7150 +Si 8.1450 2.7150 0.0000 +Si 6.7875 1.3575 1.3575 +Si 6.7875 4.0725 4.0725 +Si 9.5025 1.3575 4.0725 +Si 9.5025 4.0725 1.3575 +Si 5.4300 0.0000 5.4300 +Si 5.4300 2.7150 8.1450 +Si 8.1450 0.0000 8.1450 +Si 8.1450 2.7150 5.4300 +Si 6.7875 1.3575 6.7875 +Si 6.7875 4.0725 9.5025 +Si 9.5025 1.3575 9.5025 +Si 9.5025 4.0725 6.7875 +Si 5.4300 5.4300 0.0000 +Si 5.4300 8.1450 2.7150 +Si 8.1450 5.4300 2.7150 +Si 8.1450 8.1450 0.0000 +Si 6.7875 6.7875 1.3575 +Si 6.7875 9.5025 4.0725 +Si 9.5025 6.7875 4.0725 +Si 9.5025 9.5025 1.3575 +Si 5.4300 5.4300 5.4300 +Si 5.4300 8.1450 8.1450 +Si 8.1450 5.4300 8.1450 +Si 8.1450 8.1450 5.4300 +Si 6.7875 6.7875 6.7875 +Si 6.7875 9.5025 9.5025 +Si 9.5025 6.7875 9.5025 +Si 9.5025 9.5025 6.7875 diff --git a/skills/nvalchemi-toolkit/evals/files/toy_pair_model.py b/skills/nvalchemi-toolkit/evals/files/toy_pair_model.py new file mode 100644 index 00000000..3757ff03 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/toy_pair_model.py @@ -0,0 +1,71 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Toy message-passing model used by a model-wrapping evaluation task. +# It is an ordinary PyTorch module: it knows nothing about nvalchemi yet. +"""A tiny pair-distance network that predicts one scalar energy per graph. + +forward(positions, atomic_numbers, batch_indices) -> energy tensor of +shape [num_graphs]. Pairwise distances are embedded with a fixed +exponential radial basis and summed with learnable coefficients, so the +model has a handful of trainable parameters but no message-passing +rounds. Positions are in angstrom and energies are arbitrary units. +""" + +import torch +from torch import nn + + +class TinyPairModel(nn.Module): + """Pair-distance energy model with an exponential radial basis.""" + + def __init__(self, n_rbf: int = 8, cutoff: float = 5.0) -> None: + super().__init__() + self.n_rbf = n_rbf + self.cutoff = cutoff + self.register_buffer( + "centers", torch.linspace(0.5, cutoff, n_rbf).view(1, 1, n_rbf) + ) + self.register_buffer("widths", torch.full((1, 1, n_rbf), 0.5 / n_rbf)) + self.element_embedding = nn.Embedding(16, n_rbf) + self.pair_weight = nn.Linear(n_rbf, 1, bias=False) + nn.init.ones_(self.pair_weight.weight) + + def forward( + self, + positions: torch.Tensor, + atomic_numbers: torch.Tensor, + batch_indices: torch.Tensor, + ) -> torch.Tensor: + """Return one energy per graph for the given atoms.""" + # pairwise distances within each graph + dist = torch.cdist(positions, positions) # [N, N] + n = positions.shape[0] + same_graph = batch_indices.view(n, 1) == batch_indices.view(1, n) + eye = torch.eye(n, dtype=torch.bool, device=positions.device) + pair_mask = same_graph & ~eye + d = dist.unsqueeze(-1) + rbf = torch.exp(-((d - self.centers) ** 2) / (2.0 * self.widths**2)) + pair_coeff = ( + self.element_embedding(atomic_numbers).unsqueeze(1) + * self.element_embedding(atomic_numbers).unsqueeze(0) + ).sum(-1, keepdim=True) # [N, N, 1] + pair_energy = (rbf * pair_coeff * self.pair_weight.weight.view(1, 1, -1)).sum( + -1 + ) + energy_per_atom = (pair_energy * pair_mask).sum(-1) * 0.5 # [N] + num_graphs = int(batch_indices.max().item()) + 1 + return torch.zeros( + num_graphs, dtype=energy_per_atom.dtype, device=positions.device + ).index_add_(0, batch_indices, energy_per_atom) diff --git a/skills/nvalchemi-toolkit/evals/files/water.pdb b/skills/nvalchemi-toolkit/evals/files/water.pdb new file mode 100644 index 00000000..49c83f5c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/files/water.pdb @@ -0,0 +1,43 @@ +REMARK Eight waters (TIP3P geometry) in a 24 A cubic box, for a short MD test. +CRYST1 24.000 24.000 24.000 90.00 90.00 90.00 P 1 1 +HETATM 1 O HOH A 1 10.500 10.500 10.500 1.00 0.00 O +HETATM 2 H1 HOH A 1 11.457 10.500 10.500 1.00 0.00 H +HETATM 3 H2 HOH A 1 10.260 11.427 10.500 1.00 0.00 H +TER +HETATM 4 O HOH A 2 10.500 10.500 13.600 1.00 0.00 O +HETATM 5 H1 HOH A 2 11.457 10.500 13.600 1.00 0.00 H +HETATM 6 H2 HOH A 2 10.260 11.427 13.600 1.00 0.00 H +TER +HETATM 7 O HOH A 3 10.500 13.600 10.500 1.00 0.00 O +HETATM 8 H1 HOH A 3 11.457 13.600 10.500 1.00 0.00 H +HETATM 9 H2 HOH A 3 10.260 14.527 10.500 1.00 0.00 H +TER +HETATM 10 O HOH A 4 10.500 13.600 13.600 1.00 0.00 O +HETATM 11 H1 HOH A 4 11.457 13.600 13.600 1.00 0.00 H +HETATM 12 H2 HOH A 4 10.260 14.527 13.600 1.00 0.00 H +TER +HETATM 13 O HOH A 5 13.600 10.500 10.500 1.00 0.00 O +HETATM 14 H1 HOH A 5 14.557 10.500 10.500 1.00 0.00 H +HETATM 15 H2 HOH A 5 13.360 11.427 10.500 1.00 0.00 H +TER +HETATM 16 O HOH A 6 13.600 10.500 13.600 1.00 0.00 O +HETATM 17 H1 HOH A 6 14.557 10.500 13.600 1.00 0.00 H +HETATM 18 H2 HOH A 6 13.360 11.427 13.600 1.00 0.00 H +TER +HETATM 19 O HOH A 7 13.600 13.600 10.500 1.00 0.00 O +HETATM 20 H1 HOH A 7 14.557 13.600 10.500 1.00 0.00 H +HETATM 21 H2 HOH A 7 13.360 14.527 10.500 1.00 0.00 H +TER +HETATM 22 O HOH A 8 13.600 13.600 13.600 1.00 0.00 O +HETATM 23 H1 HOH A 8 14.557 13.600 13.600 1.00 0.00 H +HETATM 24 H2 HOH A 8 13.360 14.527 13.600 1.00 0.00 H +TER +CONECT 1 2 3 +CONECT 4 5 6 +CONECT 7 8 9 +CONECT 10 11 12 +CONECT 13 14 15 +CONECT 16 17 18 +CONECT 19 20 21 +CONECT 22 23 24 +END diff --git a/skills/nvalchemi-toolkit/evals/grader.py b/skills/nvalchemi-toolkit/evals/grader.py new file mode 100644 index 00000000..b7193bea --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/grader.py @@ -0,0 +1,916 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Machine checks for the nvalchemi-toolkit task set (SkillEvaluator custom grader). + +SkillEvaluator runs this file in the verifier with ``grading.mode: +default_plus_custom``, after its own judges. It reads the task's ``checks`` +list from ``entry.json``, runs them on the agent's final code, on the +output of the agent's own runs, and on the skill notes it opened (scope +``reads``), and reports five custom metrics: + +``batched`` all systems in one batch, no Python loop over systems +``device_aware`` the code picks cuda when a GPU exists, one device throughout +``loop_syncs`` no avoidable host-device syncs inside a step loop or hook +``reuse`` the toolkit component is used, no hand-written replacement +``outcome`` the run shows the expected result + +Each metric is the fraction of that task's checks with that metric which +pass. A metric with no check in the task is left out (not applicable). The +merged reward keeps SkillEvaluator's own ``overall``; the report combines +the custom metrics with it (see the task-set report). + +Checks marked ``needs_skill`` are skipped in the baseline arm (entry.json +``has_skill`` false), so that arm is not marked down for skill files it +never had. The grader never runs agent code. ``run`` checks read the output +of the agent's own commands from the trajectory. It also copies the agent's +workspace to ``/kept-workspace/`` for the GPU rerun (``gpu_check``), +because Harbor deletes the workspace after grading. + +Offline use, for testing the checks on a script:: + + python grader.py --offline --entry case.json --code DIR_OR_FILE \ + [--trajectory trajectory.json] [--output run_output.txt] +""" + +from __future__ import annotations + +import argparse +import ast +import json +import os +import re +import shlex +import shutil +import sys +from pathlib import Path +from typing import Any + +METRICS = ("batched", "device_aware", "loop_syncs", "reuse", "outcome") +MAX_FILE_BYTES = 5 * 1024 * 1024 +MAX_TOTAL_BYTES = 200 * 1024 * 1024 +MAX_CODE_FILE_BYTES = 512 * 1024 +SKIP_DIRS = {"input", "skills", "__pycache__", ".git", ".venv", "node_modules"} +# evals/setup_cpu.sh builds the toolkit venv in /workspace/.nvalchemi-env.* +# and links /workspace/.venv to it. Neither is the agent's code. +ENV_PREFIX = ".nvalchemi-env." + + +def _skip_dir(name: str) -> bool: + return name in SKIP_DIRS or name.startswith(ENV_PREFIX) + + +# Calls that copy a tensor to the host or wait for the device. +SYNC_METHODS = {"item", "cpu", "tolist", "numpy"} +SYNC_FUNCS = {"float", "int", "bool"} +SYNC_QUALIFIED = {"torch.cuda.synchronize", "torch.equal", "torch.allclose"} +# Calls that mark a loop body as a step loop when written by hand. +STEP_CALL_ATTRS = {"step", "run", "backward"} +HOOK_METHODS = {"__call__", "pre_update", "post_update"} + + +# -------------------------------------------------------------------------- +# Workspace copy +# -------------------------------------------------------------------------- + + +def keep_workspace(workspace: Path, dest: Path) -> dict: + """Copy regular files under ``workspace`` (without ``skills/``) to ``dest``.""" + kept, skipped, total = [], [], 0 + for root, dirs, files in os.walk(workspace): + rel_root = Path(root).relative_to(workspace) + if rel_root == Path("."): + dirs[:] = [ + d + for d in dirs + if d not in {"skills", ".venv"} and not d.startswith(ENV_PREFIX) + ] + dirs[:] = [d for d in dirs if d not in {"__pycache__", ".git"}] + for name in sorted(files): + src = Path(root) / name + rel = (rel_root / name).as_posix() + if src.is_symlink() or not src.is_file(): + continue + size = src.stat().st_size + if size > MAX_FILE_BYTES or total + size > MAX_TOTAL_BYTES: + skipped.append({"path": rel, "bytes": size}) + continue + target = dest / rel + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(src, target) + kept.append(rel) + total += size + return { + "workspace": str(workspace), + "kept": kept, + "skipped": skipped, + "bytes": total, + } + + +# -------------------------------------------------------------------------- +# Evidence: final code, commands, run output, final message +# -------------------------------------------------------------------------- + + +def _text(value: Any) -> str: + if isinstance(value, str): + return value + if isinstance(value, list): + return "\n".join(_text(v) for v in value) + if isinstance(value, dict): + for key in ("content", "text", "output", "results"): + if key in value: + return _text(value[key]) + return json.dumps(value) + return "" if value is None else str(value) + + +_HEREDOC = re.compile( + r"(?:cat|tee)\s+>{1,2}\s*(?P[^\s<]+\.py)\s*<<-?\s*['\"]?(?P\w+)['\"]?\n(?P.*?)\n(?P=tag)\b", + re.S, +) +_PY_HEREDOC = re.compile( + r"python3?\s+-[^\n<]*<<-?\s*['\"]?(?P\w+)['\"]?\n(?P.*?)\n(?P=tag)\b", + re.S, +) +_PATCH_FILE = re.compile( + r"\*\*\* (?PAdd|Update) File: (?P\S+\.py)\n(?P.*?)(?=\n\*\*\* |\Z)", + re.S, +) + + +def _apply_update(old: str, body: str) -> str: + """Apply the hunks of an apply_patch ``Update File`` section to ``old``.""" + text = old + for hunk in re.split(r"(?m)^@@.*$", body): + lines = hunk.splitlines() + before = [ln[1:] for ln in lines if ln[:1] in (" ", "-")] + after = [ln[1:] for ln in lines if ln[:1] in (" ", "+")] + if not before and not after: + continue + a, b = "\n".join(before), "\n".join(after) + if a and a in text: + text = text.replace(a, b, 1) + elif not a: + text = text + "\n" + b + return text + + +# Commands that show a file's text. A grep or rg on a note shows the lines the +# agent looked for, so it counts as a read too. +_READ_VERB = re.compile(r"^(?:cat|sed|head|tail|less|more|nl|awk|grep|egrep|rg)$") +READ_TOOLS = {"read", "read_file", "view", "open", "cat"} + + +def _expand(name: str) -> list[str]: + """Expand one shell brace group: ``{data,models}`` -> data, models.""" + if name.startswith("{") and name.endswith("}"): + return [n for n in name[1:-1].split(",") if n] + return [name] + + +def _segments(cmd: str) -> list[list[str]]: + """Split a shell command into simple commands, respecting quotes.""" + lexer = shlex.shlex(cmd, posix=True, punctuation_chars=";&|") + lexer.whitespace_split = True + lexer.commenters = "" + segments: list[list[str]] = [[]] + try: + for tok in lexer: + if tok and set(tok) <= set(";&|"): + segments.append([]) + else: + segments[-1].append(tok) + except ValueError: # unbalanced quotes: fall back to a plain split + segments = [seg.split() for seg in re.split(r"\|\||&&|[;|\n]", cmd)] + return [seg for seg in segments if seg] + + +def command_reads(cmd: str, workdir: str = "") -> list[str]: + """Notes under ``references/`` that a shell command prints. + + Counts ``cat``, ``sed``, ``head``, ``tail``, ``less``, ``grep`` and similar + on ``references/.md``, including brace groups such as + ``references/{data,models}.md``, a shell variable set to a ``references`` + folder (``S=.../references; cat $S/models.md``), and a bare ``.md`` + after a ``cd`` into ``references`` or with a ``workdir`` there. + """ + found: list[str] = [] + in_refs = workdir.rstrip("/").endswith("references") + ref_vars: set[str] = set() + for words in _segments(cmd.replace("\n", ";")): + assign = ( + re.fullmatch(r"(\w+)=(\S*)", words[-1]) + if words[0] in {words[-1], "export"} + else None + ) + if assign: + if assign.group(2).rstrip("/").endswith("references"): + ref_vars.add(assign.group(1)) + continue + if words[0] == "cd" and len(words) > 1: + in_refs = words[1].rstrip("/").endswith("references") + continue + if not _READ_VERB.match(words[0]): + continue + for arg in words[1:]: + for var in ref_vars: # $S/models.md and ${S}/models.md + arg = re.sub(rf"^\$\{{?{var}\}}?/", "references/", arg) + m = re.fullmatch(r"(.*/)?(\{[\w,.-]+\}|[\w.-]+)\.md", arg) + if not m: + continue + head = (m.group(1) or "").rstrip("/") + if head.endswith("references") or (not head and in_refs): + found += [f"references/{n}.md" for n in _expand(m.group(2))] + return found + + +def trajectory_evidence(traj: dict) -> dict: + """Return written files, commands, run output, notes read, and final message.""" + written: dict[str, str] = {} + reads: list[str] = [] + snippets: list[str] = [] + commands: list[str] = [] + outputs: list[str] = [] + # The reply is every agent message after the last tool call, so a reply + # split over several messages counts whole. Agent CLI error reports + # (model_name "", or extra.is_error) are not the reply. + reply: list[str] = [] + last_message = "" # fallback when the run ended on a tool call + session_python = False # a python process may still be streaming output + for step in traj.get("steps", []) if isinstance(traj, dict) else []: + if step.get("source") not in {"agent", "assistant"}: + continue + if step.get("tool_calls"): + reply = [] + message = _text(step.get("message")).strip() + extra = step.get("extra") + cli_error = step.get("model_name") == "" or ( + isinstance(extra, dict) and extra.get("is_error") is True + ) + if message and not cli_error: + last_message = message + if not step.get("tool_calls"): # a note before a tool call is not the reply + reply.append(message) + ran_python = False + obs_by_call = {} + obs_val = step.get("observation") + if isinstance(obs_val, dict): + for res in obs_val.get("results") or []: + if isinstance(res, dict): + obs_by_call[str(res.get("source_call_id"))] = _text( + res.get("content") + ) + for call in step.get("tool_calls") or []: + call_out = obs_by_call.get(str(call.get("tool_call_id")), "") + write_failed = bool( + re.search( + r"apply_patch: (command )?not found|No such file or directory: .*apply_patch" + r"|requires a UTF-8 PATCH|Failed to (apply|find)|patch failed", + call_out, + ) + ) + if ( + str(call.get("function_name", "")).lower() == "write_stdin" + and session_python + ): + ran_python = True + args = call.get("arguments") or {} + if not isinstance(args, dict): + continue + path = str(args.get("file_path") or args.get("path") or "") + name = str(call.get("function_name", "")).lower() + if path and name in READ_TOOLS: + reads.append(path) + body = args.get("content") + if path.endswith(".py") and isinstance(body, str): + written[path] = body + cmd = str(args.get("command") or args.get("cmd") or args.get("patch") or "") + if not cmd: + continue + commands.append(cmd) + reads += command_reads(cmd, str(args.get("workdir") or "")) + if re.search(r"(^|[\s;&|(/])python3?\b|\buv run\b", cmd) and not re.search( + r"python3?\s+-c\s+['\"]import\s+\w+;\s*print\(\w+\.__(version|file)__", + cmd, + ): + ran_python = session_python = True + for m in _HEREDOC.finditer(cmd): + written[m.group("path")] = m.group("body") + for m in [] if write_failed else _PATCH_FILE.finditer(cmd): + path_, body_ = m.group("path"), m.group("body") + if m.group("op") == "Add": + lines = [ln[1:] for ln in body_.splitlines() if ln.startswith("+")] + written[path_] = "\n".join(lines) + elif path_ in written: + written[path_] = _apply_update(written[path_], body_) + snippets.extend(m.group("body") for m in _PY_HEREDOC.finditer(cmd)) + obs = step.get("observation") + if obs and ran_python: # program output, not source the agent read + outputs.append(_text(obs)) + return { + "written": written, + "snippets": snippets, + "commands": commands, + "outputs": outputs, + "reads": reads, + "final": "\n\n".join(reply) or last_message, + } + + +def workspace_code(root: Path, fixtures: set[str] = frozenset()) -> dict[str, str]: + """Return the agent's .py files under ``root`` (not task fixtures or skills).""" + files: dict[str, str] = {} + if root.is_file(): + return {root.name: root.read_text(errors="replace")} + if not root.is_dir(): + return files + for path in sorted(root.rglob("*.py")): + rel = path.relative_to(root) + if ( + any(_skip_dir(part) and part != "input" for part in rel.parts[:-1]) + or path.name in fixtures + ): + continue + if path.is_symlink() or path.stat().st_size > MAX_CODE_FILE_BYTES: + continue + files[rel.as_posix()] = path.read_text(errors="replace") + return files + + +def main_code( + files: dict[str, str], evidence: dict, fixtures: set[str] = frozenset() +) -> dict[str, str]: + """Pick the agent's deliverable code. + + Workspace files win (they are the end state). Scripts the agent wrote + outside the workspace (for example under /tmp) are added from the + trajectory, with apply_patch updates applied in order. + """ + code = dict(files) + names = {Path(p).name for p in code} + code.update( + { + path: body + for path, body in evidence.get("written", {}).items() + if Path(path).name not in names and Path(path).name not in fixtures + } + ) + if not code and evidence.get("snippets"): # only inline `python - <": max(evidence["snippets"], key=len)} + return code + + +# -------------------------------------------------------------------------- +# AST analysers +# -------------------------------------------------------------------------- + + +def _parse(src: str) -> ast.AST | None: + try: + return ast.parse(src) + except SyntaxError: + return None + + +def _qualname(node: ast.AST) -> str: + if isinstance(node, ast.Name): + return node.id + if isinstance(node, ast.Attribute): + return f"{_qualname(node.value)}.{node.attr}" + return "" + + +def _sync_sites(nodes: list[ast.stmt]) -> list[tuple[int, str]]: + """Return (line, text) of host-sync calls in a list of statements.""" + sites = [] + for stmt in nodes: + for node in ast.walk(stmt): + if not isinstance(node, ast.Call): + continue + func = node.func + name = _qualname(func) + if ( + isinstance(func, ast.Attribute) + and func.attr in SYNC_METHODS + and not node.args + ): + sites.append((node.lineno, f".{func.attr}()")) + elif name in SYNC_QUALIFIED: + sites.append((node.lineno, name)) + elif ( + isinstance(func, ast.Name) + and func.id in SYNC_FUNCS + and len(node.args) == 1 + and isinstance(node.args[0], (ast.Attribute, ast.Subscript, ast.Call)) + and not _looks_host(node.args[0]) + ): + sites.append((node.lineno, f"{func.id}(tensor)")) + for node in ast.walk(stmt): + # `if tensor.any():` / `assert (x < y).all()` read a device bool. + test = getattr(node, "test", None) + if isinstance(node, (ast.If, ast.While, ast.Assert)) and isinstance( + test, ast.Call + ): + attr = getattr(test.func, "attr", "") + if attr in {"any", "all"}: + sites.append((node.lineno, f"branch on .{attr}()")) + return sites + + +def _looks_host(node: ast.AST) -> bool: + """True for expressions that are plain Python values (len(), os.environ...).""" + name = _qualname(node.func) if isinstance(node, ast.Call) else _qualname(node) + return any( + name.startswith(p) + for p in ( + "len", + "os.", + "math.", + "np.", + "numpy.", + "self.threshold", + "args.", + "str", + ) + ) or name.endswith( + ("num_graphs", "num_nodes", "step_count", "n_steps", "frequency") + ) + + +def _modulo_gate(body: list[ast.stmt]) -> int | None: + """Line after an early ``if step % n: return`` gate, if the body has one.""" + for stmt in body: + if ( + isinstance(stmt, ast.If) + and any( + isinstance(n, ast.BinOp) and isinstance(n.op, ast.Mod) + for n in ast.walk(stmt.test) + ) + and any(isinstance(s, ast.Return) for s in stmt.body) + ): + return stmt.end_lineno + return None + + +def _class_frequency(cls: ast.ClassDef) -> int | None: + for stmt in cls.body: + targets = [] + if isinstance(stmt, ast.Assign): + targets = stmt.targets + value = stmt.value + elif isinstance(stmt, ast.AnnAssign): + targets, value = [stmt.target], stmt.value + for t in targets: + names = [t] if isinstance(t, ast.Name) else list(getattr(t, "elts", [])) + for i, n in enumerate(names): + if isinstance(n, ast.Name) and n.id == "frequency": + v = value.elts[i] if isinstance(value, ast.Tuple) else value + if isinstance(v, ast.Constant) and isinstance(v.value, int): + return v.value + return None + + +def loop_sync_report(code: dict[str, str]) -> dict: + """Count host syncs inside hand-written step loops and per-step hooks. + + Hook methods (``__call__``, ``pre_update``, ``post_update``) of classes + with a class-level ``frequency`` above 1, and code after an early + ``if ... % n: return`` gate, are frequency-gated and do not count. + Loops count as step loops when their body calls ``.step()``, + ``.run()``, or ``.backward()``. + """ + sites: list[str] = [] + gated: list[str] = [] + for path, src in code.items(): + tree = _parse(src) + if tree is None: + continue + for cls in [n for n in ast.walk(tree) if isinstance(n, ast.ClassDef)]: + freq = _class_frequency(cls) + for fn in cls.body: + if not isinstance(fn, ast.FunctionDef) or fn.name not in HOOK_METHODS: + continue + gate = _modulo_gate(fn.body) + for line, what in _sync_sites(fn.body): + tag = f"{path}:{line} {what} in {cls.name}.{fn.name}" + if (freq is not None and freq > 1) or ( + gate is not None and line > gate + ): + gated.append(tag) + else: + sites.append(tag) + for loop in [n for n in ast.walk(tree) if isinstance(n, (ast.For, ast.While))]: + calls = [ + n + for s in loop.body + for n in ast.walk(s) + if isinstance(n, ast.Call) + and isinstance(n.func, ast.Attribute) + and n.func.attr in STEP_CALL_ATTRS + ] + if not calls: + continue + for line, what in _sync_sites(loop.body): + sites.append(f"{path}:{line} {what} in a step loop") + return {"sites": sorted(set(sites)), "gated": sorted(set(gated))} + + +def system_loops(code: dict[str, str], calls: list[str]) -> list[str]: + """Python loops whose body runs an engine or model (one run per system).""" + found = [] + pattern = re.compile("|".join(calls)) if calls else None + for path, src in code.items(): + tree = _parse(src) + if tree is None: + continue + for loop in [n for n in ast.walk(tree) if isinstance(n, (ast.For, ast.While))]: + body = "\n".join(ast.get_source_segment(src, s) or "" for s in loop.body) + if pattern and pattern.search(body): + found.append(f"{path}:{loop.lineno}") + return found + + +def loops_in_methods(code: dict[str, str], methods: set[str]) -> list[str]: + """Python for/while loops inside per-step methods (hooks, updates, forward). + + Loops in a hook class with a class-level ``frequency`` above 1, or after + an early ``if ... % n: return`` gate, run only every N steps and do not + count. Loops over a constant range (for example a fixed number of + denoising steps) do not count either; only loops whose iterable is a + tensor, a ``range`` over a batch size, or a ``.tolist()`` do. + """ + found = [] + for path, src in code.items(): + tree = _parse(src) + if tree is None: + continue + owners = {} + for cls in [n for n in ast.walk(tree) if isinstance(n, ast.ClassDef)]: + for fn in cls.body: + if isinstance(fn, ast.FunctionDef): + owners[id(fn)] = _class_frequency(cls) + for fn in [ + n + for n in ast.walk(tree) + if isinstance(n, ast.FunctionDef) and n.name in methods + ]: + freq = owners.get(id(fn)) + if freq is not None and freq > 1: + continue + gate = _modulo_gate(fn.body) + for node in ast.walk(fn): + if not isinstance(node, (ast.For, ast.While)): + continue + if gate is not None and node.lineno > gate: + continue + it = ( + ast.get_source_segment(src, node.iter) + if isinstance(node, ast.For) + else "while" + ) + if isinstance(node, ast.For) and re.fullmatch( + r"range\(\s*[\w.]*?\d+\s*\)|range\(self\.\w*steps\w*\)", it or "" + ): + continue + if isinstance(node, ast.For) and not re.search( + r"tolist|range\(|num_graphs|num_nodes|batch_ptr|batch_idx|unique|nonzero|split|positions|zip\(", + it or "", + ): + continue # loops over dicts, keys, or config lists are not per-atom work + found.append(f"{path}:{node.lineno} in {fn.name}: {it}") + return found + + +def calls_missing_kw(code: dict[str, str], func: str, kw: str) -> list[str]: + """Calls to ``func`` that do not pass keyword ``kw``.""" + missing = [] + for path, src in code.items(): + tree = _parse(src) + if tree is None: + continue + missing.extend( + f"{path}:{node.lineno}" + for node in ast.walk(tree) + if isinstance(node, ast.Call) + and _qualname(node.func).split(".")[-1] == func + and kw not in {k.arg for k in node.keywords} + ) + return missing + + +def hardcoded_cpu(code: dict[str, str]) -> list[str]: + """Places that pin ``cpu`` outside a cuda-or-cpu conditional.""" + found = [] + for path, src in code.items(): + tree = _parse(src) + if tree is None: + continue + cond_ranges = [ + (n.lineno, n.end_lineno) + for n in ast.walk(tree) + if isinstance(n, (ast.IfExp, ast.If)) + and "cuda" in (ast.get_source_segment(src, n.test) or "") + ] + for node in ast.walk(tree): + hit = False + if isinstance(node, ast.keyword) and node.arg in {"device", "device_type"}: + v = node.value + hit = isinstance(v, ast.Constant) and v.value == "cpu" + hit = hit or ( + isinstance(v, ast.Call) + and _qualname(v.func) == "torch.device" + and v.args + and isinstance(v.args[0], ast.Constant) + and v.args[0].value == "cpu" + ) + elif isinstance(node, ast.Call) and _qualname(node.func) == "torch.device": + hit = ( + bool(node.args) + and isinstance(node.args[0], ast.Constant) + and node.args[0].value == "cpu" + ) + elif isinstance(node, ast.Assign) and isinstance(node.value, ast.Constant): + hit = node.value.value == "cpu" and any( + "device" in _qualname(t).lower() for t in node.targets + ) + line = getattr(node, "lineno", None) or getattr( + getattr(node, "value", None), "lineno", 0 + ) + if hit and not any(a <= line <= b for a, b in cond_ranges): + found.append(f"{path}:{line}") + return sorted(set(found)) + + +# -------------------------------------------------------------------------- +# Check runner +# -------------------------------------------------------------------------- + + +def _scope_text(scope: str, code: dict[str, str], ev: dict) -> str: + if scope == "code": + return "\n".join(code.values()) + if scope == "commands": + return "\n".join(ev["commands"] + ev["snippets"]) + if scope == "output": + return "\n".join(ev["outputs"]) + if scope == "final": + return ev["final"] + if scope == "reads": + return "\n".join(ev.get("reads", [])) + if scope == "run": + return "\n".join([*ev["outputs"], ev["final"]]) + if scope == "all": + return "\n".join([*code.values(), *ev["commands"], *ev["outputs"], ev["final"]]) + raise ValueError(f"unknown scope {scope}") + + +def run_check(check: dict, code: dict[str, str], ev: dict) -> tuple[bool, str]: + """Return (passed, reason) for one check.""" + scope = check.get("scope", "code" if check["kind"] == "static" else "output") + analyser = check.get("analyser") + if analyser == "no_loop_syncs": + rep = loop_sync_report(code) + limit = int(check.get("max", 0)) + ok = len(rep["sites"]) <= limit and bool(code) + return ( + ok, + f"{len(rep['sites'])} loop sync site(s) {rep['sites'][:6]}; gated {len(rep['gated'])}", + ) + if analyser == "no_system_loop": + found = system_loops(code, check.get("calls", [])) + return ( + not found and bool(code) + ), f"loops over systems: {found}" if found else "none" + if analyser == "no_loop_in_methods": + found = loops_in_methods(code, set(check.get("methods", sorted(HOOK_METHODS)))) + return (not found and bool(code)), f"loops: {found}" if found else "none" + if analyser == "calls_have_kw": + missing = calls_missing_kw(code, check["func"], check["kw"]) + return ( + not missing, + f"{check['func']} without {check['kw']}=: {missing}" if missing else "ok", + ) + if analyser == "device_aware": + if not code or set(code) == {""}: + return False, "no script written" + text = "\n".join(code.values()) + picks = re.search( + r"cuda\.is_available\(\)|resolve_device\(|device_count\(\)", text + ) + pinned = hardcoded_cpu(code) + ok = bool(picks) and not pinned + return ok, f"picks cuda: {bool(picks)}; cpu pinned at {pinned}" + text = _scope_text(scope, code, ev) + missing = [p for p in check.get("require", []) if not re.search(p, text, re.M)] + present = [p for p in check.get("forbid", []) if re.search(p, text, re.M)] + if "expect" in check: # numeric run check: first capture group near expect + values = [float(v) for v in re.findall(check["pattern"], text, re.M)] + tol = float(check.get("tol", 0)) + ok = any(abs(v - float(check["expect"])) <= tol for v in values) + return ok, f"found {values[-5:]}, expect {check['expect']} +- {tol}" + ok = not missing and not present and (bool(text) or not check.get("require")) + reason = [] + if missing: + reason.append(f"missing {missing}") + if present: + reason.append(f"forbidden {present}") + return ok, "; ".join(reason) or "ok" + + +SKILL_NAME = "nvalchemi-toolkit" + + +def skill_present(entry: dict) -> bool: + """True unless entry.json says this trial ran without this skill. + + SkillEvaluator writes ``has_skill`` into entry.json: false in the + baseline arm. A run that installs a different skill under test names it + in ``expected_skill``. Offline runs without ``has_skill`` count as present. + """ + if entry.get("has_skill") is False: + return False + return entry.get("expected_skill") in (None, SKILL_NAME) + + +def grade(entry: dict, code: dict[str, str], ev: dict) -> dict: + """Run every check of ``entry`` and return metrics and details. + + Checks marked ``"needs_skill": true`` (for example which notes the + agent read) are skipped when the skill is absent, so the baseline arm + is not marked down for files it never had. + """ + results = [] + skipped = [] + with_skill = skill_present(entry) + for check in entry.get("checks", []): + if check.get("kind") == "gpu": # graded after the trial by gpu/gpu_check.py + continue + if check.get("needs_skill") and not with_skill: + skipped.append(check["id"]) + continue + try: + ok, reason = run_check(check, code, ev) + except Exception as exc: # a broken check must not kill the verifier + ok, reason = False, f"check error: {exc}" + results.append( + { + "id": check["id"], + "metric": check["metric"], + "passed": ok, + "reason": reason, + } + ) + metrics: dict[str, float] = {} + details: dict[str, dict] = {} + for m in METRICS: + rows = [r for r in results if r["metric"] == m] + if rows: + metrics[m] = round(sum(r["passed"] for r in rows) / len(rows), 4) + details[m] = { + "score": metrics[m], + "reason": "; ".join( + f"{r['id']}={'pass' if r['passed'] else 'FAIL'}" for r in rows + ), + } + # SkillEvaluator's reward contract needs every declared metric in every + # reward. A metric this task does not check is reported as 1.0 and marked + # not_checked, so reports can leave it out of their averages. + reward_metrics = dict(metrics) + for m in METRICS: + if m not in reward_metrics: + reward_metrics[m] = 1.0 + details[m] = {"score": 1.0, "not_checked": True, "reason": "no check"} + for m in METRICS: # say which checks the baseline arm skipped + ids = [ + c["id"] + for c in entry.get("checks", []) + if c["id"] in skipped and c["metric"] == m + ] + if ids: + details[m]["reason"] += "; " + "; ".join( + f"{i}=not_checked (skill absent)" for i in ids + ) + return { + "metrics": metrics, + "reward_metrics": reward_metrics, + "details": details, + "checks": results, + "skipped_without_skill": skipped, + "code_files": sorted(code), + } + + +def _load(path: Path) -> dict: + try: + return json.loads(path.read_text(encoding="utf-8")) + except (OSError, json.JSONDecodeError): + return {} + + +def verifier_main() -> int: + """Entry point inside the Harbor verifier; always writes a reward.""" + try: + return _verifier_main() + except Exception as exc: # never zero a trial because the grader broke + verifier = Path(os.environ.get("HARBOR_VERIFIER_DIR", "/logs/verifier")) + reward = Path(os.environ.get("HARBOR_REWARD_JSON", verifier / "reward.json")) + reward.parent.mkdir(parents=True, exist_ok=True) + reward.write_text( + json.dumps( + { + "custom_metrics": {m: 0.0 for m in METRICS}, + "grader_error": str(exc)[:500], + } + ) + ) + return 0 + + +def _verifier_main() -> int: + workspace = Path(os.environ.get("HARBOR_WORKSPACE_DIR", "/workspace")) + trial = Path(os.environ.get("HARBOR_LOGS_DIR", "/logs")) + verifier = Path(os.environ.get("HARBOR_VERIFIER_DIR", trial / "verifier")) + agent_dir = Path(os.environ.get("HARBOR_AGENT_LOGS_DIR", trial / "agent")) + atif = Path(os.environ.get("HARBOR_ATIF_PATH", agent_dir / "trajectory.json")) + entry_path = Path(os.environ.get("HARBOR_ENTRY_JSON", "/tests/entry.json")) + reward = Path(os.environ.get("HARBOR_REWARD_JSON", verifier / "reward.json")) + + try: + summary = keep_workspace(workspace, trial / "kept-workspace") + except OSError as exc: + summary = {"workspace": str(workspace), "error": str(exc)} + try: + (trial / "kept-workspace.json").write_text(json.dumps(summary, indent=2)) + except OSError: + pass + + entry = _load(entry_path) + ev = trajectory_evidence(_load(atif)) + fixtures = {Path(f).name for f in entry.get("files", []) or []} + code = main_code(workspace_code(workspace, fixtures), ev, fixtures) + result = grade(entry, code, ev) + verifier.mkdir(parents=True, exist_ok=True) + (verifier / "nvalchemi_checks.json").write_text(json.dumps(result, indent=2)) + reward.parent.mkdir(parents=True, exist_ok=True) + reward.write_text( + json.dumps( + {"custom_metrics": result["reward_metrics"], "details": result["details"]}, + indent=2, + ) + ) + return 0 + + +def offline_main(argv: list[str]) -> int: + """Grade a script or directory outside Harbor and print the result.""" + p = argparse.ArgumentParser() + p.add_argument("--offline", action="store_true") + p.add_argument("--entry", required=True, help="case JSON, or evals.json plus --id") + p.add_argument("--id") + p.add_argument("--code", required=True) + p.add_argument("--trajectory") + p.add_argument("--output", help="text file with the run output") + p.add_argument("--final", help="text file with the final message") + a = p.parse_args(argv) + entry = _load(Path(a.entry)) + if "evals" in entry: + entry = next(c for c in entry["evals"] if c["id"] == a.id) + ev = ( + trajectory_evidence(_load(Path(a.trajectory))) + if a.trajectory + else { + "written": {}, + "snippets": [], + "commands": [], + "outputs": [], + "reads": [], + "final": "", + } + ) + if a.output: + ev["outputs"].append(Path(a.output).read_text(errors="replace")) + if a.final: + ev["final"] = Path(a.final).read_text(errors="replace") + fixtures = {Path(f).name for f in entry.get("files", []) or []} + code = main_code(workspace_code(Path(a.code), fixtures), ev, fixtures) + print(json.dumps(grade(entry, code, ev), indent=2)) + return 0 + + +if __name__ == "__main__": + if "--offline" in sys.argv: + sys.exit(offline_main(sys.argv[1:])) + sys.exit(verifier_main()) diff --git a/skills/nvalchemi-toolkit/evals/harbor/comp-01/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/comp-01/instruction.md new file mode 100644 index 00000000..5e13d20a --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/comp-01/instruction.md @@ -0,0 +1,13 @@ +Before I wire up a real MLIP I want a quick CPU sanity check that I can drive an +equation-of-state workflow end to end with the ALCHEMI Toolkit. My structure is +si_diamond.extxyz (2x2x2 supercell of diamond silicon, 64 atoms, a = 5.43 angstrom). +Scale the lattice isotropically to 0.96, 0.98, 1.00, 1.02, and 1.04 of its current size, +relax the atoms at each volume with the cell held fixed, and fit an equation of state to +the five energy-volume points to get the equilibrium volume and bulk modulus. There is +no GPU and no trained checkpoint here, so check it on CPU, but write it so it uses a GPU +when one is there. Use the toolkit's Lennard-Jones model as a stand-in (epsilon = 0.5 +eV, sigma = 2.1 angstrom, cutoff = 4.1 angstrom); I only care that the plumbing is +right, not the numbers. Cap the optimizer at 50 steps per scan point and let it stop +early on convergence with fmax = 0.05 eV/angstrom. Print the five relaxed energies and +the fitted V0 and B0. When you are done, tell me the name of the script you wrote and +which toolkit classes and functions it uses. diff --git a/skills/nvalchemi-toolkit/evals/harbor/comp-01/task.toml b/skills/nvalchemi-toolkit/evals/harbor/comp-01/task.toml new file mode 100644 index 00000000..e4a4a665 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/comp-01/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-comp-01" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "comp-01" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/dataset.toml b/skills/nvalchemi-toolkit/evals/harbor/dataset.toml new file mode 100644 index 00000000..58749772 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/dataset.toml @@ -0,0 +1,31 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +[dataset] +name = "nvidia/skillevaluator" +description = "SkillEvaluator skill evaluation dataset" + +[[tasks]] +name = "nvidia/comp-01" + +[[tasks]] +name = "nvidia/imp-01" + +[[tasks]] +name = "nvidia/imp-02" + +[[tasks]] +name = "nvidia/model-01" + +[[tasks]] +name = "nvidia/neg-01" + +[[tasks]] +name = "nvidia/neg-03" + +[[tasks]] +name = "nvidia/scope-01" + +[[tasks]] +name = "nvidia/scope-02" + +[[tasks]] +name = "nvidia/scope-03" diff --git a/skills/nvalchemi-toolkit/evals/harbor/imp-01/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/imp-01/instruction.md new file mode 100644 index 00000000..137748d2 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/imp-01/instruction.md @@ -0,0 +1,9 @@ +argon_clusters.xyz holds three 27-atom argon clusters. I want all three relaxed together +to a maximum force below 0.05 eV/A, with at most 200 optimizer steps, using a +Lennard-Jones potential (epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A). Later I will run +thousands of these on a GPU, so treat them as one batch on the device and use the +batched atomistic simulation library installed in this environment, not a loop of ASE +optimizers. This machine has no GPU, so check it here on CPU, but write it so it uses a +GPU when one is there. Print the final energy and maximum force of each cluster. When +you are done, tell me the name of the script you wrote and which library classes and +functions it uses. diff --git a/skills/nvalchemi-toolkit/evals/harbor/imp-01/task.toml b/skills/nvalchemi-toolkit/evals/harbor/imp-01/task.toml new file mode 100644 index 00000000..21f7032c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/imp-01/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-imp-01" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "imp-01" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/imp-02/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/imp-02/instruction.md new file mode 100644 index 00000000..81851103 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/imp-02/instruction.md @@ -0,0 +1,10 @@ +argon_fcc32.extxyz is a 32-atom FCC argon crystal in a periodic box. Run Langevin NVT +molecular dynamics at 40 K (friction 0.01 /fs, random seed 0) for 200 steps of 2 fs, +starting from Maxwell-Boltzmann velocities at 40 K, with a Lennard-Jones potential +(epsilon 0.0104 eV, sigma 3.4 A, cutoff 8.5 A). Save a frame every 20 steps to a Zarr +store on disk so I can stream it into a training set later, then report how many frames +the store holds. The GPU-batched atomistic simulation package in this environment is +what my group uses, so build on it rather than writing an integrator or using ASE's MD. +This machine has no GPU, so check it here on CPU, but write it so it uses a GPU when one +is there. When you are done, tell me the name of the script you wrote and which library +classes and functions it uses. diff --git a/skills/nvalchemi-toolkit/evals/harbor/imp-02/task.toml b/skills/nvalchemi-toolkit/evals/harbor/imp-02/task.toml new file mode 100644 index 00000000..62c50efa --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/imp-02/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-imp-02" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "imp-02" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/model-01/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/model-01/instruction.md new file mode 100644 index 00000000..ed479745 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/model-01/instruction.md @@ -0,0 +1,8 @@ +I have a small message-passing-style network in input/toy_pair_model.py (class +TinyPairModel). It takes atomic numbers, positions, and a batch index tensor, and +returns one scalar energy per graph. Wrap it so toolkit dynamics stages (FIRE2, NVT) can +call it: energy plus forces derived from the energy by autograd. Then run a quick sanity +check with a single 4-atom structure and print the energy and force shapes it produces. +This machine has no GPU, so check it here on CPU at this size, but write it so it uses a +GPU when one is there. When you are done, tell me the name of the script you wrote and +which toolkit classes and functions it uses. diff --git a/skills/nvalchemi-toolkit/evals/harbor/model-01/task.toml b/skills/nvalchemi-toolkit/evals/harbor/model-01/task.toml new file mode 100644 index 00000000..53465979 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/model-01/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-model-01" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "model-01" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/neg-01/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/neg-01/instruction.md new file mode 100644 index 00000000..e2da2f96 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/neg-01/instruction.md @@ -0,0 +1,6 @@ +My project already depends on nvalchemi and it is installed in this environment, but for +this one I just want plain ASE. Here is a small copper slab, cu_slab.extxyz (32 Cu +atoms, four fcc(100) layers, vacuum on one side). Please relax the atomic positions with +ASE's BFGS optimizer and the EMT potential until the maximum force is below 0.01 eV/Å, +capped at 50 steps. It is a quick CPU sanity check on my laptop, so nothing heavier than +that. Report the final energy and the final maximum force when it is done. diff --git a/skills/nvalchemi-toolkit/evals/harbor/neg-01/task.toml b/skills/nvalchemi-toolkit/evals/harbor/neg-01/task.toml new file mode 100644 index 00000000..c26a8b06 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/neg-01/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-neg-01" +description = "Skill evaluation task for none" + +[metadata] +entry_id = "neg-01" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/neg-03/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/neg-03/instruction.md new file mode 100644 index 00000000..29691434 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/neg-03/instruction.md @@ -0,0 +1,2 @@ +I have a small water box in water.pdb. Run 10 ps of NVT MD at 300 K with OpenMM and save +the trajectory. diff --git a/skills/nvalchemi-toolkit/evals/harbor/neg-03/task.toml b/skills/nvalchemi-toolkit/evals/harbor/neg-03/task.toml new file mode 100644 index 00000000..6b20e642 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/neg-03/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-neg-03" +description = "Skill evaluation task for none" + +[metadata] +entry_id = "neg-03" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-01/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/scope-01/instruction.md new file mode 100644 index 00000000..07ab00a6 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-01/instruction.md @@ -0,0 +1 @@ +Here is my structure, ammonia_dimer.xyz. Run MD on it and give me the trajectory. diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-01/task.toml b/skills/nvalchemi-toolkit/evals/harbor/scope-01/task.toml new file mode 100644 index 00000000..906b217c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-01/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-scope-01" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "scope-01" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-02/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/scope-02/instruction.md new file mode 100644 index 00000000..c1ba6f6f --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-02/instruction.md @@ -0,0 +1,2 @@ +I want to fine-tune a model with the ALCHEMI Toolkit on my DFT data in +input/co_frames.extxyz. Can you set that up? diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-02/task.toml b/skills/nvalchemi-toolkit/evals/harbor/scope-02/task.toml new file mode 100644 index 00000000..0d16942c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-02/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-scope-02" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "scope-02" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-03/instruction.md b/skills/nvalchemi-toolkit/evals/harbor/scope-03/instruction.md new file mode 100644 index 00000000..8fa9bb3e --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-03/instruction.md @@ -0,0 +1,7 @@ +Please set up NVT MD with the ALCHEMI Toolkit for input/ar_scope.extxyz. Use its +Lennard-Jones model with epsilon=0.0104 eV, sigma=3.4 A and cutoff=5.0 A, dt=1 fs, +Langevin friction=0.01 /fs and random seed 0. Draw initial thermal velocities at the +thermostat temperature. This is CPU-only, with at most one minute for an optional smoke +check. I want a script and a short report of the input and settings; the check is that +the energy and forces remain finite. You may write them in this workspace; do not +install or download anything. What else do you need before setting it up? diff --git a/skills/nvalchemi-toolkit/evals/harbor/scope-03/task.toml b/skills/nvalchemi-toolkit/evals/harbor/scope-03/task.toml new file mode 100644 index 00000000..f4ea902c --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/harbor/scope-03/task.toml @@ -0,0 +1,35 @@ +# Generated from evals/evals.json and evals/setup_cpu.sh; do not edit. +schema_version = "1.3" +artifacts = ["/workspace/nvalchemi-setup.log", "/workspace/nvalchemi-setup.status"] + +[task] +name = "nvidia/skillevaluator-scope-03" +description = "Skill evaluation task for nvalchemi-toolkit" + +[metadata] +entry_id = "scope-03" + +[agent] +timeout_sec = 300.0 + +[verifier] +timeout_sec = 300.0 + +[[verifier.collect]] +command = "bash -c 'set -euo pipefail\nnva_status=125\nif [ -r /workspace/nvalchemi-setup.status ]; then\n read -r nva_status < /workspace/nvalchemi-setup.status || nva_status=125\nfi\nif [[ \"$nva_status\" =~ ^[0-9]{1,3}$ ]] && (( 10#$nva_status <= 255 )); then\n nva_status=$((10#$nva_status))\nelse\n nva_status=125\nfi\nif [ \"$nva_status\" -eq 0 ]; then\n exit 0\nfi\nprintf '\"'\"'NVALCHEMI_SETUP_DIAGNOSTICS exit_code=%s (125 means setup did not finish)\\n'\"'\"' \"$nva_status\" >&2\nif [ -r /workspace/nvalchemi-setup.log ]; then\n tail -n 12 /workspace/nvalchemi-setup.log >&2 || printf '\"'\"'Could not read the setup log.\\n'\"'\"' >&2\nelse\n printf '\"'\"'No setup log was written.\\n'\"'\"' >&2\nfi\nexit \"$nva_status\"\n'" +timeout_sec = 10.0 + +[environment] +cpus = 2 +memory_mb = 4096 +storage_mb = 6144 +workdir = "/workspace" +network_mode = "public" +skills_dir = "/workspace/skills" +build_timeout_sec = 2400.0 + +[environment.healthcheck] +command = "bash -c 'set -euo pipefail\nprintf \"125\\n\" > /workspace/nvalchemi-setup.status\nset +e\nbash -lc '\"'\"'#!/usr/bin/env bash\n# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Installs the CPU toolkit stack for the skill evaluation sandbox, in both\n# arms (with the skill and the baseline). It is for evaluation only; users\n# install nvalchemi-toolkit from PyPI as the documentation describes.\nset -euo pipefail\nnva_stage=initialize\nnva_report_failure() {\n nva_exit=$?\n if [ \"$nva_exit\" -ne 0 ]; then\n printf '\"'\"'\"'\"'\"'\"'\"'\"'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_stage\" \"$nva_exit\" >&2\n fi\n}\ntrap nva_report_failure EXIT\n\nnva_root=\"${NVALCHEMI_EVAL_ROOT:-/workspace}\"\nnva_env=\"$nva_root/.venv\"\nnva_publish=false\nif [ ! -e \"$nva_env\" ] && [ ! -L \"$nva_env\" ]; then\n nva_stage=select_interpreter\n nva_host_python=$(command -v python3)\n nva_stage=create_environment\n nva_env=$(mktemp -d \"$nva_root/.nvalchemi-env.XXXXXX\")\n nva_publish=true\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Creating CPU environment: %s (host Python: %s)\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\" \"$nva_host_python\"\n \"$nva_host_python\" -m venv --system-site-packages --without-pip \"$nva_env\"\n # The CPU torch wheel comes alone from the PyTorch index, so the resolver\n # never takes the CUDA wheel from PyPI.\n nva_stage=install_cpu_torch\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing CPU PyTorch into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-deps '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' \\\n --index-url https://download-r2.pytorch.org/whl/cpu\n # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via\n # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is\n # the one exception to wheels only.\n nva_stage=install_toolkit\n printf '\"'\"'\"'\"'\"'\"'\"'\"'Installing nvalchemi-toolkit and its dependencies into %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n \"$nva_host_python\" -m pip --python \"$nva_env\" install \\\n --cert \"${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}\" \\\n --disable-pip-version-check --no-input --only-binary=:all: --no-compile \\\n --progress-bar off --no-binary=antlr4-python3-runtime \\\n '\"'\"'\"'\"'\"'\"'\"'\"'torch==2.13.0+cpu'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit==0.3.0'\"'\"'\"'\"'\"'\"'\"'\"' \\\n '\"'\"'\"'\"'\"'\"'\"'\"'nvalchemi-toolkit-ops==0.5.0'\"'\"'\"'\"'\"'\"'\"'\"' '\"'\"'\"'\"'\"'\"'\"'\"'ase==3.27.0'\"'\"'\"'\"'\"'\"'\"'\"'\nfi\nnva_stage=smoke_check\nprintf '\"'\"'\"'\"'\"'\"'\"'\"'Checking CPU environment: %s\\n'\"'\"'\"'\"'\"'\"'\"'\"' \"$nva_env\"\n\"$nva_env/bin/python\" -u - <<'\"'\"'\"'\"'\"'\"'\"'\"'PY'\"'\"'\"'\"'\"'\"'\"'\"'\nimport sys\n\nprint(\"Smoke check runtime:\", sys.executable, sys.version.split()[0], flush=True)\nimport torch\nimport nvalchemi\nfrom nvalchemi.data import AtomicData, Batch\nfrom nvalchemi.models.lj import LennardJonesModelWrapper\n\nassert nvalchemi.__version__ == \"0.3.0\", nvalchemi.__version__\nassert torch.version.cuda is None, torch.__version__\ndata = AtomicData(\n positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]),\n atomic_numbers=torch.tensor([18, 18]),\n)\n# Two atoms, each the other'\"'\"'\"'\"'\"'\"'\"'\"'s only neighbor; padding uses n_atoms.\ndata.add_node_property(\"neighbor_matrix\", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32))\ndata.add_node_property(\"num_neighbors\", torch.tensor([1, 1], dtype=torch.int32))\nbatch = Batch.from_data_list([data])\nmodel = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5)\nenergy = model(batch)[\"energy\"]\nassert energy.shape[0] == 1 and bool(torch.isfinite(energy).all())\nprint(\"nvalchemi environment ready:\", sys.executable, sys.version.split()[0],\n \"torch\", torch.__version__, \"energy\", float(energy.sum()))\nPY\n# Publish .venv only after the install and the smoke check pass. A failed\n# environment stays at its own path for diagnosis; a retry uses a fresh one.\nif [ \"$nva_publish\" = true ]; then\n nva_stage=publish_environment\n ln -sT \"$nva_env\" \"$nva_root/.venv\"\nfi\n'\"'\"' 2>&1 | tee /workspace/nvalchemi-setup.log\nnva_codes=(\"${PIPESTATUS[@]}\")\nset -e\nnva_status=\"${nva_codes[0]}\"\nif [ \"$nva_status\" -eq 0 ]; then nva_status=\"${nva_codes[1]}\"; fi\nprintf \"%s\\n\" \"$nva_status\" > /workspace/nvalchemi-setup.status\nexit \"$nva_status\"\n'" +interval_sec = 5.0 +timeout_sec = 600.0 +retries = 1 diff --git a/skills/nvalchemi-toolkit/evals/setup_cpu.sh b/skills/nvalchemi-toolkit/evals/setup_cpu.sh new file mode 100644 index 00000000..9bae5529 --- /dev/null +++ b/skills/nvalchemi-toolkit/evals/setup_cpu.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Installs the CPU toolkit stack for the skill evaluation sandbox, in both +# arms (with the skill and the baseline). It is for evaluation only; users +# install nvalchemi-toolkit from PyPI as the documentation describes. +set -euo pipefail +nva_stage=initialize +nva_report_failure() { + nva_exit=$? + if [ "$nva_exit" -ne 0 ]; then + printf 'NVALCHEMI_SETUP_FAILED stage=%s exit_code=%s\n' "$nva_stage" "$nva_exit" >&2 + fi +} +trap nva_report_failure EXIT + +nva_root="${NVALCHEMI_EVAL_ROOT:-/workspace}" +nva_env="$nva_root/.venv" +nva_publish=false +if [ ! -e "$nva_env" ] && [ ! -L "$nva_env" ]; then + nva_stage=select_interpreter + nva_host_python=$(command -v python3) + nva_stage=create_environment + nva_env=$(mktemp -d "$nva_root/.nvalchemi-env.XXXXXX") + nva_publish=true + printf 'Creating CPU environment: %s (host Python: %s)\n' "$nva_env" "$nva_host_python" + "$nva_host_python" -m venv --system-site-packages --without-pip "$nva_env" + # The CPU torch wheel comes alone from the PyTorch index, so the resolver + # never takes the CUDA wheel from PyPI. + nva_stage=install_cpu_torch + printf 'Installing CPU PyTorch into %s\n' "$nva_env" + "$nva_host_python" -m pip --python "$nva_env" install \ + --cert "${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}" \ + --disable-pip-version-check --no-input --only-binary=:all: --no-compile \ + --progress-bar off --no-deps 'torch==2.13.0+cpu' \ + --index-url https://download-r2.pytorch.org/whl/cpu + # Everything else resolves on PyPI. antlr4-python3-runtime 4.9.3 (via + # physicsnemo and hydra-core) ships only as a pure-Python sdist, so it is + # the one exception to wheels only. + nva_stage=install_toolkit + printf 'Installing nvalchemi-toolkit and its dependencies into %s\n' "$nva_env" + "$nva_host_python" -m pip --python "$nva_env" install \ + --cert "${PIP_CERT:-/etc/ssl/certs/ca-certificates.crt}" \ + --disable-pip-version-check --no-input --only-binary=:all: --no-compile \ + --progress-bar off --no-binary=antlr4-python3-runtime \ + 'torch==2.13.0+cpu' 'nvalchemi-toolkit==0.3.0' \ + 'nvalchemi-toolkit-ops==0.5.0' 'ase==3.27.0' +fi +nva_stage=smoke_check +printf 'Checking CPU environment: %s\n' "$nva_env" +"$nva_env/bin/python" -u - <<'PY' +import sys + +print("Smoke check runtime:", sys.executable, sys.version.split()[0], flush=True) +import torch +import nvalchemi +from nvalchemi.data import AtomicData, Batch +from nvalchemi.models.lj import LennardJonesModelWrapper + +assert nvalchemi.__version__ == "0.3.0", nvalchemi.__version__ +assert torch.version.cuda is None, torch.__version__ +data = AtomicData( + positions=torch.tensor([[0.0, 0.0, 0.0], [3.8, 0.0, 0.0]]), + atomic_numbers=torch.tensor([18, 18]), +) +# Two atoms, each the other's only neighbor; padding uses n_atoms. +data.add_node_property("neighbor_matrix", torch.tensor([[1, 2], [0, 2]], dtype=torch.int32)) +data.add_node_property("num_neighbors", torch.tensor([1, 1], dtype=torch.int32)) +batch = Batch.from_data_list([data]) +model = LennardJonesModelWrapper(epsilon=0.0104, sigma=3.40, cutoff=8.5) +energy = model(batch)["energy"] +assert energy.shape[0] == 1 and bool(torch.isfinite(energy).all()) +print("nvalchemi environment ready:", sys.executable, sys.version.split()[0], + "torch", torch.__version__, "energy", float(energy.sum())) +PY +# Publish .venv only after the install and the smoke check pass. A failed +# environment stays at its own path for diagnosis; a retry uses a fresh one. +if [ "$nva_publish" = true ]; then + nva_stage=publish_environment + ln -sT "$nva_env" "$nva_root/.venv" +fi diff --git a/skills/nvalchemi-toolkit/references/composition-and-extension.md b/skills/nvalchemi-toolkit/references/composition-and-extension.md new file mode 100644 index 00000000..5558c469 --- /dev/null +++ b/skills/nvalchemi-toolkit/references/composition-and-extension.md @@ -0,0 +1,278 @@ +# Composition and extension + +This note covers new code that plugs into the toolkit: hooks, integrators and +optimizers, loss terms, biases, reporters, and domain decomposition across +GPUs. Use it only after the reuse check in `SKILL.md`: most +needs already have a shipped component, listed in the other notes. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| Hook protocol, contexts, stages | [hooks.md][doc-hooks] | [02_custom_hook.py][ex-hook] | `nvalchemi/hooks/_protocol.py`, `_context.py`, `nvalchemi/dynamics/base.py` (`DynamicsStage`) | +| Custom integrator or optimizer | [dynamics_simulations.md][doc-sims] (writing your own dynamics) | [05_custom_integrator.py][ex-integ] | `nvalchemi/dynamics/base.py`, `nvalchemi/dynamics/integrators/nve.py` | +| Custom convergence criteria | [hooks.md][doc-hooks] | [03_custom_convergence.py][ex-conv] | `ConvergenceHook` in `nvalchemi/dynamics/base.py` | +| Custom loss term | [losses.md][doc-loss] (writing your own loss) | none | `nvalchemi/training/losses/composition.py`, `terms.py` | +| Custom bias | [enhanced_sampling.md][doc-es] (writing your own bias) | [15_rmsd_metadynamics.py][ex-rmsd] | `nvalchemi/enhanced_sampling/_bias.py` | +| Reporting and dashboards | [reporting.md][doc-rep] | [07_rich_training_reporting.py][ex-rich] | `nvalchemi/hooks/reporting/` | +| Domain decomposition | [distributed.md][doc-dd], [distributed_byo.md][doc-byo] | [03_mace_nvt_distributed.py][ex-dd], [04_byo_pytorch_mpnn.py][ex-byo] | `nvalchemi/distributed/` | +| Multi-rank stage pipelines | [dynamics.md][doc-dyn] (distributed pipelines) | [01_distributed_pipeline.py][ex-pipe] | `DistributedPipeline` in `nvalchemi/dynamics/base.py` | + +API reference sources: [docs/modules/hooks.rst][api-hooks], +[docs/modules/dynamics/][api-dyn], [docs/modules/distributed.rst][api-dist]. + +## Custom hooks + +A hook is any object with `stage`, `frequency`, and +`__call__(ctx, stage)`. No base class is needed. Dynamics hooks receive a +`DynamicsContext` with `batch`, `step_count`, `model`, `active_graph_mask`, +`converged_mask`, and `workflow` (the engine that owns the hook). + +### Checklist + +Go through every item. Hooks that skipped one of these were the most common +failure in tested scripts. + +1. **Class attributes.** Declare `stage` and `frequency` on the class. For + "every N steps", set `frequency = N` and let the engine gate the call. + Do not use `frequency = 1` with your own step counter, and do not count + steps inside `__call__`. +2. **Vectorized per-graph math.** Reduce per graph with + `index_add_` or `scatter_reduce_` over `batch.batch_idx`. No Python loop + over graphs, and no `.item()` or `.tolist()` per graph in the hot path. +3. **Respect the active mask.** Gate every write on `ctx.active_graph_mask` + (it can be `None` when the batch has no `status`). Graphs that already + finished must not be touched again. +4. **Stopping a graph.** Write `ctx.workflow.exit_status` into + `batch.status` for the graphs to stop, with `torch.where`, not a loop. + A plain engine has no `status` column; add one before `run()`. Register + the hook on the `FusedStage` (not a sub-stage) when it should end the + whole pipeline for that graph. +5. **Pick the right stage.** Model outputs change at `AFTER_COMPUTE`; + observers and stoppers go at `AFTER_STEP`. One-time per-system setup goes + at `ON_ADMISSION`, which fires once when a batch is admitted, before + forces are primed. Work on systems that just finished goes at + `ON_GRADUATE` (read `ctx.graduated_mask`). +6. **Record cheaply.** Store per-step results as detached tensors + (`.detach().clone()`), and convert to Python or files after the run. + +### Template + +This hook records a per-graph quantity every N steps and stops graphs that +cross a threshold. It was run against `main`: + +```python +class PerGraphStopHook: + stage = DynamicsStage.AFTER_STEP + frequency = 25 # every 25 steps + + def __init__(self, threshold): + self.threshold = threshold + self.history = [] # (step, [B] tensor) + + def __call__(self, ctx, stage): + b = ctx.batch + idx = b.batch_idx.long() + per_atom = 0.5 * b.atomic_masses * (b.velocities ** 2).sum(-1) # [V] + value = torch.zeros(b.num_graphs, dtype=per_atom.dtype, + device=per_atom.device).index_add_(0, idx, per_atom) + value = value / b.num_nodes_per_graph # [B] + self.history.append((ctx.step_count, value.detach().clone())) + active = ctx.active_graph_mask + if active is None: + active = torch.ones_like(value, dtype=torch.bool) + stop = active & (value > self.threshold) + status = b.status.view(-1)[: b.num_graphs] + done = torch.full_like(status, ctx.workflow.exit_status) + status.copy_(torch.where(stop, done, status)) +``` + +Replace the quantity with your own per-graph reduction built the same way: +per-atom values, then `index_add_` (sums, means) or `scatter_reduce_` +(max, min) over `batch_idx`. Before `run()` on a plain engine: +`batch["status"] = torch.zeros(batch.num_graphs, 1, dtype=torch.long, device=batch.device)`. +Register with `dynamics.register_hook(hook)` or `hooks=[...]`. + +Hooks that fire at several stages define `_runs_on_stage(stage) -> bool`. +Hooks that hold files implement `__enter__` and `__exit__`; the engine +enters and exits them in `run()`. Restartable training hooks implement +`state_dict` and `load_state_dict` (`CheckpointableHook`). A hook whose state +changes during the run (deposited hills, an adaptive parameter) follows +`StatefulHook` from `nvalchemi.hooks`: set `read_only = False` and add +`commit()`. Engines that evaluate one step twice use `read_only` to avoid a +double update. See [enhanced_sampling.md][doc-es] (Adaptive biases). +`save_checkpoint` in `nvalchemi/_checkpoint.py` saves any such hook. + +## Custom integrators and optimizers + +Subclass `BaseDynamics` and override only `pre_update(batch)` and +`post_update(batch)`. The base class runs the model, hooks, convergence, and +the step loop. Do not override `step`, `run`, or `compute`. This velocity +Verlet works alone and inside a `FusedStage`; it was run against `main`: + +```python +class VelocityVerlet(BaseDynamics): + __needs_keys__ = {"forces"} # model outputs it reads + __provides_keys__ = {"positions", "velocities"} # fields it writes + + def __init__(self, model, dt, **kwargs): + super().__init__(model=model, **kwargs) # forwards n_steps, hooks, ... + self.dt = fs_to_internal_time(dt) # fs -> kernel time unit + + def pre_update(self, batch): + with torch.no_grad(): + m = batch.atomic_masses.unsqueeze(-1) + batch.velocities.add_(0.5 * self.dt * batch.forces / m) + batch.positions.add_(self.dt * batch.velocities) + + def post_update(self, batch): + with torch.no_grad(): + m = batch.atomic_masses.unsqueeze(-1) + batch.velocities.add_(0.5 * self.dt * batch.forces / m) +``` + +Imports: `from nvalchemi.dynamics.base import BaseDynamics` and +`from nvalchemi.dynamics._units import fs_to_internal_time`. + +- Update tensors in place inside `torch.no_grad()`. The base step does not + turn off autograd for you. +- Use `batch.atomic_masses`, not `masses`. +- Convert `dt` from fs with `fs_to_internal_time`, as the shipped + integrators do, so velocities stay in sqrt(eV/amu) and match + `initialize_velocities` and the thermostats. +- Inside a `FusedStage`, the base class masks your updates to the graphs + your stage owns. You do not mask by hand. +- Per-system state (thermostat variables) goes in instance attributes or the + `_state` mechanism the shipped integrators use; see `nve.py` and + `nvt_langevin.py`. +- Under domain decomposition, per-atom updates are safe, but global + reductions (total kinetic energy, temperature, FIRE dot products) need the + `HookScope.GLOBAL` pattern in [distributed.md][doc-dd]. + +Check: NVE total energy (potential plus `0.5 * m * v**2`, summed per graph) +stays flat over a few hundred small steps, and `relax + VelocityVerlet(...)` +runs with all graphs reaching `exit_status`. + +## Custom loss terms + +Subclass `BaseLossFunction` (`nvalchemi.training`) and override +`compute_residual(pred, target, valid)`. Set `target_key` and +`prediction_key` so `ComposedLossFunction` can route tensors. Override +`mask` to drop invalid entries, `normalize` for per-atom scaling, and +`reduce` for graph-balanced means (`per_graph_sum`, `per_graph_mean` in +`nvalchemi/training/losses/reductions.py`). Zero invalid entries in +`compute_residual` with `torch.where(valid, ..., 0)`. Hooks that receive +`**kwargs` must accept them, because composition forwards batch metadata. + +## Custom biases + +Subclass `ConservativeBias` (`nvalchemi.enhanced_sampling`), call +`super().__init__(name=...)`, and implement `energy(batch) -> [B, 1]`. +Forces and stress come from autograd. Keep data-dependent Python branches +out of `energy()` if you set `compile_biases=True`; put validation in a +`forward()` override that calls `super().forward(data)`. Run it with +`EnhancedSampling(biases={name: bias}, ...)` as in +`references/dynamics-optimization.md`. + +## Reporting and observability + +- Live dashboards and TensorBoard: register one + `ReportingOrchestrator([RichReporter(...), TensorBoardReporter(dir)], + stages={...}, frequency=N)` as a hook (from `nvalchemi.hooks`). Reporters + are owned by the orchestrator; do not register them directly. +- Dynamics per-system rows: `LoggingHook(backend="csv", ...)` from + `nvalchemi.dynamics.hooks`. Do not reuse it as a training logger. +- Training: `stages={"AFTER_OPTIMIZER_STEP"}` for loss and learning rate. +- Under DDP, rendering and writing stay on rank 0, but a reporter with + `rank_reduction="mean"` (for a global loss curve) runs a collective: every + rank must reach it, with the same scalar keys. Do not skip nonzero ranks + before the orchestrator. Give each rank its own `LoggingHook` path. +- Find slow stages with `StageTimingHook` (per-stage timing, NVTX ranges); + use `TorchProfilerHook` for kernel-level traces. Both are in + `nvalchemi.dynamics.hooks`. See [reporting.md][doc-rep], [hooks.md][doc-hooks]. +- Extra metrics: `custom_scalars={"name": callable}`; keep the callable cheap. + +## Dynamics stages on different GPUs + +`relax + md` fuses stages on one GPU. `relax | md` (dynamics engines) builds a +`DistributedPipeline`: one stage per rank, converged systems sent to the next +rank. Every stage needs a `buffer_config=BufferConfig(...)` (from +`nvalchemi.dynamics.base`), identical across adjacent stages. A plain stage's +`n_steps` does not graduate systems in a pipeline; wrap fixed-length stages in +a `FusedStage`. This `|` differs from the generative `gen | stage` pipeline. +Details: [dynamics.md][doc-dyn], example [01_distributed_pipeline.py][ex-pipe]. + +## Domain decomposition across GPUs + +- `DomainParallel(dynamics=integrator, config=DomainConfig(cutoff=..., + skin=..., mesh=...))` splits one large system over ranks. Launch one process + per GPU with `torchrun`. +- Choose the strategy in `DomainConfig.strategy`: halo (default) for models + with a fixed cutoff that accept a padded view (MACE, LJ, Ewald, PME); + graph partition for models that build their own graph inside `forward` + (UMA). +- A custom model declares `distribution_spec()` returning a preset such as + `SPEC_MPNN_HALO` (autograd-force message passing) or an `MLIPSpec` with + adapters for opaque custom ops. Check it on one CUDA GPU with + `trace_and_validate(model_factory, sample_batch, world_size=2)`, where the + factory returns a fresh wrapper and the small batch is on `cuda`. +- Under halo decomposition a message-passing `forward` must rebind scatter + results (`ae = ae.scatter_add_(...)`, use the returned tensor), drop + neighbor indices `>= n_atoms` from padding, and return per-atom energies for + all local atoms, ghosts included. Missing these gives wrong energies, not an + error. Reference: [distributed_byo.md][doc-byo] and + [04_byo_pytorch_mpnn.py][ex-byo]. +- Neighbor-list hooks go on the inner integrator; trajectory and logging + hooks go on the outer `DomainParallel` with `HookScope.RANK_ZERO` or + `HookScope.GLOBAL`. +- `FIRE2` does not declare its global reductions yet. Use `FIRE` for + relaxation under `DomainParallel`. `FIRE` is deprecated and warns on + construction, but this is the one place it is still the right choice. +- Set `reprime_on_entry=True` on the wrapped dynamics, not on + `DomainParallel`. The wrapper raises `TypeError`. +- Write the scripts and launch commands; do not start multi-GPU runs without + the user's go-ahead. + +## Common mistakes + +- Writing a new hook where `FreezeAtomsHook`, `NaNDetectorHook`, + `EnergyDriftMonitorHook`, `LoggingHook`, or `SnapshotHook` already fits. +- Per-instance `self.frequency` set from a constructor argument while the + class attribute says something else, or `frequency = 1` with a manual + step counter. +- Python loops over graphs with `.item()` per graph. +- Writing `status` for graphs that are no longer active. +- Overriding `step()` in a dynamics subclass. +- Integrators that read `masses` or skip `torch.no_grad()`. +- The deprecated `BiasedPotentialHook` for a new bias. + +## How to check the result + +- Hooks: run 2 to 3 graphs for a few hundred steps with `frequency = N`; + the recorded step numbers are multiples of `N`, values are per graph, and + stopped graphs keep their positions afterwards. +- Integrators: energy conservation under NVE, and the fused-stage run above. +- Losses: a hand-computed value on a two-graph batch matches the loss. +- Biases: finite-difference forces of `energy()` match the bias forces. +- Domain decomposition: `trace_and_validate` passes, and a short run matches a + single-process run of the same system. + +[doc-hooks]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/hooks.md +[doc-sims]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_simulations.md +[doc-dyn]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics.md +[doc-loss]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/losses.md +[doc-es]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/enhanced_sampling.md +[doc-rep]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/reporting.md +[doc-dd]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/distributed.md +[doc-byo]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/distributed_byo.md +[api-hooks]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/modules/hooks.rst +[api-dyn]: https://github.com/NVIDIA/nvalchemi-toolkit/tree/v0.3.0/docs/modules/dynamics +[api-dist]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/modules/distributed.rst +[ex-hook]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/02_custom_hook.py +[ex-conv]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/03_custom_convergence.py +[ex-integ]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/05_custom_integrator.py +[ex-rmsd]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/15_rmsd_metadynamics.py +[ex-rich]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/07_rich_training_reporting.py +[ex-pipe]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/distributed/01_distributed_pipeline.py +[ex-dd]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/distributed/03_mace_nvt_distributed.py +[ex-byo]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/distributed/04_byo_pytorch_mpnn.py diff --git a/skills/nvalchemi-toolkit/references/data.md b/skills/nvalchemi-toolkit/references/data.md new file mode 100644 index 00000000..972cdad3 --- /dev/null +++ b/skills/nvalchemi-toolkit/references/data.md @@ -0,0 +1,261 @@ +# Data: atomic systems, batches, and storage + +This note covers `AtomicData` and `Batch`, conversion from ASE, Zarr storage, +and streaming data into a model or a training loop. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| `AtomicData`, `Batch`, field levels, groups | [data.md][doc-data] | [01_data_structures.py][ex-data] | `nvalchemi/data/atomic_data.py`, `nvalchemi/data/batch.py` | +| Writer, reader, dataset, loader | [datapipes.md][doc-pipes] | [02_trajectory_zarr_io.py][ex-zarr] | `nvalchemi/data/datapipes/` | +| Chunking, compression, throughput | [zarr_compression.md][doc-zarr] | none | `nvalchemi/data/datapipes/backends/zarr.py`, `nvalchemi/data/io_test.py` | +| Trajectory sinks during dynamics | [dynamics_sinks.md][doc-sinks] | [02_trajectory_zarr_io.py][ex-zarr] | `nvalchemi/dynamics/sinks.py` | +| ASE conversion | [data.md][doc-data] (ASE section) | [03_ase_integration.py][ex-ase] | `AtomicData.from_atoms` in `atomic_data.py` | +| Units and sign conventions | [conventions.md][doc-conv] | none | `nvalchemi/dynamics/_units.py` | + +API reference sources: [docs/modules/data.rst][api-data]. + +## Which component for which need + +| Need | Component | +| --- | --- | +| One structure | `AtomicData(positions=..., atomic_numbers=..., ...)` | +| Many structures in one GPU pass | `Batch.from_data_list([...])` | +| Structures from ASE or extxyz | `AtomicData.from_atoms(atoms)` per frame, then `Batch` | +| Tag images of one path, or replicas of one system | `batch.set_group_layout(group_idx)` | +| Per-group reductions and broadcasts | `batch.group_layout` (a `GroupLayout`: `reduce_all`, `reduce_any`, `broadcast`, `node_to_group`) | +| Tile a periodic structure | `make_supercell(data, repeats)` (`nvalchemi.data.transforms`) | +| Keep a float64 label in a float32 dataset | `AtomicData.precision_preserving_keys = frozenset({"energy"})`, see [data.md][doc-data] | +| Batch from trusted raw tensors, no validation | `Batch.from_raw_dicts([...], device=...)` | +| Fixed-capacity buffer for moving graphs | `Batch.empty(num_systems=..., num_nodes=..., num_edges=..., template=...)`, then `buffer.put(src, mask)` | +| Save structures or labels to disk | `AtomicDataZarrWriter(path).write(...)` | +| Add more frames to an existing store | `AtomicDataZarrWriter(path).append(...)` | +| Raw tensors per sample | `AtomicDataZarrReader(path)` | +| Check a store's fields or repair state | `reader.schema()`, `reader.level_sizes()`, `reader.check_integrity()` | +| `AtomicData` per sample, device transfer, prefetch | `Dataset(reader, device=...)` | +| Batches for training or inference | `DataLoader(dataset, batch_size=...)` | +| Small store that fits in host memory | `InMemoryDataset(reader=reader, device=device)` | +| A few hundred frames already in memory | `InMemoryDataset(batch, device=device)` | +| Several stores behind one index | `MultiDataset(ds_a, ds_b)` with `MultiDatasetBatchSampler` | +| Snapshots during dynamics | `ZarrData` or `HostMemory` sink with `SnapshotHook` | +| A storage format the toolkit lacks | Subclass `Reader` (`nvalchemi/data/datapipes/backends/base.py`) | + +Imports: `from nvalchemi.data import AtomicData, Batch` and +`from nvalchemi.data.datapipes import AtomicDataZarrWriter, +AtomicDataZarrReader, Dataset, DataLoader`. + +## How the pieces connect + +```text +ASE Atoms / tensors -> AtomicData -> Batch.from_data_list -> model or dynamics + \-> AtomicDataZarrWriter -> store.zarr +store.zarr -> AtomicDataZarrReader -> Dataset -> DataLoader -> Batch +``` + +- `AtomicData` holds one graph. Fields have a level: node (`positions`, + `atomic_numbers`, `atomic_masses`, `forces`, `velocities`), edge + (`neighbor_list`, `shifts`), and system (`cell`, `pbc`, `energy`, + `stress`). System fields carry a leading dimension of 1, for example + `energy` is `[1, 1]` and `cell` is `[1, 3, 3]`. +- `Batch` concatenates graphs. `batch.batch_idx` maps each atom to its graph; + `batch.num_nodes_per_graph` gives atom counts. Use them for per-graph + reductions instead of Python loops. +- The `DataLoader` yields `Batch` objects. `Dataset.load_batches(...)` is the + explicit batch read. +- Dynamics sinks (`ZarrData`) write stores that the same reader reads back. + +## Keep hot paths on `Batch` + +`AtomicData` is a Pydantic model. It validates every field each time you +build one. Use it to get checked input at setup: from ASE, from user +tensors, or for a few test structures. Do not build it inside a step loop, a +data-loading loop, or per-sample code in a training or dynamics loop. + +Hot paths stay on `Batch`: + +- Work on batch tensors. Reduce per graph with `batch.batch_idx` and + `batch.num_nodes_per_graph`. +- Move graphs between batches with `Batch.empty(...)` buffers, + `buffer.put(src, mask)`, and `batch.index_select(idx)`. `put` appends after + the graphs already stored. Read `copied_mask` to see which source graphs + fit. Since 0.3.0 it needs no `dest_mask`. That argument is ignored and + warns. +- Build batches from trusted tensors with `Batch.from_raw_dicts(...)`. It + skips `AtomicData` construction and validation. +- Read toolkit-written stores with `Dataset(..., skip_validation=True)`. +- Do not call `batch.get_data(i)`, `batch.to_data_list()`, or + `batch.append_data(...)` in a loop. Each one builds `AtomicData` objects. + Use them at setup or in the final report. + +## Field names that trip agents up + +**Masses are `atomic_masses`.** There is no `masses` field or alias. +`batch.masses` raises `AttributeError`. `AtomicData` fills `atomic_masses` +from the periodic table when you do not pass it. Integrator and thermostat +code must read `batch.atomic_masses` (shape `[V]`, unsqueeze to `[V, 1]` to +divide forces). + +**Labels stored under other names.** `from_atoms` reads `energy` from +`atoms.info` and `forces` from `atoms.arrays` by default. When the file uses +other names, pass them: +`AtomicData.from_atoms(atoms, energy_key="dft_energy", forces_key="dft_forces")`. +Do not set `data.energy` or `data.forces` by hand. For a few hundred labelled +frames, build one `Batch` and wrap it in +`InMemoryDataset(batch, device=device)`. You do not need a Zarr store. + +**Velocities are not read from files.** `AtomicData.from_atoms` copies +positions, numbers, cell, pbc, and optional energy, forces, stress, and +charges. It does not read velocities or momenta, even when the ASE object or +the extxyz file stores them. The result has zero velocities. Set them +yourself after conversion: + +```python +import torch +from ase.io import read +from nvalchemi.data import AtomicData + +frames = read("input.extxyz", index=":") +data_list = [] +for atoms in frames: + data = AtomicData.from_atoms(atoms) + # ASE velocities are in Å per ASE time unit, which equals the toolkit's + # sqrt(eV/amu); get_velocities() derives them from stored momenta / masses. + v = torch.as_tensor(atoms.get_velocities(), dtype=data.positions.dtype) + data.velocities = v + data_list.append(data) +``` + +If the file stores velocities in Å/fs instead, multiply by the toolkit time +factor (`FS_PER_INTERNAL_TIME` in `nvalchemi/dynamics/_units.py`, about +10.18). Check the file's convention before you convert. To draw thermal +velocities instead, use `nvalchemi.dynamics.initialize_velocities`. + +**Dynamics output buffers.** Integrators write `forces` and `energy` in place. +`from_atoms` leaves them `None` when the file has no labels. Most engines +allocate them on the first step, but scripts that read `batch.forces` before +the first step, and some strategies (enhanced sampling needs `stress` for +periodic biased runs), expect them. The safe pattern from the ASE example: + +```python +n = data.num_nodes +data.forces = torch.zeros(n, 3) +data.energy = torch.zeros(1, 1) +``` + +**Atom categories.** `from_atoms` does not set `atom_categories`. Hooks that +act on a subset (for example `FreezeAtomsHook`) read +`atom_categories == AtomCategory.SPECIAL.value` (from `nvalchemi._typing`). +Set it from ASE tags or indices after conversion. + +**Custom per-system or per-atom data.** A plain assignment of an unknown key +on a `Batch` (`batch.foo = t`) is stored as a system-level field, so a `[B, 1]` +tensor survives `to_data_list()` and sinks. For per-atom or per-edge data use +`data.add_node_property(name, t)` or `batch.add_key(name, values, +level="node")`, so the level is explicit. + +**Groups.** `batch.set_group_layout(group_idx)` needs each group's graphs to +be contiguous. Set groups through it, not by assigning `batch.group_idx`. +The `batch.group_layout` property is cached: after an in-place edit such as +`batch.group_idx[3] = 2`, call `set_group_layout` again. Grouped batches +reject `put()` and `append_data()`; use `append()` with another grouped +batch. See [data.md][doc-data] (Grouping graphs). + +## Storage patterns + +Write once, then append: + +```python +from nvalchemi.data.datapipes import AtomicDataZarrWriter + +writer = AtomicDataZarrWriter("frames.zarr") +writer.write(data_list[:100]) # creates the store; a second write() raises +writer.append(data_list[100:]) # adds to it +``` + +`write()` raises `FileExistsError` when the store exists. Pick `append()` or a +new path on purpose, so the script can be rerun. + +Stream it back in batches: + +```python +from nvalchemi.data.datapipes import AtomicDataZarrReader, DataLoader, Dataset + +device = torch.device("cuda" if torch.cuda.is_available() else "cpu") +dataset = Dataset(AtomicDataZarrReader("frames.zarr"), device=device) +loader = DataLoader(dataset, batch_size=64, shuffle=True) +for batch in loader: + ... +``` + +Use the same `device` for the model and the training strategy. For in-memory +structures, use `Batch.from_data_list(data_list).to(device)` once at setup. + +To mix stores, wrap them in `MultiDataset` and pick the mixture with +`MultiDatasetBatchSampler.balanced(dataset, batch_size=..., epoch_policy=...)`: +`"min_size"` ends the epoch at the smallest store, `"max_size"` covers the +largest and resamples the others (`replacement=True`). For fixed ratios, pass +`samples_per_dataset` to `MultiDatasetBatchSampler`. Details in +[datapipes.md][doc-pipes]. + +Do not hand-write a loop that opens Zarr arrays and builds `AtomicData` per +sample. The reader, dataset, and loader handle offsets, device transfer, and +prefetching. + +## Throughput tuning + +Start here when a training or inference loop waits on data: + +- `Dataset(..., skip_validation=True)` for stores written by the toolkit. It + skips per-sample validation. Keep validation on for third-party stores. +- `DataLoader(..., pin_memory=True)` for CUDA targets. +- `prefetch_factor` fuses that many batches into one backend read. Shuffled + reads gain most (16 to 64). Sequential reads need 2 to 4. `0` turns fused + prefetch off. +- `num_workers=1` on `Dataset` is usually enough; concurrent Zarr reads + contend. +- Chunk and shard sizes are set at write time with + `ZarrWriteConfig(core=ZarrArrayConfig(...))`. `chunk_size` counts rows on + the atom or edge axis, not structures. +- Measure with the `nvalchemi-io-test` command (`roundtrip` or `read` + subcommands) and sweep `--prefetch-factor` before you change chunking. + +The tuning guide has the numbers: [zarr_compression.md][doc-zarr]. + +## Common mistakes + +- Looping over structures and running one model call or one dynamics run per + structure. Build one `Batch`. +- Reading `masses` instead of `atomic_masses`. +- Assuming `from_atoms` keeps velocities from an extxyz file. +- Writing to an existing store with `write()`. +- Building `energy` as shape `[1]` or `[B]`. The batch convention is + `[B, 1]`; single-graph `AtomicData` uses `[1, 1]`. +- Mixing devices: build on CPU, then move the whole batch with `.to(device)`. +- Building `AtomicData` per sample or per step in a hot loop. Stay on + `Batch` (see "Keep hot paths on `Batch`"). +- Passing `dest_mask=` to `Batch.put`. It is deprecated and ignored. +- Source and buffer with different dtypes for one field. `Batch.put` needs + the same dtype on both sides. + +## How to check the result + +- Print `batch.num_graphs`, `batch.num_nodes`, and + `batch.num_nodes_per_graph`; they must match the input frames. +- Round-trip: `Batch.from_data_list(batch.to_data_list())` keeps positions, + numbers, and custom keys. +- After writing a store, open it with `AtomicDataZarrReader` and compare + `len(reader)` and one sample's positions with the source. +- After converting from a file, compare `data.velocities` with the file's + velocities for one frame, and kinetic energy + `0.5 * (m * v**2).sum()` with the file's value if it stores one. + +[doc-data]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/data.md +[doc-pipes]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/datapipes.md +[doc-zarr]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/zarr_compression.md +[doc-sinks]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_sinks.md +[doc-conv]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/about/conventions.md +[api-data]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/modules/data.rst +[ex-data]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/01_data_structures.py +[ex-zarr]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/02_trajectory_zarr_io.py +[ex-ase]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/03_ase_integration.py diff --git a/skills/nvalchemi-toolkit/references/dynamics-optimization.md b/skills/nvalchemi-toolkit/references/dynamics-optimization.md new file mode 100644 index 00000000..3f8de198 --- /dev/null +++ b/skills/nvalchemi-toolkit/references/dynamics-optimization.md @@ -0,0 +1,381 @@ +# Dynamics and optimization + +This note covers relaxation, molecular dynamics, chained stages, built-in +hooks, reaction paths (NEB), and biased sampling. Writing a new hook, +integrator, or bias is in +`references/composition-and-extension.md`. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| Execution loop, `FusedStage`, compile, pipelines | [dynamics.md][doc-dyn] | [01_multistage_pipeline.py][ex-multi] | `nvalchemi/dynamics/base.py` | +| Optimizers and integrators | [dynamics_simulations.md][doc-sims] | [02_geometry_optimization.py][ex-opt], [05_nvt_langevin.py][ex-nvt], [04_nve_energy_conservation.py][ex-nve] | `nvalchemi/dynamics/optimizers/`, `nvalchemi/dynamics/integrators/` | +| NPT | [dynamics_simulations.md][doc-sims] | [03_npt_barostat_validation.py][ex-npt] | `nvalchemi/dynamics/integrators/npt.py` | +| Hooks and convergence | [hooks.md][doc-hooks] | [05_safety_and_monitoring.py][ex-safety], [03_custom_convergence.py][ex-conv] | `nvalchemi/dynamics/hooks/`, `nvalchemi/hooks/` | +| Freezing atoms, ASE input | [hooks.md][doc-hooks] | [03_ase_integration.py][ex-ase] | `nvalchemi/dynamics/hooks/freeze.py` | +| Trajectory sinks | [dynamics_sinks.md][doc-sinks] | [02_trajectory_zarr_io.py][ex-zarr] | `nvalchemi/dynamics/sinks.py` | +| Inflight batching | [dynamics.md][doc-dyn] | [04_inflight_batching.py][ex-inflight] | `nvalchemi/dynamics/sampler.py` | +| Reaction paths, NEB | [dynamics_mep.md][doc-mep] | [11_batched_neb.py][ex-neb] | `nvalchemi/dynamics/mep/` | +| Restraints, umbrella, metadynamics, replica exchange | [enhanced_sampling.md][doc-es] | [12_umbrella_sampling.py][ex-umb], [13_replica_exchange.py][ex-rex], [14_metadynamics.py][ex-metad] | `nvalchemi/enhanced_sampling/` | +| L-BFGS relaxation | [dynamics_simulations.md][doc-sims] (L-BFGS) | [06_geometry_optimization_lbfgs.py][ex-lbfgs] | `nvalchemi/dynamics/optimizers/lbfgs.py` | +| Checkpoint and restore of a run's state | [enhanced_sampling.md][doc-es] (Checkpoint and restore) | none | `nvalchemi/_checkpoint.py`, `nvalchemi/enhanced_sampling/_runner.py` | + +API reference sources: [docs/modules/dynamics/][api-dyn]. + +## The two batched-run rules + +**Rule 1: one batch, one pass.** Put independent systems in one `Batch` and +run one optimizer or integrator over it. A Python loop with one run per +system is slower and drops per-system bookkeeping that hooks and stages rely +on. A plain engine checks convergence for the batch as a whole: it stops when +every system meets the criterion, and keeps moving the ones that already did. +To retire each system as it converges, wrap the engine in a `FusedStage` +(`FusedStage(sub_stages=[(0, opt)])` or `relax + md`), which gives every +system a `status`. + +**Rule 2: neighbor hooks before `run()`.** Any model with a cutoff needs its +neighbor list rebuilt before each force call. Register the hooks from +`model.make_neighbor_hooks()` (they target `BEFORE_COMPUTE`). For a +`FusedStage`, register them on the fused stage once; for a strategy +(`NEB`, `EnhancedSampling`) pass them as the strategy asks (see below). +Without them the model raises `KeyError: 'neighbor_matrix' required` or the +COO equivalent. + +## Which component for which need + +| Need | Component (classes ending in `Hook` from `nvalchemi.dynamics.hooks`, others from `nvalchemi.dynamics`, unless noted) | +| --- | --- | +| Fixed-cell relaxation | `FIRE2` (default) or `LBFGS` (fewer steps, costlier per step). `FIRE` is deprecated. | +| Relax positions and cell | `FIRE2VariableCell` or `LBFGSVariableCell` with `AlignCellHook`. The model must return `stress`. A `cell_force_scale` above 1 moves the cell less per step. | +| Relax a group of graphs as one unit | `LBFGS(by_group=True)` after `batch.set_group_layout(...)` | +| NVE | `NVE` | +| NVT | `NVTLangevin` (`temperature`, `friction`, `random_seed`) or `NVTNoseHoover` | +| NPT, NPH | `NPT`, `NPH`; model must return `stress` | +| Relax, then MD, per system | `relax + md` (a `FusedStage`) | +| Stop a system when converged | `ConvergenceHook.from_fmax(threshold)` or `ConvergenceHook(criteria=[...])` (from `nvalchemi.dynamics`); per-system only inside a `FusedStage` | +| Cap steps per system in a stage | `n_steps=N` on a sub-stage of a `FusedStage` (a per-system budget) | +| Stream many structures through a fixed GPU budget | `SizeAwareSampler` plus `refill_frequency` | +| Freeze a subset of atoms | `FreezeAtomsHook` (from `nvalchemi.dynamics.hooks`) | +| Stop on NaN or Inf | `NaNDetectorHook` | +| Clip huge forces | `MaxForceClampHook(max_force=...)` | +| Warn or stop on energy drift | `EnergyDriftMonitorHook(threshold=..., action="warn" or "raise")` | +| Per-system CSV rows | `LoggingHook(backend="csv", log_path=..., frequency=...)` | +| Save frames | `SnapshotHook(sink=ZarrData(path) or HostMemory(capacity), frequency=...)` | +| Save the final converged frame | `ConvergedSnapshotHook(sink=...)` | +| Wrap atoms back into the cell | `WrapPeriodicHook` (from `nvalchemi.hooks`); not with L-BFGS | +| Stability metrics over a run | `StabilityMonitor` (`nvalchemi.dynamics.hooks`) | +| Swap replicas between temperatures | `ReplicaExchange` with `ThermodynamicState` in enhanced sampling | +| Swap per-system state with your own acceptance rule | `PairSwapHook(accept_fn=..., params_fn=..., slot_field=..., n_slots=...)`. The engine must implement `apply_per_system_params` (`NVTLangevin`, `NVTNoseHoover` do) | +| Resume an enhanced-sampling run exactly | `sampling.checkpoint(path)` at an epoch boundary, then `restore(path)` on a rebuilt `EnhancedSampling`. Model weights are not saved. | +| Save engine, hook, and batch state for your own workflow | `save_checkpoint(path, {"md": engine, ...}, batch=batch)` and `load_checkpoint` from `nvalchemi._checkpoint`. Any object with `state_dict`/`load_state_dict` works, including `BaseDynamics` | +| Refresh forces when a graph enters a stage | `reprime_on_entry=True` on that stage's dynamics, not on the `FusedStage`. See [dynamics.md][doc-dyn]. | +| Find slow stages; NVTX ranges | `StageTimingHook`; full PyTorch traces: `TorchProfilerHook` | +| Different stages on different GPUs | `stage_a \| stage_b` builds a `DistributedPipeline`; see `references/composition-and-extension.md` | +| Thermal starting velocities | `initialize_velocities(v, masses, T, batch_idx_int32, ...)` | +| Minimum-energy path | `nvalchemi.dynamics.mep.NEB` | +| Different NEB force equation or spring policy | `method=` (`TorchNEBMethod` callable or Warp `NEBMethod`), `spring=` (`SpringConfig`); see [dynamics_mep.md][doc-mep] | +| Restraint, umbrella window, wall, metadynamics | `nvalchemi.enhanced_sampling` biases run by `EnhancedSampling` | +| Behavior none of these cover | A custom hook, see `references/composition-and-extension.md` | + +Units: positions in Å, energies in eV, `dt` in fs, `temperature` in K, +`friction` in 1/fs, pressure in eV/ų. Velocities are stored in sqrt(eV/amu). + +## How the pieces connect + +```text +step(): BEFORE_STEP + BEFORE_PRE_UPDATE -> pre_update() -> AFTER_PRE_UPDATE + BEFORE_COMPUTE (neighbor list) -> model -> AFTER_COMPUTE (freeze, clamp, NaN) + BEFORE_POST_UPDATE -> post_update() -> AFTER_POST_UPDATE (wrap) + AFTER_STEP (logging, snapshots, drift) -> convergence -> ON_CONVERGE +run(): repeats step() until n_steps or every system converged +``` + +- Each hook declares `stage` and `frequency`; it fires when + `step_count % frequency == 0`. Hooks at the same stage fire in + registration order. +- `relax + md` builds a `FusedStage`. Each system carries `status`. Stage `i` + owns systems with `status == i`. When a system converges in stage `i`, or + uses up that stage's `n_steps`, it moves to `i + 1`. One model call per step + covers all stages. +- A plain engine has `exit_status = 1`. A `FusedStage` of `k` stages has + `exit_status = k`. A system at `status >= exit_status` is frozen. +- Strategies (`NEB`, `EnhancedSampling`) build the engine for you and add + their own hooks; you pass extra hooks to them. + +## Relax then MD for many systems + +```python +relax = FIRE2(model=model, dt=0.1, n_steps=200, + convergence_hook=ConvergenceHook.from_fmax(0.05)) +md = NVTLangevin(model=model, dt=1.0, temperature=300.0, friction=0.01, + random_seed=0, n_steps=500) # per-system MD budget +fused = relax + md +for hook in model.make_neighbor_hooks(): + fused.register_hook(hook) +with fused: + batch = fused.run(batch, n_steps=2000) # overall cap +``` + +The `n_steps` on the MD stage is a per-system budget: each system gets that +many MD steps after it leaves relaxation, then graduates. Always give the +last stage either a budget or a convergence criterion, and give `run()` an +overall cap, or a stage with no exit runs forever. + +Check `batch.status` after the run. All systems at `exit_status` means each +finished both stages. + +## Running without a C++ compiler + +`NeighborListHook.__call__` is decorated with `torch.compile`. On a machine +without a working C++ toolchain, the first dynamics step fails with +`InductorError: InvalidCxxCompiler: No working C++ compiler found`. Do not +patch the hook. Run eagerly, and say so in the script: + +```python +import torch + +# NeighborListHook is torch.compile'd; this machine has no C++ compiler. +torch.compiler.set_stance("force_eager") +``` + +Put this before the first dynamics step. Setting the environment variable +`TORCHDYNAMO_DISABLE=1` before Python starts has the same effect. Results are +the same; only speed changes. Do not call `fused.compile(...)` in that mode. + +## Built-in hooks: reuse before you write + +Most per-step needs have a shipped hook. Check this list before you write a +class: + +- `FreezeAtomsHook()` freezes atoms with + `atom_categories == AtomCategory.SPECIAL.value`, or the atoms in a boolean + node mask named by `mask_key`. It restores positions and zeros their + forces and velocities. Register the same instance on every stage that must + keep them frozen. +- `NaNDetectorHook()` raises `RuntimeError` with the bad graph indices. +- `EnergyDriftMonitorHook(threshold=..., metric="per_atom_per_step", + action="warn")` tracks total-energy drift. `action="raise"` stops the run. + It does not support status-filtered batches yet. +- `LoggingHook` writes per-system rows; `by_group=True` writes per group. +- `ConvergenceHook` takes `criteria` with `key`, `threshold`, `reduce_op`, + `reduce_dims`, or a `custom_op` that returns a per-graph boolean. + +A hook that runs every N steps declares `frequency = N` as a class +attribute, and it must skip inactive graphs (read `ctx.active_graph_mask`). +The full checklist for new hooks is in +`references/composition-and-extension.md`. + +## Stopping individual systems + +A plain engine (not a `FusedStage`) does not create a `status` column. A hook +that writes `batch.status` on a plain engine needs one first: + +```python +batch["status"] = torch.zeros(batch.num_graphs, 1, dtype=torch.long, + device=batch.device) +``` + +Then set a system's status to `ctx.workflow.exit_status` to stop it. The +engine treats graphs at `status >= exit_status` as no-ops for the rest of the +run. A plain engine still runs to its `n_steps` (it exits early only through +its `ConvergenceHook`), so keep `n_steps` bounded. Inside a `FusedStage`, +`ctx.workflow` is the stage that owns the hook, so register such a hook on +the fused stage to use the fused `exit_status`. + +Prefer `ConvergenceHook` for a force threshold. For a missing stop condition, +keep the per-graph decision as a GPU mask. This hook takes an already computed +per-graph Boolean from `stop_mask(ctx)`; that callable must use only tensor +operations and return shape `[B]` on `ctx.batch.device`: + +```python +class MaskStopHook: + stage = DynamicsStage.AFTER_STEP + frequency = 25 + + def __init__(self, stop_mask): + self.stop_mask = stop_mask + + def __call__(self, ctx, stage): + stop = self.stop_mask(ctx) + if ctx.active_graph_mask is not None: # Python metadata, not a tensor test + stop = stop & ctx.active_graph_mask + status = ctx.batch.status.view(-1)[:ctx.batch.num_graphs] + done = torch.full_like(status, ctx.workflow.exit_status) + status.copy_(torch.where(stop, done, status)) +``` + +Register it on the engine that owns the exit status. No `if stop.any()`, +`bool(stop.all())`, or per-step conversion of `batch.status` to host values. +For observations, retain detached tensor snapshots and convert after the run, +or use `LoggingHook` / `SnapshotHook` with `frequency > 1`. Only report on the +host at those scheduled checks, not in every step. The complete reduction and +history pattern is in `references/composition-and-extension.md`. + +## Chaining a helper stage into a production stage + +Some workflows run a cheap helper (an analytic potential, a pre-relaxation, an +interpolation fix-up) before the physical model. Carry only the positions +(and cell, if it changed) into a fresh object for the production run: + +```python +prod = template.clone() # the batch you built for production +prod.positions.copy_(helper_out.positions) +prod.forces = torch.zeros_like(prod.positions) +prod.energy = prod.positions.new_zeros(prod.num_graphs, 1) +prod.velocities = torch.zeros_like(prod.positions) +``` + +Do not reuse the helper's output batch directly. Its `status`, neighbor data, +helper-specific fields, and optimizer state would leak into the production +run, and a fresh engine or strategy instance gives the production stage its +own optimizer history. + +## Reaction paths (NEB) + +- Build images with `interpolate_paths(initial, final, num_images=...)`. Each + path is one group in the batch; atoms must match by index. + `remove_translation_and_rotation=True` aligns the endpoints first. +- If linear interpolation puts atoms on top of each other, refine with IDPP: + `prepare_idpp_targets(paths.clone())`, run + `NEB(model=IDPPModel(), ...)`, then carry only the positions into a new + batch for the real model, as in the chaining pattern above. +- Run `NEB(model=..., spring=..., climbing=..., fmax=..., n_steps=...)`. + `NEB` builds the neighbor hooks from `model.make_neighbor_hooks()` unless + you pass `neighbor_hooks=`. +- If the saddle point matters, use climbing-image NEB. Set + `ClimbingImageConfig(mode="after_regular", regular_fmax=...)`: let the band + relax to a modest force before climbing, rather than enabling climbing at + the start or while forces are still large. An early switch can oscillate + instead of converging. Choose the switching threshold above the final + `fmax`, then check that the regular band actually reaches it. +- Run the regular and climbing stages in one `NEB` call with + `mode="after_regular"`, so the switch follows the band's force. +- Bound each stage with `ClimbingImageConfig.max_regular_steps` and + `max_climbing_steps`. `NEB.n_steps` caps the whole run, not each stage. + Given agreed thresholds and budgets: + + ```python + from nvalchemi.dynamics.mep import ClimbingImageConfig, NEB + + neb = NEB(model=model, fmax=final_fmax, + n_steps=regular_budget + climbing_budget, + climbing=ClimbingImageConfig( + mode="after_regular", regular_fmax=switch_fmax, + max_regular_steps=regular_budget, + max_climbing_steps=climbing_budget)) + paths = neb.run(paths) + ``` + + Pick a `regular_fmax` that the regular stage can reach within + `max_regular_steps`. If the regular stage reaches its step cap above + `regular_fmax`, climbing starts from a poorly relaxed band and often ends + unconverged. Report the run as unconverged with its final fmax, and offer + a larger regular budget or a looser switch threshold for the next run. Do + not present that barrier as the answer. +- `interpolate_paths` drops `forces`, `energy`, and `velocities`. Reattach + them before any optimizer run. +- Read `batch.status` after the run and the diagnostics CSV + (`diagnostics_log_path=`): one row per path with `fmax`, `energy_barrier`, + and `path_length`. Use `diagnostics_frequency > 1` for periodic logging. + With step budgets, "finished" does not mean converged; check `fmax`. +- Report the forward barrier (highest interior energy minus the initial + endpoint energy), the final force in eV/Å, and whether each path converged. + CSV `energy_barrier` uses the lower endpoint, so it is not necessarily the + forward barrier. Do not report an unconverged estimate as a final barrier. + +## Restraints and biased sampling + +Use `nvalchemi.enhanced_sampling`, not `BiasedPotentialHook`. The hook is +deprecated: its bias adds no stress, so an NPT or NPH barostat does not see +it. `ConservativeBias` derives forces and stress from one energy function. + +```python +from nvalchemi.enhanced_sampling import ( + EnhancedSampling, HarmonicUmbrellaBias, pair_distance, +) + +bias = HarmonicUmbrellaBias(cv=lambda b: pair_distance(b, torch.tensor([i, j])), + centers=r0, stiffness=k, name="restraint") +sampling = EnhancedSampling( + model=model, engine=NVTLangevin, # the class, not an instance + engine_kwargs=dict(dt=0.5, temperature=T, friction=0.05), + biases={"restraint": bias}, + extra_hooks=list(model.make_neighbor_hooks()), +) +batch = sampling.run(batch, n_steps=n) +``` + +- `engine` takes any integrator class; pass its arguments in + `engine_kwargs`. Barostat runs (`NPT`, `NPH`) see the bias through its + stress. +- `pair_distance` takes atom indices local to each graph and returns `[B, 1]`. +- Periodic biased runs need a `stress` buffer on the batch + (`stress=torch.zeros(1, 3, 3)` per `AtomicData`) and a model with stress + active (`model.set_config("active_outputs", {"energy", "forces", "stress"})`). +- Other shipped biases: `UpperWall`, `LowerWall`, `FlatBottomRestraint`, + `WellTemperedMetaDynamicsBias`, `RMSDMetaDynamicsBias`, + `AdaptiveBiasingForce`. A custom bias subclasses `ConservativeBias`. + +## Common mistakes + +- One run per system in a Python loop (rule 1). +- No neighbor hooks, or hooks created but never registered (rule 2). +- `batch.masses` instead of `batch.atomic_masses`. +- Patching toolkit source to get past the compiler error instead of + running eagerly. +- Writing a new hook for freezing, NaN checks, drift, logging, or snapshots. +- A last stage with neither a budget nor a convergence criterion. +- `BiasedPotentialHook` for new work. +- NPT, NPH, or variable-cell runs with a model that does not return stress. +- `FIRE` or `FIREVariableCell` for new work. They are deprecated. Use `FIRE2` + or `LBFGS`. The one exception is `DomainParallel` (see the composition + note). +- `FusedStage.register_fused_hook()`. It is deprecated. Use + `register_hook()`. +- Passing `reprime_on_entry` to `FusedStage` or `DomainParallel`. Both raise + `TypeError`. Set it on the wrapped dynamics. It is a bool, not a set of + status codes. +- `save_checkpoint` drops batch fields the Zarr writer does not know. Name + custom per-graph fields in `batch_fields=`. +- `WrapPeriodicHook` with L-BFGS; it corrupts the curvature history. +- A long trajectory as a first test. Run tens of steps first. + +## How to check the result + +- Relaxation: per-system max force norm + (`forces.norm(dim=-1)` reduced per graph) below the threshold. In a + `FusedStage`, also check `batch.status` at `exit_status`. +- NVE: total energy drift per atom over the run is small compared with + `kT`; `EnergyDriftMonitorHook` reports it. +- NVT: mean kinetic temperature + `2 * KE / (3 * N * KB_EV)` near the target after equilibration + (`KB_EV` from `nvalchemi.dynamics`). +- NPT: volume settles and mean pressure is near the target. +- NEB: the climbing image's `fmax` below threshold, and a smooth energy + profile along the path. +- Bias: the collective variable's histogram centers on the restraint target. + +[doc-dyn]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics.md +[doc-sims]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_simulations.md +[doc-hooks]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/hooks.md +[doc-sinks]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_sinks.md +[doc-mep]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_mep.md +[doc-es]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/enhanced_sampling.md +[api-dyn]: https://github.com/NVIDIA/nvalchemi-toolkit/tree/v0.3.0/docs/modules/dynamics +[ex-opt]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/02_geometry_optimization.py +[ex-ase]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/03_ase_integration.py +[ex-nve]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/04_nve_energy_conservation.py +[ex-nvt]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/05_nvt_langevin.py +[ex-multi]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/01_multistage_pipeline.py +[ex-zarr]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/02_trajectory_zarr_io.py +[ex-npt]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/03_npt_barostat_validation.py +[ex-inflight]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/04_inflight_batching.py +[ex-safety]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/05_safety_and_monitoring.py +[ex-conv]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/03_custom_convergence.py +[ex-neb]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/11_batched_neb.py +[ex-umb]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/12_umbrella_sampling.py +[ex-rex]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/13_replica_exchange.py +[ex-metad]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/14_metadynamics.py +[ex-lbfgs]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/06_geometry_optimization_lbfgs.py diff --git a/skills/nvalchemi-toolkit/references/generative-workflows.md b/skills/nvalchemi-toolkit/references/generative-workflows.md new file mode 100644 index 00000000..343a9618 --- /dev/null +++ b/skills/nvalchemi-toolkit/references/generative-workflows.md @@ -0,0 +1,156 @@ +# Generative workflows + +This note covers sampling structures from a generative model with +`AtomisticGenerator`, filtering them with hooks, and sending them straight +into relaxation or MD. `TrainingStrategy` accepts only `BaseModelMixin` +energy models, so it rejects a `GenerativeModelMixin` network: train the +generative network with your own PyTorch loop (or wrap it in a +`BaseModelMixin` adapter), then hand it to a sampler. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| Driver, output contract, hooks, pipelines | [generative.md][doc-gen] | [09_generative_samplers.py][ex-gen] | `nvalchemi/gen/generator.py`, `pipeline.py`, `stages.py` | +| Model-side mixin and config | [generative.md][doc-gen] | [09_generative_samplers.py][ex-gen] | `nvalchemi/models/gen/base.py`, `demo.py` | +| Crystal structure prediction (a generator subclass) | [csp.md][doc-csp] | none | `nvalchemi/csp/` | +| Relaxing generated structures | [dynamics_simulations.md][doc-sims] | [02_geometry_optimization.py][ex-opt] | `nvalchemi/dynamics/` | + +API reference sources: [docs/modules/gen.rst][api-gen]. + +## Which component for which need + +| Need | Component | +| --- | --- | +| Run any sampler (diffusion, flow, GAN, VAE, random search) | `AtomisticGenerator(generator_func=...)` from `nvalchemi.gen` | +| The sampler itself | A callable `f(inputs=None, *, num_samples=1, rng=None, **kw) -> Batch` | +| A sampler that owns a trained network | A small class with `__call__`, plus `device`, `required_inputs`, `outputs` attributes | +| Declare what a generative network needs and makes | `GenerativeModelMixin` with `GenerativeModelConfig` (`nvalchemi.models.gen`) | +| Test models with no checkpoint | `DemoGANModel`, `DemoDiffusionModel` | +| Turn raw inputs into conditioning | `condition_func=` on the generator, or a `condition` attribute on the sampler | +| Drop bad candidates | A hook at `GenerationStage.AFTER_GENERATE` that replaces `ctx.batch` | +| Generate then relax or run MD | `gen | relax` builds a `GenerationPipeline` | +| Many batches in a loop | `gen.stream(inputs, max_batches=N, num_samples=k)` | +| Reproducible draws | `seed=` on the generator; use the `rng` you receive | +| Molecular crystal starting structures | `CSPGenerator` (`nvalchemi.csp`) with `OverlapReliefPacker` (`nvalchemi.csp.packer`) | +| Drop duplicate crystal candidates | `deduplicate_batch`, `deduplicate_stream` (`nvalchemi.csp.comparison`), or `DeduplicateHook` (`nvalchemi.csp.hooks`), see [csp.md][doc-csp] (Screen similar and duplicate structures) | +| Save a generator or pipeline recipe | `model_dump_json()` / `model_validate_json()`. Weights stay in the model checkpoint | +| PhysicsNeMo diffusion samplers | Call them inside your sampler; see the docs page | + +## How the pieces connect + +```text +inputs -> [BEFORE_CONDITION] condition() [AFTER_CONDITION] + -> generator_func(inputs, num_samples=..., rng=...) -> Batch + -> [AFTER_GENERATE hooks filter ctx.batch] -> Batch + -> next pipeline stage: dynamics.run(batch) or another callable +``` + +- The sampler owns the model and the sampling loop. The driver owns seeds, + device checks, hooks, sessions, and streams. +- Returning a `Batch` is the contract. Any other return type passes through + raw: no hooks, no device checks, and dynamics stages downstream reject it. +- In a pipeline, a stage with a `run()` method (any dynamics engine) runs to + completion on the batch; other callables are called with the batch. + +## Minimal sampler and pipeline + +This pattern was run against `main`: + +```python +def sample_fn(inputs=None, *, num_samples=1, rng=None, **kw): + dev = rng.device if rng is not None else "cpu" + pos = torch.randn(num_samples, n_atoms, 3, generator=rng, device=dev) * scale + z = torch.full((n_atoms,), atomic_number, dtype=torch.long, device=dev) + data = [AtomicData(positions=p, atomic_numbers=z) for p in pos] + return Batch.from_data_list(data) + +gen = AtomisticGenerator(generator_func=sample_fn, seed=0, + required_inputs=frozenset(), + outputs=frozenset({"positions", "atomic_numbers"})) +relax = FIRE2(model=model, dt=0.1, n_steps=200, + convergence_hook=ConvergenceHook.from_fmax(0.05)) +for hook in model.make_neighbor_hooks(): + relax.register_hook(hook) +with (gen | relax) as pipe: + relaxed = pipe(stage_kwargs=[{"num_samples": 8}, None]) +``` + +A generator used alone needs no declarations: `gen.sample(num_samples=8)` +returns the batch. + +## Points to get right + +- **Declare inputs and outputs for pipelines.** `gen | stage` fails at + construction with "missing declarations: required_inputs, outputs" unless + the generator or the sampler declares them. Set them on + `AtomisticGenerator(...)` or as attributes of the sampler object. +- **Use the `rng` argument** for every random draw, so `seed` makes runs + reproducible. Draw on `rng.device`. +- **Stay on the resolved device.** The returned batch must live on the + generator's device, or the call raises `ValueError`. A sampler object can + expose a `device` property. +- **Return a batch of `num_samples` graphs.** Batch first: do not loop and + call the generator once per structure. +- **Total rejection.** If a filter rejects everything, set + `ctx.batch = Batch.empty(num_systems=0, num_nodes=0, num_edges=0, + device=...)`. Downstream stages then skip that batch. Boolean indexing + that keeps zero graphs is not supported. +- **Conditioning does not enforce physics.** Put physical constraints in the + sampler (guidance), in filter hooks, or in a relaxation stage. +- **Bounded streams.** `iter(gen)` never ends. Use + `gen.stream(..., max_batches=N)`. +- **Compile the network, not the driver.** Building a `Batch` breaks + `torch.compile` graphs. Compile the model inside the sampler and keep the + sampler eager. +- **Relaxation needs model fields.** Generated batches usually carry only + positions and numbers (plus cell and pbc for crystals). Add `cell` and + `pbc` for periodic structures before relaxing, and register the model's + neighbor hooks (rule 2 in `references/dynamics-optimization.md`). + +## Filter hook pattern + +A filter hook follows the shared `Hook` protocol (`stage`, `frequency`, +`__call__(ctx, stage)`). Compute per-structure scores vectorized over the +batch with `batch.batch_idx`, then keep a boolean mask: + +```python +class KeepCompact: + stage = GenerationStage.AFTER_GENERATE + frequency = 1 + def __init__(self, max_radius): self.max_radius = max_radius + def __call__(self, ctx, stage): + b = ctx.batch + r = b.positions.norm(dim=-1) + rmax = r.new_zeros(b.num_graphs).scatter_reduce_( # same dtype as r + 0, b.batch_idx.long(), r, reduce="amax") + keep = rmax <= self.max_radius + ctx.accepted_mask = keep + ctx.batch = b[keep] if keep.any() else Batch.empty( + num_systems=0, num_nodes=0, num_edges=0, device=r.device) +``` + +## Common mistakes + +- Returning a list of `AtomicData` or a raw tensor instead of a `Batch`. +- Drawing noise with the global torch RNG instead of `rng`. +- Building a pipeline without `required_inputs` and `outputs` declarations. +- Unbounded `for batch in gen:` loops. +- Relaxing generated crystals without `cell`, `pbc`, or neighbor hooks. + +## How to check the result + +- `batch.num_graphs == num_samples` (before filtering), and atom counts per + graph as expected. +- Same `seed` gives the same positions on two runs; different seeds differ. +- No overlapping atoms: the minimum pair distance per structure is above a + sensible floor for the elements. +- After relaxation: per-structure max force below the threshold. A plain + optimizer does not add a `status` column, so check forces, not status. + +[doc-gen]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/generative.md +[doc-csp]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/csp.md +[doc-sims]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/dynamics_simulations.md +[api-gen]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/modules/gen.rst +[ex-gen]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/09_generative_samplers.py +[ex-opt]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/02_geometry_optimization.py diff --git a/skills/nvalchemi-toolkit/references/models.md b/skills/nvalchemi-toolkit/references/models.md new file mode 100644 index 00000000..e30526dc --- /dev/null +++ b/skills/nvalchemi-toolkit/references/models.md @@ -0,0 +1,225 @@ +# Models: loading, wrapping, and combining potentials + +This note covers the shipped model wrappers, wrapping your own PyTorch model so +dynamics and training can call it, combining models, and reading outputs and +embeddings. Domain-decomposition specs for your own model are in +`references/composition-and-extension.md`. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| Wrapper contract, `ModelConfig`, outputs | [models.md][doc-models] | [06_ddp_mlp_training.py][ex-mlp] (a small wrapped MLP), [04_byo_pytorch_mpnn.py][ex-byo] | `nvalchemi/models/base.py` | +| MACE | [models.md][doc-models] | [04_mace_nvt.py][ex-mace] | `nvalchemi/models/mace.py` | +| AIMNet2 and electrostatics | [models.md][doc-models] | [08_aimnet2_ewald_pipeline.py][ex-aimnet] | `nvalchemi/models/aimnet2.py`, `ewald.py`, `pme.py` | +| UMA (fairchem) | [models.md][doc-models] | [09_uma_nve.py][ex-uma] | `nvalchemi/models/uma.py` | +| Lennard-Jones, DFT-D3 | [models.md][doc-models] | [02_geometry_optimization.py][ex-opt] | `nvalchemi/models/lj.py`, `dftd3.py` | +| Combining models | [models.md][doc-models] (composition) | [07_composable_model_composition.py][ex-comp] | `nvalchemi/models/pipeline.py` | +| Test model with no extras | [models.md][doc-models] | [01_data_structures.py][ex-data] | `nvalchemi/models/demo.py` | + +API reference sources: [docs/modules/models.rst][api-models]. + +## Which component for which need + +| Need | Component | +| --- | --- | +| Quick test model, no extras, no neighbor list | `DemoModelWrapper(DemoModel())` (not physical) | +| Analytic pair potential for small tests | `LennardJonesModelWrapper(epsilon=..., sigma=..., cutoff=...)` | +| Pretrained MACE (MACE-MP, OFF) | `MACEWrapper.from_checkpoint(name_or_path, device=...)` | +| Pretrained AIMNet2 | `AIMNet2Wrapper.from_checkpoint(path, device=...)` | +| Pretrained UMA | `UMAWrapper.from_checkpoint(name_or_path, task_name=...)` | +| Dispersion or long-range electrostatics | `DFTD3ModelWrapper`, `EwaldModelWrapper`, `PMEModelWrapper` | +| Your own PyTorch model | Subclass `nn.Module` and `BaseModelMixin` | +| Sum independent models | `model_a + model_b` | +| One model's output feeds another (charges to Ewald) | `PipelineModelWrapper` with `PipelineGroup(use_autograd=True)` | +| Energy only, or energy plus stress | `model.set_config("active_outputs", {...})` | +| Hessians | `model.hessian_vector_product(batch, v)`, `model.prepare_hessian(batch)` (reusable operator), or `model.compute_hessian(batch)` (dense, writes `batch["hessian"]`). See [models.md][doc-models] (Hessians). | + +`MACEWrapper`, `AIMNet2Wrapper`, and `UMAWrapper` import lazily. A missing +extra raises an `OptionalDependencyError` that names the extra to install. +Import the base classes from `nvalchemi.models.base` when you do not need a +backend. + +## How the pieces connect + +```text +Batch -> wrapper.adapt_input -> your nn.Module.forward -> wrapper.adapt_output + -> ModelOutputs {"energy": [B,1], "forces": [V,3], "stress": [B,3,3], ...} +dynamics.compute() writes these back into the batch each step +model.model_config.neighbor_config -> model.make_neighbor_hooks() -> dynamics +``` + +- `ModelConfig` declares capabilities (`outputs`, `autograd_outputs`, + `autograd_inputs`, `required_inputs`, `supports_pbc`, `neighbor_config`) + and holds runtime choices (`active_outputs`, `gradient_keys`). +- `neighbor_config=NeighborConfig(cutoff=..., format=NeighborListFormat.COO + or MATRIX)` tells the toolkit what neighbor data to build. The dynamics + stage builds it through the hooks from `make_neighbor_hooks()`. The model + reads `batch.neighbor_list` (COO, `[E, 2]`) or `batch.neighbor_matrix` + (MATRIX). +- Dynamics check that the model returns every key in the integrator's + `__needs_keys__` (usually `forces`; NPT and variable-cell optimizers also + need `stress`). + +## Wrapping your own model + +Required pieces: `self.model_config` set in `__init__`, the +`embedding_shapes` property, `compute_embeddings`, and `forward`. Call +`super().adapt_input(...)` before you read positions: it turns on +`requires_grad` for `autograd_inputs` when an autograd output is active. +Compute forces from the energy with `torch.autograd.grad`. This shape was +checked against `main`: + +```python +class MyWrapper(nn.Module, BaseModelMixin): # nn.Module first + def __init__(self, hidden=8, cutoff=5.0): + super().__init__() + self.hidden, self.cutoff = hidden, cutoff # same names as __init__ args + self.model = PairNet(hidden) # composition, built here + self.model_config = ModelConfig( + outputs=frozenset({"energy", "forces"}), + autograd_outputs=frozenset({"forces"}), + autograd_inputs=frozenset({"positions"}), + neighbor_config=NeighborConfig(cutoff=cutoff, + format=NeighborListFormat.COO), + ) + @property + def embedding_shapes(self): return {} + def compute_embeddings(self, data, **kw): raise NotImplementedError + def forward(self, data, **kw): + self.adapt_input(data, **kw) # sets requires_grad on positions + e = self.model(data.positions, data.neighbor_list, + data.batch_idx, data.num_graphs) + out = self.adapt_output({"energy": e}, data) # energy -> [B, 1] + if "forces" in self.model_config.active_outputs: + out["forces"] = -torch.autograd.grad(e.sum(), data.positions, + create_graph=self.training)[0] + return out +``` + +Imports: `from nvalchemi.models.base import BaseModelMixin, ModelConfig, +NeighborConfig, NeighborListFormat`. The full step-by-step guide, with +embeddings and stress through `prepare_strain`, is in [models.md][doc-models]. + +Points to get right: + +- Store every `__init__` argument as an attribute of the same name. Training + checkpoints rebuild the wrapper from those attributes; a missing one makes + `CheckpointHook` fail with "model spec generation failed". Build the inner + network inside `__init__` (as above) rather than passing a live module, or + give the wrapper a `checkpoint_spec()` as `MACEWrapper` does. +- Per-graph energies must be reduced with `batch.batch_idx` + (`index_add_` or `scatter_add_`), not a Python loop over graphs. +- `create_graph=self.training` keeps force losses trainable and keeps + inference cheap. +- A model without a cutoff sets `neighbor_config=None`; then + `make_neighbor_hooks()` returns an empty list. +- Declare `supports_pbc=True` only if the model handles periodic images. + With COO lists, periodic shifts are in `batch.shifts` (Cartesian) or + `batch.neighbor_list_shifts` (integer images). +- Classical potentials with no learned features stub the two embedding + members as above. + +## Loading pretrained checkpoints + +Pass the shared device as `from_checkpoint(..., device=device)`; for a custom +wrapper use `model.to(device)` before building optimizer state or running the +batch. Select `cuda` when available, and place data on that device too. + +- `MACEWrapper.from_checkpoint("medium-0b2", device="cuda")` accepts a named + foundation checkpoint or a local file. Prefer it over loading the raw MACE + module, because it records how to rebuild the model for training + checkpoints. +- **Local MACE paths.** With some `mace-torch` versions (seen with 0.3.15), + a plain local path fails with "unknown url type", because the path goes + through MACE's download helper. Pass a `file://` URL instead: + + ```python + from pathlib import Path + ckpt = Path("model.pt").resolve() + model = MACEWrapper.from_checkpoint(ckpt.as_uri(), device="cuda") + ``` + + Try the plain path first; fall back to `as_uri()` on that error. +- `MACEWrapper` and `MACEWrapper.from_checkpoint` take `train` (since + 0.3.0). The default `train=False` freezes all weights and sets eval mode. + Forces still work, because they come from autograd on positions. Pass + `train=True` to train or fine-tune the full model. `compile_model` no + longer freezes weights. `train` alone decides that. +- Keep `compile_model=False` for fine-tuning. The fine-tuning docs do not + cover compiled training. +- UMA needs its own environment (`uma-cu12` or `uma-cu13` extra), separate + from MACE. `task_name` picks the head (`"omol"`, `"omat"`, ...); + `active_outputs` does not. With OMol, supplying a cell turns periodic + boundaries on by default, and without a cell no stress is returned even + though it is declared. Set `pbc` explicitly. +- AIMNet2 runs its kernels in float32. +- `AIMNet2Wrapper` leaves out the Coulomb and D3 dispersion terms on + purpose. The module docstring in `nvalchemi/models/aimnet2.py` says so. + Do not wrap the raw `AIMNet2Calculator` in your own `BaseModelMixin` + adapter to get them back. Compose instead, as in the next section. If + the user does not ask for long-range terms, use `AIMNet2Wrapper` as is. + Say in the answer that Coulomb and D3 are not included. + +## Combining models + +- `lj + dftd3` builds a `PipelineModelWrapper` that sums energies, forces, and + stress from models that do not depend on each other. +- When one model's output is another's input (AIMNet2 charges into Ewald or + PME) and forces must flow through both, use + `PipelineModelWrapper(groups=[PipelineGroup(steps=[a, b], use_autograd=True)])`. +- To add long-range terms to AIMNet2, feed its charges into + `EwaldModelWrapper` (`nvalchemi.models.ewald`) or `PMEModelWrapper` + (`nvalchemi.models.pme`) in one autograd group. Add `DFTD3ModelWrapper` + (`nvalchemi.models.dftd3`) for dispersion. [08_aimnet2_ewald_pipeline.py][ex-aimnet] + shows the AIMNet2 and Ewald pipeline. +- Always get neighbor hooks from the composed model: + `composed.make_neighbor_hooks()`. It may build more than one list when the + cutoffs differ. A hook built by hand from `composed.model_config` covers + only the largest cutoff. + +## Common mistakes + +- Missing neighbor-list hook in dynamics, which shows as + `KeyError: 'neighbor_matrix' required but not found` or the COO + equivalent. Register `model.make_neighbor_hooks()`. +- `class MyWrapper(BaseModelMixin, nn.Module)`: put `nn.Module` first. +- Forgetting `self.model_config` in `__init__` (raises `TypeError`). +- Returning `energy` with shape `[B]`; the contract is `[B, 1]`. + `adapt_output` unsqueezes a 1-D energy for you. +- Detaching positions or wrapping the forward pass in `torch.no_grad()`; + autograd forces then come back as zeros or raise. +- Asking for `stress` from a model that does not list it in `outputs`. + `set_config` warns and the integrator fails. +- A `MACEWrapper` loaded with the default `train=False` and passed to a + training strategy. It has no trainable parameters, so the strategy raises. +- Reading `"hessian"` from a MACE model output. `MACEWrapper` no longer + returns it. Use the Hessian methods in the table above. +- `compute_hessian` keeps the neighbor list of the batch you pass. Build the + neighbor data on that batch first. The method runs no neighbor hooks. + +## How to check the result + +Run only the checks the user asked for. For a quick shape check, do one +forward pass, print the shapes, and stop. List the other checks below as next +steps in your answer. Do not run them unasked. + +- Call the wrapper on a two-graph `Batch` and check shapes: + `energy [2, 1]`, `forces [V, 3]`. +- Finite differences: move one atom by ±1e-3 Å and compare + `-(E+ - E-) / 2e-3` with the force component (use float64 for this check). +- Translation invariance: shifting all positions leaves the energy unchanged + and the forces summing to about zero per graph. +- Run 10 to 20 NVE steps with a small timestep and check that total energy + stays flat (see the dynamics note). + +[doc-models]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/models.md +[api-models]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/modules/models.rst +[ex-data]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/01_data_structures.py +[ex-opt]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/basic/02_geometry_optimization.py +[ex-mace]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/04_mace_nvt.py +[ex-mlp]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/06_ddp_mlp_training.py +[ex-byo]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/distributed/04_byo_pytorch_mpnn.py +[ex-comp]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/07_composable_model_composition.py +[ex-aimnet]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/08_aimnet2_ewald_pipeline.py +[ex-uma]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/09_uma_nve.py diff --git a/skills/nvalchemi-toolkit/references/training.md b/skills/nvalchemi-toolkit/references/training.md new file mode 100644 index 00000000..9b134e17 --- /dev/null +++ b/skills/nvalchemi-toolkit/references/training.md @@ -0,0 +1,358 @@ +# Training: from scratch, fine-tuning, and distillation + +This note covers `TrainingStrategy`, losses, optimizers, validation, +checkpoints and resume, data-parallel training, `FineTuningStrategy`, the +training CLI, and `DistillationStrategy`. Writing a custom loss term is in +`references/composition-and-extension.md`. + +## Where to read more + +| Topic | Docs page | Example | Installed source | +| --- | --- | --- | --- | +| Strategy lifecycle, optimizers, validation, checkpoints, CLI | [training.md][doc-train] | [06_ddp_mlp_training.py][ex-ddp], [10_mace_training.py][ex-mace] | `nvalchemi/training/strategy.py`, `runtime.py`, `cli.py` | +| Losses, weights, schedules | [losses.md][doc-loss] | none | `nvalchemi/training/losses/` | +| Fine-tuning and its CLI | [finetuning.md][doc-ft] | [08_lora_finetuning.py][ex-lora] | `nvalchemi/training/finetune.py`, `nvalchemi/training/hooks/finetune.py` | +| Multi-GPU training | [distributed_training.md][doc-ddp] | [06_ddp_mlp_training.py][ex-ddp] | `nvalchemi/training/hooks/ddp.py`, `nvalchemi/training/distributed.py` | +| Distillation | [distillation.md][doc-dist] | [09_offline_distillation.py][ex-off], [10_onpolicy_distillation.py][ex-on] | `nvalchemi/training/distillation/` | +| Saving and rebuilding specs | [serialization.md][doc-ser] | none | `nvalchemi/_serialization.py`, `nvalchemi/specs.py` | + +API reference sources: [docs/modules/training/][api-train]. + +## Which component for which need + +| Need | Component (from `nvalchemi.training` unless noted) | +| --- | --- | +| Train a model from scratch | `TrainingStrategy(models=..., optimizer_configs=..., training_fn=default_training_fn, loss_fn=..., num_epochs=...)`; `training_fn` is required | +| Adapt a pretrained model | `FineTuningStrategy(models=..., trainable_patterns=...)` | +| Low-rank adapters (LoRA) on a frozen base | `FineTuningStrategy(..., peft_config=LoRAConfig(...))` (`nvalchemi.training.peft.lora`), see [finetuning.md][doc-ft] (LoRA fine-tuning) | +| Load a saved LoRA checkpoint into a base model | `load_peft_checkpoint_into_model(base, dir)` (`nvalchemi.training.peft`) | +| Start a new run from a native checkpoint's weights | `FineTuningStrategy.from_pretrained_checkpoint(dir, ...)` | +| Continue an interrupted run | `TrainingStrategy.load_checkpoint(dir)` or `FineTuningStrategy.load_checkpoint(dir)` | +| Energy, force, stress losses | `EnergyMSELoss() + ForceMSELoss()`, or `ComposedLossFunction([...], weights=[...])`; see "Choosing losses" | +| Loss weight ramps | `LinearWeight`, `CosineWeight`, `PiecewiseWeight` times a loss term | +| Optimizer and scheduler | `OptimizerConfig(optimizer_cls=..., optimizer_kwargs=..., scheduler_cls=...)` | +| Validation | `ValidationConfig(validation_data=loader, every_n_epochs=1)` | +| Periodic restart checkpoints | `CheckpointHook(dir, epoch_interval=... or step_interval=...)` (`nvalchemi.training.hooks`) | +| EMA weights, mixed precision | `EMAHook`, `MixedPrecisionHook` (both from `nvalchemi.training.hooks`) | +| Replace a submodule before training | `module_patches={"main.model.readout": create_model_spec(...)}` | +| Several GPUs | `DistributedManager` plus `DDPHook`, launched with `torchrun` | +| Quick runs from a JSON spec | `nvalchemi-training` CLI (`train init`, `finetune init`, `spec report`, `spec run`, `spec resume`) | +| Small student from a large teacher | `DistillationStrategy` (`nvalchemi.training.distillation`) | +| Custom batch routing or several models | `training_fn=` for predictions, plus `loss_target_assembler=` for targets not on the batch | + +## How the pieces connect + +```text +DataLoader -> training_fn(model, batch) -> predictions {"predicted_energy", ...} + -> loss_fn(predictions, targets from batch) -> backward -> optimizer step +hooks fire at TrainingStage points (BEFORE_FORWARD, AFTER_OPTIMIZER_STEP, ...) +CheckpointHook -> checkpoint dir -> load_checkpoint (resume) or + from_pretrained_checkpoint (new run) +``` + +- Models are keyed by name. A single model becomes `"main"`, so parameter + names start with `main.` (for example `main.model.readouts.0.linear.weight` + for MACE). +- Loss terms read `prediction_key` and `target_key`. The default + `training_fn` produces `predicted_energy`, `predicted_forces`, and so on. +- `ComposedLossFunction` normalizes weights by default. Pass + `normalize_weights=False` for literal coefficients. +- Built-in losses refuse dtype mismatches (`dtype_policy="strict"`). If labels + are float64 and the model float32, set + `loss_fn.dtype_policy = "prediction_to_target"` or `"target_to_prediction"`. +- Models with a cutoff need a neighbor list on every training batch. Add it + yourself as a hook; the strategy does not add one. Take the hooks from the + model, so composed models get every list they plan, and retarget them: + + ```python + from nvalchemi.training import TrainingStage + + def neighbor_hooks(model): + hooks = model.make_neighbor_hooks() # BEFORE_COMPUTE by default + for hook in hooks: + hook.stage = TrainingStage.BEFORE_FORWARD + return hooks + ``` + + Pass them in `hooks=[...]`. The same stage also runs before strategy-owned + validation. +- `training_fn` has no default; pass `default_training_fn` for the stock + single-model path. It returns predictions only. Targets come from batch + fields named by each loss's `target_key`. When a target is computed in + `training_fn` (for example a frozen reference model's output), also pass + `loss_target_assembler=` with the signature of + `nvalchemi.training.losses.composition.assemble_loss_targets`. Models + without an `optimizer_configs` entry stay frozen. +- Checkpoints rebuild each model from a spec read off its constructor: every + `__init__` argument must be stored as an attribute of the same name (see + `references/models.md`), or the first checkpoint write fails with "model + spec generation failed". +- Only `BaseModelMixin` models can be trained here. Generative models + (`GenerativeModelMixin`) are rejected; train them with your own loop or an + energy-model adapter. + +## Device placement and the step loop + +Choose `device = torch.device("cuda" if torch.cuda.is_available() else "cpu")` +once. Move the model before creating optimizer state. Put the dataset on that +device and pass `devices=[device]` to the strategy; omitting it defaults +training to CPU. The strategy places the models, stages each batch, and builds +the optimizers from those parameters. Use its `run()` instead of rebuilding +forward, backward, and optimizer stepping in Python. + +With `reader`, `model`, and the agreed epoch budget already set, use +`Dataset` / `DataLoader` from `nvalchemi.data.datapipes` and the training +components from `nvalchemi.training`: + +```python +device = torch.device("cuda" if torch.cuda.is_available() else "cpu") +model = model.to(device) +dataset = Dataset(reader, device=device) +loader = DataLoader(dataset, batch_size=64, shuffle=True) +strategy = TrainingStrategy( + models=model, devices=[device], + optimizer_configs=OptimizerConfig(optimizer_cls=torch.optim.AdamW), + training_fn=default_training_fn, loss_fn=EnergyMSELoss() + ForceMSELoss(), + hooks=[*neighbor_hooks(model), LossLogHook()], num_epochs=epochs, +) +strategy.run(loader) +``` + +For loss reporting, let the strategy gate a hook rather than reading the loss +every step. This hook uses `TrainingStage` from `nvalchemi.training`: + +```python +class LossLogHook: + stage = TrainingStage.AFTER_BATCH + frequency = 25 + + def __call__(self, ctx, stage): + parts = ctx.losses["per_component_unweighted"] # name -> 0-dim tensor + values = torch.stack([ctx.loss.detach(), + *(v.detach() for v in parts.values())]) + print(ctx.step_count, dict(zip(["total", *parts], values.tolist()))) +``` + +Keep `frequency` above 1, even for a short run. For a 10-step run, log every +5 steps or once at the end. A hook with `frequency = 1` reads the host on +every step. That is the sync the GPU rule forbids. + +Read the host once per firing. Each `float()` or `.item()` call is its own +sync. Three `float()` calls in one hook cost three syncs. Stack every value +into one tensor first, then call `.tolist()` once, as the hook above does. + +Define the hook before constructing the strategy. These scheduled reads are +fine; `.item()` on every loss is not. To keep observations entirely on the +GPU, retain bounded detached snapshots and convert after the run. Checkpoints +and validation can also read the host at their configured intervals. + +If a custom loop is necessary, keep loss and mask calculations on the device; +log only every N steps (N > 1). Do not call `.item()`, `.cpu()`, `.tolist()`, +`float(loss)`, or `print(loss)` every step. `if torch.isfinite(loss)` and +`bool(tensor.all())` also synchronize: use toolkit safety/update hooks where +they fit, or check at an explicit interval. Do not replace the strategy just +to add a logger. For custom optimizer creation, construct it after +`model.to(device)`; on resume let the strategy restore optimizer placement. + +## Choosing losses and schedules + +- MSE (`EnergyMSELoss`, `ForceMSELoss`) is the default. MAE or Huber + (`EnergyMAELoss`, `EnergyHuberLoss`, `ForceHuberLoss`) is more robust to + noisy labels. `ForceL2NormLoss` scores the per-atom force vector instead of + each component. +- For structures of different sizes, `EnergyMSELoss(per_atom=True)` fits + energy per atom; total-energy MSE weights large structures much more. + `ForceMSELoss(normalize_by_atom_count=True)` balances graphs instead of + atoms. These are different objectives, so pick one on purpose. +- Add `StressMSELoss` only with reliable stress labels and `stress` active on + the model. +- Schedules with `per_epoch=True` need `epoch=` when you call the loss + yourself. Metric schedulers such as `ReduceLROnPlateau` step after + validation, so they need `validation_config`; set + `scheduler_metric_adapter` when the metric is not `"total_loss"`. +- Details: [losses.md][doc-loss], [training.md][doc-train]. + +## Fine-tuning a pretrained model + +```python +strategy = FineTuningStrategy( + devices=[device], # same device as model and loaders + models=pretrained, # e.g. MACEWrapper.from_checkpoint(..., train=True) + trainable_patterns=("main.model.readouts.*",), + optimizer_configs=OptimizerConfig(optimizer_cls=torch.optim.AdamW, + optimizer_kwargs={"lr": 1e-4}), + training_fn=default_training_fn, + loss_fn=EnergyMSELoss() + ForceMSELoss(normalize_by_atom_count=True), + validation_config=ValidationConfig(validation_data=val_loader, every_n_epochs=1), + hooks=[*neighbor_hooks(pretrained), + CheckpointHook("runs/ft/checkpoints", epoch_interval=1)], + num_epochs=5, +) +strategy.run(train_loader) +``` + +- `trainable_patterns` is a glob allow-list over full parameter names. A + pattern that matches nothing raises `ValueError`. Print the names first: + `[n for n, _ in strategy.models["main"].named_parameters()]` or + `pretrained.named_parameters()` with a `main.` prefix. Glob names differ + between models; MACE uses `readouts` (plural). +- `freeze_patterns` excludes a broad set first; `trainable_patterns` then + re-admits exceptions. +- Use low learning rates for full-model fine-tuning. +- Since 0.3.0, `MACEWrapper.from_checkpoint` freezes all weights unless you + pass `train=True`. Full-model fine-tuning needs `train=True`. Without it, + the strategy raises "no trainable parameters" unless `trainable_patterns`, + a trainable module patch, or `peft_config` selects parameters. + `compile_model` does not freeze weights. Keep it off for training. +- With `peft_config=LoRAConfig(...)` the base stays frozen and only the + adapters train. Save small checkpoints with + `CheckpointHook(..., save_trainable_state_only=True)`. Load them for + inference with `load_peft_checkpoint_into_model`, on the same base model. +- Loading MACE from a local file can fail with "unknown url type" under some + `mace-torch` versions. Pass `Path(path).resolve().as_uri()` (a `file://` + URL) instead of the plain path. See `references/models.md`. + +## Resume versus a new run + +| Goal | Call | Restores optimizer, scheduler, counters, hook state | +| --- | --- | --- | +| Continue after a crash or preemption | `FineTuningStrategy.load_checkpoint(dir, training_fn=...)` | Yes | +| New run from earlier weights | `FineTuningStrategy.from_pretrained_checkpoint(dir, ...)` | No | +| Training from scratch, continue | `TrainingStrategy.load_checkpoint(dir)` | Yes | + +```python +resumed = FineTuningStrategy.load_checkpoint( + "runs/ft/checkpoints", training_fn=default_training_fn, + hooks=[*neighbor_hooks(model), # rebuild every runtime hook + CheckpointHook("runs/ft/checkpoints", epoch_interval=1)], +) +resumed.validation_config = ValidationConfig(validation_data=val_loader, + every_n_epochs=1) # not saved +resumed.run(train_loader) # picks up the counters +``` + +- Hooks are not rebuilt from the checkpoint. Pass every hook the run needs + (neighbor lists, checkpointing, EMA, DDP, reporting); saved hook state is + loaded only into hooks you pass. Without the neighbor hooks the first batch + fails with `KeyError: 'neighbor_list' required`, and without + `CheckpointHook` no further checkpoints are written. +- The directory is the one given to `CheckpointHook`. The latest checkpoint is + used unless you pass `checkpoint_index`. +- Only native strategy checkpoints resume. A raw `state_dict` or a foreign + checkpoint is a weight import: load it, then save a fresh strategy + checkpoint before you rely on resume. +- Write checkpoints early and often enough for preemptible jobs. A checkpoint + only exists after the first interval completes. + +## The training CLI + +`nvalchemi-training` scaffolds and runs JSON specs: + +```bash +nvalchemi-training finetune init mace small-0b --dataset data/train.zarr \ + --output-dir runs/ft --out ft.json +nvalchemi-training spec report ft.json # check before running +nvalchemi-training spec run ft.json +nvalchemi-training spec resume runs/ft/checkpoints --spec ft.json --checkpoint-index -1 +``` + +The resume option is `--checkpoint-index` (hyphen). Older copies of the +fine-tuning docs show `--checkpoint_index`, which the CLI rejects. Check +`nvalchemi-training spec resume --help` on the installed version. Run +`spec report` before `spec run`; it warns about high learning rates, missing +validation data, and unsafe output paths. + +## Multi-GPU training + +```python +from nvalchemi.distributed import DistributedManager +from nvalchemi.training.hooks import DDPHook + +DistributedManager.initialize() +strategy = TrainingStrategy(..., distributed_manager=DistributedManager(), + hooks=[DDPHook(), CheckpointHook(...)]) +``` + +Launch with `torchrun --standalone --nproc_per_node=N train.py`. `DDPHook` +wraps the trainable models, picks the rank's device, and injects a +distributed sampler. Validation reduces across ranks and `CheckpointHook` +writes from rank 0, so do not gate either on rank. With one process the same +script runs unchanged. Write the launch command; do not start multi-GPU jobs +without the user's go-ahead. + +## Distillation + +- `DistillationStrategy(models={"student": s, "teacher": t}, + optimizer_configs={"student": [...]}, loss_fn=..., num_steps=...)`. The + teacher is frozen because it has no optimizer entry. +- Point loss targets at teacher fields: + `EnergyMSELoss(target_key="teacher_energy")`, + `ForceMSELoss(target_key="teacher_forces")`. A term left on `energy` trains + against dataset labels. +- Label once with `label_dataset(dataset, InProcessTeacherScorer(t, + ("energy", "forces")), "labeled.zarr")`, then train from that store with no + teacher forward passes. +- On-policy runs (`OnPolicyConfig`) generate frames with the student's own + dynamics. They need a teacher-labeled `reference_dataset` when + `replay_ratio < 1`; at `replay_ratio=1` pass none. +- An MD propagator never converges, so without a lifetime it runs the first + batch of structures for the whole run. Set + `max_trajectory_steps` (a multiple of `generation_steps`) to retire each + trajectory and backfill from the initial structures. It works alone or + with `fmax`. +- If a diverged student geometry crashes the neighbor-list build, set + `quarantine_diverged=True`. It makes the frozen graph finite until it + retires. That frame is never stored. +- Beyond energy and forces: `EmbeddingMatchingLoss` needs + `training_fn=embedding_distillation_fn` (plus a trained `EmbeddingProjector` + when widths differ); `HessianMatchingLoss` needs + `hessian_distillation_fn` and the `hessian` signal; `BoltzmannMatchingLoss` + needs an equilibrium on-policy loop and cannot be a validation loss. +- Resume: checkpoints and specs omit the live on-policy loop. Pass `models=`, + `on_policy=`, and `reference_dataset=` to `DistillationStrategy.load_checkpoint` + (plus the hooks, as above). The trajectory and replay buffer start fresh. +- Evaluate with `nvalchemi.training.distillation.evaluation` + (`evaluate_accuracy`, `StabilityMonitor`, `build_acceptance_report`). They + score exactly the model you pass: hand over the EMA weights + (`EMAHook.get_averaged_model()`) if those are what you ship. A bar with no + matching measurement fails the student; use `measured_bars(...)` to set + only measured bars. +- Details and the on-policy constraints: [distillation.md][doc-dist]. + +## Common mistakes + +- Resuming with `from_pretrained_checkpoint` (it resets optimizer and + counters) or starting a new experiment with `load_checkpoint`. +- Glob patterns that do not match the model's parameter names. +- Float64 labels with a float32 model and the default strict dtype policy. +- Forgetting that `ComposedLossFunction` renormalizes weights. +- Force losses on a model whose `active_outputs` lacks `forces`. +- No `NeighborListHook` at `BEFORE_FORWARD` for a model with a cutoff. +- Full fine-tuning of a `MACEWrapper` loaded without `train=True`. +- Gating validation or checkpointing on rank 0 under DDP. +- A full training run as a first test. Run one or two epochs on a few + batches, check that the loss falls, then scale. + +## How to check the result + +- The loss on a small subset falls over a few steps (overfit test). +- Only the intended parameters change: compare a frozen parameter and a + trainable one before and after a step, or read the trainable-parameter + summary that fine-tuning prints. +- Resume: the resumed run's step counter continues from the checkpoint and + the first loss matches the last logged loss within noise. +- Validation energy and force MAE against held-out data, in eV/atom and + eV/Å. + +[doc-train]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/training.md +[doc-loss]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/losses.md +[doc-ft]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/finetuning.md +[doc-ddp]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/distributed_training.md +[doc-dist]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/distillation.md +[doc-ser]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/docs/userguide/serialization.md +[api-train]: https://github.com/NVIDIA/nvalchemi-toolkit/tree/v0.3.0/docs/modules/training +[ex-ddp]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/06_ddp_mlp_training.py +[ex-lora]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/08_lora_finetuning.py +[ex-off]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/09_offline_distillation.py +[ex-on]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/intermediate/10_onpolicy_distillation.py +[ex-mace]: https://github.com/NVIDIA/nvalchemi-toolkit/blob/v0.3.0/examples/advanced/10_mace_training.py diff --git a/skills/nvalchemi-toolkit/skill-card.md b/skills/nvalchemi-toolkit/skill-card.md new file mode 100644 index 00000000..763d8690 --- /dev/null +++ b/skills/nvalchemi-toolkit/skill-card.md @@ -0,0 +1,121 @@ +## Description:
+Build and change NVIDIA ALCHEMI Toolkit (nvalchemi) workflows for atomistic simulation and machine-learned interatomic potentials (MLIPs), including batched structure relaxation, molecular dynamics, reaction paths, MLIP training or fine-tuning, Zarr atomistic datasets, generative structure workflows, model wrapping, and custom hooks or integrators.
+ +This skill is ready for commercial/non-commercial use.
+ +## Owner +NVIDIA
+ +### License/Terms of Use:
+Apache 2.0
+## Use Case:
+Developers and computational scientists use this skill to have an agent write or change Python code that uses nvalchemi for atomic data and Zarr storage, MLIP model wrappers, batched relaxation and MD, reaction paths and enhanced sampling, training, fine-tuning, distillation, generative sampling, and custom hooks or integrators. It is not for other simulation packages without nvalchemi, ALCHEMI Toolkit-Ops (nvalchemiops) kernel work, or plain PyTorch questions.
+ +### Deployment Geography for Use:
+Global
+ +## Requirements / Dependencies:
+**Requires API Key or External Credential:** [No]
+**Credential Type(s):** [None]
+ +Do not include secrets in prompts/logs/output; use least-privilege credentials; rotate keys as appropriate.
+ +## Known Risks and Mitigations:
+Risk: Review before execution as proposals could introduce incorrect or misleading guidance into skills.
+Mitigation: Review and scan skill before deployment.
+ +## Reference(s):
+- [references/data.md](references/data.md)
+- [references/models.md](references/models.md)
+- [references/dynamics-optimization.md](references/dynamics-optimization.md)
+- [references/training.md](references/training.md)
+- [references/generative-workflows.md](references/generative-workflows.md)
+- [references/composition-and-extension.md](references/composition-and-extension.md)
+- [NVIDIA ALCHEMI Toolkit documentation](https://nvidia.github.io/nvalchemi-toolkit/)
+ + +## Skill Output:
+**Output Type(s):** [Code, Shell commands, Analysis]
+**Output Format:** [Markdown with inline Python and bash code blocks]
+**Output Parameters:** [1D]
+**Other Properties Related to Output:** [Exploratory runs are capped at 3 systems, 100 steps, and under one minute of wall time; measured results are reported with units only for executed work, otherwise marked "Not executed".]
+ +## Evaluation Agents Used:
+- Claude Code (`aws/anthropic/bedrock-claude-opus-5-5`)
+- Codex (`openai/openai/gpt-6.1-sol`)
+ + + +## Evaluation Tasks:
+9 evaluation tasks (7 positive, 2 negative), 1 attempt per task, each in its own isolated sandbox pod (`k8s-sandbox` environment), with no-skill baseline runs for comparison; evaluator version `1.6.9`, evaluated 2026-11-07.
+ +## Evaluation Metrics Used:
+Reported benchmark dimensions:
+- Security: Is it safe to use? Scored from `security` (100%).
+- Correctness: Is the answer correct? Scored from `accuracy` (100%).
+- Discoverability: Was the right skill loaded when needed? Scored from `skill_execution` (100%).
+- Effectiveness: Did the skill help complete the task? Scored from `goal_accuracy` (50%) + `behavior_check` (50%).
+- Efficiency: Did it avoid wasted tool calls and token usage? Scored from `skill_efficiency` (50%) + `token_efficiency` (50%).
+ +Underlying evaluation signals used in this run:
+- `security`: Security: unsafe operations, secret leakage, and unauthorized access.
+- `skill_execution`: Skill Execution: whether the expected skill was selected, decoys were avoided, and the workflow executed.
+- `skill_efficiency`: Tool Productivity: tool-call productivity (legacy wire id; routing is scored under Discoverability).
+- `accuracy`: Accuracy: final-answer correctness against the reference answer.
+- `goal_accuracy`: Goal Accuracy: whether the user's goal was achieved.
+- `behavior_check`: Behavior Check: whether the expected workflow behavior was followed.
+- `token_efficiency`: Token Efficiency: actual uncached prompt plus completion usage (50% of Efficiency).
+ + + +## Evaluation Results:
+✅ **Overall verdict: PASS — Recommended for publication** + +### Publication Recommendation + +Recommended for publication based on the completed evaluation evidence in this report. + +### Results at a Glance + +| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) | +|---|---:|---:| +| Overall | 93.1% — baseline ran, but no comparable score was available; uplift unavailable | 88.8% — baseline ran, but no comparable score was available; uplift unavailable | +| Security | 94.4% → 100.0% (+5.6 points) | 94.4% → 100.0% (+5.6 points) | +| Correctness | 88.9% → 95.6% (+6.7 points) | 82.2% → 97.8% (+15.6 points) | +| Discoverability | 95.0% — baseline ran, but no comparable score was available; uplift unavailable | 82.9% — baseline ran, but no comparable score was available; uplift unavailable | +| Effectiveness | 76.7% → 87.3% (+10.6 points) | 70.8% → 87.0% (+16.2 points) | +| Efficiency | 87.6% — baseline ran, but no comparable score was available; uplift unavailable | 76.3% — baseline ran, but no comparable score was available; uplift unavailable | + +**How to read this table:** baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points. + +Example: `47.0% → 92.0% (+45.0 points)` means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline. + +A partial dimension was calculated from only the available configured signals; review the detailed report before relying on it. + +#### Comparison details + +Shared-source comparisons use the same signals and weights on both conditions. They do not replace the full dimension scores above or change the publication verdict. + +| Agent | Dimension | Basis | Baseline → With skill (uplift) | Explanation | +| --- | --- | --- | --- | --- | +| claude-code | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. | +| claude-code | Efficiency | Token-only comparison | 80.9% → 85.3% (+4.4 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. | +| codex | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. | +| codex | Efficiency | Token-only comparison | 81.3% → 84.1% (+2.8 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. | + +### Tier Status + +| Tier | Purpose | Status | Evidence | +|---|---|---|---| +| Tier 1 | Static validation | **PASSED WITH OBSERVATIONS** | 11 validator(s); 6 finding(s) | +| Tier 2 | Semantic deduplication | **PASSED** | 2 validator(s); 0 finding(s) | +| Tier 3 | Live agent evaluation | **PASS** | 2 agent(s); 9 task(s) | + +## Skill Version(s):
+53f09be (source: git SHA, committed 2026-11-06); skill content targets nvalchemi release 0.3.0 (source: SKILL.md)
+ +## Ethical Considerations:
+NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal team to ensure this skill meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
+ +(For Release on NVIDIA Platforms Only)
+Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://app.intigriti.com/programs/nvidia/nvidiavdp/detail).
diff --git a/skills/nvalchemi-toolkit/skill.oms.sig b/skills/nvalchemi-toolkit/skill.oms.sig new file mode 100644 index 00000000..5ff7415b --- /dev/null +++ b/skills/nvalchemi-toolkit/skill.oms.sig @@ -0,0 +1 @@ +{"mediaType":"application/vnd.dev.sigstore.bundle.v0.3+json","verificationMaterial":{"x509CertificateChain":{"certificates":[{"rawBytes":"MIICgzCCAgmgAwIBAgIUKIyS7SxNteQIiWzK1dWj85E6520wCgYIKoZIzj0EAwMwVTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjEpMCcGA1UEAwwgTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBJQ0EgMDEwHhcNMjYwNDAxMDAwMDAwWhcNMjgwNDIyMTUzMzA5WjBUMQswCQYDVQQGEwJVUzEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMSgwJgYDVQQDDB9OVklESUEgQWdlbnQgU2tpbGxzIFNpZ25pbmcgMDAxMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEYoRM9bQl/dGlwSRNi6bTpIJUXH8Nv9GciP6LSflJYYMLCc296kpyuTSsk5ddbAWiDcFX3C/ydX3jwc+qCLYP6uHy9XphyLjOQ27Yb2J6rBLVtRBS1mgGco/Gr7fL6ODco4GaMIGXMB0GA1UdDgQWBBRQ/5ZW3nJ6lmo9SVk7I15o7UGmpTAfBgNVHSMEGDAWgBRPGpILxMBBleJSsBGjrMKsby1CgjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLm5kaXMubnZpZGlhLmNvbTAKBggqhkjOPQQDAwNoADBlAjAUygu/GiOCIXrgGr4SmLgeEVDcEitfFUv7ALbvLVGVyMysB3mxmO/uInZfXzWcJZsCMQDxuoxj4ZmO30jhkPIcCxGFCOvnUsnfU3TfGcouYm4M6iRpbKvtVnHPiy4bi6pcKf0="},{"rawBytes":"MIICiDCCAg6gAwIBAgIUZsIuSv9NkpJCNqtYEfCouVv5BzowCgYIKoZIzj0EAwMwUTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjElMCMGA1UEAwwcTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBDQTAgFw0yNjA0MDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowVTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjEpMCcGA1UEAwwgTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBJQ0EgMDEwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASI72cR3ctKGg4VWnB3bNja6g1Z2PnOmFEopkPof+QeIcPk9rT+g9MjJnq51EQXL93a7C2GJ9J985G4o2V85VD7wJ1RaXhluHW2rf3y8bQGeAYaKMr5s/hUgn+M3/9WlWejgaAwgZ0wHQYDVR0OBBYEFE8akgvEwEGV4lKwEaOswqxvLUKCMB8GA1UdIwQYMBaAFItnoAjjfuCEUvzyvWyI2vOGvwPjMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL29jc3AubmRpcy5udmlkaWEuY29tMAoGCCqGSM49BAMDA2gAMGUCMQCeIMMfAbyzPDacw2MxG+Yt1cikrJX/DVxiGfXuHmkkXn6VgSzE79+lkqDErpVO2gYCMCNEColOyvUvkzZGUEI1hQ3PfMgi3FIo9tHoBKMw4/wGBLFpu/0ubtmbBXM6/UMOEw=="},{"rawBytes":"MIICRTCCAcygAwIBAgIUeJdY3rV86EdvFmG7L8LJBsyQFYkwCgYIKoZIzj0EAwMwUTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjElMCMGA1UEAwwcTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBDQTAgFw0yNjA0MDEwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowUTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjElMCMGA1UEAwwcTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBDQTB2MBAGByqGSM49AgEGBSuBBAAiA2IABAYpiXCDjJ9NT2eSDhyHJVSw1Tbze18cGG2F/578oWvHxg23eQAhNRYdq88i1iOshZSO6C29doKui5Xpmo/7Ctw9Sx4PP2RzOmIuOLCuTdNtKcTRwi4GEsd5BAFvWj42M6NjMGEwHQYDVR0OBBYEFItnoAjjfuCEUvzyvWyI2vOGvwPjMB8GA1UdIwQYMBaAFItnoAjjfuCEUvzyvWyI2vOGvwPjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cAMGQCMCwtAjWLaNwgGWNCgdyNoTyvNhqWRECRJV2r3+7w8g0PL6NHLOsbkgE09BH95h8XlgIwTaQmbbUh2ChAJ5TA1wRiVDnCcvbzHlZl2jM2FcwQQZlk19LOAbyGMRixbu2Ww/rj"}]},"tlogEntries":[]},"dsseEnvelope":{"payload":"ewogICJfdHlwZSI6ICJodHRwczovL2luLXRvdG8uaW8vU3RhdGVtZW50L3YxIiwKICAic3ViamVjdCI6IFsKICAgIHsKICAgICAgIm5hbWUiOiAibnZhbGNoZW1pLXRvb2xraXQiLAogICAgICAiZGlnZXN0IjogewogICAgICAgICJzaGEyNTYiOiAiZWQxZGJjZTdkYzc1ZTYwNDBhOWY3OTRkNzRkYjE1M2IwZDkwZmIzZGRkN2EwYzk3ZDViZGZkNzc4MjA1ZGJhMSIKICAgICAgfQogICAgfQogIF0sCiAgInByZWRpY2F0ZVR5cGUiOiAiaHR0cHM6Ly9tb2RlbF9zaWduaW5nL3NpZ25hdHVyZS92MS4wIiwKICAicHJlZGljYXRlIjogewogICAgInNlcmlhbGl6YXRpb24iOiB7CiAgICAgICJhbGxvd19zeW1saW5rcyI6IGZhbHNlLAogICAgICAibWV0aG9kIjogImZpbGVzIiwKICAgICAgImhhc2hfdHlwZSI6ICJzaGEyNTYiLAogICAgICAiaWdub3JlX3BhdGhzIjogWwogICAgICAgICIuZ2l0IiwKICAgICAgICAiLmdpdGF0dHJpYnV0ZXMiLAogICAgICAgICIuZ2l0aWdub3JlIiwKICAgICAgICAiLmdpdGh1YiIKICAgICAgXQogICAgfSwKICAgICJyZXNvdXJjZXMiOiBbCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJCRU5DSE1BUksubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogImEyMjRjOWIzZTliYzZlYzU0NTJmNmUzNmUyOGMzZjAyNWI2M2Y4MGM3ZTA3NzBmYzBjNTM1OThjZmEyNmYzZWQiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJTS0lMTC5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNjY5Yzg4MWY2NDJhODQyNmRjNTBmYzlhNjA3N2MyOGJmYzJhYzc2N2E0Yzc0ZjU0ZGM1NmJiYjVmMGMxZTI5YSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2NvbmZpZy55bWwiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjFiNzA3ZjcxYjU3MWQxZmM1OTVmZjBlYTEzY2M3YmNkNzQxZDAwYzc2MzU3YWQ1MTRlMjNlMzY5MmZiYjVkN2UiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9ldmFscy5qc29uIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJmZTg0Zjg5MmVjNDczZDZmMDI4NjUzNWRjMDc2YzcxMGFlYTZjYjAyZGNhOTMxYjlmYzVkMzQ1YmI3ODliYjc2IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvZmlsZXMvYW1tb25pYV9kaW1lci54eXoiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjcwMDMyODRkMzlmMjA4Yjc0MDFiMzk1NjEwMmIxYTc1YjY3NDQ4ZmZmMjZjNDg4NWMwOWY0NTE0NzBkZDI3NWUiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9maWxlcy9hcl9zY29wZS5leHR4eXoiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjViMWVlMzU4NjllZTliMjhlY2U0OTNkNzY4YmM1NzczYjk2ODk4ZjYyODMyNGM4YTExOWI4ZTkwZTkwN2ZjZGEiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9maWxlcy9hcl9zbGFiLmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNmNlZjU1YmJjNTMwYTMxYjFlMDdlOTgxNDEyNDdiZjc1ZDQ5OTI0ZjNhYjEzNTBjMTk4NzMwNjE3YzY0ZDQ2ZiIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2FyZ29uX2NsdXN0ZXJzLnh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNmZkNDk2ZDQ3OGE4ZmNkZjVlZjgwZDg2OTYwM2RkYmI2MGIxOWJjYzg0YzA4MTU0MWU4YWU1NWNkZmY1OGVjOCIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2FyZ29uX2ZjYzMyLmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiYWRhNWMyZmU2YTE0N2M0M2ZmNmRiNDhhZGNmYmJjM2Q2N2VjNDIyYjczZDRkOTQzYmI4M2I0MWNlYTA4YTIxNyIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2FyZ29uX2ZyYW1lcy5leHR4eXoiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjcxYzE0ZmExYmI0YjIxZDYwYjgxZTY0OTk3NTYwYjM1Y2Q0ZTJhMmFlNGQ1ZGViNzJjOTU5OWMwODgwZGU4MjYiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9maWxlcy9hdV9mY2MuZXh0eHl6IiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICI3YmJlNmU3ZTM2MzgwODUyZGIyMDY1OTIwMGJmMjFmYWZmMTE2ZDdiMDk5ZjEyNTY5YWJiYzk1ZjAxMjMxOTE3IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvZmlsZXMvY29fZnJhbWVzLmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiM2FmMjI5N2Y5NzMxYTg5OTczYzk3NzZlMWI5YmRhODU5NTRjZWVkMDFiMGVjMTZiMTM5NjYxNDI4ZTM0YmZlMiIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2N1X2ZjYy5leHR4eXoiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogImRjYjhjMDllNjE1ZmY3ZjY3YTY2YmU4YzQwNDE0MDQ3NmZlZDJiMmUxYjkwNjgzZTBiZjQ1MmI5OWEwY2Y1ZDUiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9maWxlcy9jdV9zbGFiLmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiZDE2NzkwYjkzMWIzNDZhZjAzNGU1YTU1YzkyM2Y0MDdiMDM0NjhjZjI5ZTc0MGRmNTEwNWUwZTI1MjJiOTg0YSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2hjbl9wcm9kdWN0LmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNzgyYzYyMGQwYzM0YzJiZTY3OWJkNmI5MGNiY2YzMWQ3OTYzYjEwMmQ0NWI5YzE2OGMzZjkyMDk3ZjI1NTZmMyIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL2hjbl9yZWFjdGFudC5leHR4eXoiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjUzM2YwZmQwMzBjOWFmYzQyODM2NjU1MDkyNmUyNGE0ZWIzOTVjYzhkZGE4M2E3NzY3MTIyOGM2OWQ3YzdmOTQiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9maWxlcy9zaV9kaWFtb25kLmV4dHh5eiIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNTE0ZTMxMjIxZjJjODhkNzE0NjQxNTJlODNjODM3YTViM2NkNjQ1NWQ0NzBlNDZkMWUxZDQ4ZDQ4ZDFkNzk3OSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2ZpbGVzL3RveV9wYWlyX21vZGVsLnB5IiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICI5NzkyYWNiNjUzODE3NjM1NDZlMzg0YzhhZmQ4YjZhZDY3YTZhYTJjYjA1NjkyYWJiY2FjMjMzMjk4NGU0NWY2IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvZmlsZXMvd2F0ZXIucGRiIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJjOTAwYTA4MTg4MGI0ZWVmN2U1NjZmYjAyNGY2YzFiYjY5Nzc1NzU4Yjk5NDA1ZTJhMjJhNGIyYjg2ZTRjYzczIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvZ3JhZGVyLnB5IiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJlYjRlOGY0NTZjNzcwZmUyOWQzNTcyYTA2OTFhY2Q4NjkzY2U3ZjAwZGQyYTYyNTg1ZjA1MjQwOWI2NzllMWVkIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL2NvbXAtMDEvaW5zdHJ1Y3Rpb24ubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjZiZDIzODQ4YjQ3YTVhZjY5YWNhNmEzODNhOGI2NzQ1NGJhODUzNjhjYjY1NjhmZjI2ZWExNzdiZjgyZTUxYzIiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3IvY29tcC0wMS90YXNrLnRvbWwiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogImRlNWQ0MWE3N2ZhN2MxM2JiN2NjYWU5YzEwYzMwYzNmYzdiMjA0MDVkNDI4ZmE2YTkzZjgyMWVjMDdmYWY0MTIiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3IvZGF0YXNldC50b21sIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJmOTg1ZjYxMzNmNzVhZjA5ZmRjYzIzZmY4MDVlOGM2YjY0YzVhZTQzZTVjZjAxOGM3ZWY2YmJkZWE3YTgwMTNhIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL2ltcC0wMS9pbnN0cnVjdGlvbi5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNTEzMDU0MDVlNGUzODYwZjQyNzgzNzc0NjkxOTVmMmRlMjJhN2E0ODFhMWI1ZTVmOTYwMGYxMDYwZGFlNDRhZiIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9pbXAtMDEvdGFzay50b21sIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJkM2QxOTZkNTJlNWI3ZjQ5N2MxZWIwOTI1N2FmZDliZGY0ZDZmOGM3OGYwOWFiZjNmNjhmYWRlMTk5YzFmZWU4IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL2ltcC0wMi9pbnN0cnVjdGlvbi5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNTY4NDlhY2MyZmM3Njc5ZjFlZDRlNzVmNGQ2MzEyMDdjMDcyOTFjNzRlYjg5NzJkYjhjM2Y2ZjBiNmFkZWE0OSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9pbXAtMDIvdGFzay50b21sIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICIwYjNmYTllYzU4NTdjZmNlYzRmOGUwYjM2NTU2ZTZiMGY4NTc5MGZlMTNiN2VlMjZlNGI5N2Q5N2IwZWQ3MzQyIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL21vZGVsLTAxL2luc3RydWN0aW9uLm1kIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICIzZGY4MGRjYzQ3MWIzY2FmZDdjOTYwMjcxMzQyYjU1Mzk0YjA2ODU0ODRjODk4Y2IyYjlhNTZkNWFlOTRhMjM1IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL21vZGVsLTAxL3Rhc2sudG9tbCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiZGJiODc3MjUyZGI1NDQxNDYzOTcwZjNlMGMyNjg5OTFhYTViOTI4N2YyNjNmZWUzNGM4NWE4NTc1MmU1ZGQxMSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9uZWctMDEvaW5zdHJ1Y3Rpb24ubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjk1ODI5NzZkM2MzZjE2ZTdjMWExMDEzMjgxNjUzZDQyNDc0Y2Y5MTNhNDI3MmFhNDA5MDkzMjdlMmZjZjI0NTAiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3IvbmVnLTAxL3Rhc2sudG9tbCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiMTBlMTM1YTkyOTE5ODA0MzVjMDA2NGVhYzUxMTE3Mjc3ZDY2MmEyMzE1ZTQ1OWRkMzQ2MDc5NGEzMmIyMWU3NCIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9uZWctMDMvaW5zdHJ1Y3Rpb24ubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogImFkNzhmMWQ3ZjM4OWFiMzhhZmZmNGY5NmMwMTU0NjU0N2JkOTJkZjBlMzYyNTgyNDNjNWE1MTRlZjljOGRjNGIiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3IvbmVnLTAzL3Rhc2sudG9tbCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiZGRiNjE4NTBjNGM5OTJiYTg0N2M5ODMzZGE3MjZjNzRmZDg1Nzg2MWJlYzQ2NzgxNzk0MTU1MGM0YzY3NjVmOSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9zY29wZS0wMS9pbnN0cnVjdGlvbi5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiZDIwNmVlNTM2YTQxMzUwYzQ0YTIzNzAwMDg5YzI2MWM1ZGFmNGE5OWFjY2IyY2Q0YzZhYTI3OWI3YzY3MGE5ZiIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL2hhcmJvci9zY29wZS0wMS90YXNrLnRvbWwiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjAxNDliMTdjOTViOTRmZWU2NzYwOWRmYjYwYTFjYjJhODJmNmJkZjAwNjhhMjAyYzZjN2IxYTNjZDJhNmU3N2YiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3Ivc2NvcGUtMDIvaW5zdHJ1Y3Rpb24ubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjc2NGZlODdkYWNjNTBhNGU5MmEzMjVkY2E1ZDNkMDY1ODM4ODI2YzZiMzY0OGJiODE3YjM1NGVkZWQ5MWFlYzUiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAibmFtZSI6ICJldmFscy9oYXJib3Ivc2NvcGUtMDIvdGFzay50b21sIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICI3Y2JhNGNlYjAzYWU3NzlmYWQ3MzhjYjBmMzQ5NjdmMGQxYjQwYzI4MjJiNTAwYzA4MzU1M2RhNmFkZDM5OWMwIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL3Njb3BlLTAzL2luc3RydWN0aW9uLm1kIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICIyZTY1ZTZlYmE3NzVlZDAzOTVhNTRmOWM0NGUzZjI2MmZiZmQwMmY1ZDMwYzRlMGZjNzE2MTBiMTNkZGZhNjQ4IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAiZXZhbHMvaGFyYm9yL3Njb3BlLTAzL3Rhc2sudG9tbCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiMGY5NjJmYWQ2ZmRiYjQxY2E2MDEwOGNiZjM4NjdkZjhkODlmN2M5YTUxNWVjZjNmYmE5OGY2N2Q1NDUzYTUwYSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogImV2YWxzL3NldHVwX2NwdS5zaCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiYWY5N2E2Y2ZhYTllNjczNTQ2NzM4NGQ3ZDRlNzVkZjI3YzhhNWVlM2MzNzk3NjhiYWQ3NjU0MGIwOGQ0NzhkZSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogInJlZmVyZW5jZXMvY29tcG9zaXRpb24tYW5kLWV4dGVuc2lvbi5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiNTNmMDk4ZmYyZjlmNTg5YTk3OTRlMjU4NjNkMjg2ODE1NzIyMTA5NzNjYzk2OTQ4YzQ1NTViOWZmYmQ2ZWVkYSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogInJlZmVyZW5jZXMvZGF0YS5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiMzkzNzdhMmY5MmRlNGFhNzliMjlhODYxYmRkODAwY2Q1MmZiZGU3MzZmODA3NTJmMWJkZTA2ODdkMzI4MGZiOSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogInJlZmVyZW5jZXMvZHluYW1pY3Mtb3B0aW1pemF0aW9uLm1kIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICIxZGRjZGQ5NDZhMzZlYzQ2NTRjNDEwOWQ2OTU2NjIwYTAxNTJjYWNhN2UzMzg1YjU3MjQzM2YwYjM3YmM0MDE3IgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAicmVmZXJlbmNlcy9nZW5lcmF0aXZlLXdvcmtmbG93cy5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiN2UyMGRjOTAxMGJhNGE4NDEzNGZmZjgyNTA2N2Y0MjgzNWE0Nzg4OTljYWRkY2Y2MzVjYTEyYjgzMzYyMjY4NSIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogInJlZmVyZW5jZXMvbW9kZWxzLm1kIiwKICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICJlYWE1NDM3ODU5YzQwMDVlZjQwYmZkNTcyYTk3YzI2MmI4NWJjZmQxNzI3NWI1NGM3ZTI0N2IxYWQzYjk0ZGIwIgogICAgICB9LAogICAgICB7CiAgICAgICAgIm5hbWUiOiAicmVmZXJlbmNlcy90cmFpbmluZy5tZCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJkaWdlc3QiOiAiMjJhYjcxYmUzYjZhZWM3Yjk5MjcyMWE0ODUxZGI3MDA5Mzg2NDk2ZTg4MjRlMDJmYzBhYWUwOTk1NGY4NzI1ZiIKICAgICAgfSwKICAgICAgewogICAgICAgICJuYW1lIjogInNraWxsLWNhcmQubWQiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAiZGlnZXN0IjogIjQ1NDg0MTQ5ZmUwYTNhNGRjMTUxOGEyODdmM2M2YjQyYWFmM2NmODU3NWE4OWVhYmQ0NDRlNWNhZWY4MjBlYzIiCiAgICAgIH0KICAgIF0KICB9Cn0=","payloadType":"application/vnd.in-toto+json","signatures":[{"sig":"MGYCMQCi9UXFeLiLxUCyPvsrLv6BzhDmZjzFc+gGoR8zyoLDxjBQb9HYs6If+x2lb5xPLzkCMQD3GdJNoaYK8UemN4bDP/X/+cCeljc2gDZ887pKMIXf+9EYROpfxZds3xAoXCNVbc8=","keyid":""}]}} \ No newline at end of file