Skip to content

Playback modes: live mode, configured sim runs, pre-computed trajectories #450

@interim17

Description

@interim17

Use Case

Viewer branch #442 (prefetching) was merged but is being reverted as it introduced some bugs. I am expanding this issue description to include discussion of those issues, as I think this issue of defining playback modes is a prerequisite to solving some of those issues.

IClientSimulatorImpl defines these playback modes:

export declare const enum ClientPlayBackType {
    ID_LIVE_SIMULATION = 0,
    ID_PRE_RUN_SIMULATION = 1,
    ID_TRAJECTORY_FILE_PLAYBACK = 2,
    LENGTH = 3
}

In order to use BioSimulators (and other) APIs, and to manage playback, caching, and interaction with live/running client simulators we need to meaningfully distinguish between these playback modes in both local and remote contexts.

Clarify naming of interfaces:

Define playback modes:

  • live, pre-run and pre-computed modes should be defined at some level (controller?)
  • different modes should allow/expose/trigger different playback and streaming behaviors and controls
  • define/enforce approach to interacting with live/client sims (sendUpdate, local methods, frameRequests, etc.)
  • configure RemoteSimulator, particularly sendUpdate, for running remote procedural sims
  • define/configure caching options and behavior for live/procedural sims
  • procedural sims to adapt to any necessary changes as viewer defines playback modes

General caching updates/maintenance:

  • ensure sequential order of cached frames
  • cache logging, some required for front end features and some required for dev purposes
  • manage cache trimming to prevent loss of current rendered frame
  • handle requesting frames previous to cache, and fragmented cache, without clearing cache
  • should cached frames from procedural simulations be allowed to be discontinuous?
  • ensure that file changing results in rejection of inflight frames
  • return a promise when sending websocket requests to allow async chaining of sequential requests
  • initialize simulations with frame 0

Prefetching:

  • ability to control streaming behavior distinct from playback behavior, and distinguish streaming head distinct from playback head
  • ability to ensure sync and communication of back end and front end streaming head
  • checks to ensure cache (or cache fragments) only contain continuous frames
  • build behavior behind the scenes without unnecessary exposure of public methods

Future steps:

  • defining approach to pre-run sims
  • manage caching if pre-run exceeds cache limits
  • build JSON writer to export live and preconfigured sim runs, capture color changes, manage discontinuities of frame that result from cache trimming
  • expand to JSON writer to binary writer?
  • current BioSimulators API integration is a pre-run that utilizes auto-conversion, expand to live mode?
  • expand user configuration of display features (geometries, etc.) on pre-run sims
  • update test bed with necessary features to manage playback modes and take to UX to explore website/other front end implementations

Acceptance Criteria

TBD
Please describe how you know this is done

Details

Please provide any helpful specifications

TBD

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🏁 Ready for work

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions