xls icon indicating copy to clipboard operation
xls copied to clipboard

[enhancement] add structured traceback for fn and test failures

Open proppy opened this issue 1 year ago • 0 comments

What's hard to do? (limit 100 words)

<discussed offline with @hzeller />

When a dslx function or test fails it can be difficult to traceback why it did so: the interpreter doesn't print stacktrace or contextual value about the state that led to that particular failure.

Current best alternative workaround (limit 100 words)

Currently the best alternative is to scatter trace_fmt statement along the code paths that led to the failure.

Your view of the "best case XLS enhancement" (limit 100 words)

Ideally we would have a structured representation of the execution trace of the call graph that led to the failure w/ input and output bit vectors of each function (similar to what is proposed in #1438 for channels) and possibly values of intermediate let bindings.

An interesting take on this could be to annotate the IR presentation itself w/ recording of the input/output signals of each node across a given execution; which could lend itself to being nicely displayed in https://google.github.io/xls/ir_visualization/.

proppy avatar Jun 06 '24 00:06 proppy