Add el-wise-op order regression tests#32
Merged
Conversation
PR #21 fixed el-wise-op, which had flopped the raveled element list and so reversed every Hoon-only transcendental (exp/sin/cos/tan/abs) for arrays with more than one element. That fix shipped without a test in the suite (it was validated with a throwaway generator), so the bug could silently return. Add two regression tests to lagoon-single-args: - test-el-wise-op-order-5r: identity through el-wise-op on [1 2 3 4] must return [1 2 3 4] (the purest order check; identity has no jet to mask a Hoon reversal). - test-abs-1x4-5r: abs of [-1 2 -3 4] must return [1 2 3 4]; distinct magnitudes and mixed signs make any reversal visible in the public single-arg path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
PR #21 fixed
el-wise-op, which hadflopped the raveled element list ("compensate for LSB") and so reversed every Hoon-only transcendental (exp/sin/cos/tan/abs) for arrays with more than one element. That fix shipped without a regression test in the suite — it was validated with a throwaway generator — so the bug could silently come back.Tests (added to
lagoon-single-args)test-el-wise-op-order-5r— identity throughel-wise-opon[1 2 3 4]must return[1 2 3 4], not[4 3 2 1]. This is the purest order check: the identity gate has no jet, so it exercises the Hoonel-wise-opdirectly with nothing to mask a reversal.test-abs-1x4-5r—absof[-1 2 -3 4]must return[1 2 3 4]. Distinct magnitudes and mixed signs make any reversal visible through the public single-arg path.Both fail against the pre-#21
flopand pass against currentmain.🤖 Generated with Claude Code