Skip to main content

Module register

Module register 

Source
Expand description

2.6 steps 2 and 4, the engine’s to drive before the cut: X’s own open on M_X, the private Environment, and each bundle’s marked rows reached (docs/plans/batch.md 2.6; review round 1’s B4, round 2’s S1 and S2).

A Registration is the engine’s to drive in 2.6’s order: Registration::open is step 2 (X’s own open on M_X by a Source::Path‘s rules, the stream reader, after the members’ ids are checked, in bytewise order and none repeated, and the stop), then step 3 is the engine’s (Registration::own gives X’s own handle), then Registration::member registers each member in bytewise order of id with load_dependency, handing the engine each loaded bundle (for the view’s name table and its same_named_cab rows) and reaching its marked rows, its peek bits loaded at that reach into a buffer charged to M_X and dropped after (PeekBits, Bits); and Registration::finish registers X last, from the bytes of its own open, compares the registered header and directory with the own handle’s, and reaches X’s rows. register runs all of it for a view as staged, with no step 3. Every Environment call is checked as 2.6 step 7 says: its run-level class first, then the evictions (X’s own bare limit(attempt_evictions, <value>), never a member’s), then the rest. Every core call, and every charge of a table registration makes, is under the refusal probe on its own, with the engine’s hooks (2.7; review round 3’s P1). peek is the peek pass’s function, and register_bytes the tests’ path to the engine’s, from bytes.

The core has no entry point that registers X’s slot over its own handle’s parse (step 4’s “X’s slot shares its own handle’s allocation”): the slot shares the own open’s bytes, so nothing is read twice, but parses them again on a dependency meter of its own; its resources are served through the own handle by the core’s redirect over shared Bytes.

Structs§

Admit
Bits
A bundle’s peek bits (2.6 step 4’s peek table): its top-level row count and a bit per row in directory order, set for a bundle, packed eight to a byte, in a buffer charged to its meter before it is allocated.
Registration
A view’s registration, as the engine drives it (module docs).
Staged
A bundle of the view as staged.

Enums§

Data
A staged bundle’s bytes: a spool file, or bytes in hand.

Traits§

PeekBits
Where an attempt reads a bundle’s peek bits at its reach: the engine’s peek file, read into Bits::charged on meter (M_X). A refused charge is X’s own reason, an I/O error host_io; the bits are checked against the registered directory’s row count here.

Functions§

peek
The peek (2.6 step 4’s peek table): the bundle opened by step 2’s rules on meter, the peek’s own, then a bit per top-level row in directory order, a dropped row included, set for a bundle, in a buffer charged on that meter first. The stop is checked between entries. Its failure is the bundle’s peek failure (Failure::Input): its open’s, or a row’s Limit; a refusal is the allocator’s, host_memory; an I/O error host_io.
register
2.6 steps 2 and 4 for a view as staged, with no step 3: the members sorted in bytewise order of id (X among them is passed over), their ids checked (a repeated one is internal) and the stop, before X’s own open; then the members in that order; then X (Registration).
register_bytes
register from bytes, each bundle named by its id and its bits peeked here first, each on a meter of its own (an unbounded budget, the context’s limits), as the engine’s peek pass would: X’s peek failure first, then the member’s of least id (2.3, rule 1). The tests’ path to the engine’s.
same_open
Step 4’s comparison: X’s slot, read by the memory reader’s rules, against its own handle, read by the stream reader’s. A difference (a header string with no NUL in its first 32,767 bytes, which the two readers return differently) fails X, container_error, detail malformed.