Thibaut Forest Claude Fable 5 commited on
Commit
67bad41
·
1 Parent(s): 58f946e

docs: REPRODUCIBILITY.md - submitted commits, run-time-fit pipeline, seeds, pickle provenance + sha256, exact repro commands

Browse files
Files changed (1) hide show
  1. REPRODUCIBILITY.md +94 -0
REPRODUCIBILITY.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reproducibility
2
+
3
+ This document identifies the submitted version(s) and the exact pipeline that
4
+ reproduces every trained or stored artifact in this repository, per the
5
+ competition rules.
6
+
7
+ ## Submitted commits
8
+
9
+ The final submission is selected in the competition portal from publicly
10
+ scored versions of this repository. Publicly scored versions relevant to the
11
+ selection:
12
+
13
+ | commit | public score | configuration (env defaults at that commit) |
14
+ |---|---|---|
15
+ | `4c93883` | **1575.31** | primary selection — order .50 logbag + .30 Wiener + .20 gapHGB, alpha 1.0, planner split_days=7 / timing_weight=1.0 |
16
+ | `71bfff2` | 1583.11 | alternate — same model, planner split_days=3 / timing_weight=2.0 (equivalent to `60d65da`; warmup gate present in code but OFF by default) |
17
+ | `e4745d2` | 1594.89 | not selected — warmup gate ON (refuted by the public score) |
18
+
19
+ The exact submitted commit is the one recorded in the competition portal at
20
+ selection time; unless stated otherwise there, it is `4c93883`.
21
+
22
+ ## Pipeline: what is trained, and when
23
+
24
+ The scored entry point is `script.py`, which calls
25
+ `batteryswap_example/submit.py:main()`. **No pre-trained model is used on the
26
+ primary path.** All estimators (bagged logistic RUL model, Wiener
27
+ first-hitting-time model, gap-feature HistGradientBoosting order source) are
28
+ fit at submission run time, inside the evaluation container, from the dataset
29
+ provided to the run. The submitted model is therefore fully specified by the
30
+ code at the submitted commit plus the configuration below — there is no
31
+ training step to reproduce separately for the primary path.
32
+
33
+ Determinism: every estimator is seeded (`random_state=0` throughout
34
+ `submit.py`/`models_cv.py`; ancillary sampling uses
35
+ `numpy.random.RandomState(0)`). Given the same dataset and the pinned
36
+ competition environment (`/app/env` in the `huggingface/competitions` image),
37
+ repeated runs emit an identical `submission.csv`. Defensive fallbacks exist
38
+ (on failure or budget overrun a split degrades to a simpler static fit, with a
39
+ log line); all publicly scored runs of the commits above completed on the
40
+ primary path (leaderboard components invert to integer swap/day counts
41
+ consistent with it).
42
+
43
+ ## Configuration and seeds
44
+
45
+ All dials are environment variables read in `batteryswap_example/submit.py`
46
+ with in-repo defaults. The Dockerfile sets only `BATTERYSWAP_SPLITS` and
47
+ `BATTERYSWAP_SUBMISSION_PATH`; **the env defaults in the code at the
48
+ submitted commit are the submitted configuration** — no external
49
+ configuration files or overrides are used. Random seeds are fixed in code
50
+ (seed 0 everywhere); no seed is supplied at run time.
51
+
52
+ ## Exact reproduction commands
53
+
54
+ ```bash
55
+ git checkout <submitted-commit> # e.g. 4c93883
56
+ docker build -t batteryswapai-2026-example .
57
+ docker run --name batteryswapai -v ./dataset:/tmp/data \
58
+ batteryswapai-2026-example \
59
+ bash -c "/app/env/bin/python3 script.py && /app/env/bin/python3 -m batteryswap_public.metric"
60
+ docker cp batteryswapai:/app/submission.csv ./submission.csv
61
+ ```
62
+
63
+ `dataset/` must contain the official competition dataset (not redistributed
64
+ here; see THIRD_PARTY_NOTICES.md). `BATTERYSWAP_SPLITS` defaults to `train`;
65
+ the scoring system sets its own splits.
66
+
67
+ ## Stored artifact: `batteryswap_example/planners/best.pickle`
68
+
69
+ - sha256: `1d263e1282560dc608868cb9ce3360007c2230b360bd4ea272b260bd3b08b0d0`
70
+ - Role: **fallback only.** It is loaded exclusively if the run-time-fitted
71
+ path fails for a split; it does not contribute to the primary scored
72
+ output.
73
+ - Provenance: produced by `python batteryswap_example/train.py` (which fits
74
+ the legacy `OrderedPlanner` RUL model, seeded, and writes this path) run
75
+ inside the Docker environment above, at commit `4fb1dc8`. Re-running that
76
+ command at that commit in that environment reproduces an equivalent
77
+ artifact; equivalence should be verified on emitted plans rather than
78
+ pickle byte-identity (pickle serialization is not guaranteed byte-stable
79
+ across library builds). Note: running `train.py` overwrites this file.
80
+
81
+ ## Verification
82
+
83
+ 1. Run the Docker commands above at the submitted commit; the container
84
+ prints the official metric for the chosen split via
85
+ `batteryswap_public.metric`.
86
+ 2. Cross-check against the public leaderboard scores in the table above for
87
+ the corresponding commits.
88
+ 3. The internal cross-validation harness reproduces the model-selection
89
+ number at the repository head: from the repo root with the dataset in
90
+ place, `python -m batteryswap_example.cv cand ft2a10` → 1541.3
91
+ (building-grouped 5-fold out-of-fold cost, mean over 48 scenarios).
92
+
93
+ Full experiment provenance for every modeling decision is recorded in
94
+ `EXPERIMENTS.md` (phases 1–69) and `agent_reports_bgkf/`.