-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Bolt: [성능 개선] 명시적 팩터 레벨 지정을 통한 추론 오버헤드 제거 #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## 2024-07-28 - R 언어에서 공지된 값의 팩터 생성 시 레벨 명시적 할당을 통한 최적화 | ||
| **Learning:** R에서 알려진 구조의 데이터를 `as.factor(c(rep('A', N), rep('B', M)))` 형태로 팩터로 변환하면 내부적으로 전체 벡터를 스캔하여 레벨을 추론하는 오버헤드가 발생합니다. | ||
| **Action:** `factor(rep(c('A', 'B'), c(N, M)), levels = c('A', 'B'))`와 같이 레벨을 명시적으로 설정하여 오버헤드를 회피하고 O(1) 수준의 팩터 생성을 달성해야 합니다. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,5 @@ | |
| ^\.jules(/.*)?$ | ||
| ^\.trivyignore\.yaml$ | ||
| ^trivy\.yaml$ | ||
| ^\.Jules(/.*)?$ | ||
| ^\.jules(/.*)?$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ jobs: | |
|
|
||
| - name: Lint GitHub workflows | ||
| run: | | ||
| ACTIONLINT_VERSION="1.7.10" | ||
| ACTIONLINT_VERSION="1.7.1" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "actionlint 버전 선언:"
rg -n 'ACTIONLINT_VERSION=' .github/workflows
echo "YAML anchor/alias 사용 위치:"
rg -n --glob '*.yml' --glob '*.yaml' \
'(^|[[:space:]])&[A-Za-z0-9_-]+|(^|[[:space:]])\*[A-Za-z0-9_-]+' \
.github/workflows || trueRepository: ContextualWisdomLab/aFIPC Length of output: 359 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- code-quality.yml ---'
sed -n '25,55p' .github/workflows/code-quality.yml
printf '%s\n' '--- security-audit.yml ---'
sed -n '28,58p' .github/workflows/security-audit.yml
printf '%s\n' '--- actionlint references and workflow YAML features ---'
rg -n -i 'actionlint|anchor|alias|^[[:space:]]*&[A-Za-z0-9_-]+|^[[:space:]]*\*[A-Za-z0-9_-]+' \
.github/workflows .github 2>/dev/null || true
printf '%s\n' '--- repository workflow files ---'
git ls-files '.github/workflows/*'Repository: ContextualWisdomLab/aFIPC Length of output: 6506 🌐 Web query:
💡 Result: The official release details for actionlint versions 1.7.10 and 1.7.1 are as follows: v1.7.10 Release Date: December 30, 2025 [1][2] Changes: - Added support for YAML anchors and aliases ( Citations:
두 워크플로가 서로 다른 🤖 Prompt for AI Agents |
||
| ACTIONLINT_FILE="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | ||
| ACTIONLINT_BASE_URL="https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}" | ||
| curl -sSLo "$ACTIONLINT_FILE" "${ACTIONLINT_BASE_URL}/${ACTIONLINT_FILE}" | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -612,11 +612,12 @@ autoFIPC <- | |
| #IPD | ||
| if (checkIPD == T) { | ||
| # config | ||
| # ⚡ Bolt: Explicitly define levels to bypass automatic factor level inference overhead | ||
| IPDgroup <- | ||
| as.factor(c( | ||
| rep('oldForm', nrow(oldformYDataK)), | ||
| rep('newForm', nrow(newformXDataK)) | ||
| )) | ||
| factor( | ||
| rep(c('oldForm', 'newForm'), c(nrow(oldformYDataK), nrow(newformXDataK))), | ||
| levels = c('oldForm', 'newForm') | ||
| ) | ||
|
Comment on lines
+615
to
+620
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 6 'IPDgroup|multipleGroup|ref\.group|newForm|oldForm' .Repository: ContextualWisdomLab/aFIPC Length of output: 50381 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- relevant implementation ---'
sed -n '612,725p' R/aFIPC.R
printf '%s\n' '--- mirt multipleGroup documentation/source references ---'
rg -n -C 4 'reference group|ref\.group|first group|group levels|levels\(group\)|multipleGroup <-|multipleGroup\s*<-' \
packrat R inst man docs 2>/dev/null | head -n 240
printf '%s\n' '--- factor behavior and package metadata ---'
rg -n -C 3 'as.factor|factor\(|IPDgroup|multipleGroup' R tests DESCRIPTION README.md 2>/dev/null | head -n 240Repository: ContextualWisdomLab/aFIPC Length of output: 4160 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- available runtimes ---'
command -v R || true
command -v Rscript || true
printf '%s\n' '--- mirt package files ---'
fd -i 'multiple|group' packrat 2>/dev/null | head -n 120
printf '%s\n' '--- package documentation and source text ---'
rg -n -i -C 5 'multipleGroup|ref\.group|reference group|first group' \
packrat/lib 2>/dev/null | head -n 300 || trueRepository: ContextualWisdomLab/aFIPC Length of output: 28515 🌐 Web query:
💡 Result: In the mirt package for R, the multipleGroup function determines the reference group based on the factor levels of the provided grouping variable [1][2][3]. Specifically, the first level of the factorized grouping variable is automatically treated as the reference group [1][4]. If you supply a character vector as the group argument, mirt will automatically transform it into a factor variable [1][3][4]. Because factor levels are typically ordered alphabetically by default in R, the group name that comes first alphabetically will be selected as the reference group unless you explicitly set the levels of the factor before passing it to the function [1][3][4]. To specify a different reference group, you should convert your grouping variable to a factor and use the relevel function or manually define the levels so that the desired reference group is the first level [1][3][4]. In terms of model identification, the reference group is typically constrained (e.g., latent means fixed to 0) while parameters in focal groups are estimated relative to it, particularly when using invariance constraints like free_means or free_var [3][4]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
source = Path("R/aFIPC.R").read_text()
match = re.search(
r"IPDgroup\s*<-\s*factor\s*\(\s*"
r"rep\(c\('([^']+)',\s*'([^']+)'\).*?"
r"levels\s*=\s*c\('([^']+)',\s*'([^']+)'\)",
source,
re.S,
)
if not match:
raise SystemExit("IPDgroup factor expression not found")
rep_levels = match.group(1, 2)
explicit_levels = match.group(3, 4)
default_levels = tuple(sorted(set(rep_levels)))
print("rep levels:", rep_levels)
print("R-default-equivalent sorted levels:", default_levels)
print("explicit levels:", explicit_levels)
print("default first level:", default_levels[0])
print("explicit first level:", explicit_levels[0])
print("explicit order preserves default order:", explicit_levels == default_levels)
print("IPDgroup passed to multipleGroup:", "group = IPDgroup" in source)
PYRepository: ContextualWisdomLab/aFIPC Length of output: 441
현재 순서는 기존 🤖 Prompt for AI Agents |
||
| IPDItemCount <- 0 | ||
|
|
||
| # IPD target item checking | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.