Skip to content

시뮬레이션 데모 재생 루프 밀도 개선#24

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

시뮬레이션 데모 재생 루프 밀도 개선#24
seoJing merged 2 commits into
mainfrom
fix/sim-loop-preview-overlap

Conversation

@seoJing

@seoJing seoJing commented Jun 11, 2026

Copy link
Copy Markdown
Member

요약

  • demo_run_001 전용으로 sparse tail movement를 24~47틱 구간에 접어 시연 중 활동 밀도를 높였습니다.
  • 접힌 tail movement는 spot 단위 clone agent id를 사용해 같은 agent가 동시에 여러 위치에 렌더링되는 충돌을 피했습니다.
  • 시연 playback loop를 프론트에서 72틱으로 단축해 활동 종료 후 긴 빈 구간 없이 다시 0틱부터 반복되게 했습니다.
  • fold 모드에서 preview overlap, 중복 chunk load, stale async chunk update로 생길 수 있는 ghost/중복 렌더링을 막았습니다.

검증

  • pnpm lint 통과
    • 기존 warning 6개만 유지
  • pnpm build 통과
  • git diff --check 통과
  • ocr review 실행 후 발견된 medium/style 지적 반영

리스크 / 메모

  • 변경은 demo_run_001 전용 조건으로 제한했습니다.
  • manifest 원본 값은 바꾸지 않고 프론트 playback에서만 effective loop period를 조정합니다.

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 모든 에이전트에 대한 페르소나 생성 로직 개선
    • 데모 실행의 재생 성능 및 타임라인 처리 최적화

@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 6:10pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seoJing, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c84de437-94b0-4c5e-b0ee-797a0708a677

📥 Commits

Reviewing files that changed from the base of the PR and between c6cde8a and ae7e1fc.

📒 Files selected for processing (3)
  • src/features/map/client/MapClient.tsx
  • src/features/simulation/model/sim-domain-adapter.ts
  • src/features/simulation/model/use-sim-run.ts
📝 Walkthrough

Walkthrough

두 파일에서 Persona 생성 및 재생 제어를 개선합니다. sim-domain-adapter.ts는 모든 에이전트를 Persona로 변환하도록 protagonist 필터를 제거하고, use-sim-run.ts는 데모 실행의 Tail Fold 재생 모드를 구현하여 에이전트 ID와 틱을 리매핑하면서 청크 로딩과 재생 경계를 조정합니다.

Changes

Demo Tail Fold과 All-Agent Persona

Layer / File(s) Summary
Agent Persona 생성 업데이트
src/features/simulation/model/sim-domain-adapter.ts
protagonist 필터링을 제거하여 manifest의 모든 에이전트를 Persona로 변환하고, 각 에이전트의 홈 지역 좌표를 initialCoord로 매핑.
Demo-Tail-Fold 상수와 헬퍼 함수
src/features/simulation/model/use-sim-run.ts
Fold 활성화 조건, 재생 루프 기간, 미리보기 오버랩 틱 계산 및 틱 폴딩을 수행하는 상수와 헬퍼 함수들을 추가하고, renderCycleTicks 서명을 runId 매개변수로 업데이트.
매니페스트 로딩과 상태 초기화
src/features/simulation/model/use-sim-run.ts
activeRunIdRef와 agentByIdRef를 추가하여 활성 실행을 추적하고, 타일 폴딩 에이전트 별칭 매핑을 초기화하며, 초기 청크 로딩을 확대하여 Tail 윈도우 커버리지를 지원.
청크 데이터 변환과 로딩
src/features/simulation/model/use-sim-run.ts
에이전트와 페르소나 ID를 폴딩된 타임라인으로 리매핑하고, 이동 및 수명주기 이벤트의 스케줄/예상 틱을 조정하는 변환 함수를 구현하고, loadChunk에서 변환을 적용하여 타임라인과 수명주기 맵을 재구성.
재생 제어와 렌더링 업데이트
src/features/simulation/model/use-sim-run.ts
runId를 인식한 playbackLoopPeriodTicks를 사용하여 활동 틱, 빈 틱 건너뛰기, 시크 클램핑을 업데이트하고, emitFrame에서 renderCycleTicks 호출 시 runId를 전달하여 일관된 폴드 경계 적용.

Possibly Related PRs

  • spot-platform/frontend#23: renderCycleTicks와 렌더 사이클 틱 윈도우 로직의 수정 사항이 직접 겹치며, 이전 PR에서 미리보기 오버랩을 위한 render-cycle 틱 윈도우 로직을 수정했습니다.

Estimated Code Review Effort

🎯 4 (복잡) | ⏱️ ~60분

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.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 제목이 주요 변경사항을 명확하게 요약합니다: 시뮬레이션 데모 재생 루프 밀도를 개선하는 것이 주된 목표이며, 이는 72틱으로 단축된 playback loop와 sparse tail movement 배치를 통해 구현되었습니다.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sim-loop-preview-overlap

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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/features/simulation/model/use-sim-run.ts`:
- Around line 149-154: The playback loop period is overridden for demo runs in
playbackLoopPeriodTicks but that effective value isn’t propagated to the domain
so useSimDomain still calculates seed cycle offsets from the original manifest
period; update useSimDomain’s cycle/preview calculations to prefer the effective
loop period (effectiveLoopPeriodTicks derived from playbackLoopPeriodTicks)
instead of manifest.loopPeriodTicks and/or include effectiveLoopPeriodTicks in
the UseSimRunResult so downstream code uses the same single source of truth
(also apply the same change pattern for the similar logic referenced around
lines 817-836).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 69bfd942-45d5-4c2c-9902-989210d899e1

📥 Commits

Reviewing files that changed from the base of the PR and between 2caec8d and c6cde8a.

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

Comment thread src/features/simulation/model/use-sim-run.ts
@seoJing seoJing merged commit 420ef3f 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