Skip to content

Make profiler counters record exactly what was asked for, or fail - #66

Merged
vbucc merged 2 commits into
mainfrom
fix/issue-4-profiler-counter-resolution
Oct 9, 2026
Merged

vbucc merged 2 commits into
mainfrom
fix/issue-4-profiler-counter-resolution

Conversation

@vbucc

@vbucc vbucc commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

manage_profiler sample_start and counter_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.

  • Make profiler counters record exactly what was asked for, or fail
  • Bump version to 10.3.0-fork.5

Issue: #4

Tests

  • 10 new EditMode tests in ManageProfilerCounterTests. Eight failed on the old code for the predicted reasons. The other two passed and pin paths that should not change.
  • One new Python check that counters accepts a list.

Land gate on this tree (73b38493)

  • pytest: 1680 passed, 18 skipped.
  • Smoke: passed.
  • EditMode: 1230 passed, 0 failed, 78 skipped.
  • The compile check on 6000.5.5f1 also passed.

🤖 Generated with Claude Code

vbucc and others added 2 commits October 9, 2026 11:55
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>
@vbucc
vbucc merged commit 656c6e5 into main Oct 9, 2026
1 of 3 checks passed
@vbucc
vbucc deleted the fix/issue-4-profiler-counter-resolution branch October 9, 2026 15:59
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