s42chen commited on
Commit
f7aeb4e
·
verified ·
1 Parent(s): 822230a

Add files using upload-large-folder tool

Browse files
Files changed (31) hide show
  1. README.md +8 -5
  2. reproduction/files/b8/b8fb00d62a620bf637a35d0a187466db26f8a6f0f6f483742323477ed9b18a27/task_profiles.py +232 -0
  3. shared/package-files/15/1533af4a35b861ab993cc345ca9427367bf8598cb7509ae356657387954302fc/predict.py +66 -0
  4. shared/package-files/15/153991f4d9778419ba659e9e25a93c7212748d7ee3812cd95b0e8584d920a35e/infer.py +282 -0
  5. shared/package-files/17/17e3abdadab8ff46bcb82c1a437ce5e34c24a0f50d7803feb0ea7a0066651f5a/EXPERIMENTS.md +1016 -0
  6. shared/package-files/1f/1f7768dd917533f2d14a11c4f28f4afbbcf6e25ca94bd8e360835f8a0df44405/predict.py +180 -0
  7. shared/package-files/1f/1f7c0663465b01d97ff4ec9da36bf75146b88fb255402887f579a0dc60b7519e/model_config.json +206 -0
  8. shared/package-files/1f/1fc2e9d3bb7cb98f342fe2dce097279e252df317a962e625af2aa99ac68b5cb8/model.py +67 -0
  9. shared/package-files/41/417f003ee44c62cd8aac22ef71b5c4416d5dc38791aad4ba629b42b5fdafb7e0/infer.py +242 -0
  10. shared/package-files/41/41ae8da4b43a996c61d439a7cc34629031489fd85dfa46bff2dee57c1fe95777/direct_forward_runtime.py +45 -0
  11. shared/package-files/41/41fbf5a709a2978e26e8ee65c1f040d30fb0b7f70ec111f67dd83bbc7a600681/EXPERIMENTS.md +864 -0
  12. shared/package-files/4a/4ac1ff250fc2b604f7a5a8a9efde98c5a1511beb11f6d6610900b65de170ae2a/mass-error-model.json +76 -0
  13. shared/package-files/4f/4f3123ec614b5c73ec6784dd27b53b3cec463c11566093ea31c4e7d4dfd6f27d/model_config.json +194 -0
  14. shared/package-files/4f/4f6c7bd133bd4d17d613a8f91d6a95ba290e6181ce5aa42b3303715caf50ee24/model_manifest.json +13 -0
  15. shared/package-files/55/5595b3ec75506a43b91961d851efd3ec0969d243ee1c62df76d9754dc1f5d3f4/README.md +21 -0
  16. shared/package-files/55/55cd07c1ae927779e611361b1d037082f0aa6d15aa08d0eee131f62f88a2af89/README.md +19 -0
  17. shared/package-files/77/77c5dcb5804ea9f87d5e5efa3ac92fc92f00355a421f6e1aefab2a27df653eb3/model_manifest.json +13 -0
  18. shared/package-files/83/838fc9ba55674dbfb740b9541f763d1bcfcf9a61e58f99a1019538ad0a5145e6/README.md +17 -0
  19. shared/package-files/83/83b354c4b4827f7b34eb6067a523a26cbb5f8b6f8ef9019fc1c5b8460aa9390e/README.md +15 -0
  20. shared/package-files/98/982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d/molecular_graph_features.py +38 -0
  21. shared/package-files/98/982f43fbb43dac1fdb465567e7bb282d601114437f66d1726fc9b16c751b70cf/model_config.json +338 -0
  22. shared/package-files/98/98bd29092b2f673242209bbc90508f34a88bd1bf9eb7bb20bf23e24138be0040/model_config.json +338 -0
  23. shared/package-files/98/98d57d911bb5b74fed6a67f3769079837d05894336e4a7989a5d2fd627383ec0/preparation.json +0 -0
  24. shared/package-files/98/98e37e2cec879ea0f78e24e7e21d7a04f8e700a3d3173ffe8a6036ccd7474789/predict.py +198 -0
  25. shared/package-files/bc/bceb0eb0405cf659f313c5237bff71454cb4aa7eb092008fcf8e95c52040d561/model_config.json +232 -0
  26. shared/package-files/bc/bcef8d39ee980403916c42e282b0afc4af86473c59ee1dd6435267fdc7722f95/predict.py +61 -0
  27. shared/package-files/d1/d1e3521fc473facfbfafc8d8d7cdbd7125932fc01abf29a6017df7350efaba8d/README.md +17 -0
  28. shared/package-files/fe/fe39ad2cc9c157a595c2e916c235c721f99cfef28c4ad6253b2f1af49c0ba178/EXPERIMENTS.md +1002 -0
  29. shared/package-files/fe/fe4fc26586c3d600fdc06939efd07c6e8413c51d42f30a146a80014f87d7af89/graph_fragment_features.py +36 -0
  30. shared/package-files/fe/fe543bb675e7bf2213e6cb402b564b2f8718f8541c1d57072e52e95233866ecb/EXPERIMENTS.md +1277 -0
  31. shared/package-files/fe/fe8dd43e26925057812ef5eb7085bbbc90a3e14bd6c6e0f1a2b7dca3947cea87/model_config.json +182 -0
README.md CHANGED
@@ -6,13 +6,13 @@ tags:
6
  - research-artifacts
7
  ---
8
 
9
- # Science Speedrun: 42 completed task histories
10
 
11
  Reproducible submitted solutions, native evaluation reports, and screened agent logs from
12
- GPT-6 Astra (Codex, xhigh reasoning; 22 histories) and from Claude Code
13
  (Fable 5.2 requested, xhigh effort; 20 histories, see "Claude Code runs" below). These are
14
  file artifacts, not a tabular training dataset.
15
- The histories contain 910 inference-distinct candidates; each has a completed
16
  sealed evaluation. Existing additional measurements of duplicate packages are retained.
17
  `reviews/fairness-20261031/` holds the operator-side fairness review of every first-round
18
  trajectory (per-task verdicts and the cross-cutting infrastructure findings); each first-round
@@ -22,6 +22,7 @@ the first trial it repeats under `fresh_trial_of`.
22
  | Task | Agent · model | Distinct candidates | Artifacts |
23
  |---|---|---:|---|
24
  | atomistic-materials | Codex · gpt-6-astra | 3 | [Files](tasks/atomistic-materials/atomistic-materials-astra-xhigh-1h100-48h-20261020b) |
 
25
  | atomistic-materials | Claude Code · claude-fable-5-2 | 11 | [Files](tasks/atomistic-materials/atomistic-materials-fable52-xhigh-1h100-48h-20261110a) |
26
  | brain-computer-interface-decoding | Codex · gpt-6-astra | 127 | [Files](tasks/brain-computer-interface-decoding/brain-computer-interface-decoding-astra-xhigh-1h100-48h-20261031a) |
27
  | brain-computer-interface-decoding | Claude Code · claude-fable-5-2 | 14 | [Files](tasks/brain-computer-interface-decoding/brain-computer-interface-decoding-fable52-xhigh-1h100-48h-20261110a) |
@@ -36,6 +37,7 @@ the first trial it repeats under `fresh_trial_of`.
36
  | genome-sequence-to-function | Codex · gpt-6-astra | 33 | [Files](tasks/genome-sequence-to-function/genome-sequence-to-function-astra-xhigh-1h100-48h-20261022a) |
37
  | genome-sequence-to-function | Claude Code · claude-fable-5-2 | 26 | [Files](tasks/genome-sequence-to-function/genome-sequence-to-function-fable52-xhigh-1h100-48h-20261110a) |
38
  | mass-spectrometry-molecule-retrieval | Codex · gpt-6-astra | 21 | [Files](tasks/mass-spectrometry-molecule-retrieval/mass-spectrometry-molecule-retrieval-astra-xhigh-1h100-48h-20261020b) |
 
39
  | mass-spectrometry-molecule-retrieval | Claude Code · claude-fable-5-2 | 17 | [Files](tasks/mass-spectrometry-molecule-retrieval/mass-spectrometry-molecule-retrieval-fable52-xhigh-1h100-48h-20261110a) |
40
  | molecular-pretraining-transfer | Codex · gpt-6-astra | 14 | [Files](tasks/molecular-pretraining-transfer/molecular-pretraining-transfer-astra-xhigh-1h100-48h-20261023a) |
41
  | molecular-pretraining-transfer | Claude Code · claude-fable-5-2 requested, claude-opus-5 fallback (105 / 504 requests) | 15 | [Files](tasks/molecular-pretraining-transfer/molecular-pretraining-transfer-fable52-xhigh-1h100-48h-20261110a) |
@@ -44,6 +46,7 @@ the first trial it repeats under `fresh_trial_of`.
44
  | pde-surrogate | Codex · gpt-6-astra | 60 | [Files](tasks/pde-surrogate/pde-surrogate-astra-xhigh-1h100-48h-20261020b) |
45
  | pde-surrogate | Claude Code · claude-fable-5-2 | 24 | [Files](tasks/pde-surrogate/pde-surrogate-fable52-xhigh-1h100-48h-20261110a) |
46
  | probabilistic-global-weather | Codex · gpt-6-astra | 9 | [Files](tasks/probabilistic-global-weather/probabilistic-global-weather-astra-xhigh-1h100-48h-20261024f) |
 
47
  | probabilistic-global-weather | Claude Code · claude-fable-5-2 | 4 | [Files](tasks/probabilistic-global-weather/probabilistic-global-weather-fable52-xhigh-1h100-48h-20261110a) |
48
  | protein-design | Codex · gpt-6-astra | 1 | [Files](tasks/protein-design/protein-design-astra-xhigh-1h100-48h-20261022a) · superseded by the corrected trial |
49
  | protein-design | Codex · gpt-6-astra | 3 | [Files](tasks/protein-design/protein-design-astra-xhigh-1h100-48h-20261027a) |
@@ -110,8 +113,8 @@ reproduce uninterrupted computation. The fairness review under `reviews/` quanti
110
  operator-caused losses per task and names the trials judged materially unfair. Fresh
111
  trials of those tasks were run from scratch (new session, same images, data, and budget) and
112
  are added as separate run directories next to the retained first trials, as each fresh
113
- history is fully scored: Protein Sequence (run 20261031a) is included; Weather, Genome,
114
- Atomistic Materials, and Mass Spectrometry will follow. Brain-computer interface decoding
115
  (BCI), the nineteenth task, ran once at its native budget; its five tracks are scored and
116
  plotted separately.
117
  Beaker execution uses documented isolation/resource adaptations and may grant more
 
6
  - research-artifacts
7
  ---
8
 
9
+ # Science Speedrun: 45 completed task histories
10
 
11
  Reproducible submitted solutions, native evaluation reports, and screened agent logs from
12
+ GPT-6 Astra (Codex, xhigh reasoning; 25 histories) and from Claude Code
13
  (Fable 5.2 requested, xhigh effort; 20 histories, see "Claude Code runs" below). These are
14
  file artifacts, not a tabular training dataset.
15
+ The histories contain 993 inference-distinct candidates; each has a completed
16
  sealed evaluation. Existing additional measurements of duplicate packages are retained.
17
  `reviews/fairness-20261031/` holds the operator-side fairness review of every first-round
18
  trajectory (per-task verdicts and the cross-cutting infrastructure findings); each first-round
 
22
  | Task | Agent · model | Distinct candidates | Artifacts |
23
  |---|---|---:|---|
24
  | atomistic-materials | Codex · gpt-6-astra | 3 | [Files](tasks/atomistic-materials/atomistic-materials-astra-xhigh-1h100-48h-20261020b) |
25
+ | atomistic-materials | Codex · gpt-6-astra | 19 | [Files](tasks/atomistic-materials/atomistic-materials-astra-xhigh-1h100-48h-20261031a) · fresh trial after the fairness review |
26
  | atomistic-materials | Claude Code · claude-fable-5-2 | 11 | [Files](tasks/atomistic-materials/atomistic-materials-fable52-xhigh-1h100-48h-20261110a) |
27
  | brain-computer-interface-decoding | Codex · gpt-6-astra | 127 | [Files](tasks/brain-computer-interface-decoding/brain-computer-interface-decoding-astra-xhigh-1h100-48h-20261031a) |
28
  | brain-computer-interface-decoding | Claude Code · claude-fable-5-2 | 14 | [Files](tasks/brain-computer-interface-decoding/brain-computer-interface-decoding-fable52-xhigh-1h100-48h-20261110a) |
 
37
  | genome-sequence-to-function | Codex · gpt-6-astra | 33 | [Files](tasks/genome-sequence-to-function/genome-sequence-to-function-astra-xhigh-1h100-48h-20261022a) |
38
  | genome-sequence-to-function | Claude Code · claude-fable-5-2 | 26 | [Files](tasks/genome-sequence-to-function/genome-sequence-to-function-fable52-xhigh-1h100-48h-20261110a) |
39
  | mass-spectrometry-molecule-retrieval | Codex · gpt-6-astra | 21 | [Files](tasks/mass-spectrometry-molecule-retrieval/mass-spectrometry-molecule-retrieval-astra-xhigh-1h100-48h-20261020b) |
40
+ | mass-spectrometry-molecule-retrieval | Codex · gpt-6-astra | 52 | [Files](tasks/mass-spectrometry-molecule-retrieval/mass-spectrometry-molecule-retrieval-astra-xhigh-1h100-48h-20261031a) · fresh trial after the fairness review |
41
  | mass-spectrometry-molecule-retrieval | Claude Code · claude-fable-5-2 | 17 | [Files](tasks/mass-spectrometry-molecule-retrieval/mass-spectrometry-molecule-retrieval-fable52-xhigh-1h100-48h-20261110a) |
42
  | molecular-pretraining-transfer | Codex · gpt-6-astra | 14 | [Files](tasks/molecular-pretraining-transfer/molecular-pretraining-transfer-astra-xhigh-1h100-48h-20261023a) |
43
  | molecular-pretraining-transfer | Claude Code · claude-fable-5-2 requested, claude-opus-5 fallback (105 / 504 requests) | 15 | [Files](tasks/molecular-pretraining-transfer/molecular-pretraining-transfer-fable52-xhigh-1h100-48h-20261110a) |
 
46
  | pde-surrogate | Codex · gpt-6-astra | 60 | [Files](tasks/pde-surrogate/pde-surrogate-astra-xhigh-1h100-48h-20261020b) |
47
  | pde-surrogate | Claude Code · claude-fable-5-2 | 24 | [Files](tasks/pde-surrogate/pde-surrogate-fable52-xhigh-1h100-48h-20261110a) |
48
  | probabilistic-global-weather | Codex · gpt-6-astra | 9 | [Files](tasks/probabilistic-global-weather/probabilistic-global-weather-astra-xhigh-1h100-48h-20261024f) |
49
+ | probabilistic-global-weather | Codex · gpt-6-astra | 12 | [Files](tasks/probabilistic-global-weather/probabilistic-global-weather-astra-xhigh-1h100-48h-20261031a) · fresh trial after the fairness review |
50
  | probabilistic-global-weather | Claude Code · claude-fable-5-2 | 4 | [Files](tasks/probabilistic-global-weather/probabilistic-global-weather-fable52-xhigh-1h100-48h-20261110a) |
51
  | protein-design | Codex · gpt-6-astra | 1 | [Files](tasks/protein-design/protein-design-astra-xhigh-1h100-48h-20261022a) · superseded by the corrected trial |
52
  | protein-design | Codex · gpt-6-astra | 3 | [Files](tasks/protein-design/protein-design-astra-xhigh-1h100-48h-20261027a) |
 
113
  operator-caused losses per task and names the trials judged materially unfair. Fresh
114
  trials of those tasks were run from scratch (new session, same images, data, and budget) and
115
  are added as separate run directories next to the retained first trials, as each fresh
116
+ history is fully scored: Protein Sequence, Weather, Atomistic Materials and Mass Spectrometry
117
+ (runs 20261031a) are included; Genome will follow. Brain-computer interface decoding
118
  (BCI), the nineteenth task, ran once at its native budget; its five tracks are scored and
119
  plotted separately.
120
  Beaker execution uses documented isolation/resource adaptations and may grant more
reproduction/files/b8/b8fb00d62a620bf637a35d0a187466db26f8a6f0f6f483742323477ed9b18a27/task_profiles.py ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Explicit development-only mounts and budgets for the added benchmark tasks."""
2
+ from pathlib import Path
3
+ import importlib
4
+ import json
5
+ import os
6
+ import shutil
7
+
8
+
9
+ PROFILES = {
10
+ "crystal-structure-generation": {
11
+ "cpus": 64, "memory_gib": 512, "shm_gib": 32,
12
+ "entries": [(f"mp20/{p}", f"mp20/{p}") for p in ("train.csv", "val.csv", "manifest.json")]
13
+ + [("scorer-assets", "scorer-assets")],
14
+ "imports": ["numpy", "pymatgen.core", "omg"],
15
+ "python_bin": "/opt/conda/bin", "entrypoint": "generate.sh",
16
+ },
17
+ "fluid-flow-control": {
18
+ "cpus": 64, "memory_gib": 1536, "shm_gib": 32,
19
+ "entries": [("release.json", "release/release.json"),
20
+ ("materialized.json", "release/materialized.json"),
21
+ ("environments", "release/environments")],
22
+ "imports": ["numpy", "hydrogym", "pyarrow"],
23
+ "python_bin": "/home/easybuild/venvs/hydrogym_gpu/bin", "entrypoint": "infer.sh",
24
+ },
25
+ "molecular-pretraining-transfer": {
26
+ "cpus": 96, "memory_gib": 768, "shm_gib": 256,
27
+ "entries": [("public/pretrain", "pretrain"), ("public/downstream", "downstream")],
28
+ "imports": ["numpy", "rdkit", "lmdb", "unicore"],
29
+ "python_bin": "/opt/conda/bin", "entrypoint": "encoder.json",
30
+ },
31
+ "pde-surrogate": {
32
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
33
+ "entries": [(p, p) for p in ("ape2d-full", "pdearena-ns", "well-active_matter",
34
+ "well-turbulent_radiative_layer_2D", "release-receipt.json", "materialize-receipt.json")],
35
+ "imports": ["numpy", "h5py"],
36
+ "python_bin": "/usr/local/bin", "entrypoint": "infer.sh",
37
+ "check": ["python", "/opt/pde-surrogate/check_agent_mount.py", "/workspace/data", "/workspace/data/split.json"],
38
+ },
39
+ "probabilistic-global-weather": {
40
+ "cpus": 64, "memory_gib": 512, "shm_gib": 64, "storage_gib": 2048,
41
+ "entries": [("training-2017-2020", "training"),
42
+ ("development-inputs-2021", "development/inputs"),
43
+ ("development-weather-2021", "development/weather"),
44
+ ("development-precipitation-2021", "development/precipitation")],
45
+ "imports": ["numpy", "jax", "xarray", "weathernext"], "gpu_runtime": "jax",
46
+ "python_bin": "/opt/weather-python/bin", "entrypoint": "infer.sh",
47
+ "check": ["bwrap", "--unshare-all", "--ro-bind", "/", "/", "--proc", "/proc",
48
+ "--dev", "/dev", "/bin/true"],
49
+ },
50
+ "protein-design": {
51
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
52
+ "entries": [("development/fit", "fit"), ("development/tune", "tune")],
53
+ "imports": ["numpy", "gemmi", "atomworks", "lightning"],
54
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
55
+ },
56
+ "protein-sequence-modeling": {
57
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
58
+ "entries": [(f"public/development/{p}", p) for p in
59
+ ("fit", "tune", "pretrain", "manifest.json", "stats.json")],
60
+ "imports": ["numpy"],
61
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
62
+ },
63
+ "timeseries-forecasting": {
64
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
65
+ "entries": [(p, p) for p in ("gifteval_pretrain", "valid", "materialize-receipt.json")],
66
+ "imports": ["numpy", "pyarrow"],
67
+ "python_bin": "/usr/local/bin", "entrypoint": "infer.sh",
68
+ },
69
+ "surface-code-decoding": {
70
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
71
+ "entries": [(f"development/{p}", p) for p in
72
+ ("release.json", "inventory.json", "train", "validation", "reference")],
73
+ "imports": ["numpy", "stim", "pymatching", "jax"],
74
+ "gpu_runtime": "jax",
75
+ "python_bin": "/opt/qec/.venv/bin", "entrypoint": "infer.sh",
76
+ "check": ["python", "/opt/qec/check_resources.py", "--data-root", "/workspace/data"],
77
+ },
78
+ "fruit-fly-neuron-reconstruction": {
79
+ "cpus": 64, "memory_gib": 512, "shm_gib": 16,
80
+ "entries": [(p, p) for p in ("training", "validation", "runtime")],
81
+ "imports": ["numpy", "scipy", "h5py"],
82
+ "python_bin": "/usr/local/bin", "entrypoint": "package.json",
83
+ },
84
+ "mass-spectrometry-molecule-retrieval": {
85
+ "cpus": 64, "memory_gib": 512, "shm_gib": 32,
86
+ "entries": [(f"development/{p}", p) for p in
87
+ ("manifest.json", "train.jsonl", "validation.jsonl",
88
+ "validation_candidate_pools.jsonl", "glacier", "synthetic_augmentation")],
89
+ "imports": ["numpy", "rdkit"],
90
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
91
+ "check": ["python", "/workspace/data/check_resources.py", "--data-root", "/workspace/data"],
92
+ },
93
+ "atomistic-materials": {
94
+ "cpus": 128, "memory_gib": 768, "shm_gib": 64,
95
+ "entries": [(p, p) for p in ("pool", "val", "baselines/mp-standard")],
96
+ "imports": ["ase", "fairchem.core", "phonopy", "phono3py"],
97
+ "python_bin": "/opt/venv/bin", "entrypoint": "calculator.py",
98
+ },
99
+ "protein-folding-prediction": {
100
+ "cpus": 64, "memory_gib": 512, "shm_gib": 32,
101
+ "entries": [("manifests", "manifests"), ("objects", "objects"),
102
+ ("features", "features"), ("foldbench-val", "foldbench"), ("models", "models")],
103
+ "imports": ["numpy", "biotite", "esm", "transformers"],
104
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
105
+ },
106
+ "single-cell-perturbation-prediction": {
107
+ "cpus": 64, "memory_gib": 512, "shm_gib": 32,
108
+ "entries": [(f"dev/{p}", p) for p in
109
+ ("manifest.json", "splits.json", "gene_panel.csv",
110
+ "gene_panel_intersection.json", "train", "priors", "se600m",
111
+ "test/ctx_near/public", "test/ctx_mid/public", "test/ctx_far/public")],
112
+ "imports": ["numpy", "anndata", "h5py", "state"],
113
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
114
+ },
115
+ "genome-sequence-to-function": {
116
+ "cpus": 128, "memory_gib": 768, "shm_gib": 64,
117
+ "entries": [(p, p) for p in
118
+ ("reference", "public/train.parquet", "public/valid.parquet",
119
+ "public/junction_tracks.parquet", "metadata/tracks.parquet",
120
+ "labels/train.parquet", "labels/valid.parquet", "scoring/train",
121
+ "scoring/valid", "targets/train", "targets/valid", "variant_evals/valid")],
122
+ "imports": ["numpy", "pyarrow", "pysam", "zarr"],
123
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
124
+ },
125
+ # Natively one H100 (task.toml): launch with --gpus 1 and no --single-slot.
126
+ "brain-computer-interface-decoding": {
127
+ "cpus": 64, "memory_gib": 128, "shm_gib": 16,
128
+ "entries": [(f"runtime/development/{p}", p) for p in
129
+ ("faced", "tuev", "ad65", "openbmi", "longitudinal", "pretrained")],
130
+ "imports": ["numpy", "braindecode", "mne", "safetensors"],
131
+ "python_bin": "/opt/conda/bin", "entrypoint": "infer.sh",
132
+ },
133
+ }
134
+
135
+
136
+ def gpu_count(task):
137
+ """An explicit reduced-compute budget overrides the original task allocation."""
138
+ value = int(os.environ.get("SPEEDRUN_GPU_COUNT", "8" if task in PROFILES else "1"))
139
+ if value not in (1, 8):
140
+ raise ValueError("SPEEDRUN_GPU_COUNT must be 1 or 8")
141
+ return value
142
+
143
+
144
+ def cpu_count(task):
145
+ return 22 if os.environ.get("SPEEDRUN_SINGLE_SLOT") == "1" else PROFILES.get(task, {}).get("cpus", 64)
146
+
147
+
148
+ def validate_sources(task, root):
149
+ """Validate only the reviewed allowlist; the operator installer checks payload hashes."""
150
+ root = Path(root).resolve(strict=True)
151
+ entries = []
152
+ for source, target in PROFILES[task]["entries"]:
153
+ path = root / source
154
+ path.resolve(strict=True).relative_to(root)
155
+ if path.is_symlink() or not (path.is_file() or path.is_dir()):
156
+ raise ValueError(f"Missing or linked development source: {path}")
157
+ for item in (path, *path.parents):
158
+ if item == root.parent:
159
+ break
160
+ info = item.stat()
161
+ if info.st_uid == 1000 or info.st_mode & 0o022:
162
+ raise ValueError(f"Researcher could alter development source: {item}")
163
+ entries.append({"source": source, "target": target, "kind": "directory" if path.is_dir() else "file"})
164
+ return entries
165
+
166
+
167
+ def configure_data(task, workspace):
168
+ data_root = Path("/task-data")
169
+ for _, target in PROFILES[task]["entries"]:
170
+ source = data_root / target
171
+ if not source.exists():
172
+ raise RuntimeError(f"Missing scoped development mount: {source}")
173
+ # Preserve the original image's data documentation/helper files beside the
174
+ # scoped mounts. Keep one real data root so upstream containment checks work.
175
+ image_data = Path("/opt/task-workspace/data")
176
+ for source in image_data.rglob("*"):
177
+ relative = source.relative_to(image_data)
178
+ destination = data_root / relative
179
+ if any(relative == Path(t) or Path(t) in relative.parents
180
+ for _, t in PROFILES[task]["entries"]):
181
+ continue
182
+ if source.is_dir():
183
+ destination.mkdir(parents=True, exist_ok=True)
184
+ destination.chmod(0o755)
185
+ elif source.is_file() and not destination.exists():
186
+ destination.parent.mkdir(parents=True, exist_ok=True)
187
+ shutil.copyfile(source, destination)
188
+ destination.chmod(0o444)
189
+ destination = workspace / "data"
190
+ if not destination.is_symlink():
191
+ raise RuntimeError("Expected the persistent workspace data link")
192
+ destination.unlink()
193
+ destination.symlink_to(data_root, target_is_directory=True)
194
+
195
+
196
+ def probe_data(task):
197
+ profile = PROFILES[task]
198
+ for module in profile["imports"]:
199
+ importlib.import_module(module)
200
+ entries = []
201
+ for _, target in profile["entries"]:
202
+ path = Path("/workspace/data") / target
203
+ assert path.resolve() == (Path("/task-data") / target).resolve()
204
+ assert not os.access(path, os.W_OK), f"Writable data mount: {path}"
205
+ sample = next((p for p in path.rglob("*") if p.is_file()), None) if path.is_dir() else path
206
+ if sample:
207
+ assert not os.access(sample, os.W_OK), f"Writable data file: {sample}"
208
+ with sample.open("rb") as stream:
209
+ stream.read(64)
210
+ entries.append(target)
211
+ # Explicitly reject evaluation roots that exist in the operator materialization.
212
+ forbidden = ("private", "verifier", "grader", "foldbench-test", "public/test.parquet",
213
+ "labels/test.parquet", "targets/test", "scoring/test",
214
+ "variant_evals/public", "variant_evals/labels")
215
+ if task != "single-cell-perturbation-prediction":
216
+ forbidden += ("test",)
217
+ else:
218
+ for context in ("ctx_near", "ctx_mid", "ctx_far"):
219
+ public = Path("/workspace/data/test") / context / "public"
220
+ assert len((public / "requests.jsonl").read_text().splitlines()) == 300
221
+ assert not (public / "responses.h5ad").exists()
222
+ assert not (public.parent / "private").exists()
223
+ for name in forbidden:
224
+ assert not (Path("/workspace/data") / name).exists(), f"Evaluation role leaked: {name}"
225
+ if task == "crystal-structure-generation":
226
+ assert not Path("/workspace/data/mp20/test.csv").exists()
227
+ assert Path("/workspace/data/scorer-assets/READY.json").is_file()
228
+ if task == "protein-folding-prediction":
229
+ manifest = json.loads(Path("/workspace/data/foldbench/suite/suite_manifest.json").read_text())
230
+ assert len(manifest["requests"]) == 74
231
+ return {"development_data_ok": True, "data_readonly": True,
232
+ "development_mounts": entries, "evaluation_roles_absent": True}
shared/package-files/15/1533af4a35b861ab993cc345ca9427367bf8598cb7509ae356657387954302fc/predict.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Portable ranking for arbitrary conforming spectra and candidate pools."""
3
+ import argparse, json, os, time
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from functools import lru_cache
6
+ from pathlib import Path
7
+ import numpy as np
8
+ import torch
9
+ from features import molecule_features,spectrum_features,sha256
10
+ from model import PeakFingerprint,normalized_fp
11
+ from scoring import rank_scores
12
+
13
+ @lru_cache(maxsize=8192)
14
+ def cached_features(smiles): return molecule_features(smiles)[0]
15
+ def encode_pool(item):
16
+ pool_id,candidates=item
17
+ return pool_id,np.stack([cached_features(c['smiles']) for c in candidates])
18
+
19
+ @torch.inference_mode()
20
+ def main():
21
+ ap=argparse.ArgumentParser(); ap.add_argument('input_root',type=Path); ap.add_argument('output_root',type=Path); ap.add_argument('--internal-scores',type=Path,help='Fresh per-invocation score exchange for the containing hybrid'); args=ap.parse_args()
22
+ root=Path(__file__).resolve().parent; manifest=json.loads((root/'model_manifest.json').read_text()); config=json.loads((root/manifest['model_config']).read_text())
23
+ checkpoint=root/manifest['checkpoint']['path']
24
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']: raise ValueError('checkpoint checksum mismatch')
25
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
26
+ pools={r['candidate_pool_id']:r['candidates'] for r in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
27
+ all_scores=np.full((len(queries),256),-np.inf,np.float32) if args.internal_scores else None
28
+ by_pool={}
29
+ for i,q in enumerate(queries): by_pool.setdefault(q['candidate_pool_id'],[]).append(i)
30
+ torch.set_num_threads(4); torch.set_float32_matmul_precision('high'); device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
31
+ state=torch.load(checkpoint,map_location='cpu',weights_only=False); model=PeakFingerprint(**state['model_config']).to(device).eval(); model.load_state_dict(state['state_dict'])
32
+ predictions=torch.empty((len(queries),6144),dtype=torch.float32)
33
+ rule=config.get('scoring_rule','cosine')
34
+ idf=None
35
+ if rule=='idf_cosine':
36
+ asset=config['idf_asset']; path=root/asset['path']
37
+ if sha256(path)!=asset['sha256']:raise ValueError('IDF checksum mismatch')
38
+ idf=torch.from_numpy(np.load(path)).to(device)
39
+ for start in range(0,len(queries),256):
40
+ features=[spectrum_features(r,max_peaks=state['model_config']['max_peaks']) for r in queries[start:start+256]]
41
+ peaks=torch.from_numpy(np.stack([f[0] for f in features])).to(device); meta=torch.from_numpy(np.stack([f[1] for f in features])).to(device)
42
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):
43
+ pred=model(peaks,meta).float().sigmoid()
44
+ predictions[start:start+len(features)]=pred.cpu()
45
+ del model
46
+ args.output_root.mkdir(parents=True,exist_ok=True); temp=args.output_root/'rankings.jsonl.tmp'; started=time.monotonic()
47
+ # Fork workers never execute CUDA; they only parse candidate SMILES and pack bits.
48
+ with ProcessPoolExecutor(max_workers=min(8,os.cpu_count() or 1)) as ex, temp.open('w') as f:
49
+ for count,(pid,packed) in enumerate(ex.map(encode_pool,((p,pools[p]) for p in by_pool),chunksize=1),1):
50
+ fp=torch.from_numpy(np.unpackbits(packed,axis=1).astype(np.float32)).to(device)
51
+ qix=by_pool[pid]; pred=predictions[qix].to(device)
52
+ # Match validation's bfloat16 feature rounding with float32 reduction.
53
+ scores=[]
54
+ for offset in range(0,len(qix),64):
55
+ scores.append(rank_scores(pred[offset:offset+64,None,:],fp[None,:,:],rule,idf).cpu().numpy())
56
+ scores=np.nan_to_num(np.concatenate(scores),nan=-np.inf,posinf=-np.inf,neginf=-np.inf); ids=[c['candidate_id'] for c in pools[pid]]
57
+ for i,s in zip(qix,scores):
58
+ if all_scores is not None:all_scores[i,:len(s)]=s
59
+ order=sorted(range(len(ids)),key=lambda j:(-float(s[j]),ids[j]))
60
+ f.write(json.dumps({'query_id':queries[i]['query_id'],'ranking':[ids[j] for j in order]},separators=(',',':'))+'\n')
61
+ if count%500==0: print(json.dumps({'pools_ranked':count,'total_pools':len(by_pool),'ranking_seconds':time.monotonic()-started}),flush=True)
62
+ os.replace(temp,args.output_root/'rankings.jsonl')
63
+ if args.internal_scores:
64
+ args.internal_scores.parent.mkdir(parents=True,exist_ok=True)
65
+ np.savez_compressed(args.internal_scores,scores=all_scores,query_ids=np.asarray([q['query_id'] for q in queries]))
66
+ if __name__=='__main__': main()
shared/package-files/15/153991f4d9778419ba659e9e25a93c7212748d7ee3812cd95b0e8584d920a35e/infer.py ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stream candidate simulations directly into entropy ranking, without a spectrum database."""
2
+ import argparse, hashlib, json, math, os, subprocess, sys, tempfile, time
3
+ from collections import OrderedDict,defaultdict
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from pathlib import Path
6
+ import numpy as np
7
+ import torch
8
+ from tolerance import entropy_tolerant,TOLERANCES
9
+ from torch.utils.data import Dataset,DataLoader
10
+ from rdkit import Chem,RDLogger
11
+ RDLogger.DisableLog('rdApp.*')
12
+ ROOT=Path(__file__).resolve().parent
13
+ sys.path.insert(0,str(ROOT/'vendor'))
14
+
15
+
16
+ def sha256(path):
17
+ h=hashlib.sha256()
18
+ with Path(path).open('rb') as f:
19
+ for b in iter(lambda:f.read(1024*1024),b''):h.update(b)
20
+ return h.hexdigest()
21
+
22
+ def supported_pool(item):
23
+ from ms_pred.common.chem_utils import VALID_ATOM_NUM
24
+ pid,candidates=item; out=[]
25
+ for i,c in enumerate(candidates):
26
+ m=Chem.MolFromSmiles(c['smiles'])
27
+ if m is None: continue
28
+ if any(a.GetAtomicNum() not in VALID_ATOM_NUM for a in m.GetAtoms()):continue
29
+ try:m=Chem.RemoveHs(m)
30
+ except Exception:continue
31
+ n=m.GetNumAtoms()
32
+ if n>100 or n<3:continue
33
+ out.append((Chem.MolToSmiles(m),i,n))
34
+ return pid,out
35
+
36
+ def observed(row,num_bins=150000):
37
+ mz=np.asarray(row['mzs'],np.float32); v=np.asarray(row['intensities'],np.float32)
38
+ keep=(mz<=row['precursor_mz']+1)&(v>0); mz,v=mz[keep],v[keep]
39
+ if not len(v):return np.zeros(50,np.int64),np.zeros(50,np.float32),np.zeros(50,np.float32)
40
+ v=np.sqrt(v/v.max()); strongest=np.argsort(v)[::-1][:50]; mz,v=mz[strongest],v[strongest]
41
+ keep=v>.001; mz,v=mz[keep],v[keep]
42
+ idx=np.floor(mz*((num_bins-1)/1500)).astype(np.int64)+1
43
+ keep=(idx>=0)&(idx<num_bins);idx,v,mz=idx[keep],v[keep],mz[keep]
44
+ unique=np.unique(idx); values=np.array([v[idx==j].max() for j in unique],np.float32)
45
+ representatives=np.array([mz[idx==j][np.argmax(v[idx==j])] for j in unique],np.float32)
46
+ bins=np.zeros(50,np.int64);probs=np.zeros(50,np.float32);mzs=np.zeros(50,np.float32);mzs[:len(unique)]=representatives
47
+ bins[:len(unique)]=unique
48
+ if values.sum()>0:probs[:len(unique)]=values/values.sum()
49
+ return bins,probs,mzs
50
+
51
+
52
+ def entropy_overlap(masses,intens,counts,obs_bins,obs_probs,assignment_rows,assignment_queries,num_bins=150000):
53
+ """1 - normalized Jensen-Shannon distance, matching the native sparse scorer."""
54
+ b,k=masses.shape; indices=torch.floor(masses*((num_bins-1)/1500)).long()+1
55
+ valid=(torch.arange(k,device=masses.device)[None,:]<counts[:,None])&(indices>=0)&(indices<num_bins)&(intens>0)
56
+ values=torch.where(valid,intens,torch.zeros_like(intens)).float()
57
+ dense=torch.zeros((b,num_bins),device=masses.device,dtype=torch.float32)
58
+ dense.scatter_add_(1,indices.clamp(0,num_bins-1),values)
59
+ total=values.sum(-1).clamp(min=1e-22)
60
+ p=dense[assignment_rows[:,None],obs_bins[assignment_queries]]/total[assignment_rows,None]
61
+ q=obs_probs[assignment_queries]
62
+ mix=p+q
63
+ score=(mix*torch.log(mix+1e-22)-p*torch.log(p+1e-22)-q*torch.log(q+1e-22)).sum(-1)/math.log(4)
64
+ return score
65
+
66
+
67
+ class CandidateDataset(Dataset):
68
+ def __init__(self,entries,processor,cache_size=128):self.entries=entries;self.processor=processor;self.cache=OrderedDict();self.cache_size=cache_size
69
+ def __len__(self):return len(self.entries)
70
+ def __getitem__(self,index):
71
+ from ms_pred import common
72
+ smi,group,candidate,atoms,adduct,instrument,energy,expert=self.entries[index]
73
+ key=(smi,adduct);feat=self.cache.get(key)
74
+ if feat is None:
75
+ try:
76
+ feat=self.processor.featurize_tree({'root_canonical_smiles':smi,'adduct':adduct,'collision_energy':energy},include_inten_targs=False,include_frag_targs=False)
77
+ except (ValueError, KeyError, IndexError, RuntimeError) as error:
78
+ return {'_index':index,'_feature_error':type(error).__name__,'_expert':expert}
79
+ self.cache[key]=feat
80
+ if len(self.cache)>self.cache_size:self.cache.popitem(last=False)
81
+ else:self.cache.move_to_end(key)
82
+ item=dict(feat,collision_energy=energy,name=str(index),adduct=common.ion2onehot_pos[adduct],instrument=common.instrument2onehot_pos[instrument],precursor=0.,_index=index,_expert=expert)
83
+ return item
84
+
85
+ def collate(batch):
86
+ from ms_pred.glacier.dataset import IntenDataset
87
+ errors=[b['_index'] for b in batch if '_feature_error' in b]; valid=[b for b in batch if '_feature_error' not in b]
88
+ out=IntenDataset.collate_fn(valid) if valid else {}
89
+ if len({b['_expert'] for b in batch})!=1:raise ValueError('Mixed expert batch')
90
+ out['_expert']=batch[0]['_expert']
91
+ out['_indices']=[b['_index'] for b in valid];out['_errors']=errors;return out
92
+
93
+ def to_device(batch,device):
94
+ for k,v in batch.items():
95
+ if torch.is_tensor(v):batch[k]=v.to(device)
96
+ elif k=='graphormer_input' and v is not None:batch[k]={a:b.to(device) for a,b in v.items()}
97
+ return batch
98
+
99
+ @torch.inference_mode()
100
+ def predict_sparse(model,batch,k=100):
101
+ out=model.forward(batch['graphormer_input'],batch['num_atoms'],batch['adducts'],batch['collision_engs'],root_form_vecs=batch['root_form_vecs'],masses=batch['masses'],adduct_mass_shifts=batch['adduct_mass_shifts'],atom_form_vecs=batch['atom_form_vecs'],adj_matrices=batch['adj_matrices'],atom_hs=batch['atom_hs'],total_hs=batch['total_hs'],instruments=batch['instruments'] if model.embed_instrument else None)
102
+ spec=out['inten_pred_end_to_end']['output'];frags=out['frags_pred']['fragment_count']
103
+ rows=frags*batch['adduct_mass_shifts'].shape[1]*model.output_size
104
+ valid=torch.arange(spec.shape[1],device=spec.device)[None,:]<rows[:,None]
105
+ vals,ix=torch.topk(spec[:,:,1].masked_fill(~valid,float('-inf')),min(k,spec.shape[1]),dim=1)
106
+ return spec[:,:,0].gather(1,ix),torch.where(torch.isfinite(vals),vals,0.),rows.clamp(max=ix.shape[1])
107
+
108
+
109
+ def domain(row,mode):
110
+ if mode=='all':return True
111
+ return row['adduct']=='[M+H]+' and row['instrument_type'] in {'Orbitrap','QTOF'} and row['collision_energy'] is not None
112
+
113
+ def write_input(root,queries,pools):
114
+ root.mkdir();needed={q['candidate_pool_id'] for q in queries}
115
+ (root/'queries.jsonl').write_text(''.join(json.dumps(q)+'\n' for q in queries))
116
+ (root/'candidate_pools.jsonl').write_text(''.join(json.dumps({'candidate_pool_id':p,'candidates':pools[p]})+'\n' for p in needed))
117
+ m={'schema':'massspecgym-retrieval-input/v1','source':'public-input runtime partition','counts':{'queries':len(queries),'candidate_pools':len(needed)},'files':{n:sha256(root/n) for n in ['queries.jsonl','candidate_pools.jsonl']}}
118
+ (root/'manifest.json').write_text(json.dumps(m)+'\n')
119
+
120
+ @torch.inference_mode()
121
+ def run(args):
122
+ started=time.monotonic(); config=json.loads((ROOT/'model_config.json').read_text());manifest=json.loads((ROOT/'model_manifest.json').read_text())
123
+ checkpoint=ROOT/manifest['checkpoint']['path']
124
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']:raise ValueError('checkpoint checksum mismatch')
125
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
126
+ pools={p['candidate_pool_id']:p['candidates'] for p in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
127
+ obs=[observed(q) for q in queries]
128
+ eligible=[domain(q,config['domain']) and obs[i][1].sum()>0 for i,q in enumerate(queries)]
129
+ poolids={q['candidate_pool_id'] for i,q in enumerate(queries) if eligible[i]}
130
+ workers=config.get('workers',8)
131
+ # CPU chemistry and loader workers are started before any CUDA initialization.
132
+ pool_items=((pid,pools[pid]) for pid in sorted(poolids))
133
+ if workers:
134
+ with ProcessPoolExecutor(max_workers=workers) as ex:supported=dict(ex.map(supported_pool,pool_items,chunksize=1))
135
+ else:supported=dict(map(supported_pool,pool_items))
136
+ for i,q in enumerate(queries):eligible[i]=eligible[i] and bool(supported.get(q['candidate_pool_id']))
137
+ groups={};group_queries=[];entries=[];remaining=[]
138
+ for i,q in enumerate(queries):
139
+ if not eligible[i]:continue
140
+ ce=q['collision_energy'];instrument=q['instrument_type'] if q['instrument_type'] in {'Orbitrap','QTOF'} else 'Unknown'
141
+ key=(q['candidate_pool_id'],q['adduct'],instrument,ce)
142
+ if key not in groups:
143
+ gi=len(groups);groups[key]=gi;group_queries.append([]);remaining.append(len(supported[q['candidate_pool_id']]))
144
+ energy=float('nan') if ce is None else float(ce)
145
+ expert=int(domain(q,'released'))
146
+ entries.extend((smi,gi,cidx,n,q['adduct'],instrument,energy,expert) for smi,cidx,n in supported[q['candidate_pool_id']])
147
+ group_queries[groups[key]].append(i)
148
+ entries.sort(key=lambda e:(e[7],e[3],e[0],e[4],e[1]))
149
+ print(json.dumps({'event':'prepared','queries':len(queries),'simulator_queries':int(sum(eligible)),'unique_conditions':len(groups),'candidate_simulations':len(entries),'seconds':time.monotonic()-started}),flush=True)
150
+ scores=np.full((len(queries),256),-1.,np.float32)
151
+ original_scores=np.full_like(scores,-1.) if args.research_scores is not None else None
152
+ energy_grid=config.get('missing_energy_grid',[])
153
+ energy_adducts=config.get('missing_energy_adducts', ['[M+H]+','[M+Na]+'])
154
+ if not isinstance(energy_adducts,list) or not energy_adducts or not set(energy_adducts)<=set(['[M+H]+','[M+Na]+']):raise ValueError('Invalid energy-marginalization adducts')
155
+ original_weight=float(config.get('missing_energy_original_weight',.5))
156
+ if not 0<=original_weight<=1:raise ValueError('Invalid missing-energy original weight')
157
+ if energy_grid and (len(energy_grid)!=3 or not all(math.isfinite(float(e)) for e in energy_grid)):raise ValueError('Invalid fixed missing-energy grid')
158
+ forward_evaluations=0
159
+ mode=config.get("native_similarity","grid")
160
+ if mode not in ["grid",*TOLERANCES]:raise ValueError("Unknown native similarity mode")
161
+ alternatives={key:np.full_like(scores,-1.) for key in ["grid",*TOLERANCES]} if args.research_scores is not None else {}
162
+ fallback_rows=queries; fallback={};inverse_scores=np.full(scores.shape,-np.inf,np.float32)
163
+ if fallback_rows:
164
+ with tempfile.TemporaryDirectory(prefix='massspec-fallback-') as tmp:
165
+ tmp=Path(tmp);write_input(tmp/'input',fallback_rows,pools)
166
+ subprocess.run(['bash',str(ROOT/'fallback/infer.sh'),str(tmp/'input'),str(tmp/'output'),'--internal-scores',str(tmp/'scores.npz')],check=True)
167
+ with np.load(tmp/'scores.npz',allow_pickle=False) as exported:
168
+ if exported['query_ids'].tolist()!=[q['query_id'] for q in queries] or exported['scores'].shape!=scores.shape:raise ValueError('Internal score alignment mismatch')
169
+ inverse_scores=exported['scores'].copy()
170
+ fallback={r['query_id']:r['ranking'] for r in (json.loads(l) for l in (tmp/'output/rankings.jsonl').open())}
171
+ if entries:
172
+ from ms_pred.glacier.joint_model import JointModel
173
+ from ms_pred.glacier.dataset import TreeProcessor
174
+ torch.set_num_threads(2);torch.set_float32_matmul_precision(config.get('matmul_precision','high'));torch.manual_seed(42)
175
+ model=JointModel.load_from_checkpoint(checkpoint,map_location='cpu',weights_only=False);model.eval();model.freeze()
176
+ asset=config['released_domain_asset'];other_checkpoint=ROOT/asset['path']
177
+ if sha256(other_checkpoint)!=asset['sha256']:raise ValueError('Released expert checksum mismatch')
178
+ other=JointModel.load_from_checkpoint(other_checkpoint,map_location='cpu',weights_only=False);other.eval();other.freeze()
179
+ for attr in ['pe_embed_k','embed_elem_group','multi_hop_max_dist']:
180
+ if getattr(model,attr)!=getattr(other,attr):raise ValueError('Expert feature configuration mismatch')
181
+ models={0:model,1:other}
182
+ processor=TreeProcessor(pe_embed_k=model.pe_embed_k,root_encode='graphormer',embed_elem_group=model.embed_elem_group,multi_hop_max_dist=model.multi_hop_max_dist)
183
+ dataset=CandidateDataset(entries,processor,cache_size=config.get('feature_cache_per_worker',128))
184
+ size=config.get('batch_size',64);batches=[];begin=0
185
+ while begin<len(entries):
186
+ end=begin+1
187
+ while end<len(entries) and entries[end][7]==entries[begin][7]:end+=1
188
+ batches.extend(range(i,min(i+size,end)) for i in range(begin,end,size));begin=end
189
+ loader=DataLoader(dataset,batch_sampler=batches,num_workers=workers,collate_fn=collate,multiprocessing_context='fork' if workers else None,prefetch_factor=1 if workers else None)
190
+ iterator=iter(loader);device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
191
+ for network in models.values():network.to(device)
192
+ obs_bins=torch.from_numpy(np.stack([x[0] for x in obs])).to(device);obs_probs=torch.from_numpy(np.stack([x[1] for x in obs])).to(device);obs_masses=torch.from_numpy(np.stack([x[2] for x in obs])).to(device)
193
+ completed=0;next_progress=4096;deadline_reached=False
194
+ for batch in iterator:
195
+ if time.monotonic()-started>=config.get('simulation_deadline_seconds',16000):
196
+ deadline_reached=True
197
+ print(json.dumps({'event':'simulation_deadline','completed':completed,'total':len(entries),'seconds':time.monotonic()-started}),flush=True)
198
+ break
199
+ indices=batch['_indices']; completed+=len(batch['_errors'])
200
+ for index in batch['_errors']:remaining[entries[index][1]]-=1
201
+ if batch['_errors']:print(json.dumps({'event':'unsupported_feature_entries','count':len(batch['_errors'])}),flush=True)
202
+ if not indices:continue
203
+ batch=to_device(batch,device);m,v,c=predict_sparse(models[batch['_expert']],batch,config.get('sparse_k',100))
204
+ forward_evaluations+=len(indices)
205
+ assignments=[(b,q,entries[index][2]) for b,index in enumerate(indices) for q in group_queries[entries[index][1]]]
206
+ a=np.asarray(assignments,np.int64);ar=torch.from_numpy(a[:,0]).to(device);aq=torch.from_numpy(a[:,1]).to(device)
207
+ computed={}
208
+ if mode=='grid' or alternatives:computed['grid']=entropy_overlap(m,v,c,obs_bins,obs_probs,ar,aq)
209
+ tolerance_modes=list(TOLERANCES) if alternatives else ([mode] if mode!='grid' else [])
210
+ if tolerance_modes:computed.update(entropy_tolerant(m,v,c,obs_masses,obs_probs,ar,aq,tolerance_modes))
211
+ if original_scores is not None:
212
+ original_scores[a[:,1],a[:,2]]=np.nan_to_num(computed[mode].cpu().numpy(),nan=-1.,posinf=-1.,neginf=-1.)
213
+ adduct_selected=torch.tensor([entries[index][4] in energy_adducts for index in indices],device=device,dtype=torch.bool)
214
+ missing=torch.isnan(batch['collision_engs'])
215
+ apply_energy_blend=missing & adduct_selected
216
+ if energy_grid and bool(missing.any()):
217
+ average={key:torch.zeros_like(value) for key,value in computed.items()}
218
+ for energy in energy_grid:
219
+ alternative_batch=dict(batch)
220
+ alternative_batch['collision_engs']=torch.where(missing,torch.full_like(batch['collision_engs'],float(energy)),batch['collision_engs'])
221
+ am,av,ac=predict_sparse(models[batch['_expert']],alternative_batch,config.get('sparse_k',100));forward_evaluations+=len(indices)
222
+ alternative={}
223
+ if mode=='grid' or alternatives:alternative['grid']=entropy_overlap(am,av,ac,obs_bins,obs_probs,ar,aq)
224
+ if tolerance_modes:alternative.update(entropy_tolerant(am,av,ac,obs_masses,obs_probs,ar,aq,tolerance_modes))
225
+ for key,value in alternative.items():average[key]+=value/len(energy_grid)
226
+ # Preserve the original forward pass for every observed-energy query.
227
+ computed={key:torch.where(apply_energy_blend[ar],original_weight*value+(1-original_weight)*average[key],value) for key,value in computed.items()}
228
+ for key,value in computed.items():
229
+ value=np.nan_to_num(value.cpu().numpy(),nan=-1.,posinf=-1.,neginf=-1.)
230
+ if key==mode:scores[a[:,1],a[:,2]]=value
231
+ if key in alternatives:alternatives[key][a[:,1],a[:,2]]=value
232
+ for index in indices:remaining[entries[index][1]]-=1
233
+ completed+=len(indices)
234
+ if completed>=next_progress:
235
+ print(json.dumps({'event':'simulated','candidates':completed,'total':len(entries),'seconds':time.monotonic()-started}),flush=True)
236
+ next_progress=(completed//4096+1)*4096
237
+ if hasattr(iterator,'_shutdown_workers'):iterator._shutdown_workers()
238
+ del iterator,loader,model,other,models,network
239
+ if completed!=len(entries) and not deadline_reached:raise RuntimeError('Incomplete simulation')
240
+ incomplete={q for g,n in enumerate(remaining) if n for q in group_queries[g]}
241
+ failed=[q for i,q in enumerate(queries) if eligible[i] and (i in incomplete or scores[i].max()<0)]
242
+ missing_failed=[q for q in failed if q['query_id'] not in fallback]
243
+ if missing_failed:
244
+ with tempfile.TemporaryDirectory(prefix='massspec-unsupported-') as tmp:
245
+ tmp=Path(tmp);write_input(tmp/'input',missing_failed,pools)
246
+ subprocess.run(['bash',str(ROOT/'fallback/infer.sh'),str(tmp/'input'),str(tmp/'output')],check=True)
247
+ fallback.update({r['query_id']:r['ranking'] for r in (json.loads(l) for l in (tmp/'output/rankings.jsonl').open())})
248
+ failed_ids={q['query_id'] for q in failed}
249
+ for i,q in enumerate(queries):
250
+ if q['query_id'] in failed_ids:eligible[i]=False
251
+ # All native and inverse forward calls are complete before this CPU-only gate.
252
+ # Keep simulation calls, their ordering and RNG consumption unchanged.
253
+ from fusion_gate_model import applies
254
+ from candidate_fusion_gate_model import CandidateFusionGate
255
+ from candidate_fusion_runtime import compute_weights
256
+ gate_asset=config['fusion_gate_asset'];gate_path=ROOT/gate_asset['path']
257
+ if sha256(gate_path)!=gate_asset['sha256']:raise ValueError('Fusion gate checksum mismatch')
258
+ gate_state=torch.load(gate_path,map_location='cpu',weights_only=False)
259
+ if gate_state['architecture']!='bounded-spectrum-candidate-aromatic-native-weight-v1':raise ValueError('Unknown candidate fusion gate')
260
+ gate=CandidateFusionGate(gate_state['state_dict']['mean'],gate_state['state_dict']['scale'])
261
+ gate.load_state_dict(gate_state['state_dict'],strict=True);gate.eval()
262
+ fusion_weights=compute_weights(queries,pools,gate)
263
+ if not np.isfinite(fusion_weights).all() or not ((fusion_weights>=.25)&(fusion_weights<=.75)).all():raise ValueError('Invalid fusion weights')
264
+ args.output_root.mkdir(parents=True,exist_ok=True);tmp=args.output_root/'rankings.jsonl.tmp'
265
+ with tmp.open('w') as f:
266
+ for i,q in enumerate(queries):
267
+ cs=pools[q['candidate_pool_id']];ids=[c['candidate_id'] for c in cs]
268
+ if eligible[i]:
269
+ native_weight=1. if domain(q,'released') else float(config.get('outside_native_weight',1.))
270
+ if applies(q):native_weight=fusion_weights[i,:len(ids)]
271
+ fused=native_weight*np.maximum(scores[i,:len(ids)],0.)+float(config['inverse_score_weight'])*np.where(np.isfinite(inverse_scores[i,:len(ids)]),inverse_scores[i,:len(ids)],0.)
272
+ ranking=[ids[j] for j in sorted(range(len(ids)),key=lambda j:(-float(fused[j]),ids[j]))]
273
+ else:ranking=fallback[q['query_id']]
274
+ if len(ranking)!=len(ids) or set(ranking)!=set(ids):raise ValueError('Invalid ranking')
275
+ f.write(json.dumps({'query_id':q['query_id'],'ranking':ranking},separators=(',',':'))+'\n')
276
+ os.replace(tmp,args.output_root/'rankings.jsonl')
277
+ if args.research_scores is not None:
278
+ args.research_scores.parent.mkdir(parents=True,exist_ok=True);np.savez_compressed(args.research_scores,scores=scores,inverse_scores=inverse_scores,eligible=np.asarray(eligible,dtype=bool),query_ids=np.asarray([q['query_id'] for q in queries]),native_original=original_scores,fusion_weights=fusion_weights,**{'native_'+key:value for key,value in alternatives.items()})
279
+ print(json.dumps({'event':'complete','elapsed_seconds':time.monotonic()-started,'queries':len(queries),'candidate_simulations':len(entries),'candidate_forward_evaluations':forward_evaluations,'missing_energy_grid':energy_grid,'missing_energy_adducts':energy_adducts}),flush=True)
280
+
281
+ if __name__=='__main__':
282
+ p=argparse.ArgumentParser();p.add_argument('input_root',type=Path);p.add_argument('output_root',type=Path);p.add_argument('--research-scores',type=Path,help='Development-only optional diagnostic outside the contracted output directory');run(p.parse_args())
shared/package-files/17/17e3abdadab8ff46bcb82c1a437ce5e34c24a0f50d7803feb0ea7a0066651f5a/EXPERIMENTS.md ADDED
@@ -0,0 +1,1016 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Selected sparse-seed ensemble
2
+
3
+ {
4
+ "experiment": "seed37-ensemble-v1",
5
+ "hypothesis": "An equal mean of independently trained sparse inverse seeds improves the fixed outside-domain ensemble.",
6
+ "changed_factor": "Replace only the outside sparse quarter with0.125seed23+0.125seed37. Condition,old,andadduct inverse weights remain0.25each; known inverse mean unchanged. Native6000/5098 and precursor priors unchanged.",
7
+ "seed": 37,
8
+ "checkpoint_sha256": "274a713c4136b98b38a220ebbd0ac327098375ba02c0728c92e4b681548fee16",
9
+ "validation_query_sha256": "3f2e5f420b68ac8db30fb4b6d901924c690872852fdfe0b36a2f27332db23818",
10
+ "base_publication_manifest": {
11
+ "schema": "massspecgym-retrieval-model/v1",
12
+ "checkpoint": {
13
+ "path": ".versions/generation-19theuvt/glacier.ckpt",
14
+ "sha256": "f31200ebf18e90e18fdacc307c4ff660875a211d14475e9e60dfd3edbd6f34a9",
15
+ "format": "pytorch"
16
+ },
17
+ "model_config": ".versions/generation-19theuvt/model_config.json",
18
+ "training_provenance": {
19
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only",
20
+ "pretrained_assets": []
21
+ }
22
+ },
23
+ "component_estimate": {
24
+ "baseline": {
25
+ "hit_rate_at_1": 0.37957710159876223,
26
+ "hit_rate_at_5": 0.5570912841670964,
27
+ "hit_rate_at_20": 0.7249097472924187
28
+ },
29
+ "replacement": {
30
+ "hit_rate_at_1": 0.38339350180505416,
31
+ "hit_rate_at_5": 0.5589479112944817,
32
+ "hit_rate_at_20": 0.725219185146983
33
+ },
34
+ "mean": {
35
+ "hit_rate_at_1": 0.38525012893243943,
36
+ "hit_rate_at_5": 0.5587416193914388,
37
+ "hit_rate_at_20": 0.7285198555956679
38
+ },
39
+ "paired_delta": {
40
+ "replacement": {
41
+ "estimate": 0.003816400206291903,
42
+ "lower": -0.0034530906703546414,
43
+ "upper": 0.011699533503382712,
44
+ "confidence": 0.95,
45
+ "resamples": 2000,
46
+ "seed": 0,
47
+ "molecule_groups": 1119,
48
+ "queries": 9695,
49
+ "grouping": "supplied target_inchikey connectivity block",
50
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
51
+ },
52
+ "mean": {
53
+ "estimate": 0.005673027333677153,
54
+ "lower": 0.0008657041172670547,
55
+ "upper": 0.01136134767422208,
56
+ "confidence": 0.95,
57
+ "resamples": 2000,
58
+ "seed": 0,
59
+ "molecule_groups": 1119,
60
+ "queries": 9695,
61
+ "grouping": "supplied target_inchikey connectivity block",
62
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
63
+ }
64
+ }
65
+ },
66
+ "status": "Selected: equal sparse-seed mean improves portable outside and full-component validation; combined relocated replay passes.",
67
+ "pretrained_assets": [],
68
+ "relocation": {
69
+ "queries": 4,
70
+ "inverse_component_max_score_difference": 0.0,
71
+ "unchanged_native_max_score_difference": 1.4901161193847656e-08,
72
+ "complete_rankings_match_independent_components": true,
73
+ "relocated": true,
74
+ "working_directory": "/tmp",
75
+ "output_sha256": "f212cff8c10cf984972180620171484731604b664ae88de9709959e975f04134"
76
+ },
77
+ "contract_inverse_compute": {
78
+ "command": [
79
+ "bash",
80
+ "/workspace/research/seed37-ensemble-v1/inverse-package/infer.sh",
81
+ "/workspace/research/directglacier-contract-input",
82
+ "/workspace/research/seed37-ensemble-v1/contract-inverse",
83
+ "--internal-scores",
84
+ "/workspace/research/seed37-ensemble-v1/contract-inverse-scores.npz"
85
+ ],
86
+ "started_utc": "2026-10-31T12:53:24.507531+00:00",
87
+ "finished_utc": "2026-10-31T12:53:30.741924+00:00",
88
+ "elapsed_seconds": 6.234425908973208,
89
+ "user_cpu_seconds": 4.682362,
90
+ "system_cpu_seconds": 1.290221,
91
+ "peak_child_rss_kib": 1234336,
92
+ "exit_code": 0
93
+ },
94
+ "contract_hybrid_compute": {
95
+ "command": [
96
+ "bash",
97
+ "/workspace/research/seed37-ensemble-v1/relocated-package/infer.sh",
98
+ "/workspace/research/directglacier-contract-input",
99
+ "/workspace/research/seed37-ensemble-v1/contract-hybrid",
100
+ "--research-scores",
101
+ "/workspace/research/seed37-ensemble-v1/contract-hybrid-scores.npz"
102
+ ],
103
+ "started_utc": "2026-10-31T12:53:30.777044+00:00",
104
+ "finished_utc": "2026-10-31T12:54:02.043255+00:00",
105
+ "elapsed_seconds": 31.266241503995843,
106
+ "user_cpu_seconds": 27.164665,
107
+ "system_cpu_seconds": 4.119886,
108
+ "peak_child_rss_kib": 1815112,
109
+ "exit_code": 0
110
+ },
111
+ "compute": {
112
+ "command": [
113
+ "bash",
114
+ "/workspace/research/seed37-ensemble-v1/inverse-package/infer.sh",
115
+ "/workspace/research/validation-fallback",
116
+ "/workspace/research/seed37-ensemble-v1/inverse-replay",
117
+ "--internal-scores",
118
+ "/workspace/research/seed37-ensemble-v1/scores.npz"
119
+ ],
120
+ "started_utc": "2026-10-31T12:48:42.542221+00:00",
121
+ "finished_utc": "2026-10-31T12:56:29.354579+00:00",
122
+ "elapsed_seconds": 466.81239589100005,
123
+ "user_cpu_seconds": 946.508155,
124
+ "system_cpu_seconds": 9.262165,
125
+ "peak_child_rss_kib": 2596220,
126
+ "exit_code": 0
127
+ },
128
+ "outside_report": {
129
+ "benchmark_score": {
130
+ "at_or_above_upper_reference": false,
131
+ "comparable_to_test_reference": false,
132
+ "direction": "maximize",
133
+ "evaluation_fold": "validation",
134
+ "lower_reference": 0.04004329004329004,
135
+ "metric": "hit_rate_at_1",
136
+ "raw_performance": 0.38525012893243943,
137
+ "saturation": null,
138
+ "score": 0.7605988031548577,
139
+ "unclipped_score": 0.7605988031548577,
140
+ "upper_reference": 0.4939052175894281,
141
+ "version": "massspecgym-retrieval-score/v1"
142
+ },
143
+ "external_reference_context": {
144
+ "comparable_to_this_validation_report": false,
145
+ "fold": "test",
146
+ "hit_rate_at_1": 0.4939052175894281,
147
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
148
+ },
149
+ "global_error": null,
150
+ "metrics": {
151
+ "hit_rate_at_1": 0.38525012893243943,
152
+ "hit_rate_at_20": 0.7284167096441465,
153
+ "hit_rate_at_5": 0.5587416193914388
154
+ },
155
+ "paired_baseline_delta": {
156
+ "confidence": 0.95,
157
+ "estimate": 0.005673027333677153,
158
+ "grouping": "supplied target_inchikey connectivity block",
159
+ "lower": 0.0008657041172670547,
160
+ "molecule_groups": 1119,
161
+ "queries": 9695,
162
+ "resamples": 2000,
163
+ "seed": 0,
164
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
165
+ "upper": 0.01136134767422208
166
+ },
167
+ "queries": 9695,
168
+ "schema": "massspecgym-retrieval-development-report/v1",
169
+ "strata": {
170
+ "adduct": {
171
+ "[M+H]+": {
172
+ "hit_rate_at_1": 0.4461476401774909,
173
+ "queries": 4958
174
+ },
175
+ "[M+Na]+": {
176
+ "hit_rate_at_1": 0.3215115051720498,
177
+ "queries": 4737
178
+ }
179
+ },
180
+ "candidate_pool_size": {
181
+ "129-256": {
182
+ "hit_rate_at_1": 0.3863518691104898,
183
+ "queries": 9657
184
+ },
185
+ "33-128": {
186
+ "hit_rate_at_1": 0.10526315789473684,
187
+ "queries": 38
188
+ }
189
+ },
190
+ "collision_energy": {
191
+ "20-39.999": {
192
+ "hit_rate_at_1": 0.23300970873786409,
193
+ "queries": 103
194
+ },
195
+ "40-59.999": {
196
+ "hit_rate_at_1": 0.4605263157894737,
197
+ "queries": 76
198
+ },
199
+ "<20": {
200
+ "hit_rate_at_1": 0.28,
201
+ "queries": 25
202
+ },
203
+ ">=60": {
204
+ "hit_rate_at_1": 0.32432432432432434,
205
+ "queries": 37
206
+ },
207
+ "missing": {
208
+ "hit_rate_at_1": 0.38682039348423947,
209
+ "queries": 9454
210
+ }
211
+ },
212
+ "instrument_type": {
213
+ "": {
214
+ "hit_rate_at_1": 0.6234567901234568,
215
+ "queries": 486
216
+ },
217
+ "Orbitrap": {
218
+ "hit_rate_at_1": 0.34662129314535733,
219
+ "queries": 8228
220
+ },
221
+ "QTOF": {
222
+ "hit_rate_at_1": 0.5912334352701325,
223
+ "queries": 981
224
+ }
225
+ },
226
+ "routing_domain": {
227
+ "fallback": {
228
+ "hit_rate_at_1": 0.38525012893243943,
229
+ "queries": 9695
230
+ }
231
+ }
232
+ },
233
+ "uncertainty": {
234
+ "confidence": 0.95,
235
+ "estimate": 0.38525012893243943,
236
+ "grouping": "supplied target_inchikey connectivity block",
237
+ "lower": 0.340724670195138,
238
+ "molecule_groups": 1119,
239
+ "queries": 9695,
240
+ "resamples": 2000,
241
+ "seed": 0,
242
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
243
+ "upper": 0.4318484203802568
244
+ },
245
+ "valid_rankings": 9695
246
+ },
247
+ "full_component_report": {
248
+ "benchmark_score": {
249
+ "at_or_above_upper_reference": true,
250
+ "comparable_to_test_reference": false,
251
+ "direction": "maximize",
252
+ "evaluation_fold": "validation",
253
+ "lower_reference": 0.04004329004329004,
254
+ "metric": "hit_rate_at_1",
255
+ "raw_performance": 0.5740388079674713,
256
+ "saturation": "upper",
257
+ "score": 1.0,
258
+ "unclipped_score": 1.1765594016913814,
259
+ "upper_reference": 0.4939052175894281,
260
+ "version": "massspecgym-retrieval-score/v1"
261
+ },
262
+ "external_reference_context": {
263
+ "comparable_to_this_validation_report": false,
264
+ "fold": "test",
265
+ "hit_rate_at_1": 0.4939052175894281,
266
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
267
+ },
268
+ "global_error": null,
269
+ "metrics": {
270
+ "hit_rate_at_1": 0.5740388079674713,
271
+ "hit_rate_at_20": 0.8510474033661022,
272
+ "hit_rate_at_5": 0.7376087292192084
273
+ },
274
+ "paired_baseline_delta": {
275
+ "confidence": 0.95,
276
+ "estimate": 0.002830819908384374,
277
+ "grouping": "supplied target_inchikey connectivity block",
278
+ "lower": 0.0005197303197202903,
279
+ "molecule_groups": 3185,
280
+ "queries": 19429,
281
+ "resamples": 2000,
282
+ "seed": 0,
283
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
284
+ "upper": 0.005267598288203097
285
+ },
286
+ "queries": 19429,
287
+ "schema": "massspecgym-retrieval-development-report/v1",
288
+ "strata": {
289
+ "adduct": {
290
+ "[M+H]+": {
291
+ "hit_rate_at_1": 0.6554587530628914,
292
+ "queries": 14692
293
+ },
294
+ "[M+Na]+": {
295
+ "hit_rate_at_1": 0.3215115051720498,
296
+ "queries": 4737
297
+ }
298
+ },
299
+ "candidate_pool_size": {
300
+ "129-256": {
301
+ "hit_rate_at_1": 0.574957454489196,
302
+ "queries": 19391
303
+ },
304
+ "33-128": {
305
+ "hit_rate_at_1": 0.10526315789473684,
306
+ "queries": 38
307
+ }
308
+ },
309
+ "collision_energy": {
310
+ "20-39.999": {
311
+ "hit_rate_at_1": 0.7791095890410958,
312
+ "queries": 4088
313
+ },
314
+ "40-59.999": {
315
+ "hit_rate_at_1": 0.7536694320357371,
316
+ "queries": 1567
317
+ },
318
+ "<20": {
319
+ "hit_rate_at_1": 0.5883333333333334,
320
+ "queries": 1200
321
+ },
322
+ ">=60": {
323
+ "hit_rate_at_1": 0.7769230769230769,
324
+ "queries": 3120
325
+ },
326
+ "missing": {
327
+ "hit_rate_at_1": 0.38682039348423947,
328
+ "queries": 9454
329
+ }
330
+ },
331
+ "instrument_type": {
332
+ "": {
333
+ "hit_rate_at_1": 0.6234567901234568,
334
+ "queries": 486
335
+ },
336
+ "Orbitrap": {
337
+ "hit_rate_at_1": 0.5796581300565727,
338
+ "queries": 16439
339
+ },
340
+ "QTOF": {
341
+ "hit_rate_at_1": 0.527555910543131,
342
+ "queries": 2504
343
+ }
344
+ },
345
+ "routing_domain": {
346
+ "fallback": {
347
+ "hit_rate_at_1": 0.38525012893243943,
348
+ "queries": 9695
349
+ },
350
+ "glacier_released": {
351
+ "hit_rate_at_1": 0.7620710910211629,
352
+ "queries": 9734
353
+ }
354
+ }
355
+ },
356
+ "uncertainty": {
357
+ "confidence": 0.95,
358
+ "estimate": 0.5740388079674713,
359
+ "grouping": "supplied target_inchikey connectivity block",
360
+ "lower": 0.5363340571148925,
361
+ "molecule_groups": 3185,
362
+ "queries": 19429,
363
+ "resamples": 2000,
364
+ "seed": 0,
365
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
366
+ "upper": 0.60854761243379
367
+ },
368
+ "valid_rankings": 19429
369
+ },
370
+ "scope": "Actual portable six-model inverse for9695outside queries, unchanged native production-tolerance predictions and unchanged9734known rankings. Not a new full combined simulator replay.",
371
+ "probe_candidate": {
372
+ "schema": "massspecgym-validation-paired-mces/v1",
373
+ "queries": 512,
374
+ "valid_rankings": 512,
375
+ "metrics": {
376
+ "hit_rate_at_1": 0.56640625,
377
+ "hit_rate_at_5": 0.71484375,
378
+ "hit_rate_at_20": 0.83203125,
379
+ "mces_at_1": 7.4423828125
380
+ },
381
+ "mces_unique_pairs": 454,
382
+ "mces_new_pairs": 3,
383
+ "elapsed_seconds": 1.5789514190109912,
384
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
385
+ "rankings_sha256": "e2b4226a3cf489a22313c3464bb144903dc0cc85bd48383fcf6bf68ed2c2e043",
386
+ "comparison": "validation only, not evidence of beating a test reference",
387
+ "strata": {
388
+ "adduct": {
389
+ "[M+H]+": {
390
+ "queries": 391,
391
+ "hit_rate_at_1": 0.6470588235294118
392
+ },
393
+ "[M+Na]+": {
394
+ "queries": 121,
395
+ "hit_rate_at_1": 0.30578512396694213
396
+ }
397
+ },
398
+ "instrument_type": {
399
+ "": {
400
+ "queries": 17,
401
+ "hit_rate_at_1": 0.5294117647058824
402
+ },
403
+ "Orbitrap": {
404
+ "queries": 431,
405
+ "hit_rate_at_1": 0.5846867749419954
406
+ },
407
+ "QTOF": {
408
+ "queries": 64,
409
+ "hit_rate_at_1": 0.453125
410
+ }
411
+ },
412
+ "collision_energy": {
413
+ "20-39.999": {
414
+ "queries": 98,
415
+ "hit_rate_at_1": 0.8163265306122449
416
+ },
417
+ "40-59.999": {
418
+ "queries": 47,
419
+ "hit_rate_at_1": 0.7872340425531915
420
+ },
421
+ "<20": {
422
+ "queries": 39,
423
+ "hit_rate_at_1": 0.717948717948718
424
+ },
425
+ ">=60": {
426
+ "queries": 82,
427
+ "hit_rate_at_1": 0.6829268292682927
428
+ },
429
+ "missing": {
430
+ "queries": 246,
431
+ "hit_rate_at_1": 0.3617886178861789
432
+ }
433
+ },
434
+ "candidate_pool_size": {
435
+ "129-256": {
436
+ "queries": 511,
437
+ "hit_rate_at_1": 0.5675146771037182
438
+ },
439
+ "33-128": {
440
+ "queries": 1,
441
+ "hit_rate_at_1": 0.0
442
+ }
443
+ },
444
+ "routing_domain": {
445
+ "fallback": {
446
+ "queries": 257,
447
+ "hit_rate_at_1": 0.36186770428015563
448
+ },
449
+ "glacier_released": {
450
+ "queries": 255,
451
+ "hit_rate_at_1": 0.7725490196078432
452
+ }
453
+ }
454
+ },
455
+ "uncertainty": {
456
+ "estimate": 0.56640625,
457
+ "lower": 0.5130780015916394,
458
+ "upper": 0.6220112244897958,
459
+ "confidence": 0.95,
460
+ "resamples": 2000,
461
+ "seed": 0,
462
+ "molecule_groups": 389,
463
+ "queries": 512,
464
+ "grouping": "supplied target_inchikey connectivity block",
465
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
466
+ }
467
+ },
468
+ "probe_baseline": {
469
+ "schema": "massspecgym-validation-paired-mces/v1",
470
+ "queries": 512,
471
+ "valid_rankings": 512,
472
+ "metrics": {
473
+ "hit_rate_at_1": 0.5703125,
474
+ "hit_rate_at_5": 0.716796875,
475
+ "hit_rate_at_20": 0.8359375,
476
+ "mces_at_1": 7.4609375
477
+ },
478
+ "mces_unique_pairs": 451,
479
+ "mces_new_pairs": 0,
480
+ "elapsed_seconds": 1.15448702298454,
481
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
482
+ "rankings_sha256": "b1de460171201cfb3da835ba0007b8ab806afe0f953936766c57c2b57281d8f7",
483
+ "comparison": "validation only, not evidence of beating a test reference",
484
+ "strata": {
485
+ "adduct": {
486
+ "[M+H]+": {
487
+ "queries": 391,
488
+ "hit_rate_at_1": 0.6445012787723785
489
+ },
490
+ "[M+Na]+": {
491
+ "queries": 121,
492
+ "hit_rate_at_1": 0.3305785123966942
493
+ }
494
+ },
495
+ "instrument_type": {
496
+ "": {
497
+ "queries": 17,
498
+ "hit_rate_at_1": 0.5882352941176471
499
+ },
500
+ "Orbitrap": {
501
+ "queries": 431,
502
+ "hit_rate_at_1": 0.5870069605568445
503
+ },
504
+ "QTOF": {
505
+ "queries": 64,
506
+ "hit_rate_at_1": 0.453125
507
+ }
508
+ },
509
+ "collision_energy": {
510
+ "20-39.999": {
511
+ "queries": 98,
512
+ "hit_rate_at_1": 0.8163265306122449
513
+ },
514
+ "40-59.999": {
515
+ "queries": 47,
516
+ "hit_rate_at_1": 0.7872340425531915
517
+ },
518
+ "<20": {
519
+ "queries": 39,
520
+ "hit_rate_at_1": 0.717948717948718
521
+ },
522
+ ">=60": {
523
+ "queries": 82,
524
+ "hit_rate_at_1": 0.6829268292682927
525
+ },
526
+ "missing": {
527
+ "queries": 246,
528
+ "hit_rate_at_1": 0.3699186991869919
529
+ }
530
+ },
531
+ "candidate_pool_size": {
532
+ "129-256": {
533
+ "queries": 511,
534
+ "hit_rate_at_1": 0.5714285714285714
535
+ },
536
+ "33-128": {
537
+ "queries": 1,
538
+ "hit_rate_at_1": 0.0
539
+ }
540
+ },
541
+ "routing_domain": {
542
+ "fallback": {
543
+ "queries": 257,
544
+ "hit_rate_at_1": 0.36964980544747084
545
+ },
546
+ "glacier_released": {
547
+ "queries": 255,
548
+ "hit_rate_at_1": 0.7725490196078432
549
+ }
550
+ }
551
+ },
552
+ "uncertainty": {
553
+ "estimate": 0.5703125,
554
+ "lower": 0.5188862110356727,
555
+ "upper": 0.6247567365269461,
556
+ "confidence": 0.95,
557
+ "resamples": 2000,
558
+ "seed": 0,
559
+ "molecule_groups": 389,
560
+ "queries": 512,
561
+ "grouping": "supplied target_inchikey connectivity block",
562
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
563
+ }
564
+ },
565
+ "probe_scope": "Fixed512 subset of full-component rankings, not a fresh512 inverse batching replay. Same selected weights and native scores; all512queries present.",
566
+ "previous_publication": {
567
+ "schema": "massspecgym-retrieval-model/v1",
568
+ "checkpoint": {
569
+ "path": ".versions/generation-19theuvt/glacier.ckpt",
570
+ "sha256": "f31200ebf18e90e18fdacc307c4ff660875a211d14475e9e60dfd3edbd6f34a9",
571
+ "format": "pytorch"
572
+ },
573
+ "model_config": ".versions/generation-19theuvt/model_config.json",
574
+ "training_provenance": {
575
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only",
576
+ "pretrained_assets": []
577
+ }
578
+ },
579
+ "selected_full_report": {
580
+ "benchmark_score": {
581
+ "at_or_above_upper_reference": true,
582
+ "comparable_to_test_reference": false,
583
+ "direction": "maximize",
584
+ "evaluation_fold": "validation",
585
+ "lower_reference": 0.04004329004329004,
586
+ "metric": "hit_rate_at_1",
587
+ "raw_performance": 0.5740388079674713,
588
+ "saturation": "upper",
589
+ "score": 1.0,
590
+ "unclipped_score": 1.1765594016913814,
591
+ "upper_reference": 0.4939052175894281,
592
+ "version": "massspecgym-retrieval-score/v1"
593
+ },
594
+ "external_reference_context": {
595
+ "comparable_to_this_validation_report": false,
596
+ "fold": "test",
597
+ "hit_rate_at_1": 0.4939052175894281,
598
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
599
+ },
600
+ "global_error": null,
601
+ "metrics": {
602
+ "hit_rate_at_1": 0.5740388079674713,
603
+ "hit_rate_at_20": 0.8510474033661022,
604
+ "hit_rate_at_5": 0.7376087292192084
605
+ },
606
+ "paired_baseline_delta": {
607
+ "confidence": 0.95,
608
+ "estimate": 0.002830819908384374,
609
+ "grouping": "supplied target_inchikey connectivity block",
610
+ "lower": 0.0005197303197202903,
611
+ "molecule_groups": 3185,
612
+ "queries": 19429,
613
+ "resamples": 2000,
614
+ "seed": 0,
615
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
616
+ "upper": 0.005267598288203097
617
+ },
618
+ "queries": 19429,
619
+ "schema": "massspecgym-retrieval-development-report/v1",
620
+ "strata": {
621
+ "adduct": {
622
+ "[M+H]+": {
623
+ "hit_rate_at_1": 0.6554587530628914,
624
+ "queries": 14692
625
+ },
626
+ "[M+Na]+": {
627
+ "hit_rate_at_1": 0.3215115051720498,
628
+ "queries": 4737
629
+ }
630
+ },
631
+ "candidate_pool_size": {
632
+ "129-256": {
633
+ "hit_rate_at_1": 0.574957454489196,
634
+ "queries": 19391
635
+ },
636
+ "33-128": {
637
+ "hit_rate_at_1": 0.10526315789473684,
638
+ "queries": 38
639
+ }
640
+ },
641
+ "collision_energy": {
642
+ "20-39.999": {
643
+ "hit_rate_at_1": 0.7791095890410958,
644
+ "queries": 4088
645
+ },
646
+ "40-59.999": {
647
+ "hit_rate_at_1": 0.7536694320357371,
648
+ "queries": 1567
649
+ },
650
+ "<20": {
651
+ "hit_rate_at_1": 0.5883333333333334,
652
+ "queries": 1200
653
+ },
654
+ ">=60": {
655
+ "hit_rate_at_1": 0.7769230769230769,
656
+ "queries": 3120
657
+ },
658
+ "missing": {
659
+ "hit_rate_at_1": 0.38682039348423947,
660
+ "queries": 9454
661
+ }
662
+ },
663
+ "instrument_type": {
664
+ "": {
665
+ "hit_rate_at_1": 0.6234567901234568,
666
+ "queries": 486
667
+ },
668
+ "Orbitrap": {
669
+ "hit_rate_at_1": 0.5796581300565727,
670
+ "queries": 16439
671
+ },
672
+ "QTOF": {
673
+ "hit_rate_at_1": 0.527555910543131,
674
+ "queries": 2504
675
+ }
676
+ },
677
+ "routing_domain": {
678
+ "fallback": {
679
+ "hit_rate_at_1": 0.38525012893243943,
680
+ "queries": 9695
681
+ },
682
+ "glacier_released": {
683
+ "hit_rate_at_1": 0.7620710910211629,
684
+ "queries": 9734
685
+ }
686
+ }
687
+ },
688
+ "uncertainty": {
689
+ "confidence": 0.95,
690
+ "estimate": 0.5740388079674713,
691
+ "grouping": "supplied target_inchikey connectivity block",
692
+ "lower": 0.5363340571148925,
693
+ "molecule_groups": 3185,
694
+ "queries": 19429,
695
+ "resamples": 2000,
696
+ "seed": 0,
697
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
698
+ "upper": 0.60854761243379
699
+ },
700
+ "valid_rankings": 19429
701
+ },
702
+ "selected_outside_report": {
703
+ "benchmark_score": {
704
+ "at_or_above_upper_reference": false,
705
+ "comparable_to_test_reference": false,
706
+ "direction": "maximize",
707
+ "evaluation_fold": "validation",
708
+ "lower_reference": 0.04004329004329004,
709
+ "metric": "hit_rate_at_1",
710
+ "raw_performance": 0.38525012893243943,
711
+ "saturation": null,
712
+ "score": 0.7605988031548577,
713
+ "unclipped_score": 0.7605988031548577,
714
+ "upper_reference": 0.4939052175894281,
715
+ "version": "massspecgym-retrieval-score/v1"
716
+ },
717
+ "external_reference_context": {
718
+ "comparable_to_this_validation_report": false,
719
+ "fold": "test",
720
+ "hit_rate_at_1": 0.4939052175894281,
721
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
722
+ },
723
+ "global_error": null,
724
+ "metrics": {
725
+ "hit_rate_at_1": 0.38525012893243943,
726
+ "hit_rate_at_20": 0.7284167096441465,
727
+ "hit_rate_at_5": 0.5587416193914388
728
+ },
729
+ "paired_baseline_delta": {
730
+ "confidence": 0.95,
731
+ "estimate": 0.005673027333677153,
732
+ "grouping": "supplied target_inchikey connectivity block",
733
+ "lower": 0.0008657041172670547,
734
+ "molecule_groups": 1119,
735
+ "queries": 9695,
736
+ "resamples": 2000,
737
+ "seed": 0,
738
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
739
+ "upper": 0.01136134767422208
740
+ },
741
+ "queries": 9695,
742
+ "schema": "massspecgym-retrieval-development-report/v1",
743
+ "strata": {
744
+ "adduct": {
745
+ "[M+H]+": {
746
+ "hit_rate_at_1": 0.4461476401774909,
747
+ "queries": 4958
748
+ },
749
+ "[M+Na]+": {
750
+ "hit_rate_at_1": 0.3215115051720498,
751
+ "queries": 4737
752
+ }
753
+ },
754
+ "candidate_pool_size": {
755
+ "129-256": {
756
+ "hit_rate_at_1": 0.3863518691104898,
757
+ "queries": 9657
758
+ },
759
+ "33-128": {
760
+ "hit_rate_at_1": 0.10526315789473684,
761
+ "queries": 38
762
+ }
763
+ },
764
+ "collision_energy": {
765
+ "20-39.999": {
766
+ "hit_rate_at_1": 0.23300970873786409,
767
+ "queries": 103
768
+ },
769
+ "40-59.999": {
770
+ "hit_rate_at_1": 0.4605263157894737,
771
+ "queries": 76
772
+ },
773
+ "<20": {
774
+ "hit_rate_at_1": 0.28,
775
+ "queries": 25
776
+ },
777
+ ">=60": {
778
+ "hit_rate_at_1": 0.32432432432432434,
779
+ "queries": 37
780
+ },
781
+ "missing": {
782
+ "hit_rate_at_1": 0.38682039348423947,
783
+ "queries": 9454
784
+ }
785
+ },
786
+ "instrument_type": {
787
+ "": {
788
+ "hit_rate_at_1": 0.6234567901234568,
789
+ "queries": 486
790
+ },
791
+ "Orbitrap": {
792
+ "hit_rate_at_1": 0.34662129314535733,
793
+ "queries": 8228
794
+ },
795
+ "QTOF": {
796
+ "hit_rate_at_1": 0.5912334352701325,
797
+ "queries": 981
798
+ }
799
+ },
800
+ "routing_domain": {
801
+ "fallback": {
802
+ "hit_rate_at_1": 0.38525012893243943,
803
+ "queries": 9695
804
+ }
805
+ }
806
+ },
807
+ "uncertainty": {
808
+ "confidence": 0.95,
809
+ "estimate": 0.38525012893243943,
810
+ "grouping": "supplied target_inchikey connectivity block",
811
+ "lower": 0.340724670195138,
812
+ "molecule_groups": 1119,
813
+ "queries": 9695,
814
+ "resamples": 2000,
815
+ "seed": 0,
816
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
817
+ "upper": 0.4318484203802568
818
+ },
819
+ "valid_rankings": 9695
820
+ },
821
+ "selected_probe_report": {
822
+ "schema": "massspecgym-validation-paired-mces/v1",
823
+ "queries": 512,
824
+ "valid_rankings": 512,
825
+ "metrics": {
826
+ "hit_rate_at_1": 0.56640625,
827
+ "hit_rate_at_5": 0.71484375,
828
+ "hit_rate_at_20": 0.83203125,
829
+ "mces_at_1": 7.4423828125
830
+ },
831
+ "mces_unique_pairs": 454,
832
+ "mces_new_pairs": 3,
833
+ "elapsed_seconds": 1.5789514190109912,
834
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
835
+ "rankings_sha256": "e2b4226a3cf489a22313c3464bb144903dc0cc85bd48383fcf6bf68ed2c2e043",
836
+ "comparison": "validation only, not evidence of beating a test reference",
837
+ "strata": {
838
+ "adduct": {
839
+ "[M+H]+": {
840
+ "queries": 391,
841
+ "hit_rate_at_1": 0.6470588235294118
842
+ },
843
+ "[M+Na]+": {
844
+ "queries": 121,
845
+ "hit_rate_at_1": 0.30578512396694213
846
+ }
847
+ },
848
+ "instrument_type": {
849
+ "": {
850
+ "queries": 17,
851
+ "hit_rate_at_1": 0.5294117647058824
852
+ },
853
+ "Orbitrap": {
854
+ "queries": 431,
855
+ "hit_rate_at_1": 0.5846867749419954
856
+ },
857
+ "QTOF": {
858
+ "queries": 64,
859
+ "hit_rate_at_1": 0.453125
860
+ }
861
+ },
862
+ "collision_energy": {
863
+ "20-39.999": {
864
+ "queries": 98,
865
+ "hit_rate_at_1": 0.8163265306122449
866
+ },
867
+ "40-59.999": {
868
+ "queries": 47,
869
+ "hit_rate_at_1": 0.7872340425531915
870
+ },
871
+ "<20": {
872
+ "queries": 39,
873
+ "hit_rate_at_1": 0.717948717948718
874
+ },
875
+ ">=60": {
876
+ "queries": 82,
877
+ "hit_rate_at_1": 0.6829268292682927
878
+ },
879
+ "missing": {
880
+ "queries": 246,
881
+ "hit_rate_at_1": 0.3617886178861789
882
+ }
883
+ },
884
+ "candidate_pool_size": {
885
+ "129-256": {
886
+ "queries": 511,
887
+ "hit_rate_at_1": 0.5675146771037182
888
+ },
889
+ "33-128": {
890
+ "queries": 1,
891
+ "hit_rate_at_1": 0.0
892
+ }
893
+ },
894
+ "routing_domain": {
895
+ "fallback": {
896
+ "queries": 257,
897
+ "hit_rate_at_1": 0.36186770428015563
898
+ },
899
+ "glacier_released": {
900
+ "queries": 255,
901
+ "hit_rate_at_1": 0.7725490196078432
902
+ }
903
+ }
904
+ },
905
+ "uncertainty": {
906
+ "estimate": 0.56640625,
907
+ "lower": 0.5130780015916394,
908
+ "upper": 0.6220112244897958,
909
+ "confidence": 0.95,
910
+ "resamples": 2000,
911
+ "seed": 0,
912
+ "molecule_groups": 389,
913
+ "queries": 512,
914
+ "grouping": "supplied target_inchikey connectivity block",
915
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
916
+ }
917
+ },
918
+ "selected_probe_baseline": {
919
+ "schema": "massspecgym-validation-paired-mces/v1",
920
+ "queries": 512,
921
+ "valid_rankings": 512,
922
+ "metrics": {
923
+ "hit_rate_at_1": 0.5703125,
924
+ "hit_rate_at_5": 0.716796875,
925
+ "hit_rate_at_20": 0.8359375,
926
+ "mces_at_1": 7.4609375
927
+ },
928
+ "mces_unique_pairs": 451,
929
+ "mces_new_pairs": 0,
930
+ "elapsed_seconds": 1.15448702298454,
931
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
932
+ "rankings_sha256": "b1de460171201cfb3da835ba0007b8ab806afe0f953936766c57c2b57281d8f7",
933
+ "comparison": "validation only, not evidence of beating a test reference",
934
+ "strata": {
935
+ "adduct": {
936
+ "[M+H]+": {
937
+ "queries": 391,
938
+ "hit_rate_at_1": 0.6445012787723785
939
+ },
940
+ "[M+Na]+": {
941
+ "queries": 121,
942
+ "hit_rate_at_1": 0.3305785123966942
943
+ }
944
+ },
945
+ "instrument_type": {
946
+ "": {
947
+ "queries": 17,
948
+ "hit_rate_at_1": 0.5882352941176471
949
+ },
950
+ "Orbitrap": {
951
+ "queries": 431,
952
+ "hit_rate_at_1": 0.5870069605568445
953
+ },
954
+ "QTOF": {
955
+ "queries": 64,
956
+ "hit_rate_at_1": 0.453125
957
+ }
958
+ },
959
+ "collision_energy": {
960
+ "20-39.999": {
961
+ "queries": 98,
962
+ "hit_rate_at_1": 0.8163265306122449
963
+ },
964
+ "40-59.999": {
965
+ "queries": 47,
966
+ "hit_rate_at_1": 0.7872340425531915
967
+ },
968
+ "<20": {
969
+ "queries": 39,
970
+ "hit_rate_at_1": 0.717948717948718
971
+ },
972
+ ">=60": {
973
+ "queries": 82,
974
+ "hit_rate_at_1": 0.6829268292682927
975
+ },
976
+ "missing": {
977
+ "queries": 246,
978
+ "hit_rate_at_1": 0.3699186991869919
979
+ }
980
+ },
981
+ "candidate_pool_size": {
982
+ "129-256": {
983
+ "queries": 511,
984
+ "hit_rate_at_1": 0.5714285714285714
985
+ },
986
+ "33-128": {
987
+ "queries": 1,
988
+ "hit_rate_at_1": 0.0
989
+ }
990
+ },
991
+ "routing_domain": {
992
+ "fallback": {
993
+ "queries": 257,
994
+ "hit_rate_at_1": 0.36964980544747084
995
+ },
996
+ "glacier_released": {
997
+ "queries": 255,
998
+ "hit_rate_at_1": 0.7725490196078432
999
+ }
1000
+ }
1001
+ },
1002
+ "uncertainty": {
1003
+ "estimate": 0.5703125,
1004
+ "lower": 0.5188862110356727,
1005
+ "upper": 0.6247567365269461,
1006
+ "confidence": 0.95,
1007
+ "resamples": 2000,
1008
+ "seed": 0,
1009
+ "molecule_groups": 389,
1010
+ "queries": 512,
1011
+ "grouping": "supplied target_inchikey connectivity block",
1012
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
1013
+ }
1014
+ },
1015
+ "selection_scope": "Actual portable inverse replay on9695outside queries, unchanged known rankings and native simulator predictions. Group intervals are not selection-adjusted. Relocated combined4check passes. No test claim."
1016
+ }
shared/package-files/1f/1f7768dd917533f2d14a11c4f28f4afbbcf6e25ca94bd8e360835f8a0df44405/predict.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Portable ranking for arbitrary conforming spectra and candidate pools."""
3
+ import argparse, json, os, time
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from functools import lru_cache
6
+ from pathlib import Path
7
+ import numpy as np
8
+ import torch
9
+ from features import molecule_features,spectrum_features,sha256
10
+ from model import PeakFingerprint,normalized_fp
11
+ from relative_model import PeakFingerprint as RelativePeakFingerprint
12
+ from scoring import rank_scores
13
+ from mass_prior import mass_penalties
14
+ from composition import CompositionHead,candidate_chemistry
15
+
16
+ @lru_cache(maxsize=8192)
17
+ def cached_features(smiles): return candidate_chemistry(smiles)
18
+ def encode_pool(item):
19
+ pool_id,candidates=item
20
+ features=[cached_features(c['smiles']) for c in candidates]
21
+ return pool_id,np.stack([x[0] for x in features]),np.asarray([x[1] for x in features],np.float32),np.stack([x[2] for x in features]),np.asarray([x[3] for x in features],bool)
22
+
23
+ @torch.inference_mode()
24
+ def main():
25
+ ap=argparse.ArgumentParser(); ap.add_argument('input_root',type=Path); ap.add_argument('output_root',type=Path); ap.add_argument('--internal-scores',type=Path); args=ap.parse_args()
26
+ root=Path(__file__).resolve().parent; manifest=json.loads((root/'model_manifest.json').read_text()); config=json.loads((root/manifest['model_config']).read_text())
27
+ checkpoint=root/manifest['checkpoint']['path']
28
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']: raise ValueError('checkpoint checksum mismatch')
29
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
30
+ pools={r['candidate_pool_id']:r['candidates'] for r in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
31
+ all_scores=np.full((len(queries),256),-np.inf,np.float32) if args.internal_scores else None
32
+ by_pool={}
33
+ for i,q in enumerate(queries): by_pool.setdefault(q['candidate_pool_id'],[]).append(i)
34
+ torch.set_num_threads(4); torch.set_float32_matmul_precision('high'); device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
35
+ rule=config.get('scoring_rule','cosine')
36
+ if rule!='idf_cosine':raise ValueError('This optimized ensemble requires fixed IDF cosine scoring')
37
+ idf=None
38
+ asset=config['mass_prior_asset']; mass_file=root/asset['path']
39
+ if sha256(mass_file)!=asset['sha256']:raise ValueError('Mass-prior checksum mismatch')
40
+ mass_parameters=json.loads(mass_file.read_text())['parameters']
41
+ if rule=='idf_cosine':
42
+ asset=config['idf_asset']; path=root/asset['path']
43
+ if sha256(path)!=asset['sha256']:raise ValueError('IDF checksum mismatch')
44
+ idf=torch.from_numpy(np.load(path)).to(device)
45
+ def query_predictions(path,capture_embedding=False):
46
+ state=torch.load(path,map_location='cpu',weights_only=False);model_class=RelativePeakFingerprint if state['model_config'].get('relative_mass_bias',False) else PeakFingerprint;model=model_class(**state['model_config']).to(device).eval();model.load_state_dict(state['state_dict']);predictions=torch.empty((len(queries),6144),dtype=torch.float32)
47
+ captured=[];embedding_output=torch.empty((len(queries),state['model_config']['width']*2),dtype=torch.float32) if capture_embedding else None
48
+ handle=model.decoder.register_forward_pre_hook(lambda module,args:captured.append(args[0].detach())) if capture_embedding else None
49
+ for start in range(0,len(queries),256):
50
+ features=[spectrum_features(r,max_peaks=state['model_config']['max_peaks']) for r in queries[start:start+256]]
51
+ peaks=torch.from_numpy(np.stack([f[0] for f in features])).to(device);meta=torch.from_numpy(np.stack([f[1] for f in features])).to(device)
52
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):pred=model(peaks,meta).float().sigmoid()
53
+ predictions[start:start+len(features)]=pred.cpu()
54
+ if capture_embedding:embedding_output[start:start+len(features)]=captured.pop().cpu()
55
+ if handle is not None:handle.remove()
56
+ return (predictions,embedding_output) if capture_embedding else predictions
57
+ released=np.asarray([q['adduct']=='[M+H]+' and q['instrument_type'] in {'Orbitrap','QTOF'} and q['collision_energy'] is not None for q in queries])
58
+ outside_weight=float(config.get('outside_checkpoint_weight',1.));use_base=released.any() or outside_weight<1.
59
+ predictions,composition_embeddings=query_predictions(checkpoint,capture_embedding=True)
60
+ asset=config['ensemble_asset'];other=root/asset['path']
61
+ if sha256(other)!=asset['sha256']:raise ValueError('Ensemble checkpoint checksum mismatch')
62
+ other_predictions=query_predictions(other) if use_base else None
63
+ asset=config['outside_inverse_asset'];outside=root/asset['path']
64
+ if sha256(outside)!=asset['sha256']:raise ValueError('Outside-domain checkpoint checksum mismatch')
65
+ outside_predictions=query_predictions(outside) if (~released).any() else None
66
+ asset=config['outside_ensemble_asset'];outside_ensemble=root/asset['path']
67
+ if sha256(outside_ensemble)!=asset['sha256']:raise ValueError('Outside ensemble checkpoint checksum mismatch')
68
+ outside_ensemble_predictions=query_predictions(outside_ensemble) if (~released).any() else None
69
+ asset=config['outside_replica_asset'];replica=root/asset['path']
70
+ if sha256(replica)!=asset['sha256']:raise ValueError('Sparse replica checksum mismatch')
71
+ replica_predictions=query_predictions(replica) if (~released).any() else None
72
+ asset=config['outside_capacity_asset'];capacity_checkpoint=root/asset['path']
73
+ if sha256(capacity_checkpoint)!=asset['sha256']:raise ValueError('Capacity checkpoint checksum mismatch')
74
+ capacity_predictions=query_predictions(capacity_checkpoint) if (~released).any() else None
75
+ asset=config['outside_capacity_replica_asset'];capacity_replica_checkpoint=root/asset['path']
76
+ if sha256(capacity_replica_checkpoint)!=asset['sha256']:raise ValueError('Outside capacity replica checksum mismatch')
77
+ capacity_replica_predictions=query_predictions(capacity_replica_checkpoint) if (~released).any() else None
78
+ asset=config['known_inverse_asset'];known_checkpoint=root/asset['path']
79
+ if sha256(known_checkpoint)!=asset['sha256']:raise ValueError('Known-condition checkpoint checksum mismatch')
80
+ known_predictions=query_predictions(known_checkpoint) if released.any() else None
81
+ asset=config['known_capacity_asset'];known_capacity_checkpoint=root/asset['path']
82
+ if sha256(known_capacity_checkpoint)!=asset['sha256']:raise ValueError('Known capacity checkpoint checksum mismatch')
83
+ known_capacity_predictions=query_predictions(known_capacity_checkpoint) if released.any() else None
84
+ asset=config['known_capacity_replica_asset'];known_capacity_replica_checkpoint=root/asset['path']
85
+ if sha256(known_capacity_replica_checkpoint)!=asset['sha256']:raise ValueError('Known capacity replica checksum mismatch')
86
+ known_capacity_replica_predictions=query_predictions(known_capacity_replica_checkpoint) if released.any() else None
87
+ asset=config['outside_relative_asset'];relative_checkpoint=root/asset['path']
88
+ if sha256(relative_checkpoint)!=asset['sha256']:raise ValueError('Relative-mass checkpoint checksum mismatch')
89
+ relative_predictions=query_predictions(relative_checkpoint) if (~released).any() else None
90
+ asset=config['outside_energy_mask_asset'];energy_mask_checkpoint=root/asset['path']
91
+ if sha256(energy_mask_checkpoint)!=asset['sha256']:raise ValueError('Energy-mask checkpoint checksum mismatch')
92
+ energy_mask_predictions=query_predictions(energy_mask_checkpoint) if (~released).any() else None
93
+ asset=config['composition_asset'];composition_path=root/asset['path']
94
+ if sha256(composition_path)!=asset['sha256']:raise ValueError('Composition head checksum mismatch')
95
+ composition_state=torch.load(composition_path,map_location='cpu',weights_only=False)
96
+ if composition_state['encoder_sha256']!=manifest['checkpoint']['sha256']:raise ValueError('Composition encoder identity mismatch')
97
+ recipe=composition_state['config'];composition_head=CompositionHead(input_width=config['model']['width']*2,hidden_width=recipe['head_width'],dropout=recipe['dropout'],recurrent_width=recipe['recurrent_width'],count_embedding_width=recipe['count_embedding_width']).to(device).eval();composition_head.load_state_dict(composition_state['state_dict'])
98
+ args.output_root.mkdir(parents=True,exist_ok=True); temp=args.output_root/'rankings.jsonl.tmp'; started=time.monotonic()
99
+ # Fork workers never execute CUDA; they only parse candidate SMILES and pack bits.
100
+ with ProcessPoolExecutor(max_workers=min(config.get('feature_workers',8),os.cpu_count() or 1)) as ex, temp.open('w') as f:
101
+ for count,(pid,packed,masses,composition_counts,composition_valid) in enumerate(ex.map(encode_pool,((p,pools[p]) for p in by_pool),chunksize=1),1):
102
+ fp=torch.from_numpy(np.unpackbits(packed,axis=1).astype(np.float32)).to(device)
103
+ fp=normalized_fp(fp[None,:,:]*idf).bfloat16().float()
104
+ counts_tensor=torch.from_numpy(composition_counts).to(device);composition_mask=torch.from_numpy(composition_valid).to(device)
105
+ qix=by_pool[pid]; embeddings=composition_embeddings[qix].to(device); pred=predictions[qix].to(device) if predictions is not None else None;other_pred=other_predictions[qix].to(device) if other_predictions is not None else None
106
+ outside_pred=outside_predictions[qix].to(device) if outside_predictions is not None else None
107
+ outside_ensemble_pred=outside_ensemble_predictions[qix].to(device) if outside_ensemble_predictions is not None else None
108
+ replica_pred=replica_predictions[qix].to(device) if replica_predictions is not None else None
109
+ known_pred=known_predictions[qix].to(device) if known_predictions is not None else None
110
+ known_capacity_pred=known_capacity_predictions[qix].to(device) if known_capacity_predictions is not None else None
111
+ capacity_replica_pred=capacity_replica_predictions[qix].to(device) if capacity_replica_predictions is not None else None
112
+ known_capacity_replica_pred=known_capacity_replica_predictions[qix].to(device) if known_capacity_replica_predictions is not None else None
113
+ capacity_pred=capacity_predictions[qix].to(device) if capacity_predictions is not None else None
114
+ relative_pred=relative_predictions[qix].to(device) if relative_predictions is not None else None
115
+ energy_mask_pred=energy_mask_predictions[qix].to(device) if energy_mask_predictions is not None else None
116
+ # Match validation's bfloat16 feature rounding with float32 reduction.
117
+ scores=[]
118
+ for offset in range(0,len(qix),64):
119
+ use=released[np.asarray(qix[offset:offset+64])]
120
+ value=torch.zeros((len(use),fp.shape[1]),device=device)
121
+ if use.any() or outside_weight<1.:
122
+ first=normalized_fp(pred[offset:offset+64,None,:]*idf).bfloat16().float()
123
+ second=normalized_fp(other_pred[offset:offset+64,None,:]*idf).bfloat16().float()
124
+ value=(((first+second)*.5)*fp).sum(-1)
125
+ if (~use).any():
126
+ third=normalized_fp(outside_pred[offset:offset+64,None,:]*idf).bfloat16().float()
127
+ replica_value=normalized_fp(replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
128
+ replica_share=float(config['outside_replica_share'])
129
+ alternative=(1-replica_share)*(third*fp).sum(-1)+replica_share*(replica_value*fp).sum(-1)
130
+ fifth=normalized_fp(outside_ensemble_pred[offset:offset+64,None,:]*idf).bfloat16().float()
131
+ share=float(config['outside_ensemble_share'])
132
+ alternative=(1-share)*alternative+share*(fifth*fp).sum(-1)
133
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,outside_weight*alternative+(1-outside_weight)*value)
134
+ capacity_value=normalized_fp(capacity_pred[offset:offset+64,None,:]*idf).bfloat16().float()
135
+ capacity_delta=float(config['outside_capacity_weight'])*((capacity_value*fp).sum(-1)-(second*fp).sum(-1))
136
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+capacity_delta)
137
+ capacity_replica_value=normalized_fp(capacity_replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
138
+ replica_delta=float(config['outside_capacity_replica_weight'])*((capacity_replica_value*fp).sum(-1)-(capacity_value*fp).sum(-1))
139
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+replica_delta)
140
+ relative_value=normalized_fp(relative_pred[offset:offset+64,None,:]*idf).bfloat16().float()
141
+ relative_delta=float(config['outside_relative_weight'])*((relative_value*fp).sum(-1)-(second*fp).sum(-1))
142
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+relative_delta)
143
+ energy_mask_value=normalized_fp(energy_mask_pred[offset:offset+64,None,:]*idf).bfloat16().float()
144
+ energy_mask_delta=float(config['outside_energy_mask_weight'])*((energy_mask_value*fp).sum(-1)-(third*fp).sum(-1))
145
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+energy_mask_delta)
146
+ if use.any():
147
+ fourth=normalized_fp(known_pred[offset:offset+64,None,:]*idf).bfloat16().float()
148
+ known_value=(((first+fourth)*.5)*fp).sum(-1)
149
+ extra=normalized_fp(known_capacity_pred[offset:offset+64,None,:]*idf).bfloat16().float()
150
+ extra_weight=float(config['known_capacity_weight'])
151
+ known_value=(1-extra_weight)*known_value+extra_weight*(extra*fp).sum(-1)
152
+ known_capacity_replica_value=normalized_fp(known_capacity_replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
153
+ known_value+=float(config['known_capacity_replica_weight'])*((known_capacity_replica_value*fp).sum(-1)-(extra*fp).sum(-1))
154
+ value=torch.where(torch.as_tensor(use[:,None],device=device),known_value,value)
155
+ if (~use).any():
156
+ outside_indices=torch.as_tensor(np.flatnonzero(~use),device=device)
157
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):
158
+ chemical=composition_head.score(embeddings[offset:offset+64][outside_indices],counts_tensor[None].expand(len(outside_indices),-1,-1))
159
+ chemical=chemical.masked_fill(~composition_mask[None],0.)
160
+ value[outside_indices]+=float(config['composition_weight'])*chemical
161
+ scores.append(value.cpu().numpy())
162
+ scores=np.concatenate(scores)
163
+ evidence=mass_penalties([queries[i] for i in qix],masses,mass_parameters)
164
+ if config.get('mass_prior_domain','all')=='released':
165
+ use=np.array([queries[i]['adduct']=='[M+H]+' and queries[i]['instrument_type'] in {'Orbitrap','QTOF'} and queries[i]['collision_energy'] is not None for i in qix])
166
+ weights=np.where(use,float(config['mass_prior_weight']),float(config.get('outside_mass_prior_weight',0.)))
167
+ scores-=weights[:,None]*evidence
168
+ else:
169
+ scores-=float(config['mass_prior_weight'])*evidence
170
+ scores=np.nan_to_num(scores,nan=-np.inf,posinf=-np.inf,neginf=-np.inf); ids=[c['candidate_id'] for c in pools[pid]]
171
+ for i,s in zip(qix,scores):
172
+ if all_scores is not None:all_scores[i,:len(s)]=s
173
+ order=sorted(range(len(ids)),key=lambda j:(-float(s[j]),ids[j]))
174
+ f.write(json.dumps({'query_id':queries[i]['query_id'],'ranking':[ids[j] for j in order]},separators=(',',':'))+'\n')
175
+ if count%500==0: print(json.dumps({'pools_ranked':count,'total_pools':len(by_pool),'ranking_seconds':time.monotonic()-started}),flush=True)
176
+ os.replace(temp,args.output_root/'rankings.jsonl')
177
+ if args.internal_scores:
178
+ args.internal_scores.parent.mkdir(parents=True,exist_ok=True)
179
+ np.savez_compressed(args.internal_scores,scores=all_scores,query_ids=np.asarray([q['query_id'] for q in queries]))
180
+ if __name__=='__main__': main()
shared/package-files/1f/1f7c0663465b01d97ff4ec9da36bf75146b88fb255402887f579a0dc60b7519e/model_config.json ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "b45240216cb2ff79390253ccc63f71bfd290e66b405a8413c0f8ed13b1fbb1d6"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "all",
180
+ "workers": 8,
181
+ "max_heavy_atoms": 90,
182
+ "large_threshold": 50,
183
+ "large_mode": "specialist",
184
+ "large_asset": {
185
+ "path": "graph-large.pt",
186
+ "sha256": "fc7161d65ff9606c88c294fa12aa617a855de2fd25add669522d30be45205dcc"
187
+ },
188
+ "small_features": 98,
189
+ "structure_context_asset": {
190
+ "path": "structure_context_features.py",
191
+ "sha256": "9dba7d3c1865b1b43ac7a7bbf84cb1d68636cc0a671a1e4ef0ce2fc06ba6c8f9"
192
+ },
193
+ "sodium_specialist": {
194
+ "small_asset": {
195
+ "path": "sodium-small-graph.pt",
196
+ "sha256": "166be11d0a16c03348da7f87ba85e22615615fd7d4573f136d9a8142b8620422"
197
+ },
198
+ "large_asset": {
199
+ "path": "sodium-large-graph.pt",
200
+ "sha256": "387feeb91016d128970cc1ea200251ec833e460a4fc1e090e6e0efe5accf114e"
201
+ },
202
+ "extra_features": 63,
203
+ "extra_feature_mode": "train_mean"
204
+ }
205
+ }
206
+ }
shared/package-files/1f/1fc2e9d3bb7cb98f342fe2dce097279e252df317a962e625af2aa99ac68b5cb8/model.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Formula-free mass/neutral-loss peak transformer predicting molecular fingerprints."""
2
+ import math
3
+ import torch
4
+ from torch import nn
5
+ from torch.nn import functional as F
6
+ FP_SIZE=6144
7
+
8
+ class AttentionBlock(nn.Module):
9
+ def __init__(self,width,heads,dropout):
10
+ super().__init__(); self.heads=heads; self.dropout=dropout
11
+ self.norm1=nn.LayerNorm(width); self.qkv=nn.Linear(width,width*3); self.proj=nn.Linear(width,width)
12
+ self.norm2=nn.LayerNorm(width); self.ff=nn.Sequential(nn.Linear(width,width*4),nn.GELU(),nn.Dropout(dropout),nn.Linear(width*4,width))
13
+ def forward(self,x,valid):
14
+ b,t,d=x.shape; q,k,v=self.qkv(self.norm1(x)).reshape(b,t,3,self.heads,d//self.heads).permute(2,0,3,1,4).unbind(0)
15
+ out=F.scaled_dot_product_attention(q,k,v,attn_mask=valid[:,None,None,:],dropout_p=self.dropout if self.training else 0.)
16
+ x=x+F.dropout(self.proj(out.transpose(1,2).reshape(b,t,d)),p=self.dropout,training=self.training)
17
+ return x+F.dropout(self.ff(self.norm2(x)),p=self.dropout,training=self.training)
18
+
19
+ class PeakFingerprint(nn.Module):
20
+ def __init__(self,width=384,layers=4,heads=8,dropout=0.1,frequencies=64,max_peaks=64,**kwargs):
21
+ super().__init__(); self.config=dict(width=width,layers=layers,heads=heads,dropout=dropout,frequencies=frequencies,max_peaks=max_peaks)
22
+ self.register_buffer('freq',torch.logspace(-2.5,2.5,frequencies)*2*math.pi)
23
+ self.mass_bins=nn.Embedding(2049,width); self.loss_bins=nn.Embedding(2049,width)
24
+ self.numeric=nn.Sequential(nn.Linear(frequencies*4+12,width),nn.GELU(),nn.Linear(width,width))
25
+ self.adduct=nn.Embedding(2,width); self.instrument=nn.Embedding(3,width)
26
+ self.conditions=nn.Sequential(nn.Linear(6,width),nn.GELU(),nn.Linear(width,width))
27
+ self.cls=nn.Parameter(torch.randn(width)*.02); self.input_norm=nn.LayerNorm(width)
28
+ self.layers=nn.ModuleList([AttentionBlock(width,heads,dropout) for _ in range(layers)])
29
+ self.out_norm=nn.LayerNorm(width*2)
30
+ self.decoder=nn.Sequential(nn.Linear(width*2,1024),nn.GELU(),nn.Dropout(dropout),nn.Linear(1024,FP_SIZE))
31
+ def forward(self,peaks,meta):
32
+ # Trigonometric features must remain float32 even under AMP.
33
+ mass=peaks[:,:,0].float(); inten=peaks[:,:,1].float(); prec=meta[:,0,None].float()
34
+ loss=prec-mass; valid=inten>0
35
+ if self.training:
36
+ valid=valid & (torch.rand_like(inten)>.10); valid[:,0]=True
37
+ inten=inten*torch.exp(torch.randn_like(inten)*.1); inten[:,0]=2.
38
+ with torch.autocast(device_type=peaks.device.type,enabled=False):
39
+ phase=mass[:,:,None]*self.freq; lphase=loss[:,:,None]*self.freq
40
+ scalar=torch.stack([mass/1000,loss/1000,mass/(prec+1e-6),loss/(prec+1e-6),
41
+ torch.sqrt(inten.clamp(min=0)),inten,torch.log1p(inten*100)/5,
42
+ mass/1.00048-torch.round(mass/1.00048),loss/1.00048-torch.round(loss/1.00048),
43
+ mass-torch.round(mass),loss-torch.round(loss),(inten>1.5).float()],dim=-1)
44
+ numeric=torch.cat([phase.sin(),phase.cos(),lphase.sin(),lphase.cos(),scalar],dim=-1)
45
+ x=self.numeric(numeric)+self.mass_bins(mass.long().clamp(0,2048))+self.loss_bins(loss.long().clamp(0,2048))
46
+ energy=meta[:,3].float()/100; missing=meta[:,4].float()
47
+ c=torch.stack([meta[:,0]/1000,energy,energy.square().clamp(max=100),energy.sin(),energy.cos(),missing],dim=-1)
48
+ cond=self.adduct(meta[:,1].long())+self.instrument(meta[:,2].long())+self.conditions(c)
49
+ x=x+cond[:,None,:]; x[:,0]=x[:,0]+self.cls
50
+ x=self.input_norm(x)
51
+ for layer in self.layers: x=layer(x,valid)
52
+ weight=torch.sqrt(inten.clamp(min=0))*valid; weight[:,0]=0
53
+ avg=(x*weight[:,:,None]).sum(1)/weight.sum(1,keepdim=True).clamp(min=1)
54
+ return self.decoder(self.out_norm(torch.cat([x[:,0],avg],dim=-1)))
55
+
56
+ def normalized_fp(x,morgan_weight=0.7):
57
+ return torch.cat([F.normalize(x[...,:4096],dim=-1)*math.sqrt(morgan_weight),F.normalize(x[...,4096:],dim=-1)*math.sqrt(1-morgan_weight)],dim=-1)
58
+
59
+ def training_loss(logits,target,groups):
60
+ logits=logits.float(); target=target.float(); prob=logits.sigmoid()
61
+ bce=.5*(F.binary_cross_entropy_with_logits(logits[:,:4096],target[:,:4096])+F.binary_cross_entropy_with_logits(logits[:,4096:],target[:,4096:]))
62
+ pred=normalized_fp(prob); targ=normalized_fp(target)
63
+ cos=1-(pred*targ).sum(-1).mean()
64
+ scores=pred@targ.T/.08
65
+ positive=groups[:,None]==groups[None,:]
66
+ contrast=(torch.logsumexp(scores,dim=1)-torch.logsumexp(scores.masked_fill(~positive,float('-inf')),dim=1)).mean()
67
+ return bce+cos+.1*contrast,{'bce':bce.detach(),'cosine':cos.detach(),'contrastive':contrast.detach()}
shared/package-files/41/417f003ee44c62cd8aac22ef71b5c4416d5dc38791aad4ba629b42b5fdafb7e0/infer.py ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stream candidate simulations directly into entropy ranking, without a spectrum database."""
2
+ import argparse, hashlib, json, math, os, subprocess, sys, tempfile, time
3
+ from collections import OrderedDict,defaultdict
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from pathlib import Path
6
+ import numpy as np
7
+ import torch
8
+ from tolerance import entropy_tolerant,TOLERANCES
9
+ from torch.utils.data import Dataset,DataLoader
10
+ from rdkit import Chem,RDLogger
11
+ RDLogger.DisableLog('rdApp.*')
12
+ ROOT=Path(__file__).resolve().parent
13
+ sys.path.insert(0,str(ROOT/'vendor'))
14
+
15
+
16
+ def sha256(path):
17
+ h=hashlib.sha256()
18
+ with Path(path).open('rb') as f:
19
+ for b in iter(lambda:f.read(1024*1024),b''):h.update(b)
20
+ return h.hexdigest()
21
+
22
+ def supported_pool(item):
23
+ from ms_pred.common.chem_utils import VALID_ATOM_NUM
24
+ pid,candidates=item; out=[]
25
+ for i,c in enumerate(candidates):
26
+ m=Chem.MolFromSmiles(c['smiles'])
27
+ if m is None: continue
28
+ if any(a.GetAtomicNum() not in VALID_ATOM_NUM for a in m.GetAtoms()):continue
29
+ try:m=Chem.RemoveHs(m)
30
+ except Exception:continue
31
+ n=m.GetNumAtoms()
32
+ if n>100 or n<3:continue
33
+ out.append((Chem.MolToSmiles(m),i,n))
34
+ return pid,out
35
+
36
+ def observed(row,num_bins=150000):
37
+ mz=np.asarray(row['mzs'],np.float32); v=np.asarray(row['intensities'],np.float32)
38
+ keep=(mz<=row['precursor_mz']+1)&(v>0); mz,v=mz[keep],v[keep]
39
+ if not len(v):return np.zeros(50,np.int64),np.zeros(50,np.float32),np.zeros(50,np.float32)
40
+ v=np.sqrt(v/v.max()); strongest=np.argsort(v)[::-1][:50]; mz,v=mz[strongest],v[strongest]
41
+ keep=v>.001; mz,v=mz[keep],v[keep]
42
+ idx=np.floor(mz*((num_bins-1)/1500)).astype(np.int64)+1
43
+ keep=(idx>=0)&(idx<num_bins);idx,v,mz=idx[keep],v[keep],mz[keep]
44
+ unique=np.unique(idx); values=np.array([v[idx==j].max() for j in unique],np.float32)
45
+ representatives=np.array([mz[idx==j][np.argmax(v[idx==j])] for j in unique],np.float32)
46
+ bins=np.zeros(50,np.int64);probs=np.zeros(50,np.float32);mzs=np.zeros(50,np.float32);mzs[:len(unique)]=representatives
47
+ bins[:len(unique)]=unique
48
+ if values.sum()>0:probs[:len(unique)]=values/values.sum()
49
+ return bins,probs,mzs
50
+
51
+
52
+ def entropy_overlap(masses,intens,counts,obs_bins,obs_probs,assignment_rows,assignment_queries,num_bins=150000):
53
+ """1 - normalized Jensen-Shannon distance, matching the native sparse scorer."""
54
+ b,k=masses.shape; indices=torch.floor(masses*((num_bins-1)/1500)).long()+1
55
+ valid=(torch.arange(k,device=masses.device)[None,:]<counts[:,None])&(indices>=0)&(indices<num_bins)&(intens>0)
56
+ values=torch.where(valid,intens,torch.zeros_like(intens)).float()
57
+ dense=torch.zeros((b,num_bins),device=masses.device,dtype=torch.float32)
58
+ dense.scatter_add_(1,indices.clamp(0,num_bins-1),values)
59
+ total=values.sum(-1).clamp(min=1e-22)
60
+ p=dense[assignment_rows[:,None],obs_bins[assignment_queries]]/total[assignment_rows,None]
61
+ q=obs_probs[assignment_queries]
62
+ mix=p+q
63
+ score=(mix*torch.log(mix+1e-22)-p*torch.log(p+1e-22)-q*torch.log(q+1e-22)).sum(-1)/math.log(4)
64
+ return score
65
+
66
+
67
+ class CandidateDataset(Dataset):
68
+ def __init__(self,entries,processor,cache_size=128):self.entries=entries;self.processor=processor;self.cache=OrderedDict();self.cache_size=cache_size
69
+ def __len__(self):return len(self.entries)
70
+ def __getitem__(self,index):
71
+ from ms_pred import common
72
+ smi,group,candidate,atoms,adduct,instrument,energy,expert=self.entries[index]
73
+ key=(smi,adduct);feat=self.cache.get(key)
74
+ if feat is None:
75
+ try:
76
+ feat=self.processor.featurize_tree({'root_canonical_smiles':smi,'adduct':adduct,'collision_energy':energy},include_inten_targs=False,include_frag_targs=False)
77
+ except (ValueError, KeyError, IndexError, RuntimeError) as error:
78
+ return {'_index':index,'_feature_error':type(error).__name__,'_expert':expert}
79
+ self.cache[key]=feat
80
+ if len(self.cache)>self.cache_size:self.cache.popitem(last=False)
81
+ else:self.cache.move_to_end(key)
82
+ item=dict(feat,collision_energy=energy,name=str(index),adduct=common.ion2onehot_pos[adduct],instrument=common.instrument2onehot_pos[instrument],precursor=0.,_index=index,_expert=expert)
83
+ return item
84
+
85
+ def collate(batch):
86
+ from ms_pred.glacier.dataset import IntenDataset
87
+ errors=[b['_index'] for b in batch if '_feature_error' in b]; valid=[b for b in batch if '_feature_error' not in b]
88
+ out=IntenDataset.collate_fn(valid) if valid else {}
89
+ if len({b['_expert'] for b in batch})!=1:raise ValueError('Mixed expert batch')
90
+ out['_expert']=batch[0]['_expert']
91
+ out['_indices']=[b['_index'] for b in valid];out['_errors']=errors;return out
92
+
93
+ def to_device(batch,device):
94
+ for k,v in batch.items():
95
+ if torch.is_tensor(v):batch[k]=v.to(device)
96
+ elif k=='graphormer_input' and v is not None:batch[k]={a:b.to(device) for a,b in v.items()}
97
+ return batch
98
+
99
+ @torch.inference_mode()
100
+ def predict_sparse(model,batch,k=100):
101
+ out=model.forward(batch['graphormer_input'],batch['num_atoms'],batch['adducts'],batch['collision_engs'],root_form_vecs=batch['root_form_vecs'],masses=batch['masses'],adduct_mass_shifts=batch['adduct_mass_shifts'],atom_form_vecs=batch['atom_form_vecs'],adj_matrices=batch['adj_matrices'],atom_hs=batch['atom_hs'],total_hs=batch['total_hs'],instruments=batch['instruments'] if model.embed_instrument else None)
102
+ spec=out['inten_pred_end_to_end']['output'];frags=out['frags_pred']['fragment_count']
103
+ rows=frags*batch['adduct_mass_shifts'].shape[1]*model.output_size
104
+ valid=torch.arange(spec.shape[1],device=spec.device)[None,:]<rows[:,None]
105
+ vals,ix=torch.topk(spec[:,:,1].masked_fill(~valid,float('-inf')),min(k,spec.shape[1]),dim=1)
106
+ return spec[:,:,0].gather(1,ix),torch.where(torch.isfinite(vals),vals,0.),rows.clamp(max=ix.shape[1])
107
+
108
+
109
+ def domain(row,mode):
110
+ if mode=='all':return True
111
+ return row['adduct']=='[M+H]+' and row['instrument_type'] in {'Orbitrap','QTOF'} and row['collision_energy'] is not None
112
+
113
+ def write_input(root,queries,pools):
114
+ root.mkdir();needed={q['candidate_pool_id'] for q in queries}
115
+ (root/'queries.jsonl').write_text(''.join(json.dumps(q)+'\n' for q in queries))
116
+ (root/'candidate_pools.jsonl').write_text(''.join(json.dumps({'candidate_pool_id':p,'candidates':pools[p]})+'\n' for p in needed))
117
+ m={'schema':'massspecgym-retrieval-input/v1','source':'public-input runtime partition','counts':{'queries':len(queries),'candidate_pools':len(needed)},'files':{n:sha256(root/n) for n in ['queries.jsonl','candidate_pools.jsonl']}}
118
+ (root/'manifest.json').write_text(json.dumps(m)+'\n')
119
+
120
+ @torch.inference_mode()
121
+ def run(args):
122
+ started=time.monotonic(); config=json.loads((ROOT/'model_config.json').read_text());manifest=json.loads((ROOT/'model_manifest.json').read_text())
123
+ checkpoint=ROOT/manifest['checkpoint']['path']
124
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']:raise ValueError('checkpoint checksum mismatch')
125
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
126
+ pools={p['candidate_pool_id']:p['candidates'] for p in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
127
+ obs=[observed(q) for q in queries]
128
+ eligible=[domain(q,config['domain']) and obs[i][1].sum()>0 for i,q in enumerate(queries)]
129
+ poolids={q['candidate_pool_id'] for i,q in enumerate(queries) if eligible[i]}
130
+ workers=config.get('workers',8)
131
+ # CPU chemistry and loader workers are started before any CUDA initialization.
132
+ pool_items=((pid,pools[pid]) for pid in sorted(poolids))
133
+ if workers:
134
+ with ProcessPoolExecutor(max_workers=workers) as ex:supported=dict(ex.map(supported_pool,pool_items,chunksize=1))
135
+ else:supported=dict(map(supported_pool,pool_items))
136
+ for i,q in enumerate(queries):eligible[i]=eligible[i] and bool(supported.get(q['candidate_pool_id']))
137
+ groups={};group_queries=[];entries=[];remaining=[]
138
+ for i,q in enumerate(queries):
139
+ if not eligible[i]:continue
140
+ ce=q['collision_energy'];instrument=q['instrument_type'] if q['instrument_type'] in {'Orbitrap','QTOF'} else 'Unknown'
141
+ key=(q['candidate_pool_id'],q['adduct'],instrument,ce)
142
+ if key not in groups:
143
+ gi=len(groups);groups[key]=gi;group_queries.append([]);remaining.append(len(supported[q['candidate_pool_id']]))
144
+ energy=float('nan') if ce is None else float(ce)
145
+ expert=int(domain(q,'released'))
146
+ entries.extend((smi,gi,cidx,n,q['adduct'],instrument,energy,expert) for smi,cidx,n in supported[q['candidate_pool_id']])
147
+ group_queries[groups[key]].append(i)
148
+ entries.sort(key=lambda e:(e[7],e[3],e[0],e[4],e[1]))
149
+ print(json.dumps({'event':'prepared','queries':len(queries),'simulator_queries':int(sum(eligible)),'unique_conditions':len(groups),'candidate_simulations':len(entries),'seconds':time.monotonic()-started}),flush=True)
150
+ scores=np.full((len(queries),256),-1.,np.float32)
151
+ mode=config.get("native_similarity","grid")
152
+ if mode not in ["grid",*TOLERANCES]:raise ValueError("Unknown native similarity mode")
153
+ alternatives={key:np.full_like(scores,-1.) for key in ["grid",*TOLERANCES]} if args.research_scores is not None else {}
154
+ fallback_rows=queries; fallback={};inverse_scores=np.full(scores.shape,-np.inf,np.float32)
155
+ if fallback_rows:
156
+ with tempfile.TemporaryDirectory(prefix='massspec-fallback-') as tmp:
157
+ tmp=Path(tmp);write_input(tmp/'input',fallback_rows,pools)
158
+ subprocess.run(['bash',str(ROOT/'fallback/infer.sh'),str(tmp/'input'),str(tmp/'output'),'--internal-scores',str(tmp/'scores.npz')],check=True)
159
+ with np.load(tmp/'scores.npz',allow_pickle=False) as exported:
160
+ if exported['query_ids'].tolist()!=[q['query_id'] for q in queries] or exported['scores'].shape!=scores.shape:raise ValueError('Internal score alignment mismatch')
161
+ inverse_scores=exported['scores'].copy()
162
+ fallback={r['query_id']:r['ranking'] for r in (json.loads(l) for l in (tmp/'output/rankings.jsonl').open())}
163
+ if entries:
164
+ from ms_pred.glacier.joint_model import JointModel
165
+ from ms_pred.glacier.dataset import TreeProcessor
166
+ torch.set_num_threads(2);torch.set_float32_matmul_precision(config.get('matmul_precision','high'));torch.manual_seed(42)
167
+ model=JointModel.load_from_checkpoint(checkpoint,map_location='cpu',weights_only=False);model.eval();model.freeze()
168
+ asset=config['released_domain_asset'];other_checkpoint=ROOT/asset['path']
169
+ if sha256(other_checkpoint)!=asset['sha256']:raise ValueError('Released expert checksum mismatch')
170
+ other=JointModel.load_from_checkpoint(other_checkpoint,map_location='cpu',weights_only=False);other.eval();other.freeze()
171
+ for attr in ['pe_embed_k','embed_elem_group','multi_hop_max_dist']:
172
+ if getattr(model,attr)!=getattr(other,attr):raise ValueError('Expert feature configuration mismatch')
173
+ models={0:model,1:other}
174
+ processor=TreeProcessor(pe_embed_k=model.pe_embed_k,root_encode='graphormer',embed_elem_group=model.embed_elem_group,multi_hop_max_dist=model.multi_hop_max_dist)
175
+ dataset=CandidateDataset(entries,processor,cache_size=config.get('feature_cache_per_worker',128))
176
+ size=config.get('batch_size',64);batches=[];begin=0
177
+ while begin<len(entries):
178
+ end=begin+1
179
+ while end<len(entries) and entries[end][7]==entries[begin][7]:end+=1
180
+ batches.extend(range(i,min(i+size,end)) for i in range(begin,end,size));begin=end
181
+ loader=DataLoader(dataset,batch_sampler=batches,num_workers=workers,collate_fn=collate,multiprocessing_context='fork' if workers else None,prefetch_factor=1 if workers else None)
182
+ iterator=iter(loader);device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
183
+ for network in models.values():network.to(device)
184
+ obs_bins=torch.from_numpy(np.stack([x[0] for x in obs])).to(device);obs_probs=torch.from_numpy(np.stack([x[1] for x in obs])).to(device);obs_masses=torch.from_numpy(np.stack([x[2] for x in obs])).to(device)
185
+ completed=0;next_progress=4096;deadline_reached=False
186
+ for batch in iterator:
187
+ if time.monotonic()-started>=config.get('simulation_deadline_seconds',16000):
188
+ deadline_reached=True
189
+ print(json.dumps({'event':'simulation_deadline','completed':completed,'total':len(entries),'seconds':time.monotonic()-started}),flush=True)
190
+ break
191
+ indices=batch['_indices']; completed+=len(batch['_errors'])
192
+ for index in batch['_errors']:remaining[entries[index][1]]-=1
193
+ if batch['_errors']:print(json.dumps({'event':'unsupported_feature_entries','count':len(batch['_errors'])}),flush=True)
194
+ if not indices:continue
195
+ batch=to_device(batch,device);m,v,c=predict_sparse(models[batch['_expert']],batch,config.get('sparse_k',100))
196
+ assignments=[(b,q,entries[index][2]) for b,index in enumerate(indices) for q in group_queries[entries[index][1]]]
197
+ a=np.asarray(assignments,np.int64);ar=torch.from_numpy(a[:,0]).to(device);aq=torch.from_numpy(a[:,1]).to(device)
198
+ computed={}
199
+ if mode=='grid' or alternatives:computed['grid']=entropy_overlap(m,v,c,obs_bins,obs_probs,ar,aq)
200
+ tolerance_modes=list(TOLERANCES) if alternatives else ([mode] if mode!='grid' else [])
201
+ if tolerance_modes:computed.update(entropy_tolerant(m,v,c,obs_masses,obs_probs,ar,aq,tolerance_modes))
202
+ for key,value in computed.items():
203
+ value=np.nan_to_num(value.cpu().numpy(),nan=-1.,posinf=-1.,neginf=-1.)
204
+ if key==mode:scores[a[:,1],a[:,2]]=value
205
+ if key in alternatives:alternatives[key][a[:,1],a[:,2]]=value
206
+ for index in indices:remaining[entries[index][1]]-=1
207
+ completed+=len(indices)
208
+ if completed>=next_progress:
209
+ print(json.dumps({'event':'simulated','candidates':completed,'total':len(entries),'seconds':time.monotonic()-started}),flush=True)
210
+ next_progress=(completed//4096+1)*4096
211
+ if hasattr(iterator,'_shutdown_workers'):iterator._shutdown_workers()
212
+ del iterator,loader,model,other,models,network
213
+ if completed!=len(entries) and not deadline_reached:raise RuntimeError('Incomplete simulation')
214
+ incomplete={q for g,n in enumerate(remaining) if n for q in group_queries[g]}
215
+ failed=[q for i,q in enumerate(queries) if eligible[i] and (i in incomplete or scores[i].max()<0)]
216
+ missing_failed=[q for q in failed if q['query_id'] not in fallback]
217
+ if missing_failed:
218
+ with tempfile.TemporaryDirectory(prefix='massspec-unsupported-') as tmp:
219
+ tmp=Path(tmp);write_input(tmp/'input',missing_failed,pools)
220
+ subprocess.run(['bash',str(ROOT/'fallback/infer.sh'),str(tmp/'input'),str(tmp/'output')],check=True)
221
+ fallback.update({r['query_id']:r['ranking'] for r in (json.loads(l) for l in (tmp/'output/rankings.jsonl').open())})
222
+ failed_ids={q['query_id'] for q in failed}
223
+ for i,q in enumerate(queries):
224
+ if q['query_id'] in failed_ids:eligible[i]=False
225
+ args.output_root.mkdir(parents=True,exist_ok=True);tmp=args.output_root/'rankings.jsonl.tmp'
226
+ with tmp.open('w') as f:
227
+ for i,q in enumerate(queries):
228
+ cs=pools[q['candidate_pool_id']];ids=[c['candidate_id'] for c in cs]
229
+ if eligible[i]:
230
+ native_weight=1. if domain(q,'released') else float(config.get('outside_native_weight',1.))
231
+ fused=native_weight*np.maximum(scores[i,:len(ids)],0.)+float(config['inverse_score_weight'])*np.where(np.isfinite(inverse_scores[i,:len(ids)]),inverse_scores[i,:len(ids)],0.)
232
+ ranking=[ids[j] for j in sorted(range(len(ids)),key=lambda j:(-float(fused[j]),ids[j]))]
233
+ else:ranking=fallback[q['query_id']]
234
+ if len(ranking)!=len(ids) or set(ranking)!=set(ids):raise ValueError('Invalid ranking')
235
+ f.write(json.dumps({'query_id':q['query_id'],'ranking':ranking},separators=(',',':'))+'\n')
236
+ os.replace(tmp,args.output_root/'rankings.jsonl')
237
+ if args.research_scores is not None:
238
+ args.research_scores.parent.mkdir(parents=True,exist_ok=True);np.savez_compressed(args.research_scores,scores=scores,inverse_scores=inverse_scores,eligible=np.asarray(eligible,dtype=bool),query_ids=np.asarray([q['query_id'] for q in queries]),**{'native_'+key:value for key,value in alternatives.items()})
239
+ print(json.dumps({'event':'complete','elapsed_seconds':time.monotonic()-started,'queries':len(queries),'candidate_simulations':len(entries)}),flush=True)
240
+
241
+ if __name__=='__main__':
242
+ p=argparse.ArgumentParser();p.add_argument('input_root',type=Path);p.add_argument('output_root',type=Path);p.add_argument('--research-scores',type=Path,help='Development-only optional diagnostic outside the contracted output directory');run(p.parse_args())
shared/package-files/41/41ae8da4b43a996c61d439a7cc34629031489fd85dfa46bff2dee57c1fe95777/direct_forward_runtime.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Portable condition-aware direct spectrum scoring for supplied top-eight structures."""
2
+ from pathlib import Path
3
+ import hashlib,time
4
+ import numpy as np
5
+ import torch
6
+ from direct_forward_model import DirectForward,fingerprint_vector,spectrum_target
7
+ from direct_forward_features import molecule_features,spectrum_features
8
+
9
+ def outside(row):
10
+ return not(row.get('adduct')=='[M+H]+' and row.get('instrument_type') in ['Orbitrap','QTOF'] and row.get('collision_energy') is not None)
11
+
12
+ def score(queries,pools,positions,configuration,root):
13
+ start=time.monotonic();root=Path(root);cfg=configuration
14
+ assert cfg['coefficient']==.03125 and cfg['domain']=='outside' and cfg['k']==8 and cfg['batch_size']==256
15
+ assert positions.shape==(len(queries),8)
16
+ def asset(key):
17
+ item=cfg[key];path=root/item['path'];assert hashlib.sha256(path.read_bytes()).hexdigest()==item['sha256'];return path
18
+ checkpoint=asset('asset');idf_path=asset('idf_asset')
19
+ rows=[];columns=[];smiles=[]
20
+ for i,q in enumerate(queries):
21
+ if not outside(q):continue
22
+ cs=pools[q['candidate_pool_id']]
23
+ for column,j in enumerate(positions[i]):
24
+ if j>=0:assert j<len(cs);rows.append(i);columns.append(column);smiles.append(cs[int(j)]['smiles'])
25
+ scores=np.zeros(positions.shape,np.float32)
26
+ if not rows:return scores,dict(queries=len(queries),active_queries=0,pairs=0,unique_structures=0,elapsed_seconds=time.monotonic()-start)
27
+ unique=sorted(set(smiles));lookup={s:i for i,s in enumerate(unique)}
28
+ # Serial fresh RDKit extraction avoids new worker copies of the graph-stage parent.
29
+ molecular=[molecule_features(s) for s in unique];packed=np.stack([x[0] for x in molecular]);mass=np.array([x[1] for x in molecular],np.float32);molecules=np.array([lookup[s] for s in smiles],np.int64);del molecular,smiles,lookup
30
+ rows=np.asarray(rows,np.int64);columns=np.asarray(columns,np.int64);active=np.unique(rows);query_lookup=np.full(len(queries),-1,np.int64);query_lookup[active]=np.arange(len(active));spectra=[spectrum_features(queries[int(i)]) for i in active];peaks=torch.from_numpy(np.stack([v[0] for v in spectra])).cuda();meta=torch.from_numpy(np.stack([v[1] for v in spectra])).cuda();del spectra
31
+ torch.set_float32_matmul_precision('high');torch.set_num_threads(2)
32
+ state=torch.load(checkpoint,map_location='cpu',weights_only=False);assert set(state)=={'state_dict','model_config','training_checkpoint_sha256'};model=DirectForward(**state['model_config']).cuda().eval();model.load_state_dict(state['state_dict'],strict=True);del state
33
+ idf=torch.from_numpy(np.load(idf_path)).cuda();batch=cfg['batch_size']
34
+ with torch.inference_mode():
35
+ target,valid=spectrum_target(peaks,meta,model.bins,model.bin_width)
36
+ for b in range(0,len(rows),batch):
37
+ end=min(b+batch,len(rows));mi=molecules[b:end];qi=torch.from_numpy(query_lookup[rows[b:end]]).cuda();bits=torch.from_numpy(np.unpackbits(packed[mi],axis=1)).cuda();fp=fingerprint_vector(bits,idf);masses=torch.from_numpy(mass[mi]).cuda()
38
+ with torch.autocast('cuda',dtype=torch.bfloat16):prediction=model(fp,masses,meta[qi])
39
+ values=(prediction.float()*target[qi]).sum(-1)*valid[qi]
40
+ scores[rows[b:end],columns[b:end]]=values.cpu().numpy()
41
+ assert np.isfinite(scores).all() and scores.min()>=0 and scores.max()<=1.000001
42
+ report=dict(queries=len(queries),active_queries=len(active),pairs=len(rows),unique_structures=len(unique),empty_target_queries=int((~valid).sum()),elapsed_seconds=time.monotonic()-start,checkpoint_sha256=cfg['asset']['sha256'],idf_sha256=cfg['idf_asset']['sha256'],features='Fresh supplied-SMILES Morgan4096/RDK2048 and RDKit exact mass; supplied spectrum top64; no data cache.')
43
+ del model,idf,peaks,meta,target,valid
44
+ torch.cuda.empty_cache()
45
+ return scores,report
shared/package-files/41/41fbf5a709a2978e26e8ee65c1f040d30fb0b7f70ec111f67dd83bbc7a600681/EXPERIMENTS.md ADDED
@@ -0,0 +1,864 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Selected inverse addition
2
+
3
+ {
4
+ "experiment": "capacity-warm-adduct-portable-v1",
5
+ "hypothesis": "Previously assessed inverse additions improve the fixed published energy/fusion model.",
6
+ "changed_factor": "Only the prespecified fixed inverse replacement(s) listed below. Native code, conditions, weights, energy simulations and fusion gate are byte-identical to the current publication.",
7
+ "seed": {
8
+ "capacity-warm-adduct-current-v1": 61
9
+ },
10
+ "base_publication_manifest": {
11
+ "schema": "massspecgym-retrieval-model/v1",
12
+ "checkpoint": {
13
+ "path": ".versions/generation-axcc3su_/glacier.ckpt",
14
+ "sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62",
15
+ "format": "pytorch"
16
+ },
17
+ "model_config": ".versions/generation-axcc3su_/model_config.json",
18
+ "training_provenance": {
19
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only; outside simulator continued1000steps with train-only decoys and contrastive weight0.2",
20
+ "pretrained_assets": []
21
+ }
22
+ },
23
+ "baseline_score_cache": "fusion-candidate-aromatic-current-v1-score-cache",
24
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
25
+ "replacements": [
26
+ {
27
+ "case": "capacity_warm_adduct",
28
+ "asset": {
29
+ "path": "replacement-capacity_warm_adduct.pt",
30
+ "sha256": "47c38156c8dd8d18f6216d42e95a568ac9278a0dbaab50ddad19c7bfb6867ffa"
31
+ },
32
+ "old_asset_key": "outside_capacity_replica_asset",
33
+ "old_checkpoint_sha256": "1e00f641e802e610ef9e7987042b2ca1e7bba01542f6ff1de05c6f93a1e88ca2",
34
+ "domain": "outside",
35
+ "weight": 0.03125,
36
+ "training_checkpoint_sha256": "47c38156c8dd8d18f6216d42e95a568ac9278a0dbaab50ddad19c7bfb6867ffa",
37
+ "training_work": "peak-capacity-adduct-warm-v1",
38
+ "train8_cpu_runtime_class_max_difference": 0.0
39
+ }
40
+ ],
41
+ "checkpoint_sha256": {
42
+ "capacity_warm_adduct": "47c38156c8dd8d18f6216d42e95a568ac9278a0dbaab50ddad19c7bfb6867ffa"
43
+ },
44
+ "component_assessments": [
45
+ "capacity-warm-adduct-current-v1"
46
+ ],
47
+ "selected": false,
48
+ "status": "Explicit actual-result review complete; guarded atomic publication ready.",
49
+ "candidate_manifest": {
50
+ "schema": "massspecgym-retrieval-model/v1",
51
+ "checkpoint": {
52
+ "path": ".versions/generation-ek3qcmkt/glacier.ckpt",
53
+ "sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62",
54
+ "format": "pytorch"
55
+ },
56
+ "model_config": ".versions/generation-ek3qcmkt/model_config.json",
57
+ "training_provenance": {
58
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only; outside simulator continued1000steps with train-only decoys and contrastive weight0.2",
59
+ "pretrained_assets": []
60
+ }
61
+ },
62
+ "contracts": {
63
+ "five": {
64
+ "queries": 5,
65
+ "maximum_score_differences": {
66
+ "inverse": 0.0,
67
+ "native": 1.4901161193847656e-08,
68
+ "native_original": 1.4901161193847656e-08,
69
+ "gate": 0.0
70
+ },
71
+ "all_complete_rankings_match_independent_components": true,
72
+ "relocated": true,
73
+ "working_directory": "/tmp",
74
+ "labels_read": false,
75
+ "fitting_performed": false
76
+ },
77
+ "sensitive-train": {
78
+ "queries": 8,
79
+ "maximum_score_differences": {
80
+ "inverse": 0.0,
81
+ "native": 5.960464477539063e-08,
82
+ "native_original": 8.940696716308594e-08,
83
+ "gate": 0.0
84
+ },
85
+ "all_complete_rankings_match_independent_components": true,
86
+ "relocated": true,
87
+ "working_directory": "/tmp",
88
+ "labels_read": false,
89
+ "fitting_performed": false
90
+ }
91
+ },
92
+ "full_inverse_compute": {
93
+ "command": [
94
+ "bash",
95
+ "/workspace/research/capacity-warm-adduct-portable-v1/inverse-package/infer.sh",
96
+ "/workspace/research/validation-input",
97
+ "/workspace/research/capacity-warm-adduct-portable-v1/full-inverse",
98
+ "--internal-scores",
99
+ "/workspace/research/capacity-warm-adduct-portable-v1/scores.npz"
100
+ ],
101
+ "started_utc": "2026-10-31T20:47:16.696554+00:00",
102
+ "finished_utc": "2026-10-31T20:56:47.888867+00:00",
103
+ "elapsed_seconds": 571.1923459079117,
104
+ "user_cpu_seconds": 2287.443577,
105
+ "system_cpu_seconds": 29.967561,
106
+ "peak_child_rss_kib": 9042068,
107
+ "exit_code": 0
108
+ },
109
+ "resource_observation": {
110
+ "max_sampled_sum_rss_bytes": 44997775360,
111
+ "samples": 284,
112
+ "interval_seconds": 2,
113
+ "elapsed_seconds": 570.5338477706537,
114
+ "last": {
115
+ "rss_bytes": 2162085888,
116
+ "processes": 3
117
+ },
118
+ "scope": "Verifier parent and complete child process tree, sampled from before full inverse start. Shared pages counted repeatedly; brief peaks can be missed."
119
+ },
120
+ "actual_full_inverse_replay": true,
121
+ "full_result": {
122
+ "benchmark_score": {
123
+ "at_or_above_upper_reference": true,
124
+ "comparable_to_test_reference": false,
125
+ "direction": "maximize",
126
+ "evaluation_fold": "validation",
127
+ "lower_reference": 0.04004329004329004,
128
+ "metric": "hit_rate_at_1",
129
+ "raw_performance": 0.5916928303052138,
130
+ "saturation": "upper",
131
+ "score": 1.0,
132
+ "unclipped_score": 1.2154567430771002,
133
+ "upper_reference": 0.4939052175894281,
134
+ "version": "massspecgym-retrieval-score/v1"
135
+ },
136
+ "external_reference_context": {
137
+ "comparable_to_this_validation_report": false,
138
+ "fold": "test",
139
+ "hit_rate_at_1": 0.4939052175894281,
140
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
141
+ },
142
+ "global_error": null,
143
+ "metrics": {
144
+ "hit_rate_at_1": 0.5916928303052138,
145
+ "hit_rate_at_20": 0.8597972103556539,
146
+ "hit_rate_at_5": 0.7520201760255288
147
+ },
148
+ "paired_baseline_delta": {
149
+ "confidence": 0.95,
150
+ "estimate": 0.0007205723403160225,
151
+ "grouping": "supplied target_inchikey connectivity block",
152
+ "lower": 0.00016315265874067855,
153
+ "molecule_groups": 3185,
154
+ "queries": 19429,
155
+ "resamples": 2000,
156
+ "seed": 0,
157
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
158
+ "upper": 0.0012791837027820575
159
+ },
160
+ "queries": 19429,
161
+ "schema": "massspecgym-retrieval-development-report/v1",
162
+ "strata": {
163
+ "adduct": {
164
+ "[M+H]+": {
165
+ "hit_rate_at_1": 0.6696841818676831,
166
+ "queries": 14692
167
+ },
168
+ "[M+Na]+": {
169
+ "hit_rate_at_1": 0.3497994511294068,
170
+ "queries": 4737
171
+ }
172
+ },
173
+ "candidate_pool_size": {
174
+ "129-256": {
175
+ "hit_rate_at_1": 0.592646072920427,
176
+ "queries": 19391
177
+ },
178
+ "33-128": {
179
+ "hit_rate_at_1": 0.10526315789473684,
180
+ "queries": 38
181
+ }
182
+ },
183
+ "collision_energy": {
184
+ "20-39.999": {
185
+ "hit_rate_at_1": 0.787426614481409,
186
+ "queries": 4088
187
+ },
188
+ "40-59.999": {
189
+ "hit_rate_at_1": 0.768985322271857,
190
+ "queries": 1567
191
+ },
192
+ "<20": {
193
+ "hit_rate_at_1": 0.5991666666666666,
194
+ "queries": 1200
195
+ },
196
+ ">=60": {
197
+ "hit_rate_at_1": 0.7817307692307692,
198
+ "queries": 3120
199
+ },
200
+ "missing": {
201
+ "hit_rate_at_1": 0.4140046541146605,
202
+ "queries": 9454
203
+ }
204
+ },
205
+ "instrument_type": {
206
+ "": {
207
+ "hit_rate_at_1": 0.6275720164609053,
208
+ "queries": 486
209
+ },
210
+ "Orbitrap": {
211
+ "hit_rate_at_1": 0.5980899081452643,
212
+ "queries": 16439
213
+ },
214
+ "QTOF": {
215
+ "hit_rate_at_1": 0.5427316293929713,
216
+ "queries": 2504
217
+ }
218
+ },
219
+ "routing_domain": {
220
+ "fallback": {
221
+ "hit_rate_at_1": 0.41279009798865396,
222
+ "queries": 9695
223
+ },
224
+ "glacier_released": {
225
+ "hit_rate_at_1": 0.7698787754263406,
226
+ "queries": 9734
227
+ }
228
+ }
229
+ },
230
+ "uncertainty": {
231
+ "confidence": 0.95,
232
+ "estimate": 0.5916928303052138,
233
+ "grouping": "supplied target_inchikey connectivity block",
234
+ "lower": 0.5536948341344984,
235
+ "molecule_groups": 3185,
236
+ "queries": 19429,
237
+ "resamples": 2000,
238
+ "seed": 0,
239
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
240
+ "upper": 0.627156415176479
241
+ },
242
+ "valid_rankings": 19429
243
+ },
244
+ "outside_result": {
245
+ "benchmark_score": {
246
+ "at_or_above_upper_reference": false,
247
+ "comparable_to_test_reference": false,
248
+ "direction": "maximize",
249
+ "evaluation_fold": "validation",
250
+ "lower_reference": 0.04004329004329004,
251
+ "metric": "hit_rate_at_1",
252
+ "raw_performance": 0.41279009798865396,
253
+ "saturation": null,
254
+ "score": 0.821277981963957,
255
+ "unclipped_score": 0.821277981963957,
256
+ "upper_reference": 0.4939052175894281,
257
+ "version": "massspecgym-retrieval-score/v1"
258
+ },
259
+ "external_reference_context": {
260
+ "comparable_to_this_validation_report": false,
261
+ "fold": "test",
262
+ "hit_rate_at_1": 0.4939052175894281,
263
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
264
+ },
265
+ "global_error": null,
266
+ "metrics": {
267
+ "hit_rate_at_1": 0.41279009798865396,
268
+ "hit_rate_at_20": 0.7458483754512636,
269
+ "hit_rate_at_5": 0.5855595667870036
270
+ },
271
+ "paired_baseline_delta": {
272
+ "confidence": 0.95,
273
+ "estimate": 0.001444043321299639,
274
+ "grouping": "supplied target_inchikey connectivity block",
275
+ "lower": 0.00033694995571926134,
276
+ "molecule_groups": 1119,
277
+ "queries": 9695,
278
+ "resamples": 2000,
279
+ "seed": 0,
280
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
281
+ "upper": 0.00260780301335411
282
+ },
283
+ "queries": 9695,
284
+ "schema": "massspecgym-retrieval-development-report/v1",
285
+ "strata": {
286
+ "adduct": {
287
+ "[M+H]+": {
288
+ "hit_rate_at_1": 0.47297297297297297,
289
+ "queries": 4958
290
+ },
291
+ "[M+Na]+": {
292
+ "hit_rate_at_1": 0.3497994511294068,
293
+ "queries": 4737
294
+ }
295
+ },
296
+ "candidate_pool_size": {
297
+ "129-256": {
298
+ "hit_rate_at_1": 0.41400020710365537,
299
+ "queries": 9657
300
+ },
301
+ "33-128": {
302
+ "hit_rate_at_1": 0.10526315789473684,
303
+ "queries": 38
304
+ }
305
+ },
306
+ "collision_energy": {
307
+ "20-39.999": {
308
+ "hit_rate_at_1": 0.2621359223300971,
309
+ "queries": 103
310
+ },
311
+ "40-59.999": {
312
+ "hit_rate_at_1": 0.5394736842105263,
313
+ "queries": 76
314
+ },
315
+ "<20": {
316
+ "hit_rate_at_1": 0.28,
317
+ "queries": 25
318
+ },
319
+ ">=60": {
320
+ "hit_rate_at_1": 0.35135135135135137,
321
+ "queries": 37
322
+ },
323
+ "missing": {
324
+ "hit_rate_at_1": 0.4140046541146605,
325
+ "queries": 9454
326
+ }
327
+ },
328
+ "instrument_type": {
329
+ "": {
330
+ "hit_rate_at_1": 0.6275720164609053,
331
+ "queries": 486
332
+ },
333
+ "Orbitrap": {
334
+ "hit_rate_at_1": 0.37639766650461837,
335
+ "queries": 8228
336
+ },
337
+ "QTOF": {
338
+ "hit_rate_at_1": 0.6116207951070336,
339
+ "queries": 981
340
+ }
341
+ },
342
+ "routing_domain": {
343
+ "fallback": {
344
+ "hit_rate_at_1": 0.41279009798865396,
345
+ "queries": 9695
346
+ }
347
+ }
348
+ },
349
+ "uncertainty": {
350
+ "confidence": 0.95,
351
+ "estimate": 0.41279009798865396,
352
+ "grouping": "supplied target_inchikey connectivity block",
353
+ "lower": 0.3658913245023047,
354
+ "molecule_groups": 1119,
355
+ "queries": 9695,
356
+ "resamples": 2000,
357
+ "seed": 0,
358
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
359
+ "upper": 0.46135598539313016
360
+ },
361
+ "valid_rankings": 9695
362
+ },
363
+ "final_gate_seconds": 87.62865331489593,
364
+ "numerical_runtime": {
365
+ "python": "/opt/glacier/bin/python",
366
+ "numpy": "2.4.6",
367
+ "torch": "2.6.0+cu124"
368
+ },
369
+ "component_parity": {
370
+ "same_top_choices": 19427,
371
+ "same_full_rankings": 16544,
372
+ "maximum_score_difference": 6.219744682312012e-05,
373
+ "baseline_all_complete_rankings_exact": true,
374
+ "baseline_max_score_difference": 0.0
375
+ },
376
+ "reused_native_work": "native-proton-energy-full-v1",
377
+ "base_inverse_work": "known-inverse-joint-portable-v1",
378
+ "actual_full_combined_portable_replay": false,
379
+ "scope": "Fresh full portable inverse replay and relocated combined5/8TRAIN checks; unchanged native scores reused from the full native energy replay. Not a new full combined invocation. Molecule-group intervals are not selection-adjusted.",
380
+ "full_mces_paired": {
381
+ "queries": 19429,
382
+ "candidate_mces_at_1": 6.6803232281640845,
383
+ "baseline_mces_at_1": 6.707885120181173,
384
+ "paired_mces_delta": {
385
+ "estimate": -0.02756189201708786,
386
+ "lower": -0.045618664562945284,
387
+ "upper": -0.009242239163168648,
388
+ "confidence": 0.95,
389
+ "resamples": 2000,
390
+ "seed": 0,
391
+ "molecule_groups": 3185,
392
+ "queries": 19429,
393
+ "grouping": "supplied target_inchikey connectivity block",
394
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
395
+ },
396
+ "direction": "Negative candidate-minus-baseline change is favorable.",
397
+ "scope": "Same19429validationqueries, native MCES threshold15/strongerbound/CBC cached distances, no approximation. Intervals not selection-adjusted.",
398
+ "rankings_sha256": {
399
+ "candidate": "c0cb426b655ad8ea0eb3df507a23828ee8095e579253ef4ef11a6268af6d4fcc",
400
+ "baseline": "320532ea8f27c94e5fb39d5913854bdb1ae9bae5c63424d9d2370d4af4a79ed2"
401
+ }
402
+ },
403
+ "error_review": {
404
+ "candidate": {
405
+ "queries": 19429,
406
+ "gained_top1": 21,
407
+ "lost_top1": 7,
408
+ "net_top1": 14,
409
+ "molecule_groups": 3185,
410
+ "groups_net_improved": 20,
411
+ "groups_net_worse": 7,
412
+ "groups_net_tied": 3158,
413
+ "largest_group_gain": 2,
414
+ "largest_group_loss": -1,
415
+ "paired": {
416
+ "1": {
417
+ "estimate": 0.0007205723403160225,
418
+ "lower": 0.00016315265874067855,
419
+ "upper": 0.0012791837027820575,
420
+ "confidence": 0.95,
421
+ "resamples": 2000,
422
+ "seed": 0,
423
+ "molecule_groups": 3185,
424
+ "queries": 19429,
425
+ "grouping": "supplied target_inchikey connectivity block",
426
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
427
+ "net_hits": 14
428
+ },
429
+ "5": {
430
+ "estimate": 0.0002573472643985794,
431
+ "lower": -0.0002698181732783543,
432
+ "upper": 0.0008211236787986028,
433
+ "confidence": 0.95,
434
+ "resamples": 2000,
435
+ "seed": 0,
436
+ "molecule_groups": 3185,
437
+ "queries": 19429,
438
+ "grouping": "supplied target_inchikey connectivity block",
439
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
440
+ "net_hits": 5
441
+ },
442
+ "20": {
443
+ "estimate": -5.146945287971589e-05,
444
+ "lower": -0.0005747093989649017,
445
+ "upper": 0.0004643594364628202,
446
+ "confidence": 0.95,
447
+ "resamples": 2000,
448
+ "seed": 0,
449
+ "molecule_groups": 3185,
450
+ "queries": 19429,
451
+ "grouping": "supplied target_inchikey connectivity block",
452
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
453
+ "net_hits": -1
454
+ }
455
+ },
456
+ "strata": {
457
+ "adduct": {
458
+ "[M+Na]+": {
459
+ "queries": 4737,
460
+ "baseline_hit1": 0.3478995144606291,
461
+ "candidate_hit1": 0.3497994511294068,
462
+ "net_top1": 9
463
+ },
464
+ "[M+H]+": {
465
+ "queries": 14692,
466
+ "baseline_hit1": 0.6693438606044105,
467
+ "candidate_hit1": 0.6696841818676831,
468
+ "net_top1": 5
469
+ }
470
+ },
471
+ "instrument_type": {
472
+ "Orbitrap": {
473
+ "queries": 16439,
474
+ "baseline_hit1": 0.5972991057850234,
475
+ "candidate_hit1": 0.5980899081452643,
476
+ "net_top1": 13
477
+ },
478
+ "QTOF": {
479
+ "queries": 2504,
480
+ "baseline_hit1": 0.542332268370607,
481
+ "candidate_hit1": 0.5427316293929713,
482
+ "net_top1": 1
483
+ },
484
+ "": {
485
+ "queries": 486,
486
+ "baseline_hit1": 0.6275720164609053,
487
+ "candidate_hit1": 0.6275720164609053,
488
+ "net_top1": 0
489
+ }
490
+ },
491
+ "collision_energy": {
492
+ "40-59.999": {
493
+ "queries": 1567,
494
+ "baseline_hit1": 0.768985322271857,
495
+ "candidate_hit1": 0.768985322271857,
496
+ "net_top1": 0
497
+ },
498
+ "20-39.999": {
499
+ "queries": 4088,
500
+ "baseline_hit1": 0.787426614481409,
501
+ "candidate_hit1": 0.787426614481409,
502
+ "net_top1": 0
503
+ },
504
+ "missing": {
505
+ "queries": 9454,
506
+ "baseline_hit1": 0.41252379944996825,
507
+ "candidate_hit1": 0.4140046541146605,
508
+ "net_top1": 14
509
+ },
510
+ "<20": {
511
+ "queries": 1200,
512
+ "baseline_hit1": 0.5991666666666666,
513
+ "candidate_hit1": 0.5991666666666666,
514
+ "net_top1": 0
515
+ },
516
+ ">=60": {
517
+ "queries": 3120,
518
+ "baseline_hit1": 0.7817307692307692,
519
+ "candidate_hit1": 0.7817307692307692,
520
+ "net_top1": 0
521
+ }
522
+ }
523
+ },
524
+ "elapsed_seconds": 4.427580880001187,
525
+ "rankings_sha256": {
526
+ "baseline": "320532ea8f27c94e5fb39d5913854bdb1ae9bae5c63424d9d2370d4af4a79ed2",
527
+ "candidate": "c0cb426b655ad8ea0eb3df507a23828ee8095e579253ef4ef11a6268af6d4fcc"
528
+ },
529
+ "scope": "Aggregate validation error analysis; no fitting or runtime answers. Molecule-group intervals are not selection-adjusted."
530
+ }
531
+ },
532
+ "mces": {
533
+ "schema": "massspecgym-validation-paired-mces/v1",
534
+ "queries": 19429,
535
+ "valid_rankings": 19429,
536
+ "metrics": {
537
+ "hit_rate_at_1": 0.5916928303052138,
538
+ "hit_rate_at_5": 0.7520201760255288,
539
+ "hit_rate_at_20": 0.8597972103556539,
540
+ "mces_at_1": 6.6803232281640845
541
+ },
542
+ "mces_unique_pairs": 5857,
543
+ "mces_new_pairs": 0,
544
+ "elapsed_seconds": 7.461581276729703,
545
+ "query_set_sha256": "0f58984b1143c4e7dd1bb34cbb4c1e6933ebb9044b6c333ec27a88f8e5fbe4c4",
546
+ "rankings_sha256": "c0cb426b655ad8ea0eb3df507a23828ee8095e579253ef4ef11a6268af6d4fcc",
547
+ "comparison": "validation only, not evidence of beating a test reference",
548
+ "strata": {
549
+ "adduct": {
550
+ "[M+H]+": {
551
+ "queries": 14692,
552
+ "hit_rate_at_1": 0.6696841818676831
553
+ },
554
+ "[M+Na]+": {
555
+ "queries": 4737,
556
+ "hit_rate_at_1": 0.3497994511294068
557
+ }
558
+ },
559
+ "instrument_type": {
560
+ "": {
561
+ "queries": 486,
562
+ "hit_rate_at_1": 0.6275720164609053
563
+ },
564
+ "Orbitrap": {
565
+ "queries": 16439,
566
+ "hit_rate_at_1": 0.5980899081452643
567
+ },
568
+ "QTOF": {
569
+ "queries": 2504,
570
+ "hit_rate_at_1": 0.5427316293929713
571
+ }
572
+ },
573
+ "collision_energy": {
574
+ "20-39.999": {
575
+ "queries": 4088,
576
+ "hit_rate_at_1": 0.787426614481409
577
+ },
578
+ "40-59.999": {
579
+ "queries": 1567,
580
+ "hit_rate_at_1": 0.768985322271857
581
+ },
582
+ "<20": {
583
+ "queries": 1200,
584
+ "hit_rate_at_1": 0.5991666666666666
585
+ },
586
+ ">=60": {
587
+ "queries": 3120,
588
+ "hit_rate_at_1": 0.7817307692307692
589
+ },
590
+ "missing": {
591
+ "queries": 9454,
592
+ "hit_rate_at_1": 0.4140046541146605
593
+ }
594
+ },
595
+ "candidate_pool_size": {
596
+ "129-256": {
597
+ "queries": 19391,
598
+ "hit_rate_at_1": 0.592646072920427
599
+ },
600
+ "33-128": {
601
+ "queries": 38,
602
+ "hit_rate_at_1": 0.10526315789473684
603
+ }
604
+ },
605
+ "routing_domain": {
606
+ "fallback": {
607
+ "queries": 9695,
608
+ "hit_rate_at_1": 0.41279009798865396
609
+ },
610
+ "glacier_released": {
611
+ "queries": 9734,
612
+ "hit_rate_at_1": 0.7698787754263406
613
+ }
614
+ }
615
+ },
616
+ "uncertainty": {
617
+ "estimate": 0.5916928303052138,
618
+ "lower": 0.5536948341344984,
619
+ "upper": 0.627156415176479,
620
+ "confidence": 0.95,
621
+ "resamples": 2000,
622
+ "seed": 0,
623
+ "molecule_groups": 3185,
624
+ "queries": 19429,
625
+ "grouping": "supplied target_inchikey connectivity block",
626
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
627
+ },
628
+ "paired_baseline_delta": {
629
+ "estimate": 0.0007205723403160225,
630
+ "lower": 0.00016315265874067855,
631
+ "upper": 0.0012791837027820575,
632
+ "confidence": 0.95,
633
+ "resamples": 2000,
634
+ "seed": 0,
635
+ "molecule_groups": 3185,
636
+ "queries": 19429,
637
+ "grouping": "supplied target_inchikey connectivity block",
638
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
639
+ }
640
+ },
641
+ "model_selection_review_ready": true,
642
+ "assessment_elapsed_seconds": 138.46581715345383,
643
+ "component_rounding_review": {
644
+ "changed_top_choices": 2,
645
+ "molecule_groups": 2,
646
+ "changed_top_choice_strata": {
647
+ "[M+Na]+/Orbitrap/missing": 1,
648
+ "[M+H]+/QTOF/missing": 1
649
+ },
650
+ "changed_top_choice_score_gaps": [
651
+ {
652
+ "actual_score_advantage": 1.5497207641601562e-06,
653
+ "estimated_score_advantage": 2.5033950805664062e-06,
654
+ "actual_correct": false,
655
+ "estimated_correct": false
656
+ },
657
+ {
658
+ "actual_score_advantage": 4.291534423828125e-06,
659
+ "estimated_score_advantage": 2.771615982055664e-06,
660
+ "actual_correct": false,
661
+ "estimated_correct": false
662
+ }
663
+ ],
664
+ "actual_minus_estimate_hit_changes": {
665
+ "1": {
666
+ "0": 19429
667
+ },
668
+ "5": {
669
+ "0": 19429
670
+ },
671
+ "20": {
672
+ "0": 19429
673
+ }
674
+ },
675
+ "actual_minus_estimate_mces": -5.146945287971589e-05,
676
+ "maximum_score_difference": 6.219744682312012e-05,
677
+ "elapsed_seconds": 4.286977826617658,
678
+ "scope": "Aggregate inspection of actual portable outputs versus earlier component estimate. Components use different batching/numerical contexts; maximum score difference remains below the prespecified1e-3 bound. Actual replay is authoritative. This diagnostic neither changes rankings nor fits parameters."
679
+ },
680
+ "build_compute": {
681
+ "command": [
682
+ "/opt/glacier/bin/python",
683
+ "/workspace/research/campaign/build_fixed_inverse_candidate.py",
684
+ "--assessment",
685
+ "capacity-warm-adduct-current-v1",
686
+ "--work",
687
+ "capacity-warm-adduct-portable-v1"
688
+ ],
689
+ "started_utc": "2026-10-31T20:27:42.072831+00:00",
690
+ "finished_utc": "2026-10-31T20:28:15.583855+00:00",
691
+ "elapsed_seconds": 33.51105302898213,
692
+ "user_cpu_seconds": 12.760889,
693
+ "system_cpu_seconds": 12.334045,
694
+ "peak_child_rss_kib": 795556,
695
+ "exit_code": 0
696
+ },
697
+ "gate_loader_preflight_compute": {
698
+ "command": [
699
+ "/opt/glacier/bin/python",
700
+ "/workspace/research/campaign/check_portable_candidate_gate.py"
701
+ ],
702
+ "started_utc": "2026-10-31T20:27:40.897645+00:00",
703
+ "finished_utc": "2026-10-31T20:27:44.290786+00:00",
704
+ "elapsed_seconds": 3.3931673170009162,
705
+ "user_cpu_seconds": 10.825346,
706
+ "system_cpu_seconds": 0.373287,
707
+ "peak_child_rss_kib": 480144,
708
+ "exit_code": 0
709
+ },
710
+ "assessment_compute": {
711
+ "command": [
712
+ "/opt/glacier/bin/python",
713
+ "/workspace/research/campaign/assess_fixed_inverse_candidate.py",
714
+ "--work",
715
+ "capacity-warm-adduct-portable-v1"
716
+ ],
717
+ "started_utc": "2026-10-31T20:56:49.663772+00:00",
718
+ "finished_utc": "2026-10-31T20:59:18.198030+00:00",
719
+ "elapsed_seconds": 148.53429376147687,
720
+ "user_cpu_seconds": 144.187677,
721
+ "system_cpu_seconds": 43.77061,
722
+ "peak_child_rss_kib": 2463876,
723
+ "exit_code": 0
724
+ },
725
+ "native_parent_memory_compute": {
726
+ "command": [
727
+ "/opt/glacier/bin/python",
728
+ "/workspace/research/campaign/measure_native_parent_before_inverse.py",
729
+ "--work",
730
+ "capacity-warm-adduct-portable-v1"
731
+ ],
732
+ "started_utc": "2026-10-31T20:55:52.367265+00:00",
733
+ "finished_utc": "2026-10-31T20:58:34.649183+00:00",
734
+ "elapsed_seconds": 162.28195053897798,
735
+ "user_cpu_seconds": 601.537079,
736
+ "system_cpu_seconds": 5.982336,
737
+ "peak_child_rss_kib": 1769528,
738
+ "exit_code": 0
739
+ },
740
+ "native_parent_memory": {
741
+ "native_parent_rss_bytes": 1527427072,
742
+ "queries": 19429,
743
+ "inference_source_sha256": "153991f4d9778419ba659e9e25a93c7212748d7ee3812cd95b0e8584d920a35e",
744
+ "config_sha256": "1e88f749fc61f8fd58c78085628c14074502534ff10d2fff8103cbc6a8d065bf",
745
+ "cuda_initialized": false,
746
+ "inverse_launched": false,
747
+ "remaining_child_processes": 0,
748
+ "launch_environment": {
749
+ "PYTHONDONTWRITEBYTECODE": "1",
750
+ "OMP_NUM_THREADS": "2",
751
+ "OPENBLAS_NUM_THREADS": "1",
752
+ "DGLBACKEND": "pytorch"
753
+ },
754
+ "elapsed_seconds": 160.89431375451386,
755
+ "scope": "Exact packaged full validation input preparation through the inverse subprocess boundary. The subprocess call is intercepted before launching any inverse or native forward. Measures native parent resident memory held while full inverse runs, supplementing separate full inverse process-tree measurement. No fitting or labels."
756
+ },
757
+ "combined_memory_bound": {
758
+ "bytes": 46525202432,
759
+ "gib": 43.32997131347656,
760
+ "native_stage_sampled_bytes": 33719009280,
761
+ "inverse_process_tree_plus_prepared_parent_bytes": 46525202432,
762
+ "native_stage_plus_complete_cpu_gate_assessment_bytes": 36242018304,
763
+ "caveat": "Separate observed stage measurements combined conservatively; sampled RSS can miss brief peaks and double-count shared pages. Not a new complete combined invocation."
764
+ },
765
+ "selection_review": {
766
+ "decision": "publish",
767
+ "reviewed_utc": "2026-10-31T21:00:04.915219+00:00",
768
+ "rationale": "Actual full portable inverse replay retains the14-query Hit1 gain of the balanced warm-start arm, with positive molecule-group primary interval and favorable MCES interval versus the published model. Both relocated combined TRAIN fixtures pass. Select this one prespecified0.03125outside replacement; accept the1-query Hit20 decrease for primary and MCES gains.",
769
+ "validation_metrics": {
770
+ "hit_rate_at_1": 0.5916928303052138,
771
+ "hit_rate_at_5": 0.7520201760255288,
772
+ "hit_rate_at_20": 0.8597972103556539,
773
+ "mces_at_1": 6.6803232281640845
774
+ },
775
+ "primary": {
776
+ "estimate": 0.0007205723403160225,
777
+ "lower": 0.00016315265874067855,
778
+ "upper": 0.0012791837027820575,
779
+ "confidence": 0.95,
780
+ "resamples": 2000,
781
+ "seed": 0,
782
+ "molecule_groups": 3185,
783
+ "queries": 19429,
784
+ "grouping": "supplied target_inchikey connectivity block",
785
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
786
+ "net_hits": 14
787
+ },
788
+ "hit5": {
789
+ "estimate": 0.0002573472643985794,
790
+ "lower": -0.0002698181732783543,
791
+ "upper": 0.0008211236787986028,
792
+ "confidence": 0.95,
793
+ "resamples": 2000,
794
+ "seed": 0,
795
+ "molecule_groups": 3185,
796
+ "queries": 19429,
797
+ "grouping": "supplied target_inchikey connectivity block",
798
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
799
+ "net_hits": 5
800
+ },
801
+ "hit20": {
802
+ "estimate": -5.146945287971589e-05,
803
+ "lower": -0.0005747093989649017,
804
+ "upper": 0.0004643594364628202,
805
+ "confidence": 0.95,
806
+ "resamples": 2000,
807
+ "seed": 0,
808
+ "molecule_groups": 3185,
809
+ "queries": 19429,
810
+ "grouping": "supplied target_inchikey connectivity block",
811
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
812
+ "net_hits": -1
813
+ },
814
+ "mces": {
815
+ "estimate": -0.02756189201708786,
816
+ "lower": -0.045618664562945284,
817
+ "upper": -0.009242239163168648,
818
+ "confidence": 0.95,
819
+ "resamples": 2000,
820
+ "seed": 0,
821
+ "molecule_groups": 3185,
822
+ "queries": 19429,
823
+ "grouping": "supplied target_inchikey connectivity block",
824
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
825
+ },
826
+ "group_review": {
827
+ "gained_top1": 21,
828
+ "lost_top1": 7,
829
+ "groups_net_improved": 20,
830
+ "groups_net_worse": 7,
831
+ "largest_group_gain": 2,
832
+ "largest_group_loss": -1
833
+ },
834
+ "matched_control_component_estimate_primary": {
835
+ "estimate": 0.0005146945287971588,
836
+ "lower": 0.0,
837
+ "upper": 0.0010258625000053438,
838
+ "confidence": 0.95,
839
+ "resamples": 2000,
840
+ "seed": 0,
841
+ "molecule_groups": 3185,
842
+ "queries": 19429,
843
+ "grouping": "supplied target_inchikey connectivity block",
844
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
845
+ "net_hits": 10
846
+ },
847
+ "matched_control_component_estimate_mces": {
848
+ "estimate": -0.006845437233002213,
849
+ "lower": -0.02031125838844528,
850
+ "upper": 0.006743195155582665,
851
+ "confidence": 0.95,
852
+ "resamples": 2000,
853
+ "seed": 0,
854
+ "molecule_groups": 3185,
855
+ "queries": 19429,
856
+ "grouping": "supplied target_inchikey connectivity block",
857
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
858
+ },
859
+ "limitations": "Intervals are not adjusted for checkpoint or repeated campaign selection. The matched-control Hit1 interval touches zero and its MCES interval spans zero. Validation selection does not establish a test/generalization improvement over the previous model or the reference.",
860
+ "replay_scope": "Fresh full portable inverse replay and relocated combined5/8TRAIN checks; unchanged native scores reused from the full native energy replay. Not a new full combined invocation. Molecule-group intervals are not selection-adjusted.",
861
+ "test_evidence": false
862
+ },
863
+ "selection_review_completed": true
864
+ }
shared/package-files/4a/4ac1ff250fc2b604f7a5a8a9efde98c5a1511beb11f6d6610900b65de170ae2a/mass-error-model.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "parameters": {
3
+ "global": {
4
+ "center": 0.014311414935245329,
5
+ "scale": 0.3176135677377524,
6
+ "tail": 0.07223919348440905,
7
+ "rows": 194119
8
+ },
9
+ "0:0:0": {
10
+ "center": -0.017377113818317233,
11
+ "scale": 0.2,
12
+ "tail": 0.05,
13
+ "rows": 64738
14
+ },
15
+ "0:0:1": {
16
+ "center": 0.3827596091712057,
17
+ "scale": 1.6570847929744472,
18
+ "tail": 0.1442441590592604,
19
+ "rows": 51704
20
+ },
21
+ "0:1:0": {
22
+ "center": 0.012992398355152469,
23
+ "scale": 0.2,
24
+ "tail": 0.05,
25
+ "rows": 34603
26
+ },
27
+ "0:1:1": {
28
+ "center": 0.304643620587054,
29
+ "scale": 1.6746603326600598,
30
+ "tail": 0.07484703713016512,
31
+ "rows": 11931
32
+ },
33
+ "0:2:1": {
34
+ "center": -0.11139352203391124,
35
+ "scale": 1.4115033030101347,
36
+ "tail": 0.052783386212864145,
37
+ "rows": 3467
38
+ },
39
+ "1:0:0": {
40
+ "center": -0.022543949491959106,
41
+ "scale": 0.2,
42
+ "tail": 0.05,
43
+ "rows": 1369
44
+ },
45
+ "1:0:1": {
46
+ "center": -0.47066744099773805,
47
+ "scale": 5.354656041019607,
48
+ "tail": 0.05,
49
+ "rows": 23085
50
+ },
51
+ "1:1:0": {
52
+ "center": -0.0996056346336567,
53
+ "scale": 1.0089129214163823,
54
+ "tail": 0.05,
55
+ "rows": 863
56
+ },
57
+ "1:1:1": {
58
+ "center": 0.019112808781993635,
59
+ "scale": 0.8112433097126588,
60
+ "tail": 0.05,
61
+ "rows": 1498
62
+ },
63
+ "1:2:1": {
64
+ "center": -0.026220458545451453,
65
+ "scale": 0.8261069114016499,
66
+ "tail": 0.05,
67
+ "rows": 825
68
+ }
69
+ },
70
+ "units": "ppm",
71
+ "distribution": "Cauchy core plus fixed100ppm Cauchy outlier component; train-only median/MAD/tail fitting",
72
+ "mass_precision": "RDKit exact molecular weights and observed precursors rounded to float32, matching development features",
73
+ "training_manifest_sha256": "e3f6fc50d481de41ee13b02523cfff41d42b09abe1ca1372499f09cfb821e36a",
74
+ "training_masses_sha256": "d91fa2c9378d03022a6705249f5bafc6069fe64262d665d88650e73a6a64ce43",
75
+ "pretrained_assets": []
76
+ }
shared/package-files/4f/4f3123ec614b5c73ec6784dd27b53b3cec463c11566093ea31c4e7d4dfd6f27d/model_config.json ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "b45240216cb2ff79390253ccc63f71bfd290e66b405a8413c0f8ed13b1fbb1d6"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "all",
180
+ "workers": 8,
181
+ "max_heavy_atoms": 90,
182
+ "large_threshold": 50,
183
+ "large_mode": "specialist",
184
+ "large_asset": {
185
+ "path": "graph-large.pt",
186
+ "sha256": "fc7161d65ff9606c88c294fa12aa617a855de2fd25add669522d30be45205dcc"
187
+ },
188
+ "small_features": 98,
189
+ "structure_context_asset": {
190
+ "path": "structure_context_features.py",
191
+ "sha256": "9dba7d3c1865b1b43ac7a7bbf84cb1d68636cc0a671a1e4ef0ce2fc06ba6c8f9"
192
+ }
193
+ }
194
+ }
shared/package-files/4f/4f6c7bd133bd4d17d613a8f91d6a95ba290e6181ce5aa42b3303715caf50ee24/model_manifest.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "massspecgym-retrieval-model/v1",
3
+ "checkpoint": {
4
+ "path": ".versions/generation-a70nc_5s/model.pt",
5
+ "sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
6
+ "format": "pytorch"
7
+ },
8
+ "model_config": ".versions/generation-a70nc_5s/model_config.json",
9
+ "training_provenance": {
10
+ "data": "MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra",
11
+ "pretrained_assets": []
12
+ }
13
+ }
shared/package-files/55/5595b3ec75506a43b91961d851efd3ec0969d243ee1c62df76d9754dc1f5d3f4/README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Molecular retrieval from tandem spectra
2
+
3
+ Run `bash infer.sh INPUT_ROOT OUTPUT_ROOT`. The package uses verifier-supplied `/opt/glacier/bin/python` and one H100. Owned assets resolve relative to the package. No network, development data, persistent cache or live trainer is needed.
4
+
5
+ The unchanged backbone combines two native spectrum simulators, fifteen inverse fingerprint encoders, composition and mass evidence, and a candidate-aromaticity fusion gate. Protonated spectra with missing collision energy combine the original native simulation with a fixed 20/40/60 energy grid.
6
+
7
+ Every query receives graph reranking of the physical backbone’s first eight candidates with a fixed 0.01 centered-sigmoid increment. Two shared classifiers cover 3–50 and 51–90 heavy atoms. The same 90 graph/observed-peak features feed both. Unsupported structures receive zero increment and candidates after the first eight retain order. Candidate structures are legitimate inputs; no true query formula or answer lookup is used.
8
+
9
+ The smaller head is unchanged. The large head was fitted from random seed 199 for 2,000 fixed CPU updates with final EMA on all 1,370 cached experimental TRAIN pairs spanning 414 positive molecule groups. Same-formula decoys come from experimental TRAIN or held-out-clean synthetic metadata. Former internal diagnostic pairs are now fitting data, and their accuracy is not held-out evidence. No synthetic spectrum or validation label fitted this large head.
10
+
11
+ Full validation on 19,429 queries: Hit@1 0.59333985, Hit@5 0.75258634, Hit@20 0.85979721, MCES@1 6.66045602. Compared with E20, net gains are 8 top-1 and 16 top-5 queries; top-20 is unchanged. All selection is based on validation.
12
+
13
+ Paired 95% molecule-group intervals versus E20: Hit@1 change [-0.00033457, 0.00111273]; MCES change [-0.02338089, 0.00513621]. Both include zero and are unadjusted for selection. These results do not establish an improvement over the reference test score.
14
+
15
+ Fresh graph generation through relocated packaged source reproduces every complete validation ranking. Native/inverse/gate source/config/assets remain exact. Fresh combined TRAIN fixture independently verifies all prefixes and graph routing. No new complete native/inverse validation invocation.
16
+
17
+ The current outside-only all-pairs publication was also compared directly: this all-condition extension gains seven Hit@1 and twelve Hit@5 queries, with MCES lower by 0.00782336.
18
+
19
+ Conservative replay-stage sum: 9448.963 seconds, below 18,000. Conservative backbone-plus-graph sampled memory sum: 59.000 GiB, below 64 GiB. Nonoverlapping stages and verification overhead are included; RSS sampling can miss brief peaks and count shared pages repeatedly.
20
+
21
+ Research source, configurations, logs, seeds, measured compute, hashes, failed experiments and selection reviews are retained in research/ and EXPERIMENTS.md. Inference regenerates graph features without development caches.
shared/package-files/55/55cd07c1ae927779e611361b1d037082f0aa6d15aa08d0eee131f62f88a2af89/README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Molecular retrieval from tandem spectra
2
+
3
+ Run `bash infer.sh INPUT_ROOT OUTPUT_ROOT`. The package uses the verifier-supplied `/opt/glacier/bin/python` and one H100. Owned source and assets resolve relative to the package. No network, development data, persistent cache or live trainer is needed.
4
+
5
+ The backbone combines two native spectrum simulators, sixteen inverse fingerprint encoders, composition and mass evidence, and a candidate-aromaticity fusion gate. Protonated spectra with missing collision energy combine the original simulation with a fixed 20/40/60 energy grid. The asymmetric-loss encoder supplies the existing fixed 0.03125 outside inverse replacement.
6
+
7
+ Graph evidence reranks the physical top eight for every query using a fixed 0.01 centered-sigmoid increment. A shared head handles candidates with 3–50 heavy atoms using 90 fragment-match features plus eight deterministic candidate structure descriptors: size, aromaticity, ring membership, heteroatom fraction, rotatable bonds, hydrogen donors and acceptors, and carbon hybridization. The unchanged 51–90-heavy-atom head uses the original 90 features. Unsupported structures receive zero increment; positions after the top eight keep their order. No true query formula, identity lookup, candidate-position shortcut or query-specific fitted parameter is used.
8
+
9
+ The small head starts from our seed-191 model trained on all 9,883 experimental TRAIN pairs and 3,802 positive connectivity groups. Eight zero-initialized input columns are added, followed by 1,000 fixed seed-263 updates and final EMA. Original feature normalization is retained; new feature normalization uses TRAIN only. A matched continuation disables the new inputs. The large head uses all 1,370 cached TRAIN pairs across 414 positive groups. Former internal diagnostic groups in these all-pairs fits are fitted data. No validation examples are fitted.
10
+
11
+ Full validation on 19,429 queries: Hit@1 0.59411189, Hit@5 0.75335838, Hit@20 0.86056925, MCES@1 6.64339390. Versus the verified all-pairs small head, first-choice hits gain one, top-five and top-twenty hits are unchanged, and MCES decreases 0.00180143. Two gains and one loss span three molecule groups. Versus E23, first-choice hits gain three, top-five hits lose three, and top-twenty is unchanged.
12
+
13
+ Paired 95% molecule-group intervals versus the all-pairs head: Hit@1 change [-0.00010764,0.00025457], MCES change [-0.00469859,0.00039498]. Both include zero and are unadjusted for repeated selection. The structure-feature effect versus matched continuation has the same primary direction in a second fixed stochastic seed; that diagnostic does not establish broad seed robustness and does not select or average seeds. The original seed-263 candidate remains fixed. These validation results do not establish improvement over the test reference.
14
+
15
+ Fresh complete graph regeneration through the relocated package and fresh five-query combined TRAIN replays. Exact E23 native/inverse/fusion scores reused under source/config/asset identity; the current root prefix is checked again. This is not a new full combined native/inverse validation invocation. All comparisons are validation-only; molecule intervals are unadjusted for selection.
16
+
17
+ Conservative replay-stage sum 9386.623 seconds; conservative sampled memory sum 55.025 GiB. Limits are 18,000 seconds and 64 GiB. Sampling can miss short peaks and count shared pages repeatedly.
18
+
19
+ Training source, configurations, logs, seeds, compute, hashes and positive/negative/failed experiments are retained in research/ and EXPERIMENTS.md. All candidate graph features and descriptors are regenerated at inference.
shared/package-files/77/77c5dcb5804ea9f87d5e5efa3ac92fc92f00355a421f6e1aefab2a27df653eb3/model_manifest.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "massspecgym-retrieval-model/v1",
3
+ "checkpoint": {
4
+ "path": "model.pt",
5
+ "sha256": "ba84d1304563cdb301fa4ae1f3068e784f6e56af66ea7ae78ce68ad8caec9e4d",
6
+ "format": "pytorch"
7
+ },
8
+ "model_config": "model_config.json",
9
+ "training_provenance": {
10
+ "data": "MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra",
11
+ "pretrained_assets": []
12
+ }
13
+ }
shared/package-files/83/838fc9ba55674dbfb740b9541f763d1bcfcf9a61e58f99a1019538ad0a5145e6/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Molecular retrieval from tandem spectra
2
+
3
+ Run bash infer.sh INPUT_ROOT OUTPUT_ROOT. One H100 and verifier-supplied /opt/glacier/bin/python; all owned assets resolve relative to this package. No network, development data, external cache or live trainer is needed.
4
+
5
+ The fixed model combines two native forward simulators, sixteen inverse fingerprint encoders, composition and mass evidence, a candidate fusion gate, input-only spectral neighbor pooling, four adduct/size graph heads, a fingerprint-to-spectrum forward MLP, and a spectrum-to-fingerprint CNN. Missing-energy proton queries retain the original/20/40/60 native simulation blend.
6
+
7
+ This revision uses the fixed final dual encoder from dual-resampled-negative-v1. It starts from our original dual EMA and takes 2,500 experimental TRAIN updates. Each query receives up to four freshly sampled formula-matched decoys from distinct admissible connectivity groups; the hardest current decoy enters both the contrastive bank and pair loss. The initializer, seed, schedule, loss, five-candidate forward layout and optimization settings match the already completed fixed-table hard-decoy control. Sampling uses a separate deterministic generator and the original query, augmentation and pre-forward RNG traces remain exact. Both encoders adapt at 0.1 of the projection learning rate. The negative inventory is used only in training. Existing graph, Direct, CNN and Cross terms keep their original physical top8 positions. One fixed 0.125 cosine score applies to every supplied candidate outside known proton/Orbitrap-or-QTOF/known-energy conditions. All inference features use supplied spectra, metadata and candidate SMILES. No external pretrained assets or validation fitting.
8
+
9
+ Validation on 19,429 queries: Hit@1 0.61855988, Hit@5 0.77760049, Hit@20 0.87750270, MCES@1 6.32665088. Against the prior published model, correct-query changes are +2/-153/-153; MCES changes by 0.02663544. There are 120 first-choice gains and 118 losses across 57 better and 52 worse molecule groups.
10
+
11
+ Paired 95% molecule-group Hit@1 interval [-0.00227511, 0.00243569]; donor-connected interval [-0.00227822, 0.00254426]; MCES molecule-group interval [-0.03015391, 0.08736983]. Intervals may include zero and are unadjusted for repeated model selection. This validation comparison does not establish superiority to the reference test score.
12
+
13
+ Fresh relocated graph, direct-forward, CNN, Cross and global-dual passes cover all19,429 validation queries and exactly reproduce sealed complete rankings. Five expanded TRAIN fixtures separately exercise the complete native/inverse/graph/neural/global pipeline with independent features, dual embeddings, NumPy cosine and final global ordering, including pool sizes3/9/17/32. Final scorer checks also cover256candidate pools. Native/inverse/pooling/fusion full outputs are reused only under unchanged source/configuration/asset identity and exact baseline reconstruction. A second full TRAIN replay from /tmp blocks Python access to development/research and package writes. Not an OS sandbox, UID10001 execution or fresh combined fullVAL invocation. Intervals unadjusted for repeated selection; no test/reference claim.
14
+
15
+ Conservative measured stage sum 12862.789 seconds and sampled additive process-tree memory estimate 61.271 GiB fit the 18,000-second and 64-GiB limits. Sampling may miss brief peaks and counts shared pages conservatively.
16
+
17
+ EXPERIMENTS.md and research/ preserve hypotheses, changed factors, seeds, measured compute, query/checkpoint hashes, selected training sources/configurations/logs, and negative experiments. The root manifest atomically selects an immutable generation.
shared/package-files/83/83b354c4b4827f7b34eb6067a523a26cbb5f8b6f8ef9019fc1c5b8460aa9390e/README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Molecular retrieval from tandem spectra
2
+
3
+ Run `bash infer.sh INPUT_ROOT OUTPUT_ROOT`. The package uses two task-trained native GLACIER forward simulators, six inverse transformers, an autoregressive composition head, and a train-fitted precursor mass-error prior. The verifier supplies `/opt/glacier/bin/python`; all other runtime code and weights are included. No network, development data, live trainer, or query cache is required.
4
+
5
+ Protonated Orbitrap/QTOF queries with observed collision energy use the original known-condition native expert and the equal condition/long23 inverse mean. Every other query uses the contrastive1000 continuation of the all-condition6000 native model. Outside inverse weights are 0.25 condition, 0.25 old, 0.125 sparse23, 0.125 sparse37, and 0.25 adduct. The composition head shares the frozen condition encoder and contributes 0.03 times the mean autoregressive count log-probability outside the known domain. Fingerprints, masses, and elemental counts come from supplied candidate SMILES. True query formulae and answer tables are never used.
6
+
7
+ Native strengths are 1 for the known domain and 0.5 otherwise; matching tolerance is max(0.005 Da, 10 ppm), with each predicted peak matched at most once. Train-fitted mass-prior strengths remain 0.05/0.01. Incomplete native pools use complete rankings from the fixed inverse model. Production uses batch128, eight chemistry workers, and a 16,000-second simulation deadline.
8
+
9
+ The native continuation uses only experimental training positives and training-structure decoys. Its matched positive-only control has the same initialization, seed, data, optimizer, and 1,000 updates. The control comparison remains uncertain, so the selection does not establish that the contrastive objective itself caused the gain.
10
+
11
+ Validation across 19,429 queries: {"hit_rate_at_1": 0.578979875443924, "hit_rate_at_5": 0.7439394719234135, "hit_rate_at_20": 0.8581501878635031, "mces_at_1": 6.940810129188327}. Paired Hit@1 change versus the previous published model: {"confidence": 0.95, "estimate": 0.0030366977199032374, "grouping": "supplied target_inchikey connectivity block", "lower": 0.00010475801793527001, "molecule_groups": 3185, "queries": 19429, "resamples": 2000, "seed": 0, "statistic": "spectrum-weighted mean; molecules sampled with replacement", "upper": 0.006192323462113621}.
12
+
13
+ Paired MCES change (lower is better): {"estimate": -0.004297699315456277, "lower": -0.055643283442922575, "upper": 0.04549200789942584, "confidence": 0.95, "resamples": 2000, "seed": 0, "molecule_groups": 3185, "queries": 19429, "grouping": "supplied target_inchikey connectivity block", "statistic": "spectrum-weighted mean; molecules sampled with replacement"}. Molecule-group intervals are not adjusted for model selection. These validation results cannot establish improvement over a test reference.
14
+
15
+ Selection combines actual portable outside native and inverse predictions with the unchanged known branch. Exported weights match the training checkpoint exactly; a combined replay from a relocated package matches independently computed full rankings on four conforming queries. This is not a fresh combined full-fold simulator replay. Training sources, configuration, compute measurements, logs, hashes, and failed experiments are preserved under research/ and EXPERIMENTS.md.
shared/package-files/98/982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d/molecular_graph_features.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Owned molecular graph features; structures are supplied candidate inputs.
2
+
3
+ Canonical atom order fixes floating-point neighbor accumulation order. No graph
4
+ is truncated, and uncommon valid atoms/bonds map to explicit bounded categories.
5
+ """
6
+ import numpy as np
7
+ from rdkit import Chem,RDLogger
8
+ from rdkit.Chem import rdMolDescriptors
9
+ RDLogger.DisableLog('rdApp.*')
10
+ ATOM_SIZES=(119,9,9,9,9,2,2,4,256,5)
11
+ BOND_SIZES=(6,2,2,8)
12
+ BOND_TYPES={'SINGLE':1,'DOUBLE':2,'TRIPLE':3,'AROMATIC':4,'DATIVE':5}
13
+
14
+ def molecule_graph(smiles):
15
+ original=Chem.MolFromSmiles(smiles)
16
+ if original is None or original.GetNumAtoms()==0:
17
+ return np.zeros((0,10),np.uint8),np.zeros((0,0),np.int32),np.zeros((0,0,4),np.uint8),0.,False
18
+ canonical=Chem.MolToSmiles(original,canonical=True,isomericSmiles=True)
19
+ mol=Chem.MolFromSmiles(canonical)
20
+ if mol is None:raise ValueError('Canonical molecular graph failed to parse')
21
+ Chem.AssignStereochemistry(mol,cleanIt=True,force=True)
22
+ atoms=list(mol.GetAtoms());n=len(atoms);degree=max((a.GetDegree() for a in atoms),default=0);features=np.zeros((n,10),np.uint8);neighbors=np.full((n,degree),-1,np.int32);bonds=np.zeros((n,degree,4),np.uint8)
23
+ for i,a in enumerate(atoms):
24
+ number=a.GetAtomicNum();isotope=a.GetIsotope();cip=a.GetProp('_CIPCode') if a.HasProp('_CIPCode') else '';chirality={'':0,'R':1,'S':2}.get(cip,3)
25
+ features[i]=[number if 0<=number<119 else 0,min(8,max(0,a.GetFormalCharge()+4)),min(8,a.GetTotalNumHs(includeNeighbors=True)),min(8,a.GetDegree()),min(8,int(a.GetHybridization())),int(a.GetIsAromatic()),int(a.IsInRing()),chirality,isotope if 0<=isotope<256 else 0,min(4,a.GetNumRadicalElectrons())]
26
+ for column,j in enumerate(sorted(v.GetIdx() for v in a.GetNeighbors())):
27
+ b=mol.GetBondBetweenAtoms(i,j);neighbors[i,column]=j;bonds[i,column]=[BOND_TYPES.get(str(b.GetBondType()),0),int(b.GetIsConjugated()),int(b.IsInRing()),min(7,int(b.GetStereo()))]
28
+ assert all(int(features[:,j].max())<size for j,size in enumerate(ATOM_SIZES))
29
+ assert all(bonds.size==0 or int(bonds[:,:,j].max())<size for j,size in enumerate(BOND_SIZES))
30
+ return features,neighbors,bonds,float(rdMolDescriptors.CalcExactMolWt(mol)),True
31
+
32
+ def collate_graphs(graphs):
33
+ """Independent dense batch for runtime and preflight, with no truncation."""
34
+ n=max((len(v[0]) for v in graphs),default=0);d=max((v[1].shape[1] for v in graphs),default=0);n=max(n,1);d=max(d,1);features=np.zeros((len(graphs),n,10),np.uint8);neighbors=np.zeros((len(graphs),n,d),np.int64);bonds=np.zeros((len(graphs),n,d,4),np.uint8);node_mask=np.zeros((len(graphs),n),bool);edge_mask=np.zeros((len(graphs),n,d),bool)
35
+ for i,(x,j,e,_,valid) in enumerate(graphs):
36
+ length=len(x);degree=j.shape[1];features[i,:length]=x;node_mask[i,:length]=valid
37
+ if degree:neighbors[i,:length,:degree]=np.maximum(j,0);bonds[i,:length,:degree]=e;edge_mask[i,:length,:degree]=j>=0
38
+ return dict(atoms=features,neighbors=neighbors,bonds=bonds,node_mask=node_mask,edge_mask=edge_mask)
shared/package-files/98/982f43fbb43dac1fdb465567e7bb282d601114437f66d1726fc9b16c751b70cf/model_config.json ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "b45240216cb2ff79390253ccc63f71bfd290e66b405a8413c0f8ed13b1fbb1d6"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "all",
180
+ "workers": 8,
181
+ "max_heavy_atoms": 90,
182
+ "large_threshold": 50,
183
+ "large_mode": "specialist",
184
+ "large_asset": {
185
+ "path": "graph-large.pt",
186
+ "sha256": "fc7161d65ff9606c88c294fa12aa617a855de2fd25add669522d30be45205dcc"
187
+ },
188
+ "small_features": 98,
189
+ "structure_context_asset": {
190
+ "path": "structure_context_features.py",
191
+ "sha256": "9dba7d3c1865b1b43ac7a7bbf84cb1d68636cc0a671a1e4ef0ce2fc06ba6c8f9"
192
+ },
193
+ "sodium_specialist": {
194
+ "small_asset": {
195
+ "path": "sodium-small-graph.pt",
196
+ "sha256": "166be11d0a16c03348da7f87ba85e22615615fd7d4573f136d9a8142b8620422"
197
+ },
198
+ "large_asset": {
199
+ "path": "sodium-large-graph.pt",
200
+ "sha256": "387feeb91016d128970cc1ea200251ec833e460a4fc1e090e6e0efe5accf114e"
201
+ },
202
+ "extra_features": 63,
203
+ "extra_feature_mode": "train_mean"
204
+ },
205
+ "direct_forward": {
206
+ "asset": {
207
+ "path": "direct-forward.pt",
208
+ "sha256": "5c7301efee51b73c6a65f14b02bfc9e54e3e382ec2a737b408f90be1580bf751"
209
+ },
210
+ "idf_asset": {
211
+ "path": "direct-forward-idf.npy",
212
+ "sha256": "825ffc15a0f640e1d67f647cb0ec2d87e307e58384281df15484f82203d9d6c7"
213
+ },
214
+ "coefficient": 0.03125,
215
+ "domain": "outside",
216
+ "k": 8,
217
+ "batch_size": 256,
218
+ "model_source": {
219
+ "path": "direct_forward_model.py",
220
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
221
+ },
222
+ "feature_source": {
223
+ "path": "direct_forward_features.py",
224
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
225
+ },
226
+ "runtime_source": {
227
+ "path": "direct_forward_runtime.py",
228
+ "sha256": "41ae8da4b43a996c61d439a7cc34629031489fd85dfa46bff2dee57c1fe95777"
229
+ }
230
+ },
231
+ "binned_inverse": {
232
+ "asset": {
233
+ "path": "binned-inverse.pt",
234
+ "sha256": "3254be6a6e896041f14ddc7b4fa6504c3d59632c808e834e4512beab960b1b42"
235
+ },
236
+ "idf_asset": {
237
+ "path": "binned-inverse-idf.npy",
238
+ "sha256": "825ffc15a0f640e1d67f647cb0ec2d87e307e58384281df15484f82203d9d6c7"
239
+ },
240
+ "coefficient": 0.03125,
241
+ "domain": "outside",
242
+ "k": 8,
243
+ "batch_size": 256,
244
+ "model_source": {
245
+ "path": "binned_inverse_model.py",
246
+ "sha256": "b34619b46be5ef0fa57a1d531f6703a08dc425c8e49ca707b73f7995b8b70ecf"
247
+ },
248
+ "feature_source": {
249
+ "path": "binned_inverse_features.py",
250
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
251
+ },
252
+ "runtime_source": {
253
+ "path": "binned_inverse_runtime.py",
254
+ "sha256": "05e652848da3dcb71e3b765220144648c29dd28cd5d65da75497439321d57151"
255
+ }
256
+ },
257
+ "cross_attention": {
258
+ "architecture": "graph_peak_cross/v1",
259
+ "asset": {
260
+ "path": "graph-peak-cross.pt",
261
+ "sha256": "6829aab0fd13ccf9b6488be6443870ec123ac8d4de0610443e24448c7c715ba1"
262
+ },
263
+ "coefficient": 0.03125,
264
+ "domain": "outside",
265
+ "k": 8,
266
+ "query_batch_size": 256,
267
+ "pair_batch_size": 128,
268
+ "encoder_max_graphs": 128,
269
+ "encoder_max_padded_nodes": 8192,
270
+ "model_source": {
271
+ "path": "graph_peak_cross_model.py",
272
+ "sha256": "ceb1368c5210eb926c23e65689bed4c886d6730b655b19e32ce5ea07c8c93578"
273
+ },
274
+ "runtime_source": {
275
+ "path": "graph_peak_cross_runtime.py",
276
+ "sha256": "1c69bce28cee92245db394d54f0e53026d1c8126f7743ba30575f711d47b2be0"
277
+ },
278
+ "graph_model_source": {
279
+ "path": "molecular_graph_forward_model.py",
280
+ "sha256": "8e845e8d4399b7b4cbb0e71f305ea218843b2f80be7768e10f2ff14b14b9131e"
281
+ },
282
+ "graph_feature_source": {
283
+ "path": "molecular_graph_features.py",
284
+ "sha256": "982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d"
285
+ },
286
+ "parent_model_source": {
287
+ "path": "direct_forward_model.py",
288
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
289
+ },
290
+ "spectrum_feature_source": {
291
+ "path": "direct_forward_features.py",
292
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
293
+ }
294
+ },
295
+ "global_dual": {
296
+ "architecture": "graph_peak_dual/v1",
297
+ "asset": {
298
+ "path": "graph-peak-dual.pt",
299
+ "sha256": "a7d878536e188a70b2054f0930c0afb42b0c260a2ffd90732a62601b32fde28d"
300
+ },
301
+ "coefficient": 0.125,
302
+ "domain": "outside",
303
+ "scope": "all",
304
+ "query_batch_size": 256,
305
+ "score_batch_size": 128,
306
+ "encoder_max_graphs": 128,
307
+ "encoder_max_padded_nodes": 8192,
308
+ "model_source": {
309
+ "path": "graph_peak_dual_model.py",
310
+ "sha256": "8faf1e2676dd17c09694cd8996dd85b689fd8e7b77c24626d6aaeb7eba3e8a1a"
311
+ },
312
+ "runtime_source": {
313
+ "path": "graph_peak_dual_runtime.py",
314
+ "sha256": "56a7797c95d0d808cdf2e1ad7a58470bc1ff552915783ed72918be445dea3a55"
315
+ },
316
+ "cross_model_source": {
317
+ "path": "graph_peak_cross_model.py",
318
+ "sha256": "ceb1368c5210eb926c23e65689bed4c886d6730b655b19e32ce5ea07c8c93578"
319
+ },
320
+ "graph_model_source": {
321
+ "path": "molecular_graph_forward_model.py",
322
+ "sha256": "8e845e8d4399b7b4cbb0e71f305ea218843b2f80be7768e10f2ff14b14b9131e"
323
+ },
324
+ "graph_feature_source": {
325
+ "path": "molecular_graph_features.py",
326
+ "sha256": "982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d"
327
+ },
328
+ "parent_model_source": {
329
+ "path": "direct_forward_model.py",
330
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
331
+ },
332
+ "spectrum_feature_source": {
333
+ "path": "direct_forward_features.py",
334
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
335
+ }
336
+ }
337
+ }
338
+ }
shared/package-files/98/98bd29092b2f673242209bbc90508f34a88bd1bf9eb7bb20bf23e24138be0040/model_config.json ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "b45240216cb2ff79390253ccc63f71bfd290e66b405a8413c0f8ed13b1fbb1d6"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "all",
180
+ "workers": 8,
181
+ "max_heavy_atoms": 90,
182
+ "large_threshold": 50,
183
+ "large_mode": "specialist",
184
+ "large_asset": {
185
+ "path": "graph-large.pt",
186
+ "sha256": "fc7161d65ff9606c88c294fa12aa617a855de2fd25add669522d30be45205dcc"
187
+ },
188
+ "small_features": 98,
189
+ "structure_context_asset": {
190
+ "path": "structure_context_features.py",
191
+ "sha256": "9dba7d3c1865b1b43ac7a7bbf84cb1d68636cc0a671a1e4ef0ce2fc06ba6c8f9"
192
+ },
193
+ "sodium_specialist": {
194
+ "small_asset": {
195
+ "path": "sodium-small-graph.pt",
196
+ "sha256": "166be11d0a16c03348da7f87ba85e22615615fd7d4573f136d9a8142b8620422"
197
+ },
198
+ "large_asset": {
199
+ "path": "sodium-large-graph.pt",
200
+ "sha256": "387feeb91016d128970cc1ea200251ec833e460a4fc1e090e6e0efe5accf114e"
201
+ },
202
+ "extra_features": 63,
203
+ "extra_feature_mode": "train_mean"
204
+ },
205
+ "direct_forward": {
206
+ "asset": {
207
+ "path": "direct-forward.pt",
208
+ "sha256": "5c7301efee51b73c6a65f14b02bfc9e54e3e382ec2a737b408f90be1580bf751"
209
+ },
210
+ "idf_asset": {
211
+ "path": "direct-forward-idf.npy",
212
+ "sha256": "825ffc15a0f640e1d67f647cb0ec2d87e307e58384281df15484f82203d9d6c7"
213
+ },
214
+ "coefficient": 0.03125,
215
+ "domain": "outside",
216
+ "k": 8,
217
+ "batch_size": 256,
218
+ "model_source": {
219
+ "path": "direct_forward_model.py",
220
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
221
+ },
222
+ "feature_source": {
223
+ "path": "direct_forward_features.py",
224
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
225
+ },
226
+ "runtime_source": {
227
+ "path": "direct_forward_runtime.py",
228
+ "sha256": "41ae8da4b43a996c61d439a7cc34629031489fd85dfa46bff2dee57c1fe95777"
229
+ }
230
+ },
231
+ "binned_inverse": {
232
+ "asset": {
233
+ "path": "binned-inverse.pt",
234
+ "sha256": "3254be6a6e896041f14ddc7b4fa6504c3d59632c808e834e4512beab960b1b42"
235
+ },
236
+ "idf_asset": {
237
+ "path": "binned-inverse-idf.npy",
238
+ "sha256": "825ffc15a0f640e1d67f647cb0ec2d87e307e58384281df15484f82203d9d6c7"
239
+ },
240
+ "coefficient": 0.03125,
241
+ "domain": "outside",
242
+ "k": 8,
243
+ "batch_size": 256,
244
+ "model_source": {
245
+ "path": "binned_inverse_model.py",
246
+ "sha256": "b34619b46be5ef0fa57a1d531f6703a08dc425c8e49ca707b73f7995b8b70ecf"
247
+ },
248
+ "feature_source": {
249
+ "path": "binned_inverse_features.py",
250
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
251
+ },
252
+ "runtime_source": {
253
+ "path": "binned_inverse_runtime.py",
254
+ "sha256": "05e652848da3dcb71e3b765220144648c29dd28cd5d65da75497439321d57151"
255
+ }
256
+ },
257
+ "cross_attention": {
258
+ "architecture": "graph_peak_cross/v1",
259
+ "asset": {
260
+ "path": "graph-peak-cross.pt",
261
+ "sha256": "6829aab0fd13ccf9b6488be6443870ec123ac8d4de0610443e24448c7c715ba1"
262
+ },
263
+ "coefficient": 0.03125,
264
+ "domain": "outside",
265
+ "k": 8,
266
+ "query_batch_size": 256,
267
+ "pair_batch_size": 128,
268
+ "encoder_max_graphs": 128,
269
+ "encoder_max_padded_nodes": 8192,
270
+ "model_source": {
271
+ "path": "graph_peak_cross_model.py",
272
+ "sha256": "ceb1368c5210eb926c23e65689bed4c886d6730b655b19e32ce5ea07c8c93578"
273
+ },
274
+ "runtime_source": {
275
+ "path": "graph_peak_cross_runtime.py",
276
+ "sha256": "1c69bce28cee92245db394d54f0e53026d1c8126f7743ba30575f711d47b2be0"
277
+ },
278
+ "graph_model_source": {
279
+ "path": "molecular_graph_forward_model.py",
280
+ "sha256": "8e845e8d4399b7b4cbb0e71f305ea218843b2f80be7768e10f2ff14b14b9131e"
281
+ },
282
+ "graph_feature_source": {
283
+ "path": "molecular_graph_features.py",
284
+ "sha256": "982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d"
285
+ },
286
+ "parent_model_source": {
287
+ "path": "direct_forward_model.py",
288
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
289
+ },
290
+ "spectrum_feature_source": {
291
+ "path": "direct_forward_features.py",
292
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
293
+ }
294
+ },
295
+ "global_dual": {
296
+ "architecture": "graph_peak_dual/v1",
297
+ "asset": {
298
+ "path": "graph-peak-dual.pt",
299
+ "sha256": "2a882e07cdd5e3887af9e8c7015224693b96d59c54c01a1381c3e6501f60f3ad"
300
+ },
301
+ "coefficient": 0.125,
302
+ "domain": "outside",
303
+ "scope": "all",
304
+ "query_batch_size": 256,
305
+ "score_batch_size": 128,
306
+ "encoder_max_graphs": 128,
307
+ "encoder_max_padded_nodes": 8192,
308
+ "model_source": {
309
+ "path": "graph_peak_dual_model.py",
310
+ "sha256": "8faf1e2676dd17c09694cd8996dd85b689fd8e7b77c24626d6aaeb7eba3e8a1a"
311
+ },
312
+ "runtime_source": {
313
+ "path": "graph_peak_dual_runtime.py",
314
+ "sha256": "56a7797c95d0d808cdf2e1ad7a58470bc1ff552915783ed72918be445dea3a55"
315
+ },
316
+ "cross_model_source": {
317
+ "path": "graph_peak_cross_model.py",
318
+ "sha256": "ceb1368c5210eb926c23e65689bed4c886d6730b655b19e32ce5ea07c8c93578"
319
+ },
320
+ "graph_model_source": {
321
+ "path": "molecular_graph_forward_model.py",
322
+ "sha256": "8e845e8d4399b7b4cbb0e71f305ea218843b2f80be7768e10f2ff14b14b9131e"
323
+ },
324
+ "graph_feature_source": {
325
+ "path": "molecular_graph_features.py",
326
+ "sha256": "982f281d6b55eda913016c5d294f1a23e4378dcfcb043687d9b8b2353bc70e6d"
327
+ },
328
+ "parent_model_source": {
329
+ "path": "direct_forward_model.py",
330
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
331
+ },
332
+ "spectrum_feature_source": {
333
+ "path": "direct_forward_features.py",
334
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
335
+ }
336
+ }
337
+ }
338
+ }
shared/package-files/98/98d57d911bb5b74fed6a67f3769079837d05894336e4a7989a5d2fd627383ec0/preparation.json ADDED
The diff for this file is too large to render. See raw diff
 
shared/package-files/98/98e37e2cec879ea0f78e24e7e21d7a04f8e700a3d3173ffe8a6036ccd7474789/predict.py ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Portable ranking for arbitrary conforming spectra and candidate pools."""
3
+ import argparse, json, os, time
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from functools import lru_cache
6
+ from pathlib import Path
7
+ import numpy as np
8
+ import torch
9
+ from features import molecule_features,spectrum_features,sha256
10
+ from model import PeakFingerprint,normalized_fp
11
+ from relative_model import PeakFingerprint as RelativePeakFingerprint
12
+ from scoring import rank_scores
13
+ from mass_prior import mass_penalties
14
+ from composition import CompositionHead,candidate_chemistry
15
+
16
+ @lru_cache(maxsize=8192)
17
+ def cached_features(smiles): return candidate_chemistry(smiles)
18
+ def encode_pool(item):
19
+ pool_id,candidates=item
20
+ features=[cached_features(c['smiles']) for c in candidates]
21
+ return pool_id,np.stack([x[0] for x in features]),np.asarray([x[1] for x in features],np.float32),np.stack([x[2] for x in features]),np.asarray([x[3] for x in features],bool)
22
+
23
+ @torch.inference_mode()
24
+ def main():
25
+ ap=argparse.ArgumentParser(); ap.add_argument('input_root',type=Path); ap.add_argument('output_root',type=Path); ap.add_argument('--internal-scores',type=Path); args=ap.parse_args()
26
+ root=Path(__file__).resolve().parent; manifest=json.loads((root/'model_manifest.json').read_text()); config=json.loads((root/manifest['model_config']).read_text())
27
+ checkpoint=root/manifest['checkpoint']['path']
28
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']: raise ValueError('checkpoint checksum mismatch')
29
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
30
+ pools={r['candidate_pool_id']:r['candidates'] for r in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
31
+ all_scores=np.full((len(queries),256),-np.inf,np.float32) if args.internal_scores else None
32
+ by_pool={}
33
+ for i,q in enumerate(queries): by_pool.setdefault(q['candidate_pool_id'],[]).append(i)
34
+ torch.set_num_threads(4); torch.set_float32_matmul_precision('high'); device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
35
+ rule=config.get('scoring_rule','cosine')
36
+ if rule!='idf_cosine':raise ValueError('This optimized ensemble requires fixed IDF cosine scoring')
37
+ idf=None
38
+ asset=config['mass_prior_asset']; mass_file=root/asset['path']
39
+ if sha256(mass_file)!=asset['sha256']:raise ValueError('Mass-prior checksum mismatch')
40
+ mass_parameters=json.loads(mass_file.read_text())['parameters']
41
+ if rule=='idf_cosine':
42
+ asset=config['idf_asset']; path=root/asset['path']
43
+ if sha256(path)!=asset['sha256']:raise ValueError('IDF checksum mismatch')
44
+ idf=torch.from_numpy(np.load(path)).to(device)
45
+ def query_predictions(path,capture_embedding=False):
46
+ state=torch.load(path,map_location='cpu',weights_only=False);model_class=RelativePeakFingerprint if state['model_config'].get('relative_mass_bias',False) else PeakFingerprint;model=model_class(**state['model_config']).to(device).eval();model.load_state_dict(state['state_dict']);predictions=torch.empty((len(queries),6144),dtype=torch.float32)
47
+ captured=[];embedding_output=torch.empty((len(queries),state['model_config']['width']*2),dtype=torch.float32) if capture_embedding else None
48
+ handle=model.decoder.register_forward_pre_hook(lambda module,args:captured.append(args[0].detach())) if capture_embedding else None
49
+ for start in range(0,len(queries),256):
50
+ features=[spectrum_features(r,max_peaks=state['model_config']['max_peaks']) for r in queries[start:start+256]]
51
+ peaks=torch.from_numpy(np.stack([f[0] for f in features])).to(device);meta=torch.from_numpy(np.stack([f[1] for f in features])).to(device)
52
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):pred=model(peaks,meta).float().sigmoid()
53
+ predictions[start:start+len(features)]=pred.cpu()
54
+ if capture_embedding:embedding_output[start:start+len(features)]=captured.pop().cpu()
55
+ if handle is not None:handle.remove()
56
+ return (predictions,embedding_output) if capture_embedding else predictions
57
+ released=np.asarray([q['adduct']=='[M+H]+' and q['instrument_type'] in {'Orbitrap','QTOF'} and q['collision_energy'] is not None for q in queries])
58
+ outside_weight=float(config.get('outside_checkpoint_weight',1.));use_base=released.any() or outside_weight<1.
59
+ predictions,composition_embeddings=query_predictions(checkpoint,capture_embedding=True)
60
+ asset=config['ensemble_asset'];other=root/asset['path']
61
+ if sha256(other)!=asset['sha256']:raise ValueError('Ensemble checkpoint checksum mismatch')
62
+ other_predictions=query_predictions(other) if use_base else None
63
+ asset=config['outside_inverse_asset'];outside=root/asset['path']
64
+ if sha256(outside)!=asset['sha256']:raise ValueError('Outside-domain checkpoint checksum mismatch')
65
+ outside_predictions=query_predictions(outside) if (~released).any() else None
66
+ asset=config['outside_ensemble_asset'];outside_ensemble=root/asset['path']
67
+ if sha256(outside_ensemble)!=asset['sha256']:raise ValueError('Outside ensemble checkpoint checksum mismatch')
68
+ outside_ensemble_predictions=query_predictions(outside_ensemble) if (~released).any() else None
69
+ asset=config['outside_replica_asset'];replica=root/asset['path']
70
+ if sha256(replica)!=asset['sha256']:raise ValueError('Sparse replica checksum mismatch')
71
+ replica_predictions=query_predictions(replica) if (~released).any() else None
72
+ asset=config['outside_capacity_asset'];capacity_checkpoint=root/asset['path']
73
+ if sha256(capacity_checkpoint)!=asset['sha256']:raise ValueError('Capacity checkpoint checksum mismatch')
74
+ capacity_predictions=query_predictions(capacity_checkpoint) if (~released).any() else None
75
+ asset=config['outside_capacity_replica_asset'];capacity_replica_checkpoint=root/asset['path']
76
+ if sha256(capacity_replica_checkpoint)!=asset['sha256']:raise ValueError('Outside capacity replica checksum mismatch')
77
+ capacity_replica_predictions=query_predictions(capacity_replica_checkpoint) if (~released).any() else None
78
+ asset=config['known_inverse_asset'];known_checkpoint=root/asset['path']
79
+ if sha256(known_checkpoint)!=asset['sha256']:raise ValueError('Known-condition checkpoint checksum mismatch')
80
+ known_predictions=query_predictions(known_checkpoint) if released.any() else None
81
+ asset=config['known_capacity_asset'];known_capacity_checkpoint=root/asset['path']
82
+ if sha256(known_capacity_checkpoint)!=asset['sha256']:raise ValueError('Known capacity checkpoint checksum mismatch')
83
+ known_capacity_predictions=query_predictions(known_capacity_checkpoint) if released.any() else None
84
+ asset=config['known_capacity_replica_asset'];known_capacity_replica_checkpoint=root/asset['path']
85
+ if sha256(known_capacity_replica_checkpoint)!=asset['sha256']:raise ValueError('Known capacity replica checksum mismatch')
86
+ known_capacity_replica_predictions=query_predictions(known_capacity_replica_checkpoint) if released.any() else None
87
+ asset=config['outside_relative_asset'];relative_checkpoint=root/asset['path']
88
+ if sha256(relative_checkpoint)!=asset['sha256']:raise ValueError('Relative-mass checkpoint checksum mismatch')
89
+ relative_predictions=query_predictions(relative_checkpoint) if (~released).any() else None
90
+ asset=config['outside_energy_mask_asset'];energy_mask_checkpoint=root/asset['path']
91
+ if sha256(energy_mask_checkpoint)!=asset['sha256']:raise ValueError('Energy-mask checkpoint checksum mismatch')
92
+ energy_mask_predictions=query_predictions(energy_mask_checkpoint) if (~released).any() else None
93
+ # Fixed, globally shared inverse replacements.
94
+ old_predictions_by_asset={'ensemble_asset':other_predictions,'outside_capacity_asset':capacity_predictions,'outside_capacity_replica_asset':capacity_replica_predictions,'known_capacity_asset':known_capacity_predictions,'known_capacity_replica_asset':known_capacity_replica_predictions,'outside_ensemble_asset':outside_ensemble_predictions}
95
+ replacement_predictions=[]
96
+ for replacement in config.get('fixed_inverse_replacements',[]):
97
+ old_asset=config[replacement['old_asset_key']]
98
+ if old_asset['sha256']!=replacement['old_checkpoint_sha256']:raise ValueError('Replacement source mismatch')
99
+ active=released.any() if replacement['domain']=='known' else (~released).any()
100
+ if not active:continue
101
+ asset=replacement['asset'];path=root/asset['path']
102
+ if sha256(path)!=asset['sha256']:raise ValueError('Replacement checkpoint mismatch')
103
+ replacement_predictions.append((replacement,query_predictions(path),old_predictions_by_asset[replacement['old_asset_key']]))
104
+ asset=config['composition_asset'];composition_path=root/asset['path']
105
+ if sha256(composition_path)!=asset['sha256']:raise ValueError('Composition head checksum mismatch')
106
+ composition_state=torch.load(composition_path,map_location='cpu',weights_only=False)
107
+ if composition_state['encoder_sha256']!=manifest['checkpoint']['sha256']:raise ValueError('Composition encoder identity mismatch')
108
+ recipe=composition_state['config'];composition_head=CompositionHead(input_width=config['model']['width']*2,hidden_width=recipe['head_width'],dropout=recipe['dropout'],recurrent_width=recipe['recurrent_width'],count_embedding_width=recipe['count_embedding_width']).to(device).eval();composition_head.load_state_dict(composition_state['state_dict'])
109
+ args.output_root.mkdir(parents=True,exist_ok=True); temp=args.output_root/'rankings.jsonl.tmp'; started=time.monotonic()
110
+ # Fork workers never execute CUDA; they only parse candidate SMILES and pack bits.
111
+ with ProcessPoolExecutor(max_workers=min(config.get('feature_workers',8),os.cpu_count() or 1)) as ex, temp.open('w') as f:
112
+ for count,(pid,packed,masses,composition_counts,composition_valid) in enumerate(ex.map(encode_pool,((p,pools[p]) for p in by_pool),chunksize=1),1):
113
+ fp=torch.from_numpy(np.unpackbits(packed,axis=1).astype(np.float32)).to(device)
114
+ fp=normalized_fp(fp[None,:,:]*idf).bfloat16().float()
115
+ counts_tensor=torch.from_numpy(composition_counts).to(device);composition_mask=torch.from_numpy(composition_valid).to(device)
116
+ qix=by_pool[pid]; embeddings=composition_embeddings[qix].to(device); pred=predictions[qix].to(device) if predictions is not None else None;other_pred=other_predictions[qix].to(device) if other_predictions is not None else None
117
+ outside_pred=outside_predictions[qix].to(device) if outside_predictions is not None else None
118
+ outside_ensemble_pred=outside_ensemble_predictions[qix].to(device) if outside_ensemble_predictions is not None else None
119
+ replica_pred=replica_predictions[qix].to(device) if replica_predictions is not None else None
120
+ known_pred=known_predictions[qix].to(device) if known_predictions is not None else None
121
+ known_capacity_pred=known_capacity_predictions[qix].to(device) if known_capacity_predictions is not None else None
122
+ capacity_replica_pred=capacity_replica_predictions[qix].to(device) if capacity_replica_predictions is not None else None
123
+ known_capacity_replica_pred=known_capacity_replica_predictions[qix].to(device) if known_capacity_replica_predictions is not None else None
124
+ capacity_pred=capacity_predictions[qix].to(device) if capacity_predictions is not None else None
125
+ relative_pred=relative_predictions[qix].to(device) if relative_predictions is not None else None
126
+ energy_mask_pred=energy_mask_predictions[qix].to(device) if energy_mask_predictions is not None else None
127
+ replacement_pool_predictions=[(r,new[qix].to(device),old[qix].to(device)) for r,new,old in replacement_predictions]
128
+ # Match validation's bfloat16 feature rounding with float32 reduction.
129
+ scores=[]
130
+ for offset in range(0,len(qix),64):
131
+ use=released[np.asarray(qix[offset:offset+64])]
132
+ value=torch.zeros((len(use),fp.shape[1]),device=device)
133
+ if use.any() or outside_weight<1.:
134
+ first=normalized_fp(pred[offset:offset+64,None,:]*idf).bfloat16().float()
135
+ second=normalized_fp(other_pred[offset:offset+64,None,:]*idf).bfloat16().float()
136
+ value=(((first+second)*.5)*fp).sum(-1)
137
+ if (~use).any():
138
+ third=normalized_fp(outside_pred[offset:offset+64,None,:]*idf).bfloat16().float()
139
+ replica_value=normalized_fp(replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
140
+ replica_share=float(config['outside_replica_share'])
141
+ alternative=(1-replica_share)*(third*fp).sum(-1)+replica_share*(replica_value*fp).sum(-1)
142
+ fifth=normalized_fp(outside_ensemble_pred[offset:offset+64,None,:]*idf).bfloat16().float()
143
+ share=float(config['outside_ensemble_share'])
144
+ alternative=(1-share)*alternative+share*(fifth*fp).sum(-1)
145
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,outside_weight*alternative+(1-outside_weight)*value)
146
+ capacity_value=normalized_fp(capacity_pred[offset:offset+64,None,:]*idf).bfloat16().float()
147
+ capacity_delta=float(config['outside_capacity_weight'])*((capacity_value*fp).sum(-1)-(second*fp).sum(-1))
148
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+capacity_delta)
149
+ capacity_replica_value=normalized_fp(capacity_replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
150
+ replica_delta=float(config['outside_capacity_replica_weight'])*((capacity_replica_value*fp).sum(-1)-(capacity_value*fp).sum(-1))
151
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+replica_delta)
152
+ relative_value=normalized_fp(relative_pred[offset:offset+64,None,:]*idf).bfloat16().float()
153
+ relative_delta=float(config['outside_relative_weight'])*((relative_value*fp).sum(-1)-(second*fp).sum(-1))
154
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+relative_delta)
155
+ energy_mask_value=normalized_fp(energy_mask_pred[offset:offset+64,None,:]*idf).bfloat16().float()
156
+ energy_mask_delta=float(config['outside_energy_mask_weight'])*((energy_mask_value*fp).sum(-1)-(third*fp).sum(-1))
157
+ value=torch.where(torch.as_tensor(use[:,None],device=device),value,value+energy_mask_delta)
158
+ if use.any():
159
+ fourth=normalized_fp(known_pred[offset:offset+64,None,:]*idf).bfloat16().float()
160
+ known_value=(((first+fourth)*.5)*fp).sum(-1)
161
+ extra=normalized_fp(known_capacity_pred[offset:offset+64,None,:]*idf).bfloat16().float()
162
+ extra_weight=float(config['known_capacity_weight'])
163
+ known_value=(1-extra_weight)*known_value+extra_weight*(extra*fp).sum(-1)
164
+ known_capacity_replica_value=normalized_fp(known_capacity_replica_pred[offset:offset+64,None,:]*idf).bfloat16().float()
165
+ known_value+=float(config['known_capacity_replica_weight'])*((known_capacity_replica_value*fp).sum(-1)-(extra*fp).sum(-1))
166
+ value=torch.where(torch.as_tensor(use[:,None],device=device),known_value,value)
167
+ for replacement,new_pred,old_pred in replacement_pool_predictions:
168
+ new_value=normalized_fp(new_pred[offset:offset+64,None,:]*idf).bfloat16().float()
169
+ old_value=normalized_fp(old_pred[offset:offset+64,None,:]*idf).bfloat16().float()
170
+ replacement_delta=float(replacement['weight'])*((new_value*fp).sum(-1)-(old_value*fp).sum(-1))
171
+ replacement_mask=use if replacement['domain']=='known' else ~use
172
+ value=value+torch.where(torch.as_tensor(replacement_mask[:,None],device=device),replacement_delta,torch.zeros_like(replacement_delta))
173
+ if (~use).any():
174
+ outside_indices=torch.as_tensor(np.flatnonzero(~use),device=device)
175
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):
176
+ chemical=composition_head.score(embeddings[offset:offset+64][outside_indices],counts_tensor[None].expand(len(outside_indices),-1,-1))
177
+ chemical=chemical.masked_fill(~composition_mask[None],0.)
178
+ value[outside_indices]+=float(config['composition_weight'])*chemical
179
+ scores.append(value.cpu().numpy())
180
+ scores=np.concatenate(scores)
181
+ evidence=mass_penalties([queries[i] for i in qix],masses,mass_parameters)
182
+ if config.get('mass_prior_domain','all')=='released':
183
+ use=np.array([queries[i]['adduct']=='[M+H]+' and queries[i]['instrument_type'] in {'Orbitrap','QTOF'} and queries[i]['collision_energy'] is not None for i in qix])
184
+ weights=np.where(use,float(config['mass_prior_weight']),float(config.get('outside_mass_prior_weight',0.)))
185
+ scores-=weights[:,None]*evidence
186
+ else:
187
+ scores-=float(config['mass_prior_weight'])*evidence
188
+ scores=np.nan_to_num(scores,nan=-np.inf,posinf=-np.inf,neginf=-np.inf); ids=[c['candidate_id'] for c in pools[pid]]
189
+ for i,s in zip(qix,scores):
190
+ if all_scores is not None:all_scores[i,:len(s)]=s
191
+ order=sorted(range(len(ids)),key=lambda j:(-float(s[j]),ids[j]))
192
+ f.write(json.dumps({'query_id':queries[i]['query_id'],'ranking':[ids[j] for j in order]},separators=(',',':'))+'\n')
193
+ if count%500==0: print(json.dumps({'pools_ranked':count,'total_pools':len(by_pool),'ranking_seconds':time.monotonic()-started}),flush=True)
194
+ os.replace(temp,args.output_root/'rankings.jsonl')
195
+ if args.internal_scores:
196
+ args.internal_scores.parent.mkdir(parents=True,exist_ok=True)
197
+ np.savez_compressed(args.internal_scores,scores=all_scores,query_ids=np.asarray([q['query_id'] for q in queries]))
198
+ if __name__=='__main__': main()
shared/package-files/bc/bceb0eb0405cf659f313c5237bff71454cb4aa7eb092008fcf8e95c52040d561/model_config.json ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "b45240216cb2ff79390253ccc63f71bfd290e66b405a8413c0f8ed13b1fbb1d6"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "all",
180
+ "workers": 8,
181
+ "max_heavy_atoms": 90,
182
+ "large_threshold": 50,
183
+ "large_mode": "specialist",
184
+ "large_asset": {
185
+ "path": "graph-large.pt",
186
+ "sha256": "fc7161d65ff9606c88c294fa12aa617a855de2fd25add669522d30be45205dcc"
187
+ },
188
+ "small_features": 98,
189
+ "structure_context_asset": {
190
+ "path": "structure_context_features.py",
191
+ "sha256": "9dba7d3c1865b1b43ac7a7bbf84cb1d68636cc0a671a1e4ef0ce2fc06ba6c8f9"
192
+ },
193
+ "sodium_specialist": {
194
+ "small_asset": {
195
+ "path": "sodium-small-graph.pt",
196
+ "sha256": "166be11d0a16c03348da7f87ba85e22615615fd7d4573f136d9a8142b8620422"
197
+ },
198
+ "large_asset": {
199
+ "path": "sodium-large-graph.pt",
200
+ "sha256": "387feeb91016d128970cc1ea200251ec833e460a4fc1e090e6e0efe5accf114e"
201
+ },
202
+ "extra_features": 63,
203
+ "extra_feature_mode": "train_mean"
204
+ },
205
+ "direct_forward": {
206
+ "asset": {
207
+ "path": "direct-forward.pt",
208
+ "sha256": "5c7301efee51b73c6a65f14b02bfc9e54e3e382ec2a737b408f90be1580bf751"
209
+ },
210
+ "idf_asset": {
211
+ "path": "direct-forward-idf.npy",
212
+ "sha256": "825ffc15a0f640e1d67f647cb0ec2d87e307e58384281df15484f82203d9d6c7"
213
+ },
214
+ "coefficient": 0.03125,
215
+ "domain": "outside",
216
+ "k": 8,
217
+ "batch_size": 256,
218
+ "model_source": {
219
+ "path": "direct_forward_model.py",
220
+ "sha256": "a6579cf8070056163a54539746e5ac7f792aa52893ab20da25743bd1048c26cc"
221
+ },
222
+ "feature_source": {
223
+ "path": "direct_forward_features.py",
224
+ "sha256": "66519e1c0f5313cd9e7af9e8c9e3ca4548a9c9e6dbdf21b104ba5ff95a3c8369"
225
+ },
226
+ "runtime_source": {
227
+ "path": "direct_forward_runtime.py",
228
+ "sha256": "41ae8da4b43a996c61d439a7cc34629031489fd85dfa46bff2dee57c1fe95777"
229
+ }
230
+ }
231
+ }
232
+ }
shared/package-files/bc/bcef8d39ee980403916c42e282b0afc4af86473c59ee1dd6435267fdc7722f95/predict.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Portable ranking for arbitrary conforming spectra and candidate pools."""
3
+ import argparse, json, os, time
4
+ from concurrent.futures import ProcessPoolExecutor
5
+ from functools import lru_cache
6
+ from pathlib import Path
7
+ import numpy as np
8
+ import torch
9
+ from features import molecule_features,spectrum_features,sha256
10
+ from model import PeakFingerprint,normalized_fp
11
+ from scoring import rank_scores
12
+
13
+ @lru_cache(maxsize=8192)
14
+ def cached_features(smiles): return molecule_features(smiles)[0]
15
+ def encode_pool(item):
16
+ pool_id,candidates=item
17
+ return pool_id,np.stack([cached_features(c['smiles']) for c in candidates])
18
+
19
+ @torch.inference_mode()
20
+ def main():
21
+ ap=argparse.ArgumentParser(); ap.add_argument('input_root',type=Path); ap.add_argument('output_root',type=Path); args=ap.parse_args()
22
+ root=Path(__file__).resolve().parent; manifest=json.loads((root/'model_manifest.json').read_text()); config=json.loads((root/manifest['model_config']).read_text())
23
+ checkpoint=root/manifest['checkpoint']['path']
24
+ if sha256(checkpoint)!=manifest['checkpoint']['sha256']: raise ValueError('checkpoint checksum mismatch')
25
+ queries=[json.loads(l) for l in (args.input_root/'queries.jsonl').open() if l.strip()]
26
+ pools={r['candidate_pool_id']:r['candidates'] for r in (json.loads(l) for l in (args.input_root/'candidate_pools.jsonl').open() if l.strip())}
27
+ by_pool={}
28
+ for i,q in enumerate(queries): by_pool.setdefault(q['candidate_pool_id'],[]).append(i)
29
+ torch.set_num_threads(4); torch.set_float32_matmul_precision('high'); device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
30
+ state=torch.load(checkpoint,map_location='cpu',weights_only=False); model=PeakFingerprint(**state['model_config']).to(device).eval(); model.load_state_dict(state['state_dict'])
31
+ predictions=torch.empty((len(queries),6144),dtype=torch.float32)
32
+ rule=config.get('scoring_rule','cosine')
33
+ idf=None
34
+ if rule=='idf_cosine':
35
+ asset=config['idf_asset']; path=root/asset['path']
36
+ if sha256(path)!=asset['sha256']:raise ValueError('IDF checksum mismatch')
37
+ idf=torch.from_numpy(np.load(path)).to(device)
38
+ for start in range(0,len(queries),256):
39
+ features=[spectrum_features(r,max_peaks=state['model_config']['max_peaks']) for r in queries[start:start+256]]
40
+ peaks=torch.from_numpy(np.stack([f[0] for f in features])).to(device); meta=torch.from_numpy(np.stack([f[1] for f in features])).to(device)
41
+ with torch.autocast(device.type,dtype=torch.bfloat16,enabled=device.type=='cuda'):
42
+ pred=model(peaks,meta).float().sigmoid()
43
+ predictions[start:start+len(features)]=pred.cpu()
44
+ del model
45
+ args.output_root.mkdir(parents=True,exist_ok=True); temp=args.output_root/'rankings.jsonl.tmp'; started=time.monotonic()
46
+ # Fork workers never execute CUDA; they only parse candidate SMILES and pack bits.
47
+ with ProcessPoolExecutor(max_workers=min(8,os.cpu_count() or 1)) as ex, temp.open('w') as f:
48
+ for count,(pid,packed) in enumerate(ex.map(encode_pool,((p,pools[p]) for p in by_pool),chunksize=1),1):
49
+ fp=torch.from_numpy(np.unpackbits(packed,axis=1).astype(np.float32)).to(device)
50
+ qix=by_pool[pid]; pred=predictions[qix].to(device)
51
+ # Match validation's bfloat16 feature rounding with float32 reduction.
52
+ scores=[]
53
+ for offset in range(0,len(qix),64):
54
+ scores.append(rank_scores(pred[offset:offset+64,None,:],fp[None,:,:],rule,idf).cpu().numpy())
55
+ scores=np.nan_to_num(np.concatenate(scores),nan=-np.inf,posinf=-np.inf,neginf=-np.inf); ids=[c['candidate_id'] for c in pools[pid]]
56
+ for i,s in zip(qix,scores):
57
+ order=sorted(range(len(ids)),key=lambda j:(-float(s[j]),ids[j]))
58
+ f.write(json.dumps({'query_id':queries[i]['query_id'],'ranking':[ids[j] for j in order]},separators=(',',':'))+'\n')
59
+ if count%500==0: print(json.dumps({'pools_ranked':count,'total_pools':len(by_pool),'ranking_seconds':time.monotonic()-started}),flush=True)
60
+ os.replace(temp,args.output_root/'rankings.jsonl')
61
+ if __name__=='__main__': main()
shared/package-files/d1/d1e3521fc473facfbfafc8d8d7cdbd7125932fc01abf29a6017df7350efaba8d/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Molecular retrieval from tandem spectra
2
+
3
+ Run bash infer.sh INPUT_ROOT OUTPUT_ROOT. One H100 and verifier-supplied /opt/glacier/bin/python; all owned assets resolve relative to this package. No network, development data, external cache or live trainer is needed.
4
+
5
+ The fixed model combines two native forward simulators, sixteen inverse fingerprint encoders, composition and mass evidence, a candidate fusion gate, input-only spectral neighbor pooling, four adduct/size graph heads, and a fingerprint-to-spectrum forward MLP. Missing-energy proton queries retain the original/20/40/60 native simulation blend.
6
+
7
+ This revision adds one spectrum CNN trained from random initialization for 20,000 synthetic and then 5,000 experimental TRAIN updates. It predicts 6144 fingerprint coordinates from 4096-bin absolute and precursor-loss channels and supplied acquisition metadata. Candidate fingerprints use the same TRAIN-derived IDF and block-normalized cosine. A fixed 0.03125 CNN score augments the original physical top eight after the 0.01 graph and 0.03125 direct-forward terms, outside known proton/Orbitrap-or-QTOF/known-energy conditions. No external pretrained assets or validation fitting are used. Deterministic peak-column bin accumulation is retained in both neural postprocessors.
8
+
9
+ Validation on 19,429 queries: Hit@1 0.59539863, Hit@5 0.75423336, Hit@20 0.86077513, MCES@1 6.58698338. Against E29, correct-query changes are +7/+13/+0; MCES changes by -0.02928612. There are 19 first-choice gains and 12 losses across 14 better and 10 worse molecule groups.
10
+
11
+ Paired 95% molecule-group Hit@1 interval [-0.00030194, 0.00105709]; donor-connected interval [-0.00030316, 0.00102092]; MCES molecule-group interval [-0.04629421, -0.01318887]. Primary intervals include zero; MCES favors the candidate in this validation comparison. This is a small uncertain primary improvement and does not establish superiority to the reference test score.
12
+
13
+ Fresh relocated graph, retained direct-forward and CNN passes cover all 19,429 validation queries and exactly reproduce sealed assessed scores and complete rankings. Five TRAIN fixtures separately exercise the combined native/inverse/graph/forward/CNN pipeline with independent feature arithmetic. Unchanged native/inverse/pooling/fusion outputs are reused only under complete source/configuration/asset identity and exact baseline reconstruction. A second fresh combined TRAIN replay rejects Python access to development directories and packaged research, rejects package writes, and preserves all package bytes. This is not an OS sandbox or a fresh combined full-validation native/inverse invocation. Intervals are not adjusted for repeated selection; no test/reference claim.
14
+
15
+ Conservative measured stage sum 9536.826 seconds and sampled additive process-tree memory estimate 55.699 GiB fit the 18,000-second and 64-GiB limits. Sampling may miss brief peaks and counts shared pages conservatively.
16
+
17
+ EXPERIMENTS.md and research/ preserve hypotheses, changed factors, seeds, measured compute, query/checkpoint hashes, selected training sources/configurations/logs, and negative experiments. The root manifest atomically selects an immutable generation.
shared/package-files/fe/fe39ad2cc9c157a595c2e916c235c721f99cfef28c4ad6253b2f1af49c0ba178/EXPERIMENTS.md ADDED
@@ -0,0 +1,1002 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Selected inverse addition
2
+
3
+ {
4
+ "experiment": "known-inverse-joint-portable-v1",
5
+ "hypothesis": "Previously assessed inverse additions improve the fixed published energy/fusion model.",
6
+ "changed_factor": "Only the prespecified fixed inverse replacement(s) listed below. Native code, conditions, weights, energy simulations and fusion gate are byte-identical to the current publication.",
7
+ "seed": {
8
+ "relative512-known-current-v1": 37,
9
+ "capacity61-long-current-v1": 61
10
+ },
11
+ "base_publication_manifest": {
12
+ "schema": "massspecgym-retrieval-model/v1",
13
+ "checkpoint": {
14
+ "path": ".versions/generation-7hlhqvei/glacier.ckpt",
15
+ "sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62",
16
+ "format": "pytorch"
17
+ },
18
+ "model_config": ".versions/generation-7hlhqvei/model_config.json",
19
+ "training_provenance": {
20
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only; outside simulator continued1000steps with train-only decoys and contrastive weight0.2",
21
+ "pretrained_assets": []
22
+ }
23
+ },
24
+ "baseline_score_cache": "energy-current-mask-v1-score-cache",
25
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
26
+ "replacements": [
27
+ {
28
+ "case": "relative512_known",
29
+ "asset": {
30
+ "path": "replacement-relative512_known.pt",
31
+ "sha256": "959ce077571b5115ec5452df29bcdafd07e081aca56613009cced08e4ee30d86"
32
+ },
33
+ "old_asset_key": "known_capacity_asset",
34
+ "old_checkpoint_sha256": "bb18ef93459ac9f2c27d73c1d313aa476b34b871ab959d4d95cf35712876a709",
35
+ "domain": "known",
36
+ "weight": 0.0625,
37
+ "training_checkpoint_sha256": "959ce077571b5115ec5452df29bcdafd07e081aca56613009cced08e4ee30d86",
38
+ "training_work": "peak-relative-capacity-v1",
39
+ "train8_cpu_runtime_class_max_difference": 0.0
40
+ },
41
+ {
42
+ "case": "capacity61_long",
43
+ "asset": {
44
+ "path": "replacement-capacity61_long.pt",
45
+ "sha256": "e0d3ef5a7aa45317c4f8acd95adad9a7a756210ee74b469c7f0d05c9786800c1"
46
+ },
47
+ "old_asset_key": "known_capacity_replica_asset",
48
+ "old_checkpoint_sha256": "1f6c14e3e5c2441bb22e468f06629e171580ace54c6305771cc2c6cb093be750",
49
+ "domain": "known",
50
+ "weight": 0.0625,
51
+ "training_checkpoint_sha256": "e0d3ef5a7aa45317c4f8acd95adad9a7a756210ee74b469c7f0d05c9786800c1",
52
+ "training_work": "peak-capacity-seed61-long-v1",
53
+ "train8_cpu_runtime_class_max_difference": 0.0
54
+ }
55
+ ],
56
+ "checkpoint_sha256": {
57
+ "relative512_known": "959ce077571b5115ec5452df29bcdafd07e081aca56613009cced08e4ee30d86",
58
+ "capacity61_long": "e0d3ef5a7aa45317c4f8acd95adad9a7a756210ee74b469c7f0d05c9786800c1"
59
+ },
60
+ "component_assessments": [
61
+ "relative512-known-current-v1",
62
+ "capacity61-long-current-v1"
63
+ ],
64
+ "selected": false,
65
+ "status": "Actual full portable inverse, relocated combined checks, MCES and molecule-group review complete; explicit publication decision required.",
66
+ "candidate_manifest": {
67
+ "schema": "massspecgym-retrieval-model/v1",
68
+ "checkpoint": {
69
+ "path": ".versions/generation-2g_1kuay/glacier.ckpt",
70
+ "sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62",
71
+ "format": "pytorch"
72
+ },
73
+ "model_config": ".versions/generation-2g_1kuay/model_config.json",
74
+ "training_provenance": {
75
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only; outside simulator continued1000steps with train-only decoys and contrastive weight0.2",
76
+ "pretrained_assets": []
77
+ }
78
+ },
79
+ "contracts": {
80
+ "five": {
81
+ "queries": 5,
82
+ "maximum_score_differences": {
83
+ "inverse": 0.0,
84
+ "native": 1.4901161193847656e-08,
85
+ "native_original": 1.4901161193847656e-08,
86
+ "gate": 0.0
87
+ },
88
+ "all_complete_rankings_match_independent_components": true,
89
+ "relocated": true,
90
+ "working_directory": "/tmp",
91
+ "labels_read": false,
92
+ "fitting_performed": false
93
+ },
94
+ "sensitive-train": {
95
+ "queries": 8,
96
+ "maximum_score_differences": {
97
+ "inverse": 0.0,
98
+ "native": 5.960464477539063e-08,
99
+ "native_original": 8.940696716308594e-08,
100
+ "gate": 0.0
101
+ },
102
+ "all_complete_rankings_match_independent_components": true,
103
+ "relocated": true,
104
+ "working_directory": "/tmp",
105
+ "labels_read": false,
106
+ "fitting_performed": false
107
+ }
108
+ },
109
+ "full_inverse_compute": {
110
+ "command": [
111
+ "bash",
112
+ "/workspace/research/known-inverse-joint-portable-v1/inverse-package/infer.sh",
113
+ "/workspace/research/validation-input",
114
+ "/workspace/research/known-inverse-joint-portable-v1/full-inverse",
115
+ "--internal-scores",
116
+ "/workspace/research/known-inverse-joint-portable-v1/scores.npz"
117
+ ],
118
+ "started_utc": "2026-10-31T18:30:14.353897+00:00",
119
+ "finished_utc": "2026-10-31T18:39:45.487456+00:00",
120
+ "elapsed_seconds": 571.1335962869925,
121
+ "user_cpu_seconds": 2263.982421,
122
+ "system_cpu_seconds": 42.05837,
123
+ "peak_child_rss_kib": 8421072,
124
+ "exit_code": 0
125
+ },
126
+ "resource_observation": {
127
+ "max_sampled_sum_rss_bytes": 41728196608,
128
+ "samples": 285,
129
+ "interval_seconds": 2,
130
+ "elapsed_seconds": 570.0049515849969,
131
+ "last": {
132
+ "rss_bytes": 6805692416,
133
+ "processes": 3
134
+ },
135
+ "scope": "Verifier parent and complete child process tree, sampled from before full inverse start. Shared pages counted repeatedly; brief peaks can be missed."
136
+ },
137
+ "actual_full_inverse_replay": true,
138
+ "full_result": {
139
+ "benchmark_score": {
140
+ "at_or_above_upper_reference": true,
141
+ "comparable_to_test_reference": false,
142
+ "direction": "maximize",
143
+ "evaluation_fold": "validation",
144
+ "lower_reference": 0.04004329004329004,
145
+ "metric": "hit_rate_at_1",
146
+ "raw_performance": 0.5908178496062587,
147
+ "saturation": "upper",
148
+ "score": 1.0,
149
+ "unclipped_score": 1.2135288865069627,
150
+ "upper_reference": 0.4939052175894281,
151
+ "version": "massspecgym-retrieval-score/v1"
152
+ },
153
+ "external_reference_context": {
154
+ "comparable_to_this_validation_report": false,
155
+ "fold": "test",
156
+ "hit_rate_at_1": 0.4939052175894281,
157
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
158
+ },
159
+ "global_error": null,
160
+ "metrics": {
161
+ "hit_rate_at_1": 0.5908178496062587,
162
+ "hit_rate_at_20": 0.860157496525812,
163
+ "hit_rate_at_5": 0.7515054814967317
164
+ },
165
+ "paired_baseline_delta": {
166
+ "confidence": 0.95,
167
+ "estimate": 0.001441144680632045,
168
+ "grouping": "supplied target_inchikey connectivity block",
169
+ "lower": 0.0004006336541843963,
170
+ "molecule_groups": 3185,
171
+ "queries": 19429,
172
+ "resamples": 2000,
173
+ "seed": 0,
174
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
175
+ "upper": 0.0026147108830591494
176
+ },
177
+ "queries": 19429,
178
+ "schema": "massspecgym-retrieval-development-report/v1",
179
+ "strata": {
180
+ "adduct": {
181
+ "[M+H]+": {
182
+ "hit_rate_at_1": 0.6691396678464471,
183
+ "queries": 14692
184
+ },
185
+ "[M+Na]+": {
186
+ "hit_rate_at_1": 0.3478995144606291,
187
+ "queries": 4737
188
+ }
189
+ },
190
+ "candidate_pool_size": {
191
+ "129-256": {
192
+ "hit_rate_at_1": 0.5917693775462843,
193
+ "queries": 19391
194
+ },
195
+ "33-128": {
196
+ "hit_rate_at_1": 0.10526315789473684,
197
+ "queries": 38
198
+ }
199
+ },
200
+ "collision_energy": {
201
+ "20-39.999": {
202
+ "hit_rate_at_1": 0.787426614481409,
203
+ "queries": 4088
204
+ },
205
+ "40-59.999": {
206
+ "hit_rate_at_1": 0.768985322271857,
207
+ "queries": 1567
208
+ },
209
+ "<20": {
210
+ "hit_rate_at_1": 0.5991666666666666,
211
+ "queries": 1200
212
+ },
213
+ ">=60": {
214
+ "hit_rate_at_1": 0.7817307692307692,
215
+ "queries": 3120
216
+ },
217
+ "missing": {
218
+ "hit_rate_at_1": 0.41220647345039135,
219
+ "queries": 9454
220
+ }
221
+ },
222
+ "instrument_type": {
223
+ "": {
224
+ "hit_rate_at_1": 0.6255144032921811,
225
+ "queries": 486
226
+ },
227
+ "Orbitrap": {
228
+ "hit_rate_at_1": 0.5971774438834478,
229
+ "queries": 16439
230
+ },
231
+ "QTOF": {
232
+ "hit_rate_at_1": 0.542332268370607,
233
+ "queries": 2504
234
+ }
235
+ },
236
+ "routing_domain": {
237
+ "fallback": {
238
+ "hit_rate_at_1": 0.4110366168127901,
239
+ "queries": 9695
240
+ },
241
+ "glacier_released": {
242
+ "hit_rate_at_1": 0.7698787754263406,
243
+ "queries": 9734
244
+ }
245
+ }
246
+ },
247
+ "uncertainty": {
248
+ "confidence": 0.95,
249
+ "estimate": 0.5908178496062587,
250
+ "grouping": "supplied target_inchikey connectivity block",
251
+ "lower": 0.5527472908731879,
252
+ "molecule_groups": 3185,
253
+ "queries": 19429,
254
+ "resamples": 2000,
255
+ "seed": 0,
256
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
257
+ "upper": 0.6262363773511576
258
+ },
259
+ "valid_rankings": 19429
260
+ },
261
+ "outside_result": {
262
+ "benchmark_score": {
263
+ "at_or_above_upper_reference": false,
264
+ "comparable_to_test_reference": false,
265
+ "direction": "maximize",
266
+ "evaluation_fold": "validation",
267
+ "lower_reference": 0.04004329004329004,
268
+ "metric": "hit_rate_at_1",
269
+ "raw_performance": 0.4110366168127901,
270
+ "saturation": null,
271
+ "score": 0.8174145136502688,
272
+ "unclipped_score": 0.8174145136502688,
273
+ "upper_reference": 0.4939052175894281,
274
+ "version": "massspecgym-retrieval-score/v1"
275
+ },
276
+ "external_reference_context": {
277
+ "comparable_to_this_validation_report": false,
278
+ "fold": "test",
279
+ "hit_rate_at_1": 0.4939052175894281,
280
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
281
+ },
282
+ "global_error": null,
283
+ "metrics": {
284
+ "hit_rate_at_1": 0.4110366168127901,
285
+ "hit_rate_at_20": 0.7465703971119133,
286
+ "hit_rate_at_5": 0.5845281072717896
287
+ },
288
+ "paired_baseline_delta": {
289
+ "confidence": 0.95,
290
+ "estimate": 0.0,
291
+ "grouping": "supplied target_inchikey connectivity block",
292
+ "lower": 0.0,
293
+ "molecule_groups": 1119,
294
+ "queries": 9695,
295
+ "resamples": 2000,
296
+ "seed": 0,
297
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
298
+ "upper": 0.0
299
+ },
300
+ "queries": 9695,
301
+ "schema": "massspecgym-retrieval-development-report/v1",
302
+ "strata": {
303
+ "adduct": {
304
+ "[M+H]+": {
305
+ "hit_rate_at_1": 0.47135941912061313,
306
+ "queries": 4958
307
+ },
308
+ "[M+Na]+": {
309
+ "hit_rate_at_1": 0.3478995144606291,
310
+ "queries": 4737
311
+ }
312
+ },
313
+ "candidate_pool_size": {
314
+ "129-256": {
315
+ "hit_rate_at_1": 0.41223982603292947,
316
+ "queries": 9657
317
+ },
318
+ "33-128": {
319
+ "hit_rate_at_1": 0.10526315789473684,
320
+ "queries": 38
321
+ }
322
+ },
323
+ "collision_energy": {
324
+ "20-39.999": {
325
+ "hit_rate_at_1": 0.2621359223300971,
326
+ "queries": 103
327
+ },
328
+ "40-59.999": {
329
+ "hit_rate_at_1": 0.5394736842105263,
330
+ "queries": 76
331
+ },
332
+ "<20": {
333
+ "hit_rate_at_1": 0.28,
334
+ "queries": 25
335
+ },
336
+ ">=60": {
337
+ "hit_rate_at_1": 0.35135135135135137,
338
+ "queries": 37
339
+ },
340
+ "missing": {
341
+ "hit_rate_at_1": 0.41220647345039135,
342
+ "queries": 9454
343
+ }
344
+ },
345
+ "instrument_type": {
346
+ "": {
347
+ "hit_rate_at_1": 0.6255144032921811,
348
+ "queries": 486
349
+ },
350
+ "Orbitrap": {
351
+ "hit_rate_at_1": 0.37457462323772484,
352
+ "queries": 8228
353
+ },
354
+ "QTOF": {
355
+ "hit_rate_at_1": 0.6106014271151886,
356
+ "queries": 981
357
+ }
358
+ },
359
+ "routing_domain": {
360
+ "fallback": {
361
+ "hit_rate_at_1": 0.4110366168127901,
362
+ "queries": 9695
363
+ }
364
+ }
365
+ },
366
+ "uncertainty": {
367
+ "confidence": 0.95,
368
+ "estimate": 0.4110366168127901,
369
+ "grouping": "supplied target_inchikey connectivity block",
370
+ "lower": 0.36428263992845034,
371
+ "molecule_groups": 1119,
372
+ "queries": 9695,
373
+ "resamples": 2000,
374
+ "seed": 0,
375
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
376
+ "upper": 0.45929365136334055
377
+ },
378
+ "valid_rankings": 9695
379
+ },
380
+ "numerical_runtime": {
381
+ "python": "/opt/glacier/bin/python",
382
+ "numpy": "2.4.6",
383
+ "torch": "2.6.0+cu124"
384
+ },
385
+ "component_parity": {
386
+ "same_top_choices": 19428,
387
+ "same_full_rankings": 14359,
388
+ "maximum_score_difference": 0.00017398595809936523,
389
+ "baseline_all_complete_rankings_exact": true,
390
+ "baseline_max_score_difference": 0.0
391
+ },
392
+ "reused_native_work": "native-proton-energy-full-v1",
393
+ "base_inverse_work": "energy-mask-ensemble-v1",
394
+ "actual_full_combined_portable_replay": false,
395
+ "scope": "Fresh full portable inverse replay and relocated combined5/8TRAIN checks; unchanged native scores reused from the full native energy replay. Not a new full combined invocation. Molecule-group intervals are not selection-adjusted.",
396
+ "full_mces_paired": {
397
+ "queries": 19429,
398
+ "candidate_mces_at_1": 6.717252560605281,
399
+ "baseline_mces_at_1": 6.741237325647228,
400
+ "paired_mces_delta": {
401
+ "estimate": -0.023984765041947603,
402
+ "lower": -0.04251406248721084,
403
+ "upper": -0.008197334263343797,
404
+ "confidence": 0.95,
405
+ "resamples": 2000,
406
+ "seed": 0,
407
+ "molecule_groups": 3185,
408
+ "queries": 19429,
409
+ "grouping": "supplied target_inchikey connectivity block",
410
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
411
+ },
412
+ "direction": "Negative candidate-minus-baseline change is favorable.",
413
+ "scope": "Same19429validationqueries, native MCES threshold15/strongerbound/CBC cached distances, no approximation. Intervals not selection-adjusted.",
414
+ "rankings_sha256": {
415
+ "candidate": "41bc22893a11691a304ac29d1759b35daa642dceab185392bed505c3901fde44",
416
+ "baseline": "cb9d9a9759f5063731b089d3db734e45f747baf6d9c9de1fff3ced168edaddf8"
417
+ }
418
+ },
419
+ "error_review": {
420
+ "candidate": {
421
+ "queries": 19429,
422
+ "gained_top1": 48,
423
+ "lost_top1": 20,
424
+ "net_top1": 28,
425
+ "molecule_groups": 3185,
426
+ "groups_net_improved": 33,
427
+ "groups_net_worse": 19,
428
+ "groups_net_tied": 3133,
429
+ "largest_group_gain": 5,
430
+ "largest_group_loss": -2,
431
+ "paired": {
432
+ "1": {
433
+ "estimate": 0.001441144680632045,
434
+ "lower": 0.0004006336541843963,
435
+ "upper": 0.0026147108830591494,
436
+ "confidence": 0.95,
437
+ "resamples": 2000,
438
+ "seed": 0,
439
+ "molecule_groups": 3185,
440
+ "queries": 19429,
441
+ "grouping": "supplied target_inchikey connectivity block",
442
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
443
+ "net_hits": 28
444
+ },
445
+ "5": {
446
+ "estimate": 0.00020587781151886356,
447
+ "lower": -0.0003907812804891875,
448
+ "upper": 0.0008037209836279038,
449
+ "confidence": 0.95,
450
+ "resamples": 2000,
451
+ "seed": 0,
452
+ "molecule_groups": 3185,
453
+ "queries": 19429,
454
+ "grouping": "supplied target_inchikey connectivity block",
455
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
456
+ "net_hits": 4
457
+ },
458
+ "20": {
459
+ "estimate": 0.0002573472643985794,
460
+ "lower": -5.343900694238942e-05,
461
+ "upper": 0.0006120940764910772,
462
+ "confidence": 0.95,
463
+ "resamples": 2000,
464
+ "seed": 0,
465
+ "molecule_groups": 3185,
466
+ "queries": 19429,
467
+ "grouping": "supplied target_inchikey connectivity block",
468
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
469
+ "net_hits": 5
470
+ }
471
+ },
472
+ "strata": {
473
+ "adduct": {
474
+ "[M+Na]+": {
475
+ "queries": 4737,
476
+ "baseline_hit1": 0.3478995144606291,
477
+ "candidate_hit1": 0.3478995144606291,
478
+ "net_top1": 0
479
+ },
480
+ "[M+H]+": {
481
+ "queries": 14692,
482
+ "baseline_hit1": 0.6672338687721209,
483
+ "candidate_hit1": 0.6691396678464471,
484
+ "net_top1": 28
485
+ }
486
+ },
487
+ "instrument_type": {
488
+ "Orbitrap": {
489
+ "queries": 16439,
490
+ "baseline_hit1": 0.5960216558184804,
491
+ "candidate_hit1": 0.5971774438834478,
492
+ "net_top1": 19
493
+ },
494
+ "QTOF": {
495
+ "queries": 2504,
496
+ "baseline_hit1": 0.5387380191693291,
497
+ "candidate_hit1": 0.542332268370607,
498
+ "net_top1": 9
499
+ },
500
+ "": {
501
+ "queries": 486,
502
+ "baseline_hit1": 0.6255144032921811,
503
+ "candidate_hit1": 0.6255144032921811,
504
+ "net_top1": 0
505
+ }
506
+ },
507
+ "collision_energy": {
508
+ "40-59.999": {
509
+ "queries": 1567,
510
+ "baseline_hit1": 0.7613273771537971,
511
+ "candidate_hit1": 0.768985322271857,
512
+ "net_top1": 12
513
+ },
514
+ "20-39.999": {
515
+ "queries": 4088,
516
+ "baseline_hit1": 0.7849804305283757,
517
+ "candidate_hit1": 0.787426614481409,
518
+ "net_top1": 10
519
+ },
520
+ "missing": {
521
+ "queries": 9454,
522
+ "baseline_hit1": 0.41220647345039135,
523
+ "candidate_hit1": 0.41220647345039135,
524
+ "net_top1": 0
525
+ },
526
+ "<20": {
527
+ "queries": 1200,
528
+ "baseline_hit1": 0.5991666666666666,
529
+ "candidate_hit1": 0.5991666666666666,
530
+ "net_top1": 0
531
+ },
532
+ ">=60": {
533
+ "queries": 3120,
534
+ "baseline_hit1": 0.7798076923076923,
535
+ "candidate_hit1": 0.7817307692307692,
536
+ "net_top1": 6
537
+ }
538
+ }
539
+ },
540
+ "elapsed_seconds": 4.463462204992538,
541
+ "rankings_sha256": {
542
+ "baseline": "cb9d9a9759f5063731b089d3db734e45f747baf6d9c9de1fff3ced168edaddf8",
543
+ "candidate": "41bc22893a11691a304ac29d1759b35daa642dceab185392bed505c3901fde44"
544
+ },
545
+ "scope": "Aggregate validation error analysis; no fitting or runtime answers. Molecule-group intervals are not selection-adjusted."
546
+ }
547
+ },
548
+ "mces": {
549
+ "schema": "massspecgym-validation-paired-mces/v1",
550
+ "queries": 19429,
551
+ "valid_rankings": 19429,
552
+ "metrics": {
553
+ "hit_rate_at_1": 0.5908178496062587,
554
+ "hit_rate_at_5": 0.7515054814967317,
555
+ "hit_rate_at_20": 0.860157496525812,
556
+ "mces_at_1": 6.717252560605281
557
+ },
558
+ "mces_unique_pairs": 5851,
559
+ "mces_new_pairs": 0,
560
+ "elapsed_seconds": 7.44695534100174,
561
+ "query_set_sha256": "0f58984b1143c4e7dd1bb34cbb4c1e6933ebb9044b6c333ec27a88f8e5fbe4c4",
562
+ "rankings_sha256": "41bc22893a11691a304ac29d1759b35daa642dceab185392bed505c3901fde44",
563
+ "comparison": "validation only, not evidence of beating a test reference",
564
+ "strata": {
565
+ "adduct": {
566
+ "[M+H]+": {
567
+ "queries": 14692,
568
+ "hit_rate_at_1": 0.6691396678464471
569
+ },
570
+ "[M+Na]+": {
571
+ "queries": 4737,
572
+ "hit_rate_at_1": 0.3478995144606291
573
+ }
574
+ },
575
+ "instrument_type": {
576
+ "": {
577
+ "queries": 486,
578
+ "hit_rate_at_1": 0.6255144032921811
579
+ },
580
+ "Orbitrap": {
581
+ "queries": 16439,
582
+ "hit_rate_at_1": 0.5971774438834478
583
+ },
584
+ "QTOF": {
585
+ "queries": 2504,
586
+ "hit_rate_at_1": 0.542332268370607
587
+ }
588
+ },
589
+ "collision_energy": {
590
+ "20-39.999": {
591
+ "queries": 4088,
592
+ "hit_rate_at_1": 0.787426614481409
593
+ },
594
+ "40-59.999": {
595
+ "queries": 1567,
596
+ "hit_rate_at_1": 0.768985322271857
597
+ },
598
+ "<20": {
599
+ "queries": 1200,
600
+ "hit_rate_at_1": 0.5991666666666666
601
+ },
602
+ ">=60": {
603
+ "queries": 3120,
604
+ "hit_rate_at_1": 0.7817307692307692
605
+ },
606
+ "missing": {
607
+ "queries": 9454,
608
+ "hit_rate_at_1": 0.41220647345039135
609
+ }
610
+ },
611
+ "candidate_pool_size": {
612
+ "129-256": {
613
+ "queries": 19391,
614
+ "hit_rate_at_1": 0.5917693775462843
615
+ },
616
+ "33-128": {
617
+ "queries": 38,
618
+ "hit_rate_at_1": 0.10526315789473684
619
+ }
620
+ },
621
+ "routing_domain": {
622
+ "fallback": {
623
+ "queries": 9695,
624
+ "hit_rate_at_1": 0.4110366168127901
625
+ },
626
+ "glacier_released": {
627
+ "queries": 9734,
628
+ "hit_rate_at_1": 0.7698787754263406
629
+ }
630
+ }
631
+ },
632
+ "uncertainty": {
633
+ "estimate": 0.5908178496062587,
634
+ "lower": 0.5527472908731879,
635
+ "upper": 0.6262363773511576,
636
+ "confidence": 0.95,
637
+ "resamples": 2000,
638
+ "seed": 0,
639
+ "molecule_groups": 3185,
640
+ "queries": 19429,
641
+ "grouping": "supplied target_inchikey connectivity block",
642
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
643
+ },
644
+ "paired_baseline_delta": {
645
+ "estimate": 0.001441144680632045,
646
+ "lower": 0.0004006336541843963,
647
+ "upper": 0.0026147108830591494,
648
+ "confidence": 0.95,
649
+ "resamples": 2000,
650
+ "seed": 0,
651
+ "molecule_groups": 3185,
652
+ "queries": 19429,
653
+ "grouping": "supplied target_inchikey connectivity block",
654
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
655
+ }
656
+ },
657
+ "model_selection_review_ready": true,
658
+ "assessment_elapsed_seconds": 51.45117378802388,
659
+ "build_compute": {
660
+ "command": [
661
+ "/opt/glacier/bin/python",
662
+ "/workspace/research/campaign/build_fixed_inverse_candidate.py",
663
+ "--assessment",
664
+ "relative512-known-current-v1",
665
+ "--assessment",
666
+ "capacity61-long-current-v1",
667
+ "--work",
668
+ "known-inverse-joint-portable-v1"
669
+ ],
670
+ "started_utc": "2026-10-31T18:27:27.330362+00:00",
671
+ "finished_utc": "2026-10-31T18:27:56.980032+00:00",
672
+ "elapsed_seconds": 29.649697765009478,
673
+ "user_cpu_seconds": 13.729513,
674
+ "system_cpu_seconds": 9.923368,
675
+ "peak_child_rss_kib": 811904,
676
+ "exit_code": 0
677
+ },
678
+ "assessment_compute": {
679
+ "command": [
680
+ "python",
681
+ "/workspace/research/campaign/assess_fixed_inverse_candidate.py",
682
+ "--work",
683
+ "known-inverse-joint-portable-v1"
684
+ ],
685
+ "started_utc": "2026-10-31T18:39:46.714258+00:00",
686
+ "finished_utc": "2026-10-31T18:40:45.303756+00:00",
687
+ "elapsed_seconds": 58.58952610800043,
688
+ "user_cpu_seconds": 59.08453,
689
+ "system_cpu_seconds": 42.072416,
690
+ "peak_child_rss_kib": 2232748,
691
+ "exit_code": 0
692
+ },
693
+ "package_audit": {
694
+ "package": "/run-state/workspace/research/known-inverse-joint-portable-v1/relocated-package",
695
+ "selected_generation": ".versions/generation-2g_1kuay",
696
+ "files": 977,
697
+ "total_bytes_including_unused_generations": 2015520458,
698
+ "selected_generation_bytes": 2015519091,
699
+ "all_paths_inside_package": true,
700
+ "all_files_world_readable": true,
701
+ "all_directories_world_traversable": true,
702
+ "declared_asset_hashes_verified": 20,
703
+ "no_pretrained_assets": true,
704
+ "elapsed_seconds": 1.4957555619766936,
705
+ "scope": "Read-only filesystem and metadata audit; complements actual relocated replay. No fitting, labels or network."
706
+ },
707
+ "package_audit_compute": {
708
+ "command": [
709
+ "python",
710
+ "/workspace/research/campaign/audit_portable_package.py",
711
+ "--package",
712
+ "/workspace/research/known-inverse-joint-portable-v1/relocated-package",
713
+ "--output",
714
+ "/workspace/research/known-inverse-joint-portable-v1/report-package-audit.json"
715
+ ],
716
+ "started_utc": "2026-10-31T18:37:50.966978+00:00",
717
+ "finished_utc": "2026-10-31T18:37:52.530803+00:00",
718
+ "elapsed_seconds": 1.5638510209973902,
719
+ "user_cpu_seconds": 0.793912,
720
+ "system_cpu_seconds": 0.380754,
721
+ "peak_child_rss_kib": 17672,
722
+ "exit_code": 0
723
+ },
724
+ "component_numerical_review": {
725
+ "changed_estimate_top_choices": [
726
+ {
727
+ "full_index": 11574,
728
+ "known_index": 9297,
729
+ "in_final_full_batch": false,
730
+ "in_final_known_batch": false,
731
+ "instrument": "Orbitrap",
732
+ "collision_energy": 20.0
733
+ }
734
+ ],
735
+ "outside_score_max_difference": 0.0,
736
+ "interpretation": "One head differs from component-only estimates; actual full portable inverse output is authoritative. Batch contexts and arithmetic grouping differ in component estimates; this diagnostic does not assign a cause."
737
+ },
738
+ "selection_matrix_work": "known-inverse-interaction-v1",
739
+ "selection_matrix_review": {
740
+ "decision": "advance_joint_to_portable_replay",
741
+ "chosen": "joint",
742
+ "rationale": "Unique primary maximum in declared fixed2x2 matrix. Joint gains29Hit1/4Hit5/5Hit20 versus publication, MCES decreases0.024190642853466. Both instruments improve;49gains20losses across34net-improved19net-worse groups. Versus long alone gains14Hit1 but loses3Hit5; primary objective favors joint. Intervals not selection-adjusted; validation does not establish test improvement. Actual portable replay required before publication.",
743
+ "paired": {
744
+ "baseline": {
745
+ "1": {
746
+ "estimate": 0.0014926141335117609,
747
+ "lower": 0.0004441569747803937,
748
+ "upper": 0.002654687027776904,
749
+ "confidence": 0.95,
750
+ "resamples": 2000,
751
+ "seed": 0,
752
+ "molecule_groups": 3185,
753
+ "queries": 19429,
754
+ "grouping": "supplied target_inchikey connectivity block",
755
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
756
+ "net_hits": 29
757
+ },
758
+ "5": {
759
+ "estimate": 0.00020587781151886356,
760
+ "lower": -0.0003907812804891875,
761
+ "upper": 0.0008037209836279038,
762
+ "confidence": 0.95,
763
+ "resamples": 2000,
764
+ "seed": 0,
765
+ "molecule_groups": 3185,
766
+ "queries": 19429,
767
+ "grouping": "supplied target_inchikey connectivity block",
768
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
769
+ "net_hits": 4
770
+ },
771
+ "20": {
772
+ "estimate": 0.0002573472643985794,
773
+ "lower": -5.343900694238942e-05,
774
+ "upper": 0.0006120940764910772,
775
+ "confidence": 0.95,
776
+ "resamples": 2000,
777
+ "seed": 0,
778
+ "molecule_groups": 3185,
779
+ "queries": 19429,
780
+ "grouping": "supplied target_inchikey connectivity block",
781
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
782
+ "net_hits": 5
783
+ }
784
+ },
785
+ "relative": {
786
+ "1": {
787
+ "estimate": 0.001389675227752329,
788
+ "lower": 0.0005312118312326495,
789
+ "upper": 0.0024013818544347675,
790
+ "confidence": 0.95,
791
+ "resamples": 2000,
792
+ "seed": 0,
793
+ "molecule_groups": 3185,
794
+ "queries": 19429,
795
+ "grouping": "supplied target_inchikey connectivity block",
796
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
797
+ "net_hits": 27
798
+ },
799
+ "5": {
800
+ "estimate": 0.00036028617015801124,
801
+ "lower": -5.083156479643294e-05,
802
+ "upper": 0.0008025338359090668,
803
+ "confidence": 0.95,
804
+ "resamples": 2000,
805
+ "seed": 0,
806
+ "molecule_groups": 3185,
807
+ "queries": 19429,
808
+ "grouping": "supplied target_inchikey connectivity block",
809
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
810
+ "net_hits": 7
811
+ },
812
+ "20": {
813
+ "estimate": -5.146945287971589e-05,
814
+ "lower": -0.00036407282262927845,
815
+ "upper": 0.0002258199903815856,
816
+ "confidence": 0.95,
817
+ "resamples": 2000,
818
+ "seed": 0,
819
+ "molecule_groups": 3185,
820
+ "queries": 19429,
821
+ "grouping": "supplied target_inchikey connectivity block",
822
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
823
+ "net_hits": -1
824
+ }
825
+ },
826
+ "long": {
827
+ "1": {
828
+ "estimate": 0.0007205723403160225,
829
+ "lower": 0.0,
830
+ "upper": 0.00150492989109417,
831
+ "confidence": 0.95,
832
+ "resamples": 2000,
833
+ "seed": 0,
834
+ "molecule_groups": 3185,
835
+ "queries": 19429,
836
+ "grouping": "supplied target_inchikey connectivity block",
837
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
838
+ "net_hits": 14
839
+ },
840
+ "5": {
841
+ "estimate": -0.00015440835863914768,
842
+ "lower": -0.0007104104814731299,
843
+ "upper": 0.00035529629484306967,
844
+ "confidence": 0.95,
845
+ "resamples": 2000,
846
+ "seed": 0,
847
+ "molecule_groups": 3185,
848
+ "queries": 19429,
849
+ "grouping": "supplied target_inchikey connectivity block",
850
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
851
+ "net_hits": -3
852
+ },
853
+ "20": {
854
+ "estimate": 0.00020587781151886356,
855
+ "lower": 0.0,
856
+ "upper": 0.0004659844310642099,
857
+ "confidence": 0.95,
858
+ "resamples": 2000,
859
+ "seed": 0,
860
+ "molecule_groups": 3185,
861
+ "queries": 19429,
862
+ "grouping": "supplied target_inchikey connectivity block",
863
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
864
+ "net_hits": 4
865
+ }
866
+ }
867
+ },
868
+ "paired_mces": {
869
+ "baseline": {
870
+ "queries": 19429,
871
+ "candidate_mces_at_1": 6.717046682793762,
872
+ "baseline_mces_at_1": 6.741237325647228,
873
+ "paired_mces_delta": {
874
+ "estimate": -0.024190642853466466,
875
+ "lower": -0.04289154132999541,
876
+ "upper": -0.008226109738362537,
877
+ "confidence": 0.95,
878
+ "resamples": 2000,
879
+ "seed": 0,
880
+ "molecule_groups": 3185,
881
+ "queries": 19429,
882
+ "grouping": "supplied target_inchikey connectivity block",
883
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
884
+ },
885
+ "direction": "Negative candidate-minus-baseline change is favorable.",
886
+ "scope": "Same19429validationqueries, native MCES threshold15/strongerbound/CBC cached distances, no approximation. Intervals not selection-adjusted.",
887
+ "rankings_sha256": {
888
+ "candidate": "2f1d2cbf06c27983e88d2feed86a6a2da280bd0681b4a5b980cefabc691b2e1b",
889
+ "baseline": "cb9d9a9759f5063731b089d3db734e45f747baf6d9c9de1fff3ced168edaddf8"
890
+ }
891
+ },
892
+ "relative": {
893
+ "queries": 19429,
894
+ "candidate_mces_at_1": 6.717046682793762,
895
+ "baseline_mces_at_1": 6.735678624736219,
896
+ "paired_mces_delta": {
897
+ "estimate": -0.018631941942457153,
898
+ "lower": -0.03588796930787953,
899
+ "upper": -0.003949810273938753,
900
+ "confidence": 0.95,
901
+ "resamples": 2000,
902
+ "seed": 0,
903
+ "molecule_groups": 3185,
904
+ "queries": 19429,
905
+ "grouping": "supplied target_inchikey connectivity block",
906
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
907
+ },
908
+ "direction": "Negative candidate-minus-baseline change is favorable.",
909
+ "scope": "Same19429validationqueries, native MCES threshold15/strongerbound/CBC cached distances, no approximation. Intervals not selection-adjusted.",
910
+ "rankings_sha256": {
911
+ "candidate": "2f1d2cbf06c27983e88d2feed86a6a2da280bd0681b4a5b980cefabc691b2e1b",
912
+ "baseline": "aa1e528d7212a4254eaf3e1bd13be76c3965ba2296b31c9536cfaff5e42d2c1e"
913
+ }
914
+ },
915
+ "long": {
916
+ "queries": 19429,
917
+ "candidate_mces_at_1": 6.717046682793762,
918
+ "baseline_mces_at_1": 6.728575840238818,
919
+ "paired_mces_delta": {
920
+ "estimate": -0.01152915744505636,
921
+ "lower": -0.026034747151627437,
922
+ "upper": 0.0006013668136470641,
923
+ "confidence": 0.95,
924
+ "resamples": 2000,
925
+ "seed": 0,
926
+ "molecule_groups": 3185,
927
+ "queries": 19429,
928
+ "grouping": "supplied target_inchikey connectivity block",
929
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
930
+ },
931
+ "direction": "Negative candidate-minus-baseline change is favorable.",
932
+ "scope": "Same19429validationqueries, native MCES threshold15/strongerbound/CBC cached distances, no approximation. Intervals not selection-adjusted.",
933
+ "rankings_sha256": {
934
+ "candidate": "2f1d2cbf06c27983e88d2feed86a6a2da280bd0681b4a5b980cefabc691b2e1b",
935
+ "baseline": "38ad8c906ed21f4e62c85eece7c842013ad623dffc9e0705d64c579361dac8c9"
936
+ }
937
+ }
938
+ },
939
+ "reviewed_utc": "2026-10-31T18:27:27.242727+00:00"
940
+ },
941
+ "selection_review_completed": true,
942
+ "selection_review": {
943
+ "decision": "publish",
944
+ "reviewed_utc": "2026-10-31T18:41:21.710789+00:00",
945
+ "rationale": "Fresh full portable inverse gains28Hit1/4Hit5/5Hit20 against the current publication and lowers MCES0.023984765041947603. Molecule-group Hit1 interval is positive;48gains20losses across33net-improved19net-worse groups, max+5/-2. Both Orbitrap(+19) and QTOF(+9) improve. All outside scores exactly unchanged. The earlier fixed2x2 matrix uniquely favored this joint; its+29 estimate is superseded by actual+28. Fullactualnative/inverse baseline reconstruction is exact; both relocated contracts, asset/path/permission audit and resource checks pass.",
946
+ "paired_hit": {
947
+ "1": {
948
+ "estimate": 0.001441144680632045,
949
+ "lower": 0.0004006336541843963,
950
+ "upper": 0.0026147108830591494,
951
+ "confidence": 0.95,
952
+ "resamples": 2000,
953
+ "seed": 0,
954
+ "molecule_groups": 3185,
955
+ "queries": 19429,
956
+ "grouping": "supplied target_inchikey connectivity block",
957
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
958
+ "net_hits": 28
959
+ },
960
+ "5": {
961
+ "estimate": 0.00020587781151886356,
962
+ "lower": -0.0003907812804891875,
963
+ "upper": 0.0008037209836279038,
964
+ "confidence": 0.95,
965
+ "resamples": 2000,
966
+ "seed": 0,
967
+ "molecule_groups": 3185,
968
+ "queries": 19429,
969
+ "grouping": "supplied target_inchikey connectivity block",
970
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
971
+ "net_hits": 4
972
+ },
973
+ "20": {
974
+ "estimate": 0.0002573472643985794,
975
+ "lower": -5.343900694238942e-05,
976
+ "upper": 0.0006120940764910772,
977
+ "confidence": 0.95,
978
+ "resamples": 2000,
979
+ "seed": 0,
980
+ "molecule_groups": 3185,
981
+ "queries": 19429,
982
+ "grouping": "supplied target_inchikey connectivity block",
983
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
984
+ "net_hits": 5
985
+ }
986
+ },
987
+ "paired_mces": {
988
+ "estimate": -0.023984765041947603,
989
+ "lower": -0.04251406248721084,
990
+ "upper": -0.008197334263343797,
991
+ "confidence": 0.95,
992
+ "resamples": 2000,
993
+ "seed": 0,
994
+ "molecule_groups": 3185,
995
+ "queries": 19429,
996
+ "grouping": "supplied target_inchikey connectivity block",
997
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
998
+ },
999
+ "secondary_tradeoff": "All secondary point estimates improve versus publication. Earlier joint-versus-long-only component comparison gained14Hit1 but lost3Hit5; fixed primary objective favored joint. That component comparison is not presented as a separate actual portable replay.",
1000
+ "limitations": "Intervals do not adjust for repeated campaign/checkpoint selection. Validation does not establish improvement over the reference test score. Fresh full inverse plus unchanged previously replayed native scores and relocated combined checks; no new full combined invocation. Sampled RSS may miss brief peaks and counts shared pages repeatedly."
1001
+ }
1002
+ }
shared/package-files/fe/fe4fc26586c3d600fdc06939efd07c6e8413c51d42f30a146a80014f87d7af89/graph_fragment_features.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Candidate graph-fragment match summaries; no query formula or learned constants."""
2
+ import time
3
+ import numpy as np
4
+ from rdkit import Chem
5
+ from ms_pred.magma.fragmentation import FragmentEngine
6
+ ION={'[M+H]+':1.007276466621,'[M+Na]+':22.989218}
7
+ CHANNELS=[(depth,shift,score) for depth in [1,2] for shift in [0,1,6] for score in [2,4,100]]
8
+ def generate(smiles):
9
+ start=time.monotonic();mol=Chem.MolFromSmiles(smiles)
10
+ if mol is None or not 3<=mol.GetNumHeavyAtoms()<=50:return None,dict(seconds=time.monotonic()-start,available=False)
11
+ engine=FragmentEngine(smiles,max_tree_depth=2,max_broken_bonds=6);engine.generate_fragments();ids,_,shifts,masses,scores=engine.get_frag_masses();depth=np.array([engine.frag_to_entry[k]['tree_depth'] for k in ids]);shifts=np.abs(shifts-6)
12
+ values=[np.unique(masses[(depth>0)&(depth<=d)&(shifts<=h)&(scores<=s)].astype(np.float64)) for d,h,s in CHANNELS]
13
+ return values,dict(seconds=time.monotonic()-start,available=True,atoms=engine.natoms,nodes=len(engine.frag_to_entry)-1,full_unique_masses=len(values[-1]))
14
+ def encode(query,channels):
15
+ mz=np.asarray(query['mzs'],np.float64);intensity=np.asarray(query['intensities'],np.float64);keep=(intensity>0)&(mz>0)&(mz<query['precursor_mz']-1);mz=mz[keep];intensity=intensity[keep];names=[];features=[]
16
+ # Use at most64strongest observed peaks, stable original m/z order in ties.
17
+ if len(mz)>64:
18
+ ix=np.argsort(-intensity,kind='stable')[:64];mz=mz[ix];intensity=intensity[ix]
19
+ if not len(mz) or channels is None:return np.zeros(90,np.float32),False,None
20
+ weights=[np.ones(len(mz)),np.sqrt(intensity),intensity];weights=[v/v.sum() for v in weights];tolerance=np.maximum(.005,mz*1e-5);all_match=None
21
+ for channel,values in zip(CHANNELS,channels):
22
+ ions=values+ION[query['adduct']]
23
+ if len(ions):
24
+ positions=np.searchsorted(ions,mz);error=np.minimum(np.abs(mz-ions[np.maximum(positions-1,0)]),np.abs(mz-ions[np.minimum(positions,len(ions)-1)]));match=error<=tolerance
25
+ else:match=np.zeros(len(mz),bool)
26
+ for wn,w in zip(['uniform','sqrt','intensity'],weights):features.append(float(w[match].sum()));names.append(str(channel)+'/'+wn)
27
+ features.append(float(np.log1p(len(values))/8));names.append(str(channel)+'/log_theoretical_masses')
28
+ all_match=match
29
+ ratio=mz/float(query['precursor_mz'])
30
+ for lo,hi in [(0,.33),(.33,.67),(.67,100)]:
31
+ region=(ratio>=lo)&(ratio<hi)
32
+ for wn,w in zip(['uniform','sqrt','intensity'],weights):features.append(float(w[region&all_match].sum()));names.append(f'full_match_region{lo}/{wn}')
33
+ energy=query.get('collision_energy');inst=query.get('instrument_type')
34
+ context=[np.log1p(len(mz))/5,float(query['precursor_mz'])/1000,float(query['adduct']=='[M+Na]+'),float(inst=='Orbitrap'),float(inst=='QTOF'),float(inst not in ['Orbitrap','QTOF']),0 if energy is None else float(energy)/100,float(energy is None),float(np.max(weights[2]))]
35
+ features.extend(context);names.extend(['log_peak_count','precursor_mass','sodium','orbitrap','qtof','unknown_instrument','collision_energy','energy_missing','largest_intensity_fraction'])
36
+ x=np.asarray(features,np.float32);assert x.shape==(90,) and np.isfinite(x).all();return x,True,names
shared/package-files/fe/fe543bb675e7bf2213e6cb402b564b2f8718f8541c1d57072e52e95233866ecb/EXPERIMENTS.md ADDED
@@ -0,0 +1,1277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Selected candidate-composition head
2
+
3
+ {
4
+ "experiment": "seed37-composition-ensemble-v1",
5
+ "hypothesis": "Autoregressive candidate-composition evidence adds value after averaging independent sparse inverse seeds.",
6
+ "changed_factor": "Combine only the two prespecified rules: equal23/37mean within the outside sparse quarter, plus0.03autoregressive count log-probability outside. Native models, known inverse and mass priors unchanged. No new fitting or coefficients.",
7
+ "seed": 41,
8
+ "checkpoint_sha256": "47a4d0c24db64239246ecfe191029bb33dc584d70c389df66777621167b364a5",
9
+ "validation_query_sha256": "3f2e5f420b68ac8db30fb4b6d901924c690872852fdfe0b36a2f27332db23818",
10
+ "result": {
11
+ "baseline": {
12
+ "hit_rate_at_1": 0.37957710159876223,
13
+ "hit_rate_at_5": 0.5570912841670964,
14
+ "hit_rate_at_20": 0.7249097472924187
15
+ },
16
+ "six": {
17
+ "hit_rate_at_1": 0.38525012893243943,
18
+ "hit_rate_at_5": 0.5587416193914388,
19
+ "hit_rate_at_20": 0.7285198555956679
20
+ },
21
+ "combined": {
22
+ "hit_rate_at_1": 0.3891696750902527,
23
+ "hit_rate_at_5": 0.5657555440948943,
24
+ "hit_rate_at_20": 0.7415162454873646
25
+ },
26
+ "paired_vs_baseline": {
27
+ "estimate": 0.00959257349149046,
28
+ "lower": 0.004097172370545993,
29
+ "upper": 0.01627772848269742,
30
+ "confidence": 0.95,
31
+ "resamples": 2000,
32
+ "seed": 0,
33
+ "molecule_groups": 1119,
34
+ "queries": 9695,
35
+ "grouping": "supplied target_inchikey connectivity block",
36
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
37
+ },
38
+ "paired_vs_six": {
39
+ "estimate": 0.003919546157813306,
40
+ "lower": 0.0010986966714375504,
41
+ "upper": 0.007112133813558044,
42
+ "confidence": 0.95,
43
+ "resamples": 2000,
44
+ "seed": 0,
45
+ "molecule_groups": 1119,
46
+ "queries": 9695,
47
+ "grouping": "supplied target_inchikey connectivity block",
48
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
49
+ }
50
+ },
51
+ "elapsed_seconds": 2.8716370679903775,
52
+ "status": "Selected: autoregressive candidate-composition evidence improves the published six-model baseline in portable outside and full-component validation; combined relocation passes.",
53
+ "scope": "Actual portable six-model plus candidate-composition inverse for9695outside queries, unchanged native production-tolerance predictions and unchanged9734known rankings. Not a new full combined simulator replay.",
54
+ "base_publication_manifest": {
55
+ "schema": "massspecgym-retrieval-model/v1",
56
+ "checkpoint": {
57
+ "path": ".versions/generation-yj82k8q_/glacier.ckpt",
58
+ "sha256": "f31200ebf18e90e18fdacc307c4ff660875a211d14475e9e60dfd3edbd6f34a9",
59
+ "format": "pytorch"
60
+ },
61
+ "model_config": ".versions/generation-yj82k8q_/model_config.json",
62
+ "training_provenance": {
63
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only",
64
+ "pretrained_assets": []
65
+ }
66
+ },
67
+ "preflight": {
68
+ "candidate_chemistry_samples": 100,
69
+ "fingerprints_masses_counts_exactly_match": true,
70
+ "encoder_hook_max_difference": 0.0,
71
+ "encoder_examples": 4
72
+ },
73
+ "composition_strength": 0.03,
74
+ "initial_baseline_manifest": {
75
+ "schema": "massspecgym-retrieval-model/v1",
76
+ "checkpoint": {
77
+ "path": ".versions/generation-19theuvt/glacier.ckpt",
78
+ "sha256": "f31200ebf18e90e18fdacc307c4ff660875a211d14475e9e60dfd3edbd6f34a9",
79
+ "format": "pytorch"
80
+ },
81
+ "model_config": ".versions/generation-19theuvt/model_config.json",
82
+ "training_provenance": {
83
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only",
84
+ "pretrained_assets": []
85
+ }
86
+ },
87
+ "publication_comparison_scope": "Initial component estimate uses frozen generation19theuvt; final candidate must also improve the newly published six-model generation-yj82k8q_ using exact portable scores.",
88
+ "relocation": {
89
+ "queries": 4,
90
+ "inverse_component_max_score_difference": 0.0,
91
+ "unchanged_native_max_score_difference": 1.4901161193847656e-08,
92
+ "complete_rankings_match_independent_components": true,
93
+ "relocated": true,
94
+ "working_directory": "/tmp",
95
+ "output_sha256": "b0cde3e0b26c5f324d0db44f607bf3e75953266fcf032a9861478ff8ca47c216"
96
+ },
97
+ "contract_inverse_compute": {
98
+ "command": [
99
+ "bash",
100
+ "/workspace/research/seed37-composition-ensemble-v1/inverse-package/infer.sh",
101
+ "/workspace/research/directglacier-contract-input",
102
+ "/workspace/research/seed37-composition-ensemble-v1/contract-inverse",
103
+ "--internal-scores",
104
+ "/workspace/research/seed37-composition-ensemble-v1/contract-inverse-scores.npz"
105
+ ],
106
+ "started_utc": "2026-10-31T12:59:21.588844+00:00",
107
+ "finished_utc": "2026-10-31T12:59:27.039511+00:00",
108
+ "elapsed_seconds": 5.450703998008976,
109
+ "user_cpu_seconds": 3.99641,
110
+ "system_cpu_seconds": 1.348907,
111
+ "peak_child_rss_kib": 1292016,
112
+ "exit_code": 0
113
+ },
114
+ "contract_hybrid_compute": {
115
+ "command": [
116
+ "bash",
117
+ "/workspace/research/seed37-composition-ensemble-v1/relocated-package/infer.sh",
118
+ "/workspace/research/directglacier-contract-input",
119
+ "/workspace/research/seed37-composition-ensemble-v1/contract-hybrid",
120
+ "--research-scores",
121
+ "/workspace/research/seed37-composition-ensemble-v1/contract-hybrid-scores.npz"
122
+ ],
123
+ "started_utc": "2026-10-31T12:59:27.107645+00:00",
124
+ "finished_utc": "2026-10-31T12:59:59.740497+00:00",
125
+ "elapsed_seconds": 32.63288116900367,
126
+ "user_cpu_seconds": 28.005729,
127
+ "system_cpu_seconds": 4.690634,
128
+ "peak_child_rss_kib": 1814196,
129
+ "exit_code": 0
130
+ },
131
+ "compute": {
132
+ "command": [
133
+ "bash",
134
+ "/workspace/research/seed37-composition-ensemble-v1/inverse-package/infer.sh",
135
+ "/workspace/research/validation-fallback",
136
+ "/workspace/research/seed37-composition-ensemble-v1/inverse-replay",
137
+ "--internal-scores",
138
+ "/workspace/research/seed37-composition-ensemble-v1/scores.npz"
139
+ ],
140
+ "started_utc": "2026-10-31T12:56:43.920915+00:00",
141
+ "finished_utc": "2026-10-31T13:04:42.217461+00:00",
142
+ "elapsed_seconds": 478.2965794010088,
143
+ "user_cpu_seconds": 978.781252,
144
+ "system_cpu_seconds": 8.894041,
145
+ "peak_child_rss_kib": 2717172,
146
+ "exit_code": 0
147
+ },
148
+ "outside_report": {
149
+ "benchmark_score": {
150
+ "at_or_above_upper_reference": false,
151
+ "comparable_to_test_reference": false,
152
+ "direction": "maximize",
153
+ "evaluation_fold": "validation",
154
+ "lower_reference": 0.04004329004329004,
155
+ "metric": "hit_rate_at_1",
156
+ "raw_performance": 0.3890665291387313,
157
+ "saturation": null,
158
+ "score": 0.7690075283081785,
159
+ "unclipped_score": 0.7690075283081785,
160
+ "upper_reference": 0.4939052175894281,
161
+ "version": "massspecgym-retrieval-score/v1"
162
+ },
163
+ "external_reference_context": {
164
+ "comparable_to_this_validation_report": false,
165
+ "fold": "test",
166
+ "hit_rate_at_1": 0.4939052175894281,
167
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
168
+ },
169
+ "global_error": null,
170
+ "metrics": {
171
+ "hit_rate_at_1": 0.3890665291387313,
172
+ "hit_rate_at_20": 0.7413099535843218,
173
+ "hit_rate_at_5": 0.5657555440948943
174
+ },
175
+ "paired_baseline_delta": {
176
+ "confidence": 0.95,
177
+ "estimate": 0.009489427539969056,
178
+ "grouping": "supplied target_inchikey connectivity block",
179
+ "lower": 0.00399121856594463,
180
+ "molecule_groups": 1119,
181
+ "queries": 9695,
182
+ "resamples": 2000,
183
+ "seed": 0,
184
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
185
+ "upper": 0.01620036027696291
186
+ },
187
+ "queries": 9695,
188
+ "schema": "massspecgym-retrieval-development-report/v1",
189
+ "strata": {
190
+ "adduct": {
191
+ "[M+H]+": {
192
+ "hit_rate_at_1": 0.4499798305768455,
193
+ "queries": 4958
194
+ },
195
+ "[M+Na]+": {
196
+ "hit_rate_at_1": 0.32531137850960523,
197
+ "queries": 4737
198
+ }
199
+ },
200
+ "candidate_pool_size": {
201
+ "129-256": {
202
+ "hit_rate_at_1": 0.39018328673501085,
203
+ "queries": 9657
204
+ },
205
+ "33-128": {
206
+ "hit_rate_at_1": 0.10526315789473684,
207
+ "queries": 38
208
+ }
209
+ },
210
+ "collision_energy": {
211
+ "20-39.999": {
212
+ "hit_rate_at_1": 0.23300970873786409,
213
+ "queries": 103
214
+ },
215
+ "40-59.999": {
216
+ "hit_rate_at_1": 0.4605263157894737,
217
+ "queries": 76
218
+ },
219
+ "<20": {
220
+ "hit_rate_at_1": 0.32,
221
+ "queries": 25
222
+ },
223
+ ">=60": {
224
+ "hit_rate_at_1": 0.35135135135135137,
225
+ "queries": 37
226
+ },
227
+ "missing": {
228
+ "hit_rate_at_1": 0.39052253014596994,
229
+ "queries": 9454
230
+ }
231
+ },
232
+ "instrument_type": {
233
+ "": {
234
+ "hit_rate_at_1": 0.6275720164609053,
235
+ "queries": 486
236
+ },
237
+ "Orbitrap": {
238
+ "hit_rate_at_1": 0.35063198833252307,
239
+ "queries": 8228
240
+ },
241
+ "QTOF": {
242
+ "hit_rate_at_1": 0.5932721712538226,
243
+ "queries": 981
244
+ }
245
+ },
246
+ "routing_domain": {
247
+ "fallback": {
248
+ "hit_rate_at_1": 0.3890665291387313,
249
+ "queries": 9695
250
+ }
251
+ }
252
+ },
253
+ "uncertainty": {
254
+ "confidence": 0.95,
255
+ "estimate": 0.3890665291387313,
256
+ "grouping": "supplied target_inchikey connectivity block",
257
+ "lower": 0.3431928285292061,
258
+ "molecule_groups": 1119,
259
+ "queries": 9695,
260
+ "resamples": 2000,
261
+ "seed": 0,
262
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
263
+ "upper": 0.4355042068549089
264
+ },
265
+ "valid_rankings": 9695
266
+ },
267
+ "full_component_report": {
268
+ "benchmark_score": {
269
+ "at_or_above_upper_reference": true,
270
+ "comparable_to_test_reference": false,
271
+ "direction": "maximize",
272
+ "evaluation_fold": "validation",
273
+ "lower_reference": 0.04004329004329004,
274
+ "metric": "hit_rate_at_1",
275
+ "raw_performance": 0.5759431777240208,
276
+ "saturation": "upper",
277
+ "score": 1.0,
278
+ "unclipped_score": 1.1807553248146223,
279
+ "upper_reference": 0.4939052175894281,
280
+ "version": "massspecgym-retrieval-score/v1"
281
+ },
282
+ "external_reference_context": {
283
+ "comparable_to_this_validation_report": false,
284
+ "fold": "test",
285
+ "hit_rate_at_1": 0.4939052175894281,
286
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
287
+ },
288
+ "global_error": null,
289
+ "metrics": {
290
+ "hit_rate_at_1": 0.5759431777240208,
291
+ "hit_rate_at_20": 0.8574810849760667,
292
+ "hit_rate_at_5": 0.7411086520150291
293
+ },
294
+ "paired_baseline_delta": {
295
+ "confidence": 0.95,
296
+ "estimate": 0.004735189664933861,
297
+ "grouping": "supplied target_inchikey connectivity block",
298
+ "lower": 0.0020077852140193116,
299
+ "molecule_groups": 3185,
300
+ "queries": 19429,
301
+ "resamples": 2000,
302
+ "seed": 0,
303
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
304
+ "upper": 0.007704264243452058
305
+ },
306
+ "queries": 19429,
307
+ "schema": "massspecgym-retrieval-development-report/v1",
308
+ "strata": {
309
+ "adduct": {
310
+ "[M+H]+": {
311
+ "hit_rate_at_1": 0.656751973863327,
312
+ "queries": 14692
313
+ },
314
+ "[M+Na]+": {
315
+ "hit_rate_at_1": 0.32531137850960523,
316
+ "queries": 4737
317
+ }
318
+ },
319
+ "candidate_pool_size": {
320
+ "129-256": {
321
+ "hit_rate_at_1": 0.5768655561858594,
322
+ "queries": 19391
323
+ },
324
+ "33-128": {
325
+ "hit_rate_at_1": 0.10526315789473684,
326
+ "queries": 38
327
+ }
328
+ },
329
+ "collision_energy": {
330
+ "20-39.999": {
331
+ "hit_rate_at_1": 0.7791095890410958,
332
+ "queries": 4088
333
+ },
334
+ "40-59.999": {
335
+ "hit_rate_at_1": 0.7536694320357371,
336
+ "queries": 1567
337
+ },
338
+ "<20": {
339
+ "hit_rate_at_1": 0.5891666666666666,
340
+ "queries": 1200
341
+ },
342
+ ">=60": {
343
+ "hit_rate_at_1": 0.7772435897435898,
344
+ "queries": 3120
345
+ },
346
+ "missing": {
347
+ "hit_rate_at_1": 0.39052253014596994,
348
+ "queries": 9454
349
+ }
350
+ },
351
+ "instrument_type": {
352
+ "": {
353
+ "hit_rate_at_1": 0.6275720164609053,
354
+ "queries": 486
355
+ },
356
+ "Orbitrap": {
357
+ "hit_rate_at_1": 0.5816655514325689,
358
+ "queries": 16439
359
+ },
360
+ "QTOF": {
361
+ "hit_rate_at_1": 0.5283546325878594,
362
+ "queries": 2504
363
+ }
364
+ },
365
+ "routing_domain": {
366
+ "fallback": {
367
+ "hit_rate_at_1": 0.3890665291387313,
368
+ "queries": 9695
369
+ },
370
+ "glacier_released": {
371
+ "hit_rate_at_1": 0.7620710910211629,
372
+ "queries": 9734
373
+ }
374
+ }
375
+ },
376
+ "uncertainty": {
377
+ "confidence": 0.95,
378
+ "estimate": 0.5759431777240208,
379
+ "grouping": "supplied target_inchikey connectivity block",
380
+ "lower": 0.5383460454335357,
381
+ "molecule_groups": 3185,
382
+ "queries": 19429,
383
+ "resamples": 2000,
384
+ "seed": 0,
385
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
386
+ "upper": 0.6104767157034057
387
+ },
388
+ "valid_rankings": 19429
389
+ },
390
+ "comparison_vs_published_six_outside": {
391
+ "benchmark_score": {
392
+ "at_or_above_upper_reference": false,
393
+ "comparable_to_test_reference": false,
394
+ "direction": "maximize",
395
+ "evaluation_fold": "validation",
396
+ "lower_reference": 0.04004329004329004,
397
+ "metric": "hit_rate_at_1",
398
+ "raw_performance": 0.3890665291387313,
399
+ "saturation": null,
400
+ "score": 0.7690075283081785,
401
+ "unclipped_score": 0.7690075283081785,
402
+ "upper_reference": 0.4939052175894281,
403
+ "version": "massspecgym-retrieval-score/v1"
404
+ },
405
+ "external_reference_context": {
406
+ "comparable_to_this_validation_report": false,
407
+ "fold": "test",
408
+ "hit_rate_at_1": 0.4939052175894281,
409
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
410
+ },
411
+ "global_error": null,
412
+ "metrics": {
413
+ "hit_rate_at_1": 0.3890665291387313,
414
+ "hit_rate_at_20": 0.7413099535843218,
415
+ "hit_rate_at_5": 0.5657555440948943
416
+ },
417
+ "paired_baseline_delta": {
418
+ "confidence": 0.95,
419
+ "estimate": 0.003816400206291903,
420
+ "grouping": "supplied target_inchikey connectivity block",
421
+ "lower": 0.0010214478515165114,
422
+ "molecule_groups": 1119,
423
+ "queries": 9695,
424
+ "resamples": 2000,
425
+ "seed": 0,
426
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
427
+ "upper": 0.00702620750232798
428
+ },
429
+ "queries": 9695,
430
+ "schema": "massspecgym-retrieval-development-report/v1",
431
+ "strata": {
432
+ "adduct": {
433
+ "[M+H]+": {
434
+ "hit_rate_at_1": 0.4499798305768455,
435
+ "queries": 4958
436
+ },
437
+ "[M+Na]+": {
438
+ "hit_rate_at_1": 0.32531137850960523,
439
+ "queries": 4737
440
+ }
441
+ },
442
+ "candidate_pool_size": {
443
+ "129-256": {
444
+ "hit_rate_at_1": 0.39018328673501085,
445
+ "queries": 9657
446
+ },
447
+ "33-128": {
448
+ "hit_rate_at_1": 0.10526315789473684,
449
+ "queries": 38
450
+ }
451
+ },
452
+ "collision_energy": {
453
+ "20-39.999": {
454
+ "hit_rate_at_1": 0.23300970873786409,
455
+ "queries": 103
456
+ },
457
+ "40-59.999": {
458
+ "hit_rate_at_1": 0.4605263157894737,
459
+ "queries": 76
460
+ },
461
+ "<20": {
462
+ "hit_rate_at_1": 0.32,
463
+ "queries": 25
464
+ },
465
+ ">=60": {
466
+ "hit_rate_at_1": 0.35135135135135137,
467
+ "queries": 37
468
+ },
469
+ "missing": {
470
+ "hit_rate_at_1": 0.39052253014596994,
471
+ "queries": 9454
472
+ }
473
+ },
474
+ "instrument_type": {
475
+ "": {
476
+ "hit_rate_at_1": 0.6275720164609053,
477
+ "queries": 486
478
+ },
479
+ "Orbitrap": {
480
+ "hit_rate_at_1": 0.35063198833252307,
481
+ "queries": 8228
482
+ },
483
+ "QTOF": {
484
+ "hit_rate_at_1": 0.5932721712538226,
485
+ "queries": 981
486
+ }
487
+ },
488
+ "routing_domain": {
489
+ "fallback": {
490
+ "hit_rate_at_1": 0.3890665291387313,
491
+ "queries": 9695
492
+ }
493
+ }
494
+ },
495
+ "uncertainty": {
496
+ "confidence": 0.95,
497
+ "estimate": 0.3890665291387313,
498
+ "grouping": "supplied target_inchikey connectivity block",
499
+ "lower": 0.3431928285292061,
500
+ "molecule_groups": 1119,
501
+ "queries": 9695,
502
+ "resamples": 2000,
503
+ "seed": 0,
504
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
505
+ "upper": 0.4355042068549089
506
+ },
507
+ "valid_rankings": 9695
508
+ },
509
+ "comparison_vs_published_six_full": {
510
+ "benchmark_score": {
511
+ "at_or_above_upper_reference": true,
512
+ "comparable_to_test_reference": false,
513
+ "direction": "maximize",
514
+ "evaluation_fold": "validation",
515
+ "lower_reference": 0.04004329004329004,
516
+ "metric": "hit_rate_at_1",
517
+ "raw_performance": 0.5759431777240208,
518
+ "saturation": "upper",
519
+ "score": 1.0,
520
+ "unclipped_score": 1.1807553248146223,
521
+ "upper_reference": 0.4939052175894281,
522
+ "version": "massspecgym-retrieval-score/v1"
523
+ },
524
+ "external_reference_context": {
525
+ "comparable_to_this_validation_report": false,
526
+ "fold": "test",
527
+ "hit_rate_at_1": 0.4939052175894281,
528
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
529
+ },
530
+ "global_error": null,
531
+ "metrics": {
532
+ "hit_rate_at_1": 0.5759431777240208,
533
+ "hit_rate_at_20": 0.8574810849760667,
534
+ "hit_rate_at_5": 0.7411086520150291
535
+ },
536
+ "paired_baseline_delta": {
537
+ "confidence": 0.95,
538
+ "estimate": 0.001904369756549488,
539
+ "grouping": "supplied target_inchikey connectivity block",
540
+ "lower": 0.0004668910499798635,
541
+ "molecule_groups": 3185,
542
+ "queries": 19429,
543
+ "resamples": 2000,
544
+ "seed": 0,
545
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
546
+ "upper": 0.003419418048106212
547
+ },
548
+ "queries": 19429,
549
+ "schema": "massspecgym-retrieval-development-report/v1",
550
+ "strata": {
551
+ "adduct": {
552
+ "[M+H]+": {
553
+ "hit_rate_at_1": 0.656751973863327,
554
+ "queries": 14692
555
+ },
556
+ "[M+Na]+": {
557
+ "hit_rate_at_1": 0.32531137850960523,
558
+ "queries": 4737
559
+ }
560
+ },
561
+ "candidate_pool_size": {
562
+ "129-256": {
563
+ "hit_rate_at_1": 0.5768655561858594,
564
+ "queries": 19391
565
+ },
566
+ "33-128": {
567
+ "hit_rate_at_1": 0.10526315789473684,
568
+ "queries": 38
569
+ }
570
+ },
571
+ "collision_energy": {
572
+ "20-39.999": {
573
+ "hit_rate_at_1": 0.7791095890410958,
574
+ "queries": 4088
575
+ },
576
+ "40-59.999": {
577
+ "hit_rate_at_1": 0.7536694320357371,
578
+ "queries": 1567
579
+ },
580
+ "<20": {
581
+ "hit_rate_at_1": 0.5891666666666666,
582
+ "queries": 1200
583
+ },
584
+ ">=60": {
585
+ "hit_rate_at_1": 0.7772435897435898,
586
+ "queries": 3120
587
+ },
588
+ "missing": {
589
+ "hit_rate_at_1": 0.39052253014596994,
590
+ "queries": 9454
591
+ }
592
+ },
593
+ "instrument_type": {
594
+ "": {
595
+ "hit_rate_at_1": 0.6275720164609053,
596
+ "queries": 486
597
+ },
598
+ "Orbitrap": {
599
+ "hit_rate_at_1": 0.5816655514325689,
600
+ "queries": 16439
601
+ },
602
+ "QTOF": {
603
+ "hit_rate_at_1": 0.5283546325878594,
604
+ "queries": 2504
605
+ }
606
+ },
607
+ "routing_domain": {
608
+ "fallback": {
609
+ "hit_rate_at_1": 0.3890665291387313,
610
+ "queries": 9695
611
+ },
612
+ "glacier_released": {
613
+ "hit_rate_at_1": 0.7620710910211629,
614
+ "queries": 9734
615
+ }
616
+ }
617
+ },
618
+ "uncertainty": {
619
+ "confidence": 0.95,
620
+ "estimate": 0.5759431777240208,
621
+ "grouping": "supplied target_inchikey connectivity block",
622
+ "lower": 0.5383460454335357,
623
+ "molecule_groups": 3185,
624
+ "queries": 19429,
625
+ "resamples": 2000,
626
+ "seed": 0,
627
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
628
+ "upper": 0.6104767157034057
629
+ },
630
+ "valid_rankings": 19429
631
+ },
632
+ "probe_candidate": {
633
+ "schema": "massspecgym-validation-paired-mces/v1",
634
+ "queries": 512,
635
+ "valid_rankings": 512,
636
+ "metrics": {
637
+ "hit_rate_at_1": 0.5625,
638
+ "hit_rate_at_5": 0.71875,
639
+ "hit_rate_at_20": 0.841796875,
640
+ "mces_at_1": 7.201171875
641
+ },
642
+ "mces_unique_pairs": 451,
643
+ "mces_new_pairs": 0,
644
+ "elapsed_seconds": 1.0260065459879115,
645
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
646
+ "rankings_sha256": "517ef2d0400499442a543bed340109bb0688aa8e1cb657e4673fe7e993de7d9b",
647
+ "comparison": "validation only, not evidence of beating a test reference",
648
+ "strata": {
649
+ "adduct": {
650
+ "[M+H]+": {
651
+ "queries": 391,
652
+ "hit_rate_at_1": 0.6445012787723785
653
+ },
654
+ "[M+Na]+": {
655
+ "queries": 121,
656
+ "hit_rate_at_1": 0.2975206611570248
657
+ }
658
+ },
659
+ "instrument_type": {
660
+ "": {
661
+ "queries": 17,
662
+ "hit_rate_at_1": 0.5294117647058824
663
+ },
664
+ "Orbitrap": {
665
+ "queries": 431,
666
+ "hit_rate_at_1": 0.580046403712297
667
+ },
668
+ "QTOF": {
669
+ "queries": 64,
670
+ "hit_rate_at_1": 0.453125
671
+ }
672
+ },
673
+ "collision_energy": {
674
+ "20-39.999": {
675
+ "queries": 98,
676
+ "hit_rate_at_1": 0.8163265306122449
677
+ },
678
+ "40-59.999": {
679
+ "queries": 47,
680
+ "hit_rate_at_1": 0.7872340425531915
681
+ },
682
+ "<20": {
683
+ "queries": 39,
684
+ "hit_rate_at_1": 0.717948717948718
685
+ },
686
+ ">=60": {
687
+ "queries": 82,
688
+ "hit_rate_at_1": 0.6829268292682927
689
+ },
690
+ "missing": {
691
+ "queries": 246,
692
+ "hit_rate_at_1": 0.35365853658536583
693
+ }
694
+ },
695
+ "candidate_pool_size": {
696
+ "129-256": {
697
+ "queries": 511,
698
+ "hit_rate_at_1": 0.5636007827788649
699
+ },
700
+ "33-128": {
701
+ "queries": 1,
702
+ "hit_rate_at_1": 0.0
703
+ }
704
+ },
705
+ "routing_domain": {
706
+ "fallback": {
707
+ "queries": 257,
708
+ "hit_rate_at_1": 0.3540856031128405
709
+ },
710
+ "glacier_released": {
711
+ "queries": 255,
712
+ "hit_rate_at_1": 0.7725490196078432
713
+ }
714
+ }
715
+ },
716
+ "uncertainty": {
717
+ "estimate": 0.5625,
718
+ "lower": 0.5090534187086446,
719
+ "upper": 0.6196361537994289,
720
+ "confidence": 0.95,
721
+ "resamples": 2000,
722
+ "seed": 0,
723
+ "molecule_groups": 389,
724
+ "queries": 512,
725
+ "grouping": "supplied target_inchikey connectivity block",
726
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
727
+ }
728
+ },
729
+ "probe_baseline": {
730
+ "schema": "massspecgym-validation-paired-mces/v1",
731
+ "queries": 512,
732
+ "valid_rankings": 512,
733
+ "metrics": {
734
+ "hit_rate_at_1": 0.56640625,
735
+ "hit_rate_at_5": 0.71484375,
736
+ "hit_rate_at_20": 0.83203125,
737
+ "mces_at_1": 7.4423828125
738
+ },
739
+ "mces_unique_pairs": 454,
740
+ "mces_new_pairs": 0,
741
+ "elapsed_seconds": 1.0675355179992039,
742
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
743
+ "rankings_sha256": "e2b4226a3cf489a22313c3464bb144903dc0cc85bd48383fcf6bf68ed2c2e043",
744
+ "comparison": "validation only, not evidence of beating a test reference",
745
+ "strata": {
746
+ "adduct": {
747
+ "[M+H]+": {
748
+ "queries": 391,
749
+ "hit_rate_at_1": 0.6470588235294118
750
+ },
751
+ "[M+Na]+": {
752
+ "queries": 121,
753
+ "hit_rate_at_1": 0.30578512396694213
754
+ }
755
+ },
756
+ "instrument_type": {
757
+ "": {
758
+ "queries": 17,
759
+ "hit_rate_at_1": 0.5294117647058824
760
+ },
761
+ "Orbitrap": {
762
+ "queries": 431,
763
+ "hit_rate_at_1": 0.5846867749419954
764
+ },
765
+ "QTOF": {
766
+ "queries": 64,
767
+ "hit_rate_at_1": 0.453125
768
+ }
769
+ },
770
+ "collision_energy": {
771
+ "20-39.999": {
772
+ "queries": 98,
773
+ "hit_rate_at_1": 0.8163265306122449
774
+ },
775
+ "40-59.999": {
776
+ "queries": 47,
777
+ "hit_rate_at_1": 0.7872340425531915
778
+ },
779
+ "<20": {
780
+ "queries": 39,
781
+ "hit_rate_at_1": 0.717948717948718
782
+ },
783
+ ">=60": {
784
+ "queries": 82,
785
+ "hit_rate_at_1": 0.6829268292682927
786
+ },
787
+ "missing": {
788
+ "queries": 246,
789
+ "hit_rate_at_1": 0.3617886178861789
790
+ }
791
+ },
792
+ "candidate_pool_size": {
793
+ "129-256": {
794
+ "queries": 511,
795
+ "hit_rate_at_1": 0.5675146771037182
796
+ },
797
+ "33-128": {
798
+ "queries": 1,
799
+ "hit_rate_at_1": 0.0
800
+ }
801
+ },
802
+ "routing_domain": {
803
+ "fallback": {
804
+ "queries": 257,
805
+ "hit_rate_at_1": 0.36186770428015563
806
+ },
807
+ "glacier_released": {
808
+ "queries": 255,
809
+ "hit_rate_at_1": 0.7725490196078432
810
+ }
811
+ }
812
+ },
813
+ "uncertainty": {
814
+ "estimate": 0.56640625,
815
+ "lower": 0.5130780015916394,
816
+ "upper": 0.6220112244897958,
817
+ "confidence": 0.95,
818
+ "resamples": 2000,
819
+ "seed": 0,
820
+ "molecule_groups": 389,
821
+ "queries": 512,
822
+ "grouping": "supplied target_inchikey connectivity block",
823
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
824
+ }
825
+ },
826
+ "probe_scope": "Fixed512 subset of full-component rankings, not a fresh512 inverse batching replay. Same selected weights and native scores; all512queries present.",
827
+ "previous_publication": {
828
+ "schema": "massspecgym-retrieval-model/v1",
829
+ "checkpoint": {
830
+ "path": ".versions/generation-yj82k8q_/glacier.ckpt",
831
+ "sha256": "f31200ebf18e90e18fdacc307c4ff660875a211d14475e9e60dfd3edbd6f34a9",
832
+ "format": "pytorch"
833
+ },
834
+ "model_config": ".versions/generation-yj82k8q_/model_config.json",
835
+ "training_provenance": {
836
+ "data": "MassSpecGym v1.5 train fold; fallback data: MassSpecGym v1.5 train fold and provided held-out-clean ICEBERG synthetic spectra; own random initialization lineage; validation selection only",
837
+ "pretrained_assets": []
838
+ }
839
+ },
840
+ "selected_full_report": {
841
+ "benchmark_score": {
842
+ "at_or_above_upper_reference": true,
843
+ "comparable_to_test_reference": false,
844
+ "direction": "maximize",
845
+ "evaluation_fold": "validation",
846
+ "lower_reference": 0.04004329004329004,
847
+ "metric": "hit_rate_at_1",
848
+ "raw_performance": 0.5759431777240208,
849
+ "saturation": "upper",
850
+ "score": 1.0,
851
+ "unclipped_score": 1.1807553248146223,
852
+ "upper_reference": 0.4939052175894281,
853
+ "version": "massspecgym-retrieval-score/v1"
854
+ },
855
+ "external_reference_context": {
856
+ "comparable_to_this_validation_report": false,
857
+ "fold": "test",
858
+ "hit_rate_at_1": 0.4939052175894281,
859
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
860
+ },
861
+ "global_error": null,
862
+ "metrics": {
863
+ "hit_rate_at_1": 0.5759431777240208,
864
+ "hit_rate_at_20": 0.8574810849760667,
865
+ "hit_rate_at_5": 0.7411086520150291
866
+ },
867
+ "paired_baseline_delta": {
868
+ "confidence": 0.95,
869
+ "estimate": 0.001904369756549488,
870
+ "grouping": "supplied target_inchikey connectivity block",
871
+ "lower": 0.0004668910499798635,
872
+ "molecule_groups": 3185,
873
+ "queries": 19429,
874
+ "resamples": 2000,
875
+ "seed": 0,
876
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
877
+ "upper": 0.003419418048106212
878
+ },
879
+ "queries": 19429,
880
+ "schema": "massspecgym-retrieval-development-report/v1",
881
+ "strata": {
882
+ "adduct": {
883
+ "[M+H]+": {
884
+ "hit_rate_at_1": 0.656751973863327,
885
+ "queries": 14692
886
+ },
887
+ "[M+Na]+": {
888
+ "hit_rate_at_1": 0.32531137850960523,
889
+ "queries": 4737
890
+ }
891
+ },
892
+ "candidate_pool_size": {
893
+ "129-256": {
894
+ "hit_rate_at_1": 0.5768655561858594,
895
+ "queries": 19391
896
+ },
897
+ "33-128": {
898
+ "hit_rate_at_1": 0.10526315789473684,
899
+ "queries": 38
900
+ }
901
+ },
902
+ "collision_energy": {
903
+ "20-39.999": {
904
+ "hit_rate_at_1": 0.7791095890410958,
905
+ "queries": 4088
906
+ },
907
+ "40-59.999": {
908
+ "hit_rate_at_1": 0.7536694320357371,
909
+ "queries": 1567
910
+ },
911
+ "<20": {
912
+ "hit_rate_at_1": 0.5891666666666666,
913
+ "queries": 1200
914
+ },
915
+ ">=60": {
916
+ "hit_rate_at_1": 0.7772435897435898,
917
+ "queries": 3120
918
+ },
919
+ "missing": {
920
+ "hit_rate_at_1": 0.39052253014596994,
921
+ "queries": 9454
922
+ }
923
+ },
924
+ "instrument_type": {
925
+ "": {
926
+ "hit_rate_at_1": 0.6275720164609053,
927
+ "queries": 486
928
+ },
929
+ "Orbitrap": {
930
+ "hit_rate_at_1": 0.5816655514325689,
931
+ "queries": 16439
932
+ },
933
+ "QTOF": {
934
+ "hit_rate_at_1": 0.5283546325878594,
935
+ "queries": 2504
936
+ }
937
+ },
938
+ "routing_domain": {
939
+ "fallback": {
940
+ "hit_rate_at_1": 0.3890665291387313,
941
+ "queries": 9695
942
+ },
943
+ "glacier_released": {
944
+ "hit_rate_at_1": 0.7620710910211629,
945
+ "queries": 9734
946
+ }
947
+ }
948
+ },
949
+ "uncertainty": {
950
+ "confidence": 0.95,
951
+ "estimate": 0.5759431777240208,
952
+ "grouping": "supplied target_inchikey connectivity block",
953
+ "lower": 0.5383460454335357,
954
+ "molecule_groups": 3185,
955
+ "queries": 19429,
956
+ "resamples": 2000,
957
+ "seed": 0,
958
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
959
+ "upper": 0.6104767157034057
960
+ },
961
+ "valid_rankings": 19429
962
+ },
963
+ "selected_outside_report": {
964
+ "benchmark_score": {
965
+ "at_or_above_upper_reference": false,
966
+ "comparable_to_test_reference": false,
967
+ "direction": "maximize",
968
+ "evaluation_fold": "validation",
969
+ "lower_reference": 0.04004329004329004,
970
+ "metric": "hit_rate_at_1",
971
+ "raw_performance": 0.3890665291387313,
972
+ "saturation": null,
973
+ "score": 0.7690075283081785,
974
+ "unclipped_score": 0.7690075283081785,
975
+ "upper_reference": 0.4939052175894281,
976
+ "version": "massspecgym-retrieval-score/v1"
977
+ },
978
+ "external_reference_context": {
979
+ "comparable_to_this_validation_report": false,
980
+ "fold": "test",
981
+ "hit_rate_at_1": 0.4939052175894281,
982
+ "name": "GLACIER no-CF with strict-clean MIST fallback"
983
+ },
984
+ "global_error": null,
985
+ "metrics": {
986
+ "hit_rate_at_1": 0.3890665291387313,
987
+ "hit_rate_at_20": 0.7413099535843218,
988
+ "hit_rate_at_5": 0.5657555440948943
989
+ },
990
+ "paired_baseline_delta": {
991
+ "confidence": 0.95,
992
+ "estimate": 0.003816400206291903,
993
+ "grouping": "supplied target_inchikey connectivity block",
994
+ "lower": 0.0010214478515165114,
995
+ "molecule_groups": 1119,
996
+ "queries": 9695,
997
+ "resamples": 2000,
998
+ "seed": 0,
999
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
1000
+ "upper": 0.00702620750232798
1001
+ },
1002
+ "queries": 9695,
1003
+ "schema": "massspecgym-retrieval-development-report/v1",
1004
+ "strata": {
1005
+ "adduct": {
1006
+ "[M+H]+": {
1007
+ "hit_rate_at_1": 0.4499798305768455,
1008
+ "queries": 4958
1009
+ },
1010
+ "[M+Na]+": {
1011
+ "hit_rate_at_1": 0.32531137850960523,
1012
+ "queries": 4737
1013
+ }
1014
+ },
1015
+ "candidate_pool_size": {
1016
+ "129-256": {
1017
+ "hit_rate_at_1": 0.39018328673501085,
1018
+ "queries": 9657
1019
+ },
1020
+ "33-128": {
1021
+ "hit_rate_at_1": 0.10526315789473684,
1022
+ "queries": 38
1023
+ }
1024
+ },
1025
+ "collision_energy": {
1026
+ "20-39.999": {
1027
+ "hit_rate_at_1": 0.23300970873786409,
1028
+ "queries": 103
1029
+ },
1030
+ "40-59.999": {
1031
+ "hit_rate_at_1": 0.4605263157894737,
1032
+ "queries": 76
1033
+ },
1034
+ "<20": {
1035
+ "hit_rate_at_1": 0.32,
1036
+ "queries": 25
1037
+ },
1038
+ ">=60": {
1039
+ "hit_rate_at_1": 0.35135135135135137,
1040
+ "queries": 37
1041
+ },
1042
+ "missing": {
1043
+ "hit_rate_at_1": 0.39052253014596994,
1044
+ "queries": 9454
1045
+ }
1046
+ },
1047
+ "instrument_type": {
1048
+ "": {
1049
+ "hit_rate_at_1": 0.6275720164609053,
1050
+ "queries": 486
1051
+ },
1052
+ "Orbitrap": {
1053
+ "hit_rate_at_1": 0.35063198833252307,
1054
+ "queries": 8228
1055
+ },
1056
+ "QTOF": {
1057
+ "hit_rate_at_1": 0.5932721712538226,
1058
+ "queries": 981
1059
+ }
1060
+ },
1061
+ "routing_domain": {
1062
+ "fallback": {
1063
+ "hit_rate_at_1": 0.3890665291387313,
1064
+ "queries": 9695
1065
+ }
1066
+ }
1067
+ },
1068
+ "uncertainty": {
1069
+ "confidence": 0.95,
1070
+ "estimate": 0.3890665291387313,
1071
+ "grouping": "supplied target_inchikey connectivity block",
1072
+ "lower": 0.3431928285292061,
1073
+ "molecule_groups": 1119,
1074
+ "queries": 9695,
1075
+ "resamples": 2000,
1076
+ "seed": 0,
1077
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement",
1078
+ "upper": 0.4355042068549089
1079
+ },
1080
+ "valid_rankings": 9695
1081
+ },
1082
+ "selected_probe_report": {
1083
+ "schema": "massspecgym-validation-paired-mces/v1",
1084
+ "queries": 512,
1085
+ "valid_rankings": 512,
1086
+ "metrics": {
1087
+ "hit_rate_at_1": 0.5625,
1088
+ "hit_rate_at_5": 0.71875,
1089
+ "hit_rate_at_20": 0.841796875,
1090
+ "mces_at_1": 7.201171875
1091
+ },
1092
+ "mces_unique_pairs": 451,
1093
+ "mces_new_pairs": 0,
1094
+ "elapsed_seconds": 1.0260065459879115,
1095
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
1096
+ "rankings_sha256": "517ef2d0400499442a543bed340109bb0688aa8e1cb657e4673fe7e993de7d9b",
1097
+ "comparison": "validation only, not evidence of beating a test reference",
1098
+ "strata": {
1099
+ "adduct": {
1100
+ "[M+H]+": {
1101
+ "queries": 391,
1102
+ "hit_rate_at_1": 0.6445012787723785
1103
+ },
1104
+ "[M+Na]+": {
1105
+ "queries": 121,
1106
+ "hit_rate_at_1": 0.2975206611570248
1107
+ }
1108
+ },
1109
+ "instrument_type": {
1110
+ "": {
1111
+ "queries": 17,
1112
+ "hit_rate_at_1": 0.5294117647058824
1113
+ },
1114
+ "Orbitrap": {
1115
+ "queries": 431,
1116
+ "hit_rate_at_1": 0.580046403712297
1117
+ },
1118
+ "QTOF": {
1119
+ "queries": 64,
1120
+ "hit_rate_at_1": 0.453125
1121
+ }
1122
+ },
1123
+ "collision_energy": {
1124
+ "20-39.999": {
1125
+ "queries": 98,
1126
+ "hit_rate_at_1": 0.8163265306122449
1127
+ },
1128
+ "40-59.999": {
1129
+ "queries": 47,
1130
+ "hit_rate_at_1": 0.7872340425531915
1131
+ },
1132
+ "<20": {
1133
+ "queries": 39,
1134
+ "hit_rate_at_1": 0.717948717948718
1135
+ },
1136
+ ">=60": {
1137
+ "queries": 82,
1138
+ "hit_rate_at_1": 0.6829268292682927
1139
+ },
1140
+ "missing": {
1141
+ "queries": 246,
1142
+ "hit_rate_at_1": 0.35365853658536583
1143
+ }
1144
+ },
1145
+ "candidate_pool_size": {
1146
+ "129-256": {
1147
+ "queries": 511,
1148
+ "hit_rate_at_1": 0.5636007827788649
1149
+ },
1150
+ "33-128": {
1151
+ "queries": 1,
1152
+ "hit_rate_at_1": 0.0
1153
+ }
1154
+ },
1155
+ "routing_domain": {
1156
+ "fallback": {
1157
+ "queries": 257,
1158
+ "hit_rate_at_1": 0.3540856031128405
1159
+ },
1160
+ "glacier_released": {
1161
+ "queries": 255,
1162
+ "hit_rate_at_1": 0.7725490196078432
1163
+ }
1164
+ }
1165
+ },
1166
+ "uncertainty": {
1167
+ "estimate": 0.5625,
1168
+ "lower": 0.5090534187086446,
1169
+ "upper": 0.6196361537994289,
1170
+ "confidence": 0.95,
1171
+ "resamples": 2000,
1172
+ "seed": 0,
1173
+ "molecule_groups": 389,
1174
+ "queries": 512,
1175
+ "grouping": "supplied target_inchikey connectivity block",
1176
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
1177
+ }
1178
+ },
1179
+ "selected_probe_baseline": {
1180
+ "schema": "massspecgym-validation-paired-mces/v1",
1181
+ "queries": 512,
1182
+ "valid_rankings": 512,
1183
+ "metrics": {
1184
+ "hit_rate_at_1": 0.56640625,
1185
+ "hit_rate_at_5": 0.71484375,
1186
+ "hit_rate_at_20": 0.83203125,
1187
+ "mces_at_1": 7.4423828125
1188
+ },
1189
+ "mces_unique_pairs": 454,
1190
+ "mces_new_pairs": 0,
1191
+ "elapsed_seconds": 1.0675355179992039,
1192
+ "query_set_sha256": "7a325e288613bf0183eb58f8e36f762c5b3d2acb886e5798dbba078d82fa3661",
1193
+ "rankings_sha256": "e2b4226a3cf489a22313c3464bb144903dc0cc85bd48383fcf6bf68ed2c2e043",
1194
+ "comparison": "validation only, not evidence of beating a test reference",
1195
+ "strata": {
1196
+ "adduct": {
1197
+ "[M+H]+": {
1198
+ "queries": 391,
1199
+ "hit_rate_at_1": 0.6470588235294118
1200
+ },
1201
+ "[M+Na]+": {
1202
+ "queries": 121,
1203
+ "hit_rate_at_1": 0.30578512396694213
1204
+ }
1205
+ },
1206
+ "instrument_type": {
1207
+ "": {
1208
+ "queries": 17,
1209
+ "hit_rate_at_1": 0.5294117647058824
1210
+ },
1211
+ "Orbitrap": {
1212
+ "queries": 431,
1213
+ "hit_rate_at_1": 0.5846867749419954
1214
+ },
1215
+ "QTOF": {
1216
+ "queries": 64,
1217
+ "hit_rate_at_1": 0.453125
1218
+ }
1219
+ },
1220
+ "collision_energy": {
1221
+ "20-39.999": {
1222
+ "queries": 98,
1223
+ "hit_rate_at_1": 0.8163265306122449
1224
+ },
1225
+ "40-59.999": {
1226
+ "queries": 47,
1227
+ "hit_rate_at_1": 0.7872340425531915
1228
+ },
1229
+ "<20": {
1230
+ "queries": 39,
1231
+ "hit_rate_at_1": 0.717948717948718
1232
+ },
1233
+ ">=60": {
1234
+ "queries": 82,
1235
+ "hit_rate_at_1": 0.6829268292682927
1236
+ },
1237
+ "missing": {
1238
+ "queries": 246,
1239
+ "hit_rate_at_1": 0.3617886178861789
1240
+ }
1241
+ },
1242
+ "candidate_pool_size": {
1243
+ "129-256": {
1244
+ "queries": 511,
1245
+ "hit_rate_at_1": 0.5675146771037182
1246
+ },
1247
+ "33-128": {
1248
+ "queries": 1,
1249
+ "hit_rate_at_1": 0.0
1250
+ }
1251
+ },
1252
+ "routing_domain": {
1253
+ "fallback": {
1254
+ "queries": 257,
1255
+ "hit_rate_at_1": 0.36186770428015563
1256
+ },
1257
+ "glacier_released": {
1258
+ "queries": 255,
1259
+ "hit_rate_at_1": 0.7725490196078432
1260
+ }
1261
+ }
1262
+ },
1263
+ "uncertainty": {
1264
+ "estimate": 0.56640625,
1265
+ "lower": 0.5130780015916394,
1266
+ "upper": 0.6220112244897958,
1267
+ "confidence": 0.95,
1268
+ "resamples": 2000,
1269
+ "seed": 0,
1270
+ "molecule_groups": 389,
1271
+ "queries": 512,
1272
+ "grouping": "supplied target_inchikey connectivity block",
1273
+ "statistic": "spectrum-weighted mean; molecules sampled with replacement"
1274
+ }
1275
+ },
1276
+ "selection_scope": "Actual portable inverse replay on9695outside queries, unchanged known rankings and native simulator predictions. Group intervals are not selection-adjusted. Relocated combined4check passes. No test claim."
1277
+ }
shared/package-files/fe/fe8dd43e26925057812ef5eb7085bbbc90a3e14bd6c6e0f1a2b7dca3947cea87/model_config.json ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "native-glacier-entropy-plus-inverse-cosine",
3
+ "inverse_score_weight": 1.0,
4
+ "fusion_rule": "Native entropy at fixed strength 1 for released conditions or 0.5 otherwise, plus inverse fingerprint evidence. Unsupported native candidates contribute zero native evidence.",
5
+ "domain": "all",
6
+ "batch_size": 128,
7
+ "workers": 4,
8
+ "feature_cache_per_worker": 128,
9
+ "sparse_k": 100,
10
+ "matmul_precision": "high",
11
+ "simulation_deadline_seconds": 16000,
12
+ "deadline_policy": "Incomplete candidate pools use the fixed inverse model; no partial simulation rankings",
13
+ "deduplication": "identical pool/adduct/instrument/energy simulation reused; spectra scored independently",
14
+ "fallback_checkpoint_sha256": "cbbc283ca804879dbf2a2986e221d5fcb2ebfb14a4ca61dd0b877c020ce3175e",
15
+ "training": {
16
+ "experiment": "native-contrast-v1",
17
+ "hypothesis": "Ranking against experimental training structure decoys may improve native candidate discrimination beyond positive-only spectral fitting.",
18
+ "changed_factor": "Matched pair changes only native contr_weight0\u21920.2. Both use one train-only exact-formula preferred decoy per positive, native Sinkhorn ranking loss, target spectral entropy and fixed0.01 fragment regularization; initialize frozen own all-condition6000, new optimizer, lr5e-5, warmup100, seed1, batch8/accumulate2,1000steps,900sec cap,512 validation-loss queries. No validation/test negatives or pools are used.",
19
+ "seed": 1,
20
+ "initial_checkpoint_sha256": "371296612be1ef216eb99d0568ab2ec0fc15bff2b084f83eb5cd531947ab66eb",
21
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
22
+ "validation_query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6",
23
+ "status": "Training complete; portable retrieval comparison required.",
24
+ "matched_control": "native-contrast-control-v1",
25
+ "pretrained_assets": [],
26
+ "preflight": {
27
+ "training_examples": 2,
28
+ "decoys_per_example": 1,
29
+ "condition_alignment": true,
30
+ "strict_checkpoint_load": true,
31
+ "loss_weight_identity_passed": true,
32
+ "control_loss": 0.32466134428977966,
33
+ "weighted_loss": 0.32466134428977966,
34
+ "contrastive_loss": 0.0,
35
+ "finite_gradients": true,
36
+ "device": "CPU",
37
+ "elapsed_seconds": 17.484049640013836,
38
+ "negative_pool_sha256": "2665814fb6f63bd7609e69de1e9f4539ae32acf342f52cdfbb329d034026cb62",
39
+ "nonzero_contrastive_gradient_check": {
40
+ "positive_loss": 0.7,
41
+ "negative_loss": 0.6,
42
+ "ranking_loss": 0.4793221652507782,
43
+ "gradient": [
44
+ [
45
+ 1.8417903184890747,
46
+ -1.5494613647460938
47
+ ]
48
+ ],
49
+ "interpretation": "Synthetic loss pair exercises nonzero ranking-gradient signs; two real training examples had zero contrastive loss. No optimizer step or checkpoint was produced."
50
+ }
51
+ },
52
+ "publication_preflight": {
53
+ "command": [
54
+ "/opt/glacier/bin/python",
55
+ "/workspace/research/native-contrast-training/publish.py",
56
+ "--checkpoint",
57
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
58
+ "--fallback",
59
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
60
+ "--source-root",
61
+ "/workspace/research/ms-pred",
62
+ "--output-dir",
63
+ "/workspace/research/native-contrast-data-v1/publication-smoke-package"
64
+ ],
65
+ "started_utc": "2026-10-31T11:43:24.138362+00:00",
66
+ "finished_utc": "2026-10-31T11:43:28.866993+00:00",
67
+ "elapsed_seconds": 4.728661336004734,
68
+ "user_cpu_seconds": 2.5988949999999997,
69
+ "system_cpu_seconds": 0.585553,
70
+ "peak_child_rss_kib": 578708,
71
+ "exit_code": 0
72
+ },
73
+ "compute": {
74
+ "command": [
75
+ "/opt/glacier/bin/python",
76
+ "/workspace/research/native-contrast-training/train.py",
77
+ "--data-root",
78
+ "/workspace/research/allconditions/data",
79
+ "--source-root",
80
+ "/workspace/research/ms-pred",
81
+ "--config",
82
+ "/workspace/research/native-contrast-v1/config.json",
83
+ "--work-dir",
84
+ "/workspace/research/native-contrast-v1",
85
+ "--fallback",
86
+ "/workspace/research/known-long-hybrid-v1/inverse-package",
87
+ "--submission-dir",
88
+ "/workspace/research/native-contrast-v1/package",
89
+ "--max-steps",
90
+ "1000",
91
+ "--max-seconds",
92
+ "900",
93
+ "--batch-size",
94
+ "8",
95
+ "--workers",
96
+ "4",
97
+ "--accumulate-grad-batches",
98
+ "2",
99
+ "--validate-every",
100
+ "1000",
101
+ "--checkpoint-every",
102
+ "250",
103
+ "--seed",
104
+ "1",
105
+ "--initialize-from",
106
+ "/workspace/research/glacier-all-v1/frozen-phase1/selected.ckpt",
107
+ "--validation-limit",
108
+ "512",
109
+ "--negative-pool",
110
+ "/workspace/research/native-contrast-data-v1/negative-pool.json"
111
+ ],
112
+ "started_utc": "2026-10-31T11:58:19.280365+00:00",
113
+ "finished_utc": "2026-10-31T12:08:17.816182+00:00",
114
+ "elapsed_seconds": 598.5358515259868,
115
+ "user_cpu_seconds": 1182.827914,
116
+ "system_cpu_seconds": 100.445548,
117
+ "peak_child_rss_kib": 3668992,
118
+ "exit_code": 0
119
+ },
120
+ "result": {
121
+ "global_step": 1000,
122
+ "elapsed_seconds": 583.4989081730018,
123
+ "selected_checkpoint": "/run-state/workspace/research/native-contrast-v1/validated-final.ckpt",
124
+ "validation_loss": 0.6348612308502197,
125
+ "last_validation_loss": 0.6348612308502197,
126
+ "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6",
127
+ "data_manifest_sha256": "7be9576f9bc738df28bcc647b851b40f0f38be56198d71cda5f53bd3e94cfa46",
128
+ "hardware": "NVIDIA H100 80GB HBM3",
129
+ "peak_cuda_allocated_bytes": 2316938752,
130
+ "selected_on": "validation spectrum loss; retrieval must be measured separately"
131
+ },
132
+ "checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
133
+ "raw_checkpoint_sha256": "6dbf912b28da6c7b5d25983b8e255bc673a50455961d6445667668a5f1002799",
134
+ "export_checkpoint_sha256": "f306da9887cd7f30b348735251a18302c22a53c44aeb0fc2715601e3d7ac2c62"
135
+ },
136
+ "runtime": "/opt/glacier/bin/python",
137
+ "native_similarity": "moderate",
138
+ "similarity_tolerances": {
139
+ "tight": [
140
+ 0.002,
141
+ 5.0
142
+ ],
143
+ "moderate": [
144
+ 0.005,
145
+ 10.0
146
+ ],
147
+ "broad": [
148
+ 0.01,
149
+ 20.0
150
+ ]
151
+ },
152
+ "similarity_rule": "Grid entropy, or nearest-observation entropy with max(absolute daltons, ppm) tolerance. Each predicted peak matches at most one observation.",
153
+ "outside_native_weight": 0.5,
154
+ "released_domain_asset": {
155
+ "path": "released-glacier.ckpt",
156
+ "sha256": "114931ad091fc0a1b7c620413ed3258062a5a427e11577bba2b02e8fcff90bf0"
157
+ },
158
+ "expert_routing": "Original known-condition native expert; train-decoy contrastive1000 outside expert. Fixed condition routing for every query.",
159
+ "missing_energy_grid": [
160
+ 20.0,
161
+ 40.0,
162
+ 60.0
163
+ ],
164
+ "missing_energy_original_weight": 0.5,
165
+ "missing_energy_adducts": [
166
+ "[M+H]+"
167
+ ],
168
+ "fusion_gate_asset": {
169
+ "path": "fusion-gate.pt",
170
+ "sha256": "488fbe5ae200957c6a471d88fa6ae5eb108024a5d2bf453dd491c1c05c507002"
171
+ },
172
+ "graph_reranker": {
173
+ "asset": {
174
+ "path": "graph-fragment.pt",
175
+ "sha256": "48dbce2c012d78b4ff0148fcde8dd6b1eeb2713dfbcc9c5d4715c02bcefeeab0"
176
+ },
177
+ "k": 8,
178
+ "coefficient": 0.01,
179
+ "domain": "outside",
180
+ "workers": 8
181
+ }
182
+ }