From a400005353a675e36186a88131375404af05bf7a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 15 Jul 2026 10:34:19 +0000 Subject: [PATCH] =?UTF-8?q?Ratchet=20the=20API-corpus=20within-0.5=20floor?= =?UTF-8?q?=20to=2078.8%=20for=20the=20water-only=20DHW=20fix=20?= =?UTF-8?q?=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enumerates the 3 corpus certs that can move (all WHC 950) individually per #1592 sub-task D: two improve (one crossing inside 0.5), one worsens and is handed to sub-task C for an accredited oracle. No loosening required. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../epc_client/test_sap_accuracy_corpus.py | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/infrastructure/epc_client/test_sap_accuracy_corpus.py b/tests/infrastructure/epc_client/test_sap_accuracy_corpus.py index 5271c2434..6a74fdc4d 100644 --- a/tests/infrastructure/epc_client/test_sap_accuracy_corpus.py +++ b/tests/infrastructure/epc_client/test_sap_accuracy_corpus.py @@ -241,7 +241,26 @@ _CORPUS = Path( # fallback (see the `_MAX_SAP_MAE` note below for the mechanism). # 77.8% -> 78.6% via the RdSAP 10 §5.7 Table 13 200/280mm solid-brick-wall # boundary fix (see the `_MAX_SAP_MAE` note below). -_MIN_WITHIN_HALF_SAP = 0.786 +# 78.7% -> 78.8% (MAE 0.6273 -> 0.6272) via the water-only heat-network DHW +# fix (#1592 sub-task B): SAP 10.2 §4.3 (PDF p.24) puts the water-heating +# efficiency in the Table 12 price of delivered heat, and C4 (p.53) scopes the +# plant efficiency to "the calculation of CO2 emissions and Primary Energy" — +# so worksheet (310) = (64) × (305a) × (306) carries NO efficiency divisor. +# The WHC-950/951/952 branch had been applying it a second time dwelling-side. +# Also re-applies the Table 3 primary loss (p=1.0, h=3) for these certs. +# Only 3 corpus certs can move (all lodge WHC 950), enumerated individually: +# 5300047580 err 0.695 -> 0.249 (crosses inside 0.5 — this is the +0.1%) +# 10010254955 err 1.535 -> 0.795 (improves, still outside) +# 22032926 err 1.707 -> 2.737 (WORSENS — it over-rates, and the fix +# raises SAP further; a separate baseline residual that pashub's lodged +# `pre_sap` cannot adjudicate. Tracked as #1592 sub-task C, which pins an +# accredited Elmhurst worksheet as the oracle.) +# Net MAE −0.00016 over 1000 certs. PE 2.845 -> 2.867 and CO2 0.0701 -> 0.0702 +# both drift slightly the wrong way but stay well inside their loose ceilings; +# the plant efficiency C4 reserves for CO2/PE is a known follow-up. Spec- +# verified against the SAP 10.2 PDF, not the ticket prose; unit-pinned in +# test_cert_to_inputs (950/951/952 must bill identical DHW fuel). +_MIN_WITHIN_HALF_SAP = 0.788 # 0.793 -> 0.789 via the §12 Unknown-meter + dual-electric-immersion off-peak # trigger (RdSAP 10 PDF p.62): Apartment 241 (main 691 + 903 dual immersion) # -5.38 -> -1.05. Worksheet-validated on "simulated case 48" (Elmhurst SAP 57,