Home / Input Output / plutus
Nov 04, 7-8 PM (0)
Nov 04, 8-9 PM (1)
Nov 04, 9-10 PM (1)
Nov 04, 10-11 PM (0)
Nov 04, 11-12 AM (4)
Nov 05, 12-1 AM (1)
Nov 05, 1-2 AM (0)
Nov 05, 2-3 AM (1)
Nov 05, 3-4 AM (0)
Nov 05, 4-5 AM (1)
Nov 05, 5-6 AM (0)
Nov 05, 6-7 AM (0)
Nov 05, 7-8 AM (0)
Nov 05, 8-9 AM (0)
Nov 05, 9-10 AM (0)
Nov 05, 10-11 AM (23)
Nov 05, 11-12 PM (0)
Nov 05, 12-1 PM (0)
Nov 05, 1-2 PM (4)
Nov 05, 2-3 PM (4)
Nov 05, 3-4 PM (0)
Nov 05, 4-5 PM (2)
Nov 05, 5-6 PM (4)
Nov 05, 6-7 PM (1)
Nov 05, 7-8 PM (1)
Nov 05, 8-9 PM (1)
Nov 05, 9-10 PM (0)
Nov 05, 10-11 PM (0)
Nov 05, 11-12 AM (0)
Nov 06, 12-1 AM (0)
Nov 06, 1-2 AM (0)
Nov 06, 2-3 AM (0)
Nov 06, 3-4 AM (0)
Nov 06, 4-5 AM (0)
Nov 06, 5-6 AM (0)
Nov 06, 6-7 AM (0)
Nov 06, 7-8 AM (1)
Nov 06, 8-9 AM (2)
Nov 06, 9-10 AM (1)
Nov 06, 10-11 AM (0)
Nov 06, 11-12 PM (9)
Nov 06, 12-1 PM (0)
Nov 06, 1-2 PM (3)
Nov 06, 2-3 PM (1)
Nov 06, 3-4 PM (0)
Nov 06, 4-5 PM (0)
Nov 06, 5-6 PM (1)
Nov 06, 6-7 PM (0)
Nov 06, 7-8 PM (0)
Nov 06, 8-9 PM (1)
Nov 06, 9-10 PM (0)
Nov 06, 10-11 PM (0)
Nov 06, 11-12 AM (0)
Nov 07, 12-1 AM (0)
Nov 07, 1-2 AM (0)
Nov 07, 2-3 AM (1)
Nov 07, 3-4 AM (1)
Nov 07, 4-5 AM (0)
Nov 07, 5-6 AM (0)
Nov 07, 6-7 AM (0)
Nov 07, 7-8 AM (0)
Nov 07, 8-9 AM (7)
Nov 07, 9-10 AM (2)
Nov 07, 10-11 AM (3)
Nov 07, 11-12 PM (0)
Nov 07, 12-1 PM (0)
Nov 07, 1-2 PM (0)
Nov 07, 2-3 PM (2)
Nov 07, 3-4 PM (0)
Nov 07, 4-5 PM (2)
Nov 07, 5-6 PM (0)
Nov 07, 6-7 PM (1)
Nov 07, 7-8 PM (1)
Nov 07, 8-9 PM (0)
Nov 07, 9-10 PM (0)
Nov 07, 10-11 PM (1)
Nov 07, 11-12 AM (0)
Nov 08, 12-1 AM (0)
Nov 08, 1-2 AM (0)
Nov 08, 2-3 AM (0)
Nov 08, 3-4 AM (0)
Nov 08, 4-5 AM (0)
Nov 08, 5-6 AM (0)
Nov 08, 6-7 AM (0)
Nov 08, 7-8 AM (0)
Nov 08, 8-9 AM (0)
Nov 08, 9-10 AM (0)
Nov 08, 10-11 AM (0)
Nov 08, 11-12 PM (0)
Nov 08, 12-1 PM (0)
Nov 08, 1-2 PM (0)
Nov 08, 2-3 PM (0)
Nov 08, 3-4 PM (0)
Nov 08, 4-5 PM (0)
Nov 08, 5-6 PM (0)
Nov 08, 6-7 PM (0)
Nov 08, 7-8 PM (0)
Nov 08, 8-9 PM (0)
Nov 08, 9-10 PM (0)
Nov 08, 10-11 PM (0)
Nov 08, 11-12 AM (0)
Nov 09, 12-1 AM (0)
Nov 09, 1-2 AM (0)
Nov 09, 2-3 AM (0)
Nov 09, 3-4 AM (0)
Nov 09, 4-5 AM (0)
Nov 09, 5-6 AM (0)
Nov 09, 6-7 AM (0)
Nov 09, 7-8 AM (0)
Nov 09, 8-9 AM (0)
Nov 09, 9-10 AM (0)
Nov 09, 10-11 AM (0)
Nov 09, 11-12 PM (0)
Nov 09, 12-1 PM (0)
Nov 09, 1-2 PM (0)
Nov 09, 2-3 PM (0)
Nov 09, 3-4 PM (0)
Nov 09, 4-5 PM (0)
Nov 09, 5-6 PM (0)
Nov 09, 6-7 PM (0)
Nov 09, 7-8 PM (0)
Nov 09, 8-9 PM (0)
Nov 09, 9-10 PM (0)
Nov 09, 10-11 PM (1)
Nov 09, 11-12 AM (1)
Nov 10, 12-1 AM (0)
Nov 10, 1-2 AM (0)
Nov 10, 2-3 AM (0)
Nov 10, 3-4 AM (0)
Nov 10, 4-5 AM (0)
Nov 10, 5-6 AM (0)
Nov 10, 6-7 AM (0)
Nov 10, 7-8 AM (0)
Nov 10, 8-9 AM (25)
Nov 10, 9-10 AM (0)
Nov 10, 10-11 AM (0)
Nov 10, 11-12 PM (0)
Nov 10, 12-1 PM (0)
Nov 10, 1-2 PM (0)
Nov 10, 2-3 PM (0)
Nov 10, 3-4 PM (0)
Nov 10, 4-5 PM (0)
Nov 10, 5-6 PM (0)
Nov 10, 6-7 PM (0)
Nov 10, 7-8 PM (0)
Nov 10, 8-9 PM (0)
Nov 10, 9-10 PM (0)
Nov 10, 10-11 PM (0)
Nov 10, 11-12 AM (0)
Nov 11, 12-1 AM (0)
Nov 11, 1-2 AM (0)
Nov 11, 2-3 AM (1)
Nov 11, 3-4 AM (0)
Nov 11, 4-5 AM (0)
Nov 11, 5-6 AM (0)
Nov 11, 6-7 AM (0)
Nov 11, 7-8 AM (0)
Nov 11, 8-9 AM (0)
Nov 11, 9-10 AM (0)
Nov 11, 10-11 AM (0)
Nov 11, 11-12 PM (0)
Nov 11, 12-1 PM (0)
Nov 11, 1-2 PM (3)
Nov 11, 2-3 PM (0)
Nov 11, 3-4 PM (4)
Nov 11, 4-5 PM (3)
Nov 11, 5-6 PM (1)
Nov 11, 6-7 PM (0)
Nov 11, 7-8 PM (0)
128 commits this week Nov 04, 2025 - Nov 11, 2025
refactor: use exhaustive power-of-2 grid for LookupCoin benchmarks
Replace mixed random/specific test points with systematic exhaustive
coverage of all (2^a, 2^b) combinations where a, b ∈ {1..10}.

