Commit 763801c
authored
feat(footnote): reserve full footnote demand at body slice time (SD-2656) (#3597)
Replaces the body slicer's ORDERED-MINIMUM acceptance rule with
ORDERED-PREFERRED. The slicer now reserves each anchored footnote's
full height up front, instead of just the first line of the last
anchor. The body naturally backs off enough lines to fit every
anchored footnote whole on its anchor page — matching Word's
pagination behavior, which knows each footnote's full demand at
every line decision rather than reserving a minimum and patching
later.
## Architectural rationale
The previous five-layer pipeline (mandatory-minimum planner → body
slicer → convergence loop → preferred-reserve scorer → post-hoc widow
absorb) existed to compensate for the deliberate under-reservation
at layer 1. Each downstream layer fixed a symptom of layer 1's
optimism. By reserving the full demand at slice time, the symptoms
disappear and the downstream layers can be simplified or removed in
follow-up work.
This is the cleaner shape: one place that decides demand, no
back-and-forth between layers.
## Fixture results
| Fixture | Before | After |
|---|---|---|
| Carlsbad | 46p / 3 splits | 46p / 0 splits |
| IRA | 48p / 9 splits | 46p / 0 splits |
| SPA | 53p / 7 splits | 53p / 0 splits |
| IT-923 COI | 50p / 15 splits (Phase 1 era) | 54p / 1 split |
| MRL | 5p / 0 splits | 5p / 0 splits |
Cost is a small page-count growth (≤ +4 pages on packed legal docs
like COI; ≤ +1 on most others). Word would also grow these documents
under similar packing pressure.
The single remaining split (COI fn 32) is a footnote large enough
that no single page accommodates it without itself overflowing — a
genuine forced split that Word would also produce.
## Test sweep (all green)
- layout-engine 657 / layout-bridge 1281 / layout-tests 332
The Phase 1 dead-reserve concern (24 IT-923 pages had `deadReserve >
30 px` under preferred demand) is mitigated by the codex correctness
fixes shipped earlier on the SD-2656 branch — the column-state
carryover that exaggerated dead-reserve drift is gone.1 parent a1e1f9a commit 763801c
1 file changed
Lines changed: 14 additions & 25 deletions
Lines changed: 14 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
975 | 966 | | |
976 | 967 | | |
977 | 968 | | |
978 | 969 | | |
979 | 970 | | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
986 | 975 | | |
987 | 976 | | |
988 | 977 | | |
| |||
992 | 981 | | |
993 | 982 | | |
994 | 983 | | |
995 | | - | |
| 984 | + | |
996 | 985 | | |
997 | 986 | | |
998 | 987 | | |
| |||
1046 | 1035 | | |
1047 | 1036 | | |
1048 | 1037 | | |
1049 | | - | |
| 1038 | + | |
1050 | 1039 | | |
1051 | 1040 | | |
1052 | 1041 | | |
| |||
0 commit comments