Detection & tolerances

How much of a water-leak detector's score on the BattLeDIM benchmark beats random alarms?

research/water-leaks

Research programme: leak detection on the real BattLeDIM L-Town benchmark (2018 tunes, 2019 tests), scored against chance; a residual CUSUM finds 13 of the 19 leaks that start in 2019 and an automatic reimplementation of the published LILA method 14 (1 false alarm), against a median 11 for the same 26 random alarms (P = 0.105 and 0.019, the latter back to 0.265 under a different tie-break)…

52 tests

What it found

An open research programme on leak detection and localisation in water distribution networks, run on the one public benchmark with a realistic network, two years of SCADA data and a published leak schedule: BattLeDIM's L-Town (Vrachimis et al. 2022; Zenodo 4017659, CC-BY-4.0), which infra-waterloss could not reach and replaced with Net3. It asks how much of a detector's reported skill is above what random alarms would score, and whether a data-driven detector can carry a false-alarm rate fixed before the year is seen.

Step 1 (2026-11-12) builds the harness: SHA-256-checked loader, ground truth from the leak-flow files (onsets match Melnikov 2025's table), matching (an alarm counts for the running leak with the latest onset within 30 days) and distances along the pipe graph. Detector D1 fits each of the 33 pressure sensors on hour-of-week, tank level and the three inlet flows over a trailing two-week window ending a week back, runs a one-sided CUSUM on the standardised residuals, and re-anchors its window after each alarm (an earlier hold-off version re-alarmed on the same leak; a unit test caught it).

Tuned on 2018 only (at most 2 false alarms), on 2019 it detects 13 of the 19 new leaks with 2 false alarms, a median delay of 104 h (11 to 341), and 16 of BattLeDIM's 23 counting the 3 of 4 carried-over leaks it found in 2018; without localisation, so not comparable with the published 15 to 17 of 23, which required a reported pipe within 300 m. Against the same 26 alarms placed at random (1,000 draws, 14 days apart, random sensors), the detection count is near chance (median 11, 95% range 8 to 13, P = 0.105), as is detection within 72 h (4 against 2, P = 0.145); but the alarming sensor is within 300 m along the pipes of 5 detected leaks against a chance median of 0 (P < 0.001). L-Town is a simulated network with simulated leaks; 2018 labels were used for tuning, which competitors did not have; nothing here is an operational recommendation.

Show the rest of the summary (30 more paragraphs, 2,538 words)

Step 2 (2026-11-12) reimplements LILA's identification (Daniel et al. 2022: pairwise sensor regressions on the inlet flow, a most-affected-sensor reconstruction error, Montgomery's CUSUM) and runs it blind on D1's trailing window; the authors' released notebook instead writes in each known leak's sensor and calibration windows. Tuned on 2018 (delta 1, Cthr 20), it detects 14 of 19 with 1 false alarm and 26 alarms: P = 0.019 against chance on the count, which refutes the programme's pre-registered H1 as written, but thinly: 2 of the 13 settings with 20 or more alarms clear 0.05, and a disclosed post-hoc change of the most-affected-sensor tie-break (ties occur in 46% of hours, because the inlet flow drives every sensor) gives 13 of 19 and P = 0.265.

Its most affected sensor is within 300 m of 7 of the 14 leaks (chance median 0, P < 0.001), and every one of the 27 settings beats chance on that count. Zenodo was unreachable; the inputs came from public GitHub copies whose SHA-256s match Zenodo's.

Step 6 (2026-11-13) tests the practitioner's minimum-night-flow statistic on the district water balance (p227 + p235 less the tank T1's storage change, least hourly flow from 00:00 to 06:00, a CUSUM on its trailing median and MAD), pre-registered as hypothesis H4: that it detects incipient leaks sooner than pressure CUSUM. Tuned on 2018 the same way, it detects 3 of the 9 new 2019 leaks under 12 m³/h, against 7 for D1 and 7 for LILA, and is earlier than D1 on 1 of them: H4 refuted.

The nightly minimum's two-week robust sd is 10.7 m³/h, the size of the leaks; a post-hoc look shows Friday and Saturday nights 10 to 15 m³/h above the week, and removing that pattern leaves 7.1 m³/h. Over all 19 new leaks it finds 10 with 6 false alarms, at chance on the count (P = 0.80).

Step 7 (2026-11-13) runs the two fixes step 6 named, pre-registered: a 2018 weekday profile and the night balance net of the 82 AMR meters (8.2% of district flow). Together they halve the night-to-night spread to 5.1 m³/h, yet the combined statistic still detects 3 of the 9 small leaks (AMR-net alone: 6 of 9, median delay 473 h): H4 refuted again. The ground-truth leak flows show why: five of the nine are ramps leaking under 0.5 m³/h for a week and 1.3 to 6 m³/h at day 30, invisible to any trailing-baseline statistic inside the 30-day match; and the pressure detectors were credited with four of them at the hour the leak carried 0.01 to 0.22 m³/h, chance matches rather than detections. A detection-only score should credit an alarm only once the leak's flow passes a stated level.

Step 8 (2026-11-13) rescores all six detectors, unchanged, under a pre-registered flow-gated match: an alarm counts for a leak only from the hour its own flow reaches φ = 1 m³/h (swept 0.5 to 5), with the chance level under the same rule. D1 falls to 11 of 19 (P = 0.319), LILA to 13 (P = 0.013, but 0.057 at 2 m³/h), and the AMR-net night flow rises to 15 of 19 with 3 false alarms (P = 0.001, below 0.005 at every gate).

Two of three written predictions failed. The swing is two or three leaks, from alarms before a ramp's gate and from which of two overlapping leaks an alarm credits: on L-Town the detection-only verdict depends on the matching rule, while the 300 m location score beats chance under every rule.

