fix: Layout 리팩터링 Phase 2 line_break_char_idx 다중화 누락 회귀 정정 (Task #518 재적용, closes #648)#650
Open
planet6897 wants to merge 2 commits intoedwardkim:develfrom
Open
fix: Layout 리팩터링 Phase 2 line_break_char_idx 다중화 누락 회귀 정정 (Task #518 재적용, closes #648)#650planet6897 wants to merge 2 commits intoedwardkim:develfrom
planet6897 wants to merge 2 commits intoedwardkim:develfrom
Conversation
Stage 1: RHWP_LAYOUT_DEBUG=1 env logging - paragraph_layout.rs 에 layout_debug_enabled() + layout_inline_table_paragraph 진단 로깅 - 출력: pi/sec/col_x/col_w/y_start/ls_count/tables + 각 ls/inline_tbl 상세 - env-var-checked → 기본 동작 변경 없음 Stage 2: scripts/svg_regression_diff.sh - build mode: 두 ref 자동 빌드 + 광범위 비교 - diff mode: 두 디렉토리 byte 비교 - 기본 7 샘플 170 페이지 커버 검증: - cargo test --release: 1103 passed - svg_regression_diff.sh build devel HEAD: 170/170 byte 동일, diff=0 - exam_science p2 pi=61 logging: ls_count=3 tables=1 rows=2 확인 Phase 2~4 본질 정정의 측정·재현·검증 인프라 마련. (cherry picked from commit 9c16a1b)
paragraph_layout.rs:layout_inline_table_paragraph 줄 나눔 위치 결정 정확도 향상. 핵심 변경: - line_break_char_idx: Option<usize> → line_break_char_indices: Vec<usize> → ls[1..] 모두 사용 (이전엔 ls[1] 만) - ctrl_gap 기반 algorithm → 직접 char_offsets 룩업 → 이전: paragraph 전체 controls 합으로 over-subtract → controls 많은 paragraph 에서 saturating 0 으로 항상 None → 신규: char_offsets[i] >= ts 인 첫 i 가 break char index (간결 + 정확) - wrap 조건에 next_break 추적 추가 - LAYOUT_BREAK_INDICES 디버그 로깅 추가 검증: - edwardkim#496 재현 케이스 (exam_science p2 pi=61): 본문 1줄 column 폭 초과 → 3줄 정상 wrap ls[1] break (char 5) + ls[2] break (char 28) 적용 - 회귀: 7 샘플 170 페이지 중 same=167 / diff=3 (exam_science 정확도 정정) exam_kor/exam_eng/exam_math/synam-001/aift/2010-01-06 byte 동일 - cargo test --release --lib: 1103 passed edwardkim#496 본질 (B) ls[2..] break 미사용 해결. (A) baseline 정렬 / (C) 인라인 vs 블록 은 Phase 3/4 영역. (cherry picked from commit b395e8e)
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.
개요
이슈 #648 정정. Task #518 (Layout 리팩터링 Phase 2 —
line_break_char_idx: Option<usize>→line_break_char_indices: Vec<usize>다중화) 의 원 commitb395e8e6를 cherry-pick 재적용. 이슈 #496 본질 (B)ls[2..]break 미사용 결함 해결.본 PR 의
LAYOUT_BREAK_INDICES디버그 로깅은 PR #649 가 도입한layout_debug_enabled()헬퍼에 의존합니다. 따라서 PR #649 선행 머지 → 본 PR 자동 1 commit 축약 → 머지 순으로 진행 권장.현재 본 PR 은 head=
pr-task648(=pr-task647+ Task #518 commit) 으로 구성되어 있어 GitHub 상에는 2 commit 으로 표시됩니다. PR #649 머지 후에는 본 PR diff 가b395e8e6단일 commit 으로 자동 축약됩니다.회귀 메커니즘
이슈 #618 (Task #519) → PR #620, 이슈 #647 (Task #517) → PR #649 와 동일 패턴: 묶음 머지
a7e43f9 (Task #517/#518/#519/#520/#521/#523/#528)가local/devel에는 머지되었으나stream/devel으로 승격되지 않음.→ Task #518 이전 단일 break 시그니처 그대로.
변경 내역
원 commit
b395e8e6를git cherry-pick -x로 그대로 적용 (충돌 없음).핵심 변경 (
src/renderer/layout/paragraph_layout.rs-40/+77):line_break_char_idx: Option<usize>line_break_char_indices: Vec<usize>ls[1]만ls[1..]모두ctrl_gap합산 (controls 많은 paragraph 에서 over-subtract → saturating 0 → 항상 None)char_offsets[i] >= ts인 첫i직접 룩업next_break추적 + 다중 break 검사LAYOUT_BREAK_INDICES로깅 추가검증
회귀 케이스 (원 commit 보고 인용): exam_science p2 pi=61 본문 1줄 column 폭 초과 → 3줄 정상 wrap (
ls[1]break char 5 +ls[2]break char 28). 7 샘플 170 페이지 중 same=167 / diff=3 (exam_science 정확도 정정).참고
b395e8e6a7e43f9(Merge local/devel: Task Layout 리팩터링 Phase 1: 디버그 인프라 + 회귀 검증 도구 #517/Layout 리팩터링 Phase 2: line_break_char_idx 다중화 (ls[2..] break 사용) #518/그림(Picture) 회전·뒤집기(flip) 속성이 SVG 렌더링에 적용되지 않음 #519/exam_science.hwp 문제7: inline 도형(tac=true, wrap=TopAndBottom)이 다음 문단 라인에 그려져 텍스트와 겹침 #520/exam_eng p2 18번 답안지 위치가 박스 하단에 너무 가까움 — 그림(BehindText) 의 vertical extent 가 paragraph height 에 미반영 #521/exam_science 페이지 1 → 2 누적 vpos drift: 문제 6번 <보기>/답안이 다음 페이지로 밀림 #523/옛한글 PUA → KS X 1026-1:2007 자모 변환 (HncPUAConverter 정합) — exam_kor 17p 고어 미렌더 #528)