Task #435: exam_kor.hwp 24→22 페이지 정합 (#393 옵션 A col 1 reserve 정정)#442
Closed
planet6897 wants to merge 5 commits into
Closed
Task #435: exam_kor.hwp 24→22 페이지 정합 (#393 옵션 A col 1 reserve 정정)#442planet6897 wants to merge 5 commits into
planet6897 wants to merge 5 commits into
Conversation
exam_kor.hwp 24페이지 → 20페이지 정합 작업 1단계. - 페이지별 단별 used/hwp_used/diff CSV (output/debug/task435/) - 회귀 대상 5문서 페이지 수 (exam_kor 24, exam_eng 8, k-water-rfp 28, hwpspec 177, synam-001 35) - RHWP_TYPESET_DRIFT 출력 캡처 (pi=0.30, pi=1.25 split 진단) - compute_body_wide_top_reserve_for_para 산정 경로 추적 핵심 진단: col 1 reserve 306.1px (HWP 실제 94.5px 대비 +211.6px 과대). 원인: Paper-rel 좌표를 body-rel 변환 없이 그대로 reserve 에 누적. Stage 2 에서 typeset.rs:2127-2172 의 VertRelTo::Paper 분기 정정. 수행계획서/구현계획서/Stage 1 보고서 포함.
compute_body_wide_top_reserve_for_para 의 VertRelTo::Paper 분기에서 body-rel 변환 누락 정정. body 와 일부만 겹치는 (header→body 침범) 케이스에서 Paper-rel 좌표를 그대로 reserve 에 누적하던 버그 수정. 수정 전 reserve = shape_y_offset(paper) + h + outer_bottom = 306.1 px 수정 후 reserve = max(0, shape_top_abs - body_top) ... = 94.4 px 결과: - exam_kor.hwp: 24 → 22 페이지 (page 2, 15 orphan 해소) - pi=0.30, pi=1.25 split → FullParagraph - 회귀: exam_eng 8, k-water-rfp 28, hwpspec 177, synam-001 35 유지 - cargo test: 1062 passed Stage 3 에서 일반 페이지 누적 -100~-300px 정정 (22 → 20).
원래 가설 ("표/도형 후 컬럼 잔여 공간 산정 부족") 재검토.
RHWP_TYPESET_DRIFT 분석 결과 diff 메트릭은 typeset cur_h 누적
(height_for_fit, trail_ls 제외) vs hwp_used (last line vpos+lh)
의 좌표계 차이를 측정하는 것일 뿐, "rhwp 가 채울 수 있는데 못 채운
잔여 공간" 이 아님을 확인.
실제 22→20 페이지 단축 장애물:
1. 섹션 1 페이지 14: Square wrap 표 + col 0 over-fill (1225>1211)
→ col 1 under-use (64px)
2. 섹션 1 페이지 15: 단일 컬럼 출력 (단정의는 2단인데 단 1 누락)
3. 섹션 2 페이지 18: pi=11 split + pi=13 [단나누기] orphan-like
3가지 전부 해결 시 22→19 가능 (목표 20 도달).
옵션 A/B/C 결정 필요 (현 상태 종료 / Stage 4 확장 / Stage 4 부분).
옵션 A 종료: 24→22 페이지 (Stage 2 col 1 reserve 정정). 잔여 22→20 미달성, 3가지 별도 메커니즘 (Square wrap over-fill, 단일 컬럼 출력 버그, col 0 cur_h over-advance) 별도 task 분리 권고. edwardkim#393 (옵션 A) 본 task Stage 2 로 적용 완료, close 가능.
edwardkim
added a commit
that referenced
this pull request
Apr 29, 2026
- mydocs/pr/pr_442_review.md (Task #435 cherry-pick 검토) - mydocs/pr/pr_442_report.md (cherry-pick 머지 결정 + Canvas 시각 판정 통과) - mydocs/orders/20260429.md (PR #442 완료 행 추가) 검증: 1066 passed + svg_snapshot 6/6 + issue_418 1/1 + clippy 0 + WASM 4,174,855 bytes 광범위 byte 비교: 285/309 동일, 24 차이 (exam_kor 한정 — 의도된 정정) 시각 판정: 작업지시자 Canvas (rhwp-studio) 통과 본질: typeset.rs Paper-rel→body-rel 변환 정정 (32 lines) exam_kor 24→22 페이지 (page 2/15 orphan 제거), col 1 reserve 306.1→94.5px (HWP ±0.2) 잔여 22→20 정합: #439/#440/#441 별도 이슈 (작은 단위 회전 정책 부합)
edwardkim
added a commit
that referenced
this pull request
Apr 29, 2026
edwardkim
added a commit
that referenced
this pull request
Apr 29, 2026
Owner
|
@planet6897 님 PR 감사드립니다. 메인테이너가 cherry-pick 으로 devel 에 적용 완료했습니다. 집요한 진단 + 정밀한 측정 (HWP 실측 94.5 px ±0.2) + 잔여 작업 분리 등록 (#439/#440/#441) 모두 좋습니다. 처리작성자 attribution 보존 4 commits cherry-pick (merge commit 제외):
devel 머지 commit: 검증
광범위 byte 단위 비교10 샘플 / 309 페이지 SVG 비교: 285/309 동일, 24/309 차이 (exam_kor 한정). 차이 분포:
→ 본 PR 영향이 exam_kor 에 정확히 한정됨을 byte 단위로 확인. 시각 판정 (작업지시자 직접)
페이지 수 24→22, page 2/15 orphan 페이지 제거 정상 확인. 본 PR 의 좋은 점
이슈 #435, #393 도 함께 close 됩니다. 잔여 작업 (#439/#440/#441) 도 같은 집요함으로 이어가실 것 같습니다. 감사합니다. |
This was referenced Apr 29, 2026
edwardkim
added a commit
that referenced
this pull request
Apr 29, 2026
- mydocs/pr/pr_443_review.md (Task #439 cherry-pick 검토) - mydocs/pr/pr_443_report.md (cherry-pick 머지 결정 + SVG/Canvas 시각 판정 통과) - mydocs/orders/20260429.md (PR #443 완료 행 추가) 검증: 1066 passed + svg_snapshot 6/6 + issue_418 1/1 + clippy 0 + WASM 4,178,523 bytes 광범위 byte 비교: 298/307 동일, 9 차이 (exam_kor 한정 — 의도된 정정) 시각 판정: 작업지시자 SVG + Canvas 양 경로 통과 본질: typeset.rs Square wrap 표 누적 정책 max 적용 (32 lines) exam_kor 22→20 (페이지 14+15 통합), col 0 1225.8→1036.1px, col 1 64.3→1016.9px @planet6897 본 사이클 9번째 PR (가장 활발), PR #442 머지 직후 잔여 작업 즉시 처리
This was referenced Apr 29, 2026
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.
Summary
compute_body_wide_top_reserve_for_para(typeset.rs:2127-2174) 의VertRelTo::Paper분기에서 paper-relvertical_offset을 body-rel 변환 없이 reserve 에 누적하던 버그 정정변경 내용
버그
samples/exam_kor.hwp의 body-wide TopAndBottom 표 (pi=0wrap=TopAndBottomvert=Paper(38mm)) 처리 시:이로 인해 col 1 의 가용 공간이 부족해져 paragraph split 발생, page 2 (49px) / page 15 (104px) orphan 페이지 생성.
수정
결과 메트릭
회귀 검증
cargo test --release: 1062 passed, 0 failed잔여 작업 (별도 이슈로 분리)
22→20 페이지 정합 미달성 — 다음 3 가지 별도 메커니즘:
Test plan
cargo build --release --bin rhwp성공cargo test --release1062 passed, 0 failedrhwp dump-pages samples/exam_kor.hwp -p 0→ 단 1 used 1207.6 → 1035.8 pxrhwp dump-pages samples/exam_kor.hwp -p 13→ 단 1 used 1193.5 → 1076.9 pxrhwp export-svg samples/exam_kor.hwp→ 22 SVG (was 24)RHWP_TYPESET_DRIFT=1로 col 1 reserve 변화 (306.1 → 94.5) 정량 확인단계별 커밋
e0cdc2eStage 1: 베이스라인 측정 + 진단 데이터 수집0879f11Stage 2: col 1 reserve 정정 (typeset.rs 32 lines)bd08d6bStage 3: 일반 페이지 누적 부족 조사 (코드 변경 없음)0a096fcStage 5: 최종 결과보고서 + 오늘할일 갱신관련
mydocs/plans/task_m100_435.mdmydocs/plans/task_m100_435_impl.mdmydocs/working/task_m100_435_stage{1,2,3}.mdmydocs/report/task_m100_435_report.md