Skip to content

Task #1022: 측정 정합 — 분할 표 cut 모델 + LAYOUT_OVERFLOW 42→12 (closes #1022)#1024

Closed
planet6897 wants to merge 1 commit into
edwardkim:develfrom
planet6897:pr-task1022
Closed

Task #1022: 측정 정합 — 분할 표 cut 모델 + LAYOUT_OVERFLOW 42→12 (closes #1022)#1024
planet6897 wants to merge 1 commit into
edwardkim:develfrom
planet6897:pr-task1022

Conversation

@planet6897

@planet6897 planet6897 commented May 20, 2026

Copy link
Copy Markdown
Contributor

개요

stream/devel(edwardkim/devel) 최신 기준으로 재구성한 PR입니다. devel에 이미 merge된 #990/#991 휴리스틱 정정(PR #1003·#1004) 위에, 본 PR 고유 작업인 분할 표 cut 모델 + 측정 정합만 순변경분으로 적층했습니다. (다중 타스크 번들 → 단일 커밋 squash 재구성)

closes #1022

핵심 변경

  • table_layout.rscell_units() 셀 콘텐츠 유닛 평탄화 + RowCut 단일 컷 측정
  • table_partial.rs — 분할 표 cut 모델(줄 범위 → 이산 cut 모델로 교체)
  • typeset.rs / pagination — cut 모델 페이지네이터 정합, 다중 머리행 반복 overhead 정합, VPOS_CORR 정합
  • layout.rs21_언어_기출.hwp TAC 표 직후 첫 문단의 trailing line_spacing 누락으로 줄간격 좁아짐 #537 trailing-ls 보정 조건부 복원(아래 v2)
  • LAYOUT_OVERFLOW 42 → 12
  • golden 재생성 — issue-617 / issue-677 / form-002

v2: trailing-ls 보정 조건부화 (issue_598 회귀 해소)

재구성 중 issue_598_footnote_marker_nav 회귀를 검출했습니다. 원인은 lazy_base 산출에서 #537 trailing-ls 보정을 무조건 제거한 것으로, 표 없는 문서의 vpos가 한 줄 간격만큼 위로 밀렸습니다.

let lazy_base_corrected = prev_vpos_end - (y_delta_hu + trailing_ls_hu);
let lazy_base = if lazy_base_corrected >= 0 { lazy_base_corrected }
                else { prev_vpos_end - y_delta_hu };
  • 컬럼이 vpos≠0 에서 시작(상단 박스/도형 뒤 본문): 보정 적용 → IR 정합 복원
  • sequential이 IR을 정확히 추적(drift 0): 비보정 유지 → 표 over-correction 방지

PDF(한컴 2022) 검증: footnote-01·복학원서 모두 정답지 정합 (복학원서 본문 시작 band 196→214=PDF 일치). exam_kor·form-002 골든 불변.

검증

  • cargo build
  • cargo test 전체 green — issue_598 4/4, svg_snapshot 골든 8/8
  • cargo fmt --all -- --check

@planet6897

Copy link
Copy Markdown
Contributor Author

충돌 해소 가이드 (base가 stream/devel보다 66커밋 뒤처짐)

머지 시 충돌 14건이 발생합니다. 권장 해소 방향:

1. 코드 — src/renderer/layout.rs (1곳, ~line 4784)

2. 문서 — task_m100_991* / task_m100_993* (11건, add/add)

3. 골든 — issue-617 / issue-677 / issue-267 (3건) — 시각 재판정 필요

  • 617/677: 본 PR의 cut 모델+VPOS 변경으로 렌더가 달라짐 → Hancom 2022 PDF 대조 재판정 후 갱신.
  • issue-267(ktx-toc): TOC 쪽번호 x가 10px 좌이동. 본 PR 변경(표/VPOS)과 무관한 TOC 탭 정렬이라 회귀 가능성 — 머지 전 원인 확인 권장.

