Skip to content

Conversation

@bezirg
Copy link
Contributor

@bezirg bezirg commented Nov 19, 2025

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@bezirg bezirg changed the title Bezirg/derive eq Add deriveEq for Plinth similar to deriving stock Eq Nov 19, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

Execution Budget Golden Diff

f96714c (master) vs 97a7b4b

output

plutus-benchmark/cardano-loans/test/9.6/main.golden.eval

Metric Old New Δ%
Flat Size 8_666 8_673 +0.08%

plutus-benchmark/coop/test/9.6/certMpBurning.golden.eval

Metric Old New Δ%
Flat Size 8_031 8_035 +0.05%

plutus-benchmark/coop/test/9.6/certMpMinting.golden.eval

Metric Old New Δ%
Flat Size 8_554 8_558 +0.05%

plutus-benchmark/coop/test/9.6/fsMpBurning.golden.eval

Metric Old New Δ%
Flat Size 7_395 7_399 +0.05%

plutus-benchmark/coop/test/9.6/fsMpMinting.golden.eval

Metric Old New Δ%
Flat Size 9_213 9_217 +0.04%

plutus-benchmark/linear-vesting/test/9.6/main.golden.eval

Metric Old New Δ%
Flat Size 2_860 2_864 +0.14%

plutus-benchmark/nofib/test/9.6/clausify-F5.golden.eval

Metric Old New Δ%
Flat Size 1_477 1_484 +0.47%

plutus-benchmark/nofib/test/9.6/knights10-4x4.golden.eval

Metric Old New Δ%
CPU 1_023_470_754 1_025_262_754 +0.18%
Memory 5_395_058 5_406_258 +0.21%
Flat Size 1_674 1_682 +0.48%

plutus-benchmark/nofib/test/9.6/queens4-bt.golden.eval

Metric Old New Δ%
Flat Size 1_764 1_767 +0.17%

plutus-benchmark/nofib/test/9.6/queens5-fc.golden.eval

Metric Old New Δ%
Flat Size 1_764 1_767 +0.17%

plutus-benchmark/script-contexts/test/V3/Data/9.6/purposeIsWellFormed-4.golden.eval

Metric Old New Δ%
Flat Size 1_839 1_843 +0.22%

This comment will get updated when changes are made.

@bezirg bezirg marked this pull request as ready for review November 24, 2025 10:07
@bezirg bezirg marked this pull request as draft November 24, 2025 10:07
@bezirg bezirg self-assigned this Nov 24, 2025
@bezirg bezirg force-pushed the bezirg/derive_eq branch 2 times, most recently from 5b30be7 to 5d931a0 Compare November 25, 2025 10:05
@bezirg bezirg marked this pull request as ready for review November 25, 2025 10:05
@bezirg bezirg requested review from SeungheonOh and Unisay and removed request for SeungheonOh November 25, 2025 10:05
@bezirg bezirg marked this pull request as draft November 25, 2025 13:42
@bezirg bezirg marked this pull request as ready for review November 25, 2025 13:50
@bezirg bezirg force-pushed the bezirg/derive_eq branch 4 times, most recently from 17c33aa to 7593c53 Compare November 26, 2025 10:55
Copy link
Collaborator

@SeungheonOh SeungheonOh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too confident in my ability to review TH code. So perhaps a look from @Unisay would be nice. But everything looks right from what I can tell.

Comment on lines +17 to +43
deriveEq ''()
deriveEq ''(,)
deriveEq ''(,,)
deriveEq ''(,,,)
deriveEq ''(,,,,)
deriveEq ''(,,,,,)
deriveEq ''(,,,,,,)
deriveEq ''(,,,,,,,)
deriveEq ''(,,,,,,,,)
deriveEq ''(,,,,,,,,,)
deriveEq ''(,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,,,,,)
deriveEq ''(,,,,,,,,,,,,,,,,,,,,,,,,,,)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The great pyramid

, testCase "reflexive3" $ (v3 Tx.== v3) @?= (v3 HS.== v3)
, testCase "shortcircuit" $ (v3 Tx.== v3Error1) @?= (v3 Tx.== v3Error1) -- should not throw an error
, testCase "throws" $ try @SomeException (evaluate $ v3 Tx.== v3Error2) >>= assertBool "did not throw error" . isLeft -- should throw erro
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also have TH golden. There's a function called goldenCodeGen that will generate golden of the generated haskell code. This probably needs to go to plutus-tx-plugin/tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

@SeungheonOh
Copy link
Collaborator

Also, can you check if this works with polymorphic phantom types? I'm curious as per #4537

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.

3 participants