pub fn write_n_rails<W: Write>(w: &mut W, n: usize) -> Result<()>
2026-09-26: Write the rail count as one byte.