Skip to content

Task #521: TAC 표 outer_margin_bottom 누락 정정#564

Closed
planet6897 wants to merge 7 commits into
edwardkim:develfrom
planet6897:pr-task521
Closed

Task #521: TAC 표 outer_margin_bottom 누락 정정#564
planet6897 wants to merge 7 commits into
edwardkim:develfrom
planet6897:pr-task521

Conversation

@planet6897

Copy link
Copy Markdown
Contributor

본질

src/renderer/layout.rs::layout_table_item TAC after-spacing 분기 (라인 2497 직후) 가 outer_margin_bottom 미적용. layout_partial_table_item (라인 2638-2647) 와 정합시키는 단일 룰 적용.

한컴 명세: lh = cell_h + outer_margin_bottom (exam_eng pi=104 lh=22207 = cell_h(21607) + outer_margin_bottom(600))

cell_h 만 advance → 다음 paragraph -8 px shortfall (exam_eng p2 18번 ① 위치 PDF 한컴 2010 대비).

변경 사항

  • src/renderer/layout.rs +11 LOC (5 LOC fix + 6 LOC 코멘트)
  • src/renderer/layout/integration_tests.rs +80 LOC (test_521_tac_table_outer_margin_bottom_p2 추가)

검증

  • cargo test --lib --release: 1121 passed / 0 failed (baseline 1120 → +1 test_521 GREEN)
  • cargo clippy --release --lib: 신규 결함 0 (pre-existing 2건은 object_ops.rs 무관)
  • 광범위 sweep: 13 fixture 481 페이지 — 278 differ / 203 byte-identical / text count 변동 0 (모든 차이는 의도된 outer_margin_bottom 시프트)
  • exam_eng p2 18번 ① 위치: 543.95 → 551.95 (+8 px PDF 정합), 후속 두 ① 동일 +8 px 일관 시프트
  • 회귀 가드 GREEN 유지: test_544 / test_547 / test_469, 기존 issue_546/530/505/418/501

closes

closes #521

🤖 Generated with Claude Code

planet6897 and others added 7 commits May 4, 2026 09:57
… 산식 정정)

paragraph_layout.rs:
1. inner_pad 분기 제거 (line 693~717 → 693~700, -22 LOC)
   - has_visible_stroke / bs_left_px / bs_right_px / inner_pad_left/right 변수 모두 제거
   - margin_left = box_margin_left (단일 룰, 텍스트 inset 한 번만)
2. box_x/w 산식 정정 (line 2687~2691)
   - override 케이스: (ox, ow) — margin 미적용
   - 일반 케이스: (col_area.x, col_area.width) — margin 미적용
   - paragraph border outline = col_area 전체 (PDF 한컴 2010 정합)

integration_tests.rs:
- test_544_passage_box_coords_match_pdf_p4 의 #[ignore] 제거 → GREEN
- test_547_passage_text_inset_match_pdf_p4 의 #[ignore] 제거 → GREEN

검증:
- cargo test --lib: 1121 passed / 3 ignored (baseline 1119/5 → +2 GREEN, -2 ignored)
- 회귀 0건
- test_552_passage_box_top_gap_p2_4_6 (--ignored) GREEN 유지
  → Task edwardkim#552 가 Task edwardkim#544 (2) 효과 흡수 (Stage 1 finding 확정)

측정값:
- test_544: box_left_x 128.51 → 117.0 (PDF 117.0 ±2), box_width 425.1
- test_547: min_x 139.89 → 128.5 (PDF 128.5 ±2)

작업지시자 보고 증상 (글상자 우측 시프트) 직접 fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…y-pick @planet6897 1 commit)

