A written height is a ceiling, and the judge can see 592 more boxes - #19
Merged
Conversation
`somPath` split on every `.`. pdfium escapes a dot that is part of a NAME —
`ArtifactedHeader[0].A\.Original[0]` — so splitting on all of them left a
backslash in the rewritten path, the key matched nothing this package emits,
and the box was paired with nothing.
35 of the 559 dumped forms name an element that way. The agreement rates were
never WRONG, both sides being unpaired, but they could not see those boxes.
Against pdfium, before -> after:
keys this package emits and pdfium does not 790 -> 260
leaves pdfium emits and it does not 33462 -> 32932
under a table row 19522 -> 19590 paired, x 100% -> 100%
under neither, the control 167651 -> 168085 paired
of which agree on x 163772 -> 164206
Every one of the 502 newly paired boxes agrees with pdfium on x, which is the
check on the rewrite: had it paired the wrong pairs, they would not.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`measure` returned `max(content+marginV, own)`, following pdf.js (template.js:5222): a container was as tall as what it held even where the template wrote a height. pdfium reads it the other way round. `CalculateContainerSpecifiedSize` (cxfa_contentlayoutprocessor.cpp:97-137) turns `bContainerHeightAutoSize` off as soon as a subform writes an `h` above kXFALayoutPrecision, and `CalculateContainerComponentSizeFromContentSize` (:140-184) then leaves `componentSize.height` at the written height, never reading `fContentCalculatedHeight`. `ca-cra__rc243-fill-26e` is the case in the small. `<subform name="Detail2" h="4.233mm">` holds children reaching 8.466mm. Both sides agree to the point on the row above it, ending at y=595.0970 + 11.9991 = 607.0961, and pdfium puts Detail2 there: the written 11.9991 tall, not the 24.9991 its content reaches. Followed: pdfium, by the standard that decided px, mp, =0mm, the root's absent layout and the hidden container's break. Against pdfium, before -> after: under a wrapping container y 427/959 44.53% -> 527/959 54.95% under a table row y 15044/19590 76.79% -> 15437/19590 78.80% under neither, the control y 158206/168085 94.12% -> 158209/168085 94.12% x: not one box moved, at any of the three. w: not one box moved. Sheets 3090 -> 3090. Unplaced 48 -> 48. Fields 85455, draws 156010, both unchanged. Of 559 forms, 0 are worse and 13 better, 8 of them becoming exact on sheet AND y for every leaf. The cost, and it is a real one: against pdf.js, container heights 7794/7794 (100.00%) -> 7762/7794 (99.59%). Those 32 are exactly the containers pdf.js grows past their written h — this is a decision between the two references, not a regression against a settled answer. A height written as NOUGHT stays no height, as pdfium reads one only above kXFALayoutPrecision. No container of the 560-form corpus writes one, so that arm is a guard rather than a measured claim, and the new test pins it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Two changes that came out of diagnosing the nine remaining sheet-count
disagreements with pdfium (#7). Neither changes a sheet count; both were
measured before being shipped.
1 — The judge could not see 592 boxes
somPathcut pdfium's SOM expression at every.. pdfium escapes a dot thatis part of a NAME —
ArtifactedHeader[0].A\.Original[0]— so splitting on allof them left a backslash in the rewritten path, the key matched nothing this
package emits, and the box was paired with nothing. 35 of the 559 dumped forms
name an element that way.
The rates were never wrong, both sides being unpaired, but they were blind.
Every one of the 502 newly paired boxes agrees with pdfium on x. Had the
rewrite paired the wrong pairs, they would not.
2 — A container's written height is a ceiling, not a floor
measurereturnedmax(content+marginV, own), following pdf.js(
template.js:5222). pdfium reads it the other way round:CalculateContainerSpecifiedSize(cxfa_contentlayoutprocessor.cpp:97-137)turns
bContainerHeightAutoSizeoff as soon as a subform writes anhabovekXFALayoutPrecision, andCalculateContainerComponentSizeFromContentSize(
:140-184) then leavescomponentSize.heightat that written height, neverreading
fContentCalculatedHeightat all.ca-cra__rc243-fill-26eis the case in the small.<subform name="Detail2" h="4.233mm">holds children reaching 8.466mm. Both sides agree to the point onthe row above it, which ends at 595.0970 + 11.9991 = 607.0961, and that is
where pdfium puts
Detail2— the written 11.9991 tall, not the 24.9991 itscontent reaches.
Followed: pdfium, by the standard that decided
px,mp,=0mm, theroot's absent
layoutand the hidden container's break.x: not one box moved, at any of the three. w: not one box moved. Sheets
3090 → 3090, unplaced 48 → 48, fields 85455 and draws 156010 both unchanged.
Of 559 forms 0 are worse and 13 better, 8 of them becoming exact on sheet
AND y for every leaf.
The cost, and it is a real one. Against pdf.js, container heights
7794/7794 (100.00%) → 7762/7794 (99.59%). Those 32 are exactly the
containers pdf.js grows past their written
h. This is a decision BETWEEN thetwo references, not a regression against a settled answer.
A height written as NOUGHT stays no height, as pdfium reads one only above
kXFALayoutPrecision. No container of the 560-form corpus writes one, so thatarm is a guard rather than a measured claim, and the new test pins it.
Gate
Go 1.27.1 via
GOTOOLCHAIN,GOWORK=off,CGO_ENABLED=0:gofmt -lempty,go vetclean, 100.0% of statements,-racegreen, and ten cross-compiletargets (linux/amd64, linux/arm64, linux/386, darwin/amd64, darwin/arm64,
windows/amd64, windows/arm64, freebsd/amd64, js/wasm, wasip1/wasm).
The diagnosis this came out of — what the nine are, grouped by cause, and what
I could not settle — is posted on #7.
🤖 Generated with Claude Code