jaxrens.io.max_neighbors_log

Per-iteration neighbor-bucket diagnostic log: HDF5 writer and reader.

Schema v1 (HDF5 root):
  • Dataset iterations shape (N,) int64

  • Dataset max_neighbor_count shape (N, n_runs, n_walkers) int32

  • Dataset bucket_size shape (N, n_runs) int32

  • Dataset overflow shape (N, n_runs) bool

  • Attribute n_runs int

  • Attribute n_walkers int

  • Attribute max_neighbors_log_schema_version = 1

The full per-walker distribution is stored so postprocessing can plot the spread (min / max / quantiles, or a 2-D heatmap of count-vs-iteration). Bucket-size and overflow are kept for diagnostic clarity — together they let a reader see exactly how the outer loop’s bucket-ladder management chased the observed peak, including the brief overflow blips that triggered each upgrade.

A typical NS run with n_live=500 and n_runs=1 over 10 000 iterations produces ~20 MB int32 — well within “always cheap” territory. The file is opt-in via OutputConfig.save_max_neighbors so default runs see no I/O.

Classes

MaxNeighborsLog

Parsed neighbor-bucket trace loaded from a .max_neighbors.h5 file.

MaxNeighborsLogger

Append-only HDF5 writer for per-iteration neighbor-bucket diagnostics.