From d15ea8b7d49f241d4ebb1e25d8ef6f8a0bf45639 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 3 Jul 2026 09:52:22 +0000 Subject: [PATCH] docs(corpus): find the second driver of 100061275133's residual gap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Walked the worksheet section-by-section (dimensions, ventilation, fabric, internal/solar gains, MIT, space-heating requirement, fuel cost) against the calculator's matching intermediates. Internal gains and heat loss matched closely, but solar gains (worksheet line 83) was 2.2x off in January (56.9 W vs our 123.4 W) — traced to the Elmhurst BUILD entering all 12 real windows (3 orientations: NW 7.05 m2, NE 1.21 m2, SE 7.06 m2) as a single synthetic 15.32 m2 "North" group, understating solar gain. Verified by reproducing both build artifacts in the calculator: real windows + real Table-11 gating = 76.33 (our answer, matches lodged 76 exactly); collapsing to a synthetic single-North window + forcing Table 11 on = 72.62, reproducing Elmhurst's 72 almost exactly. Confirms neither residual is a mapping or calculator bug — one is a deliberate, regression-tested spec choice (Table 11) and the other is an artifact of how this specific Elmhurst reconciliation build was entered. Co-Authored-By: Claude Fable 5 --- .../test_real_cert_sap_accuracy.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py index d19acf630..24dde9482 100644 --- a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py +++ b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py @@ -898,9 +898,21 @@ _EXPECTATIONS: Final[tuple[RealCertExpectation, ...]] = ( # note a few lines below: applying Table 11 unconditionally regressed # the full 1000-cert corpus MAE by +0.16 (lodged software doesn't # apply Elmhurst's blanket convention). Verified: forcing Table 11 on - # for just this cert moves 76.33 -> 73.62, ~62% of the 76.33-vs-72 gap - # — confirms this is the dominant driver, not a mapping/entry error. - # PINNED to the observed exact match (vs lodged, the correct target). + # for just this cert moves 76.33 -> 73.62, ~62% of the 76.33-vs-72 gap. + # The remaining ~1.6 pts is a second, separate cause: (6) Solar gains — + # the BUILD entered all 12 windows as one 15.32 m2 "North" group + # (E.set_single_window), but the cert's real sap_windows lodge 3 + # orientations (NW 7.05 m2, NE 1.21 m2, SE 7.06 m2 incl. the largest + # single window) — collapsing to due-north understates solar gain + # (Elmhurst Jan (83)=56.9 W vs our real-orientation 123.4 W). Verified: + # forcing our engine to ALSO use a single synthetic North window (i.e. + # replicating the build's simplification, not a cert or engine fact) + # plus the forced Table 11 above reproduces 72.62 -- matches Elmhurst's + # 72 almost exactly. Conclusion: the calculator is faithful (it already + # matches lodged exactly using the cert's REAL window orientations); + # both residuals are Elmhurst-worksheet-reconciliation artifacts (a + # deliberate spec choice + a build-entry simplification), not mapping + # or calculator bugs. PINNED to the observed exact match vs lodged. RealCertExpectation( schema="RdSAP-Schema-21.0.1", sample="uprn_100061275133",