Skip to content

fix: apply hot-reload files all-or-nothing when shim compilation fails - #2386

Merged
hatayama merged 2 commits into
v3-betafrom
fix/hot-reload-atomic-shim-compile
Aug 24, 2026
Merged

fix: apply hot-reload files all-or-nothing when shim compilation fails#2386
hatayama merged 2 commits into
v3-betafrom
fix/hot-reload-atomic-shim-compile

Conversation

@hatayama

@hatayama hatayama commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • When shim compilation fails for any method in a file, uloop hot-reload no longer applies the methods that still compiled.
  • Isolation still reports which method failed; survivors in that file are skipped, and patches from earlier reloads stay active.

User Impact

  • Before: a file could end up half-applied — one method failed to compile while another already ran with new fields at default values, so gameplay could go silent with no exception.
  • After: that file applies nothing for the failed run. Fix the failed methods and rerun, or run uloop compile. Other files in the same command still apply as before.

Changes

  • Isolation salvage no longer returns survivors for apply. Those entries are reported as Skipped with an all-or-nothing reason.
  • Added a reproduction test for added-field init failure plus a healthy reader, and updated isolation tests that expected partial apply.
  • Documented the narrower shim-compile failure behavior in the hot-reload skill.

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"ErrorCount: 0
  • dist/darwin-arm64/uloop run-tests --test-mode EditMode --filter-type regex --filter-value "HotReload" --project-path "$(git rev-parse --show-toplevel)" → 538 passed, 0 failed

Review in cubic

A partial apply left new field reads running against default values
after a sibling method failed to compile. Isolation still attributes
the failed methods; survivors in that file are now skipped.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 03026d90-6f1d-461f-8c00-88df326f4673

📥 Commits

Reviewing files that changed from the base of the PR and between 3b47f25 and 51c2a4d.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/HotReload/HotReloadOrchestratorTests.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadShimFirstCompile.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadShimFirstCompile.cs

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Hot reload now applies changes atomically per file when shim compilation fails. Failed methods retain compiler errors, while other methods receive atomic-file skips. Earlier patches remain active. Tests cover methods, added members, registries, logging, retries, and transitive isolation.

Changes

Atomic file application

Layer / File(s) Summary
Shim failure handling
Packages/src/Editor/FirstPartyTools/HotReload/HotReloadShimFirstCompile.cs, Packages/src/Editor/FirstPartyTools/HotReload/HotReloadConstants.cs
Shim compilation failures now return failed and atomic-file skipped outcomes. The result factory accepts an outcome list.
Atomic application test coverage
Assets/Tests/Editor/HotReload/HotReloadAtomicFileApplyFixture.cs, Assets/Tests/Editor/HotReload/HotReloadOrchestratorTests.cs
Tests verify that failed files apply no patches or added members, preserve earlier state, and report atomic skips across direct and transitive cases.
Failure behavior documentation
.agents/skills/uloop-hot-reload/SKILL.md, .claude/skills/uloop-hot-reload/SKILL.md, Packages/src/Editor/FirstPartyTools/HotReload/Skill/SKILL.md
Documentation distinguishes per-method compiler-error isolation from file-wide shim compilation failure behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 51c2a

The change makes hot-reload application atomic per file when shim compilation fails, with targeted verification reported; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant HotReloadShimFirstCompile
  participant HotReloadOrchestrator
  participant VibeLogger
  HotReloadShimFirstCompile->>HotReloadOrchestrator: return failed and atomic-file skipped outcomes
  HotReloadOrchestrator->>HotReloadOrchestrator: apply no patches from the failed file
  HotReloadOrchestrator->>VibeLogger: record atomic-file skip reason
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: hot-reload files now apply atomically when shim compilation fails.
Description check ✅ Passed The description directly explains the atomic file application behavior, test coverage, documentation updates, and verification results.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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.
✨ 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/hot-reload-atomic-shim-compile

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.

The CS substring could match unrelated text; use the new-member
compile hint like the existing isolation test. The round number
does not help later readers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama merged commit ad7f116 into v3-beta Aug 24, 2026
14 checks passed
@hatayama
hatayama deleted the fix/hot-reload-atomic-shim-compile branch August 24, 2026 02:26
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