|
Download docs/FORMAT.md from PureOne/NYARION-FS-8.0-Transactional-Storage-Engine: direct link, hf CLI and curl.
- Browser
- Download file 11.4 kB
-
https://huggingface.co/datasets/PureOne/NYARION-FS-8.0-Transactional-Storage-Engine/resolve/main/docs/FORMAT.md
- Command line
-
hf download hf://datasets/PureOne/NYARION-FS-8.0-Transactional-Storage-Engine/docs/FORMAT.md
-
curl -L -o FORMAT.md https://huggingface.co/datasets/PureOne/NYARION-FS-8.0-Transactional-Storage-Engine/resolve/main/docs/FORMAT.md
11.4 kB
| # Format 5 reference | |
| This document describes the persistent format used by the NYARION page engine. | |
| The standalone release number and the image format number are separate: release | |
| 7 uses format 5 images. The engine is a POSIX regular-file storage engine, with | |
| all recovered logical data held in RAM. It is not an NTFS image or a mounted | |
| filesystem. | |
| ## Image layout | |
| All offsets are byte offsets from the start of one regular file. Multi-byte | |
| binary header fields use big-endian order. | |
| | Region | Location or size | | |
| |---|---| | |
| | Four catalogue seal copies | offsets `0`, `4096`, `8192`, `12288`; each uses one 512-byte unit | | |
| | Reserved seal region | bytes `0` through `16383` | | |
| | Mirrored capsule window | starts at `16384`; two arrays of 64 slots, each slot 65,536 bytes | | |
| | Mirrored object arena | starts at `8404992`; `pool_blocks` physical blocks of 4,096 bytes | | |
| | Exact apparent image length | `8404992 + pool_blocks * 4096` | | |
| The arena size is configured at creation. `pool_blocks` must be an integer from | |
| 16 through 1,048,576. The default is 16,384. The value counts physical blocks, | |
| including both replicas of each object; it does not count logical objects or | |
| file-data bytes. The apparent file size does not establish filesystem-allocated | |
| space or physical SSD write traffic. | |
| For logical capsule epoch `e` and replica `r` in `{0, 1}`, the slot offset is: | |
| ```text | |
| 16384 + (r * 64 + e % 64) * 65536 | |
| ``` | |
| For object block index `i`, the offset is `8404992 + i * 4096`. | |
| ## Record headers and identity | |
| The magic is the eight-byte string `NYPAGES5`. Every record starts with a | |
| 104-byte header. The first 72 bytes form the checksummed prefix: | |
| | Field | Size | Meaning | | |
| |---|---|---| | |
| | magic | 8 bytes | `NYPAGES5` | | |
| | format | 2 bytes | integer `5` | | |
| | kind | 2 bytes | typed record identity | | |
| | payload length | 4 bytes | bytes immediately following the header | | |
| | epoch / birth generation | 8 bytes | meaning depends on kind | | |
| | volume UUID | 16 bytes | image identity | | |
| | payload SHA-256 | 32 bytes | digest of the exact payload bytes | | |
| | prefix SHA-256 | 32 bytes | digest of the preceding 72 bytes | | |
| Kinds are seal `1`, catalogue `2`, trie `3`, blob manifest `4`, raw data `5`, and | |
| capsule `6`. Seal headers carry a catalogue generation. Arena objects carry | |
| their birth generation. Capsule headers carry a logical transaction epoch. | |
| Epochs and generations are unsigned 64-bit integers, with exhaustion rejected. | |
| An arena object has at most 3,992 payload bytes and is written as one padded | |
| 4,096-byte block per replica. A seal is padded to 512 bytes, leaving at most 408 | |
| payload bytes. A capsule payload is bounded by 65,432 bytes; capsule writes need | |
| not overwrite the unused tail of the reserved slot. The parser follows the | |
| validated length rather than treating old tail bytes as part of the record. | |
| SHA-256 is used for accidental-corruption detection and content binding under | |
| the stated collision-resistance/ideal-detection assumption. This is not an | |
| authenticated storage format against an attacker who can rewrite records and | |
| their hashes. Both replicas reside in the same image; this alone does not | |
| provide whole-drive failure independence. | |
| ## Canonical structured payloads | |
| Seals, catalogues, tries, blob manifests and capsules use compact ASCII JSON: | |
| sorted keys, no insignificant spaces, comma/colon separators, ASCII escaping, | |
| and no non-finite numbers. Duplicate object fields and noncanonical encodings | |
| are rejected on parsing. Raw data pages contain bytes rather than JSON. | |
| Binary values in JSON use standard padded base64. Decoding is strict and must | |
| round-trip to the same canonical encoding. Volume identifiers are 32 lowercase | |
| hexadecimal characters; digests are 64 lowercase hexadecimal characters. | |
| ## Object descriptors | |
| A descriptor is a six-element JSON array: | |
| ```text | |
| [replica_a_index, replica_b_index, birth_generation, kind, payload_length, sha256] | |
| ``` | |
| Replica indices must be distinct and within the configured arena. Following a | |
| descriptor checks the expected kind, volume, birth generation, payload length | |
| and digest. A current object may refer to an older immutable child, but not a | |
| child born after the selected catalogue generation. The catalogue itself must | |
| have the selected seal's generation as its birth generation. | |
| This identity distinguishes a reused address from the object that formerly | |
| occupied it. It does not authorize early reuse: blocks reachable from a root | |
| that remains protected cannot be allocated merely because a later pointer | |
| would detect that overwrite. | |
| ## Seal and catalogue | |
| A seal has exactly these fields: | |
| ```json | |
| { | |
| "generation": 7, | |
| "volume": "0123456789abcdef0123456789abcdef", | |
| "pool_blocks": 16384, | |
| "root": [20, 21, 7, 2, 123, "<64 lowercase hex characters>"] | |
| } | |
| ``` | |
| The root shown above is explanatory; the length and digest must match an actual | |
| catalogue for a valid image. A catalogue contains `format`, `volume`, `epoch`, | |
| `history`, `files_root`, and `tokens_root`. An empty trie root is JSON `null`. | |
| The catalogue's logical epoch identifies a complete global checkpoint. | |
| Seal copies are grouped into banks `(0, 1)` and `(2, 3)`. New generation `g` | |
| publishes to bank `g % 2`; creation initially writes all four seal positions. | |
| Recovery elects the greatest complete valid seal generation, rejects conflicting | |
| same-generation identities, and validates that generation's dependency graph. | |
| Missing dependencies for that selected root stop recovery. The engine does not | |
| silently try an older generation to hide that failure. | |
| ## Trie and file representations | |
| Files and retry receipts occupy two separate immutable adaptive 16-way tries. | |
| Routing uses successive hexadecimal digits of SHA-256 over the UTF-8 key. | |
| Leaves keep complete keys. A leaf includes `family`, `type: "leaf"`, `depth`, | |
| and an `entries` map. A branch includes `family`, `type: "branch"`, `depth`, | |
| and a `children` map whose single-character keys are hexadecimal digits and | |
| whose values are descriptors. Depth cannot exceed 64. | |
| Leaves split when their encoded payload would exceed one object page. An | |
| oversized bucket at exhausted routing depth is rejected. Deletion removes | |
| entries and empty children; globally minimal tree shape is not guaranteed. | |
| A file entry is either `{"inline": "<base64>"}` for at most 256 bytes, or | |
| `{"blob": <descriptor>}`. A blob manifest contains `length`, `digest`, and a | |
| nonempty `chunks` list. Its raw data chunks have the expected bounded lengths, | |
| and their concatenation must match the manifest's total length and digest. | |
| A token entry is `[logical_epoch, intent_sha256]`. Each distinct acknowledged | |
| token remains live logical data; the format has no implicit token expiration. | |
| Its intent digest binds a sorted list of paths and either a deletion marker or | |
| the replacement value's length and digest. | |
| ## Capsule and recovery tail | |
| A capsule contains exactly `format`, `volume`, `epoch`, `parent`, `token`, | |
| `intent`, and `changes`. `changes` is a nonempty sorted list of | |
| `[path, base64_value_or_null]` pairs, with no duplicate paths. `null` denotes a | |
| deletion; an empty base64 string denotes an empty byte value. The parent is the | |
| preceding global history digest. | |
| After loading a global checkpoint, recovery requires newer complete capsules | |
| to form a contiguous, history-linked tail within the 64-slot window. It checks | |
| all evidence from valid newer capsule headers. A checksum-valid newer header | |
| without a complete valid payload blocks recovery, even if that interrupted | |
| operation was never acknowledged. Fully checkpointed slots may be reused. | |
| ## Publication and allocator state | |
| An ordinary fitting transaction writes both complete capsule copies and waits | |
| for one successful `fsync` before returning its epoch. A transaction that must | |
| publish a checkpoint also includes the checkpoint's persistence operations. | |
| A checkpoint writes and validates new dependencies while keeping the old root | |
| protected, forces those dependencies, writes both new seals, and forces their | |
| publication. Only then may it release blocks absent from the successor graph. | |
| Writable recovery repairs selected reachable mirrors and normalizes the newest | |
| seal bank before another publication. | |
| The free heap, descriptor ownership, reference counts, verified edge cache and | |
| temporary reservations are RAM state. They are rebuilt from the selected disk | |
| graph after recovery. Positive reference counts represent the retained roots' | |
| reachable graph; changed roots activate and release edges at zero/one | |
| transitions. The checkpoint path avoids a whole-arena rescan. Invalid reachable | |
| graphs, cycles and conflicting block ownership stop recovery before allocation. | |
| Release 8 uses volatile capacity admission evidence before acknowledging a | |
| new capsule. An incrementally maintained conservative bound covers changed | |
| published-leaf cells, shared dirty ancestors, blob pages and the new catalogue. | |
| Each changed cell uses a weighted persistent symbolic trie. Leaves maintain | |
| canonical encoded-entry weight sums and counts; branches retain subtree page | |
| counts. Offers copy changed symbolic paths and bounded leaf maps, and unchanged | |
| symbolic subtrees are shared. Splitting follows the hash partition; retaining | |
| an existing branch after a shrink can conservatively charge extra pages. | |
| Empty symbolic branches are removed. | |
| Symbolic new descriptors use maximum format widths. If the bound fits, exact | |
| compilation can be deferred until checkpoint; if it cannot certify fit, the | |
| complete exact planner is used before accepting or rejecting the offer. | |
| An exact plan binds actual free addresses and encoded dependency/seal bytes | |
| to the published roots, generation and logical history. Planning uses private | |
| overlays and a nonmutating free-heap cursor. Publication consumes that exact | |
| allocator prefix, forces dependencies and then forces the new root seals. | |
| Reservation cells, weighted symbolic nodes, bound totals, route caches and exact plans are process-time | |
| admission state, not new persistent fields. Writable restart recompiles an exact | |
| plan for the recovered tail before accepting more changes. Read-only recovery | |
| can expose an older tail whose checkpoint cannot fit. These rules guarantee | |
| conditional engine-arena headroom, not host filesystem allocation, available | |
| RAM or successful device I/O. An older compatible writer need not enforce the | |
| release 8 admission policy merely because it writes the same image format. | |
| The bounded fault argument assumes truthful persistence barriers, one serialized | |
| publisher, disjoint replicas, detectable loss of at most one protected sector | |
| in addition to pending torn writes, and repair/drain conditions before a later | |
| writer. Two durable newest seal witnesses keep a stale bank from being elected | |
| within that loss budget. Older bank graphs may already contain reclaimed pages. | |
| Losing every newest witness is outside that promise. Finite model tests do not | |
| qualify a physical device's power-loss behavior. | |
| ## Compatibility boundary | |
| Release 8 retains format 5 rather than adding a new disk-format version for its | |
| volatile admission and planning rules. Compatibility tests and their exact | |
| source hashes are provided with the release. Format 3 and format 5 are different | |
| formats; no in-place format-3 migration is implied. The on-disk format describes | |
| data representation and recovery; process-time admission guarantees also depend | |
| on which engine version is allowed to write the image. | |