Exclude fixed region policy chunk from payload frontier
This commit is contained in:
parent
a1cd21549a
commit
0bb7d44f82
2 changed files with 61 additions and 6 deletions
|
|
@ -13285,6 +13285,39 @@ fn parse_save_region_record_triplet_probe(
|
|||
.iter()
|
||||
.filter(|entry| !entry.pre_name_prefix_dword_candidates.is_empty())
|
||||
.count();
|
||||
let records_with_any_nonzero_policy_reserved_dword = entries
|
||||
.iter()
|
||||
.filter(|entry| {
|
||||
entry
|
||||
.policy_reserved_dwords
|
||||
.iter()
|
||||
.any(|raw_u32| *raw_u32 != 0)
|
||||
})
|
||||
.count();
|
||||
let policy_reserved_nonzero_counts = (0..3)
|
||||
.map(|dword_index| {
|
||||
entries
|
||||
.iter()
|
||||
.filter(|entry| entry.policy_reserved_dwords[dword_index] != 0)
|
||||
.count()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let unique_nonzero_policy_reserved_triplets = entries
|
||||
.iter()
|
||||
.filter_map(|entry| {
|
||||
let triplet = [
|
||||
entry.policy_reserved_dwords[0],
|
||||
entry.policy_reserved_dwords[1],
|
||||
entry.policy_reserved_dwords[2],
|
||||
];
|
||||
triplet
|
||||
.iter()
|
||||
.any(|raw_u32| *raw_u32 != 0)
|
||||
.then_some(triplet)
|
||||
})
|
||||
.collect::<BTreeSet<_>>()
|
||||
.into_iter()
|
||||
.collect::<Vec<_>>();
|
||||
let unique_pre_name_prefix_lens = entries
|
||||
.iter()
|
||||
.map(|entry| entry.pre_name_prefix_len)
|
||||
|
|
@ -13318,6 +13351,13 @@ fn parse_save_region_record_triplet_probe(
|
|||
records_with_prefix_dword_candidates,
|
||||
record_count
|
||||
),
|
||||
format!(
|
||||
"fixed 0x55f2 policy reserved dwords are nonzero on {} of {} decoded region records, with per-word nonzero counts {:?} and unique nonzero triplets {:?}",
|
||||
records_with_any_nonzero_policy_reserved_dword,
|
||||
record_count,
|
||||
policy_reserved_nonzero_counts,
|
||||
unique_nonzero_policy_reserved_triplets
|
||||
),
|
||||
format!(
|
||||
"on grounded saves the 0x55f3 payload is fully consumed by that embedded profile collection: all {} decoded records currently have zero trailing padding beyond the direct profile rows",
|
||||
zero_trailing_padding_record_count
|
||||
|
|
@ -23925,6 +23965,9 @@ mod tests {
|
|||
bytes[cursor + 4..cursor + 8].copy_from_slice(&120.0f32.to_bits().to_le_bytes());
|
||||
bytes[cursor + 8..cursor + 12].copy_from_slice(&3.0f32.to_bits().to_le_bytes());
|
||||
bytes[cursor + 12..cursor + 16].copy_from_slice(&60.0f32.to_bits().to_le_bytes());
|
||||
bytes[cursor + 16..cursor + 20].copy_from_slice(&0x01020304u32.to_le_bytes());
|
||||
bytes[cursor + 20..cursor + 24].copy_from_slice(&0u32.to_le_bytes());
|
||||
bytes[cursor + 24..cursor + 28].copy_from_slice(&0x05060708u32.to_le_bytes());
|
||||
bytes[cursor + 28..cursor + 30].copy_from_slice(&1u16.to_le_bytes());
|
||||
cursor += 0x1e;
|
||||
bytes[cursor..cursor + 2].copy_from_slice(&SAVE_REGION_RECORD_PROFILE_TAG.to_le_bytes());
|
||||
|
|
@ -23990,6 +24033,17 @@ mod tests {
|
|||
triplet_probe.entries[1].policy_reserved_dword_candidates[2].relative_offset_hex,
|
||||
"0xcc"
|
||||
);
|
||||
assert_eq!(
|
||||
triplet_probe.entries[1].policy_reserved_dword_candidates[0].raw_u32_hex,
|
||||
"0x01020304"
|
||||
);
|
||||
assert_eq!(
|
||||
triplet_probe.entries[1].policy_reserved_dword_candidates[2].raw_u32_hex,
|
||||
"0x05060708"
|
||||
);
|
||||
assert!(triplet_probe.evidence.iter().any(|line| line.contains(
|
||||
"fixed 0x55f2 policy reserved dwords are nonzero on 1 of 2 decoded region records"
|
||||
)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue