Compile BuiltinData transparently in the plugin - #7862
Closed
Unisay wants to merge 2 commits into
Closed
Conversation
Contributor
Execution Budget Golden Diffoutputplutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/geq1.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/geq2.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/geq3.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/geq4.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/geq5.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/gt1.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/gt2.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/gt3.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/gt4.golden.eval
plutus-tx-plugin/test-ledger-api/Spec/Data/Budget/9.12/gt5.golden.eval
plutus-tx-plugin/test/Budget/9.12/map2.golden.eval
plutus-tx-plugin/test/Budget/9.12/map3.golden.eval
This comment will get updated when changes are made. |
Unisay
force-pushed
the
yura/builtin-data-transparent
branch
from
July 22, 2026 13:51
054cace to
a22ae94
Compare
Contributor
Author
|
Superseded — reopening as an independent PR against master rather than stacked on #7719. |
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.
Alternative to the unreachable-constructor workaround in #7719 (stacked on that branch, so the diff shows only the delta; retarget to master once #7719 merges or if it's superseded).
The plugin treats
BuiltinDataas representationally transparent:PlutusCore.Data.Datacompiles to the builtindatatype (same asBuiltinData), theBuiltinDataconstructor compiles to the identity, and a single-alternative case on it binds both the case binder and the field to the scrutinee. GHC unwrapping the wrapper (the #7716 join-point crash) then becomes harmless instead of fatal, soBuiltinDataUnreachableand its COMPLETE pragma are removed. Details in Note [Transparent BuiltinData] inPlutusTx.Compiler.Expr.The GHC 9.12 budget goldens return exactly to master's numbers — the ~1% CPU / ~2.5% memory cost of blocking GHC's unboxing is gone. Both plugin test suites pass under GHC 9.6 and 9.12 (847 + 81).
One diagnostic change:
StageViolation/builtinDatanow reports the unwrapped binding (ipv … No unfolding, Type: PlutusCore.Data.Data) instead ofvalidator :: BuiltinData, because GHC unwraps the where-binding again; the stage-violation hint and remediation notes are unchanged.