Huge chunks: selection tests with fill values, LZ4 over 256 MiB, wasm32 check
A selection of a chunked dataset with a fill value is compared with the full read in every index, through a map and through positioned reads. An LZ4 chunk larger than 256 MiB is bounded by the chunk size, not refused. The wasm package test reads the 4 GiB-chunk fixture and gets a clean error in every index. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -500,6 +500,20 @@ async function limitTests() {
|
||||
await fails(() => pkg.openUrl("http://huge.invalid/x.h5", { fetch: mockFetch(farBytes, { total }) }),
|
||||
total > 2 ** 53 ? /2\^53 - 1/ : /4 GiB/, `length ${total}`);
|
||||
}
|
||||
|
||||
// Nor can it hold a chunk of 4 GiB or more (HDF5 2.0, layout message
|
||||
// version 5): the file opens and lists, and reading such a chunk is an
|
||||
// error naming the size, in every chunk index.
|
||||
const hugeChunks = join(import.meta.dirname, "..", "..", "..",
|
||||
"crates/clawhdf5/tests/fixtures/huge_chunks_filtered.h5");
|
||||
const hc = pkg.open(new Uint8Array(readFileSync(hugeChunks)));
|
||||
eq(hc.list("/").map((e) => e.name), ["btree2", "earray", "farray", "single"], "huge chunks: list");
|
||||
for (const name of ["single", "farray", "earray", "btree2"]) {
|
||||
const [start, count] = name === "btree2" ? [[0, 0], [1, 4]] : [[0], [4]];
|
||||
await fails(() => hc.readHyperslab(`/${name}`, start, count), /exceeds the addressable size/,
|
||||
`huge chunk: ${name}`);
|
||||
}
|
||||
hc.free();
|
||||
}
|
||||
|
||||
// A body of `total` bytes in 64 KiB pieces, made as they are read; `pulled()`
|
||||
|
||||
Reference in New Issue
Block a user