format: decode selected chunks into reusable buffers

A selection read (a hyperslab or points covering at most half the
dataset) decoded each chunk it overlaps into fresh buffers, one per
filter stage; it now uses the thread's chunk-decoding scratch like the
full readers. Covered by tests/chunked_read_paths_interop.rs (small
hyperslabs and points over every filter and type) and the partial-read
equivalence tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 10:20:07 -05:00
co-authored by Claude Opus 5.5
parent 9e9b849dd7
commit 9e608b975c
2 changed files with 52 additions and 49 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ use crate::lane_partition::PartitionStats;
/// [`DecodeScratch`]), kept between reads so decoding reuses memory instead
/// of faulting in fresh pages for every chunk. A re-entrant call (a
/// registered filter codec that itself reads a file) gets a fresh scratch.
fn with_scratch<R>(f: impl FnOnce(&mut DecodeScratch) -> R) -> R {
pub(crate) fn with_scratch<R>(f: impl FnOnce(&mut DecodeScratch) -> R) -> R {
#[cfg(feature = "std")]
{
use std::cell::RefCell;