From 415dc1f5ed49495e0ae7b78b1b1f98f5e8452900 Mon Sep 17 00:00:00 2001 From: "T. Fuchs" Date: Mon, 10 Aug 2026 13:54:47 -0400 Subject: [PATCH 01/33] test: pin the pixel-subdivision path against an independent reference Golden digests fail across compilers, so the adaptive rule is reimplemented in Python and compared record for record at depths 0-4. --- .gitignore | 3 + .../benchmark_reconstruction_subdivision.py | 390 ++++++++++++ .../test/test_reconstruction_subdivision.py | 581 ++++++++++++++++++ 3 files changed, 974 insertions(+) create mode 100644 benchmarks/benchmark_reconstruction_subdivision.py create mode 100644 orgui/datautils/xrayutils/test/test_reconstruction_subdivision.py diff --git a/.gitignore b/.gitignore index 15a3129..eabe4d1 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ subprojects/.wraplock orgui.egg-info/ orgui/_version.py benchmarks/roi_sum_results.json +# Fingerprint/timing baselines are captured per build and per machine, and +# are only meaningful compared against themselves. +benchmarks/baselines/ **/.ipynb_checkpoints/ # Packages # diff --git a/benchmarks/benchmark_reconstruction_subdivision.py b/benchmarks/benchmark_reconstruction_subdivision.py new file mode 100644 index 0000000..69054b4 --- /dev/null +++ b/benchmarks/benchmark_reconstruction_subdivision.py @@ -0,0 +1,390 @@ +"""Depth-sweep cost and output fingerprints for the pixel-subdivision path. + +Two jobs in one tool: + +- **Cost.** Coordinate evaluations, leaves and nanoseconds per valid pixel at + each ``max_depth``, for both stationary and continuous exposures. This is + what shows the shared-corner cache switching off above depth three. +- **Fingerprints.** XXH3-128 of every output array, so a restructuring of the + subdivision can be held to producing bit-identical records. Capture a + baseline before changing anything, then ``--compare`` against it. + +Fingerprints are only comparable within one build on one machine: floating +point contraction differs between compilers, so a mismatch against a baseline +captured elsewhere means nothing. That is why this lives in ``benchmarks`` +rather than the test suite, where +``test/test_reconstruction_subdivision.py`` covers portable behaviour against +an independent reference implementation instead. + +Runs against the synthetic geometry by default, or a prepared job with +``--job``. + +**Run this with ``PYTHONPATH`` pointing at the checkout.** ``python +benchmarks/