<!-- examples/README-mambavision.md -->

# MambaVision arithmetic reference

Run `python examples/mambavision.py` from the repository root. No packages,
network access, GPU or checkpoint are needed. Assertions check shapes, padding,
recurrence boundaries and partition coverage before printing deterministic JSON.

The canonical source has regions `hierarchy`, `convolution`, `scan`, `mixer`,
`windows`. Registration for scripts/sync-paper-examples.mjs:

- name: `mambavision`
- filename: `mambavision.py`
- requirementsFilename: `requirements-mambavision.txt`
- keys: `['hierarchy', 'convolution', 'scan', 'mixer', 'windows']`

The generated module is `src/data/mambavisionCode.mjs`; exports are
`mambavisionCode` and `mambavisionTokens`. Central synchronization owns the
public download mirrors. Do not manually change generated excerpts.

Upstream reference: NVlabs/MambaVision, revision
7860a506b2eb844eaaae676f08461ce8c3c26f43, mambavision/models/mamba_vision.py.
Paper: https://arxiv.org/html/2407.08083v2 (2024 preprint, CVPR 2025).

This is an authored scalar mechanics reference, not copied upstream model code.
It demonstrates geometry, ordinary same-padded cross-correlation, a scalar
selective-kernel recurrence, and two fixed branches with a linear combination.
The toy mixer uses three taps for readability, while the released default uses
four. The expansion argument documents tensor widths and does not implement
multichannel projections. The scalar scan holds B/C fixed and accepts effective
deltas directly; it omits learned projections and softplus. Its injection is
ΔBu, not the general exact zero-order-hold B integral. The window helper uses
None for padding IDs; the upstream model pads feature values with zeros and
does not apply an explicit padding mask in its attention call.

No training, gradients, pretrained predictions, ImageNet accuracy, dense-task
scores or speed measurements are produced. The article reports published
benchmarks separately. Node tests: `node --test test/mambavision.test.mjs`.
