Task #301: exam_math.hwp 12쪽 z-table 셀 수식 이중 렌더링 수정#303
Merged
Conversation
paragraph_layout(Task #287의 빈-runs 경로)과 table_layout이 같은 TAC Equation을 중복 emit하던 회귀 버그를 수정. table_layout.rs:1602 Equation 분기에 get_inline_shape_position 가드를 추가하여 paragraph_layout이 이미 렌더한 경우 직접 emit을 스킵. 회귀 테스트 tests/issue_301.rs 신규 추가. - 수정 전: z-table 값이 SVG에 각 2회 출현 (FAIL) - 수정 후: 각 1회 출현 (PASS) cargo test --release: 1039 passed / 0 failed cargo clippy --release: clean 기존 SVG 골든 6건 무회귀
edwardkim
approved these changes
Apr 25, 2026
edwardkim
left a comment
Owner
There was a problem hiding this comment.
Approved. 🎉
@planet6897 님, 어제 머지된 Task #287 회귀를 다음날 즉시 발견·수정하셨네요.
평가 포인트
- Task #287 회귀 정확 식별 — 두 경로(paragraph_layout/table_layout)의 비대칭성 명확히 분석
- 최소 수정 —
set_inline_shape_position메커니즘 재활용으로 1줄 OR 추가만으로 해결. 별도 상태 추가 없음 - 신규 회귀 테스트 —
tests/issue_301.rs로 z-table 값 (0.1915/0.3413/0.4332 각 1회, 0.4772는 본문 포함 2회) 검증 - 정직한 교훈 기록 — '양방향 렌더 경로의 동기화 검증' 절차 개선 제안
메인테이너 검증
| 항목 | 결과 |
|---|---|
| cargo test --lib | ✅ 992 / 0 / 1 ignored |
| cargo test --test svg_snapshot | ✅ 6 / 0 (golden 유지) |
| cargo test --test issue_301 | ✅ 1 / 0 (신규) |
| cargo test --test tab_cross_run | ✅ 1 / 0 (#290 회귀 없음) |
| cargo clippy / wasm32 | ✅ clean |
| CI (원본) | ✅ 전부 SUCCESS |
| 실제 SVG z-table 셀 출현 | ✅ 0.1915/0.3413/0.4332 각 1회, 0.4772 2회 (본문 포함) |
| WASM Docker 빌드 + rhwp-studio 브라우저 시각 검증 | ✅ 작업지시자 판정 성공 |
후속 후보
- Picture/Shape 유사 패턴 (작성자 인지) — 별도 이슈 후보
Merge 진행합니다.
edwardkim
added a commit
that referenced
this pull request
Apr 25, 2026
edwardkim
added a commit
that referenced
this pull request
Apr 25, 2026
- 작성자: @planet6897 (Task #301, PR #303) - Merge commit: 798b845 (Task #287/PR #289 회귀 수정) - 이슈 #301 CLOSED 변경 (1파일 1줄): - src/renderer/layout/table_layout.rs +7 -2: - Equation 분기에 tree.get_inline_shape_position() 가드 추가 - paragraph_layout(Task #287) 이 이미 렌더했으면 직접 emit 스킵 테스트: - tests/issue_301.rs (신규, +44): z_table_equations_rendered_once - 0.1915/0.3413/0.4332 각 1회, 0.4772는 본문 포함 2회 검증: - cargo test --lib: 992 passed - svg_snapshot: 6 passed (golden 유지) - 실제 SVG z-table 출현 횟수: 작성자 주장 정확히 일치 - WASM Docker 빌드 + rhwp-studio 브라우저 시각 검증: 성공 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
개요
samples/exam_math.hwp페이지 12 좌측 컬럼 #29 안의 정규분포 z-table에서 모든 셀의 숫자/헤더 텍스트가 SVG 출력 시 두 번 그려져 겹치던 버그 수정. (closes#301)
근본 원인 — Task #287 회귀
z-table 셀은
text=""+Equation컨트롤 1개 구조. 빈 runs를 가진 셀 paragraph의 TAC 수식이 두 경로에서 EquationNode로 emit:paragraph_layout.rs:1996-2057(Task #287에서 추가) — 빈-runs 인라인 EquationNode push +set_inline_shape_position호출table_layout.rs:1602-1648(기존) —has_text_in_para = false분기에서 직접 EquationNode push, 중복 검사 없음Task #287 도입 시
table_layout측 가드를 함께 추가하지 않은 것이 원인. 두 경로의 좌표 계산 미세 차이(Δx≈2.5/28.9, Δy≈-1.31)로 살짝 어긋난 두 텍스트가 겹쳐보였음.
변경 내용
코드
src/renderer/layout/table_layout.rs(+5 -1)tree.get_inline_shape_position(section_index, cp_idx, ctrl_idx).is_some()가드 추가inline_x만 진행하고 직접 emit 스킵has_text_in_para검사는 보조 가드로 유지 (코너 케이스 보호)테스트
tests/issue_301.rs(신규, +45)0.1915/0.3413/0.4332각 1회 출현 검증0.4772는 본문에도 등장하므로 2회 검증검증
cargo test --releasecargo clippy --releasetests/issue_301.rs(수정 전)0.1915found 2)tests/issue_301.rs(수정 후)시각 비교
수정 전: z-table 셀 텍스트 겹침 (헤더
P(0≤Z≤z)가IR(t)≤Z≤2)처럼 보이고,0.1915가0.191$.1915형태로 출력)수정 후: z-table 1회 깔끔한 렌더링
영향 범위
산출물
mydocs/plans/task_301{,_impl}.mdmydocs/working/task_301_stage{1,2,3}.mdmydocs/report/task_301_report.md교훈
양방향 렌더 경로의 동기화 검증. Task #287에서 paragraph_layout에 빈-runs TAC 수식 처리를 추가할 때 table_layout의 기존 fallback과의 중복 가능성이 점검되지 않아 회귀가 발생. 같은 노드를 emit할 수 있는 두 경로가 있는 구조에서는 한쪽 추가 시 다른쪽 가드를 함께 점검하는 절차가 필요. 본 수정은
set_inline_shape_position이라는 기존 메커니즘을 그대로is_rendered플래그로 재활용하여 별도 상태 추가 없이 해결.