Generic BitMachine execution tracker#288
Conversation
uncomputable
left a comment
There was a problem hiding this comment.
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. |
uncomputable
left a comment
There was a problem hiding this comment.
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.. |
|
@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.
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.
We already have one :). I figured we could pin both instances at once. (Which we should do!)
This PR generalizes
CaseTrackertoExecTrackerthat 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
ExecTrackertrait 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.