Skip to content

재채점 도구의 숫자 비교를 표시 정밀도 기준으로 변경 - #60

Merged
pwh9882 merged 1 commit into
devfrom
fix/regrade-numeric-compare
Sep 2, 2026
Merged

재채점 도구의 숫자 비교를 표시 정밀도 기준으로 변경#60
pwh9882 merged 1 commit into
devfrom
fix/regrade-numeric-compare

Conversation

@pwh9882

@pwh9882 pwh9882 commented Sep 2, 2026

Copy link
Copy Markdown

목적

PR #53의 Codex 리뷰 P2를 반영합니다. numeric_equalmath.isclose(rel_tol=1e-6)를 써서 10000001000001처럼 실제로 다른 정수도 numeric_format으로 분류했고, 그 경우 재채점이 성공으로 끝나 judge 회귀를 숨길 수 있었습니다.

변경

  • 두 값을 Decimal로 파싱해 같으면 통과하고, 아니면 표시 소수 자릿수가 적은 쪽에 맞춰 둘 다 반올림한 뒤 비교합니다. 소수 자릿수가 0이면(정수) 정확히 같아야 합니다.
  • 183.0901183.0900900900901, 8510700.008510700, 40177334.017733e+06은 여전히 표현 차이로, 100000010000011.51.4는 값 차이로 분류됩니다.

검증

  • 단위 테스트(tests/test_regrade_review.py)에 위 경우와 비수치·NaN을 추가했습니다. 저장소 테스트 25개 통과.
  • 지난 학기 61문제를 현재 judge(dev@1b8a3362)와 옛 go-mysql-server judge(dev@72b1775d)로 다시 비교했습니다. 완전 일치 35, 숫자 표현 17, 값 차이 8(행 순서 6, DATE 표현 2), 비교 불가 1(#32)로 PR judge가 로컬 MySQL 템플릿 형식의 init SQL을 받아들이도록 수정 #53 댓글의 분류와 같습니다. 새 규칙이 실제 corpus에서 오탐을 내지 않았습니다.

Codex flagged on PR #53 that numeric_equal used math.isclose with
rel_tol=1e-6, so materially different integers such as 1000000 and
1000001 were classified as numeric_format and the regrade exited zero.

The comparison now parses both values as Decimal, accepts them when
equal, and otherwise rounds both to the smaller number of displayed
decimal places: 183.0901 still matches 183.0900900900901 and 4017733
matches 4.017733e+06, but integers must match exactly and 1.5 no longer
matches 1.4.
@pwh9882
pwh9882 merged commit 6f4012c into dev Sep 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T08:05:10.267495Z fa0d543 PR opened
🔒 Security Review Completed 2026-09-02T08:06:53.695048Z fa0d543 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant