Skip to content

submissions: Scalus 1.4.0 across all 8 scenarios - #262

Merged
Unisay merged 1 commit into
IntersectMBO:mainfrom
nau:scalus-1.4.0-submissions
Nov 4, 2026
Merged

Unisay merged 1 commit into
IntersectMBO:mainfrom
nau:scalus-1.4.0-submissions

Conversation

@nau

@nau nau commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Scalus 1.4.0 rows for all 8 scenarios. Each is compiled with Options.release, which targets protocol version 11 (min_protocol_version: 11), from scalus3/scalus@f1fa4a721. The compiler is the v1.4.0 release. Later commits on master change no code generation; the pinned script sizes and budgets of all 8 scenarios are unchanged.

All 8 pass cape submission verify and are measured on the production evaluator.

Scenario Total fee (lovelace)
factorial 6,055
fibonacci 3,787
ecd 7,886
factorial_naive_recursion 8,718
htlc 22,994
linear_vesting 37,244
two_party_escrow 55,560
fibonacci_naive_recursion 37,092,004

The validators use the current fixtures (#246, #247, #253): the deposit time is the exclusive upper bound minus one, and the escrow deadline is 1,800,000 ms.

The fixed-scenario rows follow the rules of #264:

  • ecd recurses on modInteger, the prescribed `mod`. An earlier revision of this PR used Scala's %, which is rem; the two negative-input cases swap costs, and the total stays 7,886.
  • The READMEs of ecd, factorial_naive_recursion and fibonacci_naive_recursion quote the source file that translates the prescribed algorithm, and give the build commands.

The branch is rebased on main after #266, and the commit is signed.

@nau
nau force-pushed the scalus-1.4.0-submissions branch from 8d340bb to 9c4e4da Compare October 28, 2026 20:20
@Unisay

Unisay commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

The factorial submission needs a change before merging. Requirement 3 requires the program to "compute results dynamically, not have values hardcoded".

The pinned source precomputes 0!..12! on the JVM and sets the table bound to 12 because it is the benchmark's largest fixture input. Every measured input from 0 to 12 returns a precomputed table entry. The recursive fallback for inputs from 13 onwards is correct, but none of the benchmark measurements exercises it. Please replace the precomputed answer table with runtime computation, or omit the factorial row from this PR.

@nau
nau force-pushed the scalus-1.4.0-submissions branch from 9c4e4da to aeb64f2 Compare November 3, 2026 16:06
@nau

nau commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, you're right: every measured input hit the table. factorial is now a plain @Compile Scala function that computes every result at run time, with the recursion unrolled four times (source). Total fee is now 6,055 lovelace (was 3,091 with the table). The branch is rebased on main and the commit is signed.

Compiled with Scalus 1.4.0 (Options.release, protocol version 11) from
scalus3/scalus. Each row is verified and measured on the production
evaluator.

factorial computes every result at run time: a @compile function with
the recursion unrolled four times (scalus3/scalus 9b26ab007). ecd
recurses on modInteger, following the prescribed `mod` (IntersectMBO#264). The
READMEs of the three fixed scenarios quote the source that translates
the prescribed algorithm and give the build commands.
@Unisay
Unisay force-pushed the scalus-1.4.0-submissions branch from aeb64f2 to 79d5df2 Compare November 4, 2026 12:24
@Unisay
Unisay merged commit 4ffa47d into IntersectMBO:main Nov 4, 2026
4 checks passed
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.

2 participants