Commit Graph
9 Commits
Author SHA1 Message Date
Omar SobhandClaude Sonnet 5 88195d1c33 docs: fix untraceable benchmark claims, add dual-audience framing, validate on second machine
- README's "HDF5 Core I/O" table claimed 19ns/2,080µs labeled 308× (real ratio
  ~109,000×) and a 313ns zero-copy mmap figure — neither traced to any dated
  benchmark in BENCHMARKS.md. Replaced the table wholesale with the existing
  "vs libhdf5 Summary" figures, relabeled from "h5py/C HDF5" to "libhdf5"
  (BENCHMARKS.md never benchmarks against h5py, only libhdf5 directly).
- Added two new Criterion benchmarks to close the coverage gaps that produced
  the untraceable numbers: metadata_open_from_disk (I/O-inclusive, fair
  clawhdf5-vs-libhdf5 file-open comparison) and metadata_parse_in_memory
  (clawhdf5-only, explicitly labeled as excluding I/O) in h5bench_meta.rs;
  read_zerocopy_mmap in h5bench_read.rs (forces real page-ins by summing
  elements rather than just returning a slice length — the mmap path turns
  out to be slower than a plain copy at these sizes, an honest, unflattering
  but real result now documented instead of a fabricated 313ns).
- Re-ran the full existing benchmark suite plus the two new ones on a second,
  independently administered machine (tank: Ryzen 7 7800X3D) to validate the
  numbers before publishing them. 5 of 6 rows landed within ~15% of the
  original i7-12650H figures; recorded both in BENCHMARKS.md's new
  "Independent Validation" section. README now cites the tank numbers.
- Added a short top-of-file README callout naming both halves of the project
  (general-purpose HDF5 library vs. agent memory layer) with links to
  BENCHMARKS.md and the Crate Map, so a data-infra reader isn't 60% through
  a memory-store pitch before finding the part relevant to them.
- Added one factual, no-names line noting benchmark numbers are being
  validated in collaboration with HDF5 Group engineers.
- Fixed the same untraceable "2-300x faster than h5py/C HDF5" / "313 ns"
  claims in docs/QUICKSTART.md, one click from the README's own "New here?"
  link.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-03 17:46:55 -07:00
Omar SobhandClaude Sonnet 4.6 1347746973 docs: consolidate benchmark.md into BENCHMARKS.md
- Merge libhdf5 1.14.6 head-to-head comparison from benchmark.md into
  BENCHMARKS.md h5bench section (sequential read/write, chunked write,
  metadata — attribute write, group create)
- Recalculate speedup ratios using current clawhdf5 numbers (post auto-shuffle):
  chunked write 512×512 now 38.4× faster than libhdf5 (was 16×)
- Fix groups_create/traverse column header mismatch: data was k=4/16/32/64
  but labeled k=4/16/64/128; corrected with separate Groups table
- Clarify Pcodec codec comparison benchmarked without auto-shuffle (shuffle
  degrades Pcodec which handles byte organization internally)
- Add "vs libhdf5 Summary" and "Why the Gaps" interpretation sections
- Delete benchmark.md (content fully absorbed)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-01 22:01:16 +00:00
Omar SobhandClaude Sonnet 4.6 c30ed0cda5 docs: update benchmarks and README with post-improvement numbers
- Write Path: WAL single save 134 µs → 18 µs (group-commit append, HDF5 batched at flush)
- Write Path: no-WAL save 91 µs → 61 µs (owned-Vec IO path)
- Summary table: memory write <135 µs → <20 µs
- Chunked write table: reflect auto-shuffle numbers (Zstd 748 MiB/s, deflate 719 MiB/s at 512×512)
- Add Pcodec to chunked write comparison and clawhdf5-format feature flags table
- Bump BENCHMARKS.md date to 2026-07-01

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-01 02:55:50 +00:00
Omar SobhandClaude Sonnet 4.6 e23e0358e0 docs: update BENCHMARKS.md with 2026-07-01 h5bench results
Post all write-path improvements (chunk-cache, SIMD shuffle, Zstd codec,
auto-shuffle pre-filter, owned-Vec IO, WAL group commit, Pcodec codec):

