Skip to content

refactor(lavaan): make missing-pattern row counts type-stable - #90

Draft
seonghobae wants to merge 7 commits into
masterfrom
bolt-vapply-optimization-10202613825547525671
Draft

refactor(lavaan): make missing-pattern row counts type-stable#90
seonghobae wants to merge 7 commits into
masterfrom
bolt-vapply-optimization-10202613825547525671

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Replace the sapply(mispatts, nrow) simplification path in llcont.lavaan() with vapply(mispatts, nrow, numeric(1)) so the expected scalar return shape is explicit.

Current exact state

  • protected base: master@b62bf9ac928988a4b988fc3efb0adfb88549fef2
  • exact head: ddaa04ad6a157c2f09a5f33496a63e28d2013ee3
  • lifecycle: Draft / focused lavaan delta restored after unrelated intervening changes
  • effective protected-base delta: R/llcont.R only
  • repository-wide .jules/bolt.md and the central reusable R-CMD-check thin caller are restored to the reviewed tree

Intervening-delta repair

Reviewed semantic head 3f8faf6559f5aa5e4ac0fd2141b0262e78f7aef3 was followed by three normal commits ending at 247dd24192844e46b7a330ba8cc941a394e3fdba. Fresh compare showed those descendants did not extend the lavaan change: they replaced the central reusable R-CMD-check thin caller with repository-local workflow implementation, appended unrelated GLM/ifelse doctrine, and changed llcont.glm() while leaving this PR's bounded purpose unrelated.

The history was not reset or rebased. A normal child ddaa04ad6a157c2f09a5f33496a63e28d2013ee3 reuses the exact reviewed tree of 3f8faf...; the intervening commits remain in ancestry but their unrelated workflow/GLM/doctrine delta is absent from the effective tree. Branch advancement was fast-forward only.

Behavioral contract

The missing-pattern list still maps each matrix to one row count and takes the maximum. The change makes the result shape explicit but does not alter lavaan missing-data policy, likelihood arithmetic, model support, or error semantics. The existing lavaan test path includes a missing='ml' fit and remains the relevant behavioral regression.

No percentage, GC, allocation, or end-to-end latency improvement is claimed from unit tests or source inspection. A performance claim requires a reproducible representative lavaan workload and controlled benchmark/profile evidence.

Acceptance

Keep Draft until the unchanged exact head has fresh R-CMD-check/security/static-analysis evidence and a qualifying current-head review under live policy. Do not reuse predecessor-head review/check evidence. Merge only the unchanged accepted tree through normal protection; no self-approval, source-neutral retrigger, local duplication of central workflow ownership, force update, destructive rebase, or bypass.

Replaced max(sapply(mispatts, nrow)) with max(vapply(mispatts, nrow, numeric(1))) to reduce execution overhead.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d64cd90-b609-4852-907d-2959fb9e9439

📥 Commits

Reviewing files that changed from the base of the PR and between 807e940 and 1bc09f6.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • R/llcont.R

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

누락 패턴별 행 수 수집에 vapply를 사용하도록 변경했습니다. 반환 타입과 길이를 명시하는 사용 지침도 추가했습니다.

Changes

R 반복 처리 최적화

Layer / File(s) Summary
반환 타입 지정 반복 처리
R/llcont.R, .jules/bolt.md
mispatts의 행 수 수집에 vapply(..., numeric(1))를 사용합니다. 알려진 반환 타입과 길이에는 vapply를 사용하도록 학습 항목을 추가했습니다.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 1bc09

This PR makes a localized calculation more efficient without evidence of changed user-visible behavior or an actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 sapplyvapply로 변경하여 누락 패턴 행 수의 반환 타입을 안정화하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-vapply-optimization-10202613825547525671

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@opencode-agent opencode-agent Bot added area: performance Performance, resource use, scalability, or benchmarking priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep labels Aug 22, 2026
@seonghobae seonghobae changed the title ⚡ Bolt: Optimize maximum matrix rows calculation with vapply refactor(lavaan): make missing-pattern row counts type-stable Sep 5, 2026
@seonghobae
seonghobae marked this pull request as draft September 5, 2026 21:31
seonghobae and others added 4 commits September 5, 2026 23:34
Replaced max(sapply(mispatts, nrow)) with max(vapply(mispatts, nrow, numeric(1))) to reduce execution overhead.
Replaced two instances of ifelse() in llcont.glm with vectorized subsetting and preallocation to avoid unnecessary evaluation overhead.
Replaced two instances of ifelse() in llcont.glm with vectorized subsetting and preallocation to avoid unnecessary evaluation overhead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: performance Performance, resource use, scalability, or benchmarking maintenance priority: medium Normal-priority or P2 work status: draft type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant