Skip to content

refactor: Hot reload's compiled-caller analysis sits behind one entry point in its own assembly, and a run's wait for a background read is now timed - #3273

Merged
hatayama merged 2 commits into
mainfrom
refactor/hot-reload-compiled-callers
Oct 11, 2026
Merged

hatayama merged 2 commits into
mainfrom
refactor/hot-reload-compiled-callers

Conversation

@hatayama

@hatayama hatayama commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Hot reload's compiled-caller analysis (the call-site scan, its cache, the load budget, the caller closure, the one-shot lifecycle note and the background reads after a run) now sits behind one entry point and one scope per run, in its own assembly. The rest of hot reload can reach only that entry point, so the order a run starts in is kept in one place and the compiler enforces it.
  • One behavior change: a run now stops the background reads before it holds the call-site cache, and that wait is timed in warm_up_yield.

This merges the integration branch refactor/hot-reload-compiled-callers:

User Impact

  • Before: a run could arrive while a background read was loading a dll (the warm-up's call-site item, or the previous run's backfill). That run took the cache hold first, then waited on the cache lock until the read ended, and no timing step counted that wait. A slow start did not show where its time went.
  • After: the run yields to the warm-up and then to the backfill inside warm_up_yield, and only then takes the hold, so the wait shows up in that step.
  • The base could already start runs in this order, depending on timing: a run that came a little later, after the cancel reached the item or the backfill before its next dll. The change makes that order the only one. A run never starts from cache content the base could not have produced. Two things change:
    • The next dll is no longer read under the run's hold.
    • A read that had not yet reached the cache lock when the hold was taken now ends with no hold open, so a full cache may evict there, as reads outside a run do.
  • Patched / Unchanged results, the notes and their budget are unchanged.

Changes

Verification

View guided diff

… point, and a run's wait for a background read is now timed (#3271)
…sembly, so only its entry point is reachable (#3272)
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: hatayama/unity-cli-loop/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13db5507-0a4e-4c50-b8aa-4c0b178632c1

📥 Commits

Reviewing files that changed from the base of the PR and between b04b58e and d90045d.


⛔ Files ignored due to path filters (24)
  • Assets/Tests/Editor/HotReload/HotReloadCompiledCallersTests.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/HotReload/HotReloadOneShotCallerNoteAttacherTests.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/HotReload/UnityCLILoop.Tests.Editor.HotReload.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/AssemblyInfo.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteBackfill.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteHit.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteLoadBudget.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteScanner.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallSiteCache.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallSiteIndex.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallers.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallersRun.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledMethodIdentity.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerClosure.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteBuilder.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteEnricher.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteRequest.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadReferencedMethodIndex.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/UnityCLILoop.FirstPartyTools.HotReload.CompiledCallers.Editor.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/UnityCLILoop.FirstPartyTools.HotReload.CompiledCallers.Editor.asmdef.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOneShotCallerNoteAttacher.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOneShotCallerNoteCandidate.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/HotReload/UnityCLILoop.FirstPartyTools.HotReload.Editor.asmdef is excluded by none and included by none

📒 Files selected for processing (57)
  • Assets/Tests/Editor/HotReload/HotReloadCallSiteScannerTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadCallSiteWarmUpItemTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadCallerNoteBackfillE2ETests.cs
  • Assets/Tests/Editor/HotReload/HotReloadCompiledCallersTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadCompositionRootTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadDomainTestScope.cs
  • Assets/Tests/Editor/HotReload/HotReloadEditorTickPumpTestSafety.cs
  • Assets/Tests/Editor/HotReload/HotReloadGroupProcessorTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadIntroducedTypeE2ETestBase.cs
  • Assets/Tests/Editor/HotReload/HotReloadOneShotCallerClosureTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadOneShotCallerNoteAttacherTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadOneShotCallerNoteBuilderTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadOrchestratorTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadPatcherContractTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadPatcherTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadReferencedMethodSetWarmUpItemTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadRunStaleSignatureWarningsTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadServicesTestScope.cs
  • Assets/Tests/Editor/HotReload/HotReloadSignatureChangeCoverageTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadWarmUpE2ETests.cs
  • Assets/Tests/Editor/HotReload/HotReloadWarmUpItemsTests.cs
  • Packages/src/Editor/FirstPartyTools/Common/ScriptPath/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteBackfill.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteHit.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteLoadBudget.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCallSiteScanner.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallSiteCache.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallSiteIndex.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallers.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledCallersRun.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadCompiledMethodIdentity.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerClosure.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteBuilder.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteEnricher.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadOneShotCallerNoteRequest.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/CompiledCallers/HotReloadReferencedMethodIndex.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadCallSiteWarmUpItem.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadCompositionRoot.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadFileEntryApplier.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadFileSinks.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadGroupStageCollaborators.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOneShotCallerNoteAttacher.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOneShotCallerNoteCandidate.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOrchestrator.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadOrchestratorLog.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadReferencedMethodSetWarmUpItem.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadRunAccumulator.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadRunStaleSignatureWarnings.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadServices.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadSignatureChangeCoverage.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadSignatureChangeGate.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadStaleSignatureCallSites.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadWarmUpEditorHooks.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadWarmUpItems.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Shared/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Shared/HotReloadTypeNames.cs

 _____________________________________________
< Because, bugs shouldn't outnumber features. >
 ---------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@hatayama
hatayama marked this pull request as ready for review October 11, 2026 01:38
@hatayama
hatayama merged commit 2230f8e into main Oct 11, 2026
30 of 31 checks passed
@hatayama
hatayama deleted the refactor/hot-reload-compiled-callers branch October 11, 2026 01:38
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