-
Notifications
You must be signed in to change notification settings - Fork 14
Generic BitMachine execution tracker #288
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
Conversation
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.
concept ack: 5d77a6e Can the simfony stack trace be implemented with CaseTracker
? This should be our goal.
I was thinking of the following scheme:
It can be used both for rich error messages and profiling (given jet costs we can aggregate weighted stack traces) |
This looks great to me. It's a bit of a sharp API -- your input and output buffers are passed as arrays of Will ACK this. |
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.
ACK 4821b65 I think raw &[UWORD]
slices are too low level to provide helpful introspection, but I will leave refactors to future PRs.
Using |
@m-kus if you are motivated, to fix the doc test you need to run with the nightly compiler because stable doesn't have the docsrs flags we need for this test. If you are less motivated you can drop the CI test and I will do it at some point :) |
Sure, no problem :) |
Great, looks good! I have queued this on my local CI box. There is one rust-bitcoin PR in front of it so it'll hopefully finish in the next hour. Very cool that you're developing on an arm box! We definitely appreciate the extra testing we get from you doing this.. |
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.
ACK 36ff961; successfully ran local tests
@uncomputable can I go ahead and merge this? |
- name: Checkout Crate | ||
uses: actions/checkout@v4 | ||
- name: Checkout Toolchain | ||
uses: dtolnay/rust-toolchain@nightly |
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.
36ff961: an unpinned nightly version might lead to flaky CI, but it should be ok for checking if docs build.
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.
We already have one :). I figured we could pin both instances at once. (Which we should do!)
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.
ACK 36ff961
This PR generalizes
CaseTracker
toExecTracker
that now supports tracking jet calls (in addition to case branches). It is also now possible to run BitMachine with a custom tracker created outside of the crate.This mechanim allows to implement jet tracer which pretty-prints jet arguments/result for each invocation, see https://github.com/m-kus/simfony/pull/2/files#diff-13e8b158f84f88059e0bd8631dfa9113112e30d7b8c21a15413d0ef36d2ea180
As a follow up it is proposed to further extend
ExecTracker
trait to allow visitor pattern on case/assert expressions. That would enable debug logging, similar to https://github.com/uncomputable/simfony-webide/blob/adb60d4e60c0d6b019ea13f64b1a166da3467d8d/src/function.rs#L145Having these two features (jet calls tracking and debug symbols) combined it's fairly simple to output weighted stack traces (e.g. in pprof) and build a Simfony profiler.