Skip to content

HWPX 어댑터 페이지 수 +1쪽 잔존 origin 조사 (hwpx-h-02) #317

@planet6897

Description

@planet6897

선행: #313 (TypesetEngine main 전환), #314 (어댑터 normalize 부분 완료)

배경

#314 에서 HWPX → 어댑터 → HWP 라운드트립의 일부 IR 차이를 해소했으나(char_shapes empty default, control_mask 재계산), 페이지 수 +1쪽 차이는 그대로 잔존.

```
[#178 Stage 4] hwpx-h-02: orig=9, after_adapter=10
```

#314 의 normalize 후 잔존 paragraph 필드 차이:

  • char_count 3건
  • char_count_msb 2건
  • raw_break_type 4건 (column_type=Page 동일이나 raw 0x00 vs 0x04)
  • raw_header_extra 130건 (전체)
  • controls_len 2건 (어댑터 SectionDef 의도)

#314 분석에서 페이지 3 단 0 의 used_height 가 direct=1268.5px 와 reloaded=595.5px 로 크게 다름. Table pi=51 처리에서 분기되는 것으로 보임.

작업 범위

  1. 잔존 차이 중 typeset 영향 origin 식별:
    • char_count 3건 (paragraph 0.0, 0.34, 1.0 — 0.34 가 +1쪽 발생 페이지 3 내부) — 가장 의심
    • paragraph 외 다른 IR 차이 추적 (style, doc_info, 표 cell paragraphs 의 다른 필드)
    • 직렬화/파싱 라운드트립 손실 trace
  2. 페이지 3 단 0 의 paragraph-by-paragraph current_height 누적 차이 측정
  3. 식별된 origin 보강
  4. 격리된 3개 테스트 #[ignore] 제거 + 통과 확인

격리된 테스트 (재활성화 대상)

  • `tests/hwpx_to_hwp_adapter.rs::stage4_page_count_recovered_hwpx_h_02`
  • `tests/hwpx_to_hwp_adapter.rs::stage5_all_three_samples_recover_via_unified_entry_point`
  • `tests/hwpx_to_hwp_adapter.rs::stage6_verify_recovered_for_all_three_samples`

검증

  • 위 3개 테스트 통과 (hwpx-h-02 변환 후 9쪽)
  • `cargo test` 전체 회귀 0
  • hwpx-h-01/h-02/h-03 모두 어댑터 변환 후 페이지 수 보존
  • 4샘플 (21_언어 등) 무회귀

비범위

추정 작업 강도

`#314` 진단으로 origin 후보가 좁혀졌으나 (char_count + 미식별 깊은 곳) 확정에 추가 trace 필요. 직렬화/파싱 라운드트립 디버깅 도구 추가가 필요할 수 있음.

참고

  • `mydocs/report/task_m100_314_report.md`
  • `mydocs/working/task_m100_314_stage1.md` (LINE_SEG 비교)
  • `mydocs/working/task_m100_314_stage2.md` (normalize 적용)
  • `tests/hwpx_to_hwp_adapter.rs` (격리 테스트 + 사유 메시지)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions