Skip to content

Release/1.3.4#6

Merged
joaner merged 3 commits into
ioai-tech:mainfrom
joaner:release/1.3.4
May 28, 2026
Merged

Release/1.3.4#6
joaner merged 3 commits into
ioai-tech:mainfrom
joaner:release/1.3.4

Conversation

@joaner
Copy link
Copy Markdown
Contributor

@joaner joaner commented May 28, 2026

Description

Merge release/1.3.4 into main to address UI stuttering when playing large zstd-compressed MCAP files, and improve worker initialization and playback stability.

Key changes:

  • High-performance zstd decompression: Replace fzstd with @ioai/wasm-zstd@^1.1.0 (Vite/ESM-friendly WASM); keep lz4js for LZ4
  • Playback architecture improvements:
    • IterablePlayer: Make stale topic refresh asynchronous and non-blocking; adapt stale thresholds by topic frequency
    • MessageCursor: Add buffer duration limits, slice pump + yield to avoid long worker blocking
    • mcap.worker: Limit playback cursor buffer ahead (1.5s) to reduce memory and decode backlog
  • MCAP file reading: Remove local BlobReadable; use @mcap/browser
  • Loading UX: Add LoadingOverlay; support cancellable worker initialization (WorkerSourceCancelledError)
  • HDF5: Upgrade @ioai/hdf5 to ^1.0.0; add hdf5RuntimeLoader
  • E2E: Self-contained fixture generation scripts and test data; CI uses npm run gen:e2e:fixtures
  • Vite: Pre-bundle worker transitive dependencies; disable worker code splitting to avoid broken HDF5 dynamic import paths
  • Version bump: 1.3.31.3.4

Motivation / related issue

When playing large zstd-compressed MCAP files (e.g. 20241224_demo_gripper_PickAndPlace_ljw.mcap), the progress bar and UI stutter noticeably, with layouts/sec fluctuating between 5–20, while CPU usage stays below 10%.

Root causes include:

  1. Pure-JS fzstd decompression is too slow; zstd chunk decoding becomes a worker bottleneck
  2. Stale topic backfill was synchronously awaited in the playback tick loop, blocking the main loop
  3. MessageCursor had no duration-based buffer limit, causing queue buildup and latency spikes on high-throughput topics

Closes #

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Documentation update
  • Refactor / internal cleanup (no behavior change)

Checklist

  • npm run lint passes with no errors
  • npm test passes (unit tests) — 351 tests passed
  • npm run build and npm run build:lib succeed
  • New behavior is covered by tests (or explain why tests aren't applicable)
    • Added WorkerSerializedSource.test.ts (cancel initialization)
    • Existing MessageCursor / playback-related tests pass
  • Documentation updated (README, API.md, EMBEDDING.md) if the public API changed
    • Updated docs/ARCHITECTURE.md / docs/ARCHITECTURE.zh.md
  • Breaking change: all affected call sites updated and migration path described in PR description

API compatibility

N/A — no changes to exports in src/entrypoints/index.ts. Internal worker decompression switched from fzstd to @ioai/wasm-zstd; public API is unchanged.

New runtime dependencies:

  • @ioai/wasm-zstd@^1.1.0 (published to npm)
  • @mcap/browser@^1.1.0

Removed dependencies:

  • fzstd

Merge notes

main has 4 panel directory rename/refactor commits (Component.tsx*Panel.tsx, foxglove-corecore, etc.) that do not conflict with this worker/playback work. The only merge attention needed is docs/ARCHITECTURE.zh.md (changed in both branches).

Do not commit the untracked wasm-zstd/ subdirectory — rosview consumes @ioai/wasm-zstd via npm.

Test plan

  • Play the problematic MCAP: 20241224_demo_gripper_PickAndPlace_ljw.mcap — progress bar should be smooth, layouts/sec stable
  • Play a large non-zstd MCAP (e.g. banana_*.mcap, ~4 GB) — no regression
  • Open/cancel loading: cancel during large-file initialization — should return to welcome screen with no leftover worker
  • H.264 video topics: delta frames after keyframe are not dropped; seek recovery works
  • HDF5 / BVH / ROS bag basic playback
  • npm run test:e2e passes

Screenshots / recordings

joaner added 3 commits May 28, 2026 12:12
Integrate the @mcap/browser package to enhance BlobReadable functionality and streamline decompression processes. Update architecture documentation to reflect browser-safe decompression methods and remove the deprecated BlobReadable service. Adjust IterablePlayer to utilize the new BlobReadable implementation, improving performance and maintainability.
…asm-zstd

Bump the package version to 1.3.4. Update the NOTICE file to reflect the new source URL for the wasm-hdf5 repository. Replace the deprecated fzstd library with @ioai/wasm-zstd for Zstandard decompression, and update relevant documentation to ensure clarity on the new library usage.
Upgrade @ioai/wasm-zstd to 1.1.1 and pass preloaded wasm bytes from the
main thread into MCAP/bag inline workers, matching the HDF5 loading pattern.
Add shared E2E helpers that wait on data-player-presence before asserting
dockview readiness.
@joaner joaner merged commit 47ea86b into ioai-tech:main May 28, 2026
2 checks passed
@joaner joaner deleted the release/1.3.4 branch June 4, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant