# Physical error budgets and raster exchange

For user-supplied planes, use **Multicomponent physical exchange**. Choose 2–4 matching P5 PGM or U16 RAW files. Declare RAW geometry and byte order, then set the exact decimal scale, offset and epsilon for each component. All source files together fit within 4 MiB. This path uses the existing v2 profile of unsigned samples, H=V=1, Pt=0 and no mappings or special NoData.

The public MoonBit planner assigns each scan the minimum NEAR limit of its members. It generates independent, shared and equal-limit plans, removes duplicates by scan structure, and accepts one manual alternative. The workbench runs candidates serially and compares actual JLS bytes after sample and stream checks. Its selected output can be recovered by the existing `multiplane.py restore` consumer. The comparison report records plan ID and input snapshot without changing the v2 sidecar schema. [Actual Lily results, reproduction and planner API](../reports/user-planes-20261202/README.md)

The workbench uses the same MoonBit decimal budget as `moonjls physical-budget MAXVAL SCALE OFFSET EPSILON`. Select a PGM, open Advanced controls, enable the physical budget and enter scale, offset, unit and the largest permitted error. Use Pt=0. Choose buffered download or, on an eligible browser, stream to a file. The workbench uses the largest legal integer NEAR with `abs(scale) × NEAR ≤ epsilon`, capped by `min(255, floor(MAXVAL/2))`. Exact decimal inputs below the next multiple of scale retain the smaller NEAR. Offset changes physical sample values and cancels from the error calculation.

The worker still compares the original and reconstructed integers on every row. Preview and point inspection use the existing sampled display. Final export follows strict EOI, output close and complete integer comparison. The workbench shows the coding NEAR, physical bound, observed maximum and unit. It recognizes the NASA LOLA source by its pinned original PGM SHA-256. Every other source uses the unit and calibration entered by the user. The browser's real-time codec run records the independent reference as `not_run`.

Download the JLS, raster sidecar and verification report. The sidecar is `moonjls.raster-exchange/v1`. It binds the original container, the JLS and canonical reconstructed u16 little-endian raster by SHA-256 and byte count. It records dimensions, dtype, byte order, layout, coding precision, MAXVAL, NEAR, Pt=0, mapping selector zero, scale, offset, unit, epsilon and calibration provenance. The sidecar has no signature. The companion verification report links its hash. There are no circular references. Files with missing required fields, wrong dimensions or inconsistent hashes are rejected by the independent [restore example](../examples/raster-restore/README.md).

The buffered exchange and small restore tool accept 4 MiB per file. Browser file output uses SHA-256 over the original PGM reads, accepted writes and canonical reconstruction rows. The cap is 128 MiB per file. The workbench generates completion metadata after strict decode, full comparison and an awaited close. Use the streamed Native consumer `exchange.py restore` for this route. Signed data, floats, nonzero Pt, mapped output and special NoData are outside the physical exchange profile. [Browser file validation](../reports/overnight-20261201/G5.md)


The independent large-file example adds the exact-budget JLS and sidecar workflow for known-height P5 and U16 raw rasters. It hashes bounded input and output chunks, compares original and reconstructed samples by row, and publishes the completion record after EOF and digest checks. File, pixel and staging disk limits are configurable. The same-stream reference and the measured application memory trend use a 64 MiB synthetic U16 raster. [Command and limits](../examples/raster-stream/README.md) · [Large-file results](../reports/host-streaming-20261201/raster-stream.json)

The version 2 sidecar assigns exact budgets to two to four equal unsigned planes by SOF component ID. Each shared scan uses the minimum permitted NEAR, while an independent scan keeps its own. `multiplane.py` builds and validates the v2 archive. The consumer writes canonical planar U16LE in SOF order and checks the actual scan, individual plane fingerprint and combined file fingerprint. A journal can recover an abruptly terminated task on Linux/WSL. [v2 and task recovery commands](../examples/raster-stream/README.md) · [67,117,056 B direct CharLS evidence](../reports/overnight-20261201/G2.md)

C.3 abbreviated images have a separate workbench path. Attach their C.4 table stream to the JPEG-LS input. The page reports table loading and missing-table errors. Choose opaque entries to export the byte rows of a multi-byte mapping. The downloadable bytes follow decoder delivery order, with entry widths available in scan metadata. The report gives the first entry width and bytes. No display or physical quantity is inferred from them. Mixed scalar and opaque output remains available through the SDK and Native interfaces.

For deferred height, the workbench reports the state it actually observed in the decoder. Short chunks can show waiting for height, caching a first scan and replaying after height resolution. A step that finishes several stages need not produce intermediate progress events. Resolved rows remain provisional through strict termination. The decoder's documented DNL cache limits still apply.

[CLI and SDK API](API.md) · [Independent restore example](../examples/raster-restore/README.md) · [Verification report](VERIFICATION_REPORT.md)

[0.8.1 Pages 实跑、独立恢复与三后端在线消费](../reports/080-audit-20261201/README.md)

[实测文件、截图和三后端公开消费](../reports/raster-exchange-20261201/README.md)
