Skip to content

Commit

Permalink
Merge #212
Browse files Browse the repository at this point in the history
212: Add code for off-line reconstruction of candidate trees r=ulysseB,r=Elarnon a=andidr

The new module offline_analysis allows for the reconstruction of a candidate
tree from the events of a log file for post-mortem analysis or conversion to a
different log format required by an analysis tool.

The reconstruction of the tree itself and refinement of candidate nodes from
actions on the nodes can be done incrementally and in an interleaved fashion as
log messages are processed. The general outline of this process is:

  let mut tree = CandidateTree::new();
  let mut actions = ThreadActionList::new();

  // Iterate over all messages from the log file
  for ... {
    match message {
      Message::Node { ... } => { tree.extend(...); }

      Message::Trace { ... } => {
        // Iterate over all events of the trace message
        for event ... {
          match event {
            Event::Kill(...) => {
              // Declare candidate as a deadend
              tree.get_node(curr_node_id).borrow_mut().declare_deadend(...);
	      ...
            }

            Event::Implementation(...) => {
              // Update score
              tree.get_node(curr_node_id)
	        .borrow_mut()
		.declare_implementation(...);
       	      ...
            }

            ...
          }
        }
      }

      Message::Evaluation { ... } => {
        ...
        t.get_node(..).borrow_mut().set_score(...);
      }
    }
  }

Co-authored-by: Andi Drebes <andi@drebesium.org>
  • Loading branch information
bors[bot] and andidr committed Mar 21, 2019
2 parents 957b8d0 + e3515a0 commit 3167949
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -21,4 +21,5 @@ pub mod device;
pub mod explorer;
pub mod ir;
pub mod model;
pub mod offline_analysis;
pub mod search_space;
1 change: 1 addition & 0 deletions src/offline_analysis/mod.rs
@@ -0,0 +1 @@
pub mod tree;

0 comments on commit 3167949

Please sign in to comment.