-
Notifications
You must be signed in to change notification settings - Fork 202
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
Implementation of Tracing logger #241
Conversation
4651c2b
to
5452104
Compare
This comment was marked as outdated.
This comment was marked as outdated.
512dae7
to
985e78b
Compare
After implementation of the tree-like logger, the output looks like so:
|
Could we do something closer to this? With disabled logger:
With default logging level (
Also, instead of having tracing messages, we could probably incorporate extra info into the |
For the last point, I wonder if the output could look something like this:
|
After the update the output looks like so:
I didn't manage to add the data, requested in this comment to the
|
5e15e89
to
5a00b61
Compare
5a00b61
to
a8b4696
Compare
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.
Thank you! Not a full review, but I left some comments inline about how we can log the steps a bit differently.
abca6b6
to
fa4eb3e
Compare
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.
Thank you! Looks good! I left some more comments inline.
examples/src/fibonacci/fib2/mod.rs
Outdated
let trace = info_span!( | ||
"Generated execution trace", | ||
registers_num = field::Empty, | ||
steps = field::Empty | ||
) | ||
.in_scope(|| { | ||
let trace = prover.build_trace(self.sequence_length); | ||
tracing::Span::current().record("registers_num", &format!("{}", trace.width())); | ||
tracing::Span::current().record("steps", &format!("2^{}", trace.length().ilog2())); | ||
trace | ||
}); |
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.
For this, and all other examples:
- Let's change the message to
generate_execution_trace
. - Let's change
num_registers
tonum_cols
. We can get this value fromTRACE_WIDTH
constant. We can also expose this constant viaFibProver
.
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.
Looks good! Thank you! I left a few more comments inline.
prover/src/lib.rs
Outdated
let lde_domain_size = air.lde_domain_size(); | ||
let domain = { | ||
let _ = info_span!("build_domain", domain_size = lde_domain_size).entered(); | ||
StarkDomain::new(&air) | ||
}; |
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.
It doesn't look like the approach I suggested works correctly (the times reported are way too small and don't add up to the final time). To make it work we'd need to do something like this:
let lde_domain_size = air.lde_domain_size();
let domain = {
let span = info_span!("build_domain", domain_size = lde_domain_size).entered();
let domain = StarkDomain::new(&air);
drop(span);
domain
};
This may be fine for some other steps below (let's update them to make sure the times are captured correctly), but for this steps .in_scope()
would probably be a better solution.
Also, a couple of other comments:
- Let's rename the field to
lde_domain_size
. - Let's add
trace_length
field (this can also come fromair
struct).
After the recent changes logger output looks like so:
|
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.
Looks good! Thank you!
This PR changes the logger implementation from default log to Tracing, which allows to implement informative tree-like log.