test(pdf): diagnose S01 metric mismatch without changing fidelity gates

This commit is contained in:
cesnimda
2026-10-29 20:45:33 +01:00
parent 26d531cc90
commit 4024a89a95
8 changed files with 408 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
"""Independent diagnostic arithmetic, not a replacement acceptance criterion."""
MM_PER_PIXEL = 25.4 / 96
def compare(range_top, dom_baseline, pdf_baseline, pdf_cell_top, font_size_px, descriptor_descent):
predicted_cell = pdf_baseline - font_size_px * (1 - abs(descriptor_descent) / 1000)
return dict(baselineDeltaMm=abs(pdf_baseline - dom_baseline) * MM_PER_PIXEL,
oldCellDeltaMm=abs(pdf_cell_top - range_top) * MM_PER_PIXEL,
cellFormulaResidualPx=abs(predicted_cell - pdf_cell_top),
metricConventionOffsetPx=(dom_baseline - range_top) - font_size_px * (1 - abs(descriptor_descent) / 1000))