Skip to content

fix: Hot reload warnings and pause points now recognize methods with generic or multidimensional-array parameters - #3031

Merged
hatayama merged 2 commits into
mainfrom
fix/hot-reload-generic-parameter-labels
Sep 29, 2026
Merged

hatayama merged 2 commits into
mainfrom
fix/hot-reload-generic-parameter-labels

Conversation

@hatayama

@hatayama hatayama commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Hot reload now recognizes a patched method whose parameters are constructed generics (such as List<int>) or multidimensional arrays (such as int[,]), so warnings, pause points, and stale or superseded lookups about such methods are accurate.

User Impact

  • Before: for a method with a List<int> or int[,] parameter, the Editor spelled the method name differently from the transform worker (List`1[System.Int32] versus List`1<System.Int32>), so the two names never matched. As a result:
    • the added-field warning said the field keeps its default value until uloop compile, even when an earlier hot reload of the writer was still active and assigning it;
    • the pause point tool found no unapplied row for such a method;
    • stale, superseded, and signature-change lookups could miss such methods.
  • After: every method name uses the metadata spelling, so the warning names the earlier patch and the lookups find their rows. The Method field in hot reload output now spells these parameter types as System.Collections.Generic.List`1<System.Int32> and System.Int32[0...,0...].

Changes

  • The Editor builds a method's label from its reflection data with the parameter-type spelling Cecil uses: constructed generics with <>, multidimensional arrays with 0... bounds, and nested types with +. Labels built from worker rows are unchanged.
  • Comments that described the mismatch as a known limitation are updated, and the hot reload skill's output reference documents how Method spells parameter types.

Verification

  • A new parity test compares the reflection-built label with the Cecil-built label for 23 parameter shapes; 19 of them failed before the fix.
  • Two new end-to-end tests repeat the skipped-writer-with-earlier-patch warning with List<int> and int[,] writers; temporarily restoring the old spelling makes both fail with the default-value wording.
  • uloop run-tests: the parity, patcher, and domain classes (88 tests), six label-related classes (61 tests), and 35 orchestrator end-to-end tests pass.
  • check-skill-size, sync-tool-docs --check, file-length, and complexity checks pass.

Closes #2903

Review in cubic

Labels built from a resolved MethodBase used Type.ToString for parameter
types (List`1[System.Int32], System.Int32[,]), while worker rows and
call-site hits carry Cecil's spelling (List`1<System.Int32>,
System.Int32[0...,0...]). The ledgers compare labels by ordinal equality,
so methods with constructed generic or multidimensional-array parameters
silently missed their matches: the skipped-writer warning claimed the
property keeps its default value although an earlier patch still assigns
it, pause points found no unapplied row, and the stale, superseded, and
signature-change lookups could miss (#2903).

- FormatMethodLabel walks the parameter type structurally (byref, pointer,
  array rank, generic parameter, generic type from its definition's
  FullName plus argument names, otherwise FullName) and keeps reflection's
  '+' for nested types; FormatMethodLabelParts and the worker are unchanged.
- A Cecil parity test compares the MethodBase label with the label built
  from the same method's metadata spelling for 23 parameter shapes, and
  two end-to-end tests repeat the skipped-writer-with-earlier-patch case
  with List<int> and int[,] writers; restoring ToString makes both fail
  with the default-value wording.
- The pause-point domain test and the patcher label test expect the
  metadata spelling, outdated comments about the mismatch are updated, and
  the skill output reference says how Method spells parameter types.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: hatayama/unity-cli-loop/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b02a2af1-aa2f-417e-a994-ca95606a9836

📥 Commits

Reviewing files that changed from the base of the PR and between 7d442e1 and 4920cd9.

⛔ Files ignored due to path filters (2)
  • Assets/Tests/Editor/HotReload/HotReloadLabelShapeWriterHost.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/HotReload/HotReloadMethodLabelParityTests.cs.meta is excluded by none and included by none
📒 Files selected for processing (11)
  • .agents/skills/uloop-hot-reload/references/output.md
  • .claude/skills/uloop-hot-reload/references/output.md
  • Assets/Tests/Editor/HotReload/HotReloadDomainTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadLabelShapeWriterHost.cs
  • Assets/Tests/Editor/HotReload/HotReloadMethodLabelParityTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadOrchestratorTests.cs
  • Assets/Tests/Editor/HotReload/HotReloadPatcherTests.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/HotReloadSignatureChangeCoverage.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Patching/HotReloadPausePointPort.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Shared/HotReloadMethodKeys.cs
  • Packages/src/Editor/FirstPartyTools/HotReload/Skill/references/output.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The Editor now formats resolved method parameter types using recursive .NET metadata-style spelling. Tests cover label parity and skipped-writer warning attribution for constructed generics and multidimensional arrays. Output documentation describes the parameter spelling.

Changes

Method Label Consistency

Layer / File(s) Summary
Metadata-style parameter formatting and parity tests
Packages/src/Editor/FirstPartyTools/HotReload/Shared/HotReloadMethodKeys.cs, Assets/Tests/Editor/HotReload/HotReloadMethodLabelParityTests.cs, Assets/Tests/Editor/HotReload/HotReloadPatcherTests.cs
FormatMethodLabel recursively formats parameter types using metadata-style spelling. Parity tests compare labels across a range of parameter shapes, and the method-key test checks constructed-generic spelling.
Worker-row matching and skipped-writer regressions
Assets/Tests/Editor/HotReload/HotReloadDomainTests.cs, Assets/Tests/Editor/HotReload/HotReloadOrchestratorTests.cs, Assets/Tests/Editor/HotReload/HotReloadLabelShapeWriterHost.cs, Packages/src/Editor/FirstPartyTools/HotReload/Patching/HotReloadPausePointPort.cs, Packages/src/Editor/FirstPartyTools/HotReload/HotReloadSignatureChangeCoverage.cs
Tests cover constructed-generic worker-row lookup and verify earlier-patch warning attribution for constructed-generic and multidimensional-array parameters. Comments describe label matching.
Output-format documentation
Packages/src/Editor/FirstPartyTools/HotReload/Skill/references/output.md, .claude/skills/uloop-hot-reload/references/output.md, .agents/skills/uloop-hot-reload/references/output.md
The skill output documentation specifies metadata-style parameter spelling. The other skill references retain the same documented output fields and behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 4920c

The change aligns method labels and improves warning attribution for complex parameter types. No merge-blocking issue was identified; merge after normal checks pass.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 4920c

The change corrects method-name matching without changing which methods are selected for patching or reversion. Risk is low: externally visible method strings change, and runtime behavior and downstream client compatibility have not been fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected propagation is bounded to existing hot-reload reporting, row matching, and domain-local bookkeeping. The formatter remains internal, and no new externally callable formatting entrypoint or method-selection authority was observed.

Trust Boundaries and Controls

  • observed — Apply and unchanged-method reversion select the owning method using home assembly, declaring-type metadata, method name, parameter metadata, and generic arity. Labels are derived after resolution and do not substitute for those identity and ownership inputs.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 8 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: hot reload warnings and pause points now recognize methods with generic or multidimensional-array parameters.
Description check ✅ Passed The description directly explains the label-format mismatch, the affected lookups and warnings, the implementation, regression tests, and verification results.
Linked Issues check ✅ Passed Issue #2903 requires one canonical method-label format, Editor-side matching for constructed generics and multidimensional arrays, and two-reload skipped-writer regression tests. `HotReloadMethodKeys.…
Out of Scope Changes check ✅ Passed The implementation, regression tests, fixture host, comments, and method-label documentation all support the canonical label objective in issue #2903. The changes do not show an unrelated behavioral o…
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 8 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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 merged commit 12377bd into main Sep 29, 2026
16 checks passed
@hatayama
hatayama deleted the fix/hot-reload-generic-parameter-labels branch September 29, 2026 23:51
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.

Hot reload: Editor and worker method labels disagree on constructed-generic and multidimensional-array parameter types

1 participant