Upgrade SZ3 to v3.4.0; bound the header parse in decompress_config #16
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.66) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 398 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #16"
general
weight: 0.35
juntyr
Upgrades SZ3 to v3.4.0 and bounds the header and trailer parse in
decompress_config, and passes SZ3's errors to Rust. Five commits.1. Bound the header parse (fd536d8)
decompress_configreadcmpDataSizeout of the buffer and stepped over it unchecked, so a corrupted or truncated stream sentcmpConfPospast the end of the allocation (ASan: heap-buffer-overflow inSZ3::read, reproduced against the pinnedc9a428b2with a 32-byte buffer declaring a 1000-byte payload). It now checks that the buffer holds a header and that the declared payload fits.2. Upgrade SZ3 to v3.4.0 (bee8b09)
sz3-sys/SZ3to v3.4.0 (592df79);sz3andsz3-systo0.5.0+SZ3-3.4.0.decompress_configpassesConfig::loadthe bytes left after the payload. 3.4.0 requires the length, and it bounds the trailer read too. A config that fails to load returns the "unreadable" sentinel instead of throwing across the FFI.N = 0, num = 0) now also carries a data type no element type has, sodecompress()returnsErr(DecompressedDataTypeMismatch)instead of handing the buffer to SZ3 (Copilot's review point). Checked: an oversized payload and a truncated trailer both returnErr; an intact stream decompresses.ALGO_BIOMDXTC: its encoder was adapted from GROMACS'slibxdrf.cppunder the LGPL, and SZ3 is now BSD only (szcompressor/SZ3#183).CompressionAlgorithmlosesBiologyMolecularDataGromacsXtcandbiology_molecular_data_gromacs_xtc(), the test matrix loses itsbiomdxtccase and the doubled bound it needed. The enum is#[non_exhaustive], but removing a variant is still breaking, hence 0.5.0, as 0.4.0 did for the removed regression options.ALGO_BIOMDis a new codec that takes coordinates{frames, atoms, 3}(or{atoms, 3}) only and throws otherwise, so thebiomdtests shape the test data as{64, atoms, 3}.3. Address review (8852f76)
{64, 192, 3}, and the wrapper comment reads as suggested..gitmodulesno longer tracks the SZ3 branchsz3-rs.4. Check the ALGO_BIOMD shape in Rust (cd2733b)
compressreturnsSZ3Error::BiologyMolecularDataShape { dims }for anything but{atoms, 3}or{frames, atoms, 3}, before SZ3 sees the data.5. Pass SZ3's errors to Rust with their kind and message (fd9025a)
SZ3_ErrorKindand, on an error, sets an out pointer to a copy of the exception's message, which Rust copies and frees throughfree_error_message. No exception crosses the FFI.SZ3Error::InternalError { kind, message }, withkindanInternalErrorKind(InvalidArgument,OutOfRange,Runtime,OutOfMemory,Other).decompress_configreturns an error for data shorter than its header, a payload length past the end, and a config that fails to load, and fills the config through an out pointer; the unreadable sentinel from commit 2 is gone.Tests
Locally (Linux, GCC 13, stable Rust):
cargo test --all-features4684 passed, without features 2344 passed, doctests pass,cargo fmt --checkclean.