Skip to content

Record and replay operations #200

@vibraphone

Description

@vibraphone

We need a mechanism for recording operator specifications and results so that they can be played back. Some use cases are outlined below, along with implementation issues to consider.

Use cases

  • Record operations and write human-parsable/-editable Python scripts to reproduce the operations.
  • Record operations and replay to enable a poor-man's undo/redo.
  • Record operations in order to generate tests.
  • Debug a trace of operations that led to a failure or crash.
  • Group of a set of recorded operations as atomic (e.g., to create a macro).

Issues to consider

  • Naming (since UUIDs created by operator-constructed entities will be different each time). We might relax into this by only handling UUIDs that are returned by one operator as inputs for other operators; in that case we can probably assume that the order of returned values is significant (the operators return an array, not a set of UUIDs for the lists of created/modified/expunged entities) and use that order to do the mapping. The alternative is to traverse the model and pray that the traversal order is the same across session. If it is, then we can either rename entities to match UUIDs in the log or keep the lists and look up indices in the lists which could be memory- and time-inefficient if done naively.
  • Macro-style operators (i.e., that invoke child operators) can cause trouble since we only want to invoke the parent — it will re-invoke its children when replayed. If recording on the server side, we can already hit this case because of the way the "close model" operator is implemented.
  • Show progress when replaying since we know how many operations were performed. Should we record duration of each op to improve estimates?
  • Want to pull out 1 particular session's operations and replay only those (or any other filter of the operator log, but sessions make particular sense).
  • Should we record session creation/state? There are not currently observers for when sessions are created but it would not be difficult to add them and would let us capture static settings (e.g., is the CGM session discrete or parametric?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions