Skip to content

test(qa): hold a DOCX fidelity line where it stands across, as well as down - #834

Merged
DemchaAV merged 3 commits into
2.5-devfrom
test/docx-fidelity-horizontal
Oct 3, 2026
Merged

DemchaAV merged 3 commits into
2.5-devfrom
test/docx-fidelity-horizontal

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Why

The DOCX fidelity corpus held each line to how far below the page's an editor set it, and nothing across. A table's left margin the export dropped stood PaymentsInvoice's bank details 36.7pt and VioletGrid's education lines 51pt left of the page's in Word. Every line stayed at its height, so the gate passed both; #831 found them by hand.

What changed

  • FidelityMeasurement.Found.across. Each found line also records how far right of the page's its first letter stands (editor's x minus the engine's), from the glyph that already gives its baseline (PdfLines). The line file gains a column: document, line, drift, across, letters.
  • FidelityBaseline.regressions. A line whose drift across grows by more than LINE_SLACK (0.5pt) fails, as a line set lower does. The failure names it with … across.
  • Old and new line files. A file written before holds its lines down alone.
  • Baselines. All three line files carry the column: word-windows-lines.tsv and libreoffice-windows-lines.tsv from local runs, libreoffice-linux-lines.tsv from this PR's CI artifact docx-fidelity-37152419626. Their (document, line, drift) rows are identical to before, and the document files are unchanged.
  • Format per file. A line file counts as measured across when its header says so or any row holds the column, and then a row without it is refused rather than read as old.
  • Half a point, in hundredths. "More than half a point further" is counted in the hundredths drifts are written in, down and across: in doubles, 0.18 → 0.68 failed, as did 21 more of the 501 steps from 0 to 5pt, and the rest passed.
  • Docs. CONTRIBUTING and CHANGELOG say what the gate holds.

What it shows

Across the corpus the median line stands 0.07pt off across in Word and 0.10pt in LibreOffice on Windows. Lines more than 2pt off across, now held where they are: 175 in Word (33 documents), 130 in LibreOffice on Windows, 427 in LibreOffice on Linux. The ten documents with the most in Word:

Document Lines past 2pt across (Word) Worst
cv-compact_mono 28 +2.3pt
cv-teal_pulse 28 −6.7pt
cv-orange_ops 15 −6.0pt
cv-panel 14 −7.8pt
invoice-modern 8 −2.7pt
invoice-payments 8 +3.1pt
cv-executive 7 −7.9pt
cv-midnight_navy 7 −12.4pt
cv-navy_sidebar 7 −2.2pt
invoice-modern_long 7 −2.7pt

Verification

  • DocxFidelityGateTest, +6 tests (27):
    • two real PDFs, the second's lines 8pt right, measure 8pt across and nothing down;
    • the baseline fails a line 0.51pt further across, to either side, and passes one within half a point or nearer;
    • an old four-cell row reads with no place across and holds its line down alone;
    • a file measured across refuses a row cut short, with or without its header, and an old row still fails when it moves down;
    • half a point further passes for every drift from 0 to 5pt, in hundredths;
    • a line further both down and across is named once, with both.
    • The round-trip test now carries a drift across through write and read.
  • Sabotage.
    • Dropping the across rule fails two tests.
    • Reading every row as possibly old, or deciding the format from the header alone, fails the cut-short test; comparing in doubles fails the half-point test.
    • End to end: with fix(docx): keep a table's and a row's own margins #831's table-margin fix reverted in render-docx, the LibreOffice corpus gate fails exactly VioletGrid (+0.10 → −51.25pt across), PaymentsInvoice (14 lines, → −36.6pt) and PlatformInvoice's footer (−1.2 → −1.8, −4.25 → −4.85pt). Restored afterwards.
  • Word baseline. CI has no Word: word-windows-lines.tsv is from a local scripts/docx-visual/word-fidelity.ps1 -Update run (Word 16.0.20430), checked again with a plain run.
  • Corpus gates on the rewritten baselines. -Dgraphcompose.docxFidelity=libreoffice → BUILD SUCCESS; scripts/docx-visual/word-fidelity.ps1 → BUILD SUCCESS.
  • Full reactor gate. ./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -am → BUILD SUCCESS (qa 1820 tests).

Notes

  • Absolute distance. The rule compares absolute distances, as the drift rule does: a line moved from +3 to −3pt across is no further from the page and passes.
  • Centred and right-aligned lines. These move across by half or all of the difference in their width. That is a real disagreement with the page, and stable within one editor build, which is what each baseline is.

Lane: test (qa). No production code changes.

@DemchaAV
DemchaAV merged commit b736f74 into 2.5-dev Oct 3, 2026
13 checks passed
@DemchaAV
DemchaAV deleted the test/docx-fidelity-horizontal branch October 3, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant