Skip to content

Add Module to record FullSystem Stats - #3579

Merged
sauravbanna merged 23 commits into
masterfrom
sauravbanna/add_fullsystem_stats
Feb 26, 2026
Merged

Add Module to record FullSystem Stats #3579
sauravbanna merged 23 commits into
masterfrom
sauravbanna/add_fullsystem_stats

Conversation

@sauravbanna

@sauravbanna sauravbanna commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new layer to keep track of FullSystem Stats
These are stats that help us measure the performance of FullSystem -> how "well" it plays

Testing Done

Manual testing to

  1. make sure stats were being logged properly
  2. tune the filters on how stats are calculated to reduce noise and increase how well it matches observed gameplay

Resolved Issues

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@nycrat
nycrat marked this pull request as ready for review February 1, 2026 02:29
Comment on lines +31 to +32
# From GoalieTacticConfig
INCOMING_SHOT_MIN_VELOCITY = 0.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not get these from the protobuf?

@Andrewyx Andrewyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spoke to william about this today and was wondering if there was a way to implement this outisde of the GL/UI related code. Since we are not using any graphics capabilities and also making disk writes, it would probably more appropriate to have this functionality away from the UI-related layers.

From thunderscope.py we should be able to register the refresh observers for this stats module.

Comment thread src/software/thunderscope/log/stats/fullsystem_stats.py
@sauravbanna

Copy link
Copy Markdown
Contributor Author

I spoke to william about this today and was wondering if there was a way to implement this outisde of the GL/UI related code. Since we are not using any graphics capabilities and also making disk writes, it would probably more appropriate to have this functionality away from the UI-related layers.

From thunderscope.py we should be able to register the refresh observers for this stats module.

I moved all the stats stuff to its own module. i initially thought we wanted to visualize the stats at some point, but i think yea they should be separate from UI otherwise. i made a generic stats "holder" to hold all stats related function / classes, since i do plan on adding more to this (eg: the pass ML tuning data collection, which collects world state and saves to file similar to this stats class)

i'm initializing this in thunderloop main itself, right next to fullsystem, as in my mind it's not a part of fullsystem or thunderscope, but an extra logging type module we're adding on. but lmk what you think

@sauravbanna sauravbanna changed the title Add Layer to record FullSystem Stats Add Module to record FullSystem Stats Feb 14, 2026

@Andrewyx Andrewyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works so far, left some comments

@@ -0,0 +1,18 @@
load("@thunderscope_deps//:requirements.bzl", "requirement")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unused

Comment thread src/software/python_bindings.cpp Outdated
Comment on lines +361 to +362
py::arg("expected_kick_direction"), py::arg("min_kick_speed") = 0.5,
py::arg("min_kick_speed") = Angle::fromDegrees(20))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two backwards? Also, are there non constants for us to use here instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, but for the constants, we currently use magic numbers as default arguments in ball.h where the actual cpp function is defined. so i just did the same here, not sure which constant file to put them in if they should be constants


# the python __del__ destructor isn't called reliably
# so printing this at the start instead
print(f"\n\n\n##### Writing FS Stats to {self._get_stats_file()}#####\n\n\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why there are so many new lines inserted here, but one thing to make things look a bit nicer would be to add

from rich import print

Of course, this dep would need to be added in the bazel side of things too, but it allows for some nicer printing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added, the new lines were just to space out the log from the rest of the log stream but this looks better

@sauravbanna
sauravbanna merged commit 21cd689 into master Feb 26, 2026
6 checks passed
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.

4 participants