핵심 코드(cut 모델 + #1022 측정 정합)는 upstream에 없는 신규이며 클린합니다.

@edwardkim edwardkim self-requested a review May 20, 2026 02:44
@edwardkim edwardkim added the enhancement New feature or request label May 20, 2026
@edwardkim edwardkim added this to the v1.0.0 milestone May 20, 2026
edwardkim added a commit that referenced this pull request May 20, 2026
@planet6897 — Task #990 영역은 PR #1003 (c2024ec) 머지로 이미 해소,
본 머지로 Task #991 부분 (분할 표 렌더링 정합) 적용:

- 분할 셀 줄 범위 — 끝 페이지 패스(prefix 패스) 유도로 중복·누락 해소 (table_layout.rs, 99f2695)
- 1행 글자처럼취급 표 분할 금지 — 통째 다음 페이지/단 이동 (typeset.rs, 35afc77)
- 쪽 분할 표 직후 문단 vpos 팬텀 해소 — 직전 항목 PartialTable 시 vpos 보정 skip (layout.rs, 0f18849)
- table_layout.rs rustfmt 정리 (0d9a7c1)

옵션 A: cherry-pick 4 (작성자 @planet6897 보존). task_m100_991 문서 AA
충돌 5건 — @jangster77 이슈 #991 (composer marker, CLOSED) 가 같은
task 번호 사용 → --ours 로 jangster77 머지본 보존 + planet6897 v2/v3/
v4/v5 접미사 신규 문서 추가. 검증: cargo test 1307 (lib) + 전체 통합 +
clippy -D + fmt 0 + WASM 4.83MB (feedback_push_full_test_required 정합).
sweep 10 fixture: aift p.14/45/56/69 4 diff (분할 표 보유 fixture
case-specific 동작), 나머지 9 fixture diff=0 — Task #991 변경의 좁은
영역 입증. 작업지시자 시각 판정 통과.

PR #1024 (closes #1022, 분할 표 RowCut 이산 모델, +5912/-1742) 가 본
영역 발전형 — 본 PR 의 휴리스틱 정정을 단일 권위 RowCut 모델로 일반화
+ LAYOUT_OVERFLOW 42→12. #1024 처리 시 본 PR 영역 충돌 가능 (rebase
권고). feedback_pr_supersede_chain + feedback_small_batch_release_
strategy 정합.

**task 번호 충돌 메모**: jangster77/#991 composer + planet6897/분할 표
같은 task 번호 다른 본질 — 향후 가드 권고.
planet6897 added a commit to planet6897/rhwp that referenced this pull request May 20, 2026
 edwardkim#1022)

stream/devel(=edwardkim/devel) 최신 기준으로 재구성. devel에 이미 merge된
edwardkim#990/edwardkim#991 휴리스틱 정정 위에, edwardkim#1024 고유 작업(분할 표 RowCut 이산 cut 모델 +
cell_units 측정 정합 + 다중 머리행 반복 overhead + VPOS_CORR 정합)만 순변경분으로
적층한다.

핵심 변경:
- table_layout.rs: cell_units() 유닛 평탄화 + RowCut 단일 컷 측정
- table_partial.rs: 분할 표 컷 모델(줄 범위 → cut 이산)
- typeset.rs / pagination: cut 모델 페이지네이터 정합
- LAYOUT_OVERFLOW 42 → 12
- golden(issue-617/677/form-002) cut 모델 + devel 휴리스틱 정합 재생성

