Skip to content

Enable displaying mixed resources when using --detailed-resources flag #3377

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ddoktorski
Copy link
Contributor

Related #3114

Introduced changes

  • When tracking sierra-gas, display both Sierra gas and VM resources if VM resources are non zero and --detailed-resources flag is used
  • Remove redundant parentheses around sierra_gas_consumed value

@ddoktorski ddoktorski requested a review from a team as a code owner May 19, 2025 15:48
@ddoktorski ddoktorski requested review from cptartur and kkawula and removed request for a team May 19, 2025 15:48
@ddoktorski ddoktorski force-pushed the 3114-detailed-resources-flag branch from a6e81ae to 7418de8 Compare May 19, 2025 15:49
@ddoktorski ddoktorski requested a review from THenry14 May 19, 2025 16:08
Comment on lines +105 to +107
if used_resources.execution_resources != ExecutionResources::default() {
output.push_str(&vm_resources_output);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we making sure somewhere that resources for the same syscall aren't displayed here multiple times? or maybe quite contrary?

I'm just afraid such situation might be confusing for users (did I just pay twice for a syscall or what happened really?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, syscall resources are included only in the tracked resource. This is not ideal because when tracking Sierra gas, gas_consumed includes all syscalls also those from subcalls that tracked cairo steps.

Regarding the double counting of syscall resources, I can add tests for example to assert that the returned VM resources are less than computed from the executed syscalls.

Copy link
Member

Choose a reason for hiding this comment

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

If some of these costs are included twice, I wonder if this is a good UX to show it then. Maybe just an information that we had to fall back to calculating vm resources in tests and that the values may not be accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If some of these costs are included twice

No resources are calculated twice. The only issue is that some syscalls, which should be counted as VM resources, are instead included in the Sierra gas consumed. However, they are still only counted once.

Maybe just an information that we had to fall back to calculating vm resources in tests and that the values may not be accurate.

We can add a warning or something like that, but hopefully it will be fixed in #3399

Copy link
Member

Choose a reason for hiding this comment

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

I think a warning would be a simple thing to add here and it's not sure if #3399 will be addressed quickly.

@ddoktorski ddoktorski requested a review from THenry14 May 20, 2025 14:19
Base automatically changed from 3114-tracked-resources to master May 21, 2025 15:00
Copy link
Collaborator

@THenry14 THenry14 left a comment

Choose a reason for hiding this comment

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

lgtm

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