@rowsncolumns/rnc-native-linux-x64
v0.35.4
Published
The rnc engine as a native Linux x86-64 binary (`bin/rnc-native`) for servers: the forced recalculation, the full XLSX export and the conversion to stable ids (in place too) of a whole document past the wasm32 heap. Built from the same commit as @rowsncol
Readme
@rowsncolumns/rnc-native-linux-x64
The rnc engine as a native Linux x86-64 binary, for servers. It is the engine the
@rowsncolumns/rnc-yrs-store wasm runs, built from the same commit, without the wasm32 heap's
4 GiB ceiling (rust/crates/rnc-native).
bin/rnc-native --version
bin/rnc-native recalc [--fn NAME]... < room.bin > delta.bin
bin/rnc-native export [--fn NAME]... [--command JSON]... [--sheets-json PATH] < room.bin > book.xlsx
bin/rnc-native convert < positional.bin > stable-ids.bin
bin/rnc-native convert-in-place --room PATH [--options JSON] --update-out PATH --converted-out PATH
[--state-vector-out PATH] [--skip-verify]recalc: the forced recalculation of a whole room (one v1 update on stdin). stdout is the v1 update it makes against the room as read; the host applies it and writes it as its own.export: the fullexportXlsx, byte for byte the wasm's.convert: the wasm'sconvertToStableIds. stdin is a positional (v3) document's whole state (one v1 update); stdout is the converted stable-ids (v5) document's whole state: a document of its own, to read content from, never to merge into a room. No flags, no calc engine. For an input it refuses it writes nothing and exits 1, the reason on stderr starting withalready-stable-ids,newer-format,migration-refused,invalid-documentorconvert-failed.convert-in-place: the wasm'sInPlaceConversion, for a room past the wasm caps (room-past-the-caps: more than 4,000,000 cells or 200,000 formulas) that people already hold.--roomis the room's whole state (one v1 update; a positional room or one stamped"v5").--update-outgets the ONE update that, merged into that room, makes it the converted room;--converted-outthe converted room's whole state, a document of its own;--state-vector-outthe state vector of the state read.--optionsis the object's options as JSON ({"extents": {"<sheetId>": {"rows": n, "columns": n}}}).- The guarantee is the library's: the update is written under one client the room holds no item of, and the room plus the update is the converted document item for item. The host's one condition is the library's too: the room has not changed since the state was read.
- Before it writes anything the command CHECKS that guarantee on the bytes it hands out: the
room and the update merged into a fresh document against the converted document (the same
items, the same deletions, every root read key for key). On a room past the wasm caps no
wasm can run that check, and the host's write is one way.
--skip-verifyleaves it out. - A failed check and every refusal write NOTHING and exit 1. stderr is then
rnc-native: <code>: <words>: the code comes after thernc-native:prefix.not-in-placefor the check;already-stable-ids,newer-format,migration-refused,invalid-document,unreadable-entry,table-and-name-clash,convert-failed,converted-differs,recalculated-differs,stored-result-changedandinvalid-optionsfrom the library. Neverroom-past-the-caps. The files are written whole or not at all. - Log the CODE of a refusal, never its words. The library's
converted-differswords quote what differs: a few hundred characters of each side of a read, and for a small sheet that read can be its cells as CSV. A host that logs stderr whole can log a customer's cell text (rowsncolumns/spreadsheet#2204 asks the library to keep cell text out of those words). - Each file is one path. An output that is the room's own file, or two outputs that are one
file, are refused before anything is read (
... each file is one path), by ANY spelling: the same name,./or a doubled slash inside the path, a relative name for one and an absolute for the other, a symbolic or a hard link, another letter case where the file system does not tell case apart. - stderr on success is one JSON line:
convertS,verified,verifyMs,totalS, the sizes of the room, the update, the converted document and the state vector,peakResidentBeforeVerifyBytesandpeakResidentBytes. - NOT here:
addHostUpdate. A host that writes data of its own on top of the converted document and needs the engine to check that write (the wasm object'saddHostUpdate) has no checked way to for a room past the wasm caps yet.
--version:{"name","version","commit","wasmSha256","target"}.manifest.jsonholds the same fields plus the binary's sha256. A host pins this package to the same version as@rowsncolumns/rnc-yrs-storeand checkswasmSha256against the wasm it loads.
Glibc 2.34 or newer (built on Debian bookworm). Numbers equal the wasm's to the bit, except
where a math library function computes them: POWER/^ with a fractional exponent, EXP,
TAN, SIN, COS, LOG10, LN, ATAN and the like can differ by one unit in the last place
(glibc's libm against the wasm's; measured on 500 rows each: POWER(x,1/12) 71, x^0.37 47,
EXP 36, TAN 27, SIN 23, LOG10 21, COS 16, LN 9, ATAN 2). SQRT and arithmetic are
exact. Identical bits need the libm crate under formualizer on both targets.
The package declares no os/cpu (Yarn 1 enforces them on workspace packages); declare it as an
optional dependency and run the binary on Linux x86-64 only.
Building
yarn build:native # a clean Docker build, the pinned toolchain, cargo build --locked, from HEAD
yarn build:native --verify # runs the binary: its embedded commit and wasm sha are HEAD's and the committed wasm'sReleases build it in yarn publish-packages. The prepublishOnly of this package and of
@rowsncolumns/rnc-yrs-store refuse a binary built from another commit, wasm or version, so the two
publish together or not at all. RELEASE_FORCE=1 is the one emergency path (a dirty or unproven tree,
stamped <sha>-dirty); the binary still has to match the wasm being published.