알려진 잔여(기존 #1024부터 존재, 본 재구성이 유발하지 않음):
- tests/issue_598_footnote_marker_nav: body footnote 마커 hit-test 좌표(y=380)가
  cut/vpos 레이아웃 변경으로 어긋남 → 좌표 갱신 또는 회귀 판정 후속 필요.
@planet6897 planet6897 changed the title 측정 정합: 분할 표 cut 모델 + LAYOUT_OVERFLOW 42→12 (closes #1022) Task #1022: 측정 정합 — 분할 표 cut 모델 + LAYOUT_OVERFLOW 42→12 (closes #1022) May 20, 2026
planet6897 added a commit to planet6897/rhwp that referenced this pull request May 20, 2026
 edwardkim#1022)

stream/devel(=edwardkim/devel) 최신 기준으로 재구성. devel에 이미 merge된
edwardkim#990/edwardkim#991 휴리스틱 정정 위에, edwardkim#1024 고유 작업(분할 표 RowCut 이산 cut 모델 +
cell_units 측정 정합 + 다중 머리행 반복 overhead + VPOS_CORR 정합)만 순변경분으로
적층한다.

핵심 변경:
- table_layout.rs: cell_units() 유닛 평탄화 + RowCut 단일 컷 측정
- table_partial.rs: 분할 표 컷 모델(줄 범위 → cut 이산)
- typeset.rs / pagination: cut 모델 페이지네이터 정합
- LAYOUT_OVERFLOW 42 → 12
- golden(issue-617/677/form-002) cut 모델 + devel 휴리스틱 정합 재생성

알려진 잔여(기존 #1024부터 존재, 본 재구성이 유발하지 않음):
- tests/issue_598_footnote_marker_nav: body footnote 마커 hit-test 좌표(y=380)가
  cut/vpos 레이아웃 변경으로 어긋남 → 좌표 갱신 또는 회귀 판정 후속 필요.
 edwardkim#1022)

stream/devel(=edwardkim/devel) 최신 기준 재구성. devel에 이미 merge된 edwardkim#990/edwardkim#991
휴리스틱 정정 위에, edwardkim#1024 고유 작업(분할 표 RowCut 이산 cut 모델 + cell_units 측정
정합 + 다중 머리행 반복 overhead + VPOS_CORR 정합)만 순변경분으로 적층.

핵심 변경:
- table_layout.rs: cell_units() 유닛 평탄화 + RowCut 단일 컷 측정
- table_partial.rs: 분할 표 컷 모델(줄 범위 → cut 이산)
- typeset.rs / pagination: cut 모델 페이지네이터 정합
- LAYOUT_OVERFLOW 42 → 12
- layout.rs: edwardkim#537 trailing-ls 보정 조건부 복원(아래) — 비표 문서 vpos 회귀 차단
- golden(issue-617/677/form-002) cut 모델 + devel 휴리스틱 정합 재생성

trailing-ls 보정 조건부화(v2):
재구성 중 issue_598_footnote_marker_nav 회귀를 검출. lazy_base 산출의 edwardkim#537
trailing-ls 보정을 조건부로 복원한다.
  lazy_base_corrected = prev_vpos_end - (y_delta_hu + trailing_ls_hu)
  lazy_base = if lazy_base_corrected >= 0 { corrected } else { uncorrected }
- 컬럼이 vpos≠0 에서 시작(상단 박스/도형 뒤 본문): 보정 적용 → IR 정합.
- sequential 이 IR 을 정확 추적(drift 0): 비보정 유지 → 표 over-correction 방지.
PDF(한컴 2022) 검증: footnote-01·복학원서 모두 정답지 정합(복학원서 본문 시작
band 196→214=PDF 일치). exam_kor·form-002 골든 불변.

검증: cargo test 전체 green, issue_598 4/4, golden 8/8, cargo fmt --all --check 통과.
edwardkim pushed a commit that referenced this pull request May 20, 2026
stream/devel(=edwardkim/devel) 최신 기준 재구성. devel에 이미 merge된 #990/#991
휴리스틱 정정 위에, #1024 고유 작업(분할 표 RowCut 이산 cut 모델 + cell_units 측정
정합 + 다중 머리행 반복 overhead + VPOS_CORR 정합)만 순변경분으로 적층.