옵션 A2 채택 — `05beb208` (Task edwardkim#544 v2 Stage 2) 단독 cherry-pick.
B1 진단 결과 본 devel 의 Task edwardkim#479 미적용 trailing-ls 모델 확인 →
당초 옵션 A3 (edwardkim#552 + v2 + v3) 의 모델 전환 위험 회피 → 최소 fix 채택.

- mydocs/pr/pr_551_review_v3_544_a2.md (검토 문서)
- mydocs/pr/pr_551_v3_544_a2_report.md (처리 보고서)
- mydocs/orders/20260504.md (오늘할일 신규)

closes edwardkim#544

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… (옵션 A2 — passage 글상자 우측 시프트 정정 — @planet6897 1 commit)

작업지시자 보고: "21_언어_기출_편집가능본.hwp 1/2/4/5/7/8/11/13/14 페이지
글상자가 오른쪽으로 밀려있음".

이슈 edwardkim#544 (closed) 재오픈 후 PR edwardkim#551 잔존 cherry-pick. 당초 옵션 A3
(edwardkim#552 + v2 + v3) 검토했으나 B1 진단 결과 본 devel 의 Task edwardkim#479 미적용
(pre-edwardkim#479 trailing-ls 항상 가산 모델) 확인 → edwardkim#552/v3 cherry-pick 시
모델 전환 위험. 옵션 A2 (`05beb208` 단독, edwardkim#547+edwardkim#544(1) 통합) 채택.

본질 정정 (paragraph_layout.rs):
1. box_x = col_area.x / box_w = col_area.width (margin 미적용,
   paragraph border outline = col_area 전체).
2. inner_pad 분기 제거 (visible-stroke + bs=0 인 경우 margin_left =
   box_margin_left + inner_pad_left 이중 적용 → 단일 적용).

측정 (페이지 4 [7~9]):
- 박스 left x: 128.51 → 117.17 (PDF 117.0)
- 박스 width: 402.5 → 425.17 (PDF 425.1)
- 본문 첫 글자 '평' x: 153.12 → 128.51 (PDF 128.5)
- 9 박스 (col 0/1) 모두 정합

검증:
- cargo test --lib 1120 / test_544+test_547 +2 GREEN / 회귀 0건
- clippy 0 신규 (pre-existing 2건 동일 baseline)
- 5 샘플 58 페이지 광범위 sweep: 38 differ (의도된 paragraph border
  정합 변경, visible-stroke paragraph text -11.33 px 좌측 시프트 의도)
- 회귀 검출 가능 영역 (비-border paragraph text) 0 변경
- 작업지시자 시각 판정 통과

cherry-pick 1 commit:
- 457d5f3 Task edwardkim#544 v2 Stage 2 (`05beb208` from @planet6897)

처리 보고서: mydocs/pr/pr_551_v3_544_a2_report.md
검토 문서: mydocs/pr/pr_551_review_v3_544_a2.md

closes edwardkim#544

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- mydocs/pr/pr_551_review_v3_544_a2.md → archives/
- mydocs/pr/pr_551_v3_544_a2_report.md → archives/
- mydocs/orders/20260504.md: 처리 상태 갱신 (devel merge f6039f3 push + 이슈 edwardkim#544 close)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
본질: src/renderer/layout.rs::layout_table_item TAC after-spacing
분기 (라인 2478-2497) 가 outer_margin_bottom 미적용. layout_partial_table_item
(라인 2638-2647) 와 정합시키는 단일 룰 적용 (5 LOC).

한컴 명세 정합: lh = cell_h + outer_margin_bottom (exam_eng pi=104
lh=22207 = 21607+600). cell_h 만 advance → 다음 paragraph -8 px shortfall.

검증:
- cargo test --lib --release: 1120 → 1121 GREEN (+test_521)
- clippy 신규 0
- 13 fixture 481 페이지 sweep: 278 differ / 203 byte-identical
  / text count 변동 0 / 모든 차이는 의도된 outer_margin_bottom 시프트
- exam_eng p2 18번 ① 543.95→551.95 (+8 px PDF 한컴 2010 정합)
- 회귀 가드 test_544/test_547/test_469 GREEN 유지

closes edwardkim#521

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
본질 정정 완료, 광범위 회귀 검증 통과. PR 등록 대기 (작업지시자
시각 판정 후 push + PR 등록 base=devel head=planet6897:pr-task521).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
push (origin/pr-task521) + PR edwardkim#564 등록 (base=devel,
head=planet6897:pr-task521) 완료. merge 후 이슈 edwardkim#521 자동 close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim added a commit that referenced this pull request May 5, 2026
PR #564 (Task #521, @planet6897 PR / Jaeook Ryu commit author) 1차 검토:
- 본질 결함: layout_table_item TAC after-spacing 분기가
  outer_margin_bottom 미적용 (layout_partial_table_item 와 산식 불일치)
- 한컴 명세: lh = cell_h + outer_margin_bottom
  (exam_eng pi=104 lh=22207 = 21607+600)
- 정량 측정: exam_eng p2 18번 ① 543.95 → 551.95 (+8 px PDF 정합)
- 단일 룰 정정 (layout_partial_table_item 산식과 통일,
  feedback_rule_not_heuristic 정합)
- PR mergeable=CONFLICTING (stacked 구조 + PR base 시점 차이),
  본질 cherry-pick (04eefd9) 충돌 0
- 본 환경 임시 검증: cargo test --lib --release 1131 passed
  (test_521 RED → GREEN 전환)

권장 처리: 옵션 A — 핀셋 cherry-pick + WASM 빌드 +
메인테이너 직접 광범위 페이지네이션 검증.
edwardkim added a commit that referenced this pull request May 5, 2026
edwardkim added a commit that referenced this pull request May 5, 2026
…bottom 누락 정정 — @planet6897 / Jaeook Ryu 1 commit + 시각 판정 ★ 통과)

PR #564 (Task #521, @planet6897 PR / Jaeook Ryu commit author):
- 본질 결함: layout_table_item TAC after-spacing 분기가
  outer_margin_bottom 미적용 (layout_partial_table_item 와 산식 불일치)
- 한컴 명세: lh = cell_h + outer_margin_bottom
  (exam_eng pi=104 lh=22207 = 21607+600)
- 단일 룰 정정 (layout_partial_table_item 산식과 통일)
- exam_eng p2 18번 ① 543.95 → 551.95 (+8 px PDF 정합)

검증:
- cargo test --lib --release 1131 passed (test_521 GREEN)
- svg_snapshot 6/6 / issue_546 1 / issue_554 12 / clippy 0 / build --release
- WASM 4,570,615 bytes (PR #567 baseline +151 bytes)
- 광범위 페이지네이션 회귀 sweep: 164 fixture (158 hwp + 6 hwpx) /
  1,614 페이지 / 페이지 수 회귀 0

시각 판정 ★ 통과 (메인테이너 광범위한 샘플 파일 페이지네이션 +
분리된 표 검증).

closes #521.
@edwardkim

Copy link
Copy Markdown
Owner

@planet6897 @jangster77 님,

본 PR 의 본질 commit (04eefd99) 핀셋 cherry-pick 후 devel merge 완료되었습니다 (47aab48).

처리 결과

본질 cherry-pick

  • 04eefd99 Stage 3-4 본질 정정 (src/renderer/layout.rs +11/-1 + integration_tests.rs +80)
  • 충돌 0건 (PR mergeable=CONFLICTING 표시는 stacked 구조 + PR base 시점 차이, 본질은 깨끗 적용)
  • author Jaeook Ryu (@jangster77) 보존

결정적 검증

광범위 페이지네이션 회귀 sweep (본 환경 자동)

통계 결과
총 fixture 164 (158 hwp + 6 hwpx — samples/ 폴더 전체)
총 페이지 (devel baseline) 1,614
총 페이지 (cherry-pick 후) 1,614
fixture 별 페이지 수 차이 0

→ TAC 표 outer_margin_bottom 가산 (+8 px / 표) 이 페이지 break 를 트리거하는 케이스 없음. PR 본문 "278 differ / text count 변동 0" 안전성 패턴이 본 환경 광범위 sweep 으로 정량 입증.

시각 판정 (★ 게이트)

작업지시자 시각 판정 결과:

메인테이너의 광범위한 샘플 파일 페이지네이션 및 분리된 표 시각 검증 통과입니다.

WASM 기반 다양한 hwp 문서 직접 시각 검증 + 분리된 표 영역까지 통과. exam_eng p2 18번 ① 위치 (543.95 → 551.95, +8 px PDF 한컴 2010 정합) 의 정정이 확장되어 layout_table_item TAC after-spacing 분기 + layout_partial_table_item (분리된 표) 양 경로 모두 정합 회복.

단일 룰 + 한컴 명세 정합

분기 산식 변화
layout_partial_table_item (라인 2638-2647) lh = cell_h + outer_margin_bottom 변경 없음 (한컴 명세 정합 유지)
layout_table_item TAC after-spacing (라인 2497) cell_h 만 advance ❌ → cell_h + outer_margin_bottom 본 PR 정정

→ 두 분기 동일 산식으로 통일. 단일 룰 (feedback_rule_not_heuristic 정합) + 한컴 명세 정합 (exam_eng pi=104 lh=22207 = cell_h(21607) + outer_margin_bottom(600)).

Stacked PR 패턴 정합

본 PR 도 PR #561/#567 와 동일한 stacked 패턴 (PR #560 위) — PR #560 의 본질은 이미 devel 적용 완료 (a30dca7 = 457d5f33 cherry-pick), 본 PR 의 고유 본질 (04eefd99) 만 핀셋 처리. 컨트리뷰터 두 분의 협업 흐름 (@jangster77 의 본질 commit → @planet6897 의 fork 등록) 이 일관 유지되어 메인테이너 cherry-pick 의 본질만 깨끗하게 추출 가능했습니다.

처리 보고서: mydocs/pr/archives/pr_564_report.md (작성 후 push 됩니다).

본 PR 도 두 분의 협업 흐름의 우수한 사례입니다. 감사합니다.

@edwardkim edwardkim closed this May 5, 2026
edwardkim added a commit that referenced this pull request May 5, 2026
- 처리 보고서 추가: mydocs/pr/archives/pr_564_report.md
  PR #564 (Task #521, @planet6897 / @jangster77) 핀셋 cherry-pick
  1 commit + 결정적 검증 + WASM 4,570,615 bytes + 광범위 페이지네이션
  sweep (164 fixture / 1,614 페이지 / 회귀 0) + 시각 판정 ★ 통과
- 검토 보고서 archives 이동:
  mydocs/pr/pr_564_review.md → mydocs/pr/archives/pr_564_review.md
- 5/5 orders 갱신: PR #564 항목 추가
edwardkim added a commit that referenced this pull request May 5, 2026
…정 — @planet6897 / Jaeook Ryu 1 commit + 시각 판정 ★ 통과)

PR #570 (Task #568, @planet6897 PR / Jaeook Ryu commit author):
- 본질 결함: paragraph_layout.rs::layout_composed_paragraph L857
  effective_col_x/w 분기가 인라인 TAC 표 보유 줄의 segment_width 무시 →
  Justify slack 과대 산출 → 선두 공백 80 px/space 부풀음 →
  인라인 표 +175 px 우측 편위 (exam_science pi=61 12번 응답 분수)
- 본질 정정: has_picture_shape_square_wrap || line_has_inline_tac_table
  분기 확장 (단일 룰 확장) + 임계값 sw+cs 보정
  (column_start 인코딩 정상 paragraph 미진입 보장)
- 단일 파일 본질 (paragraph_layout.rs +25/-2)
- 정량 측정: pi=61 인라인 분수 x=739.87 → 584.93

검증:
- cargo test --lib --release 1131 passed (회귀 0)
- svg_snapshot 6/6 / issue_546 1 / issue_554 12 / clippy 0 / build --release
- WASM 4,570,901 bytes (PR #564 baseline +286 bytes — paragraph_layout.rs +25/-2 정합)
- 광범위 페이지네이션 회귀 sweep: 164 fixture (158 hwp + 6 hwpx) /
  1,614 페이지 / 페이지 수 회귀 0
- exam_science byte 차이: page 1/3/4 byte-identical, page 2 만 의도된 정정
  (PR 본문 100% 재현)

시각 판정 ★ 통과 — 메인테이너의 SVG (exam_science 12번 문항)
시각 검증으로 인라인 분수 [1g의 A에 들어 있는 중성자수 /
1g의 D에 들어 있는 중성자수] 정상 배치 회복 확인.

closes #568.
edwardkim added a commit that referenced this pull request May 5, 2026
v0.7.9 후속 patch 사이클 (5/4 ~ 5/6).

## 신규 기능

- **CLI 바이너리 릴리즈** (Issue #608/#612, @almet 의 요청)
  - 4 플랫폼 GitHub Release 자산 첨부 (Linux x86_64 / macOS x86_64+aarch64 /
    Windows x86_64) + SHA-256 체크섬
- **PNG raster backend** (PR #599, @seo-rii) — render P4 단계
  - native Skia 기반 PageLayerTree → PNG export, native-skia feature gate
  - **AI 파이프라인 + VLM 연동 도입** (메인테이너 후속 정정):
    - --vlm-target claude (1568 longest edge / 1.15 MP, Claude Vision 정합)
    - --scale / --max-dimension (자동 scale 계산)
    - export-png CLI 명령 + 매뉴얼 (한글 + 영문 dual)
    - 한글 폰트 fallback chain + char 단위 fallback (공백 두부 정정) +
      --font-path 동적 로딩

## 외부 PR cherry-pick (13 PR / 7 컨트리뷰터)

- @planet6897 / Jaeook Ryu (협업): PR #587/#589/#561/#564/#570/#575/
  #580/#584/#592/#593/#567
- @oksure (Hyunwoo Park): PR #600 (closes #513)
- @seo-rii: PR #599 (refs #536)
- @cskwork / @johndoekim / @nameofSEOKWONHONG / @jangster77 — 사이클 누적

## 메인테이너 정정

Skia 폰트 영역 5개 정정 (한글 fallback / font-path / char-fallback /
VLM 옵션 / export-png CLI).

## 인프라

- CI 빌드 안정성 (Cargo.toml [[example]] required-features)
- 광범위 페이지네이션 회귀 sweep 도구 (164 fixture / 1,614 페이지 자동)

## 후속 이슈

- #613 (VLM 프리셋 확장)
- #614 (DPI 메타데이터)
- #615 (pua_oldhangul.rs U+F53A 한컴 정합)
- #598 (rhwp-studio 각주 삭제, 외부 컨트리뷰터 공개)

## 잔여 PR (v0.7.11 후속 patch)

PR #601, #602 (@oksure) / PR #607 (@dicebattle) / PR #609 (@jangster77,
Task #604) / PR #611 (@kihyunnn).

상세: CHANGELOG.md (한글) / CHANGELOG_EN.md (영문).
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.

2 participants