Step 9 (2026-11-13) rescores the six detectors under six matching rules (14, 30 or 60-day windows, with and without the 1 m³/h gate), chance recomputed under each. D1 beats chance (P < 0.05) under 2 of the 6 rules, night flow M1 under 4, M3 under the 3 gated ones, LILA under all 6 but only 2 after a Holm correction across the six detectors; the 300 m location score beats chance under all 6. At the primary rule no pair of detectors differs on the 19 leaks (exact sign tests, smallest Holm-adjusted P 0.59; M3's 4-leak lead over D1 has a bootstrap interval of 0 to +8). Three of four pre-registered predictions held. A detection-only comparison on BattLeDIM needs its rule, its chance level, a multiplicity correction and a paired test stated, and more leaks than one test year provides.

Step 10 (2026-11-13) cross-fits the thresholds: each detector's grid is re-selected on 2019 by the same rule and scored once on 2018's 13 leaks, then pooled with the forward fold for 32 held-out leaks. Five of six thresholds move with the tuning year. Under the gated rule no pooled count survives a Holm correction across the six detectors (smallest 0.27); M3, 15 of 19 in 2019, finds 6 of 13 in 2018 against 8 for D1 and 9 for LILA.

Ungated, LILA's 24 of 32 survives (Holm P = 0.024). No pair of detectors differs on the 32 leaks (smallest Holm-adjusted P 0.86). Three of four pre-registered predictions held; the one that failed was that M3 would beat chance after correction.

Step 11 (2026-11-13) localises leaks with WNTR sensitivities on the nominal L-Town model (782 junctions, 24 h mean pressure change at the 33 sensors, best Pearson correlation with the residual): 31% of D1's and 36% of LILA's detected 2019 leaks fall within 300 m (pre-registered H3 inconclusive), and 47% of all 32 leaks localised at half-peak flow, about ten times what a random junction scores (4%). The sensor whose pressure fell most does as well (13 of 32; paired P = 0.75), so the uncalibrated nominal model adds nothing on this benchmark; slow-ramp leaks are 0.6 to 2.8 km off for every method.

Step 12 (2026-11-14) tries the two textbook fixes, hour-by-hour signatures (4,692 EPANET runs) and a leak size from the inflow balance: they put 12 of 32 leaks within 300 m against step 11’s 15 and the sensor’s 13, so H3 is refuted under the pre-registered primary (23% and 29%). The inflow balance sizes only 12 of 32 leaks within a factor of 2, and the nominal model’s tank-level pump control adds a 0.9 m artefact at one hour of the day.

Step 13 (2026-11-14) reimplements SICAMS (Melnikov 2025) and scores the paper’s own published detection times on the same harness: 13 of the 19 new 2019 leaks at 27 alarms against a chance median of 10 (P = 0.057; 14 at P = 0.026 with its one stated false alarm added), with 9 within 72 h (P < 0.001). An automatic SICAMS, tuned on 2018 by rule, detects 13 with 26 false alarms (P = 0.82): one false alarm in 2018 becomes 26 in 2019 as leaks pile up; its alarming sensor is within 300 m for 5 (P < 0.001).

Step 14 (2026-11-14) simulates the leak-free network from L-TOWN_Real.inp, the organisers’ generating model: it reproduces the published pressures to their 0.01 m rounding (the data carry no sensor noise), and on it the frozen pressure detectors raise 0 (D1-F) and 1 (LILA-auto) alarms in 716 days against 26 each on the real data, while the night-flow detectors raise as many as before (M3 31 against 29), and M3’s leak-free alarms are credited with 14 of the 19 new 2019 leaks, so its earlier detection scores carry no evidence; one deterministic history, without demand uncertainty.

Step 15 (2026-11-15) localises the 32 leaks on the oracle residual (published minus leak-free pressure, taken against each leak’s pre-onset level): the nominal-model signatures put 16 of 32 within 300 m against 15 on step 11’s regression residual (paired P = 1.0) and 14 for the most-affected sensor (P = 0.73), though the best signature correlates with the true leak effect at a median r = 0.97; without the pre-onset baseline the overlapping leaks swamp it (2 of 32).

Every leak shows at some sensor within a median 0 h of onset (at most 20 h), while the pressure CUSUM and LILA alarmed a median 104 and 138 h after onset: the residual limits detection delay. Oracle bounds, not methods.

Step 16 (2026-11-15) localises with the generator’s own model, L-TOWN_Real.inp, restarted on each leak’s day with its true tank and pump state and the leak’s true size (25,056 EPANET runs): 15 of 32 within 300 m, against 16 for the nominal model and 14 for the most-affected sensor (P = 1.0 for both); all five pre-registered predictions failed. Post hoc, abrupt leaks localise 11 of 15 with any method and incipient leaks 4 of 17: a slow leak reaches half its peak a median five weeks after onset, by which time other leaks’ flows have changed by 2.7 times its own, so its residual is mostly other leaks. This withdraws step 15’s reading that the nominal model limits localisation; the residual does.

Step 17 (2026-11-15) tests that reading: every leak pipe of L-TOWN_Real.inp is split at its midpoint and draws its published flow, which reproduces the published pressures exactly (median difference 0.0000 m), so published minus the replay without the target leak is that leak’s own effect. On it the generator’s-model localiser puts 27 of 32 within 300 m (median error 56 m; 14 gained and 2 lost against step 16, P = 0.004), incipient leaks 14 of 17, the nominal model at a fixed 5 m³/h 28 of 32 and the most-affected sensor 20 (P = 0.065); four of five pre-registered predictions held. An oracle bound: the open problem is a residual a utility can compute that removes the other leaks.

Step 18 (2026-11-15) tries the simplest such residual, with no model and no leak list in it: the 24 h mean pressure from the leak’s localisation hour minus the same hours a week earlier. The nominal model puts 12 of 32 within 300 m (abrupt 8 of 15, incipient 4 of 17), no better than the regression residual’s 15 (P = 0.45) or the most-affected sensor’s 12, and 16 short of the oracle; removing demand change with the leak-free model does not help (11), and lags of 24, 72 and 336 h give 8 to 12.

Three of five pre-registered predictions failed. Over a week the other leaks’ flows change by about as much as a slow leak’s own (median 2.7 against 2.3 m³/h), and only a third of the slow leak’s own change is left in the window: no lag separates them.

Step 19 (2026-11-16) models the other leaks instead: a non-negative greedy fit of the leaks’ pressure effect over the 782 nominal signatures, refitted a week later from the same atoms, placing the leak at the junction whose fitted flow rose most. It also finds 11 of 32 (slow leaks 1 of 17); four of five predictions failed. The fit leaves only 4.6% of the signal, and, seen after the run, its atoms land within 300 m of 10 of the 17 slow leaks against 5.5 by chance (P = 0.016): the slow leak is found, but a one-week rise cannot tell it from the others.

Step 20 (2026-11-16) tracks the fit day by day on a residual a utility could compute from its own data (a regression frozen on 2018’s first two weeks), dates each fitted source by the day it entered and places a new leak at the newest one: 8 of 32 within 300 m (slow leaks 2 of 17), below the one-week rise on the same residual (14; P = 0.15). Five of six predictions failed: the tracker keeps a median 20 sources active and starts a new one every three to four days, so the newest is rarely the leak.

Step 21 (2026-11-16) runs that tracker unchanged on the demand-oracle residual (published pressure minus the generator’s leak-free run): a median 8 sources active instead of 20, 13 of 32 within 300 m (slow leaks 3 of 17) and 9 of the 17 slow leaks given a source dated to their own start (4 before). Five of six predictions held, but the gain over the data-only residual is not significant on 32 leaks (P = 0.27): the residual’s drift, not the dating rule, sank step 20, and slow leaks’ sources enter a median 18 days late.

Step 22 (2026-11-16) keeps that tracker and picks, among sources dated within the last 30 days, the one whose fitted flow rose fastest over two weeks: 14 of 32 within 300 m and 6 of the 17 slow leaks (newest source: 3), but 8 of 15 abrupt leaks against 10 (likely because a burst’s source jumps once and goes flat; not yet tested). Two of five predictions held; the net gain is one leak (P = 1.0), and the two rules together hit 18 of 32.

Step 23 (2026-11-17) fits each recent source’s flow with a step or a ramp and picks the one whose change is timed nearest the alarm: every slow leak’s nearby source is fitted as a ramp (8 of 8), but the rule finds 13 of 32 and 3 of the 17 slow leaks, the newest-source result again, because a still-rising ramp’s half-level day falls days before the alarm. Three of five predictions failed; the shape label, not the timing, is what to use next.

Step 24 (2026-11-17) lets the fitted shape choose: the steepest fitted ramp when one exists, else the newest source, finds 15 of 32 (6 slow leaks, 9 bursts), but in-sample.

Step 25 (2026-11-17) tests it out of sample on 64 new leaks simulated through the generator’s model and added to the published pressures: 25 of 64 within 300 m against 16 for the newest source (11 against 2 discordant, P = 0.022; chance 2.1), with 13 of 37 slow leaks against 5. All six pre-registered predictions held; the residual still removes demand with the generator’s model, and the alarm hour is still an oracle.

Step 26 (2026-11-17) removes the time oracle: the project’s own pressure detector (D1, thresholds frozen from 2018) alarms, then the same rule localises at the alarm day. On the 30 of 64 injected leaks it detects, the rule places 8 within 300 m at the alarm day against 15 at the oracle day (P = 0.065), still far above chance (1.0 expected, P = 4e-6); on the 10 real 2019 leaks it detects, 2 against 6. End to end, detect-then-localise places 8 of 64 injected and 2 of 19 real 2019 leaks.

Four of six predictions failed. A sweep after the run shows why: moving the oracle day by one day costs 2 to 6 hits, so steps 21 to 25 were tuned to an exact day no detector supplies.

Step 27 (2026-11-19) re-times the rule to the alarm: of 17 rules (a lag or a vote over days around the alarm), the best on 2018’s detected leaks, a vote over the four days before the alarm, places 4 of the 22 detected 2019 leaks within 300 m against 3 at the alarm day and 12 at the oracle day (chance 0.8); three of five predictions held, but the rules’ ranking does not carry from 2018 to 2019 (Spearman 0.09), so the oracle day’s advantage is leak-specific timing and the next detector runs on the residual, where leaks show within hours.

Research log

Ongoing: each run adds a batch and an entry, newest first. Source: LOG.md.

2026-11-19 · Step 27 outcome: the 2018-selected vote over the four days before the alarm places 4 of 22 detected 2019 leaks against 3 at the alarm day and 12 at the oracle day; (a), (c) and (e) held, (b) and (d) failed, and the rules' ranking does not carry from 2018 to 2019 (Spearman 0.09)

Show 47 earlier entries

2026-11-19 · Step 27 plan (re-time R30 to the alarm, not the half-peak hour: a lag or a vote over days around the detector's alarm, chosen on 2018 leaks only and tested on 2019; milestone 3, H3), written before R30 was run at any day other than step 26's alarm and oracle days

  • Why now. Step 26 found that R30 run on the day D1-L alarms keeps 8 of its 15 oracle-day hits on the detected injected leaks and 2 of 6 on the real 2019 ones, and its outcome named the next test first: "a rule defined relative to the alarm's meaning, not the half-peak hour: e.g. score candidates over a window of days around k<sub>al</sub> ... set on 2018 leaks (real and injected) only and tested on 2019 and the injected 2019 leaks". The pipeline's remaining time oracle is gone only if a rule that sees nothing but the alarm day recovers what the oracle day gave.
  • Seen before writing this. Steps 1 to 26's results, including step 26's per-leak table (alarm day, oracle day, R30 at both) and its post-hoc sweep of R30 at the oracle day ± δ on all leaks (a sharp peak at δ = 0). From that table, counted before writing the predictions: on D1-L's detected leaks, the 2018 tuning set is 28 (10 real, 18 injected; R30 at the alarm day 8, at the oracle day 14) and the 2019 test set is 22 (10 real new 2019 leaks, 12 injected; at the alarm day 3, at the oracle day 12). No R30 pick at any day k<sub>al</sub> + δ with δ ≠ 0 has been computed.
  • Unchanged. Step 26's detector (D1-L, h = 80, step 1's thresholds; D1-F as a reference), its matching, step 21's tracker on D (real leaks) and step 25's trackers on D<sub>inj</sub> (the eight injected sets), step 24's localise.shape_chosen (R30, window 30), the 300 m rule along the pipes and step 25's chance p<sub>i</sub>. A leak's year is its start year (injected leaks span both years).
  • Rule grid (17 rules), every one a function of k<sub>al</sub> and the tracker only. Lδ: R30's pick on day k<sub>al</sub> + δ, δ ∈ {−7, −4, −2, −1, 0, +1, +2, +4, +7} (a positive δ means waiting δ days after the alarm before localising, which a utility can do). V[a, b]: R30's pick on every day from k<sub>al</sub> + a to k<sub>al</sub> + b, and the node picked on the most days (ties to the pick of the latest such day), for [a, b] ∈ {[−7, 0], [−4, 0], [−2, 2], [−4, 4], [0, 4], [0, 7], [−7, 7], [2, 7]}. L0 is step 26's rule.
  • Selection, on 2018 only. The rule with the most hits on the 28 detected 2018 leaks (real and injected pooled); ties to an L rule before a V rule, then the smaller |δ| (larger δ on equal |δ|) or the shorter window (earlier start on equal length). The selected rule, S, is frozen before any 2019 score is printed; the run computes 2019 scores only after writing S to results.txt.
  • Predictions on the 22 detected 2019 leaks, to be reported held or failed. (a) S has more hits than L0 (more than 3). (b) S has at least 8 hits (half the gap to the oracle day's 12). (c) S beats chance at P < 0.01 (Poisson-binomial). (d) S beats L0 at P < 0.05 (exact sign test on 300 m hits; expected to fail for power). (e) S keeps at least half its 2018 gain over L0 per leak: (S − L0)<sub>2019</sub>/22 ≥ 0.5 (S − L0)<sub>2018</sub>/28. Also reported, no verdicts: every rule's 2019 hits next to its 2018 hits (and the rank correlation between them), the real and injected parts apart, end-to-end counts (detected and within 300 m, of all 2019 leaks), and D1-F with the same S.
  • Reading fixed now. (a), (b) and (e) holding: the oracle day's advantage is a timing offset a frozen lag or vote recovers, and the detect-then-localise pipeline's figure becomes S's end-to-end count; the remaining oracle is the residual D. (a) holding with (b) failing: re-timing helps but most of the oracle day's advantage is information the alarm does not carry (the half-peak day is leak-specific), which points to a detector on D whose alarm sits at a fixed point of the leak's rise. (a) failing: no fixed offset from D1-L's alarm carries over from 2018 to 2019, and the alarm's timing scatter (−43 to +21 days) is the limit. (e) failing with (a) holding: S's 2018 gain was mostly selection.
  • Caveats fixed now. D and D<sub>inj</sub> still remove demand with the generator's model (an oracle). 28 and 22 leaks give little power, and the injected leaks of both years share the eight trackers. The real 2018 leaks are where D1's threshold and the tracker's settings were set, so the tuning set is not clean of earlier choices; the 2019 test set is clean of this step's choice only.

2026-11-17 · Step 26 outcome: at the detector's alarm day R30 keeps about half of its oracle-day hits (injected 8 against 15 of the 30 D1-L detects, P = 0.065; real 2019 leaks 2 against 6 of 10); (b) and (c) held, (a), (d), (e) and (f) failed. A sweep after the run shows the oracle day is a sharp optimum: one day off costs 2 to 6 hits

  • Ran as planned. The first launch stopped before any estimate was computed (multiprocessing could not pickle step 25's _simulate from a file-loaded module); a copy of it defined in this script, writing the same cache files, fixed that. One run then produced the registered output (about 5 minutes on 4 cores, step 25's eight simulations rebuilt from a cold cache). It asserts that both D1 variants reproduce step 1's recorded 2019 alarms exactly, that R30 at the oracle day rebuilds step 24's error on every real leak and step 25's on every injected one. No setting was changed after output was seen.
  • Arm B, injected leaks, D1-L (primary). Detected 30 of 64 (abrupt 13 of 27, incipient 17 of 37), alarm day minus oracle day median −2 days (−43 to +21; 17 early, 12 late); 30 false alarms over the 8 sets; real leaks detected 157 of 256 leak-sets. On the 30: R30 at the oracle day 15, at the alarm day 8 (chance 1.0, P = 4e-6), T-D at the alarm day 7. Paired, alarm against oracle day: 2 against 9 (P = 0.065). End to end 8 of 64. D1-F (reference): 31 detected; R30 14 at the oracle day, 10 at the alarm day, T-D 9; end to end 10 of 64.
  • Arm A, real leaks. D1-L on the new 2019 leaks: 10 of 19 detected (step 1's figure), alarm median 4 days after the oracle day; R30 6 at the oracle day, 2 at the alarm day (P = 0.059 against chance 0.41), T-D 2. D1-F: 13 detected, R30 5 against 2. LILA-auto's recorded alarms: 14 detected, R30 6 against 2, T-D 4. End to end every detector places 2 of the 19. In 2018 (the tuning year): D1-L 10 of 13 detected, R30 5 against 1; D1-F 9, 5 against 0.
  • Predictions. (a) alarm-day R30 at least 80% of oracle-day on the detected injected leaks: failed (8 against 15, bar 12). (b) beats chance at P < 0.001: held (P = 4e-6). (c) more hits than T-D at the alarm day: held, barely (8 against 7; 2 against 1 discordant). (d) at least 15 of 64 end to end: failed (8). (e) real 2019, at most one fewer: failed (2 against 6). (f) more than half the lost leaks alarmed early: failed (5 of 14; the losses come from both sides).
  • Post hoc, declared after the registered output was read, no verdicts. R30 at the oracle day shifted by δ days, on all leaks: injected (of 64) 7, 14, 14, 11, 19, 25, 22, 21, 20, 17, 16 and real (of 32) 2, 5, 2, 6, 13, 15, 10, 11, 8, 6, 8 for δ = −14, −7, −4, −2, −1, 0, +1, +2, +4, +7, +14. The oracle day is a sharp peak, sharper on the real leaks the rules were developed on (15 to 10 at +1, to 6 at −2) than on the held-out ones (25 to 22 and 19). Likely reasons, not tested here: a day early, the leak's source may not yet be active or fitted as a ramp; days late, newer sources enter the 30-day window.
  • What it changes. By the plan's fixed reading, (b) holding with (a) failing: R30 still places leaks at an alarm day, far above chance, but loses about half to the timing, so the half-peak day had been doing part of the work in steps 21 to 25. Their localisation figures are upper bounds for a pipeline, not a pipeline's figures, and the end-to-end number a utility would see on this residual is 8 of 64 injected and 2 of 19 real 2019 leaks. T-D loses about as much (it, too, was scored at the oracle day). Next: (1) a rule defined relative to the alarm's meaning, not the half-peak hour: e.g. score candidates over a window of days around k<sub>al</sub>, or the source whose dated onset is nearest a fixed lag before the alarm, set on 2018 leaks (real and injected) only and tested on 2019 and the injected 2019 leaks; (2) the detector itself on D instead of on the raw pressures (D's leaks are visible within hours, step 15), which would make the alarm day close to onset and stable; (3) the data-only residual, still open.
  • Output: experiments/step26-alarm-timed/results.txt, leaks.tsv, alarm_timed.svg.

2026-11-17 · Step 26 plan (a detector's alarm in place of the oracle half-peak hour: D1 detects, then step 24's R30 localises at the alarm day, on the real leaks and on step 25's 64 injected leaks; milestone 3, H3), written before R30 was run at any alarm day

  • Why now. Steps 15 to 25 localise at day k = t div 24 + 1 with t the oracle hour at which the leak's own flow first reaches half its peak, a time no utility has. Step 25's outcome named the replacement: "(2) a detector's alarm in place of the oracle half-peak hour". R30 uses only the day, so the change is one input. The question is what the oracle timing was worth: does R30 still place leaks when it is run on the day a real detector alarms (days early for some slow leaks, days late for others), and how many leaks a detect-then-localise pipeline places end to end.
  • Seen before writing this. Steps 1 to 25's results, including step 1's recorded 2019 alarms (D1-F h = 240: 13 of 19 new 2019 leaks; D1-L h = 80: 10 of 19; LILA-auto: 14) and their hours next to the oracle hours (alarms fall from 13 days before to 46 days after t). R30 at the oracle day hits 8 of the 19 new 2019 leaks (step 24). No estimate at any alarm day has been computed, and no detector has been run on an injected residual.
  • Detectors, frozen. Step 1's D1 (detect.detect_sequential, W = 14, g = 7, wmin = 7, k = 0.5), both variants at the thresholds step 1 selected on 2018: D1-L (hour-of-week + tank level, h = 80) and D1-F (+ the three inlet flows, h = 240). Matching is step 1's (score.match: an alarm counts for the running, unmatched leak with the latest onset within 30 days of it). Primary detector D1-L, because in arm B its regressors (the published tank level) are the less contaminated: the injected leaks' own inflow is not in the published inlet flows, so D1-F would regress pressure on flows that miss the leak, which is not what it would see in the field.
  • Arm A, the real leaks. D1-L and D1-F rerun on the published hourly pressures over both years (the run asserts that their 2019 alarms equal step 1's alarms.tsv), matched against the 33 events; LILA-auto's recorded 2019 alarms as a reference. For every detected leak among step 24's 32, R30 and T-D at k<sub>al</sub> = (alarm hour index) div 24 + 1 on step 21's tracker on D, unchanged. Primary set: the new 2019 leaks (the scored year; 2018 is where h was tuned, reported apart).
  • Arm B, the injected leaks. Step 25's eight sets, unchanged (cached simulations). For each set the hourly published-plus-injected pressures X<sub>h</sub> (step 25's, before subtracting the leak-free run) go through D1-L and D1-F with the published regressors; alarms are matched against the union of the 33 real events and the set's 8 injected ones (onset = start hour, end = end hour). For each detected injected leak: R30 and T-D at k<sub>al</sub> on step 25's tracker on D<sub>inj</sub>, and R30 at the oracle day (step 25's figure; the run asserts it).
  • Scores. Hit = within 300 m along the pipes; chance p<sub>i</sub> as in step 25 (Poisson-binomial). Paired: R30 at k<sub>al</sub> against R30 at the oracle k on the same detected leaks (exact sign test). End to end: detected and within 300 m, of all leaks.
  • Predictions, to be reported held or failed. (a) Arm B, D1-L: on the injected leaks it detects, R30 at k<sub>al</sub> hits at least 80% as many as R30 at the oracle k on the same leaks. (b) Arm B, D1-L: R30 at k<sub>al</sub> beats chance on the detected injected leaks at P < 0.001. (c) Arm B, D1-L: R30 at k<sub>al</sub> has more hits than T-D at k<sub>al</sub>. (d) Arm B, D1-L, end to end: at least 15 of the 64 detected and within 300 m. (e) Arm A, D1-L, new 2019 leaks it detects: R30 at k<sub>al</sub> within one hit of R30 at the oracle k (at most one fewer). (f) Arm A and B pooled, D1-L: the leaks R30 loses by the change of day (oracle hit, alarm miss) are mostly ones alarmed before the oracle day (more than half).
  • Reading fixed now. (a) and (b) holding: the oracle hour was not what made R30 work; the pipeline's remaining oracle is the residual D, and detection rate bounds the end-to-end figure. (a) failing with (b) holding: R30 still places leaks at an alarm day but loses a fifth or more to the timing, so the rule needs retuning to an alarm's meaning (first visible, not half-peak), e.g. a window relative to k<sub>al</sub>, on 2018 leaks only. (b) failing: the localisation results of steps 21 to 25 depend on the oracle time and do not carry into a pipeline as they stand. (f) holding points to early alarms on slow leaks (the source has not entered the tracker yet); failing, to late ones (newer sources crowd it).
  • Caveats fixed now. D and D<sub>inj</sub> remove demand with the generator's model (an oracle), so this removes only the time oracle. In arm B the regressors (tank level, inlet flows) are the published ones and miss the injected leaks' effect, which makes those leaks easier to see than in the field (worse for D1-F); the run reports arm B's detection rate next to arm A's. D1's thresholds were set on 2018 with only the real leaks. Alarms matched to no leak (false alarms) get no score; their count and R30's pick are reported. 19 real 2019 leaks give little power, so arm B carries the verdicts (a) to (d).

2026-11-17 · Step 25 outcome: held out on 64 injected leaks, step 24's rule places 25 within 300 m against the newest source's 16 (11 against 2 discordant, P = 0.022); all six predictions held

  • Ran as planned, one run (about 3 minutes on 4 cores for the eight two-year EPANET runs after step 24 had been rebuilt from a cold cache in 4.4 minutes, reproducing its results byte for byte). The run asserts that it rebuilds step 24's R30, T-D, S30 and C30 errors on the 32 real leaks. Before the run, a 3-day check showed simulate.run_injected with no leak active reproduces run_year exactly (max difference 0.0 m) and that a 15 mm orifice at 49 m leaks 14.8 m³/h. No setting was changed after output was seen.
  • Leak sizes. Injected peak hourly flow median 16.2 m³/h (4.0 to 34.9) against 15.7 (5.1 to 35.4) for the 33 published leaks, so the assumed discharge coefficient 0.75 gives leaks of the published size. 27 abrupt and 37 incipient.
  • Within 300 m, of 64 (chance 2.13): R30 25 (P = 7e-21; median error 475 m; abrupt 12 of 27, incipient 13 of 37). T-D 16 (11, 5); S30 21 (9, 12); C30 19 (11, 8). Paired: R30 against T-D 11 against 2 (P = 0.022); against S30 6 against 2 (P = 0.29); against C30 8 against 2 (P = 0.11); S30 against T-D 9 against 4 (P = 0.27). Per set R30 [3, 4, 3, 3, 2, 4, 2, 4], T-D [2, 2, 1, 3, 1, 3, 2, 2].
  • Predictions. (a) beats chance at P < 0.001: held. (b) at least 19: held (25). (c) more hits than T-D: held. (d) beats T-D at P < 0.05: held (0.022). (e) incipient share above T-D's: held (0.35 against 0.14). (f) abrupt at most 3 below T-D: held (12 against 11).
  • Variants, no verdicts. R30-S 25, R30-L 24, R14 22, R60 28 (abrupt 13, incipient 15). R60 is the best variant here and tied R30 in step 24; it was not the primary and is not adopted on this evidence (a further held-out set would be needed).
  • Where it works (seen after the run). A source within 300 m is active on day k for 34 of 64; for 23 it fits as a ramp, and R30 is within 300 m for 21 of those 23. The 21 leaks with no ramp candidate get T-D's pick by construction (4 hits). 30 of 64 have no candidate within 300 m at all: the tracker, not the rule, sets the ceiling.
  • Control (seen after the run, no verdict). The 32 real leaks on each set's tracker: R30 [7, 15, 11, 13, 7, 15, 12, 6], T-D [5, 8, 6, 11, 8, 10, 11, 6] (on D alone 15 and 13). Eight more leaks per two years crowd the tracker enough to move the real leaks' count by up to 9, so every figure here is tied to the leak density.
  • What it changes. By the plan's fixed reading, (c) and (d) holding make step 24's gain out of sample: R30 replaces T-D as the tracker's estimate on D. Next: (1) a data-only residual as clean as D (AMR demands as regressors, or a rolling regression), tracked and scored with R30 frozen, on the real and the injected leaks; (2) a detector's alarm in place of the oracle half-peak hour; (3) the injection harness (simulate.run_injected) as the power source for any later paired test, and for milestone 5's null.
  • Output: experiments/step25-heldout/results.txt, leaks.tsv, real_control.tsv, heldout.svg.

2026-11-17 · Step 25 plan (held-out check of step 24's shape-chosen rule: 64 new leaks simulated through L-TOWN_Real.inp and added to the real residual D; milestone 3, H3), written before any injected leak was simulated

  • Why now. Step 24's rule (the steepest fitted ramp among the recently dated atoms, else the newest; R30) placed 15 of 32 within 300 m, against 13 for step 21's newest-atom rule T-D, but it was named after step 23's per-leak shapes on the same 32 leaks and the paired test had no power (3 against 1, P = 0.63). Its outcome named the next test: "the same rule with every setting frozen, on simulated leak years from L-TOWN_Real.inp (new leaks, so the rule is out of sample and a paired test has power)".
  • Seen before writing this. Steps 1 to 24's results, the 33 leaks of dataset_configuration.yaml (type, diameter, start, peak, end) and, to fix the growth law below, the published flows of four 2018 incipient leaks at the middle of their rise: 0.250 to 0.257 of the peak flow, so the leak diameter grows linearly and the area (and flow) with the square of time. No leak has been injected and no tracker run on an injected residual.
  • Design (injection into the real residual). Eight sets (seeds 1 to 8) of eight leaks, 64 in all. Each leak resamples one of the 33 configured leaks with replacement and keeps its type, diameter d, rise R (start to peak) and duration (start to end; a leak that runs to the end of 2019 runs to the end of the run). Its start is drawn uniformly (5-minute grid) so that it falls on or after the first scored hour of steps 21 to 24 and its peak at least one day before the end of 2019. Its node is drawn uniformly among the junctions more than 300 m along the pipes from every real leak pipe's midpoint and from the set's other injected nodes, so no hit can come from a real leak's atom. The leak is an EPANET emitter at that node with coefficient C(t) = 0.75 π d²/4 √(2g) × 3600 (m³/h per m<sup>0.5</sup>, an orifice with discharge coefficient 0.75; not checked against BattLeDIM's generator, so the run reports the injected peak flows next to the 33 published ones) times the shape: 1 from start to end for an abrupt leak, ((t − start)/R)² up to the peak and 1 after it for an incipient one. Each set is one continuous two-year run of L-TOWN_Real.inp (as step 14's), the coefficients updated every 5 minutes. The injected residual is D<sub>inj</sub> = D + hourly(round(P<sub>real</sub> + P<sub>inj</sub> − P<sub>free</sub>, 0.01 m) − P<sub>real</sub>), i.e. the published pressures carry the new leaks' simulated effect on top of their own leaks, demand mismatch and rounding. The leak's flow is C(t) √p at its node (the injected run's pressure); its alarm hour t is the first hour at half its peak hourly flow, as for the real leaks, and day k = t div 24 + 1.
  • Frozen. Step 21's tracker on daily D<sub>inj</sub> (localise.track, nominal L-TOWN.inp q = 5 signatures, active 0.5 m³/h, gap 2 days, link 0.95) and step 24's localise.shape_chosen exactly. Primary R30 (window 30 days, fit 30 days, ramp by fitted slope). References: T-D (latest onset), S30 (step 22's steepest 14-day slope), C30 (step 23's shape-timed, with the injected leak's own t). Variants, no verdicts: R30-S, R30-L, R14, R60. Score: along-pipe distance from the injected node to the estimate node, hit within 300 m; chance p<sub>i</sub> = the share of junctions within 300 m of the node, Poisson-binomial over the 64. A control, no verdict: the 32 real leaks scored by each rule on each set's tracker (does adding 8 leaks change their results?).
  • Predictions, to be reported held or failed. (a) R30 beats chance on the 64 at P < 0.001. (b) R30 puts at least 19 of 64 (30%) within 300 m (in sample: 47%). (c) R30 has more hits than T-D. (d) R30 beats T-D at P < 0.05 (exact sign test on 300 m hits). (e) On the injected incipient leaks R30's hit share exceeds T-D's. (f) On the injected abrupt leaks R30 has at most 3 fewer hits than T-D.
  • Reading fixed now. (c) and (d) holding: the shape-chosen rule's gain is out of sample, and R30 replaces T-D as the tracker's estimate on D; the open problem is again a data-only residual as clean as D. (c) holding with (d) failing: the direction replicates but 64 leaks cannot separate the rules; report the pooled estimate and keep both. (c) failing: step 24's gain was in-sample, and T-D stays the reference. (a) or (b) failing: injected leaks on the real residual are harder than the real leaks were (the tracker's settings were chosen on those), which itself bounds the earlier steps' figures.
  • Caveats fixed now. D removes demand with the generator's model (an oracle), and t is an oracle half-peak hour; injected leaks sit at junctions (BattLeDIM's sit on pipes); the emitter's discharge coefficient is assumed, so their sizes may differ from the published leaks'; the additive injection ignores the interaction between new and real leaks' pressure drops (second order at these flows); the resampled shapes come from the same 33 leaks the earlier steps were tuned on, but their places and times are new.

2026-11-17 · Step 24 outcome: letting the fitted shape choose the score (steepest fitted ramp among the recently dated atoms, else the newest) localises 15 of 32 within 300 m, slow leaks 6 of 17 and bursts 9 of 15; four of five predictions held, but the rule is in-sample and level with D1

  • Ran as planned, one run (seven seconds once step 22 had been rerun from a cold cache, including L-TOWN_Real.inp from Zenodo; that rerun reproduced step 22's results.txt and leaks.tsv byte for byte, and this run asserts that its rebuilt tracker gives step 23's C30 error for every leak). No setting was changed after output was seen. The plan's ceiling counts were corrected by a recount from step 23's table before the run (committed separately).
  • Within 300 m, of 32 (chance 1.40): R30 15 (P < 0.0001; median error 417 m; abrupt 9 of 15, incipient 6 of 17). References: C30 13, S30 14 (8, 6), T-D 13 (10, 3), D1 15 (10, 5), one-leak oracle 28. Paired: against T-D 3 against 1 (P = 0.63); against S30 5 against 4 (P = 1.0); against C30 4 against 2 (P = 0.69); against D1 7 against 7 (P = 1.0); against the oracle 1 against 14 (P = 0.001).
  • Predictions. (a) more than 14: held (15). (b) at least 6 of 17 incipient: held (6). (c) at least 9 of 15 abrupt: held (9). (d) of the 13 leaks with a ramp candidate within 300 m, at least 9 within 300 m: held (11). (e) beats T-D at P < 0.05: failed (P = 0.63).
  • Variants, no verdicts. R30-S (ramp by 14-day least-squares slope) 15 (abrupt 7, incipient 8); R30-L (by day-k level) 14 (7, 7); R14 13 (9, 4); R60 15 (8, 7). Ranking the ramps by slope matters less than having the label: every variant that ranks ramps lands at 14 or 15.
  • Where it moves (seen after the run). 17 leaks have a ramp candidate (R30 hits 11, T-D 9); on the 15 with none R30 is T-D (4 hits) by construction. R30 hits two slow leaks no earlier tracker rule placed (p461, p653), loses one burst to a slow ramp elsewhere (p514), and misses two bursts S30 hits (p866, p142), both with no ramp candidate. R30 hits 13 of the 18 that S30 or T-D hit, plus those 2.
  • What it changes. By the plan's fixed reading, (a), (b) and (c) holding make the shape-chosen rule the best tracker estimate on D, so the open problem is again the residual: a data-only residual as clean as D. Two cautions hold it short of a method claim: it was named after step 23's per-leak shapes on the same 32 leaks (in-sample), and 15 ties D1's plain regression residual on 32 leaks with nothing significant. Next: (1) a held-out check, the same rule with every setting frozen, on simulated leak years from L-TOWN_Real.inp (new leaks, so the rule is out of sample and a paired test has power); (2) a data-only residual as clean as D, tracked the same way; (3) for the 15 leaks with no ramp source, which are mostly bursts and slow leaks the tracker never dates, a detector's alarm list in place of the newest-onset fallback.
  • Output: experiments/step24-shape-chosen/results.txt, leaks.tsv, shape_chosen.svg.

2026-11-17 · Step 24 plan (on D, let the fitted shape choose the score: the steepest-rising fitted ramp among the recently dated atoms when there is one, otherwise the newest; milestone 3, H3), written before any output of this rule was computed

  • Why now. Step 23 found that a step-or-ramp fit labels every slow leak's nearby source a ramp (8 of 8) while candidates are mostly steps (a median 1 ramp among 6), but that timing each change against the oracle alarm only brought back the newest-source rule (13 of 32, slow leaks 3). Its outcome named this test, to be registered before it is run: "the steepest ramp when a ramp candidate exists and the newest step otherwise". It needs no alarm time beyond the day k, so it removes the part of step 23 that failed (half-level timing against a half-peak hour).
  • Seen before writing this. Steps 1 to 23's results, including step 23's per-leak table: for each leak the number of candidates, how many fit as ramps, the near candidate's fitted shape and which shape C30 picked. From that table, before writing the predictions, this plan counted what the rule could at best reach: on the 15 leaks with no ramp candidate it equals T-D by construction (T-D hits 4 of 9 abrupt and 0 of 6 incipient there); on the 17 with a ramp candidate, the nearest candidate within 300 m is a ramp for 13 (8 incipient, 5 abrupt) and T-D hits 9. So, counting only those 13, the rule reaches at most about 4 + 13 = 17 of 32 (incipient at most 8). (These counts were first written as 18 and 14 leaks and corrected by a recount from the same table before any output of the rule existed.) No ramp's slope has been ranked and no pick of this rule computed.
  • Residual, tracker, candidates and fits, unchanged. Step 21's D and tracker exactly (localise.track, active 0.5 m³/h, gap 2 days, link 0.95), day k = t div 24 + 1, step 22's candidate set (atoms active on day k with onset in [k − 30, k]) and step 23's shape_fit on each candidate's daily flow over [k − 29, k].
  • Estimate (primary R30). If any candidate fits as a ramp, the ramp candidate with the largest fitted slope b (m³/h per day), ties by the larger flow on day k; otherwise the candidate with the latest onset, ties by flow (T-D's rule restricted to the candidates, which equals T-D whenever a candidate exists). No candidate: step 21's latest onset. Variants, no verdicts: R30-S, the ramp chosen by step 22's 14-day least-squares slope instead of b; R30-L, the ramp with the largest fitted level on day k, b (k − τ + 1); R14 and R60, onset windows of 14 and 60 days (fit window 30 days).
  • References, read from earlier leaks.tsv: step 23's C30 (13), step 22's S30 (14; abrupt 8, incipient 6), step 21's T-D (13; abrupt 10, incipient 3), step 11's D1 (15), step 17's one-leak oracle (28).
  • Predictions, to be reported held or failed. (a) R30 puts more than 14 of 32 within 300 m (beats S30, the best tracker rule so far). (b) R30 puts at least 6 of the 17 incipient leaks within 300 m (level with S30). (c) R30 keeps at least 9 of the 15 abrupt leaks. (d) Of the 13 leaks with a ramp candidate within 300 m, R30 picks a candidate within 300 m for at least 9. (e) R30 beats T-D at P < 0.05 (exact sign test on 300 m hits); expected to fail, as R30 can differ from T-D on at most 17 leaks.
  • Reading fixed now. (a), (b) and (c) holding: the shape label combines the two rules (S30's slow leaks, T-D's bursts) without an alarm time, the best data-driven tracker estimate on D; the open problem is again the residual, a data-only one as clean as D. (b) holding with (c) failing: a concurrent ramp still pre-empts bursts, and the choice needs a cost on ramps (a minimum slope or fit gain) set on 2018 leaks only. (b) failing: the steepest ramp is not the slow leak even when one is near (other leaks' ramps rise faster), and the route needs a detector's alarm list or a prior over atoms.
  • Caveats fixed now. D removes demand with the generator's model (an oracle); day k comes from the oracle half-peak hour; the rule was chosen after seeing step 23's per-leak shapes on the same 32 leaks, so any gain is an in-sample estimate that needs the 2018/2019 split or a new leak set before it is a method claim; 32 leaks give little power.

2026-11-17 · Step 23 outcome: a step-or-ramp fit gives every slow leak's nearby source a ramp shape (8 of 8), but timing each source's change against the alarm brings back the newest-source rule: 13 of 32 within 300 m, slow leaks 3 of 17 (step 22's steepest rise: 6); three of five predictions failed

  • Ran as planned, one run (step 22 rebuilt first from a cold cache, including L-TOWN_Real.inp from Zenodo, and reproduced its results.txt and leaks.tsv byte for byte; the run asserts its rebuilt tracker gives step 22's S30 error for every leak). No setting was changed after output was seen.
  • Within 300 m, of 32 (chance 1.40): C30 13 (P < 0.0001; median error 394 m; abrupt 10 of 15, incipient 3 of 17). References: step 22's S30 14 (abrupt 8, incipient 6), step 21's T-D 13 (10, 3), D1 15, one-leak oracle 28. Paired: C30 against T-D 1 against 1 (P = 1.0); against S30 3 against 4 (P = 1.0); against D1 5 against 7 (P = 0.77); against the oracle 1 against 16.
  • Predictions. (a) more than 14: failed (13). (b) at least 10 of 15 abrupt: held (10). (c) at least 6 of 17 incipient: failed (3). (d) the near candidate's shape matches the leak type for at least 15 of 20: held (15; incipient fitted ramp 8 of 8, abrupt fitted step 7 of 12). (e) beats T-D at P < 0.05: failed (P = 1.0).
  • Variants, no verdicts. C30-start (both shapes timed at their start) 12 (incipient 2); C30-step and C30-ramp (one shape for all) 13 each, the same leaks as C30; C14 14 (abrupt 11, incipient 3); C60 13. C30 hits 13 of the 18 leaks S30 or T-D hit, and no others.
  • Why it failed (seen after the run). The near source of a slow leak fits as a ramp whose half-level day falls a median 4.2 days before the alarm (range 1.1 to 14.5); a burst's near source is timed a median 0.4 days before it. On day k a slow leak is still rising, so half of its day-k level comes earlier than the half-peak hour t, which is half of a peak still ahead. The rule's timing therefore favoured whichever source entered last, and C30 is T-D with one leak swapped each way. The plan's half-level timing was meant to match t's definition; it matches only a ramp that has peaked. The five bursts fitted as ramps are sources one or two days old, where one or two non-zero days cannot tell a step from a ramp.
  • What it changes. By the plan's fixed reading, (d) holding with (a) failing says the shapes are right but timing them against the alarm does not separate the leak from concurrent changes. The shape label itself is informative: every slow leak's near source is a ramp, and candidates are mostly steps (a median 1 ramp among 6). The next estimate should use the shape to choose the score, not the timing: the steepest ramp when a ramp candidate exists and the newest step otherwise, registered before it is run. Timing against an alarm needs a detector's alarm, whose meaning (first visible) differs from the oracle's half-peak hour.
  • Output: experiments/step23-shape/results.txt, leaks.tsv, shape_timing.svg.

2026-11-17 · Step 23 plan (on D, fit each recently dated atom's flow with a step and a ramp, and pick the atom whose change is timed nearest the alarm; milestone 3, H3), written before any shape fit of a tracked atom was computed

  • Why now. Step 22 found that the steepest-rising dated atom triples the slow leaks found (6 of 17, against 3 for the newest atom) but loses 2 bursts (8 of 15, against 10), and that the two rules hit different leaks (18 of 32 together). Its plan's fixed reading was that the estimate should depend on the change's shape, a step for a burst and a ramp for a slow leak; its outcome named the test: "a shape test per candidate, step against ramp, fitted on the atom's flow since its onset, with the estimate the best-fitting change whose start is nearest the alarm".
  • Seen before writing this. Steps 1 to 22's results, including step 22's per-leak table (candidate count, near candidates, each rule's error). No step or ramp fit of any tracked atom's flow has been computed.
  • Residual, tracker and candidates, unchanged. Step 21's D and tracker exactly (localise.track, active 0.5 m³/h, gap 2 days, link 0.95), day k = t div 24 + 1 for the oracle localisation hour t, and step 22's candidate set: atoms active on day k with onset in [k − 30, k].
  • Shape fit. For each candidate, its daily fitted flow f(d) over d in [k − 29, k] (0 on a day it was not active). Two one-change models, each with a change day τ in that window and f̂ = 0 before τ: a step, f̂ = a for d ≥ τ, and a ramp, f̂ = b (d − τ + 1) for d ≥ τ, a and b non-negative and fitted by least squares for each τ. The candidate's shape is the model and τ with the smaller squared error (both have two parameters; ties to the step).
  • Change time. The alarm t is a half-peak hour, so each candidate's change is timed the same way: a step's change time is τ (it is at full size at once), a ramp's is the day it reaches half its fitted level on day k, τ − 1 + (k − τ + 1)/2.
  • Estimate (primary C30). The candidate whose change time is nearest the alarm day t/24, ties by the larger flow on day k; no candidate: step 21's latest onset. Variants, no verdicts: C30-start, the change time is τ for both shapes (start nearest the alarm, as step 22's outcome worded it); C30-step and C30-ramp, every candidate fitted with one shape only; C14 and C60, onset windows of 14 and 60 days (fit window unchanged at 30 days).
  • References, read from earlier leaks.tsv: step 22's S30 (14 of 32; abrupt 8, incipient 6), step 21's T-D (13; abrupt 10, incipient 3), step 11's D1 (15), step 17's one-leak oracle (28).
  • Predictions, to be reported held or failed. (a) C30 puts more than 14 of 32 within 300 m (beats S30). (b) C30 keeps at least 10 of the 15 abrupt leaks (T-D's count). (c) C30 puts at least 6 of the 17 incipient leaks within 300 m (S30's count). (d) Where a candidate within 300 m exists (20 leaks), the nearest such candidate's fitted shape matches the leak's type (step for abrupt, ramp for incipient) for at least 15 of them. (e) C30 beats T-D at P < 0.05 (exact sign test on 300 m hits).
  • Reading fixed now. (a), (b) and (c) holding: timing each atom's change by its own shape combines the two rules, and the open problem is again the residual (a data-only D) and the oracle t. (d) holding with (a) failing: the shapes are right but timing them against the alarm does not separate the leak from concurrent changes of the same shape, and the route needs a detector's alarm list or a prior. (d) failing: on daily fitted flows the tracker's atoms do not carry their leak's shape (absorbing atoms and handovers between neighbouring junctions break it), so a shape test needs the hourly residual or the linked track rather than one atom.
  • Caveats fixed now. D removes demand with the generator's model (an oracle); t is the oracle half-peak hour, and timing ramps at their half level is chosen to match that definition, so the rule would need retiming against a detector's alarm; the leak type used in (d) is the generator's configuration; 32 leaks give little power, so (e) is expected to fail unless the rule gains about 8 discordant leaks.

2026-11-16 · Step 22 outcome: picking the steepest-rising atom among those dated within 30 days localises 14 of 32 within 300 m and triples the slow leaks found (6 of 17, against 3), but loses 2 abrupt leaks (8 of 15, against 10); two of five predictions held, and the net gain over step 21's latest onset is one leak (5 against 4, P = 1.0)

  • Ran as planned, one run (step 21 rebuilt first from a cold cache, including the 177 MB L-TOWN_Real.inp from Zenodo, and reproduced its results.txt, leaks.tsv and daily.tsv byte for byte; the run asserts that its rebuilt tracker gives step 21's T-D error for every leak). No setting was changed after output was seen.
  • Within 300 m, of 32 (chance 1.40): S30 14 (P < 0.0001; median error 517 m; abrupt 8 of 15, incipient 6 of 17). References: step 21's T-D 13 (abrupt 10, incipient 3), D1 15 (10, 5), J on F 14 (9, 5), one-leak oracle 28. Paired: S30 against T-D 5 against 4 (P = 1.0); against D1 4 against 5 (P = 1.0); against J on F 3 against 3 (P = 1.0); against the oracle 0 against 14 (P < 0.0001).
  • Predictions. (a) more than 13: held (14). (b) more than 3 of 17 incipient: held (6). (c) at least 15: failed (14). (d) at least 9 of 15 abrupt: failed (8). (e) beats T-D at P < 0.05: failed (P = 1.0).
  • Variants, no verdicts. Onset window 14, 60 days or none: 15, 12, 11 (incipient 6, 4, 5). A 7-day slope span: 14 (abrupt 10, incipient 4). F30, the largest flow in the same 30-day set: 11 (incipient 3); S30 against F30 5 against 2 (P = 0.45). The window is what keeps the rule off old ramps, and the slope, not the window alone, is what finds the slow leaks.
  • The candidate set. A median 6 atoms (1 to 12) have onset within 30 days on day k, never none. One within 300 m is among them for 20 of 32 (abrupt 12 of 15, incipient 8 of 17); S30 picks it for 14 of those 20.
  • Seen after the run (no verdict). S30 and T-D hit different leaks: 9 shared, 5 only S30 (3 incipient, 2 abrupt), 4 only T-D (all abrupt), so the two rules together cover 18 of 32. No rule here has been scored that chooses between them.
  • What it changes. By the plan's fixed reading, (b) holding with (d) failing says the slope trades abrupt leaks for slow ones. The likely reason, not tested here: a burst's atom jumps once and is flat afterwards, so a concurrent ramp outruns it on a 14-day slope, while a slow leak's atom keeps rising after it enters. The estimate should depend on the change's shape, a step for a burst and a ramp for a slow leak; a detector's alarm, which says when a change began, is the natural way to choose. The 6 of 17 slow leaks is the most any data-driven estimate here has placed (D1 and J on F: 5), but on 32 leaks none of these differences is significant, and the oracle's 28 is 14 away. Next: (1) a shape test per candidate, step against ramp, fitted on the atom's flow since its onset, with the estimate the best-fitting change whose start is nearest the alarm; (2) a data-only residual as clean as D; (3) a detector's alarm times in place of the oracle t.
  • Output: experiments/step22-steepest/results.txt, leaks.tsv, steepest.svg.

2026-11-16 · Step 22 plan (on D, pick among the recently dated atoms the one whose flow is rising fastest, instead of the newest; milestone 3, H3), written before any output of this rule was computed

  • Why now. Step 21 found that on the demand-oracle residual D the tracker holds a slow leak's atom on day k for 12 of 17 and dates it to the leak's start for 9, yet the latest-onset rule picks it for 3: the slow leaks' atoms enter a median 18 days after their true onset, so newer atoms sit in front of them. A slow leak is a ramp, so its atom's fitted flow should keep rising after it enters, while an atom that absorbs a stable leak or a one-off change should not. Its outcome named the test: "the atom whose flow trend is steepest among those dated within the last 30 days".
  • Seen before writing this. Steps 1 to 21's results, including step 21's per-leak table (active count, rank of the near atom in the onset order, onset gap). No flow slope of any tracked atom has been computed. The 30-day window and the 14-day slope span are set here, before any score; the sweep shows how much they matter and none is picked after the fact.
  • Residual and tracker, unchanged. Step 21's D (published hourly pressure minus step 14's leak-free L-TOWN_Real.inp run rounded to 0.01 m; a demand oracle, no leak list), daily means, and step 21's primary tracker exactly (localise.track, active 0.5 m³/h, gap 2 days, link 0.95). Day k = t div 24 + 1 for the oracle localisation hour t, as in steps 20 and 21.
  • Estimate (primary S30). On day k, the candidates are the active atoms with onset in [k − 30, k]. For each, its daily fitted flow over days [k − 13, k] (0 on a day it was not active; the atom itself, not its linked track) and the least-squares slope of that flow on the day index. Pick the largest slope, ties by the larger flow on day k. No candidate: fall back to step 21's latest onset. Variants, no verdicts: W = 14, 60 and no onset limit; a 7-day slope span; F30, the largest flow on day k among the same candidates (does the slope matter, or only the window?).
  • References, read from earlier leaks.tsv: step 21's T-D (13 of 32; abrupt 10, incipient 3), step 11's D1 (15), step 20's J on F (14), step 17's one-leak oracle (28).
  • Predictions, to be reported held or failed. (a) S30 puts more than 13 of 32 within 300 m (beats T-D). (b) S30 puts more than 3 of the 17 incipient leaks within 300 m. (c) S30 puts at least 15 of 32 (level with D1 or better). (d) S30 keeps at least 9 of the 15 abrupt leaks (T-D: 10). (e) S30 beats T-D at P < 0.05 (exact sign test on 300 m hits).
  • Reading fixed now. (a) and (b) holding: among dated atoms, the flow trend separates a new slow leak from the older ones, and a rule a utility could run (given a residual as clean as D) recovers part of the gap to the oracle; the next step builds that residual from data. (b) holding with (d) failing: the slope trades abrupt leaks for slow ones, and the estimate should depend on leak type (a step for a burst, a ramp for a slow leak), e.g. the larger of two scores. (a) and (b) failing: the slow leaks' atoms do not rise faster than the rest on 33 sensors (other ramps and absorbing atoms rise too), and the route needs the alarm list of a detector to name which change is new, or a prior over atoms.
  • Caveats fixed now. D removes demand with the generator's model (an oracle); t is the oracle localisation hour; the tracker's settings are step 20's, none retuned; 32 leaks give little power, so (e) is expected to need a gain of about 8 discordant leaks.

2026-11-16 · Step 21 outcome: step 20's tracker, unchanged, on the demand-oracle residual D localises 13 of 32 within 300 m (slow leaks 3 of 17) and dates 9 of the 17 slow leaks to their own start, against 8 and 4 on the data-only F; five of six predictions held, but the gain over F is not significant on 32 leaks (9 against 4, P = 0.27)

  • Ran as planned, one run (under two minutes once step 19's rerun had rebuilt step 14's leak-free run and step 11's signatures from a cold cache; that rerun reproduced step 19's results.txt and leaks.tsv byte for byte). L-TOWN_Real.inp came from Zenodo, which answered this session's proxy. No setting was changed after output was seen.
  • Within 300 m, of 32 (chance 1.40): T-D 13 (P < 0.0001; median error 521 m; abrupt 10 of 15, incipient 3 of 17); T-D-on (oracle onset) 13; T-D-0 11. References: step 20's T on F 8, J on F 14; step 19's J-lag(168) on D 11; D1 15; one-leak oracle 28. Paired: T-D against T on F 9 against 4 (P = 0.27); against J on D 5 against 3 (P = 0.73); against J on F 5 against 6 (P = 1.0); against D1 5 against 7 (P = 0.77); against the oracle 1 against 16 (P < 0.0001).
  • Predictions. (a) more than 8: held (13). (b) more than 11: held. (c) more than 2 of 17 incipient: held (3). (d) at least 8 of 17 incipient dated: held (9; abrupt 11 of 15). (e) median active atoms per day below 15: held (8). (f) T-D beats T on F at P < 0.05: failed (P = 0.27).
  • Sweep, no verdicts. Active threshold 0 or 1.0 m³/h: 8, 7. Link correlation 0.90, 0.99, none: 12, 12, 11.
  • The tracker on D. Active atoms per day median 8 (0 to 23), never at the 24 cap (F: median 20, at the cap on 89 days); fit RMS median 0.0066 m of a 0.169 m centred daily D. 350 tracks, median 4 days, 0.44 new tracks a day. At the 32 leaks' day k: a median 12 atoms active while a median 6 leaks run at 1 m³/h or more. A near atom is active for 24 of 32 (chance 12.3); it is the newest for 13 and in the top 3 for 17. Incipient leaks are dated a median 18 days after their true onset, abrupt ones the same day.
  • What it changes. By the plan's fixed reading, (e) and (a) holding say F's drift was what filled the tracker: with demand removed by the generator's model, the active set falls from 20 to 8 and onset dating works (9 of 17 slow leaks dated, against 4 on F). The open problem for H3 moves to the residual: a data-only residual as clean as D. Two cautions keep this short of a method claim: (f) failed, so the gain over F is not significant on 32 leaks, and T-D (13) is level with D1 (15) and with J on F (14), still 15 short of the oracle. The slow leaks are now dated but not picked: their atom is active for 12 of 17 and dated for 9, yet the latest-onset rule picks it for 3, because their atoms enter a median 18 days after onset, behind newer ones. Next: (1) a data-only residual that removes demand without the generator (AMR demands as regressors, or a regression refitted on a rolling leak-free-by-construction window), tracked the same way; (2) on D, an estimate that uses the dated set, e.g. the atom whose flow trend is steepest among those dated within the last 30 days; (3) the alarm times of a detector in place of the oracle hour t.
  • Output: experiments/step21-tracker-d/results.txt, leaks.tsv, daily.tsv, tracker_d.svg.

2026-11-16 · Step 21 plan (step 20's tracker, unchanged, on step 19's demand-oracle residual D: does drift or the method sink the latest-onset rule?; milestone 3, H3), written before any tracker output on D was computed

  • Why now. Step 20's tracker scored 8 of 32 on the data-only residual F, with a median 20 atoms active and a new track every three to four days. Its plan fixed the reading: with a low fit RMS and many short tracks, the frozen regression's drift may be swamping the tracker, and "the same tracker on step 19's D (once L-TOWN_Real.inp is reachable) separates drift from the method". Zenodo answers through this session's proxy again (HTTP 206 on a range request for L-TOWN_Real.inp, 2026-11-16), so step 14's leak-free run, and D, can be rebuilt.
  • Seen before writing this. Steps 1 to 20's results; step 19 rerun from a cold cache only to rebuild D (its committed files are the check). No daily fit or track on D has been computed.
  • Residual. D = published hourly pressure minus step 14's leak-free L-TOWN_Real.inp run rounded to 0.01 m (exactly step 19's D: a demand oracle, no leak list). Daily means over [24k, 24k + 24).
  • Tracker, unchanged from step 20. localise.track with the same atoms (nominal L-TOWN.inp q = 5, per m³/h, centred), the same stopping (5% RMS gain, 0.005 m floor, 24 atoms), active at 0.5 m³/h, a 2-day gap, link correlation 0.95. Primary T-D: the active atom with the latest onset on day k = t div 24 + 1. Variants T-D-on (oracle onset) and T-D-0 (day t div 24). Sweep, no verdicts: active 0 and 1.0 m³/h, link 0.90, 0.99 and none.
  • References. Step 20's T on F (8 of 32) and J on F (14), step 19's J-lag(168) on D (11), step 11's D1 (15), step 17's one-leak oracle (28), all read from their leaks.tsv.
  • Predictions, to be reported held or failed. (a) T-D puts more than 8 of 32 within 300 m (beats T on F). (b) T-D puts more than 11 of 32 (beats step 19's J on D). (c) T-D puts more than 2 of the 17 incipient leaks within 300 m (T on F: 2). (d) At least 8 of the 17 incipient leaks are dated (step 20's definition: an active atom within 300 m on day k with onset in [true onset day − 2, k]). (e) The median number of active atoms per day on D is below 15 (F: 20). (f) T-D beats T on F at P < 0.05 (exact sign test on 300 m hits).
  • Reading fixed now. (e) and (a) holding: F's drift was what filled the tracker, and dating atoms works on a clean residual; the open problem moves to building a data-only residual that clean. (e) holding and (a) failing: fewer atoms, but the newest is still not the leak, so the latest-onset rule is wrong even without drift (on L-Town some 20 leaks overlap), and the next step is a tracker with a cost for keeping atoms or an alarm-driven rule. (e) failing: D, with every leak in it, keeps about as many atoms as F, so the atom count is the leak set itself, not drift; the route needs a prior that shrinks the active set. (d) is read the same way as in step 20.
  • Caveats fixed now. D removes demand with the generator's model (an oracle a utility does not have); t is the oracle localisation hour; every threshold is step 20's, none retuned.

2026-11-16 · Step 20 outcome: a daily tracker that dates each fitted source localises 8 of 32 within 300 m (slow leaks 2 of 17) on a data-only residual, below step 19's two-window rule on the same residual (14); five of six predictions failed, and the tracker piles up a median 20 active atoms, so the newest one is rarely the leak

  • Ran as planned, one run (under a minute; all seven tracker configurations over 730 days). L-TOWN_Real.inp was unreachable (zenodo.org refused by the proxy), so the residual is the plan's data-only F, as revised before any output. After the registered numbers were printed, a post-hoc section was added (track lengths, active counts at the alarm, the near atom's rank in the onset order) and the script rerun: the registered lines did not move.
  • Within 300 m, of 32 (chance 1.40): T 8 (P = 0.0001; median error 862 m; abrupt 6 of 15, incipient 2 of 17); T-on (oracle onset) 8; T-0 7; J on F, step 19's rule on the same residual, 14 (abrupt 9, incipient 5). References: step 18's A on P-lag(168) 12, D1 15, step 19's J on D 11, one-leak oracle 28. Paired: T against J 3 against 9 (P = 0.15); against D1 1 against 8 (P = 0.039, D1 better); against P-lag 3 against 7 (P = 0.34); against the oracle 1 against 21 (P < 0.0001).
  • Predictions. (a) more than 12: failed (8). (b) more than 15: failed. (c) more than 3 of 17 incipient: failed (2). (d) at most 27: held. (e) T beats J on F at P < 0.05: failed (J ahead, 9 against 3). (f) at least 8 of 17 incipient dated: failed (4; abrupt 8 of 15).
  • Sweep, no verdicts. Active threshold 0 or 1.0 m³/h: 6, 9. Link correlation 0.90, 0.99, none: 9, 7, 7. A 28-day training window: 9. No setting reaches J's 14.
  • The tracker. Active atoms per day median 20 (0 to 24), at the 24-atom cap on 89 of 730 days; fit RMS median 0.0043 m of a 0.217 m centred daily F. A near atom (within 300 m) is active on day k for 21 of 32 leaks, against 17.1 expected for as many random atoms: barely above chance, because 20 atoms cover much of the network.
  • Seen after the run (post hoc, no verdict). 221 tracks, median length 6 days (1 to 713), 0.29 new tracks a day; at 10 of the 32 alarms 23 or 24 atoms are active. Where a near atom is active it ranks first in the onset order for 8 of 21 and in the top 3 for 13. Abrupt leaks are dated with a median gap of 0 days; the 4 dated incipient leaks a median 14 days after onset.
  • What it changes. By the plan's fixed reading, (f) failing with a low fit RMS and many short tracks puts the failure on the residual's drift swamping the tracker: atoms enter to absorb the frozen regression's drift and other leaks, stay while their flow is at least 0.5 m³/h, and a new track starts every three to four days, so the latest onset is mostly not the leak. The pre-registered (e) says the dating rule loses to the two-window rise on the same data, and the same rise on this data-only residual (14 of 32, incipient 5) matched D1 (15) where on step 19's demand-oracle D it had 11; that cross-residual difference is not tested. Next: (1) the same tracker on step 19's D once L-TOWN_Real.inp is reachable, which the plan names as the test that separates drift from the method; (2) a tracker with a cost for keeping an atom (a sparsity penalty or a decay), so atoms that no longer explain much leave and onsets mean something; (3) score J on F against a detector's alarm list instead of the oracle t.
  • Output: experiments/step20-tracker/results.txt, leaks.tsv, daily.tsv, tracker.svg.

2026-11-16 · Step 20 plan (a daily tracker on a data-only residual: refit each day from the previous day's atoms, date each atom's onset, and localise a leak as the active atom whose onset is nearest the alarm; milestone 3, H3), written before any tracker output was computed

  • Why now. Step 19 found a joint fit on one week-apart pair of windows localises 11 of 32 (slow leaks 1 of 17), yet, post hoc, its window fit had an atom within 300 m of 10 of the 17 slow leaks (chance 5.5): the loss was the rule that picks the new atom from two windows. A slow leak is already in a one-week-old baseline, so its rise is small. Tracking every day removes the moving baseline: a leak's atom enters the fit when the leak becomes visible and stays while it runs, so its entry day dates it whatever the other leaks do later.
  • Why a data-only residual this time. This session's egress proxy refuses zenodo.org, and L-TOWN_Real.inp (177 MB) is on no reachable mirror, so step 14's leak-free run, and with it step 19's D, cannot be rebuilt here. Rather than wait, this step runs the tracker on a residual that needs no generator model at all, which is the version a utility could run. That makes it a harder test than step 19 (no demand oracle), and the comparison with step 19 is across residuals; the paired comparison that carries a verdict, (e), is on the same residual. An attempted rerun of step 19 stopped at that file; its committed results stand unchanged.
  • Seen before writing this. Steps 1 to 19's results. No daily fit, track, onset or frozen residual has been computed.
  • Residual (F, data only). Step 11's no-flow regression design (hour of day × weekday/weekend, tank level; inlet flows left out because they carry the leaks' water), fitted once per sensor by least squares on the first 14 days of 2018 (days 0 to 13) and frozen: F = published hourly pressure minus that prediction, for every hour of 2018-19. Leaks already running in those 14 days sit in the baseline (no scored leak starts before day 14). Daily means over calendar days [24k, 24k + 24). Sweep, no verdicts: a 28-day training window.
  • Atoms, unchanged from step 19. Step 11's nominal L-TOWN.inp q = 5 signatures at the 782 junctions, per m³/h, centred across the 33 sensors (centring absorbs a common pressure shift, such as a network-wide demand change).
  • Tracker (T). Day 0 is fitted by step 19's non-negative greedy pursuit (stop at 5% RMS gain, RMS floor 0.005 m, at most 24 atoms) from an empty set; each later day starts from the previous day's active atoms (refitted by NNLS) and adds atoms by the same rule. An atom is active on a day if its fitted flow is at least 0.5 m³/h; only active atoms carry to the next day. Onset of an active atom: the onset it carried if it was active yesterday or at most 2 days before that (a gap of up to 2 days rejoins its track); otherwise, if an atom dropped today or within those 2 days has a centred signature correlation of at least 0.95 with it, the new atom inherits that track's onset (a leak hopping to a neighbouring junction keeps its date; new atoms in order of flow, each dropped track used once, the most correlated first); otherwise its onset is today. Day 0's atoms have onset 0 (left-censored).
  • Estimate. For a leak at its oracle localisation hour t (step 11's half-peak hour, as every step since 15): on day k = t div 24 + 1 (the first whole day starting after t; it ends at most 48 h after t, against step 19's 24 h; disclosed), the active atom with the latest onset, ties by the larger flow. Primary T. Variants: T-on, the active atom on day k whose onset is nearest the leak's true onset day (an oracle onset), ties by flow; T-0, T on day t div 24 (no data past t + 24). Reference on the same residual: J, step 19's two-window rule (localise.nn_pursuit and localise.rise) on F, baseline t − 168 h, window [t, t + 24). Sweep, no verdicts: active threshold 0 and 1.0 m³/h; link correlation 0.90, 0.99 and none; the 28-day training window.
  • Scoring, unchanged. Step 11's 300 m along-pipe rule on the 32 oracle-timed leaks; chance by the Poisson-binomial tail; exact sign tests on discordant hits; leak type from the generator's configuration. References read from earlier leaks.tsv: step 18's A on P-lag(168) (data only, 12), step 11's D1 (15), step 19's J-lag(168) on D (11), step 17's one-leak oracle (28).
  • Onset dating (the step 19 outcome's first test). For each leak, the active atoms on day k within 300 m of its pipe; the leak is dated if one of them has an onset in [true onset day − 2, k] (it entered with the leak, not before). Reported per type, with the median gap in days from the true onset to the nearest such onset.
  • Predictions, to be reported held or failed. (a) T puts more than 12 of 32 within 300 m (beats step 18's best data-only residual, A on P-lag(168): 12). (b) T puts more than 15 of 32 (step 11's D1: 15). (c) T puts more than 3 of the 17 incipient leaks within 300 m. (d) T puts at most 27 of 32 (below step 17's one-leak oracle, 28). (e) T beats J on the same residual F at P < 0.05 (sign test on 300 m hits). (f) At least 8 of the 17 incipient leaks are dated.
  • Also reported, no verdict. Paired tests of T against D1, step 18's P-lag(168) and the oracle; per leak, the number of active atoms on day k and the rank, in the onset order, of the nearest atom to the target; the tracker's daily active count and fit RMS over the two years, and the centred RMS of F itself (how much drift the frozen regression leaves).
  • Reading fixed now. (a) and (f) holding: dating atoms by entry recovers what two-window rules lose, without any oracle in the residual, and a detector's alarm can replace the oracle t next. (f) holding with (a) failing: slow leaks get their own onset, but newer atoms (other leaks, drift, or hopping that linking misses) sit between it and the alarm; the next step scores the onset order against a detector's alarm list. (f) failing with a high fit RMS or many short tracks: the frozen residual's drift swamps the tracker, and the same tracker on step 19's D (once L-TOWN_Real.inp is reachable) separates drift from the method. (f) failing with a low RMS and stable tracks: daily fits on 33 sensors cannot hold a slow leak's atom, and the joint route needs a smoother (multi-day) fit or a prior over atoms.
  • Caveats fixed now. The localisation hour t is still an oracle. The frozen regression does not model seasonal demand change; centring removes only its common part. Every threshold above (14 days, 0.5 m³/h, 2 days, 0.95) is set here, before any track is seen; the sweep shows how much they matter and none is picked after the fact.

2026-11-16 · Step 19 outcome: a joint non-negative fit localises 11 of 32 within 300 m (slow leaks 1 of 17), no better than step 18's lagged difference; four of five predictions failed, yet the fit's atoms sit within 300 m of 10 of the 17 slow leaks (chance 5.5), so the rule that picks the new atom, not the fit, is what fails

  • Ran as planned, one run (8 s once step 18's rerun had rebuilt the caches; step 18 reproduced its results.txt and leaks.tsv byte for byte from a cold cache). After the pre-registered numbers were printed, a post-hoc section was added (does any atom of the window fit lie within 300 m of the target, with its chance level from as many junctions drawn at random); the registered numbers did not move.
  • Within 300 m, of 32 (chance 1.40): J-lag(168) 11 (P < 0.0001; median error 447 m; abrupt 10 of 15, incipient 1 of 17); J-on 12 (incipient 3). References: D-lag(168) 11, D1 15, O-inc 16, one-leak oracle 28. Paired: J against D-lag 4 against 4 (P = 1.0); against D1 3 against 7 (P = 0.34); against the oracle 1 against 18 (P < 0.0001); J-on against O-inc 1 against 5 (P = 0.22).
  • Predictions. (a) more than 11: failed (11). (b) more than 15: failed. (c) more than 3 of 17 incipient: failed (1). (d) at most 27: held. (e) beats D-lag(168) at P < 0.05: failed (P = 1.0).
  • Sweep, no verdicts. Lags 24, 72, 336 h: 9, 7, 13 (incipient 0, 0, 3). Stopping at 2% or 10% RMS gain: 10 and 11.
  • The fit. A median 10 atoms (1 to 16) leave a median 0.0124 m of a 0.212 m centred signal (4.6%). Of the leaks running at t (mean flow at least 1 m³/h; median 6), 147 of 250 (59%) have a fitted atom within 300 m.
  • Seen after the run (post hoc, no verdict). The window fit has an atom within 300 m of the target for 21 of 32 (chance 10.9, P = 0.0001): abrupt 11 of 15 (chance 5.45), incipient 10 of 17 (chance 5.46, P = 0.016). The largest-rise rule picks 10 of the 11 abrupt and 1 of the 10 incipient.
  • What it changes. The plan's fixed reading of (a) failing with a low fit RMS was collinearity: 33 sensors cannot separate the sources. The post-hoc split says that is too strong for the slow leaks: the fit places an atom near them more often than chance, and the loss is in deciding which atom is the new leak. A slow leak sits in the baseline fit already and its one-week rise is small, so the largest rise goes to atoms that absorb other leaks' changes. Two-window rules (differences in step 18, rises here) are closed. Next for H3: a tracker that refits each day from the previous day's atoms and dates a leak at the first day an atom's flow trends up from zero, with the estimate the atom whose onset is nearest the alarm, scored on all 32 at once; its first test is whether the 10 slow leaks found here get their own onset.
  • Output: experiments/step19-joint/results.txt, leaks.tsv, methods.svg.

2026-11-16 · Step 19 plan (a joint multi-source fit: model the other leaks instead of differencing them away; milestone 3, H3), written before any joint fit was computed

  • Why now. Step 18 closed moving baselines: with 23 leaks overlapping in 2019, any window short enough to drop the old leaks also drops most of a slow leak's own growth, and the others still change by about as much inside it (A on D-lag(168) 11 of 32, incipient 3 of 17; one-leak oracle 28). Its outcome named the open route: attribute the other leaks' effects to their own places with a multi-source fit, so their changes stop contaminating the target's. This step tests that route with no leak list in the residual or in the fit.
  • Seen before writing this. Steps 1 to 18's results. No multi-source fit has been computed on any residual.
  • Residual. D = published minus step 14's leak-free L-TOWN_Real.inp run (rounded 0.01 m), hourly; a demand oracle, no leak list. Window means: D_t over [t, t + 24) at each of step 11's 32 oracle-timed leaks, and D_b over the baseline window [t − L, t − L + 24). Both absolute, so every running leak's whole effect is in them, not only its change.
  • Joint fit (J). Atoms: step 11's nominal L-TOWN.inp q = 5 signatures at the 782 junctions, scaled to per m³/h, each centred across the 33 sensors (the same centring Pearson uses, which absorbs a common pressure shift such as a tank-level difference). Non-negative greedy pursuit on the centred window mean: add the atom with the largest positive normalised correlation with the current fit residual, refit all selected flows by non-negative least squares, and stop when the RMS improvement of the last addition is under 5% of the previous RMS, the RMS is under 0.005 m, or 24 atoms are in. First the baseline D_b is fitted from an empty set; then D_t is fitted starting from the baseline's atoms (a sequential localiser: what was found before is kept and refitted, new atoms are added by the same rule). Estimate: the junction whose fitted flow rose most from D_b to D_t.
  • Variants. Primary J-lag(168) (L = 168 h, as step 18's primary). J-on: baseline [onset − 24 h, onset), comparable with step 15's O-inc (the onset is an oracle). Sweep, no verdicts: L = 24, 72, 336 h; stopping thresholds 2% and 10%.
  • Scoring, unchanged. Step 11's 300 m along-pipe rule, chance by the Poisson-binomial tail, exact sign tests on discordant hits; leak type from the generator's configuration.
  • Predictions, to be reported held or failed. (a) J-lag(168) puts more than 11 of 32 within 300 m (beats step 18's A on D-lag(168), 11). (b) J-lag(168) puts more than 15 of 32 (beats step 11's D1, 15). (c) J-lag(168) puts more than 3 of the 17 incipient leaks within 300 m (D-lag(168): 3). (d) J-lag(168) puts at most 27 of 32 (does not reach the step 17 oracle, 28). (e) J-lag(168) beats A on D-lag(168) at P < 0.05 (sign test).
  • Also reported, no verdict. Paired tests against step 17's oracle and step 15's A on O-inc; per leak, the number of atoms fitted at t, the fit's RMS, and how many of the leaks running at t (mean flow over the window at least 1 m³/h, from the leakage files) have a fitted atom within 300 m (how much of the network's leak set one fit recovers).
  • Reading fixed now. (a) and (c) holding: modelling the other leaks recovers part of what differencing loses, and a tracker over time is the next step. (a) failing with a low fit RMS: the 33 sensors cannot separate 20-odd sources with nominal signatures (collinearity), and the joint route is closed on L-Town's sensor set. (a) failing with a high fit RMS: linear superposition of nominal signatures does not describe the leaks' combined effect (nonlinearity or model mismatch), which the fit RMS and the set recovery separate.
  • Caveats fixed now. The localisation hour t is still an oracle, and D removes demand with the generator's model; the fit itself uses only the nominal model. Superposition of 5 m³/h signatures is linear in flow while head loss is not; the fit RMS reports how far that holds. Candidates stay the 782 junctions; the leaks sit on pipes.

2026-11-15 · Step 18 outcome: a lagged baseline with no leak list localises 12 of 32 within 300 m (slow leaks 4 of 17), no better than D1's regression residual (15) and far from the oracle (28); three of five predictions failed, and no lag from 24 h to 336 h closes the gap

  • Ran as planned, one run (about 7 minutes, almost all of it rebuilding step 14's leak-free run and step 11's q = 5 signatures in a fresh cache). The lagged residual was then moved from the script into localise.lagged_change (with a unit test) and the step rerun from the cache: results.txt and leaks.tsv byte-identical. References read back from steps 15 and 17's leaks.tsv match their reported counts (D1 15, oracle 28).
  • Within 300 m, of 32 (chance 1.40): A on P-lag(168), data only, 12 (P < 0.0001; median error 841 m; abrupt 8 of 15, incipient 4 of 17); A on D-lag(168), demand removed, 11 (incipient 3); M on P-lag(168) 12 (incipient 2). Paired: A on P-lag against M 3 against 3 (P = 1.0); against D1 2 against 5 (P = 0.45); against the step 17 oracle 0 against 16 (P < 0.0001).
  • Predictions. (a) more than 15: failed (12). (b) more than 5 of 17 incipient on D-lag(168): failed (3). (c) demand change costs at most 3 leaks: held (D-lag 11, P-lag 12). (d) at most 23: held (12). (e) A beats M at P < 0.05: failed (3 against 3).
  • Sweep, no verdicts. A on P-lag at L = 24, 72, 168, 336 h: 12, 8, 12, 11 of 32 (abrupt 11, 7, 8, 8; incipient 1, 1, 4, 3); on D-lag 11, 10, 11, 10. The most-affected sensor gets 12 at every lag.
  • Contamination measured from the published leak flows. Over the 168 h lag, a slow leak's own mean flow changes a median 2.34 m³/h while the other leaks' flows change by a summed 2.66 (ratio 0.61; against the onset baseline: 6.71 and 17.84, ratio 2.57), and only a median 0.32 of its own change since onset is left in the window. For abrupt leaks the week brings in 2.76 m³/h of other leaks' change against 0.28 for the onset baseline, which is why abrupt hits fall from 10 (D1) and 11 (onset baseline) to 8. The best Pearson score on P-lag(168) has median 0.896 (oracle: 0.9986).
  • What it changes. Read as fixed in the plan: (a) failing means a weekly difference is no better than D1's regression, and (c) holding means the loss is not week-to-week demand change: it is other leaks. On L-Town, with 23 leaks overlapping in 2019, no fixed-lag baseline separates a slow leak from the others, because any window short enough to drop the old leaks also drops most of the slow leak's own growth, and the others still change by about as much inside it. Moving baselines are closed as a route to the oracle bound. The open route is to model the other leaks rather than difference them away: a sequential localiser that subtracts the modelled effect of leaks already localised, or a joint multi-source fit (greedy or sparse regression over the 782 signatures) on the onset residual, both scored against step 17's 28 of 32.
  • Output: experiments/step18-lagged/results.txt, leaks.tsv, lag_sweep.svg.

2026-11-15 · Step 18 plan (a tracking baseline: the residual taken against a lagged window instead of the leak's onset, with no leak list in it; milestone 3, H3), written before any lagged residual was computed

  • Why now. Step 17 found that with one leak in the residual even the nominal model puts 28 of 32 within 300 m, so the residual, not the model, limits H3. That residual is an oracle (it replays every other leak). The practical question is how much survives a residual built without the leak list: take the change against a recent window, so leaks that start or grow long before t drop out, at the cost that a slow leak's own growth before the window drops out too. Step 11's D1 regression residual (trained on days [d − 21, d − 7)) is one such baseline and scored 15 of 32 (incipient 5 of 17); step 15's onset-baseline O-inc 16 (incipient 5).
  • Seen before writing this. Steps 1 to 17's results, including the per-type counts above, read from steps 15 and 17's leaks.tsv. No lagged residual has been computed for any leak.
  • Residuals. For each of step 11's 32 oracle-timed leaks at hour t (the leak's localisation time is still an oracle), with hourly means: P-lag(L) = mean published pressure over [t, t + 24) minus the same over [t − L, t − L + 24): no model, no leak list. D-lag(L): the same on D = published minus step 14's leak-free L-TOWN_Real.inp run (rounded 0.01 m), which removes demand variation between the two windows (a demand oracle, no leak list). Primary L = 168 h (same weekday and hours, so the weekly demand pattern cancels); L = 24, 72 and 336 h as a sweep, reported without verdicts.
  • Estimates and scoring, unchanged. A: step 11's nominal L-TOWN.inp signatures at q = 5 (the step 17 bound used the same, 28 of 32); M: the most-affected sensor. Argmax Pearson, step 11's 300 m along-pipe rule, chance by the Poisson-binomial tail, exact sign tests on discordant hits; leak type from the generator's configuration.
  • Predictions, to be reported held or failed. (a) A on P-lag(168) puts more than 15 of 32 within 300 m (beats D1's 15). (b) A on D-lag(168) puts more than 5 of the 17 incipient leaks within 300 m (beats O-inc's 5). (c) Demand change between the windows costs at most 3 leaks: hits of A on D-lag(168) minus hits on P-lag(168) is at most 3. (d) A tracking baseline does not reach the oracle: A on P-lag(168) puts at most 23 of 32 within 300 m (step 17's oracle: 28). (e) A beats M on P-lag(168) at P < 0.05 (sign test).
  • Also reported, no verdict. Paired sign tests of A on P-lag(168) against D1 (step 11) and against step 17's oracle; per leak, from the published leakage files, the target leak's own mean-flow change between the two windows and the summed absolute change of every other leak's mean flow, for L = 168 and for step 15's onset baseline, so the contamination each baseline carries is measured rather than assumed.
  • Reading fixed now. (a) holding with (d) holding: a short tracking baseline recovers part of the oracle gap without any oracle in the residual; (a) failing: a weekly difference is no better than D1's regression, and the remaining route is a sequential localiser that subtracts leaks already found. (c) failing means week-to-week demand change, not other leaks, dominates the data-only residual.
  • Caveats fixed now. The localisation hour t is still an oracle (half the leak's peak flow); a detector's alarm time would replace it in a method. The sweep's four lags are reported, never chosen after the fact as the primary.

2026-11-15 · Step 17 outcome: with the other leaks replayed out, the generator's model localises 27 of 32 leaks within 300 m (step 16: 15) and the slow leaks 14 of 17 (step 16: 4); four of five predictions held, and the residual, not the model or the sensors, was the limit

  • Ran as planned, one run after two fixes that changed no number: a wrong length assertion (5-minute rows are 12 per hour, not 288) stopped the first attempt before any run, and nothing else was edited after results appeared. Step 16 was rerun first from a cold cache and reproduced its results.txt and leaks.tsv byte for byte. The 128 replay day runs took under a minute on 4 cores.
  • Gate held, exactly. With every leak pipe split at its midpoint and drawing its published flow, the replay rounded to 0.01 m equals the published pressures with median absolute difference 0.0000 m in both windows of all 32 leaks; a manual check before the run found the same on three arbitrary days (maximum 0.01 m with 60 m³/h of leaks running, against up to 2.07 m for the leak-free run). So the generator's leaks behave as demands at pipe midpoints, and O-one holds the target leak's effect only.
  • Within 300 m, of 32 (chance 1.40): R on O-one 27 (P < 0.0001; median error 56 m; abrupt 13 of 15, incipient 14 of 17); R on O-one-b 27; nominal model at q = 5 on O-one 28; most-affected sensor 20. Paired: R on O-one against R on step 15's O-inc 14 against 2 discordant leaks (P = 0.004); R against A 0 against 1 (P = 1.0); R against M 9 against 2 (P = 0.065).
  • Predictions. (a) more than 15: held (27). (b) more than 4 of 17 incipient: held (14). (c) at least 20: held. (d) median best r ≥ 0.99: held (0.9986, range 0.990 to 0.9999). (e) R beats M at P < 0.05: failed (P = 0.065).
  • Also reported. The leak pipe's better end node ranks first for 16 of 32 (step 16: 5), top 10 for 28, median rank 2. Junctions over 300 m away within 0.001 of the best: median 0, none for 21 leaks. O-one correlates with O-inc at a median 0.80 (0.05 to 1.00). The five misses: p31 (399 m), p277 (964 m, 17 far ties), p280 (381 m), p331 (420 m), p653 (325 m, 17 far ties).
  • What it changes. Step 16's post-hoc reading is now a pre-registered result: other leaks' changes in the residual were what cost the slow leaks, and with one leak in the residual even the uncalibrated nominal model puts 28 of 32 within 300 m. L-Town's 33 sensors resolve most leaks to a pipe or two; neither the model nor sensor resolution was the binding limit. H3's bar (half within 300 m) is met by every model-based variant on a one-leak residual, as an oracle bound. The open problem is a non-oracle residual that removes the other leaks: a baseline that tracks them (rolling or windowed, with the cost that a slow leak's own growth is partly removed too), or a sequential localiser that subtracts the modelled effect of leaks it has already found. That is the next step for H3.
  • Output: experiments/step17-replay/results.txt, leaks.tsv, localisation_error.svg; the replay runs are cached outside the repository.

2026-11-15 · Step 17 plan (a per-leak oracle residual: every other leak replayed through the generator's model, so the residual holds one leak; milestone 3, H3), written before any replayed residual was computed

  • Why now. Step 16 found the exact model and day change nothing at 300 m (15 of 32), and, post hoc, that incipient leaks localise 4 of 17 while their O-inc carries a median 17.8 m³/h of other leaks' flow change against their own 6.7. That reading is post hoc. Replaying the other leaks through L-TOWN_Real.inp gives a residual with one leak in it, which tests it: if contamination is the limit, localisation of the incipient leaks rises; if it stays put with a near-perfect fit, the limit is what 33 sensors can resolve.
  • Seen before writing this. Steps 1 to 16's results, and one mechanical check on the nominal L-TOWN.inp: splitting two pipes at their midpoints with zero demand leaves five sensors' pressures unchanged to 1e-6 m. No replay of L-TOWN_Real.inp, no replayed residual and no localisation on one.
  • Replay. Every leak pipe in the 2018 and 2019 leakage files is split at its midpoint through the EPANET 2.2 toolkit (new junction at the mean end elevation, each half keeping diameter and roughness at half the length), and the junction draws the pipe's published 5-minute leak flow as a demand reset before every hydraulic solve. Each 24 h window restarts the model at its first 5-minute mark with T1 at its published level and PUMP_1 open if its published flow is above zero, as step 16 restarts from the leak-free state.
  • Windows and runs. For each of step 11's 32 oracle-timed leaks: the localisation window [t, t + 24) and the pre-onset window [onset − 24 h, onset), each run with ALL leaks replayed and with OTHERS (the target leak's flow set to zero): 128 day runs.
  • Gate. ALL, rounded to 0.01 m, against the published pressures: median absolute difference over the 33 sensors and 288 steps under 0.01 m in both windows of every leak. Reported per leak; a leak that fails is kept and flagged, and the outcome says whether the verdicts move without it.
  • Residuals. O-one (primary): mean over [t, t + 24) of published minus OTHERS (rounded to 0.01 m). O-one-b: O-one minus the same mean over the pre-onset window. Also reported: the Pearson correlation of O-one with step 15's O-inc per leak.
  • Estimates and scoring. R: step 16's signatures (L-TOWN_Real.inp on the leak's day, constant demand of the leak's own mean flow at each of 782 junctions); A: step 11's nominal signatures at q = 5; M: the most-affected sensor. Argmax Pearson, step 11's 300 m along-pipe rule, chance by the Poisson-binomial tail, exact sign tests on discordant hits; leak type (abrupt or incipient) from the generator's configuration, as step 16's post-hoc split.
  • Predictions, to be reported held or failed. (a) R on O-one puts more than 15 of 32 within 300 m (step 16: 15). (b) R on O-one puts more than 4 of the 17 incipient leaks within 300 m (step 16: 4). (c) R on O-one puts at least 20 of 32 within 300 m. (d) The median best Pearson score of R on O-one is at least 0.99. (e) R beats M on O-one at P < 0.05 (sign test).
  • Reading fixed now. (a) and (b) holding supports step 16's post-hoc reading that other leaks' changes limit the incipient leaks; both failing with (d) holding puts the limit on the 33 sensors' resolution (signatures of distant junctions close to collinear); (d) failing means the replay or the constant-demand signature does not match the generator's leak, which the gate separates.
  • Caveats fixed now. Every input is an oracle (model, leak list, flows, times, sizes): an upper bound, not a method. The replay draws each leak's published flow as a fixed demand at the pipe's midpoint; if the generator placed or modelled its leaks otherwise, the gate shows it. Candidates stay the 782 junctions.

2026-11-15 · Step 16 outcome: the generator's own model on each leak's day localises 15 of 32, no better than the nominal model; all five predictions failed, and the loss sits in the incipient leaks' residual, which step 15 misread as the model

  • Ran as planned, one run (about 17 minutes on 4 cores for 32 × 783 day runs of L-TOWN_Real.inp), then a post-hoc section added to the script and rerun from the cache; the pre-registered numbers did not move. Step 15 was rerun first from a cold cache and reproduced its results.txt byte for byte.
  • Gate held. Restarted at each leak's hour with step 14's tank level and pump status, the leak-free run equals the continuous one to 0.00000 m (median absolute difference, every leak).
  • Within 300 m, of 32 (chance 1.40): generator's model on the leak's day, O-inc 15 (P < 0.0001; median error 389 m); the same on step 11's D1 residual 12; nominal model at q = 5 (step 15) 16; most-affected sensor 14. Paired: R against A 0 against 1 discordant (P = 1.0); R against M 4 against 3 (P = 1.0).
  • Predictions. (a) more than 16: failed (15). (b) at least 24: failed. (c) R beats M at P < 0.05: failed (P = 1.0). (d) median best r ≥ 0.99: failed (0.966, the same as the nominal model's). (e) an end node of the leak pipe scores best for at least 16: failed (5; median rank of the better end node 65 of 782).
  • Also reported. Junctions over 300 m away scoring within 0.001 of the best: median 1 (0 to 8), none for 13 leaks.
  • Seen after the run (post hoc, no verdict). The 15 abrupt leaks localise 11 of 15 within 300 m with every method (generator's model 11, nominal 11, sensor 12); the 17 incipient leaks 4 of 17 (nominal 5, sensor 2), and no incipient leak has its own pipe's end node scoring best. An incipient leak's localisation hour (half its peak flow) falls a median 906 h after its onset, so O-inc, taken against the 24 h before onset, also carries every other leak's change over those five weeks: a median 17.8 m³/h of other leaks' flow change against the leak's own 6.7 (abrupt leaks: 0.3 against 20.3). Split at the median ratio of other-leak change to own flow (0.09), the generator's model localises 12 of 16 leaks at or below it and 3 of 16 above (Fisher exact P = 0.004).
  • What it changes. Step 15's reading, that the nominal model limits localisation, does not survive: the exact model changes nothing at 300 m. For an abrupt leak whose residual holds only its own effect, the nominal model already does as well as the exact one (11 of 15), so the nominal-versus-real parameter mismatch (diameters about 2% smaller, roughness ±9%) does not cost localisation on L-Town. What does is the residual: O-inc is an oracle for the network's total change, not for one leak's, and for slow leaks other leaks dominate it. The next step is a per-leak oracle: the generator's model with the other leaks replayed (emitters at their pipes with the published flows), so the residual holds one leak only; that separates residual contamination from what 33 sensors can see, which this step cannot. For practice the same point holds without oracles: a baseline taken at onset goes stale for a slow leak, so a localiser for incipient leaks needs a baseline that tracks the other changes in the network.
  • Output: experiments/step16-realday/results.txt, leaks.tsv, localisation_error.svg; the day runs are cached outside the repository.

2026-11-15 · Step 16 plan (the generator's own model on each leak's day: what is left of the localisation loss when model and residual are both exact; milestone 3, H3), written before any L-TOWN_Real.inp signature was computed

  • Why now. Step 15 found a perfect residual moves the nominal-model localiser only from 15 to 16 of 32 leaks within 300 m, so the model limits it. Two things differ between the nominal L-TOWN.inp and the generator: its parameters (seen before writing this: in L-TOWN_Real.inp every pipe diameter differs, median 0.979 of nominal, 5th to 95th percentile 0.962 to 0.998; roughness 0.91 to 1.09 of nominal; lengths 0.95 to 1.05; base demands perturbed and each node on its own pattern) and the day (step 11's signatures are the nominal model's first day, while the leaks run on their own days with their own tank and pump state). Signatures from L-TOWN_Real.inp on each leak's own 24 h remove both. What is still lost then is what 33 pressure sensors cannot resolve, plus the other leaks changing in the window and the generator's leak model (a mid-pipe emitter, not a junction demand).
  • Seen before writing this. Steps 1 to 15's results, the two files' pipe and demand sections (the ratios above), and one test: a 5 m³/h demand at n100 on day 100 through the EPANET toolkit (0.17 s per 24 h run). No signature on any leak's day, and no localisation with the generator's model.
  • Signatures (R). For each of step 11's 32 oracle-timed leaks, L-TOWN_Real.inp through the EPANET 2.2 toolkit, restarted at the leak's localisation hour t (pattern start t, tank T1's level and PUMP_1's status from step 14's continuous leak-free run at t), run 24 h at the file's 5-minute steps, once leak-free and once per junction (782) with an extra constant demand equal to the leak's own mean flow over [t, t + 24) from the leakage files (step 15's q_true; an oracle size). Signature = 24 h mean pressure change at the 33 sensors. About 25,000 runs.
  • Gate. The restarted leak-free run must reproduce the continuous run over each window: median absolute difference under 0.01 m across the 33 sensors and 288 steps, for every leak; reported per leak.
  • Estimate and scoring, unchanged from step 15. Residual O-inc (step 15's primary), argmax Pearson over the 782 junctions, step 11's 300 m along-pipe rule, chance by the Poisson-binomial tail, paired exact sign tests on discordant 300 m hits against step 15's A (nominal, q = 5) and M (most-affected sensor) on O-inc.
  • Predictions, to be reported held or failed. (a) R on O-inc puts more than 16 of the 32 within 300 m. (b) R puts at least 24 of 32 (75%) within 300 m. (c) R beats M on O-inc at P < 0.05 (sign test). (d) The median best Pearson score of R on O-inc is at least 0.99. (e) For at least 16 of the 32, the best-scoring junction is one of the two end nodes of the leak pipe.
  • Also reported, no verdict. R on step 11's D1 residual; per leak, the rank of the leak pipe's better end node among 782 and its score gap to the best; how many junctions more than 300 m from the leak score within 0.001 of the best (a count of the places 33 sensors cannot tell apart from the true one at that fit).
  • Caveats fixed now. Every input but the residual's detector is an oracle (the generator's model, the leak's time, its size), so the result is an upper bound on what model-based correlation localisation can do on L-Town's 33 sensors, not a method. Candidates stay the 782 junctions; the leaks sit on pipes.

2026-11-15 · Step 15 outcome: a perfect residual moves the nominal-model localiser from 15 to 16 of 32 leaks within 300 m; the model, not the residual, limits localisation, and the residual, not the model, limits detection delay

  • Ran as planned, one run, then one rerun after moving the visibility rule from the script into localise.visible_from (with a unit test); the output is byte-identical. The continuous two-year leak-free run (about 4 minutes) and 782 junctions × 6 leak sizes (4,692 EPANET runs, about 12 minutes on 4 cores) were simulated here; both are cached outside the repository.
  • Gate held. Step 11's model and most-affected-sensor estimates on the D1 residual are reproduced for all 32 leaks.
  • Within 300 m, of 32 (chance 1.40 expected): nominal model at q = 5 on the D1 residual (step 11) 15, on the oracle residual O-inc 16 (P < 0.0001; median error 436 → 340 m); most-affected sensor 13 → 14; nominal model at the leak's true size 14 → 15. Paired: O-inc against D1 for the model, 3 against 2 discordant leaks, P = 1.000; model against sensor on O-inc, 5 against 3, P = 0.727.
  • O-all (the oracle residual without the pre-onset baseline, every running leak in it) puts 2 of 32 within 300 m (P = 0.41, not above chance): with 23 leaks overlapping in 2019, the residual must be taken against the leak's own before-state or the other leaks dominate it.
  • Fit. The best nominal signature correlates with O-inc at a median r = 0.966 (0.553 to 0.998), yet half the leaks are localised more than 300 m away: the 33-sensor signatures of junctions hundreds of metres apart are close to collinear, so a good fit in shape does not pin the place. Step 11's D1 residual correlates with O-inc at a median 0.870 per leak (−0.41 to 0.99; the low ones are the slow ramps p277, p280, p879).
  • Visibility. At 0.05 m sustained 3 h against the pre-onset level, all 32 leaks show at some sensor within a median 0 h of onset (0 to 20 h). D1-F's 13 detected 2019 leaks were alarmed a median 104 h after onset and LILA-auto's 14 a median 138 h, every one later than the leak was visible.
  • Predictions. (a) more than 15: held (16). (b) at least 16: held (16, exactly the line). (c) model and sensor not separable on O-inc at 0.05: held (P = 0.727). (d) median best r ≥ 0.9: held (0.966).
  • What it changes. H3's shortfall in steps 11 and 12 is not the residual: with the exact leak effect, the uncalibrated nominal model gains one leak and still cannot be told from naming the sensor that fell most. So the next localisation step is the model: signatures from L-TOWN_Real.inp itself on each leak's day, which splits the remaining error into nominal-versus-real model mismatch and what 33 sensors cannot resolve. For detection the opposite holds: every leak is in the data within hours, and the detectors lose four to six days in their regression residuals, which bounds what a better residual (milestone 5) could gain. Both bounds use the leak list and the generator's model, so they are oracles, not methods.
  • Output: experiments/step15-oracle/results.txt, leaks.tsv, localisation_error.svg.

2026-11-15 · Step 15 plan (the oracle residual: how much of step 11's localisation loss is the residual and how much the nominal model; milestone 3, H3), written before any oracle residual or localisation was computed

  • Why now. Step 14 found the published SCADA pressures equal the leak-free L-TOWN_Real.inp simulation to 0.01 m. So real minus leak-free simulated pressure, D(h), is the leaks' own pressure effect with no demand or model error in it: the best residual any detector could have. Steps 11 and 12 could not say whether the nominal-model localiser lost to the most-affected sensor because its residual (D1's regression) was poor or because L-TOWN.inp is the wrong model. Localising on D with the same nominal signatures splits the two: what is left is model mismatch (and other leaks running at the same time).
  • Seen before writing this. Steps 1 to 14's results (step 11's 15 of 32 oracle-timed leaks within 300 m for the model, 13 for the most-affected sensor; step 14's fidelity and alarm counts). No oracle residual has been computed at any leak, and no localisation on one.
  • Simulation. Step 14's leak-free history, the continuous two-year run (--continuous; the published T1 level is continuous across New Year, and step 14 found it gave identical alarms), rounded to 0.01 m, hourly means. D(h) = published minus simulated hourly pressure at the 33 sensors.
  • Leaks and times. Step 11's 32 oracle-timed leaks (every scored new leak of 2018-19, at the first hour t its flow reaches half its peak), unchanged.
  • Residuals. O-all: mean D over [t, t + 24), every running leak in it. O-inc (primary): mean D over [t, t + 24) minus mean D over the 24 h before the leak's onset hour, so leaks already running and steady drop out; leaks that start or grow in between stay in as noise.
  • Estimates. (A) step 11's method unchanged: nominal L-TOWN.inp 24 h mean signatures at q = 5 m³/h, argmax Pearson; (S) the same signatures at the grid q ∈ {1, 2, 5, 10, 20, 30} nearest in log scale to the leak's own mean flow over [t, t + 24) from the leakage files (an oracle size); (M) the most-affected sensor (most negative r). Scored by step 11's 300 m along-pipe rule, chance by its Poisson-binomial tail, paired exact sign tests on discordant 300 m hits.
  • Comparisons. A on O-inc against step 11's A on the D1 residual (15 of 32), and against M on O-inc; both on the same 32 leaks.
  • Predictions, to be reported held or failed. (a) A on O-inc puts more than 15 of the 32 within 300 m. (b) A on O-inc puts at least 16 of 32 (50%) within 300 m: the nominal model's ceiling meets H3's bar when the residual is perfect. (c) A on O-inc does not separate from M on O-inc at P < 0.05 (sign test). (d) The best Pearson score on O-inc has a median of at least 0.9 across the 32 (the nominal signatures fit the true leak effect closely in shape).
  • Also reported, no verdict. O-all with A and M; S on both residuals; the Pearson correlation between step 11's D1 residual and O-inc per leak; and a visibility delay per leak: the first hour from onset at which the hourly D minus its pre-onset 24 h mean is at or below −0.05 m (five rounding steps) at some sensor for 3 hours running, against the alarm delays of D1-F and LILA-auto on the 2019 leaks they detected (a floor on detection delay at the published resolution, with other leaks' changes counting against it).
  • Caveats fixed now. O-inc uses the leak list, so it is an oracle bound, not a method. One network model, the generator's, and its leaks were simulated by the generator (emitters, perhaps pressure-driven), while the signatures are constant demands on the nominal model; that gap is part of what is measured.

2026-11-14 · Step 14 outcome: on the leak-free L-Town, the pressure detectors are silent (0 and 1 alarms in 716 days) and the night-flow detectors alarm as often as on the real data; M3's leak-free alarms are credited with 14 of 19 new 2019 leaks, more than its real 13

  • Ran as planned, one primary run and no code change after it bar output formatting (numpy integer types in the prediction lines; no number moved). EPANET over two years at 5-minute steps took about 4 minutes; the six detectors about 3.
  • Fidelity (a: held). Over the 336 hours of 2018 with total leak flow under 1 m³/h (the first two weeks of January), the median absolute hourly difference between the published and the simulated pressures is 0.0000 to 0.0008 m at all 33 sensors; at 5 minutes, 99.6% of the first week's published readings equal the simulation rounded to 0.01 m. Inlet flows agree to 0.015 m³/h and T1 to 0.001 m in those hours. The published SCADA data are this model's output plus the leaks, rounded to 0.01, with no measurement noise added, so no noise seeds were run and the null is one deterministic history (the 20-seed requirement of the proposal is not met by this step). Over all hours the published pressures sit up to 0.6 m (median, n410) below the leak-free ones: the leaks' own signature.
  • Detectors on real data reproduce step 8's alarm lists exactly (all six).
  • Null alarms over the 716 scored days (real alarms in brackets): D1-F 0 (26), LILA-auto 1 (26), M1 28 (25), M2 4 (15), M3 31 (29), M4 18 (25). (b) failed (D1-F raised none), (c) failed (M1 and M3 raise more on the leak-free year than on the real one).
  • Null credit (d: held). Scored against the real leak list by step 1's harness, the leak-free alarms are credited with 0 (D1-F), 0 (LILA-auto), 9 (M1), 1 (M2), 14 (M3) and 8 (M4) of the 19 new 2019 leaks. M3's real 2019 count was 13, and step 8's flow-gated 15 of 19 (P = 0.001) was its headline. Random alarms at the same counts score medians of 12, 2, 13 and 8, so the leak-free night-flow alarms score like random ones.
  • Also reported (declared before any detector ran). Real alarms within 48 h of one of the same detector's null alarms: D1-F 0 of 26, LILA-auto 0 of 26, M1 6 of 25, M2 1 of 15, M3 8 of 29 (4 of its 13 real 2019 true positives), M4 4 of 25.
  • Seen after the run. The null alarms fall on the same calendar dates in both years (M1: 06-16, 08-04, 08-24, 09-15, 10-27, 11-10 and 12-22 in each), because the file holds one year of demand patterns, and the published 2019 AMR demands equal 2018's at 98.6% of 5-minute marks. The published T1 level is continuous across New Year (3.40 to 3.41 m), while the primary run restarted 2019 at the file's 3.5 m. A continuous two-year run (--continuous, declared after these results) gives identical alarm lists for all six detectors (results_continuous.txt). LILA-auto's one null alarm is 2019-01-10 04:00 at sensor index 2 (n31).
  • What it changes. For H1, the counterfactual sharpens the restated claim from both sides. The pressure detectors' alarms on the real data are caused by leaks: none of their 26 sits within 48 h of a leak-free alarm, so every one of their alarms disappears when the leaks are removed: their "false" alarms respond to leaks that the 30-day matching does not credit (leaks already running, or matched to another leak), not to the network's own demand and pump cycle. Their near-chance detection-only counts come from matching alarms to many overlapping leaks, not from alarms the network raises by itself. The night-flow statistics are dominated by the demand year itself: a run with no leaks gets as many alarms and as much credit, so steps 6 to 10's night-flow results (including step 8's M3 P = 0.001) carry no evidence of detection. For H2: L-Town's leak-free rate is close to zero for the residual detectors without any calibration, so certifying α there is easy and says little; the test that bites is a null with demand uncertainty the model does not carry, which the generator did not add. Interpretation, not tested: since L-TOWN_Real.inp is public, a residual against it is an oracle detector, and an L-Town result that used that file is not comparable with blind ones.
  • Output: experiments/step14-leakfree/results.txt, results_continuous.txt, fidelity.tsv, alarms.tsv, null_alarms.svg; the simulation is cached outside the repository.

2026-11-14 · Step 14 plan (milestone 4: a leak-free L-Town 2018-19 simulated from L-TOWN_Real.inp, and every frozen detector run on it; H1 and H2), written before any simulation was run

  • Why now. Steps 1 to 13 can only compare a detector with random alarm times. The BattLeDIM README (Zenodo record 4017659) says L-TOWN_Real.inp is "the model of the network used to generate the datasets ... It does not contain any leakages." Simulated over 2018-19, it is the benchmark's own counterfactual: the SCADA a year with no leaks would have produced. A detector's alarms on it are false by construction, so it gives each detector's real null rate, and scoring those null alarms against the real leak list measures how many of 2019's leaks the harness credits to alarms that no leak caused. Zenodo serves the 177 MB file to this session.
  • Seen before writing this. The file's first 33 MB (header, junctions with per-node patterns P-Res-<n>, section list). No simulated value and no detector output on simulated data.
  • Simulation. EPANET 2.2 through WNTR's toolkit wrapper, the file's own options, times and controls, stepped hydraulically and read at the 33 pressure sensors, the three SCADA flows (p227, p235, PUMP_1) and tank T1's level at every 5-minute report time from 2018-01-01 00:00 to 2019-12-31 23:55; then hourly means as every detector uses. Leak-free by construction (no emitters added).
  • Fidelity check, reported before any detector runs on it. Per sensor, real minus simulated hourly pressure over the 2018 hours with total leak flow (2018 leakage file) under 1 m³/h, and over all of 2018-19: median and 95th percentile of the absolute difference, and the 5-minute first-difference lag-1 autocorrelation of the residual (near −0.5 means white measurement noise was added to the published data). The same for the flows and T1. If the published data carry white noise, the null runs add Gaussian noise of each sensor's measured residual sd at 5 minutes before the hourly mean, 20 seeds; if not, the null is one deterministic run and the 20-seed requirement of the proposal is not met by this step (said so in the outcome).
  • Detectors. The six of step 8 at their frozen 2018 settings (experiments/step8-gated/run.py, alarm_lists: D1-F h = 240, LILA-auto δ = 1, C = 20, M1 to M4), unchanged, run on the simulated pressures, flows and level (M3 and M4 subtract the real AMR demands, which L-TOWN_Real.inp's demands produced). Before any null run, alarm_lists on the real data must reproduce step 8's alarm lists.
  • Measured. Per detector: null alarms over the scored period (2018-01-15 to 2019-12-31) and per 90 days, against its alarms on the real data; and the null alarms scored by step 1's harness unchanged (30-day window, 19 new 2019 leaks, ungated), giving the "null credit": 2019 leaks a leak-free run is credited with.
  • Predictions, to be reported held or failed. (a) Fidelity: if the simulation is the generator's, the median absolute hourly pressure difference over low-leak 2018 hours is under 0.1 m at 30 or more of 33 sensors. (b) Every pressure detector (D1-F, LILA-auto) raises at least one null alarm over 2018-19 (their thresholds were tuned on data with leaks in every window). (c) Null rate below real rate: each detector's null alarm count is below its real count. (d) Null credit: at least one of the six detectors' null alarms are credited with 3 or more of the 19 new 2019 leaks.
  • Amendment, before any detector ran on simulated data (after a 3-day test run of the simulator and a look at the published files' first rows): the simulated n1 and n54 at 00:00 were 28.919 and 37.129 m against the published 28.92 and 37.13, so the published values look like the model's output rounded to 0.01 m. The simulated series are rounded to each published file's decimal places before the hourly mean. Also reported, no verdict: how many of each detector's real alarms (and of its 2019 true positives) fall within 48 h of one of its null alarms, which would mark them as raised by the network's own demand and pump cycle rather than by a leak.
  • Caveats fixed now. One network model, the generator's; EPANET demand-driven, while the generator may have used WNTR's pressure-driven solver (the fidelity check says whether that matters); no demand uncertainty beyond what the file holds, so this is one leak-free history, not a distribution of them.

2026-11-14 · Step 13 outcome: the published SICAMS times beat chance thinly; an automatic SICAMS does not, and its false alarms do not transfer from 2018

  • Ran as planned, one run, no code change after it. About 2 minutes. Area A trains on 1,682 hours (69 to 71 per hour-of-day cluster, s = 32); C on 402 (33 per 2-hour cluster, s = 4); B on 8,332.
  • Published times (paper's Table 1 on our harness, detection only): 13 of 19 at 27 alarms, chance median 10 (6 to 13), P = 0.057; with the stated false alarm added, 14 at 28, P = 0.026. The paper's 14 becomes our 13 because the greedy 30-day match credits the p721 alarm to p800 (later onset); the added alarm lands in p762's window. Within 72 h: 9, P < 0.001.
  • SICAMS-auto (primary): 2018 rule picks c = 100 (1 2018 false alarm); 2019 13 of 19, 26 false alarms, 48 alarms, P = 0.82; within 72 h 9 (P = 0.001); sensor within 300 m 5 of 13 (P < 0.001). α does not matter (B raises 2 alarms and C 1 at every α; C's filter stays on from p257 in January 2018). Secondary (B, C re-anchored): 13 of 19, 28 false alarms, P = 0.93; it gains p280 and loses p680.
  • Grid: no setting's detection count beats chance (P 0.107 to 0.99); every setting's location count does (P ≤ 0.010).
  • Predictions. (a) fewer than 14: held (13). (b) published times beat chance at P < 0.05: held as specified (0.026), not without the extra alarm (0.057). (c) location P < 0.01: held. (d) detection count not beating chance: held.
  • Seen after the run (figure, not pre-registered): the false alarms are PELT starts at 02:00 to 04:00 every few days from September 2019; the T² moving average's daily swing grows with the concurrent leak load, so a penalty tuned on 2018 over-segments 2019. The statistic drops at the repairs in February and October 2019.
  • What it changes. H1 restated holds for a third method and for a published entry's own times. Milestone 2 is done. For H2 it is direct evidence that an FP rate tuned on one year does not transfer (1 to 26), the case for a rate certified on leak-free simulated years (milestone 4; L-TOWN_Real.inp is reachable on Zenodo from this session).

2026-11-14 · Step 13 plan (SICAMS reimplemented, automatic, and the published SICAMS times chance-corrected; milestone 2, H1), written before any SICAMS statistic was computed

  • Why now. Milestone 2's second half. arXiv refused earlier sessions; this session reached it and read Melnikov (2025), arXiv:2512.15685, in full (sections 3 to 5 and Appendix A, Table 1). Zenodo is reachable too.
  • Seen before writing this. Steps 1 to 12's results, and the paper's own per-leak table (Appendix A, Table 1: detection time for each 2018 and 2019 leak; 14 of the 19 new 2019 leaks detected; p426 flagged as mislocalised; p680's detection time printed as 19-06-13 11:00, before its 19-07-10 onset, with Δt = 2 h). No SICAMS statistic, PELT segmentation or filter state has been computed on any L-Town data.
  • What the paper leaves open, fixed now. Training periods were picked by hand from the 2018 leak list, area C was retrained by hand before p31 and p277, and PELT's penalty and Algorithm 2's α and slope threshold δ are not stated. SICAMS-auto fixes them by rule and tunes the free ones on 2018 by step 2's rule (most 2018 true positives with at most 2 2018 false alarms; ties: fewer false alarms, then the larger penalty, then the smaller α).
  • SICAMS-auto. Hourly means (as every detector here). Temporal clusters as the paper: hour of day in A and 2-hour blocks in C; one cluster in B. Per cluster, sample mean and covariance and T²<sub>F</sub> = (n − s)/(s(n − 1)) T² (eqs. 9, 10). Area A: 29 pressure sensors, flows p227 and p235, level T1 (s = 32); training = the 2018 hours at which every active leak (2018 leakage file, flow > 0) is p257 or p427, as the paper. 12-hour moving average, standardised by its sd over the training hours; PELT (Killick et al. 2012), Gaussian mean-change cost, minimum segment 24 h, penalty c · log n, c ∈ {1, 3, 10, 30, 100, 300, 1000, 3000}, run on each year separately (offline, as BattLeDIM scored and as the paper ran it); Algorithm 2 with paired t-tests on bisected intervals at α<sub>t</sub> = 0.05 and slope threshold δ ∈ {0, 0.001, 0.01} (standardised units per hour; 0 removes nothing); an alarm at every SCP labelled "anomaly start". Area B: n215 alone (s = 1), training = 2018 outside p673's leak hours. Area C: n1, n4, n31 and T1 (s = 4), training = 2018-01-01 to 2018-01-17 18:00 (the paper's interval). B and C: Algorithm 1's hysteresis filter on the 12-hour moving average, θ<sub>1</sub> = F<sub>1−α</sub>(s, n − s) at the median cluster size n, θ<sub>0</sub> = (n − s)/(n − s − 2) (eq. 14; 1 for s = 1), α ∈ {10<sup>−2</sup>, 10<sup>−3</sup>, 10<sup>−4</sup>, 10<sup>−5</sup>}, one alarm per False→True switch. Primary: the union of A, B and C, no retraining. Secondary: B and C re-anchored after each alarm (retrain on the 14 days from 7 days after it, filter off until then), an automatic stand-in for the paper's manual retraining.
  • Alarm sensor (for the 300 m rule): the paper's pre-localisation reduces to the most out-of-range sensor (its section 5.2, maximum principle), so the area's pressure sensor with the largest mean z² (eq. 16, cluster mean and sd) over the 12 hours ending at the alarm.
  • Published SICAMS, chance-corrected. The paper's Table 1 detection times as alarms on our harness (p680 at onset + 2 h, from its Δt column), scored for detection only (the table names no sensor) with the same chance level at that alarm count, plus the paper's stated 2019 false alarm (p426) as an extra alarm at its detection time. This is a chance level for a published L-Town entry's own times, which no paper reports.
  • Scoring. Step 1's harness unchanged: 30-day window, scored from 2018-01-15, 19 new 2019 leaks; chance from 1,000 draws of the same alarm count at random hours at least 24 h apart (PELT's minimum segment) from random sensors.
  • Predictions, to be reported held or failed. (a) SICAMS-auto detects fewer of the 19 new 2019 leaks than the paper's 14. (b) The published SICAMS times beat chance on the detection-only count at P < 0.05. (c) SICAMS-auto's location-aware count (alarm sensor within 300 m) beats chance at P < 0.01. (d) SICAMS-auto's detection-only count does not beat chance at P < 0.05.

2026-11-14 · Step 12 outcome: neither a time-resolved signature nor a flow-balance leak size helps; H3 refuted under the primary method

  • First run's gate failed, and the cause was a scoring defect, not a result. The 24 h means of the new hourly signatures differ from step 11's by up to 1e-5 m (float32 order of operations), and that flipped 4 of step 11's 59 rows. Two (p461, p810, oracle-timed) are exact ties between identical neighbouring junctions (score gaps 8e-7 and 1e-5). The other two: junction n111's signature is a uniform shift at all 33 sensors (centred RMS exactly 0 by step 11's route, 5e-7 m of rounding noise by the hourly route), so its Pearson score is set by rounding. The same thing had happened in step 11 itself at q = 1 and q = 20 for D1-F's p455. Fix, made after the first run (whose counts had been printed and seen; the fix is mechanical and changes no setting): localise.scores gives 0 to any signature whose centred RMS is below 1e-4 m, and the gate counts candidates scoring within 1e-4 as numerical ties. Step 11 rerun with the fix: every hit and error unchanged; one line moves (D1-F stability in q, 23% → 31% same junction). The first run's output is kept as results_firstrun.txt; its counts are the same as the final run's except on the 32 oracle-timed leaks, where n111 had won by rounding: A 14 (final 15) and C 13 (final 14). B, D and both detector-timed sets are unchanged.
  • Gate (final run): passed, two numerical ties. 4,692 EPANET runs (782 junctions × q = 1, 2, 5, 10, 20, 30), about 4 minutes on 4 cores.
  • Within 300 m (D1-F 13 / LILA-auto 14 / oracle 32): A (step 11) 4 / 5 / 15; B time-resolved 2 / 3 / 11; C size-matched 3 / 4 / 14; D time-resolved and size-matched (primary) 3 / 4 / 12; most-affected sensor 5 / 5 / 13. All are above chance except B on D1-F (P = 0.11). Against the sensor: smallest Holm P 1.000 in every set. D against A on the 32: D-only 0, A-only 3 (P = 0.25). Median errors on the 32: A 437, B 712, C 613, D 746, sensor 420 m.
  • H3 under D: refuted for both detectors (23% and 29%, below the 30% line). Under step 11's method A it stays inconclusive (31%, 36%).
  • Predictions. (a) q̂ within a factor of 2 of the leak's flow for ≥ 70% of the 32: failed, 12 of 32 (38%). The supply residual's day-to-day noise is the size of the leaks: q̂ is negative for 6 of the 32. (b) D beats A on the 32: failed (12 against 15). (c) No method separates from the sensor at Holm 0.05: held. (d) H3 not held under D: held (refuted).
  • After-the-run diagnostic (diag_switch.py, declared after the results were read). The nominal model's PUMP_1 switches on T1's level (closed above 3.9 m, open below 2.4 m). A leak at any of 92 junctions moves the switch by an hour, which puts up to 0.87 m on sensor n54 at hour 17 even at q = 1 (every other hour: at most 0.10 m). Leaving hours 15 to 17 out cuts B's and D's median errors (712 → 581 m, 746 → 563 m) but not their 300 m hits (11 → 10, 12 → 12). So the switch adds noise but does not explain the loss. The time-resolved residual carries the real network's demand timing, which the nominal patterns do not match hour by hour, and the 24 h mean averages that mismatch away.
  • What it changes. Two cheap fixes to the nominal-model localiser make it worse, not better. On L-Town, the 24 h mean at a fixed q is the strongest model-based variant tried, and still no better than naming the most-affected sensor. A model-based method will have to calibrate demands (AMR plus inflow) and the T1/PUMP_1 state to the day before it can be expected to beat the sensor. The flow balance from two inflow meters cannot size leaks of 5 to 30 m³/h within a factor of 2 over 24 h: that needs the night-flow window or the AMR, as steps 6 and 7 found for detection.

2026-11-14 · Step 12 plan (time-resolved and size-matched signatures, H3), written before any new signature or localisation was computed

  • Why. Step 11's "Next for H3" named two fixes to the nominal-model localiser: a time-resolved signature instead of a 24 h mean, and a leak size taken from the flow balance instead of a fixed q (its prediction (d) failed: the argmax moves with q because the response is not linear in q). Both use only the files step 11 used (L-TOWN.inp, pressures, flows, levels, leak lists). A demand-calibrated model stays for a later step.
  • Seen before writing this. All of step 11's results and leaks.tsv (every leak's estimate under the 24 h mean at q = 1, 5, 20, and the most-affected sensor). No hourly signature, no flow-balance leak estimate and no localisation at any q other than 1, 5, 20 has been computed.
  • Signatures. As step 11 (WNTR 1.5.0, EPANET, nominal L-TOWN.inp, 24 h from 00:00, hourly), now keeping all 24 hourly pressure changes at the 33 sensors, for each of the 782 junctions at q ∈ {1, 2, 5, 10, 20, 30} m³/h (4,692 runs). Gate: the 24 h mean of the q = 1, 5, 20 hourly signatures must reproduce step 11's estimates for every leak in its three sets; if not, stop and report.
  • Residuals. Step 11's D1 no-flow regression (same window [d − 21, d − 7), same 24 h from the localisation hour t), now kept hour by hour: R[k, s] for k = 0..23. The time-resolved signature row used for R[k] is the hour of day of t + k.
  • Leak size from the flow balance. Supply = p227 + p235 (the two reservoir inflows; PUMP_1 is internal, area A to T1). Its residual under the same regression design (48 hour-of-day × weekday/weekend columns plus the T1 level) on the same training window, averaged over the same 24 h, is q̂. The signature used is the grid q nearest q̂ in log scale, clipped to [1, 30]. Reported against the leak's own mean flow over the same 24 h (from the leakage files): share within a factor of 2.
  • Methods. A: step 11's (24 h mean, q = 5, Pearson), reproduced. B: time-resolved, q = 5 (Pearson over the 24 × 33 entries, each hour's row centred by its own sensor mean). C: 24 h mean at q̂. D (primary): time-resolved at q̂. Baseline: the most-affected sensor (most negative 24 h mean residual), as step 11.
  • Sets and scoring. Step 11's three: D1-F's 13 and LILA-auto's 14 detector-timed 2019 leaks (H3), and the 32 oracle-timed leaks of 2018 and 2019. The 300 m along-pipe rule, the Poisson-binomial chance tail, and exact sign tests on discordant 300 m hits against the most-affected sensor, Holm across the four methods within each set.
  • H3. Read on D: held at ≥ 50% within 300 m, refuted below 30%, inconclusive between, for D1-F and LILA-auto separately.
  • Predictions, to be reported held or failed. (a) q̂ is within a factor of 2 of the leak's mean flow for at least 70% of the 32 oracle-timed leaks. (b) D puts more of the 32 oracle-timed leaks within 300 m than A (more than 15). (c) No method separates from the most-affected sensor at Holm 0.05 on the 32 (the model is nominal, not calibrated). (d) H3 remains inconclusive or refuted for both detectors under D (below 50%).

2026-11-13 · Step 11 outcome: localisation beats chance tenfold, H3 inconclusive (31% and 36%), and the nominal model adds nothing over the most-affected sensor

  • Ran as planned, one run, no code change after it. 2,346 EPANET runs (782 junctions × q = 1, 5, 20 m³/h) plus the base, about 6 minutes on 4 cores. The plan's training window [d − 21, d − 7) was coded with a clip at day 0 and a 7-day minimum; no localisation hour needed it (the earliest is 2018-02-02, day 32).
  • Chance. A random junction is within 300 m (along pipes) of a leak pipe for 4.3% of junctions at the median leak, so 0.57 of 13, 0.59 of 14 and 1.40 of 32 leaks are expected.
  • H3, detector-timed, 2019. D1-F's 13 detected leaks: the model puts 4 within 300 m (31%, P = 0.002), median error 573 m. LILA-auto's 14: 5 (36%, P = 0.0002), median 468 m. Both sit in the proposal's inconclusive band (30 to 50%): H3 neither held nor refuted.
  • Oracle-timed, 32 leaks (2018 and 2019, at half-peak flow): model 15 of 32 within 300 m (47%, chance 1.4, P < 0.0001), median 436 m; cosine 13; the most-affected sensor (no model) 13, median 420 m. Paired: model only 6, sensor only 4, sign test P = 0.75; the model is closer on 19 leaks, the sensor on 12. Across all three sets the model and the model-free sensor are not separable.
  • Predictions. (a) H3 not held for either detector: held (31%, 36%; inconclusive, not refuted). (b) Oracle-timed beats chance at P < 0.05: held. (c) Model's median error below the sensor's on the 32: failed (436 against 420 m). (d) Same junction at q = 1, 5 and 20 for ≥ 80%: failed, 12% (q = 1 agrees with q = 5 for 62%, q = 20 for 19%). The largest signature is 0.04, 0.32 and 2.8 m for q = 1, 5 and 20: the response is not linear in q (head loss grows faster than flow near the leak), and neighbouring junctions have near-identical signatures at 33 sensors, so the argmax moves between neighbours.
  • What it changes. For the paper: on L-Town the 300 m location rule is easy to beat by chance correction (both methods ~10 times chance) and hard to win by modelling: a nominal-model sensitivity matrix, without calibration, does no better than naming the sensor whose pressure fell most. The slow ramps (p193, p277, p455, p123) are lost by every method; of the 15 leaks that reach half their peak within an hour of onset, 10 are within 300 m. Next for H3: a calibrated model (demands from the AMR and inflow, leak size from the flow balance) and a time-resolved signature instead of a 24 h mean, both pre-registered against the most-affected sensor as the baseline to beat.

2026-11-13 · Step 11 plan (model-based localisation on the nominal model, H3), written before any sensitivity or localisation was computed

  • Why now. Milestone 3 and H3 are untouched; SICAMS (milestone 2) needs Melnikov (2025), and arXiv and Zenodo both refused this session's proxy. Localisation needs only the pressures, the leak list and L-TOWN.inp, all from the pinned GitHub mirrors with matching SHA-256s. WNTR 1.5.0 is installed from PyPI.
  • Seen before writing this. Steps 1 to 10's results, including each detected 2019 leak's alarming sensor and its along-pipe distance (step 1: D1-F's alarming sensor within 300 m for some leaks, location beating chance at P < 0.001). No hydraulic simulation of L-Town has been run in this programme, and no pressure residual has been compared with any model signature.
  • Sensitivity model (fixed now). L-TOWN.inp as given (nominal demands, patterns, the three PRVs, tank T1), WNTR's EPANET simulator, 24 h from 00:00 at hourly reports. For each junction j a constant extra demand q at j; its signature s<sub>j</sub> is the 24 h mean of p<sub>leak</sub> − p<sub>nominal</sub> at the 33 pressure-sensor nodes. Primary q = 5 m³/h; q = 1 and 20 as a linearity check.
  • Observed residual. For a localisation time t (hour): per sensor, fit step 1's D1 regression without flows (48 hour-of-day × weekday/weekend columns plus tank level) on the 14 days [d − 21, d − 7) of hourly means, d = t's day; r = mean of (pressure − prediction) over the 24 h from t, in metres. No threshold or setting is tuned.
  • Estimate. The junction with the largest Pearson correlation between r and s<sub>j</sub> across the 33 sensors (primary; the standard of sensitivity-based isolation); cosine similarity as a secondary. Error: along-pipe distance from that junction to the leak pipe's midpoint (network.pipe_dist), the 300 m rule as BattLeDIM scored it.
  • Leaks and times. (i) Detector-timed: the 2019 new leaks D1-F (step 1, h = 240) and LILA-auto (step 2, index ties, δ = 1, C<sub>thr</sub> = 20) detected under the ungated 30-day rule, at their alarm hour from those steps' alarms.tsv (H3 is about these). (ii) Oracle-timed: every scored new leak of both years (32), at the first hour its own flow reaches half its peak, to separate localisation error from detection timing.
  • Baselines and chance. The model-free most-affected sensor (most negative r) and the detector's alarming sensor, each scored by the same 300 m rule. Chance: a junction drawn uniformly; for each leak the exact share p<sub>i</sub> of junctions within 300 m; the count's Poisson-binomial tail gives P(chance ≥ observed). Paired comparison of model-based against most-affected sensor by an exact sign test on discordant leaks.
  • H3 (proposal). Held if at least half of the detector-timed leaks are within 300 m, refuted below 30%, inconclusive between; stated for D1-F and LILA-auto separately.
  • Predictions, to be reported held or failed. (a) H3 is not held for either detector (under half within 300 m): the nominal model's demands differ from the real ones and 33 sensors are sparse. (b) Oracle-timed model-based localisation beats chance at P < 0.05 on the 32 leaks. (c) Its median error is smaller than the most-affected sensor's on the same 32 leaks. (d) The estimate is stable in q: the same junction for q = 1, 5 and 20 for at least 80% of the 32 leaks.

2026-11-13 · Step 10 outcome: cross-fitted on 32 leaks, no detector beats chance after Holm at the primary rule; M3's 2019 lead does not carry to 2018

  • Ran as planned. The six forward-fold alarm lists equal their steps' alarms.tsv, and each grid run at the forward setting reproduced step 8's list (D1-F, LILA-auto, M1, M3; M2 and M4 differ by design, their weekday offsets now come from 2019). No code changed after the first run. One unit test added for 2018-as-test-year scoring (a December leak matched by a January alarm is not a 2018 detection).
  • Reverse-fold settings (chosen on 2019): D1-F h = 240 (unchanged), LILA-auto δ 1 → 2 and C<sub>thr</sub> 20 → 10, M1 h 3 → 5, M2 12 → 3, M3 3 → 8, M4 3 → 30. Five of six thresholds move when the tuning year changes.
  • Held-out 2018 (13 scored leaks), primary rule: D1-F 8, LILA-auto 9, M1 6, M2 7, M3 6, M4 2 (false alarms 2, 3, 2, 2, 1, 0). M3, best on 2019 (15 of 19), finds fewer 2018 leaks than D1-F, LILA-auto and M2.
  • Pooled (32 leaks), primary rule (30 d, φ = 1): D1-F 19 (chance median 18, P = 0.307), LILA-auto 22 (19; P = 0.049), M1 19 (0.099), M2 15 (0.337), M3 21 (17; P = 0.045), M4 14 (0.504). Holm across six: smallest 0.270. Ungated: LILA-auto 24 of 32, P = 0.004, Holm 0.024 (the only survivor); D1-F 22, P = 0.023, Holm 0.115.
  • Paired, 32 leaks: smallest Holm-adjusted sign-test P 0.861 (LILA-auto vs M4, 11 vs 3 discordant). Bootstrap TP(M3) − TP(D1-F) +2 (95% −4 to +8); LILA-auto − D1-F +3 (−3 to +9).
  • Predictions. (a) M3 pooled beats chance at Holm 0.05: failed (Holm 0.270). (b) D1-F pooled P ≥ 0.05: held (0.307). (c) No pair separable: held. (d) ≥ 3 of 6 settings change: held (5).
  • What it changes. Step 8's headline (M3 P = 0.001 under the gate) was a one-year result; on the other year with a threshold picked without its labels it does not repeat. The protocol claim gets a fifth clause: cross-fit thresholds across years and report the pooled, corrected result. LILA-auto under the ungated rule is the one detection-only count that survives everything so far, and the gate is what removes it. For power, 32 leaks are still too few; the next statistics step is simulated leak years from L-TOWN_Real.inp (milestone 4).

2026-11-13 · Step 10 plan (cross-fitted thresholds: tune on 2019, test on 2018; pooled tests), written before any reverse-fold score was computed

  • Why. Step 9's paired tests had 19 leaks and little power; its "Next" was to pool more leaks under cross-fitted tuning. Every detector's threshold so far was chosen on 2018 and tested on 2019. Choosing it on 2019 and testing on 2018 makes 2018's leaks a second, held-out test set, so each leak in both years is scored by a setting picked without its label.
  • Seen before writing this. Every 2018 tuning count each step printed at every grid point (2018 TP/FP under the ungated 30-day rule), and every 2019 result to step 9. No 2018 score under the gated rule, no reverse-fold selection and no pooled statistic has been computed. 2019 has been seen through all six detectors, and M2 to M4 were designed after 2019 scores; the cross-fit only removes label use from the threshold, not from design, and the paper must say so.
  • Reverse fold. Each of the six detectors reruns its own step's grid over 2018-19 (D1-F: h in step 1's 13 values; LILA-auto, index ties: δ in {1, 2, 4} × C<sub>thr</sub> in step 2's 9 values; M1 to M4: h in step 6's 9 values; M2 and M4's weekday offsets recomputed from 2019 nights, as the forward fold took them from 2018). Selection by the same rule with the years swapped: most 2019 new-leak detections at ≤ 2 2019 false alarms, ungated 30-day rule (the forward fold's), ties to fewer false alarms then the larger parameter(s). Then 2018's scored leaks (onset from 15 Jan 2018, the first scored hour) are scored once.
  • Rules scored. Primary w = 30 d, φ = 1 m³/h (step 8's); also φ = 0 (steps 1 to 7's). Leaks that never reach φ drop out and are listed.
  • Pooled test set. Forward fold (2018 settings, 2019 new leaks: step 9's lists) plus reverse fold (2019 settings, 2018 scored leaks). Per detector: pooled TP over pooled n, FP per fold. Chance: for each fold its own alarm count at random hours over 2018-19 (14 d apart) scored on that fold's test year, 1,000 draws (forward seed 0, reverse seed 1), summed draw by draw; P = P(chance sum ≥ pooled TP); Holm across the six detectors.
  • Paired, pooled, at the primary rule. For every pair, per-leak detection on the pooled leaks; exact sign test on the discordant leaks; Holm across 15 pairs. Bootstrap over pooled leaks (2,000, seed 9) of TP(M3) − TP(D1-F) and TP(LILA-auto) − TP(D1-F).
  • Predictions, to be reported held or failed. (a) M3's pooled count beats chance at Holm-adjusted 0.05 at the primary rule. (b) D1-F's pooled count does not (unadjusted P ≥ 0.05) at the primary rule. (c) Still no pair separable at Holm 0.05 on the pooled leaks. (d) The reverse fold picks a different setting from the forward fold for at least three of the six detectors (thresholds on 19 to 13 leaks are unstable).

2026-11-13 · Step 9 outcome: three of six verdicts flip with the matching rule; no pair of detectors separable on 19 leaks

  • Ran as planned. All six regenerated alarm lists equal their steps' alarms.tsv; the 30-day cells reproduce step 8's table exactly (and step 8 reran byte-identical). No code changed after the first run; harness.evaluate and null_metrics gained a window argument whose default keeps the 30 days.
  • Rules with P < 0.05 of six (14/30/60 d × φ 0/1): D1-F 2 (14 d and 60 d ungated: 0.030, 0.011), LILA-auto 6 (Holm across the six detectors: 2, both at 14 d), M1 4, M2 0, M3 3 (all gated: 0.012, 0.001, 0.006; Holm: 2), M4 0. Location (pressure detectors) P < 0.001 under all six. Chance medians rise with the window: 7 to 9, 10 to 12, 11 to 13 leaks.
  • Predictions. (a) M3 gated below 0.05 at every window: held. (b) D1-F never below 0.05: failed at 14 and 60 d ungated (at 60 d D1-F scores 15 of 19 with 0 false alarms; the longer window credits more of its late alarms). (c) No pair separable at Holm 0.05: held, smallest adjusted P 0.586 (M2 vs M3, 1 vs 8 discordant). (d) Chance medians non-decreasing in w: held.
  • Paired at the primary rule. D1-F vs M3: 1 vs 5 discordant leaks, P = 0.219; bootstrap TP(M3) − TP(D1-F) +4 (95% 0 to +8). LILA vs D1-F +2 (−3 to +7). p762 missed by all six; p331, p455, p514, p800 found by all six.
  • For the paper. The protocol claim is now concrete: report the window and gate, the chance level under that rule, a correction across the methods compared, and a paired test. On BattLeDIM 2019 alone the paired test has little power (19 leaks), so pooling more leaks (2018 under cross-fitted tuning, or simulated leak years) is the next statistics step, beside re-selecting thresholds under each rule.

2026-11-13 · Step 9 plan (matching-window ablation and paired tests), written before any windowed or paired score was computed

  • Why. Step 8 found the detection-only verdict turns on two or three leaks and on the matching rule. The proposal's ablation list has the window (14, 30, 60 days), and step 8's "Next" asked for a paired test between detectors. Both are scoring-only: no detector, threshold or alarm changes.
  • Seen before writing this. Everything in step 8's results.txt (30-day window at φ ∈ {0, 0.5, 1, 2, 5}). No score under a 14- or 60-day window has been computed, nor any paired statistic.
  • Grid. Match window w ∈ {14, 30, 60} days × φ ∈ {0, 1} m³/h, the six detectors at their own steps' 2018 settings (alarm lists regenerated and checked against each step's alarms.tsv, as step 8). The window bounds both the alarm-to-gate interval and, as before, the leak's end. Chance level under the same (w, φ) rule: harness.null_metrics, 1,000 draws, seed 0, 14-day spacing (the detectors' blind time, unchanged with w). Reported per cell: 2019 TP of 19, FP, chance median and 95% range, P(chance ≥), and P Holm-adjusted across the six detectors in that cell.
  • Paired tests at the primary rule (w = 30, φ = 1). For every pair of the six detectors, per-leak detection on the 19 new 2019 leaks; exact two-sided sign (McNemar) test on the discordant leaks; Holm across the 15 pairs. For M3 against D1-F and LILA-auto against D1-F, also a bootstrap over leaks (2,000, seed 9) of the TP difference, with its 95% interval.
  • Predictions, to be reported held or failed. (a) M3 beats chance (P < 0.05, unadjusted) at φ = 1 for all three windows. (b) D1-F does not (P ≥ 0.05) in any of the six cells. (c) No pair of detectors differs at Holm-adjusted 0.05 at the primary rule: 19 leaks cannot separate 11 from 15 detections. (d) Chance medians rise with w at both φ (more of the year inside some leak's window).

2026-11-13 · Step 8 outcome: under a flow gate the detection-only ranking flips; two of three predictions failed

  • Ran as planned. All six regenerated alarm lists equal their steps' 2019 alarms.tsv. No leak is dropped at any φ (every 2019 leak reaches 5 m³/h). Gate lags at φ = 1: 0 to 1 h for abrupt leaks, 107 to 603 h for the ramps and slow onsets (p123 573, p193 463, p277 603, p455 497, p879 280, p586 163, p653 258, p721 324, p762 307, p800 107).
  • At φ = 1 (primary), 2019 detected of 19 / FP / P(chance ≥): D1-F 11/4/0.319, LILA-auto 13/2/0.013, M1 13/3/0.013, M2 8/0/0.131, M3 15/3/0.001, M4 12/2/0.058. Ungated: 13/2/0.105, 14/1/0.019, 10/6/0.796, 7/1/0.570, 13/5/0.317, 10/4/0.796. M3 is below 0.005 at every φ in {0.5, 1, 2, 5}; D1-F is never below 0.05. Location (alarming sensor within 300 m) beats chance for D1-F and LILA at every φ (P < 0.001).
  • Predictions: (a) D1-F 7 → 5 small leaks, LILA-auto 7 → 7: failed (LILA's ramp credits are re-earned by later alarms: p123 at 322 h, p193 at 77 h, p455 at 255 h after the gate). (b) LILA-auto P = 0.013: failed. (c) H4 under the gate, M4 689 h against D1-F 115 h: held (refuted again).
  • Mechanism, alarm by alarm. The swing is small: D1-F loses p123, p193 (alarms before the gate) and p426 (its alarm reassigned to p455), gains p721; M3 gains p455 and p586 and turns three ungated false alarms into hits through latest-gate-first reassignment and p721's later window. Two or three leaks out of 19 separate "at chance" from "beats chance"; the paper should say the detection-only count on L-Town is fragile to the matching rule, and report a gated and an ungated score side by side.
  • Multiplicity. Six detectors at one φ is six tests; M3's 0.001 survives a factor of 6, LILA's 0.013 does not. Five φ values were reported, not chosen among; φ = 1 was fixed in the plan.
  • Next. Re-select thresholds on 2018 under the gate; the 14/60-day window ablation, gated and ungated; a paired bootstrap between detectors.

2026-11-13 · Step 8 plan (flow-gated matching), written before any gated score was computed

  • Why. Step 7 found that the 30-day match window credits detectors with ramp leaks at the hour the leak carried 0.01 to 0.22 m³/h, which no SCADA statistic can see. Claim 1 (the chance-corrected protocol) needs a matching rule that does not reward that.
  • Rule (fixed now). For each leak, the gate g(φ) is the first hour whose hourly-mean leak flow (from <year>_Leakages.csv) is at least φ m³/h. An alarm at t can match the leak only if g(φ) ≤ t ≤ min(end, g(φ) + 30 d); greedy matching otherwise unchanged (latest gate first). Leaks that never reach φ drop out of the denominator and are listed. Primary φ = 1 m³/h (about 0.5% of L-Town's mean inflow; a round figure, not tuned: no gated score has been seen); sensitivity φ ∈ {0 (today's rule), 0.5, 2, 5}. Delay is reported from the gate (primary) and from onset.
  • Detectors fixed, scoring changes only. D1-F (h = 240), LILA-auto (index ties, δ = 1, C<sub>thr</sub> = 20), M1 (h = 3), M2 (h = 12), M3 (h = 3) and M4 (h = 3), each at the setting its own step chose on 2018 under the ungated rule; their full 2018-19 alarm lists are regenerated by the same code (the 2019 part must equal each step's alarms.tsv, else the step stops). Re-selecting thresholds on 2018 under the gated rule is a separate, later step.
  • Chance level for each detector under the same gated rule: its alarm count at random hours (14 d apart), random sensors, 1,000 draws, seed 0, as harness.null_metrics.
  • Predictions, written down to be checked. (a) D1-F's detections among the 9 leaks under 12 m³/h fall from 7 to 5 or fewer, LILA-auto's from 7 to 5 or fewer. (b) H1 as restated for the gated rule: LILA-auto's 2019 detection-only count is not below chance at P < 0.05 (step 2: P = 0.019 ungated). (c) H4 under the gate (median delay from the gate, 9 small leaks, misses infinite): M4 still not below D1-F. Each is reported held or failed as is.

2026-11-13 · Step 7 outcome: halving the night spread does not rescue MNF; the ramps are invisible to every detector

  • Units check passed. The 82 AMR meters carry 8.2% of the district balance in 2018 (median 17.9 of 216.6 m³/h); the nightly minimum of their sum is 4.9 m³/h against 82.1 for Q. Weekday offsets on Q, recomputed from 2018 alone: Fri +9.63, Sat +14.60 (step 6's weekly.py: +9.6, +14.6; its running median also saw the first nights of 2019, this one pads inside 2018).
  • Spread (14-day robust sd, 2018 median): M1 10.7 → M2 (weekday) 6.43, M3 (AMR-net) 9.48, M4 (both) 5.13 m³/h. The AMR term is worth about 1 m³/h alone and 1.3 on top of the weekday term.
  • H4, on the 9 leaks under 12 m³/h, 2019 scored once: M4 (primary) 3 of 9, median a miss, earlier than D1-F on 2 and later on 6, bootstrap 0.074: refuted. M2 2 of 9 (refuted); M3 6 of 9 but median 473 h (refuted). All 19: M4 10 with 4 false alarms (chance P = 0.80), M2 7 with 1 (15 alarms; P = 0.56), M3 13 with 5 (29 alarms; P = 0.32). The 2018 rule picked h = 3, 12 and 3.
  • Why, post-hoc and from the ground-truth leak flows (visible.py, after the scores): five of the nine (p123, p193, p277, p455, p879) are ramps whose own night flow is 0.1 to 0.5 m³/h at day 7 and 1.3 to 6.0 m³/h at day 30; the step a trailing-baseline detector can see within the 30-day matching window is at most 0.07 to 0.39 of M4's local spread. No night-flow statistic can find them inside the window. The four abrupt ones (5.3 to 10.9 m³/h) are 0.3 to 2.4 local sd.
  • What it changes for the comparator. The pressure detectors are credited with four of those ramps, at the hour the leak carried 0.02 (p455, D1-F and 0.01 for LILA), 0.10 (p123), 0.22 (p193) and 0.21 m³/h (p277, LILA). Those are almost certainly chance matches inside the 30-day window, not detections: H1's point in miniature. D1-F's 154 h median on the 9 owes its value to them; on the four abrupt small leaks D1-F's delays are 104, 71, 11 h and a miss. H4 as stated cannot be decided on BattLeDIM's incipient leaks under a 30-day window; the honest statement is that on the four abrupt small leaks pressure wins (D1-F 3 of 4, LILA 4 of 4, M4 2 of 4), and on the five ramps nobody detects within a month.
  • For the paper. A detection-only match window must be tied to the leak's own flow: an alarm should count only once the leak exceeds a stated flow (e.g. 1 m³/h), or the ramp leaks reward luck. That is a concrete rule for the chance-corrected protocol (claim 1), to pre-register in the next harness step and rescore D1, LILA and M1 to M4 under it.

2026-11-13 · Step 7 plan (the two MNF variants step 6 named), written before either was computed

  • Seen before writing this. Everything in step 6's results.txt, night.tsv and weekly.txt, including the post-hoc weekday offsets (Friday +9.6, Saturday +14.6 m³/h in 2018) and every 2019 M1 delay. So 2019 has been seen through M1 and its weekday pattern was found after the 2019 scores; the paper says both. No AMR demand value has been read: <year>_SCADA_Demands.csv was fetched for the first time in this step, after this entry.
  • M2, weekday baseline. Weekday offsets o<sub>k</sub> fixed from 2018 only, exactly as weekly.py computes them (each night's minimum minus the median of the 7 nights centred on it, mean by weekday of the night's date). m'<sub>d</sub> = m<sub>d</sub> − o<sub>dow(d)</sub>, then M1's detector unchanged (window, k = 0.5, re-anchoring, grid h ∈ {1, 2, 3, 5, 8, 12, 20, 30, 50}, step 1's selection rule on 2018).
  • M3, AMR-net night balance. Q' = p227 + p235 − A<sub>T1</sub> dL/dt − Σ AMR, the 82 AMR series of <year>_SCADA_Demands.csv as hourly means and converted from L/h to m³/h (BattLeDIM's documented units: flows m³/h, demands L/h). Sanity check fixed now, not a tuning knob: if the 2018 median of Σ AMR is not below the 2018 median of Q, the units are wrong; the step stops and says so rather than picking a factor. Then the nightly minimum of Q' and M1's detector, grid and rule as above.
  • M4, both. M3's series with weekday offsets recomputed on M3's own 2018 nightly minima. Declared primary for H4: H4 is said to be rescued only if M4 holds; M2 and M3 are reported to attribute the change. Three tries raise the chance that one holds by luck, and the results say so.
  • H4 test, unchanged from step 6. The 9 new 2019 leaks with peak under 12 m³/h; misses infinite; held if the median delay is below D1-F's 154 h. Reported with each: detections of 9, paired earlier/later counts against D1-F, the bootstrap of the median difference (seed 6, 2,000 resamples), all-19 detections and false alarms against the chance level, and the 14-day robust sd of the statistic in 2018 (step 6: 10.7 m³/h).
  • Expected. From weekly.py, removing weekday means cut the spread about a running median from 10.1 to 7.1 m³/h, so M2's robust sd should fall by roughly a quarter: still close to the 2 to 12 m³/h leak peaks, so M2 alone likely still misses most of the 9. M3 depends on how much of the night flow the 82 AMR customers explain, which has not been looked at; if their night use is small and smooth, M3 changes little.

2026-11-13 · Step 6 outcome: minimum night flow misses the small leaks; H4 refuted

  • Chosen on 2018: M1 with h = 3 (8 of 13, no false alarm; 25 alarms over both years). Code as planned; the only edits after the first run were output (a night.tsv series for the figure), and the rerun was byte-identical.
  • H4, on the 9 new 2019 leaks under 12 m³/h: M1 detects 3 (p280 at +497 h, p331 at +20 h, p879 at +405 h), D1-F 7, LILA-auto 7. Median delay with misses infinite: M1 missed, D1-F 154 h, LILA-auto 142 h. Paired with D1-F, M1 is earlier on 1 leak, later on 6, both missed on 2; a bootstrap over the 9 leaks puts M1's median below D1-F's in 0.3% of resamples. H4 refuted.
  • All 19 new leaks: 10 detected, 6 false alarms; chance with 25 alarms has median 11 (8 to 13), P = 0.80 on the count, and its false alarms are above chance's (P = 0.003). Leaks of 12 m³/h and up: M1 7 of 10 (median 211 h), D1-F 6 (134 h), LILA 7 (229 h).
  • Ablation M1-nt (no tank term): spread 13.9 m³/h instead of 10.7, h = 5, 7 of 19 with 3 false alarms, the same 3 small leaks.
  • Why. The nightly minimum's two-week robust sd is 10.7 m³/h at the median in 2018 (5 to 95%: 5.6 to 20.5), the size of the leaks in question. Post-hoc diagnostic, after the 2019 scores (experiments/step6-mnf/weekly.py, 2018 only): Friday and Saturday early mornings sit +9.6 and +14.6 m³/h above a 7-night running median; removing weekday means cuts the spread from 10.1 to 7.1 m³/h.
  • What it changes. For the paper, the small-leak signal on L-Town is in the pressure sensors, not the district meter; H4 as stated is refuted. Two MNF variants deserve one pre-registered run each before H4 is closed: a weekday baseline, and the night balance net of the 82 AMR demands (BattLeDIM's *_SCADA_Demands.csv, not yet loaded). Both will be scored on a 2019 already seen through M1, which the paper must say.

2026-11-13 · Step 6 plan (minimum night flow, H4), written before any night-flow statistic was computed

  • Why now. H4 needs only the three inlet flows and the tank level, which step 1 already loads, and it is the one hypothesis about the leaks every published entry mostly misses. Milestones 3 to 5 need WNTR and the 177 MB L-TOWN_Real.inp; this step does not.
  • What was seen before writing this. The first two data rows of 2019_SCADA_Flows.csv and 2019_SCADA_Levels.csv (column names), and the 2019 per-leak delays of D1 and LILA-auto already in their results.txt. No night-flow series, for either year, has been computed.
  • Water balance (fixed now). From L-TOWN.inp: reservoirs R1 and R2 feed the network through p227 and p235; PUMP_1 lifts from n54 into tank T1 (diameter 16 m, so 201.06 m²), which drains back into the network. So district demand plus leakage is Q = p227 + p235 − 201.06 · dL/dt, with PUMP_1 internal. Hourly means; dL/dt as the central difference of hourly mean levels (m/h, so Q in m³/h).
  • Statistic. The night's minimum flow m<sub>d</sub> = the least of the six hourly Q from 00:00 to 06:00 on day d. Known at 06:00, so that is when its alarm is time-stamped.
  • Detector M1 (no pressure data). Baseline on the same trailing window as D1 and LILA-auto (days [max(d − 21, anchor), d − 7), at least 7 days): median and 1.4826 × MAD of m over the window, the MAD floored at 0.1 m³/h; z<sub>d</sub> = (m<sub>d</sub> − median) / that. One-sided upward CUSUM S = max(0, S + z − k), k = 0.5; S > h alarms, resets S and re-anchors the window at the alarm day (14 days blind, as D1). Grid h ∈ {1, 2, 3, 5, 8, 12, 20, 30, 50}. Selection: step 1's rule on 2018 only (most 2018 detections at ≤ 2 false alarms; ties to fewer false alarms, then larger h). 2019 scored once.
  • Ablation, declared now. M1-nt: the same without the tank term (Q = p227 + p235), chosen by the same rule.
  • H4, made concrete. The incipient set is the 2019 new leaks with peak under 12 m³/h in 2019_Leakages.csv (the configuration file with leak types is unreachable from this session): p123, p193, p277, p280, p331, p455, p680, p710, p879 (9 leaks). Delay counts a miss as infinite. The comparator is D1-F as chosen in step 1 (pressure CUSUM; median 154 h on this set, 2 misses); LILA-auto as chosen in step 2 is secondary (142 h, 2 misses). H4 holds if M1's median delay on the 9 is below 154 h; refuted otherwise. Reported with it: the paired count of leaks where M1 is earlier, and a bootstrap over the 9 leaks of the median difference.
  • Also reported. M1's 2019 detection count against its own chance level (a pure detection-only detector, so H1's detection clause applies directly; no location metric, since one network-wide flow names no sensor), false alarms, and delays on the leaks of 12 m³/h and above.
  • Expected. MNF is the leakage engineer's standard incipient-leak statistic, so H4 should hold if the AMR-free night demand is quiet enough: a 5 m³/h leak against a night flow of order 100 m³/h may be inside the night-to-night spread, in which case the small leaks stay missed.

2026-11-12 · Step 2 outcome: automatic LILA, 14 of 19 (P = 0.019), and a tie-break that undoes it

  • Chosen on 2018: delta = 1, C_thr = 20 (2018: 11 of 13, 0 false alarms; 26 alarms over both years, the same count as D1).
  • 2019, once: 14 of 19 new leaks, 1 false alarm, median delay 138 h; MAS within 300 m along pipes for 7 (chance median 0, P < 0.001). Detection count against 26 random alarms: chance median 11 (8 to 13), P = 0.019, so H1's detection clause is refuted as written.
  • Thin. Over the whole grid, 2 of the 13 settings with ≥ 20 alarms have P < 0.05 on the count; all 27 settings have P ≤ 0.003 on the 300 m count.
  • Found while writing a unit test, after the 2019 scores: LI-2's vote ties are common (46% of hours in 15 Jan to 14 Feb 2018 have more than one sensor at the top count), because the inlet flow makes every model agree on the sign of a sensor's own noise. The pre-registered argmax takes the lowest index. Added as a labelled ablation, not a replacement: ties by the largest error norm, same grid and rule, chose the same setting and gave 13 of 19, 2 false alarms, 28 alarms, P = 0.265; 6 within 300 m (P < 0.001).
  • What it changes. H1 needs restating as a margin claim: detection counts sit within about one leak of chance's upper range, while location-aware counts sit far above it. The released LILA notebook supplies per-leak MAS, pipe and calibration windows, so its published timings are not a blind detector's; that goes in the paper's related-work section with the code reference.
  • Data route. Zenodo was refused; inputs came from two public GitHub copies whose SHA-256s match Zenodo's (now a fallback in data.py). The harness moved into src/water_leaks/harness.py; step 1 reran byte-identical.

2026-11-12 · Step 2 plan (LILA), written before LILA's 2018 or 2019 scores were seen

  • Data route. Zenodo refused this session's proxy. The eight BattLeDIM CSVs were taken from a public GitHub mirror (NaimurRahmanR/wds-sentinel, data/raw/) and L-TOWN.inp from another (Thierry-ctrl/bubble-man); all nine match the SHA-256s recorded from Zenodo in step 1 byte for byte, so the inputs are identical.
  • What the released LILA does. The authors' identification notebook (SWN-group-at-TU-Berlin/LILA, GPL-3.0, read, not copied) writes in by hand, for each known 2019 leak, the pipe, its most affected sensor, the neighbouring sensors and three or four calibration windows, then runs the CUSUM on that one leak's residuals. Its printed time to detection for p523 is 0 h. So the published LILA timings are start-time estimates given the leak, not the output of a detector run blind over the year.
  • Detector (LILA-auto). LI-1 to LI-3 as the paper describes them (pairwise regressions of p_j on p_i and PUMP_1; the most-affected-sensor MRE; Montgomery's tabular CUSUM with delta and C_thr), with the reference period replaced by D1's trailing window (W = 14, g = 7, re-anchored after an alarm, minimum 7 d). Hourly means. One change from the released code, fixed before any score: a sensor that is rarely the MAS in its reference window gets the median sd instead of NaN (NaN disables it for good).
  • Grid and selection (fixed now). delta in {1, 2, 4} by C_thr in {3, 5, 10, 20, 30, 50, 100, 200, 300}; the same rule as step 1 on 2018 only (most 2018 detections at ≤ 2 false alarms; ties to fewer false alarms, then larger delta and C_thr). 2019 scored once with the chosen setting, and every grid point reported with its own chance level for H1.
  • Predictions. H1 says LILA-auto's detection-only count is within chance if it raises 20 or more alarms; its MAS within 300 m is above chance. One smoke run (C_thr = 20, delta = 4) printed only its alarm count (16 over both years) before this entry.

2026-11-12 · Step 1 outcome: detection counts near chance, location not

  • Design change after a first look at 2019 (disclosed). The planned detector held off for g = 7 days after an alarm. Its first run reported 2019 numbers (12 of 19 new leaks, 4 false alarms); a unit test then showed that when the hold-off ends the trailing window still holds no post-leak data, so the same leak alarms again. The fix re-anchors the window at the alarm day and resumes once it holds 7 days (detect_sequential). The 7-day minimum was set once, not tuned. The first run also gave carried-over 2018 leaks a false 2019-01-01 onset; fixed.
  • Added before reading the fixed results: a chance level (the same number of alarms at random, spaced by the 14-day blind time, from random sensors; 1,000 draws) for five metrics.
  • Outcome (variant F chosen on 2018, h = 240). 2019: 13 of 19 new leaks, 2 false alarms, median delay 104 h. H1-step1 (≥ 9 with ≤ 4 false alarms) held, but chance gets a median 11 (8 to 13, P = 0.105), so it says little. Detection within 72 h: 4 against 2 (P = 0.145). Alarming sensor within 300 m along pipes: 5 against 0 (P < 0.001).
  • Without flows (variant L, h = 80): 10 of 19, 3 false alarms; P = 0.878 on the count, 6 within 300 m (P < 0.001).
  • What it changes. H1 of the programme (detection-only counts are within chance for ≥ 20 alarms; location-aware ones are not) is consistent with D1. Milestone 2 tests it on reimplementations of SICAMS and LILA.

2026-11-12 · Step 1 plan, written before any detector was run

  • Data. BattLeDIM (Zenodo record 4017659, CC-BY-4.0), fetched through the session proxy for the first time; infra-waterloss had to fall back to Net3 because it could not. Ground truth is the onset of non-zero flow in <year>_Leakages.csv (it matches the onsets in Melnikov 2025's table; the configuration file's start times differ for incipient leaks). 2019 has 23 leaks: 19 that start in 2019 and 4 carried over from 2018 (p257, p427, p654, p810).
  • Protocol. 2018 is the tuning year, 2019 the test year, scored once with the settings 2018 picked. 2018 labels are used for tuning; BattLeDIM's competitors had only 2018's repair times, so this is more information than they had, and it is disclosed wherever a comparison is made.
  • Detector (D1). Hourly means. For each pressure sensor and each day, a least-squares model of pressure on hour-of-week, tank level and (variant F) the three inlet flows, fitted on a trailing window that ends g days before the day scored; residuals standardised by the window's residual sd; a one-sided CUSUM on the negative residuals per sensor; an alarm resets all CUSUMs and holds off for g days. The trailing refit absorbs leaks already running, so each alarm is a claim that a new leak started.
  • Score (detection only). An alarm is a true positive if it falls while an unmatched leak is running and within 30 days of its onset (the latest such onset wins); every other alarm is a false positive. Delay is alarm minus onset. The distance from the alarming sensor to the leak pipe is reported as a first localisation figure (BattLeDIM counted a location within 300 m). Not the competition's score, which needed a reported pipe.
  • Hypothesis H1-step1. Tuned on 2018 to at most 2 false alarms, D1 detects at least 9 of the 19 leaks that start in 2019 with at most 4 false alarms in 2019. Refuted if it detects 8 or fewer, or needs 5 or more false alarms. The published best entries reach 15 to 17 of 23 with 1 to 4 false alarms with localisation (Melnikov 2025, Table 2), so this is a floor, not a claim to match them.
  • Expected. Abrupt leaks above ~10 m³/h found within a day; small incipient ones (p123, p455, p762, p193) missed, as every published entry mostly misses them.

Paper, code and results

More in Detection & tolerances

All 15 Detection & tolerances projects →

Other research topics

Proper scoring & elicitation28Effort & peer prediction9Verification games & slashing19Detection & tolerances15Markets as routers13Prediction-market design9Paying contributors8Decentralised training systems23Digital twins & sim-to-real164LLM chip design loops40Robot manufacturing loops53Ambient AI assistant46Self-replicating manufacturing34Simulation-first design64Engineered clothing45Task-specific AI accelerators40Algorithmic chip-design loops42Open-source purpose-built robots50The software-engineering loop43Adversarial human imitation41Open-source residential construction41Autonomous multi-angle capture35Sensing, imaging and 3D33Energy supply and dense energy storage41Robot societies among people32Agentic co-design of low-cost robots28Laundry-hanging robots26Machine learning on qualitative data23Robots on the building site28Civilizations & group psychology3History & human sciences4

Produced with AI assistance (Claude). Results are from the code in this repository and are simulated or stylised unless the abstract says otherwise; nothing here implies affiliation with or endorsement by any lab, researcher or company cited. MIT licensed.