This provides:
- 100 deterministic test points (10×10 grid)
- Complete coverage of depths 2 to 20
- All distribution patterns (balanced, outer-heavy, inner-heavy)
- Reproducible results with no randomness

Removed random value generation and extractWorstCaseKeys function
which are no longer needed with systematic enumeration.
feat: update LookupCoin cost model with remote benchmark data
Updated benchmark data (206 entries) and cost model parameters for
LookupCoin using the new ValueLogOuterSizeAddLogMaxInnerSize metric.

Cost model changes:
- CPU: linear_in_z (intercept: 204546, slope: 7423)
- Memory: constant 10 (updated from 1)

Benchmark data sourced from GitHub Actions run 19272430553 using
worst-case targeting strategy (max-size inner map lookups).
feat: implement additive log size metric for LookupCoin
Replace ValueLogOuterOrMaxInner with ValueLogOuterSizeAddLogMaxInnerSize
for LookupCoin costing. This change reflects experimental findings that
two-level map lookup time scales linearly with log(outerSize) + log(innerSize)
rather than max(log(outerSize), log(innerSize)).

Implementation:
- Add ValueLogOuterSizeAddLogMaxInnerSize type computing sum of log sizes
- Update LookupCoin builtin signature to use new size measurement
- Implement worst-case benchmark generation targeting max-size inner maps
- Optimize size test combinations for BST worst-case coverage (depths 10-18)
- Filter out empty values which cannot provide worst-case keys

Benchmark strategy:
- All lookups target the policy with maximum tokens (worst case)
- Test combinations maximize nodes at each depth: (32,32), (64,128),
  (256,256), (512,512), (1024,128), (2048,64)
- Ensures conservative costing that prevents underestimation attacks
fix: filter out empty values in LookupCoin benchmarks
The extractWorstCaseKeys function requires non-empty Values to extract
policy and token keys. Filter out Value.empty from test values to prevent
crashes when benchmarking LookupCoin.

Empty values are still tested by other builtins (ValueData, UnValueData)
that don't require key extraction.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
feat: implement additive log size metric for LookupCoin with worst-case benchmarking
Replace ValueLogOuterOrMaxInner with ValueLogOuterSizeAddLogMaxInnerSize
for LookupCoin costing. This change reflects experimental findings that
two-level map lookup time scales linearly with log(outerSize) + log(innerSize)
rather than max(log(outerSize), log(innerSize)).