핵심 변경:
- table_layout.rs: cell_units() 유닛 평탄화 + RowCut 단일 컷 측정
- table_partial.rs: 분할 표 컷 모델(줄 범위 → cut 이산)
- typeset.rs / pagination: cut 모델 페이지네이터 정합
- LAYOUT_OVERFLOW 42 → 12
- layout.rs: #537 trailing-ls 보정 조건부 복원(아래) — 비표 문서 vpos 회귀 차단
- golden(issue-617/677/form-002) cut 모델 + devel 휴리스틱 정합 재생성

trailing-ls 보정 조건부화(v2):
재구성 중 issue_598_footnote_marker_nav 회귀를 검출. lazy_base 산출의 #537
trailing-ls 보정을 조건부로 복원한다.
  lazy_base_corrected = prev_vpos_end - (y_delta_hu + trailing_ls_hu)
  lazy_base = if lazy_base_corrected >= 0 { corrected } else { uncorrected }
- 컬럼이 vpos≠0 에서 시작(상단 박스/도형 뒤 본문): 보정 적용 → IR 정합.
- sequential 이 IR 을 정확 추적(drift 0): 비보정 유지 → 표 over-correction 방지.
PDF(한컴 2022) 검증: footnote-01·복학원서 모두 정답지 정합(복학원서 본문 시작
band 196→214=PDF 일치). exam_kor·form-002 골든 불변.

검증: cargo test 전체 green, issue_598 4/4, golden 8/8, cargo fmt --all --check 통과.
edwardkim added a commit that referenced this pull request May 20, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim added a commit that referenced this pull request May 20, 2026
… + LAYOUT_OVERFLOW 42→12

@planet6897 분할 표 시리즈 마무리 (#1003 + #1004 머지 후 발전형, devel 최신
기준 재구성으로 MERGEABLE). RowCut 이산 모델(cell_units + advance_row_cut
단일 권위 함수)로 페이지네이터·렌더러 측정 통합 — PR #1004 휴리스틱
정정 일반화. closes #1022 — LAYOUT_OVERFLOW 42→12 (71% 감소) 정량 측정.

v2 trailing-ls 조건부 복원 (issue_598 회귀 자정) — lazy_base_corrected >= 0
조건부 가드로 vpos≠0 시작 컬럼 보정 + IR 정확 추적 케이스 비보정.
복학원서 본문 시작 band 196→214=PDF 일치 PR 본문 명시 (본 환경 미발동,
후속 관찰).

옵션 A: 본질 squash commit bc1cd4d cherry-pick (작성자 Jaeook Ryu 보존,
충돌 없음). 검증: cargo test 1308(lib) + 전체 통합 + pagination 15 +
wasm_api 160 + clippy -D 전체(--lib 미한정 CI 패턴) + fmt --all --check
(feedback_push_full_test_required + CI 패턴 정합). sweep 10 fixture:
hy-001/table-vpos-01/복학원서 diff=0, sample16-hwp5 13/64 + sample16-hwp3
2/64 + aift 27/74 + exam_kor 16/20 + biz_plan 3/6 광범위 변동 (분할 표
영역 의도된 효과). WASM 4.84MB.

작업지시자 결정 "그대로 A로" — 광범위 변동 시각 판정 생략 머지. 정량
측정(LAYOUT_OVERFLOW 71% 감소) + 회귀 가드(issue_598/svg_snapshot) +
CI 검증 항목 통과로 게이트 대체. golden 갱신: issue-617 + form-002
(PR 본문 명시 issue-677은 PR 적용 후 출력=현재 golden binary identical
로 갱신 불필요).

