Step 10 at https://subspace.github.io/protocol-specs/docs/consensus/proof_of_archival_storage#plotting-to-disk says:
Once all records are encoded, write the sector to disk, one s-bucket at time in order of the index, each followed by encoded_chunks_used bitfield corresponding to selected chunks.
It doesn't write things like that though, in fact step 11 (correctly) contradicts step 10.
It needs to either be rewritten or removed.