Skip to content

Commit 744f8a8

Browse files
aakoshhasterite
andauthored
feat: MsgpackTagged serialization (#12730)
Co-authored-by: Ary Borenszweig <asterite@gmail.com>
1 parent e65591d commit 744f8a8

137 files changed

Lines changed: 17336 additions & 1547 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-rust-workspace-arm64.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151

52+
# `compile_fail` runs trybuild, which spawns its own `cargo build` and
53+
# needs the cargo registry to resolve transitive proc-macro deps. The
54+
# run-tests job runs from the archive without registry access, so the
55+
# test detects the nextest run via NEXTEST_TEST_GROUP and skips itself.
56+
# We exercise it here via plain `cargo test`, where the registry cache
57+
# restored by Swatinem/rust-cache is intact.
58+
- name: Run trybuild compile_fail tests
59+
run: cargo test -p msgpack_tagged --test compile_fail
60+
5261
- name: Upload archive to workflow
5362
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
5463
with:
@@ -89,6 +98,12 @@ jobs:
8998
cargo nextest run --archive-file nextest-archive-arm64.tar.zst \
9099
--partition count:${{ matrix.partition }}/8 \
91100
--profile ci-master
101+
env:
102+
# Tests that spawn their own `cargo build` (notably trybuild's
103+
# compile_fail in `msgpack_tagged`) detect this and skip — see
104+
# acvm-repo/msgpack_tagged/tests/compile_fail.rs. They run instead
105+
# in the build-test-artifacts job where the registry cache is intact.
106+
NOIR_NEXTEST_ARCHIVED: 1
92107

93108
# This is a job which depends on all test jobs and reports the overall status.
94109
# This allows us to add/remove test jobs without having to update the required workflows.

.github/workflows/test-rust-workspace-msrv.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ jobs:
6363
env:
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565

66+
# `compile_fail` runs trybuild, which spawns its own `cargo build` and
67+
# needs the cargo registry to resolve transitive proc-macro deps. The
68+
# run-tests job runs from the archive without registry access, so the
69+
# test detects the nextest run via NEXTEST_TEST_GROUP and skips itself.
70+
# We exercise it here via plain `cargo test`, where the registry cache
71+
# restored by Swatinem/rust-cache is intact.
72+
- name: Run trybuild compile_fail tests
73+
run: cargo test -p msgpack_tagged --test compile_fail
74+
6675
- name: Upload archive to workflow
6776
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
6877
with:
@@ -103,6 +112,12 @@ jobs:
103112
cargo nextest run --archive-file nextest-archive.tar.zst \
104113
--partition count:${{ matrix.partition }}/8 \
105114
--profile ci-master
115+
env:
116+
# Tests that spawn their own `cargo build` (notably trybuild's
117+
# compile_fail in `msgpack_tagged`) detect this and skip — see
118+
# acvm-repo/msgpack_tagged/tests/compile_fail.rs. They run instead
119+
# in the build-test-artifacts job where the registry cache is intact.
120+
NOIR_NEXTEST_ARCHIVED: 1
106121

107122
# This is a job which depends on all test jobs and reports the overall status.
108123
# This allows us to add/remove test jobs without having to update the required workflows.

.github/workflows/test-rust-workspace.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ jobs:
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5252

53+
# `compile_fail` runs trybuild, which spawns its own `cargo build` and
54+
# needs the cargo registry to resolve transitive proc-macro deps. The
55+
# run-tests job runs from the archive without registry access, so the
56+
# test detects the nextest run via NEXTEST_TEST_GROUP and skips itself.
57+
# We exercise it here via plain `cargo test`, where the registry cache
58+
# restored by Swatinem/rust-cache is intact.
59+
- name: Run trybuild compile_fail tests
60+
run: cargo test -p msgpack_tagged --test compile_fail
61+
5362
- name: Upload archive to workflow
5463
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
5564
with:
@@ -93,6 +102,11 @@ jobs:
93102
--profile $NEXTEST_PROFILE
94103
env:
95104
NEXTEST_PROFILE: ${{ (github.event_name == 'merge_group' && 'merge-queue') || (github.ref == 'refs/heads/master' && 'ci-master') || 'ci' }}
105+
# Tests that spawn their own `cargo build` (notably trybuild's
106+
# compile_fail in `msgpack_tagged`) detect this and skip — see
107+
# acvm-repo/msgpack_tagged/tests/compile_fail.rs. They run instead
108+
# in the build-test-artifacts job where the registry cache is intact.
109+
NOIR_NEXTEST_ARCHIVED: 1
96110

97111
check-pending-snapshots:
98112
name: Check for pending snapshots

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
edition = "2024"
22
style_edition = "2024"
33
use_small_heuristics = "Max"
4+
merge_derives = false

Cargo.lock

Lines changed: 97 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ members = [
4242
"acvm-repo/brillig_vm",
4343
"acvm-repo/blackbox_solver",
4444
"acvm-repo/bn254_blackbox_solver",
45+
"acvm-repo/msgpack_tagged",
46+
"acvm-repo/msgpack_tagged_derive",
4547
# Utility crates
4648
"utils/iter-extended",
4749

@@ -122,6 +124,8 @@ brillig = { version = "1.0.0-beta.21", path = "acvm-repo/brillig", default-featu
122124
brillig_vm = { version = "1.0.0-beta.21", path = "acvm-repo/brillig_vm", default-features = false }
123125
acvm_blackbox_solver = { version = "1.0.0-beta.21", path = "acvm-repo/blackbox_solver", default-features = false }
124126
bn254_blackbox_solver = { version = "1.0.0-beta.21", path = "acvm-repo/bn254_blackbox_solver", default-features = false }
127+
msgpack_tagged = { version = "1.0.0-beta.20", path = "acvm-repo/msgpack_tagged", default-features = false }
128+
msgpack_tagged_derive = { version = "1.0.0-beta.20", path = "acvm-repo/msgpack_tagged_derive" }
125129

126130
# Noir compiler workspace dependencies
127131
fm = { path = "compiler/fm" }
@@ -190,8 +194,10 @@ criterion = "^0.5.0"
190194
# Note that using the "frame-pointer" feature breaks framegraphs on linux
191195
# https://github.com/tikv/pprof-rs/pull/172
192196
pprof = { version = "^0.15.0", features = ["flamegraph", "criterion"] }
197+
rmp = "0.8.14"
193198
rmp-serde = "1.3.0"
194199
rmpv = "1.3.0"
200+
smallvec = "1.15.1"
195201

196202
arbitrary = "1.4.1"
197203
arbtest = "0.3.2"
@@ -201,6 +207,7 @@ dirs = "^6.0.0"
201207
env_logger = "0.11.6"
202208
log = "0.4"
203209
serde = { version = "1.0.136", features = ["derive", "rc"] }
210+
serde_bytes = "0.11"
204211
serde_json = "1.0"
205212
smol_str = { version = "0.3.2", features = ["serde"] }
206213
thiserror = "2.0.18"
@@ -248,6 +255,10 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
248255
rust-embed = "^8.7.2"
249256
petgraph = "^0.8.2"
250257
insta = "1.47.2"
258+
trybuild = "1.0.116"
259+
proc-macro2 = "1.0"
260+
quote = "1.0"
261+
syn = "2.0"
251262

252263
[profile.dev]
253264
# This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error.

acvm-repo/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This folder is organized into several key components:
66
- `acvm/` - Implementation of ACVM that executes ACIR
77
- `brillig/` - Definition and implementation of unconstrained Brillig opcodes
88
- `brillig_vm/` - Implementation of Brillig VM that executes Brillig
9+
- `msgpack_tagged/` - Tagged-map serialization format for evolvable bytecode (paired with the `msgpack_tagged_derive` proc-macro)
910

1011
Click into each folder to learn more from their READMEs.
1112

acvm-repo/acir/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ workspace = true
1818
[dependencies]
1919
acir_field.workspace = true
2020
brillig.workspace = true
21+
msgpack_tagged.workspace = true
2122

2223
serde.workspace = true
2324
thiserror.workspace = true

0 commit comments

Comments
 (0)