Task #1556: 다단락 누름틀 필드 고아 fieldEnd 8유닛 시프트 수정 (HWPX serializer)#1561
Merged
Conversation
다단락(문단 경계를 넘는) CLICK_HERE(누름틀) 필드에서, 종료 마커가 있는 문단의 고아 `<hp:fieldEnd>` 가 8유닛 슬롯을 IR 로 표현하지 못해 직렬화 시 소실되어 char_offset/char_count 가 8 시프트되는 결함을 수정. - 원인: 파서의 field_stack 이 문단 단위라 begin·end 가 다른 문단인 필드는 연결되지 않음. end 문단은 Control·FieldRange 둘 다 없어 8유닛 슬롯 산출물 부재. - 해결: Paragraph.orphan_field_ends 로 고아 fieldEnd(위치+beginIDRef+fieldid) 기록, 직렬화기가 같은 위치에 fieldEnd 복원. inferred_control_slot_count 에서 orphan_field_ends.len() 차감으로 슬롯 추정 정합. 검증: 대표 실문서 diff=1→0, 2023-01-05 코퍼스 IR_DIFF 24→1(잔여 1건은 별개 그림 BinData 결함), 단위 테스트 5건, hwpx_roundtrip_baseline 무회귀, 전체 cargo test 무회귀. 회귀 가드: samples/hwpx/field-multipara-clickhere.hwpx + 합성 roundtrip 테스트.
# Conflicts: # src/parser/hwpx/section.rs
Collaborator
|
@planet6897 감사합니다. 최신 로컬 확인:
원격 검증 결과:
merge commit: |
This was referenced Jun 27, 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.
개요
HWPX serializer 의 "컨트롤 슬롯 8유닛 시프트"(#1556) 잔여 결함 수정.
근본 원인은 다단락(문단 경계를 넘는) CLICK_HERE 누름틀 필드의 고아
<hp:fieldEnd>였다.근본 원인
field_stack은 문단 단위라 begin·end 가 다른 문단인 필드를 연결하지 못한다.\u{0004}(8유닛)만 차지하고Control·FieldRange둘 다미생성 → IR 에 8유닛 슬롯을 표현할 산출물이 없어 직렬화 시 소실 → char_offset/count −8.
cc 38→30,cs[1].pos 37→29(정확히 −8),controls=0.해결
Paragraph.orphan_field_ends(OrphanFieldEnd { char_idx, begin_id_ref, field_id }).beginIDRef/fieldid포착, 짝 없는 fieldEnd 를 고아로 기록.emit_orphan_field_end로 같은 위치에<hp:fieldEnd>복원.inferred_control_slot_count에서orphan_field_ends.len()차감으로 슬롯 추정 정합(핵심).검증
hwpx-roundtripdiff=1→0.IR_DIFF 24→1(잔여 1건은 그림 BinData 누락 = [도구] HWP5 roundtrip 무손실 게이트(hwp5-roundtrip CLI) 신설 — BinData 보존·페이지수 복원 검사 #1552 F1 별개 결함).cargo test --test hwpx_roundtrip_baseline무회귀, 전체cargo test무회귀.회귀 가드
samples/hwpx/field-multipara-clickhere.hwpx(공개 행정문서, baseline 게이트 자동 봉인).task1556_multipara_field_parse_serialize_parse_roundtrip.범위
HWPX serializer 전용. HWP5 F1(#1554)·F2'(#1555) 와 무관. HWP3/HWP5 공통 모듈 무수정.