Record a defect packet slicing found: the tie block terminator is early
Range measured: every tie LOD block on the disc, 2,177 blocks. The last packet's end is known two ways. Its length comes from its record's packet_quadwords, and every other record's length is confirmed by the next record's pointer -- so only the last packet of each table is unconfirmed. Comparing its computed end against where parse_tie_block stopped: the last packet's computed end lands 2 to 16 bytes past the located 0xf6, on all 2,150 blocks measured. Two readings fit. Either the terminator was located too early -- inside the last packet's data -- or the last packet's length over-predicts by a small amount. The first is likelier: a length error on the last record of every table would have to be a coincidence. Neither is settled here, and the test asserts the measurement rather than the reading. Why the existing test missed it: "2,177 of 2,177 blocks end on 0xf6" is satisfied by a false terminator exactly as well as a true one -- it checks that the byte found IS a 0xf6, not that it is the block's end. A test that confirms the shape it walked to will pass on the wrong byte. The cost: the block extent is short by that much, so payload and padding under-report and anything computed from them is correspondingly short. The block starts are unaffected and RAM-confirmed. Recorded as a limitation with the measurement attached, not fixed. A terminator packet data cannot imitate is its own task, and guessing one would be the plausible-sounding alternative this project has been bitten by. A packets() accessor was tried and removed for the same reason: with the extent short it silently yields the wrong answer, and an API that is quietly wrong is worse than no API.
This commit is contained in:
@@ -372,6 +372,12 @@ pub struct TieBlock<'a> {
|
||||
/// The 16-byte header.
|
||||
pub header: TieBlockHeader,
|
||||
/// Bytes from `0x10` up to and including the terminator.
|
||||
///
|
||||
/// **This is short.** The `0xf6` the walk stops at lies inside the last
|
||||
/// packet's data, an even 2 to 16 bytes before that packet's computed end,
|
||||
/// so the block's real extent runs past it. `tie_block_payload_divides_
|
||||
/// into_contiguous_packets` measures this; finding a terminator packet
|
||||
/// data cannot imitate is its own task.
|
||||
pub payload: &'a [u8],
|
||||
/// Zero bytes between the terminator and the next block.
|
||||
pub padding: &'a [u8],
|
||||
|
||||
Reference in New Issue
Block a user