tests: shrink and regrow datasets allocated early
Datasets with early allocation and unlimited dimensions (Extensible Array, version-2 B-tree, version-1 B-tree under earliest), unfiltered and deflated: the random resize workload gives the values h5py gets and the same chunk index shape, with every chunk a growth brings in allocated and filled as H5D__chunk_allocate does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -717,6 +717,42 @@ fn shrink_matches_libhdf5() {
|
||||
false,
|
||||
99,
|
||||
);
|
||||
// Early allocation with unlimited dimensions (Extensible Array,
|
||||
// version-2 B-tree; version-1 B-tree under `earliest`), filtered and
|
||||
// not: growth allocates and fills every new chunk, as libhdf5 does.
|
||||
for (i, (lv, dump)) in [("'earliest'", true), ("'v110'", true), ("'latest'", false)]
|
||||
.iter()
|
||||
.enumerate()
|
||||
{
|
||||
for (j, (max, z)) in [
|
||||
("(None, 9)", ""),
|
||||
("(None, None)", ""),
|
||||
("(None, 9)", ", compression='gzip'"),
|
||||
("(None, None)", ", compression='gzip'"),
|
||||
]
|
||||
.iter()
|
||||
.enumerate()
|
||||
{
|
||||
shrink_workload(
|
||||
&format!("early_{i}_{j}"),
|
||||
lv,
|
||||
&format!(
|
||||
"\x20 f.create_dataset('x', data=np.arange(72, dtype='<i4').reshape(8, 9), \
|
||||
maxshape={max}, chunks=(3, 4), fillvalue=-4{z})\n\
|
||||
\x20 dcpl = f['x'].id.get_create_plist()\n\
|
||||
\x20 del f['x']\n\
|
||||
\x20 dcpl.set_alloc_time(h5d.ALLOC_TIME_EARLY)\n\
|
||||
\x20 h5d.create(f.id, b'x', h5t.STD_I32LE, \
|
||||
h5s.create_simple((8, 9), tuple(h5s.UNLIMITED if m is None else m for m in {max})), \
|
||||
dcpl=dcpl)\n\
|
||||
\x20 f['x'][...] = np.arange(72, dtype='<i4').reshape(8, 9)\n"
|
||||
),
|
||||
-4,
|
||||
*dump,
|
||||
200 + (i * 4 + j) as u64,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An implicit chunk index (early allocation, no filters, fixed maximum
|
||||
|
||||
Reference in New Issue
Block a user