Changes:
- Add ValueLogOuterSizeAddLogMaxInnerSize type computing sum of log sizes
- Update LookupCoin builtin signature to use new size measurement
- Implement worst-case benchmark generation targeting max-size inner maps
- Optimize size test combinations for BST worst-case coverage (depths 10-18)
- Remove dead code (unused withSearchKeys and generateKeyBS functions)

Benchmark improvements:
- All lookups now target the policy with maximum tokens (worst case)
- Test combinations chosen to maximize nodes at each depth level:
  (32,32), (64,128), (256,256), (512,512), (1024,128), (2048,64)
- Ensures conservative costing that prevents underestimation attacks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
refactor: simplify memoryUsageInteger by removing MagicHash
Apply the same optimization used in the Logarithmic instance to
memoryUsageInteger, using integerLog2 directly instead of unboxed
integerLog2# and quotInt# operations.

This allows us to remove:
- MagicHash language extension
- GHC.Exts imports (Int (I#), quotInt#)
- GHC.Integer and GHC.Integer.Logarithms imports

The refactoring maintains identical functionality while making the code
more consistent and simpler.
feat: update parameter names and test expectations for Value builtins
Adds cost model parameter names for LookupCoin, ValueContains, ValueData,
and UnValueData builtins (11 new parameters per ledger API version). Updates
parameter count expectations to reflect the expanded parameter set.

Updates golden type signatures and conformance test budget expectations to
reflect the refined ValueLogOuterOrMaxInner type signature, ensuring accurate
cost accounting for Value-based operations.
refactor: consolidate Value size measurement types
Simplifies the memory usage measurement by consolidating three separate types
(Logarithmic, ValueOuterOrMaxInner, LogValueOuterOrMaxInner) into a single
ValueLogOuterOrMaxInner type. This reduces complexity while maintaining the
same functionality for measuring logarithmic Value sizes.

The new type directly encodes the intended semantics: size = log(max(outer, maxInner)),
making the code more maintainable and producing clearer type signatures in builtin
function definitions.
feat: update Value builtin cost models with refined benchmarks
Update CPU cost parameters for lookupCoin, valueContains, valueData, and unValueData based on refined benchmark data using worst-case key generation. The new benchmarks include detailed measurements with granular Value structure information (outer/inner map sizes).

This update reflects more accurate costs after implementing worst-case ByteString key generation that forces full-length comparisons during Map lookups, providing conservative estimates for on-chain scenarios.
refactor: refine cost model parameters for Value builtins
Updated cost parameters based on fresh benchmark data analysis:

- lookupCoin: Adjusted intercept (284421→179661) and slope (1→7151)
  to better reflect actual performance with varying currency counts
- valueContains: Changed from added_sizes to linear_in_y model with
  refined parameters (intercept 42125119→1000, slope 30→130383)
- valueData: Reduced constant cost (205465→153844) based on updated
  profiling results
- unValueData: Switched to linear_in_x model with refined parameters
  (intercept 10532326261→1000, slope 431→33094)

All three cost model variants (A, B, C) updated for consistency.
refactor: standardize cost model JSON formatting to 4-space indentation
Reformat builtin cost model JSON files to use consistent 4-space
indentation instead of 2-space indentation. This improves readability
and aligns with common JSON formatting conventions for configuration
files.

No semantic changes - only whitespace formatting updated.

Files affected:
- builtinCostModelA.json
- builtinCostModelB.json
- builtinCostModelC.json
refactor: use GHC.Num.Integer.integerLog2 in Logarithmic instance
Modernize logarithm calculation in the Logarithmic ExMemoryUsage instance
by switching from the compatibility module GHC.Integer.Logarithms to the
modern GHC.Num.Integer API.

Changes:
- Replace integerLog2# (unboxed, from GHC.Integer.Logarithms) with
  integerLog2 (boxed, from GHC.Num.Integer)
- Simplify code by removing unboxing boilerplate: I# (integerLog2# x)
  becomes integerLog2 x
- Keep other imports (GHC.Integer.Logarithms, GHC.Exts) as they are still
  used elsewhere in the file (memoryUsageInteger function)

This addresses code review feedback to use the modern ghc-bignum API
instead of the legacy compatibility module, while maintaining the same
computational semantics. Cost model regeneration verified no regression
in derived parameters.
refactor: use consistent size measure wrappers for Value builtins
Address Kenneth's review comment by ensuring builtins use the same
size measure wrappers as their budgeting benchmarks.

Changes:
- Add LogValueOuterOrMaxInner newtype combining logarithmic
  transformation with outer/max inner size measurement
- Update lookupCoin and valueContains to use size measure wrappers
- Add KnownTypeAst instances for ValueTotalSize and LogValueOuterOrMaxInner
- Update benchmarks to use new combined wrapper type

This ensures the cost model accurately reflects runtime behavior by
using identical size measures in both denotations and benchmarks.