Skip to content
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

NEW: Added achievable frequency and latency (processing delay) to Input Debugger (ISX-2254) #2142

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

ekcoh
Copy link
Collaborator

@ekcoh ekcoh commented Feb 19, 2025

Description

Adds achievable sample/event frequency (as well as sensor frequency and global polling frequency) to Input Debugger device window. These are just basic calculations over periods of one second at the moment similar to FPS counter.
Adds input processing delay (average, min, max) to Input Debugger device window.

The diagnostic values are similar to FPS updated once a second to show primarily the average. This is intended to help with diagnosing the behaviour of the system and devices and help spot problems.

Added 11 new test cases to cover the calculators as part of editor test assembly which required modification to accept unsafe code in the test assembly which I believe should be ok to change.

Target frequency shown is based on IOCTL sample frequency query response which I believe is only supported by sensors currently. Polling frequency is as we know global at the moment, but showing it since it relates to devices with polling backends which we currently cannot determine from the system. If both of these could be capability queried in the future we can make a better message here.

Screenshot 2025-02-20 at 10 57 35

Testing status & QA

Tested manually with mouse, keyboard and gamepad on macOS during development.
Added unit tests to verify that calculations are working as expected.

Overall Product Risks

Very small. Has no impact on production or player code.

  • Complexity: 0
  • Halo Effect: 0

Comments to reviewers

If possible to cover sensors in review/QA it would be great.

Note that both label fields have tooltip that also needs review.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests: 11 new test cases added to InputLatencyCalculatorTests and SampleFrequencyCalculatorTests.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@ekcoh ekcoh changed the title ADD: Added achievable frequency and latency (processing delay) to Input Debugger (ISX-2254) ISX-2254 NEW: Added achievable frequency and latency (processing delay) to Input Debugger Feb 19, 2025
@ekcoh ekcoh changed the title ISX-2254 NEW: Added achievable frequency and latency (processing delay) to Input Debugger NEW: Added achievable frequency and latency (processing delay) to Input Debugger (ISX-2254) Feb 19, 2025
Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

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

It's a great to have, thanks for adding this!
I only did a quick run through but it looks good from my POV. I need to take another closer look and try it myself.

private double m_LastUpdateTime;
private int m_SampleCount;

public SampleFrequencyCalculator(float targetFrequency, double realtimeSinceStartup)
Copy link
Collaborator Author

@ekcoh ekcoh Feb 21, 2025

Choose a reason for hiding this comment

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

Target frequency is currently only a "convient storage" here. Hower I would suggest keeping it inside this type since an evolved implementation will likely use it to compute error compared to target and create a CDF or PDF of it to illustrate the applications or architectures ability to promptly react to stimuli.

@ekcoh ekcoh requested a review from duckets February 21, 2025 15:09
@surfnerd
Copy link
Collaborator

I think this is great step toward transparency of processing of input events. I think it should be made clear that this doesn't measure the latency between the creation of an input event to when it shows up on the screen, but from the creation of the event to when it's processed by the input system.

@ekcoh
Copy link
Collaborator Author

ekcoh commented Feb 25, 2025

I think this is great step toward transparency of processing of input events. I think it should be made clear that this doesn't measure the latency between the creation of an input event to when it shows up on the screen, but from the creation of the event to when it's processed by the input system.

Agreed, that's a much simpler/better way to say what I am trying to say in that tool tip. Also why I renamed the label to "Processing Delay". Will try to improve the tooltip based your description here. Thanks! :)

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.

3 participants