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

Use #[track_caller] to make automated namespacing useful #250

Closed
Pratyush opened this issue Aug 2, 2020 · 1 comment · Fixed by #270
Closed

Use #[track_caller] to make automated namespacing useful #250

Pratyush opened this issue Aug 2, 2020 · 1 comment · Fixed by #270

Comments

@Pratyush
Copy link
Member

Pratyush commented Aug 2, 2020

In the new refactor of the ConstraintSystem API, one doesn't have to thread &mut cs.ns(|| "new namespace") everywhere. While this enables lots of improvements, such as overloading arithmetic operators for field and group variables, the lack of meaningful human annotated names does cause a regression in diagnostics, debugging, and profiling.

The current approach would be to do manual annotations using the cs.ns() API, and this provides some high level information, but for most profiling/debugging use cases, but this doesn't suffice. A better way would be automatically annotate the relevant namespaces with file, line number and column information using the Location API in combination with #[track_caller]

@Pratyush
Copy link
Member Author

This doesn't actually work because the track_caller only returns the location of one location in the call stack, and does not return the path in the namespace tree. TO fix this, I moved to a tracing-based profiling infrastructure in #270 .

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 a pull request may close this issue.

1 participant