h5rs tools, browser reader, libhdf5 header checks, plugin filters, concurrency benchmark #14

Merged
osobh merged 60 commits from feat/p1-proof into main 2026-09-26 13:14:39 +00:00
3 changed files with 20 additions and 5 deletions
Showing only changes of commit b58d61cfb7 - Show all commits
+10 -3
View File
@@ -166,9 +166,16 @@ fn check_file(dir: &Path, file: &str, exp: &Value) {
for (path, want) in exp["datasets"].as_object().unwrap() { for (path, want) in exp["datasets"].as_object().unwrap() {
let kind = want["kind"].as_str().unwrap(); let kind = want["kind"].as_str().unwrap();
let a = r let a = match (r.read(path, None), want["unavailable"].as_str()) {
.read(path, None) (Ok(a), _) => a,
.unwrap_or_else(|e| panic!("{file}:{path}: {e}")); // A filter this build may lack (zstd: the wasm build has it
// off, a workspace build may unify it on) must fail clearly.
(Err(e), Some(why)) => {
assert!(e.contains(why), "{file}:{path}: {e}");
continue;
}
(Err(e), None) => panic!("{file}:{path}: {e}"),
};
assert_eq!(a.shape, shape(&want["shape"]), "{file}:{path} shape"); assert_eq!(a.shape, shape(&want["shape"]), "{file}:{path} shape");
let (got_kind, got) = data_strings(&a.data); let (got_kind, got) = data_strings(&a.data);
assert_eq!(got_kind, kind, "{file}:{path} kind"); assert_eq!(got_kind, kind, "{file}:{path} kind");
+4 -2
View File
@@ -175,10 +175,12 @@ def describe(path):
walk(key.rstrip("/") + "/" + n, o) walk(key.rstrip("/") + "/" + n, o)
elif obj.dtype.names: elif obj.dtype.names:
expected["errors"][key] = "compound" expected["errors"][key] = "compound"
elif key == "/zstd":
expected["errors"][key] = "unsupported filter: 32015"
else: else:
expected["datasets"][key] = entry(obj, slab_for(obj)) expected["datasets"][key] = entry(obj, slab_for(obj))
if key == "/zstd":
# Refused by the wasm build (no zstd); a native build
# that unifies in clawhdf5-format/zstd reads it.
expected["datasets"][key]["unavailable"] = "unsupported filter: 32015"
walk("/", f) walk("/", f)
return expected return expected
+6
View File
@@ -69,6 +69,12 @@ for (const [name, exp] of Object.entries(expected)) {
for (const [path, want] of Object.entries(exp.datasets)) { for (const [path, want] of Object.entries(exp.datasets)) {
const ctx = `${name}:${path}`; const ctx = `${name}:${path}`;
eq(file.kind(path), "dataset", `${ctx} kind`); eq(file.kind(path), "dataset", `${ctx} kind`);
if (want.unavailable) {
// The wasm build has no zstd (it links C): a clear error, no data.
assert.throws(() => file.read(path), (e) => e.message.includes(want.unavailable), ctx);
checks++;
continue;
}
const info = file.info(path); const info = file.info(path);
eq([...info.shape, ...info.elementShape], want.shape, `${ctx} info shape`); eq([...info.shape, ...info.elementShape], want.shape, `${ctx} info shape`);
const r = file.read(path); const r = file.read(path);