-
Notifications
You must be signed in to change notification settings - Fork 47
feat(mettagrid): add StatsMutation for logging stats #4958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all
Are you sure you want to change the base?
feat(mettagrid): add StatsMutation for logging stats #4958
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab88892947
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b509f8f to
a79ebd0
Compare
ab88892 to
40b8869
Compare
a79ebd0 to
4a8d25d
Compare
cfd9196 to
717b742
Compare
4a8d25d to
04ce093
Compare
04ce093 to
22299ef
Compare
717b742 to
14d48ae
Compare
22299ef to
0403df0
Compare
14d48ae to
cb22d29
Compare
0403df0 to
fb85dab
Compare
46a0e5c to
32c29a2
Compare
139a420 to
6c3fee4
Compare
32c29a2 to
a64686c
Compare
6c3fee4 to
59c2983
Compare
6c64e32 to
110061e
Compare
59c2983 to
731c8af
Compare
| } | ||
|
|
||
| // Log the stat to the collective's stats tracker | ||
| coll->stats.add(_config.stat_name, _config.delta); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to specify if it's game, agent, or collective stat. And handle those
Add StatsMutation that logs a stat with a specified delta. Useful for events to track when they fire or record custom metrics. Python: - StatsMutationConfig with mutation_type="stats", stat field and delta field - LogStat() helper function with optional delta (default 1) - Added to AnyMutation union C++: - StatsMutationConfig struct in handler_config.hpp - StatsMutation class in mutation.hpp (logs to target's collective StatsTracker) - Added to MutationConfig variant Tests: - test_stats_mutation.py with creation, helper, default delta, serialization tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
731c8af to
15bac33
Compare
110061e to
232df60
Compare

Add StatsMutation that logs a stat with a specified delta.
Useful for events to track when they fire or record custom metrics.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com