Repository navigation
Make profiler counters record exactly what was asked for, or fail - #66
Merged
Merged
Conversation
manage_profiler's counters parameter is documented as a category name or a JSON array of counter names, but the Python schema typed it as a string and the C# only recognised a real JSON array, so a JSON-array string fell through to the category path. Any category outside a hard-coded list of 16 then defaulted to Render. Two named counters started all 584 Render counters and reported success, as did a typo'd or unlisted category (gc, physics2d), and counter_list(category=...) passed Render's counters off as the requested category. ResolveCounters now matches both forms against the counters Unity has registered: a JSON array, or a string holding one, names counters; anything else names a category; and whatever doesn't match is an error that lists what is registered. The Render fallback (TryResolveCategory) is gone. The Python tool also accepts a real list, and the CLI help, the generated tool page and both skill-reference copies describe the contract. Fixes #4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
manage_profilersample_startandcounter_read, given a JSON array of counter names (the form the tool documents), recorded the whole Render category (584 counters) and reported success. Any category outside a hard-coded list of 16 did the same.counter_list(category=…)passed Render's counters off as whatever category was asked for. Counter names and categories are now matched against what Unity has registered, and anything that doesn't match is an error that lists what is registered.Issue: #4
Tests
ManageProfilerCounterTests. Eight failed on the old code for the predicted reasons. The other two passed and pin paths that should not change.countersaccepts a list.Land gate on this tree (
73b38493)🤖 Generated with Claude Code