Expand description
Out-of-core source: a decoder’s content that holds only the
records a worker has needed so far, instead of the whole file.
The arena is itself a valid STEP file: the original HEADER, then a subset
of the DATA records in the order they were installed. Every reader that
takes content: &[u8] therefore works on it unchanged, and a reader that
scans by type sees the subset that was installed. The host fetches records
by byte range (a File slice, an OPFS handle, a shared buffer) and installs
them here; SparseSource::expand names the records a set of roots still
needs by walking #id references through what is already present.
A lookup of an id that is not installed is recorded
(SparseIndex::take_misses), so a reference the forward walk cannot see
(an inverse relation the caller did not declare) is detected rather than
silently read as “entity not found”.
Structs§
- Sparse
Index - Id to arena span, with a record of every id asked for and not found.
- Sparse
Source - The sparse arena, its index and the reference-walk state.
- Sparse
Stats - Counters for the host’s budget decision and for the report.
Functions§
- build_
sparse_ preamble - Build the preamble every sparse worker starts from: the bytes before the
first DATA record (the HEADER, which declares the schema), the
closureroots with every record they reference, and therecordsroots alone, all in file order.lookupresolves an id to its span incontent. - for_
each_ record_ ref - Call
visitwith every#idreference in one STEP record’s attribute list. Quoted strings and/* */comments are skipped; the record’s own#id=is not reported. A reference wider thanu32is ignored, as the decoder refuses it anyway.