Skip to content
Back to skills

Data Replay And Streaming

ASecurity

Design rules for replaying and streaming large CAN datasets - time bases, deterministic replay engine, seek and indexing, back-pressure, batching to the webview, chart decimation, memory bounds. Use when building replay, recording, Signal Lab data paths or anything that handles high frame rates.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
development

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add afri-bit/candb-studio --skill data-replay-and-streaming --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Replay And Streaming?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Replay And Streaming
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/afri-bit-data-replay-and-streaming/badge)](https://www.skillsdirectory.com/skills/afri-bit-data-replay-and-streaming)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-replay-and-streaming
description: Design rules for replaying and streaming large CAN datasets - time bases, deterministic replay engine, seek and indexing, back-pressure, batching to the webview, chart decimation, memory bounds. Use when building replay, recording, Signal Lab data paths or anything that handles high frame rates.
---

# Data replay and streaming

## Model
`Source` (hardware | virtual | log | recording) -> `FramePipeline` (`onFrameReceived`) -> decode -> `EventBus` -> subscribers (monitor table, charts, recorder). **Replay is just another source.** It must never transmit to a hardware adapter.

## Time
- Internal unit: **integer nanoseconds**; keep the clock domain (hardware / host / file-relative) with the frame.
- Replay clock: `PlaybackClock` interface (`now()`, `sleepUntil(t)`) with a real monotonic implementation (`process.hrtime.bigint()`) and a **fake clock for tests**. Speed factor scales the timeline; 1x preserves recorded inter-frame gaps; "as fast as possible" is a separate mode.
- Scheduling: coarse timers drift - compute each deadline from the start time, not from the previous wake-up, and emit due frames in batches. Report dropped/late counts rather than hiding them.

## Determinism
Frame order = source order. No dependence on wall clock for *content*. Same input + same settings -> byte-identical output stream. Seed any randomness (virtual bus) and expose the seed.

## Seek and index
Build a sparse index (every N frames or every T ms: byte offset + timestamp) in a background pass; seek = binary search index, then scan. Show progress for the first pass; allow use before it completes (degrade seek).

## Back-pressure and batching
- Pull-based reading (async iterator) with a bounded queue; pause the source when the consumer lags.
- Host -> webview: batch (for example every 16-50 ms, max N frames per message) and send compact arrays, not per-frame objects; cap UI table rows with a ring buffer and virtualised rendering.
- Never post a message per frame at kHz rates.

## Charts
Keep full-resolution data in the host only when needed; send decimated series (min/max per pixel bucket, or LTTB) for display. Preserve extrema so spikes are not smoothed away - a validation tool must not hide glitches.

## Memory and failure
Bounded buffers everywhere; document the maximum. Corrupt/truncated input ends the stream with an explicit error event; partial results stay visible and labelled partial.

## Tests
Fake clock tests for pause/resume/seek/speed; property test: concatenating chunks equals whole; large synthetic stream (1e6 frames) completes within memory and time budgets.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.