# NODE.DC Rerun web viewer 0.34.1

This directory contains the audited Mission Core camera-controller override for
`@rerun-io/web-viewer` 0.34.1. It changes only native spatial-camera behavior:

- the pointer ray selects an anchor on the current focus plane;
- eye position and look target scale around that anchor, so the point under the
  cursor remains under the cursor;
- orbital drag anchors to the picked world-space point under the initial cursor
  position, with the focus plane as an empty-space fallback;
- after Rerun's `0.02 m` near-plane safety radius is reached, excess zoom becomes
  a cursor-directed dolly scaled by the scene's navigation speed instead of
  silently ignoring the wheel or moving by imperceptible millimeters;
- orbital navigation has a scene-scale speed floor, so WASD and post-limit
  dolly remain useful at the minimum radius;
- Mission Core's explicit `/world/sensor_pose` orbital follow keeps the current
  eye radius and orientation when enabled, remains attached through manual
  orbit and zoom, and releases only when the operator toggles follow off;
- repeated server-side blueprint activation for 2D detections, segmentation,
  and 3D cuboids restores the last rendered operator eye instead of applying
  Rerun's scene-bounds fallback, so layer toggles cannot reset the camera;
- first-person movement, panning and Rerun's zoom-out cap are unchanged.

## Source identity

- Upstream: `rerun-io/rerun`
- Tag: `0.34.1`
- Commit: `4efb18f17f6f0e41985cda99a2bdcd012febc8d5`
- Patched files: `crates/viewer/re_view_spatial/src/eye.rs`,
  `crates/viewer/re_view_spatial/src/ui_3d.rs`
- Patch: `NODEDC_ZOOM_TO_CURSOR.patch`
- Rust: `1.92.0`
- Binaryen / `wasm-opt`: `117` (the version pinned by Rerun's `pixi.lock`)
- Build image: `rust:1.92-bookworm`
- Build image digest:
  `sha256:e90e846de4124376164ddfbaab4b0774c7bdeef5e738866295e5a90a34a307a2`
- Build-only system packages: `clang 14.0.6`, `libudev-dev 252.39`
- Build date: `2026-07-23` (`Europe/Moscow`)
- Measured build stages: Rust to WASM `296.7 s`, JavaScript bindings
  `8.5 s`, Binaryen `wasm-opt -O2` `1244.2 s`

## Reproduction

Apply the patch to the exact upstream commit, then run Rerun's own builder:

```sh
git apply --unidiff-zero NODEDC_ZOOM_TO_CURSOR.patch
cargo test -p re_view_spatial --lib eye::tests:: -- --nocapture
cargo run -p re_dev_tools -- build-web-viewer \
  --release -g \
  --target no-modules-base \
  --no-default-features \
  --features map_view \
  -o rerun_js/web-viewer
```

The container also needs Binaryen `117` for Rerun's final `wasm-opt -O2` step.
Binaryen `108` from Debian 12 must not be used: it produced a module whose
`externref` table could not grow during initialization. The
generated `re_viewer.js` is transformed with
`scripts/transform-rerun-web-viewer-glue.mjs`, which mirrors Rerun 0.34.1's
`rerun_js/web-viewer/build-wasm.mjs` no-modules wrapper and teardown guards.

## Verified artifacts

| Artifact | SHA-256 |
| --- | --- |
| `re_viewer_bg.nodedc.wasm` | `ffe7543d28bb3394f289f6299de43d038767eef83d781c2b7f8f5683308a0469` |
| raw generated `re_viewer.js` | `cc196a93c5be972c801d46be4dc9934f7f042eb62941f0aa0678f1c8416c6874` |
| `re_viewer.nodedc.js` | `0f7b76c9f24cbd8437021b5d37499894aeadc586183e422ebc82ef556d7b8339` |

The focused Rust suite completed with `10 passed, 0 failed`, including the
orbit-to-dolly boundary, pointer-anchored rotation and scene-scale speed-floor
cases, persistent rig-orbit tracking, camera continuity across blueprint
reactivation, and explicit reset precedence. A Node `initSync`
smoke test completed successfully, including the `externref` table-growth step.
The Mission Core Node suite also checks both artifact hashes and verifies that
every `wasm.*` reference in the JavaScript glue exists in the paired WASM
exports.

`scripts/patch-rerun-web-viewer.mjs` installs the pair after npm extracts the
official package. It accepts only the known published or NODE.DC hashes and
fails closed on any other package contents.
