Repository navigation
delaunay_nn: assert single-pass parity, chunk invariance and the chunk env override - #307
Merged
Merged
Conversation
…k env override `jax_delaunay_nn` now runs the data grid and its own split-cross points through ONE concatenated Sibson pass (PyAutoArray#533), and `query_chunk` is documented as a pure memory guard settable from the environment. The JAX assertion gate did not cover either claim, so this extends it with: * single-pass parity — the concatenated pass is compared against `jax_sibson` run separately on the data grid and on `jax_delaunay_nn`'s own split points, with both halves required to be element-for-element identical (NaN-aware, so deliberate overflow/degeneracy NaNs cannot make the check vacuous); * chunk invariance — `query_chunk` 64 / 256 / 1024 via the kwarg must give bit-identical tables on all six outputs; * the `PYAUTO_SIBSON_QUERY_CHUNK` override — checked in a fresh subprocess, since the library reads it once at import, and asserted to reach `DelaunayNN.query_chunk`. The parent-side assert compares against the library's own `SIBSON_QUERY_CHUNK` rather than a literal, so the accelerator-chosen default can change without breaking this gate. Existing checks are all retained; the new ones cost +8.4s. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5HT8dp7sWc9qDhZp6moGr
This was referenced Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jax_delaunay_nnnow runs the data grid and its own 4N split-cross pointsthrough one concatenated Sibson pass, and
query_chunkis documented as apure memory guard that can be set from the environment
(PyAutoLabs/PyAutoArray#533, DelaunayNN Sibson Phase A). Neither claim was
covered by the JAX assertion gate — the script timed the new path but asserted
nothing about it. This extends
scripts/misc/jax_assertions/delaunay_nn.pywith the three checks that pin the behaviour the launch-count cut depends on.
Single-pass parity. The concatenated
jax_delaunay_nnoutputs are comparedagainst
jax_sibsonrun separately on the data grid and onjax_delaunay_nn's own returned split points, so both sides see identicalcoordinates, caps and chunk. Both halves must be element-for-element identical
across all six outputs (
mappings,sizes,weights,cavity_sizes,overflow,degenerate). The comparison is NaN-aware: overflow and Watsondegeneracy deliberately produce NaN weights, so a plain
==check would passon any pair of NaN tables and fail on a legitimately NaN one.
Chunk invariance.
query_chunksets thejax.lax.mapblock size andguards the
(C, 3, 2)intermediates only, so 64 / 256 / 1024 passed via thekwarg must give bit-identical tables on all six outputs.
Env override.
PYAUTO_SIBSON_QUERY_CHUNKis read once at import, so it canonly be proven in a fresh interpreter: the gate spawns one short subprocess
with
PYAUTO_SIBSON_QUERY_CHUNK=64and asserts it reachesaa.mesh.DelaunayNN.query_chunk. The parent first asserts the variable isunset in its own environment (an inherited value would silence the check),
and the parent-side assert compares
DelaunayNN.query_chunkagainst thelibrary's own
SIBSON_QUERY_CHUNKrather than a literal — so theaccelerator-chosen default can change without breaking this gate.
Every existing check (linear precision, gradients, diagonal-flip continuity,
jitted
vmapthrough the qhull callbacks, the warm-runtime comparison) isretained. The new checks cost +8.4 s.
Scripts Changed
scripts/misc/jax_assertions/delaunay_nn.py— added single-pass parity(
jax_delaunay_nnconcatenated vsjax_sibsonrun separately on the datagrid and the split points, both halves exact, NaN-aware),
query_chunkinvariance at 64/256/1024 via the kwarg, and a subprocess check that
PYAUTO_SIBSON_QUERY_CHUNK=64reachesDelaunayNN.query_chunk; new summarylines for all three (+162/−1).
Upstream PR
PyAutoLabs/PyAutoArray#533
Library-first merge gate. This PR must merge after PyAutoArray#533. The
env-override check needs
PYAUTO_SIBSON_QUERY_CHUNKand the single-pass paritycheck needs the concatenated
jax_delaunay_nn; againstmainautoarray thescript fails until #533 lands.
Test Plan
scripts/misc/jax_assertions/delaunay_nn.pyrun directly against thePhase A worktree — PASS, 29.0 s wall. New summary lines:
-
single-pass parity: data half 6/6 identical (15000 queries), split half 6/6 identical (4800 split points) in 1.170s-
chunk invariance: chunks (64, 256, 1024) identical on 6/6 outputs in 3.423s; PYAUTO_SIBSON_QUERY_CHUNK=64 -> DelaunayNN.query_chunk=64 (default 256) in 0.250s(
run_python.py autolens_workspace_test scripts --list … --report-dir …,the
.github/scripts/run_smoke.pyrecipe) —scripts/misc/jax_assertions/delaunay_nn.py ... PASS (31.0s), exit 0.Already listed in
smoke_tests.txt.black --checkclean.Readiness
Heart is YELLOW on organism-scope workspace validation (cloud run
34099198772), unrelated to this change; acknowledged before shipping.
Closes part of PyAutoLabs/PyAutoArray#532.
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B5HT8dp7sWc9qDhZp6moGr