Bytes; a program pads the end itself (ADR-320 D13)Open and answer this issue on GitHub.
blocked · opened 2026-10-20 · updated 2026-10-20 · 0 comments
The 1BRC study needs this. The fast programs read the station name at the start of a row as one 8-byte word (u64_le), then mask off everything from the ; onwards. ADR-320 D12 checks such a read the way it checks the cut b[i..<i+8]. In the last row of a file, a short name often lies less than 8 bytes before the end, so the program stops there. ADR-320 §5 had left the question open: should a word be read past the end, either filled with zeros or from a margin that std guarantees behind a mapping?
Checked:
fs::map maps exactly the file’s length (crates/nikaia-std/src/fs.rs).Bytes(v) does not exist yet; it is decided in #718.Options put to the owner:
fs::map guarantees.None of them. B grows std by four documented methods for one loop per program, and C is a platform promise the type would have to carry, against #718. The owner wants a manual way out, even if it is longer, without growing std:
Bytes(tail).Recorded in ADR-320 D13, with a short pointer in Part I’s text on word reads.
Bytes(v))tests/language/src/. It runs one function over a Bytes to its last row: once over the data up to a cut, and once over the padded copy of the rest. Its output must equal a byte-by-byte reading.fast.nika uses this pattern instead of a separate path for the end.