Repository navigation
Retire the Python-to-Rust parity tests and port tooling - #1492
Merged
Merged
Conversation
negpy_core is the source of truth for CPU pixels. Tests that rebuilt the old NumPy/cv2 pipeline to compare against now pin the Rust output by its SHA-256 (tests/core_pin.py) on the same fixed inputs. Pins run on Linux x86-64, where they were recorded; test_core_same_bits stays the check every release OS must match. Kernels it already pins (usm, sabattier, lith, carrier) lose their copy-based tests outright. Tests that read a recorded corpus from one maintainer's disk go: no contributor can run them. Direct oracles against one cv2 or NumPy call, behaviour checks and one-line NumPy comparisons stay.
The port is done and negpy_core is the reference, so the tools that compared it with the old Python go: replay and bench (scripts/replay.py, make replay/bench), the port manifest (manifest.toml, core_manifest.py, their test) and LEDGER.md. CLAUDE.md and CONTRIBUTING.md describe how a kernel stays pinned instead of how a port matches Python.
The cyanotype pin failed on CI's Linux runner: its input came from a float32 power, which NumPy computes through SVML on some CPUs and libm on others, so the input bytes differed. Pin inputs in cyanotype, zones, inpaint, IR gammas and autocrop now come from multiplies and a polynomial wave (core_pin.wave) instead of np.sin, np.tan, np.log and **.
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
negpy_core is now the source of truth for CPU pixels (#1489). This removes what only existed to compare it with the replaced Python, and anything that no contributor can run.
tests/test_core_*.pyfiles rebuilt the old NumPy/cv2 pipeline to compare against. Those tests now pin the Rust output by its SHA-256 (tests/core_pin.py) on the same fixed inputs.test_core_finish.pygoes:test_core_same_bitsalready pins the carrier.linux_pin), where they were recorded: some pinned paths run NumPy steps whose transcendentals differ by CPU.test_core_same_bitsstays the check that every release OS must match.scripts/replay.py,make replay/make bench,negpy_core/manifest.toml,scripts/core_manifest.pywith its test, andnegpy_core/LEDGER.md.nativeCI job drops the deleted file.Pin inputs come from exact arithmetic (
core_pin.wave, multiplies), notnp.sin,np.logor**: NumPy computes those through SVML on some CPUs and libm on others. Tests whose shared RNG made inputs depend on test order (lab, altprocess, inpaint, seam) now seed their own generator, so their pins hold in any order.Test plan
tests/test_core_*.pyand related suites: 3213 passed, also in random ordermake rust,make lint,make type