thundercode commited on
Commit
ddc0680
·
verified ·
1 Parent(s): df0d288

release: add docs/REPRODUCIBILITY.md

Browse files
Files changed (1) hide show
  1. docs/REPRODUCIBILITY.md +130 -0
docs/REPRODUCIBILITY.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reproducibility
2
+
3
+ **Status tags:** `IMPLEMENTED` · `VERIFIED` · `MEASURED` · `NOT RUN` · `BLOCKED`.
4
+
5
+ This document states exactly what a third party can reproduce, with what, and what they cannot.
6
+
7
+ ---
8
+
9
+ ## 1. The reproducibility contract
10
+
11
+ | Guarantee | How it is enforced |
12
+ |---|---|
13
+ | **Frozen configuration** | All tunables live in `configs/base.yaml`; no magic numbers in Python. The loader validates invariants and computes a hash. |
14
+ | **Frozen config hash** | `78f1e3700da15aa1`. Every artifact records the hash it was produced against. |
15
+ | **Pinned backbones** | Every backbone is pinned by revision in `configs/base.yaml`; the Hub resolves the exact commit. |
16
+ | **Seed** | `project.seed: 42`. |
17
+ | **Immutable public test** | `evaluation.immutable_public_test: true`; `hidden_data_access: false`. |
18
+ | **Byte-verified artifacts** | Every released artifact ships with a sha256 in `models/checksums.sha256`. |
19
+ | **Verified metrics** | Every quoted number is checked against its artifact by `tools/verify_readme_metrics.py`. |
20
+
21
+ ### 1.1 Invariants the loader enforces
22
+
23
+ Editing `configs/base.yaml` moves the hash and **invalidates every artifact keyed to it**. Two
24
+ invariants exist because their violation is a *silent* error:
25
+
26
+ ```
27
+ fusion.input_dim == 3 * croma.encoder_dim + croma.optical_channels + croma.sar_channels # 2318
28
+ grounding_head.feature_dim == 4 * grounding.encoder_projected_dim # 2048
29
+ ```
30
+
31
+ The second is especially load-bearing: a mismatch is a silent shape error that torch only raises at
32
+ the similarity step, after patch features are already cached. It is therefore rejected at load time.
33
+
34
+ ## 2. Reproduce the metric verification (cheap, no GPU)
35
+
36
+ ```bash
37
+ python release/tools/verify_readme_metrics.py
38
+ ```
39
+
40
+ - **Reads** the artifacts under `artifacts/`.
41
+ - **Compares** each of the 20 quoted metrics at the precision printed in the README.
42
+ - **Also asserts** statuses (VLM headline contains `ACCEPTANCE-REJECTED`; router `corpus_limited` /
43
+ `n_val`; calibration temperature and `ece_improvement`).
44
+ - **Exits 0** and prints `ALL CLAIMS VERIFIED` only when everything matches.
45
+
46
+ Committed output: `release/tools/readme_metrics_report.txt`.
47
+
48
+ ## 3. Reproduce the environment (local run)
49
+
50
+ ```bash
51
+ git clone https://github.com/Anish-lab-blip/SatQuery-AI
52
+ cd SatQuery-AI
53
+ python -m venv .venv
54
+ source .venv/Scripts/activate # Windows git-bash; .venv/bin/activate on Linux/macOS
55
+ pip install -r requirements.txt
56
+ ```
57
+
58
+ Python 3.11+ and a CPU are sufficient. Device is selected via `SATQUERY_DEVICE`; all placement is
59
+ `.to(device)`, never `.cuda()`. Backbones are fetched from the Hugging Face Hub on first use, pinned
60
+ by revision.
61
+
62
+ ## 4. Reproduce the tests
63
+
64
+ | Suite | Command | Expected |
65
+ |---|---|---|
66
+ | Frontend live-wiring | `pytest tests/unit/test_frontend_live_wiring.py` | **106 passed** |
67
+ | Doc/frontend suite | `pytest` on the 5 doc/frontend files | **183 passed** |
68
+ | Full unit suite | `pytest tests/unit` | 5–6 **environmental** failures (sandbox delete guard × 4, 1 ordering flake, 1 stale adapter test) — see [`EVALUATION.md`](EVALUATION.md) §4 |
69
+
70
+ > **Environment note.** In the authoring sandbox the full suite trips a **bulk-delete guard** and
71
+ > pytest is only installed in the repository virtualenv. Neither affects a normal user environment.
72
+
73
+ ## 5. Reproduce a live run
74
+
75
+ The deployed stack is reachable:
76
+
77
+ ```bash
78
+ curl --noproxy '*' https://satquery-backend-m4yv.onrender.com/api/health
79
+ curl --noproxy '*' https://satquery-backend-m4yv.onrender.com/api/capabilities
80
+ ```
81
+
82
+ `/api/capabilities` returns six tasks, all `available: true`. A live run requires the tunnel agent to
83
+ be connected (`agent_connected:true`); if the Codespace is stopped, the request parks until the
84
+ tunnel timeout. See [`DEPLOYMENT.md`](DEPLOYMENT.md) §5–6.
85
+
86
+ ## 6. Reproduce the trained artifacts
87
+
88
+ Backbones are public and pinned; the **trained modules** are released on the Hugging Face Hub under
89
+ `thundercode/SatQuery`, each with its backbone dependency and checksum. To reproduce training:
90
+
91
+ | Artifact | Where it trains | Guide |
92
+ |---|---|---|
93
+ | router adapter | local CPU | `configs/base.yaml` §router.training |
94
+ | grounding head | local | `configs/base.yaml` §grounding_training |
95
+ | change head | local | `configs/base.yaml` §change |
96
+ | optical_sar fusion head | local, seed sweep | `docs/PHASE14_OPTICAL_SAR_DECISIONS.md` |
97
+ | change_vqa head | **external GPU (Kaggle)** | `docs/R02_KAGGLE_TRAINING_GUIDE.md` |
98
+ | vlm LoRA adapter | **external GPU** | `configs/base.yaml` §training |
99
+
100
+ ### 6.1 What "reproduce" means for externally-trained artifacts
101
+
102
+ The change-VQA and VLM artifacts were trained **outside this repository**. Reproducing them requires
103
+ the external GPU environment described in their guides. The repository reproduces:
104
+ - the **promotion gate** (byte-identity, sha256, zero non-finite tensors);
105
+ - the **evaluation**;
106
+ - the **serving wiring**.
107
+
108
+ It does **not** ship a one-command retrain for those two artifacts. This is stated rather than
109
+ implied.
110
+
111
+ ## 7. What is NOT reproducible from this release
112
+
113
+ | Item | Reason |
114
+ |---|---|
115
+ | The private deployment repos | They are private; the deployed sources are not in this release. |
116
+ | System-level end-to-end benchmark | **No such benchmark exists.** |
117
+ | Router test-split number | **Not run.** |
118
+ | CDVQA / SECOND imagery | Public but large; the release documents the acquisition + name-verification procedure, not the data. |
119
+ | BigEarthNet full corpus | **Not downloaded** (only a 28k S2 subset was used). |
120
+ | The historical ZeroGPU/Gradio deploy target | Frozen paperwork only; no runtime exists in code. |
121
+
122
+ ## 8. Environment traps recorded for reproducibility
123
+
124
+ - **Dead proxy in the authoring sandbox** — outbound calls need `--noproxy '*'` (curl) or
125
+ `ProxyHandler({})` (Python).
126
+ - **pytest only in the repo virtualenv** (`.venv/Scripts/python.exe`).
127
+ - **Full-suite pytest trips a bulk-delete guard** in the sandbox.
128
+ - **Cloudflare 308-redirects `X.html` → `/X`.**
129
+ - **Chrome drops synthetic CDP key events when the window lacks OS focus** — relevant to any
130
+ browser-driven reproduction of the live validation.