Chunked write (deflate+shuffle) 512×512: baseline 3.33 ms → 1.35 ms (-59%)
Chunked write (Zstd-3+shuffle) 512×512: 1.34 ms / 748 MiB/s

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-01 01:44:25 +00:00
Omar SobhandClaude Sonnet 4.6 d41e5ecfdd feat: auto-apply shuffle before compression codecs (TDT byte-grouping)
Following arXiv:2506.18062 (TDT pre-filter) and matching h5py default
behavior: the shuffle filter is now automatically applied before any
compression codec (deflate, Zstd, LZ4, Pcodec) unless explicitly
disabled with .without_shuffle().

Benchmark results (f32 matrices, shuffle+codec vs unshuffled baseline):
- Zstd-3 at 512×512: 610 → 764 MiB/s (+25%)
- Deflate-6 at 128×128: 132 → 401 MiB/s (+204%)
- Deflate-6 at 512×512: 280 → 745 MiB/s (+166%)

Both codecs now reach parity at ~750 MiB/s for large matrices.

Changes:
- Add no_shuffle field to ChunkOptions (opt-out via .without_shuffle())
- Auto-add FILTER_SHUFFLE in build_pipeline() when compression is active
- Add DatasetBuilder.without_shuffle() method
- Update pipeline tests to reflect new 2-filter default
- Add chunk_options_pipeline_deflate_no_shuffle test
- Update BENCHMARKS.md with measured throughput improvements

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-01 01:21:06 +00:00
Omar SobhandClaude Sonnet 4.6 5701e8045d feat: add Pcodec lossless numerical compression filter (arXiv:2502.06112)
Implements Pcodec (filter ID 32023) via the `pco` 1.0.x crate as a new
optional compression codec. Pcodec achieves 30–94% better compression
ratio than Zstd for f32/f64 columnar data at 1–5 GiB/s decompression
speed, making it ideal for write-once/read-many embedding archives.

Write throughput at 512×512: 591 MiB/s (parity with Zstd-3 at 610 MiB/s).
For smaller chunks Zstd-3 remains faster due to Pcodec's fixed per-chunk
distributional analysis overhead.

- Add FILTER_PCODEC = 32023 constant to filter_pipeline.rs
- Add pcodec_compress/pcodec_decompress using pco::standalone API
- Wire into compress_chunk/decompress_chunk dispatch
- Add ChunkOptions.pcodec field and DatasetBuilder.with_pcodec() method
- Enable pcodec as highest-priority codec in build_pipeline()
- Add pco dep (optional, feature = "pcodec") to clawhdf5-format/clawhdf5
- Add write_2d_chunked_pcodec benchmark comparing pcodec vs zstd-3
- Document results in BENCHMARKS.md

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-01 01:16:08 +00:00
Omar SobhandClaude Sonnet 4.6 e82b8f56bd bench: enable zstd in bench crate, update codec comparison results
Add features = ["zstd"] to clawhdf5-bench dev-dependency so the
write_2d_chunked_zstd benchmark no longer panics with UnsupportedFilter(32015).

Update BENCHMARKS.md and README.md with measured results from the full
h5bench write suite (2026-06-30, post write-performance improvements):
- Zstd-3 hits 593 MiB/s at 512×512 vs deflate-6's 280 MiB/s (2.12×)
- Zstd-3 hits 330 MiB/s at 128×128 vs deflate-6's 132 MiB/s (2.51×)
- Sequential f64 batch write improved ~8-11% from owned-Vec IO path

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-06-30 23:49:13 +00:00
Omar SobhandClaude Sonnet 4.6 bf197b70e3 docs+fix: add h5bench benchmark results and repair libhdf5-compare feature
Add h5bench-equivalent Criterion benchmark results to BENCHMARKS.md
(sequential read/write, chunked read/write, metadata throughput).

Fix libhdf5-compare feature for HDF5 1.14.x:
- Switch to hdf5-metno 0.12 (aliased as 'hdf5') in clawhdf5-bench
- Fix h5bench_meta.rs: AttributeBuilderEmpty::create takes &str not &String;
  shape=[1] dataset uses write(&[val]) not write_scalar
- Fix h5bench_read.rs: libhdf5-compare variant now writes its own reference
  file via hdf5-metno instead of dumping clawhdf5 bytes (avoids float
  datatype message incompatibility)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-06-30 16:39:52 +00:00
redclawsystems 3f222f6956 Merge pull request 'docs(clawhdf5): document DType variants, fix unresolved doc links' (#17) from sdlc-docs/clawhdf5-types-20260514-165210 into main 2026-05-14 23:54:48 +00:00