refactor(validation): preserve non-missing category-count semantics - #372
seonghobae wants to merge 5 commits into
Conversation
- `length(stats::na.omit(unique(x)))`를 `sum(!is.na(unique(x)))`로 대체했습니다. - R의 `stats::na.omit()` 함수 내부의 S3 메서드 디스패치 및 `na.action` 속성 할당에 따른 오버헤드를 제거하였습니다. - 반복문 내부에서 자주 호출되는 로직의 실행 속도 및 메모리 효율성을 개선하였습니다.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
Changes고유 비결측값 계산 방식 변경
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The optimized calculation preserves the intended non-missing unique-value count and is covered by existing tests. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review 현재 exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== HEAD =='
git rev-parse HEAD
printf '%s\n' '== STATUS =='
git status --short
printf '%s\n' '== PR METADATA =='
gh pr view 372 --repo ContextualWisdomLab/aFIPC --json number,title,baseRefName,headRefName,headRefOid,body,files --jq '{number,title,baseRefName,headRefName,headRefOid,body,files:[.files[].path]}'
printf '%s\n' '== DIFF AGAINST BASE =='
git diff --find-renames --unified=80 "$(git merge-base HEAD origin/HEAD)" HEAD -- R/aFIPC.R .jules/bolt.md || true
printf '%s\n' '== RELEVANT FILES =='
fd -HI -t f . | rg '(^|/)(aFIPC\.R|.*[Tt]est.*|.*[Rr]egression.*|.*[Bb]enchmark.*|bolt\.md)$' | sort
printf '%s\n' '== SEARCH: OLD/NEW EXPRESSIONS, IPD, PERFORMANCE CLAIMS =='
rg -n -i -C 4 'length\s*\(\s*stats::na\.omit\s*\(\s*unique|sum\s*\(\s*!\s*is\.na\s*\(\s*unique|`#99`|\bIPD\b|benchmark|performance|memory efficien|execution speed|overhead|frequently executed' . -g '!**/.git/**' -g '!**/renv/**' || true
printf '%s\n' '== OUTLINE =='
ast-grep outline R/aFIPC.R --items all --type function 2>/dev/null || true
printf '%s\n' '== autoFIPC CONTEXT =='
rg -n -A100 -B20 'autoFIPC\s*(<-|=)\s*function' R/aFIPC.R || trueLength of output: 201676 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== CHECKED-OUT HEAD =='
git rev-parse HEAD
echo '== PR REFS =='
gh pr view 372 --repo ContextualWisdomLab/aFIPC --json baseRefOid,headRefOid,headRefName,title,body --jq '{baseRefOid,headRefOid,headRefName,title,body}'
base_oid="$(gh pr view 372 --repo ContextualWisdomLab/aFIPC --json baseRefOid --jq .baseRefOid)"
echo '== CHANGED FILES =='
git diff --name-status "$base_oid" HEAD
echo '== EXACT DIFF =='
git diff --unified=30 "$base_oid" HEAD -- . ':(exclude)packrat/**'
echo '== CHANGE COMMITS =='
git log --oneline --no-decorate "$base_oid"..HEAD
echo '== REPOSITORY TOP-LEVEL =='
fd -HI -t f -d 3 . -E packrat -E .git | sort | sed -n '1,800p'
echo '== RELEVANT SOURCE/TEST MATCHES =='
rg -n -i -C 8 'sum\s*\(\s*!\s*is\.na\s*\(\s*unique|length\s*\(\s*stats::na\.omit\s*\(\s*unique|autoFIPC|IPD|issue.?99|`#99`|performance|benchmark|memory efficien|execution speed|S3 method dispatch|na.action' \
-g '!packrat/**' -g '!**/.git/**' . || true
echo '== R/aFIPC.R COMMON-ITEM CHECK CONTEXT =='
rg -n -C 30 'sum\s*\(\s*!\s*is\.na\s*\(\s*unique|length\s*\(\s*stats::na\.omit\s*\(\s*unique' R/aFIPC.R || true
echo '== CHANGE FILE CONTENT =='
if [ -f .jules/bolt.md ]; then cat -n .jules/bolt.md; fiLength of output: 83832 🏁 Script executed: #!/bin/bash
set -euo pipefail
head_oid="70722c5aab3debbf5fa199053541c9e9f65130c7"
echo '== CURRENT-HEAD CHECKS =='
gh pr checks 372 --repo ContextualWisdomLab/aFIPC --json name,state,bucket,link,workflow --jq '.[] | {name,state,bucket,workflow,link}' || true
echo '== CURRENT-HEAD REVIEWS =='
gh pr view 372 --repo ContextualWisdomLab/aFIPC --json reviews --jq '.reviews[] | {author:.author.login,state,commitId,submittedAt,body}' || true
echo '== OPEN REVIEW THREADS =='
gh api graphql -F owner='ContextualWisdomLab' -F name='aFIPC' -F number=372 -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
comments(first: 20) {
nodes {
author { login }
body
commit { oid }
path
line
}
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated, comments:[.comments.nodes[] | {author:.author.login,commit:.commit.oid,path,line,body}]}' || true
echo '== CHANGED-FILE PERFORMANCE CLAIMS =='
rg -n -i -C 2 'speed|faster|performance|memory|overhead|O\([0-9A-Z^+*]+\)|benchmark|allocation|GC|wall-clock|median|p95|improve' \
.jules/bolt.md R/aFIPC.R tests/testthat/test-optimization-equivalence.R || true
echo '== CATEGORY-COUNT EXPRESSIONS IN NON-VENDORED R/TEST FILES =='
rg -n -g '*.R' -g '!packrat/**' 'length\s*\(\s*(stats::)?na\.omit\s*\(\s*unique|sum\s*\(\s*!\s*is\.na\s*\(\s*unique' R tests || true
echo '== CURRENT HEAD FILE BLOB IDS =='
git ls-tree "$head_oid" -- R/aFIPC.R tests/testthat/test-optimization-equivalence.R .jules/bolt.mdLength of output: 12781
요청 범위에서 새 finding은 없습니다.
현재 head의
|
Scope
autoFIPC()의 공통 문항 응답구조 비교에서length(stats::na.omit(unique(x)))를sum(!is.na(unique(x)))로 바꿉니다. 변경 범위는 고유한 비결측 응답 범주의 수를 계산하는 두 guarded expression뿐이며, mirt fitting·linking 산술·item parameter 의미·허용 범주 자체는 바꾸지 않습니다.master@f87c2324f1686135e57d8730c1b0b9420874f30070722c5aab3debbf5fa199053541c9e9f65130c7.jules/bolt.md,R/aFIPC.R,tests/testthat/test-optimization-equivalence.RReview finding and repair
초기 Jules 변경은 production expression만 바꾸었고, 기존
test-optimization-equivalence.R은 이전 표현식인length(stats::na.omit(unique(x)))까지만 실행했습니다. 따라서 새 표현식이 기존 응답구조 계약을 보존한다는 executable regression이 없었습니다.현재 regression은 독립 hand-computed category counts를 기준으로 새 표현식과 직전 표현식의 동등성을 숫자형, factor,
NA,NaN입력에서 직접 검증합니다. 기존 #56의 더 오래된length(levels(as.factor(x)))계약은 원래 검증하던 일반 numeric fixtures에서 계속 보존합니다. #99의 IPD anchor extraction regression도 그대로 유지합니다.이 수리는 이미 production 변경이 존재한 뒤 fresh review에서 발견한 누락 테스트를 보강한 것이므로 hosted/test-first RED였다고 주장하지 않습니다.
Evidence boundary
대표성 있는 benchmark가 없으므로 속도 향상 배수·백분율, 메모리 개선율 또는 큰 성능 개선을 주장하지 않습니다. 현재 입증하려는 것은
na.omit()wrapper 없이 동일한 distinct-non-missing category-count 의미를 보존한다는 점입니다. Buyer-visible 성능 근거로 승격하려면 동일한 R/toolchain에서 현실적인 문항 수·응답자 수·반복 횟수를 사용해 wall-clock, allocation/GC와 median/p95를 비교해야 합니다..jules/bolt.md도 이 경계로 currentize했습니다.Current exact-head acceptance
70722c5...는 test/docs가 변경된 새 generation이므로 초기 Jules head의 review/check 결과를 merge authority로 전용하지 않습니다. 현재 fresh R CMD check, Code Quality, Security Audit, Security Scan, SAST Semgrep, Required CodeQL이 모두 새로 생성되어 queued 상태입니다. 제출된 current-headAPPROVEDreview도 아직 없습니다.한 unchanged exact head에서 applicable hosted gates가 terminal-success하고, 유효한 unresolved finding/thread가 0이며, live policy가 요구하는 current-head independent review가 충족될 때까지 Draft를 유지합니다. Required CodeQL이 중앙 settlement defect를 재현하면 leaf polling, no-op commit, manual rerun, synthetic status로 우회하지 않고
.githubcanonical owner path에 exact generation을 전달합니다.No force push, destructive rebase, self-approval, gate weakening, source-neutral retrigger, predecessor-evidence transfer, or unmeasured performance claim is accepted as landing evidence.