feedback_pr_supersede_chain 권위 사례 — 작은 단위(#1003) + 부분(#1004) +
발전형(#1024) 순차 적층 → 단일 권위 모델 일반화. feedback_image_renderer_
paths_separate 본질 정합 (PR #1018 image_resolver 패턴).
@edwardkim

Copy link
Copy Markdown
Owner

옵션 A로 devel에 반영했습니다 (본질 squash commit bc1cd4d cherry-pick, 작성자 Jaeook Ryu 메타데이터 보존, 충돌 없음).

검증 (feedback_push_full_test_required + CI 패턴 정합):

  • cargo test --release --lib 1308 + 전체 통합 / pagination 15/0 / wasm_api 160/0 / clippy -D 전체(--lib 미한정 CI 패턴) / fmt --all -- --check / WASM 4.84MB
  • sweep 10 fixture: hy-001/table-vpos-01/복학원서 diff=0, sample16-hwp5 13/64 + sample16-hwp3 2/64 + aift 27/74 + exam_kor 16/20 + biz_plan 3/6 (분할 표 영역 광범위 변동, 의도된 RowCut 효과)
  • 작업지시자 결정 "그대로 A로" — 광범위 변동 시각 판정 생략, 정량 측정(LAYOUT_OVERFLOW 71% 감소) + 회귀 가드 + CI 통과로 게이트 대체

devel 최신 기준 재구성으로 MERGEABLE 달성, 단일 권위 RowCut 모델로 PR #1004 휴리스틱 정정을 일반화하신 작업 감사합니다. v2 trailing-ls 조건부 복원 (issue_598 회귀 자정)도 정밀합니다.

후속 관찰 영역:

  • 복학원서 본문 시작 band 196→214=PDF 일치 효과가 본 환경에서 미발동 (cargo test/sweep 적용 후도 출력 = devel binary identical) — 컨트리뷰터 환경 특정 페이지 / commit 누락 / v2 조건 미충족 가능성. 후속 PR 또는 별건 issue 검토 권고
  • golden 갱신: issue-617 + form-002 (PR 본문 명시 issue-677은 본 환경 적용 후 출력=현재 golden binary identical로 갱신 불필요)

@planet6897 5/20 분할 표 시리즈 (#1003 + #1004 + #1024) 마무리 감사합니다.

@edwardkim edwardkim closed this May 20, 2026
edwardkim added a commit that referenced this pull request May 20, 2026
…loses #1028)

HWPX `parse_draw_text` 의 <hp:subList> `textDirection="VERTICAL/VERTICALALL"`
속성 파싱 누락 정정 (parser 12줄). HWP5/HWP3는 정상 렌더되었으나 HWPX
만 미적용이었던 글상자 세로쓰기를 HWP5와 동일 IR (list_attr bit 0~2)로
정합. renderer는 변경 없음 (shape_layout.rs:1652 이미 보유).

samples/hwpx/tbox-v-flow-01.hwpx (윤동주 "서시") rotate transform 0→4
(HWP5 정답지 동일). sweep 7 fixture diff=0 (hy-001/sample16/exam_kor/
aift/tv01) — case-specific 동작 입증. 작업지시자 시각 판정 통과 (한글
2022 PDF 정합).

회귀 가드 tests/issue_1028_hwpx_textbox_vertical.rs 2/2 통과. 검증:
cargo test 1308(lib) + 전체 통합 + clippy -D + fmt --all (CI 패턴) +
WASM 4.84MB.

후속 권고: cell/sec_def textDirection 매칭에 VERTICALALL 추가, 영문
눕힘/세움 구분 정밀화.
edwardkim added a commit that referenced this pull request May 20, 2026
PR #1032 (closes #1027) 머지 후속 처리:
- mydocs/pr/archives/pr_1032_review.md (검토 문서 archives 이동)
- mydocs/orders/20260520.md (PR #1032 entry 추가)
- rhwp-studio/public/{rhwp.d.ts,rhwp.js,rhwp_bg.wasm} (WASM 4.86MB 동기화)

@planet6897 분할 표·측정 시리즈 마무리 (#1003+#1004+#1024+#1032).
HeightCursor 공유 측정 엔진 + parity 7개로 페이지네이터↔렌더러 정합.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
edwardkim added a commit that referenced this pull request May 20, 2026
@planet6897 23번째 PR (분할 표·측정 시리즈 5번째 마지막 마디:
#1003#1004#1024#1032#1033). page-larger 단일 표 셀 (PMR-007
세부내용 셀 25문단 ≈ 1024px) 이 rowspan 라벨 셀 (rs=2) 이 걸친 행에
있어 `advance_row_cut` 의 row_span==1 셀만 다루는 #993 컷 모델에서
원자 처리되어 본문 143px 초과·용지 밖 잘림. row-block 컷으로 일반화.

본질:
- src/renderer/layout/table_layout.rs (+170): `advance_row_block_cut`
  신규 — rowspan 블록 [b_start, b_end) 셀을 (row,col) 순서로 순회,
  거대 row_span==1 셀 줄 단위 분할, rs>1 라벨 셀 첫 조각 전량 소비
  + 연속 조각 공란. + `row_block_cells` / `row_block_content_height`
  헬퍼 (페이지네이터·렌더러 단일 권위). + parity 단위 테스트 2건
  (단일 비-rowspan 행 = advance_row_cut 동등 + rowspan 거대 셀 분할).
- src/renderer/pagination.rs (+6): PageItem::PartialTable.is_block_split
  플래그 추가 — page-larger 분할만 새 모드, 기존 분할 (form-002 등)
  은 false 유지 (backward-compatible).
- src/renderer/layout/table_partial.rs (+170/-29): is_block_split=true
  렌더 — rowspan 행 포함, rowspan_block_range/block_cut_index 로
  블록-셀 인덱싱, rs>1 라벨 셀 연속 공란.
- src/renderer/typeset.rs (+83/-6): mid-page 분할 게이트 (block_h >
  base_available 일 때만 진짜 page-larger 활성, 아니면 deferred).
  연속분 행-스킵 가드 블록 컷에서 스킵 (컷 보존).
- src/renderer/{layout.rs, page_number.rs, pagination/engine.rs,
  document_core/queries/rendering.rs} 최소 변경.

검증 (본 환경):
- cargo test --release --lib **1319 passed** (+2 block_cut tests)
- cargo test --release --tests 모든 통합 passed (issue_852 5/5 +
  svg_snapshot 8/8 + table-vpos-01 13/13 + issue_938 3/3 등)
- cargo fmt --all --check clean
- cargo clippy 통과
- sweep 7 fixtures: **diff=0 전체** — page-larger 케이스가 공개
  fixture 에 없음. PR #1031/#1032 회귀 부재 + 일반 분할 form/일반
  fixture 무변경 입증
- WASM Docker 빌드 4.89MB (+30KB) + rhwp-studio 동기화
- 작업지시자 시각 판정 통과

cherry-pick 자연 통합:
- PR base = a52859d (PR #1032 이전), origin/devel = 5263f53
- cherry-pick auto-merge 로 PR #1031 (build_page_borders) + PR #1032
  (HeightCursor / vpos_snap_current_height 13건) 영역 자동 보존
- PR #1033 변경 (advance_row_block_cut + is_block_split) 통합

검증 권위 PR 본문 명시 (AI 184p 비공개 RFP, 본 환경 미접근):
- LAYOUT_OVERFLOW 27→25
- pi=272 세부 셀 (854.9px) 해소
- pi=324 PMR-007 (143.9px) 2-프래그먼트 분할 한컴 2022 PDF 정합

@planet6897 분할 표·측정 시리즈 마무리 (#1003+#1004+#1024+#1032+#1033).

closes #1025

Co-Authored-By: Jaeook Ryu <planet6897@users.noreply.github.com>
edwardkim added a commit that referenced this pull request May 20, 2026
PR #1033 (closes #1025) 머지 후속 처리:
- mydocs/pr/archives/pr_1033_review.md (검토 문서 archives 이동)
- mydocs/orders/20260520.md (PR #1033 entry 추가)
- rhwp-studio/public/{rhwp.d.ts,rhwp.js,rhwp_bg.wasm} (WASM 4.89MB 동기화)

@planet6897 분할 표·측정 시리즈 마무리 5번째 마지막 마디
(#1003+#1004+#1024+#1032+#1033).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants