Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase AnomaLib Layer Depth for v0.30 #3277

Merged
merged 5 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ env:
SKIP: ormolu,format-juvix-files,typecheck-juvix-examples
CAIRO_VM_VERSION: 6c324e0d761013f38b8b743e515a65ac1a380206
RISC0_VM_VERSION: v1.0.1
# This is the top commit hash in the branch lukasz/juvix-integration-tracking
# This is the top commit hash in the branch paul/juvix-ci-stable
# of the anoma repository.
ANOMA_VERSION: 7fdd77377317ff0e29676a403b384cb1f2dc4729
ANOMA_VERSION: 8cc25d3fd64ad20623c8135eaa0a6d2096016549
JUST_ARGS: runtimeCcArg=$CC runtimeLibtoolArg=$LIBTOOL
STACK_BUILD_ARGS: --pedantic -j4 --ghc-options=-j

Expand Down
2 changes: 1 addition & 1 deletion runtime/nockma/anomalib.nockma

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions src/Juvix/Compiler/Nockma/AnomaLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,43 @@ anomaLib =
anomaLibPath :: AnomaLib -> Term Natural
anomaLibPath = \case
AnomaLibFunction (AnomaStdlibFunction f) -> case f of
StdlibDec -> [nock| [9 342 0 511] |]
StdlibAdd -> [nock| [9 20 0 511] |]
StdlibSub -> [nock| [9 47 0 511] |]
StdlibMul -> [nock| [9 4 0 511] |]
StdlibDiv -> [nock| [9 170 0 511] |]
StdlibMod -> [nock| [9 46 0 511] |]
StdlibLe -> [nock| [9 84 0 511] |]
StdlibLt -> [nock| [9 343 0 511] |]
StdlibDec -> [nock| [9 342 0 4.095] |]
StdlibAdd -> [nock| [9 20 0 4.095] |]
StdlibSub -> [nock| [9 47 0 4.095] |]
StdlibMul -> [nock| [9 4 0 4.095] |]
StdlibDiv -> [nock| [9 170 0 4.095] |]
StdlibMod -> [nock| [9 46 0 4.095] |]
StdlibLe -> [nock| [9 84 0 4.095] |]
StdlibLt -> [nock| [9 343 0 4.095] |]
-- pow2 is called bex in hoon
StdlibPow2 -> [nock| [9 4 0 63] |]
StdlibPow2 -> [nock| [9 4 0 511] |]
-- encode is called jam in hoon
StdlibEncode -> [nock| [9 22 0 31] |]
StdlibEncode -> [nock| [9 22 0 255] |]
-- decode is called cue in hoon
StdlibDecode -> [nock| [9 94 0 31] |]
StdlibDecode -> [nock| [9 94 0 255] |]
-- verifyDetached is called verify-detatched in hoon
StdlibVerifyDetached -> [nock| [9 22 0 15] |]
StdlibSign -> [nock| [9 10 0 15] |]
StdlibSignDetached -> [nock| [9 23 0 15] |]
StdlibVerify -> [nock| [9 4 0 15] |]
StdlibLengthList -> [nock| [9 1.406 0 255] |]
StdlibCurry -> [nock| [9 4 0 255] |]
StdlibVerifyDetached -> [nock| [9 22 0 127] |]
StdlibSign -> [nock| [9 10 0 127] |]
StdlibSignDetached -> [nock| [9 23 0 127] |]
StdlibVerify -> [nock| [9 4 0 127] |]
StdlibLengthList -> [nock| [9 1.406 0 2.047] |]
StdlibCurry -> [nock| [9 4 0 2.047] |]
-- sha256 is called shax in hoon
StdlibSha256 -> [nock| [9 22 0 7] |]
StdlibSha256 -> [nock| [9 22 0 63] |]
-- Obtained from the urbit dojo using:
--
-- => rm !=(~(met block 3))
--
-- The `3` here is because we want to treat each atom as sequences of 2^3
-- bits, i.e bytes.
StdlibLengthBytes -> [nock| [8 [9 10 0 63] 9 190 10 [6 7 [0 3] 1 3] 0 2] |]
StdlibLengthBytes -> [nock| [8 [9 10 0 511] 9 190 10 [6 7 [0 3] 1 3] 0 2] |]
-- Obtained from the urbit dojo using:
--
-- => rm !=(~(cat block 3))
--
-- The `3` here is because we want to treat each atom as sequences of 2^3
-- bits, i.e bytes.
StdlibCatBytes -> [nock| [8 [9 10 0 63] 9 4 10 [6 7 [0 3] 1 3] 0 2] |]
StdlibCatBytes -> [nock| [8 [9 10 0 511] 9 4 10 [6 7 [0 3] 1 3] 0 2] |]
-- Obtained from the urbit dojo using:
--
-- =>(rm !=(|=([l=(list @)] (foldr l |=([fst=@ snd=@] (add (~(lsh block 3) 1 snd) fst))))))
Expand All @@ -71,7 +71,7 @@ anomaLibPath = \case
[1 0]
[ 1
8
[9 46 0 1.023]
[9 46 0 8.191]
9
2
10
Expand All @@ -81,7 +81,7 @@ anomaLibPath = \case
[0 3]
8
[1 0 0]
[1 8 [9 20 0 8.191] 9 2 10 [6 [7 [0 3] 8 [8 [9 10 0 1.023] 9 90 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 29] 0 2] 0 28] 0 2]
[1 8 [9 20 0 65.535] 9 2 10 [6 [7 [0 3] 8 [8 [9 10 0 8.191] 9 90 10 [6 7 [0 3] 1 3] 0 2] 9 2 10 [6 [7 [0 3] 1 1] 0 29] 0 2] 0 28] 0 2]
0
1
]
Expand All @@ -95,7 +95,7 @@ anomaLibPath = \case
-- Obtained from the urbit dojo using:
--
-- => rm != |= [seed=@] ~(. og seed)
StdlibRandomInitGen -> [nock| [8 [1 0] [1 8 [9 47 0 31] 10 [6 0 14] 0 2] 0 1] |]
StdlibRandomInitGen -> [nock| [8 [1 0] [1 8 [9 47 0 255] 10 [6 0 14] 0 2] 0 1] |]
-- obtained from the urbit dojo using:
--
-- => rm != |= [rng=* width=@] (raws:`_og`rng width)
Expand Down
2 changes: 1 addition & 1 deletion test/Anoma/Client/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pollForOutput :: forall r a. (Members '[Error SimpleError, EmbedIO] r) => Int ->
pollForOutput timeoutMillis isDataAvailable action = runConcurrent $ do
raceResult <- race timeoutAction go
case raceResult of
Left {} -> throw (SimpleError (mkAnsiText @Text "Operation timed out"))
Left {} -> throw (SimpleError (mkAnsiText @Text "pollForOutput: Operation timed out"))
Right xs -> return xs
where
go :: Sem (Concurrent ': r) a
Expand Down
2 changes: 1 addition & 1 deletion test/Anoma/Client/Positive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ clientTests =
_clientAssertion = \program -> do
proveTraces <- proveAndSubmit program []
step "fetching unrevealed commits"
resList <- pollForOutput 2000 isListUnrevealedCommitsAvailable listUnrevealedCommits
resList <- pollForOutput 10000 isListUnrevealedCommitsAvailable listUnrevealedCommits
case (proveTraces, resList ^. listUnrevealedCommitsResultCommits) of
([proveCommitment], [listCommitment]) ->
liftIO $
Expand Down
Loading