cucapra / cucapra/protocols

[Monitor] Reactor to use `bi`'s `proto_trace.rs` interface to avoid memory blowup on long waveforms

Open
#221 0 comments 0 reactions 1 assignee Claimed by @ngernest View on GitHub
Chore
Dominant language
Rust
Stars
15
Forks
0
Avg merge
6h 20m
Merged PRs (30d)
15

Description

On the `ethmac` benchmark, the monitor runs out of memory after ~10 mins (even on our servers).
The `bi` executable also eventually runs out of memory on the same waveform, but after ~1 hour.
(Aside: we will investigate other Wishbone benchmarks with shorter waveforms for the time being)

From reading the `bi` code, it looks like `bi` keeps track of tail pointers when accumulating the protocol trace, so "cloning" the scheduler just means updating the tail pointer instead of copying the entire Vec of protocol entries, which seems much more efficient.
On the other hand, the current `monitor` implementation naively clones the entire `Scheduler` struct every time it explores a different execution path, which entails copying the entire `Scheduler.output_buffer` `Vec`, which becomes expensive when there are more paths.

Ideally, we would refactor `monitor` to use the same mechanism as `bi` (by using the data structures in `bi/src/proto_trace.rs`) to avoid this blow-up in memory.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.