Skip to content

시뮬레이션 루프 종료 전 다음 사이클 프리뷰 렌더링#23

Merged
seoJing merged 1 commit into
mainfrom
fix/sim-loop-preview-overlap
Jun 11, 2026
Merged

시뮬레이션 루프 종료 전 다음 사이클 프리뷰 렌더링#23
seoJing merged 1 commit into
mainfrom
fix/sim-loop-preview-overlap

Conversation

@seoJing

@seoJing seoJing commented Jun 11, 2026

Copy link
Copy Markdown
Member

작업 내용

  • loop 종료 직전 projection_tail_ticks 기반 preview window에서 다음 cycle agent/persona를 함께 렌더링합니다.
  • boundary 이후뿐 아니라 boundary 직전에도 next cycle 초반 movement와 spot lifecycle이 표시되도록 보강했습니다.
  • 현재 tick lifecycle event 수집 시 현재 raw tick뿐 아니라 tail/preview raw tick을 함께 포함합니다.

의도

  • 마지막 구간이 종료/귀가 이벤트 위주로 잠잠해지는 문제 완화
  • 실제 loop boundary에서 이전 tail + 다음 초반이 자연스럽게 겹치는 느낌 강화

검증

  • pnpm lint -- src/features/simulation/model/use-sim-run.ts src/features/simulation/model/sim-domain-adapter.ts
  • pnpm test -- --runInBand
  • pnpm build
  • git diff --check

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 시뮬레이션에서 다음 사이클의 미리보기를 표시합니다. 현재 틱 기준으로 프로젝션 범위 내의 다음 사이클 일부가 미리 렌더됩니다.
  • 개선

    • 프레임 렌더링 로직을 개선하여 더 정확한 라이프사이클 이벤트 집계를 제공합니다.

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend Ready Ready Preview, Comment Jun 11, 2026 10:48am

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

개요

시뮬레이션 프레임 렌더링이 projection_tail_ticks 기반 프리뷰 오버랩을 도입하여 현재 사이클뿐 아니라 다음 사이클의 일부를 미리 포함하도록 확장되었습니다. 두 파일에 걸쳐 공통 상수, 헬퍼 함수, 그리고 렌더 로직이 업데이트되었습니다.

변경 사항

시뮬레이션 렌더 파이프라인 프리뷰 오버랩

레이어 / 파일(들) 요약
프리뷰 오버랩 기본 요소
src/features/simulation/model/sim-domain-adapter.ts
MAX_PREVIEW_OVERLAP_TICKS 상수와 shiftSeedForCycle 함수의 cycleOffsetTicks 파라미터를 통해 프리뷰 시간 보정의 기반 마련
sim-domain 렌더 사이클 및 seed 계산
src/features/simulation/model/sim-domain-adapter.ts
previewOverlapTicks, shouldPreviewNextCycle, renderCyclesForTick 유틸을 추가하고, loopedSpotLifecycleSeedscurrentTick을 수신하여 프리뷰 구간 seed를 음수 offset으로 조정. useSimDomainrenderCyclesseeds 계산을 currentTick 기반으로 업데이트
useSimRun 프레임 렌더링 리팩토링
src/features/simulation/model/use-sim-run.ts
RenderCycleTick 타입과 MAX_PREVIEW_OVERLAP_TICKS 상수 정의, previewOverlapTicks·renderCycleTicks 헬퍼로 렌더 틱 집합 생성, currentLifecycleEvents 평탄화 집계로 변경

🎯 3 (Moderate) | ⏱️ ~25 분

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 변경사항의 핵심을 명확하게 나타내고 있습니다. 시뮬레이션 루프 종료 전 다음 사이클 프리뷰 렌더링이 정확히 이 PR의 주요 변경사항입니다.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sim-loop-preview-overlap

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/features/simulation/model/sim-domain-adapter.ts (1)

253-257: ⚡ Quick win

프리뷰 오버랩 유틸리티가 두 파일에 중복 정의되어 있습니다.

MAX_PREVIEW_OVERLAP_TICKS 상수와 previewOverlapTicks 함수가 sim-domain-adapter.tsuse-sim-run.ts 양쪽에 동일하게 정의되어 있습니다. 값이나 로직이 불일치할 경우 프리뷰 오버랩 동작이 파일 간에 달라질 수 있습니다.

공통 유틸리티 파일(예: sim-preview-utils.ts)로 추출하여 단일 소스를 유지하는 것을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/simulation/model/sim-domain-adapter.ts` around lines 253 - 257,
Extract the duplicated MAX_PREVIEW_OVERLAP_TICKS constant and
previewOverlapTicks(manifest: SimManifest) function into a single shared utility
module (e.g., sim-preview-utils.ts), export them, then remove the local
definitions and import the shared exports where both current copies are used;
ensure the exported function signature and constant value remain the single
source of truth and update any references to call previewOverlapTicks and use
MAX_PREVIEW_OVERLAP_TICKS from the shared module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/features/simulation/model/sim-domain-adapter.ts`:
- Around line 253-257: Extract the duplicated MAX_PREVIEW_OVERLAP_TICKS constant
and previewOverlapTicks(manifest: SimManifest) function into a single shared
utility module (e.g., sim-preview-utils.ts), export them, then remove the local
definitions and import the shared exports where both current copies are used;
ensure the exported function signature and constant value remain the single
source of truth and update any references to call previewOverlapTicks and use
MAX_PREVIEW_OVERLAP_TICKS from the shared module.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8eeeafed-f78c-4339-8f51-b02b31139f06

📥 Commits

Reviewing files that changed from the base of the PR and between 0a4d6a7 and a612100.

📒 Files selected for processing (2)
  • src/features/simulation/model/sim-domain-adapter.ts
  • src/features/simulation/model/use-sim-run.ts

@seoJing seoJing merged commit 2caec8d into main Jun 11, 2026
5 checks passed
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