Skip to content

Add el-wise-op order regression tests#32

Merged
sigilante merged 1 commit into
mainfrom
sigilante/el-wise-op-test
May 30, 2026
Merged

Add el-wise-op order regression tests#32
sigilante merged 1 commit into
mainfrom
sigilante/el-wise-op-test

Conversation

@sigilante
Copy link
Copy Markdown
Collaborator

Summary

PR #21 fixed el-wise-op, which had flopped 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 through el-wise-op on [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 Hoon el-wise-op directly with nothing to mask a reversal.
  • test-abs-1x4-5rabs of [-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 flop and pass against current main.

🤖 Generated with Claude Code

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>
@sigilante sigilante merged commit 782c18f into main May 30, 2026
@sigilante sigilante deleted the sigilante/el-wise-op-test branch May 30, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant