Changelog

Version 1.2.0

  • New search and density tools: query_ball finds all neighbours within a supplied radius; KDE estimates weighted densities with fixed or adaptive bandwidths; the custom reductions interface accumulates neighbour contributions without storing full neighbour lists, which can notably reduce memory usage for certain applications, with support for gradients.

  • Bounding boxes: tree nodes now use fitted bounding boxes instead of Morton cells, improving speed in most cases and making searches less prone to edge cases. Custom tree walks can use these bounds too. Tree regularization stays on by default for kNN, where it still helps strongly concentrated distributions.

  • Error handling: runtime and allocation errors now raise catchable Python exceptions on single and multiple GPUs, with all ranks raising the same error. jz.apply_fix and jz.run_with_fixes can increase insufficient allocations automatically.

  • Bug fixes: fix cases in version 1.1 that could silently return wrong FoF groups when many ranks requested particles from the same rank, or wrong kNN neighbours when using separate query points.

New capabilities

  • FoF catalogues: velocity-bearing particle data now also produces the one-dimensional velocity dispersion (vel_disp), and light-cone radial velocities produce v_rad_disp.

  • Radius queries: query_ball accepts a scalar or per-query radius and returns packed neighbour indices and offsets, including neighbours on the boundary. QueryBallConfig.alloc_fac_neighbours controls output capacity; insufficient capacity raises a fixable error instead of truncating the results.

  • Kernel density estimation: jztree.kde.kde supports 2D and 3D, self or separate query points, source- or query-owned fixed/adaptive support radii, and normalized polynomial, spline and truncated Gaussian kernels. Weights can be scalar or have 1–10 components. Reverse-mode gradients cover positions, weights and bandwidths. Self contributions are excluded by default, but self still counts toward the adaptive bandwidth’s neighbour count; explicit query points require exclude_self=False.

  • Neighbour reductions: knn_reduction and query_ball_reduction accumulate directly in CUDA without full neighbour-list outputs. They support gather/scatter operations and custom reductions with optional reverse-mode derivatives.

  • Compact kNN outputs: allocate only the requested outputs, including just the kth-neighbour radius/index (rmax, imax, rmax_imax) or differentiable kth distance (drmax). The default output is unchanged.

Upgrading from 1.1

  • Upgrade the Python package and CUDA backend together. Source installations need a rebuild for the new bindings.

  • Existing calls through .jit(...) and .smap(mesh, jit=True)(...) keep the same usage. If you construct your own JIT wrappers, configurations now distinguish static compilation choices from runtime values; do not mark the whole config static or rely on hashing it.

  • Multi-GPU kNN and FoF now allocate communication buffers separately from the local tree. Use alloc_fac_comm_nodes (default 1.5) and alloc_fac_comm_particles (default 1.25) for received nodes and particles; cfg.tree.alloc_fac_nodes controls the local tree. The kNN defaults are now cfg.tree.alloc_fac_nodes=1.1 and alloc_fac_ilist=200. Previously tuned allocations may need adjusting; failed checks identify the setting to increase.

  • Allocation failures now raise catchable errors instead of allowing buffer overflows or leaving peer ranks waiting. Use jz.apply_fix or jz.run_with_fixes to grow configuration-controlled buffers. Input padding normally remains the caller’s responsibility; setting cfg.extra_pad_fac enables automatic internal padding, at the cost of an extra particle copy. See the error handling guide.

  • Tree regularization remains enabled by default for kNN and disabled for FoF. Bounding boxes do not eliminate its benefit for concentrated distributions. To disable it explicitly, set cfg.tree.regularization = None.

  • Opt-in JAX GPU communication workarounds are available for affected distributed runs; apply them before backend initialization. See known issues.

  • Source builds now target the native GPU by default and respect explicit CUDA architecture settings. Non-editable wheels now include jztree_utils.

Correctness fixes

  • Fix silently wrong multi-GPU results when too many particles or nodes are requested from one rank. Insufficient communication capacity now raises an allocation error rather than substituting particle data.

  • Fix missing or incorrectly sized leaves in trees with separate source/query populations, which could return wrong neighbours. Also fix searches on small trees, including inputs that fit into a single leaf.

  • Fix multi-pass kNN tie handling and periodic differentiable neighbour distances. Differentiation continues to hold neighbour selection fixed.

  • Preserve FoF links involving wide source nodes and handle coincident particles correctly when constructing the tree.

  • Preserve the input dtype in FoF catalogue accumulation. Large float32 groups can still show summation-order differences between device partitions.

  • Fix distributed varying-axis handling, including already-varying arrays and mixed pytrees, and support explicit multi-slice meshes in the DISCO-DJ particle helper.

Performance comparison

Morton nodes (old, dashed) versus bounding boxes (new, solid), using identical inputs on one A100. kNN uses k=16; FoF includes catalogue construction for a cosmological distribution with linking length 0.2 times the mean particle spacing. Curves show mean runtime and one standard deviation over ten synchronized calls, excluding compilation, warm-up and input generation. Measurements use our jax-fixes baseline, before the subsequent interface changes; the new FoF curve was remeasured after restoring input-dtype catalogue accumulation.

kNN performance

Cosmological FoF performance

Effect of the new bounding boxes and of regularization: the same kNN benchmark (k=16, five distributions, one A100, N from 8.5e4 to 1e8) for four variants. The old tree with Morton nodes (dashed) without and with regularization (the old default), and the new tree with bounding boxes (solid) without and with regularization (the default). The lower panels show the difference to the default. Adding bounding boxes speeds up all distributions, and it removes the order-of-magnitude slowdown that a Gaussian shows with Morton nodes and no regularization. Regularization stays on by default in kNN: on top of bounding boxes it makes little difference for grid, uniform and cosmological particles (it costs 2-8%), but it still reduces the run time for a Gaussian by 14-62%. “Old” is the complete pre-1.2.0 tree, not a bounding-box-only ablation.

kNN regularization check

Version 1.1.0

  • Added TreeHierarchy.poslvl() for accessing node positions and levels.

  • Added separate query/source indexing for interaction lists, including updated CUDA bindings. The Python interface and CUDA backend must be upgraded together.

  • Improved shard-map context detection, including single-device mapped contexts, and fixed multi-GPU edge cases.

  • Fixed integer dtype consistency with JAX x64 enabled and added validation and tests.

  • Explicitly blocked gradients through tree construction.

  • Fixed mass-centering for dimensions other than three.

  • Extended initial-condition helpers, statistics, and array utilities.

  • Configurations now use slots: assigning an unknown parameter raises an error instead of silently adding an unused attribute. Existing parameters remain mutable.

  • CUDA 12 release wheels now target manylinux_2_28 (Linux x86-64, glibc >=2.28), matching CUDA 13.

Version 1.0.3

  • Updated .vma access to support jax 0.10

  • Fixed issue with CUDA_MAJOR version detection for source builds

  • Added source links to documentation

Version 1.0.2

Initial stable release