diff --git a/Cargo.lock b/Cargo.lock index 3bbec89c..a378c029 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,6 +141,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "attribute-derive" version = "0.6.1" @@ -192,9 +198,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bfieldcodec_derive" @@ -222,12 +228,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -544,8 +544,9 @@ dependencies = [ [[package]] name = "derive_tasm_object" version = "0.1.0" -source = "git+https://github.com/TritonVM/tasm-lib.git?rev=4f58791ecab112971e38c3ad5042b21ec88a85af#4f58791ecab112971e38c3ad5042b21ec88a85af" +source = "git+https://github.com/TritonVM/tasm-lib.git?rev=fc7a22d7#fc7a22d72101bc43d4ecd40fb2b1ba7b5a0c6c99" dependencies = [ + "proc-macro2", "quote", "syn 2.0.76", ] @@ -659,6 +660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -693,6 +695,7 @@ checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", + "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -749,15 +752,15 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "h2" -version = "0.3.26" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", "indexmap", "slab", @@ -812,9 +815,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -823,12 +826,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", "pin-project-lite", ] @@ -838,47 +853,77 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "hyper" -version = "0.14.30" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -968,15 +1013,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -1234,7 +1270,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -1320,6 +1356,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1400,6 +1456,16 @@ dependencies = [ "yansi", ] +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.76", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1452,7 +1518,7 @@ checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags", "lazy_static", "num-traits", "rand", @@ -1618,20 +1684,24 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", + "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -1653,7 +1723,22 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -1668,20 +1753,51 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -1732,7 +1848,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -1849,6 +1965,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.11.1" @@ -1857,9 +1979,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "structmeta" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ad9e09554f0456d67a69c1584c9798ba733a5b50349a6c0d0948710523922d" +checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" dependencies = [ "proc-macro2", "quote", @@ -1869,9 +1991,9 @@ dependencies = [ [[package]] name = "structmeta-derive" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" +checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", @@ -1900,6 +2022,12 @@ dependencies = [ "syn 2.0.76", ] +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "1.0.109" @@ -1924,26 +2052,29 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -1960,7 +2091,7 @@ dependencies = [ "clap", "field_count", "inflections", - "itertools 0.12.1", + "itertools 0.13.0", "num", "pretty_assertions", "proptest", @@ -1981,14 +2112,14 @@ dependencies = [ [[package]] name = "tasm-lib" version = "0.2.1" -source = "git+https://github.com/TritonVM/tasm-lib.git?rev=4f58791ecab112971e38c3ad5042b21ec88a85af#4f58791ecab112971e38c3ad5042b21ec88a85af" +source = "git+https://github.com/TritonVM/tasm-lib.git?rev=fc7a22d7#fc7a22d72101bc43d4ecd40fb2b1ba7b5a0c6c99" dependencies = [ "anyhow", "arbitrary", "const_format", "derive_tasm_object", "hex", - "itertools 0.10.5", + "itertools 0.13.0", "ndarray", "num", "num-traits", @@ -2014,9 +2145,9 @@ dependencies = [ [[package]] name = "test-strategy" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8361c808554228ad09bfed70f5c823caf8a3450b6881cc3a38eb57e8c08c1d9" +checksum = "2bf41af45e3f54cc184831d629d41d5b2bda8297e29c81add7ae4f362ed5e01b" dependencies = [ "proc-macro2", "quote", @@ -2094,6 +2225,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.11" @@ -2107,6 +2249,27 @@ dependencies = [ "tokio", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -2132,11 +2295,77 @@ dependencies = [ "once_cell", ] +[[package]] +name = "triton-air" +version = "0.42.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6993e1b322f6c359fa7555b028cf4be179fa175e3bd43cc86653c749781ee1f" +dependencies = [ + "arbitrary", + "itertools 0.13.0", + "strum", + "triton-constraint-circuit", + "triton-isa", + "twenty-first", +] + +[[package]] +name = "triton-constraint-builder" +version = "0.42.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bbfb9bdc43d339a260b88aa0a054f8c78ae64e042d73bc8fb82cbbceee78a4" +dependencies = [ + "arbitrary", + "itertools 0.13.0", + "prettyplease", + "proc-macro2", + "quote", + "strum", + "syn 2.0.76", + "triton-air", + "triton-constraint-circuit", + "triton-isa", + "twenty-first", +] + +[[package]] +name = "triton-constraint-circuit" +version = "0.42.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f33852d0138bc8f2a68b3c30ff202712b84f6e16351164c62d31929c5ea2e9" +dependencies = [ + "arbitrary", + "itertools 0.13.0", + "ndarray", + "num-traits", + "proc-macro2", + "quote", + "twenty-first", +] + +[[package]] +name = "triton-isa" +version = "0.42.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1af56b884d765e6164b1440f169496ae7cd3235b40abe4b45351fe27ff58d4b2" +dependencies = [ + "arbitrary", + "get-size", + "itertools 0.13.0", + "lazy_static", + "nom", + "num-traits", + "serde", + "strum", + "thiserror", + "twenty-first", +] + [[package]] name = "triton-vm" -version = "0.42.0-alpha.9" +version = "0.42.0-alpha.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8772ee812f7e10d75de0e11ff809c8eb32490d9f5f9451e0e76f8d4a6a81a277" +checksum = "2f3ae37b583246a4d82907d9fe359c3824131d5da6e1177eab51c455e0a52d3f" dependencies = [ "arbitrary", "colored", @@ -2148,15 +2377,20 @@ dependencies = [ "ndarray", "nom", "num-traits", + "prettyplease", "proc-macro2", "quote", "rand", "rand_core", "rayon", "serde", - "serde_derive", "strum", + "syn 2.0.76", "thiserror", + "triton-air", + "triton-constraint-builder", + "triton-constraint-circuit", + "triton-isa", "twenty-first", "unicode-width", ] @@ -2240,6 +2474,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.2" @@ -2386,7 +2626,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2398,6 +2638,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -2546,16 +2816,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "yansi" version = "0.5.1" @@ -2582,3 +2842,9 @@ dependencies = [ "quote", "syn 2.0.76", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 49a6f3cf..98324b3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,14 +8,14 @@ anyhow = "1" chrono = "^0.4.38" clap = "4.5" inflections = "1.1" -itertools = "0.12" +itertools = "0.13" num = "0.4" quote = "1.0" rand = "0" regex = "1.10" strum = { version = "0.26", features = ["derive"] } syn = { version = "1.0", features = ["full", "extra-traits"] } -tasm-lib = { git = "https://github.com/TritonVM/tasm-lib.git", rev = "4f58791ecab112971e38c3ad5042b21ec88a85af" } +tasm-lib = { git = "https://github.com/TritonVM/tasm-lib.git", rev = "fc7a22d7" } [dev-dependencies] anyhow = "1" @@ -24,11 +24,11 @@ field_count = "0.1.1" pretty_assertions = "1.4" proptest = "1.5" proptest-arbitrary-interop = "0.1" -reqwest = { version = "0.11", features = ["blocking"] } +reqwest = { version = "0.12", features = ["blocking"] } serde = { version = "1", features = ["derive"] } serde_derive = "1" serde_json = "1" -test-strategy = "0.3" +test-strategy = "0.4" [dev-dependencies.cargo-husky] version = "1" diff --git a/src/ast_types.rs b/src/ast_types.rs index 0a1fa02b..6d99c8ab 100644 --- a/src/ast_types.rs +++ b/src/ast_types.rs @@ -5,9 +5,8 @@ use std::str::FromStr; use anyhow::bail; use itertools::Itertools; use regex::Regex; -use tasm_lib::triton_vm::table::{NUM_BASE_COLUMNS, NUM_EXT_COLUMNS, NUM_QUOTIENT_SEGMENTS}; - -use crate::ast::FnSignature; +use tasm_lib::triton_vm::table::master_table::MasterMainTable; +use tasm_lib::triton_vm::table::NUM_QUOTIENT_SEGMENTS; pub(crate) use self::abstract_argument::*; pub(crate) use self::array_type::ArrayType; @@ -17,6 +16,9 @@ pub(crate) use self::field_id::FieldId; pub(crate) use self::function_type::FunctionType; pub(crate) use self::struct_type::*; pub(crate) use self::tuple::Tuple; +use crate::ast::FnSignature; +use crate::triton_vm::table::master_table::MasterAuxTable; +use crate::triton_vm::table::master_table::MasterTable; pub(crate) mod abstract_argument; pub(crate) mod array_type; @@ -116,15 +118,15 @@ impl DataType { "FriResponse" => Ok(DataType::Unresolved(type_str.to_owned())), "BaseRow" => Ok(DataType::Array(ArrayType { element_type: Box::new(DataType::Xfe), - length: NUM_BASE_COLUMNS, + length: MasterMainTable::NUM_COLUMNS, })), "BaseRow" => Ok(DataType::Array(ArrayType { element_type: Box::new(DataType::Bfe), - length: NUM_BASE_COLUMNS, + length: MasterMainTable::NUM_COLUMNS, })), "ExtensionRow" => Ok(DataType::Array(ArrayType { element_type: Box::new(DataType::Xfe), - length: NUM_EXT_COLUMNS, + length: MasterAuxTable::NUM_COLUMNS, })), "QuotientSegments" => Ok(DataType::Array(ArrayType { element_type: Box::new(DataType::Xfe), diff --git a/src/ast_types/tuple.rs b/src/ast_types/tuple.rs index 247501b1..41af428a 100644 --- a/src/ast_types/tuple.rs +++ b/src/ast_types/tuple.rs @@ -1,5 +1,5 @@ use itertools::Itertools; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast::FnSignature; use crate::libraries::LibraryFunction; diff --git a/src/libraries/core/array.rs b/src/libraries/core/array.rs index efb90746..13c2ac68 100644 --- a/src/libraries/core/array.rs +++ b/src/libraries/core/array.rs @@ -8,8 +8,8 @@ use crate::composite_types::CompositeTypes; use crate::libraries::core::result_type; use crate::subroutine::SubRoutine; use crate::tasm_code_generator::CompilerState; +use crate::triton_vm::prelude::triton_asm; use crate::triton_vm::prelude::LabelledInstruction; -use crate::triton_vm::triton_asm; pub(crate) fn len_method_signature(array_type: &ArrayType) -> FnSignature { let value_args = vec![("self", array_type.into())]; diff --git a/src/libraries/core/option_type.rs b/src/libraries/core/option_type.rs index 5ef77d5d..a9e8d26d 100644 --- a/src/libraries/core/option_type.rs +++ b/src/libraries/core/option_type.rs @@ -1,6 +1,6 @@ use num::One; use syn::PathArguments; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast; use crate::ast::FnSignature; diff --git a/src/libraries/core/result_type.rs b/src/libraries/core/result_type.rs index ca5ab5b2..87372aec 100644 --- a/src/libraries/core/result_type.rs +++ b/src/libraries/core/result_type.rs @@ -1,5 +1,5 @@ use syn::PathArguments; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast; use crate::ast::FnSignature; diff --git a/src/libraries/recufy.rs b/src/libraries/recufy.rs index 1e1d7f4e..b65e1753 100644 --- a/src/libraries/recufy.rs +++ b/src/libraries/recufy.rs @@ -2,10 +2,11 @@ mod vm_proof_iter; use syn::parse_quote; use syn::PathArguments; -use tasm_lib::triton_vm::table::NUM_BASE_COLUMNS; -use tasm_lib::triton_vm::table::NUM_EXT_COLUMNS; +use tasm_lib::triton_vm::table::master_table::MasterAuxTable; use tasm_lib::triton_vm::table::NUM_QUOTIENT_SEGMENTS; +use self::vm_proof_iter::graft_vm_proof_iter; +use self::vm_proof_iter::VM_PROOF_ITER_TYPE_NAME; use crate::ast; use crate::ast_types; use crate::ast_types::CustomTypeOil; @@ -14,9 +15,8 @@ use crate::ast_types::StructType; use crate::composite_types::CompositeTypes; use crate::composite_types::TypeContext; use crate::graft::Graft; - -use self::vm_proof_iter::graft_vm_proof_iter; -use self::vm_proof_iter::VM_PROOF_ITER_TYPE_NAME; +use crate::triton_vm::table::master_table::MasterMainTable; +use crate::triton_vm::table::master_table::MasterTable; use super::Library; @@ -139,7 +139,7 @@ impl RecufyLib { assert!(matches!(arguments, PathArguments::None)); ast_types::DataType::Array(ast_types::ArrayType { element_type: Box::new(ast_types::DataType::Xfe), - length: NUM_EXT_COLUMNS, + length: MasterAuxTable::NUM_COLUMNS, }) } @@ -164,7 +164,7 @@ impl RecufyLib { ); ast_types::DataType::Array(ast_types::ArrayType { element_type: Box::new(inner), - length: NUM_BASE_COLUMNS, + length: MasterMainTable::NUM_COLUMNS, }) } other => panic!("Unsupported type {other:#?}"), diff --git a/src/libraries/recufy/vm_proof_iter.rs b/src/libraries/recufy/vm_proof_iter.rs index defca620..d242ae0b 100644 --- a/src/libraries/recufy/vm_proof_iter.rs +++ b/src/libraries/recufy/vm_proof_iter.rs @@ -3,16 +3,15 @@ use syn::parse_quote; use tasm_lib::traits::basic_snippet::BasicSnippet; use tasm_lib::triton_vm::proof_item::ProofItemVariant; +use crate::ast; +use crate::ast::RoutineBody; +use crate::ast_types::DataType; use crate::ast_types::StructType; +use crate::composite_types::TypeContext; +use crate::graft::Graft; use crate::libraries::polynomial::PolynomialLib; use crate::triton_vm::prelude::*; -use crate::{ - ast::{self, RoutineBody}, - ast_types::DataType, - composite_types::TypeContext, - graft::Graft, - type_checker::Typing, -}; +use crate::type_checker::Typing; use super::RecufyLib; diff --git a/src/libraries/vector.rs b/src/libraries/vector.rs index 5c20a05d..89802016 100644 --- a/src/libraries/vector.rs +++ b/src/libraries/vector.rs @@ -3,7 +3,7 @@ use num::One; use tasm_lib::memory::memcpy::MemCpy; use tasm_lib::traits::basic_snippet::BasicSnippet; use tasm_lib::triton_vm::prelude::LabelledInstruction; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast; use crate::ast::FnSignature; diff --git a/src/tasm_code_generator.rs b/src/tasm_code_generator.rs index 1537d72c..a6f002e5 100644 --- a/src/tasm_code_generator.rs +++ b/src/tasm_code_generator.rs @@ -601,7 +601,7 @@ impl<'a> CompilerState<'a> { } } -pub(crate) const SIZE_OF_ACCESSIBLE_STACK: usize = triton_vm::op_stack::NUM_OP_STACK_REGISTERS; +pub(crate) const SIZE_OF_ACCESSIBLE_STACK: usize = triton_vm::isa::op_stack::NUM_OP_STACK_REGISTERS; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub(crate) struct ValueIdentifier { diff --git a/src/tasm_code_generator/data_type.rs b/src/tasm_code_generator/data_type.rs index 489d988c..b5b4a052 100644 --- a/src/tasm_code_generator/data_type.rs +++ b/src/tasm_code_generator/data_type.rs @@ -1,6 +1,6 @@ use tasm_lib::list::LIST_METADATA_SIZE; use tasm_lib::memory::memcpy::MemCpy; -use tasm_lib::triton_vm::op_stack::OpStackElement; +use tasm_lib::triton_vm::isa::op_stack::OpStackElement; use tasm_lib::triton_vm::prelude::*; use crate::ast_types; diff --git a/src/tasm_code_generator/data_type/tuple_type.rs b/src/tasm_code_generator/data_type/tuple_type.rs index ebcbe70b..eaf8585e 100644 --- a/src/tasm_code_generator/data_type/tuple_type.rs +++ b/src/tasm_code_generator/data_type/tuple_type.rs @@ -1,5 +1,5 @@ use tasm_lib::triton_vm::prelude::LabelledInstruction; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast_types::Tuple; use crate::tasm_code_generator::move_top_stack_value_to_memory; diff --git a/src/tasm_code_generator/inner_function_tasm_code.rs b/src/tasm_code_generator/inner_function_tasm_code.rs index 9478ef74..b20260e4 100644 --- a/src/tasm_code_generator/inner_function_tasm_code.rs +++ b/src/tasm_code_generator/inner_function_tasm_code.rs @@ -1,4 +1,4 @@ -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::subroutine::SubRoutine; diff --git a/src/tasm_code_generator/match_code.rs b/src/tasm_code_generator/match_code.rs index dc0a9679..a04055bc 100644 --- a/src/tasm_code_generator/match_code.rs +++ b/src/tasm_code_generator/match_code.rs @@ -3,7 +3,7 @@ use std::collections::HashSet; use itertools::Itertools; use num::One; use tasm_lib::triton_vm::prelude::LabelledInstruction; -use tasm_lib::triton_vm::triton_asm; +use tasm_lib::triton_vm::prelude::triton_asm; use crate::ast; use crate::ast::MatchCondition; diff --git a/src/tasm_code_generator/outer_function_tasm_code.rs b/src/tasm_code_generator/outer_function_tasm_code.rs index f9aa22ed..50d099de 100644 --- a/src/tasm_code_generator/outer_function_tasm_code.rs +++ b/src/tasm_code_generator/outer_function_tasm_code.rs @@ -4,8 +4,8 @@ use std::str::FromStr; use chrono::Local; use itertools::Itertools; use tasm_lib::library::Library as SnippetState; -use tasm_lib::triton_vm::instruction; -use tasm_lib::triton_vm::op_stack::NumberOfWords; +use tasm_lib::triton_vm::isa::instruction; +use tasm_lib::triton_vm::isa::op_stack::NumberOfWords; use tasm_lib::triton_vm::prelude::*; use crate::ast; @@ -304,7 +304,7 @@ impl OuterFunctionTasmCode { "use crate::snippet::BasicSnippet; use crate::snippet::DataType; use crate::Library; - use crate::triton_vm::triton_asm; + use crate::triton_vm::prelude::triton_asm; pub(crate) struct {snippet_struct_name}; diff --git a/src/tests_and_benchmarks/ozk/programs/algebraic_hasher/sample_scalars.rs b/src/tests_and_benchmarks/ozk/programs/algebraic_hasher/sample_scalars.rs index 82298665..f88fea16 100644 --- a/src/tests_and_benchmarks/ozk/programs/algebraic_hasher/sample_scalars.rs +++ b/src/tests_and_benchmarks/ozk/programs/algebraic_hasher/sample_scalars.rs @@ -36,7 +36,7 @@ mod tests { use itertools::Itertools; use rand::thread_rng; use rand::Rng; - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use tasm_lib::twenty_first::math::other::random_elements; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; diff --git a/src/tests_and_benchmarks/ozk/programs/boxed/method_on_nested_struct_simple.rs b/src/tests_and_benchmarks/ozk/programs/boxed/method_on_nested_struct_simple.rs index 8866bc4c..2342e8b5 100644 --- a/src/tests_and_benchmarks/ozk/programs/boxed/method_on_nested_struct_simple.rs +++ b/src/tests_and_benchmarks/ozk/programs/boxed/method_on_nested_struct_simple.rs @@ -21,11 +21,14 @@ fn main() { #[cfg(test)] mod test { - use super::*; + use tasm_lib::triton_vm::prelude::*; + + use crate::tests_and_benchmarks::ozk::ozk_parsing; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; - use crate::tests_and_benchmarks::ozk::{ozk_parsing, rust_shadows}; + use crate::tests_and_benchmarks::ozk::rust_shadows; use crate::tests_and_benchmarks::test_helpers::shared_test::*; - use tasm_lib::triton_vm::prelude::*; + + use super::*; #[test] fn methods_on_nested_structs_simple_test() { diff --git a/src/tests_and_benchmarks/ozk/programs/boxed/tuple_struct_one_element_simple.rs b/src/tests_and_benchmarks/ozk/programs/boxed/tuple_struct_one_element_simple.rs index 11d667e2..e9605969 100644 --- a/src/tests_and_benchmarks/ozk/programs/boxed/tuple_struct_one_element_simple.rs +++ b/src/tests_and_benchmarks/ozk/programs/boxed/tuple_struct_one_element_simple.rs @@ -17,7 +17,7 @@ fn main() { #[cfg(test)] mod test { - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use super::*; diff --git a/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_associated_functions.rs b/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_associated_functions.rs index 1b59d089..a1e593d7 100644 --- a/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_associated_functions.rs +++ b/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_associated_functions.rs @@ -19,7 +19,7 @@ impl Foo { #[cfg(test)] mod tests { - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use super::*; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; diff --git a/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_methods.rs b/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_methods.rs index 7a84dcbc..bf68f60c 100644 --- a/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_methods.rs +++ b/src/tests_and_benchmarks/ozk/programs/composite_types/composite_types_from_methods.rs @@ -40,7 +40,7 @@ impl Foo { #[cfg(test)] mod tests { - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use super::*; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; diff --git a/src/tests_and_benchmarks/ozk/programs/enums/boxed_proof_item_simple.rs b/src/tests_and_benchmarks/ozk/programs/enums/boxed_proof_item_simple.rs index 0340de2a..e314f8e0 100644 --- a/src/tests_and_benchmarks/ozk/programs/enums/boxed_proof_item_simple.rs +++ b/src/tests_and_benchmarks/ozk/programs/enums/boxed_proof_item_simple.rs @@ -15,10 +15,10 @@ pub(crate) struct FriResponse { #[derive(BFieldCodec)] pub(crate) enum ProofItem { AuthenticationStructure(Vec), - MasterBaseTableRows(Vec>), - MasterExtTableRows(Vec>), - OutOfDomainBaseRow(Vec), - OutOfDomainExtRow(Vec), + MasterMainTableRows(Vec>), + MasterAuxTableRows(Vec>), + OutOfDomainMainRow(Vec), + OutOfDomainAuxRow(Vec), OutOfDomainQuotientSegments([XFieldElement; 4]), MerkleRoot(Digest), Log2PaddedHeight(u32), @@ -35,16 +35,16 @@ impl ProofItem { ProofItem::AuthenticationStructure(_) => { discriminant = BFieldElement::new(0); } - ProofItem::MasterBaseTableRows(_) => { + ProofItem::MasterMainTableRows(_) => { discriminant = BFieldElement::new(1); } - ProofItem::MasterExtTableRows(_) => { + ProofItem::MasterAuxTableRows(_) => { discriminant = BFieldElement::new(2); } - ProofItem::OutOfDomainBaseRow(_) => { + ProofItem::OutOfDomainMainRow(_) => { discriminant = BFieldElement::new(3); } - ProofItem::OutOfDomainExtRow(_) => { + ProofItem::OutOfDomainAuxRow(_) => { discriminant = BFieldElement::new(4); } ProofItem::OutOfDomainQuotientSegments(_) => { @@ -97,16 +97,16 @@ fn main() { ProofItem::AuthenticationStructure(_) => { panic!(); } - ProofItem::MasterBaseTableRows(_) => { + ProofItem::MasterMainTableRows(_) => { panic!(); } - ProofItem::MasterExtTableRows(_) => { + ProofItem::MasterAuxTableRows(_) => { panic!(); } - ProofItem::OutOfDomainBaseRow(_) => { + ProofItem::OutOfDomainMainRow(_) => { panic!(); } - ProofItem::OutOfDomainExtRow(_) => { + ProofItem::OutOfDomainAuxRow(_) => { panic!(); } ProofItem::OutOfDomainQuotientSegments(_) => { diff --git a/src/tests_and_benchmarks/ozk/programs/neptune_consensus/claims/single_proof_claims.rs b/src/tests_and_benchmarks/ozk/programs/neptune_consensus/claims/single_proof_claims.rs index cbea84d4..fbc2957d 100644 --- a/src/tests_and_benchmarks/ozk/programs/neptune_consensus/claims/single_proof_claims.rs +++ b/src/tests_and_benchmarks/ozk/programs/neptune_consensus/claims/single_proof_claims.rs @@ -128,7 +128,7 @@ mod tests { use std::collections::HashMap; use rand::random; - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use tasm_lib::twenty_first::bfe; use tasm_lib::twenty_first::math::other::random_elements; diff --git a/src/tests_and_benchmarks/ozk/programs/recufier/challenges.rs b/src/tests_and_benchmarks/ozk/programs/recufier/challenges.rs index f7537bde..6611c29e 100644 --- a/src/tests_and_benchmarks/ozk/programs/recufier/challenges.rs +++ b/src/tests_and_benchmarks/ozk/programs/recufier/challenges.rs @@ -23,7 +23,7 @@ mod tests { #[test] fn local_challenges_count_agrees_with_tvm() { assert_eq!( - triton_vm::table::challenges::Challenges::COUNT, + triton_vm::challenges::Challenges::COUNT, Challenges::count() ); } diff --git a/src/tests_and_benchmarks/ozk/programs/recufier/stark_parameters.rs b/src/tests_and_benchmarks/ozk/programs/recufier/stark_parameters.rs index b88ddaae..d7ee5f28 100644 --- a/src/tests_and_benchmarks/ozk/programs/recufier/stark_parameters.rs +++ b/src/tests_and_benchmarks/ozk/programs/recufier/stark_parameters.rs @@ -1,8 +1,10 @@ -use crate::tests_and_benchmarks::ozk::rust_shadows as tasm; -use crate::{tests_and_benchmarks::ozk::rust_shadows::VmProofIter, triton_vm::prelude::*}; use serde_derive::Serialize; use tasm_lib::twenty_first::math::traits::PrimitiveRootOfUnity; +use crate::tests_and_benchmarks::ozk::rust_shadows as tasm; +use crate::tests_and_benchmarks::ozk::rust_shadows::VmProofIter; +use crate::triton_vm::prelude::*; + /// See [StarkParameters][params]. /// /// [params]: crate::triton_vm::stark::Stark diff --git a/src/tests_and_benchmarks/ozk/programs/recufier/verify.rs b/src/tests_and_benchmarks/ozk/programs/recufier/verify.rs index 9840ee90..ae4500fd 100644 --- a/src/tests_and_benchmarks/ozk/programs/recufier/verify.rs +++ b/src/tests_and_benchmarks/ozk/programs/recufier/verify.rs @@ -1,15 +1,14 @@ use itertools::Itertools; use num::Zero; use tasm_lib::triton_vm::proof::Claim; -use tasm_lib::triton_vm::table::extension_table::Quotientable; -use tasm_lib::triton_vm::table::master_table::MasterExtTable; -use tasm_lib::triton_vm::table::ExtensionRow; +use tasm_lib::triton_vm::table::master_table::MasterAuxTable; +use tasm_lib::triton_vm::table::AuxiliaryRow; +use tasm_lib::triton_vm::table::MainRow; use tasm_lib::triton_vm::table::QuotientSegments; use crate::tests_and_benchmarks::ozk::rust_shadows as tasm; use crate::tests_and_benchmarks::ozk::rust_shadows::Tip5WithState; use crate::tests_and_benchmarks::ozk::rust_shadows::VmProofIter; -use crate::triton_vm::table::BaseRow; use crate::twenty_first::prelude::*; use super::arithmetic_domain::*; @@ -63,13 +62,13 @@ impl Recufier { let out_of_domain_point_curr_row_pow_num_segments: XFieldElement = tasm::tasmlib_arithmetic_xfe_to_the_fourth(out_of_domain_point_curr_row); - let out_of_domain_curr_base_row: Box>> = + let out_of_domain_curr_base_row: Box>> = proof_iter.next_as_outofdomainbaserow(); - let out_of_domain_curr_ext_row: Box> = + let out_of_domain_curr_ext_row: Box> = proof_iter.next_as_outofdomainextrow(); - let out_of_domain_next_base_row: Box>> = + let out_of_domain_next_base_row: Box>> = proof_iter.next_as_outofdomainbaserow(); - let out_of_domain_next_ext_row: Box> = + let out_of_domain_next_ext_row: Box> = proof_iter.next_as_outofdomainextrow(); let out_of_domain_curr_row_quot_segments: Box<[XFieldElement; 4]> = proof_iter.next_as_outofdomainquotientsegments(); @@ -144,7 +143,7 @@ impl Recufier { // Dequeue base elements // Could be read from secret-in, but it's much more efficient to get them from memory let num_combination_codeword_checks: usize = fri.num_collinearity_checks as usize; - let base_table_rows: Box>> = + let base_table_rows: Box>> = proof_iter.next_as_masterbasetablerows(); // Read base authentication structure but ignore its value, as we divine-in the digests instead @@ -163,7 +162,7 @@ impl Recufier { ); // dequeue extension elements - let ext_table_rows: Box> = proof_iter.next_as_masterexttablerows(); + let ext_table_rows: Box> = proof_iter.next_as_masterexttablerows(); // dequeue extension rows' authentication structure but ignore it (divination instead) { let _dummy: Box> = proof_iter.next_as_authenticationstructure(); @@ -209,8 +208,8 @@ impl Recufier { while i < num_combination_codeword_checks { let row_idx: u32 = revealed_fri_indices_and_elements[i].0; let fri_value: XFieldElement = revealed_fri_indices_and_elements[i].1; - let base_row: BaseRow = base_table_rows[i]; - let ext_row: ExtensionRow = ext_table_rows[i]; + let base_row: MainRow = base_table_rows[i]; + let ext_row: AuxiliaryRow = ext_table_rows[i]; // let randomizer_value: XFieldElement = ext_row[ext_row.len() - 1]; let randomizer_value: XFieldElement = XFieldElement::zero(); let quot_segment_elements: QuotientSegments = quotient_segment_elements[i]; @@ -278,8 +277,8 @@ impl Recufier { #[allow(clippy::redundant_allocation)] #[allow(clippy::ptr_arg)] fn linearly_sum_xfe_base_and_ext_row( - base_row: Box>>, - ext_row: Box>, + base_row: Box>>, + ext_row: Box>, base_and_ext_codeword_weights: &Vec, ) -> XFieldElement { let mut acc: XFieldElement = XFieldElement::zero(); @@ -304,11 +303,10 @@ mod test { use std::collections::HashMap; use proptest::prelude::*; - use tasm_lib::triton_vm::program::Program; + use tasm_lib::triton_vm::prelude::triton_program; + use tasm_lib::triton_vm::prelude::Program; use tasm_lib::triton_vm::proof_stream::ProofStream; - use tasm_lib::triton_vm::table::NUM_EXT_COLUMNS; use tasm_lib::triton_vm::table::NUM_QUOTIENT_SEGMENTS; - use tasm_lib::triton_vm::triton_program; use test_strategy::proptest; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; @@ -318,7 +316,9 @@ mod test { use crate::triton_vm::prelude::NonDeterminism; use crate::triton_vm::prelude::Proof; use crate::triton_vm::prelude::Stark; - use crate::triton_vm::table::NUM_BASE_COLUMNS; + use crate::triton_vm::table::master_table::MasterAuxTable; + use crate::triton_vm::table::master_table::MasterMainTable; + use crate::triton_vm::table::master_table::MasterTable; use super::*; @@ -434,8 +434,8 @@ mod test { fn num_base_and_ext_and_quotient_segment_codeword_weights_agrees_with_tvm() { const NUM_DEEP_CODEWORD_COMPONENTS: usize = 3; // TODO: Use from TVM when made public assert_eq!( - NUM_BASE_COLUMNS - + NUM_EXT_COLUMNS + MasterMainTable::NUM_COLUMNS + + MasterAuxTable::NUM_COLUMNS + NUM_QUOTIENT_SEGMENTS + NUM_DEEP_CODEWORD_COMPONENTS, Recufier::num_base_ext_quotient_deep_weights() @@ -444,14 +444,17 @@ mod test { #[test] fn num_columns_agrees_with_tvm() { - assert_eq!(Recufier::num_columns(), NUM_BASE_COLUMNS + NUM_EXT_COLUMNS) + assert_eq!( + Recufier::num_columns(), + MasterMainTable::NUM_COLUMNS + MasterAuxTable::NUM_COLUMNS + ) } #[test] fn num_columns_plus_quotient_segments_agrees_with_tvm() { assert_eq!( Recufier::num_columns_plus_quotient_segments(), - NUM_BASE_COLUMNS + NUM_EXT_COLUMNS + NUM_QUOTIENT_SEGMENTS + MasterMainTable::NUM_COLUMNS + MasterAuxTable::NUM_COLUMNS + NUM_QUOTIENT_SEGMENTS ) } @@ -475,7 +478,7 @@ mod test { #[test] fn num_quotients_agree_with_tvm_num_quotients() { - assert_eq!(MasterExtTable::NUM_CONSTRAINTS, Recufier::num_quotients()); + assert_eq!(MasterAuxTable::NUM_CONSTRAINTS, Recufier::num_quotients()); } #[proptest] @@ -673,7 +676,7 @@ mod test { mod benches { use tasm_lib::snippet_bencher::write_benchmarks; use tasm_lib::snippet_bencher::NamedBenchmarkResult; - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; use crate::tests_and_benchmarks::ozk::programs::recufier::verify::test::claim_to_stdin_for_stark_verifier; @@ -740,9 +743,9 @@ mod benches { #[cfg(test)] mod profilers { - use tasm_lib::triton_vm::program::NonDeterminism; - use tasm_lib::triton_vm::program::Program; - use tasm_lib::twenty_first::math::b_field_element::BFieldElement; + use tasm_lib::triton_vm::prelude::NonDeterminism; + use tasm_lib::triton_vm::prelude::Program; + use tasm_lib::twenty_first::prelude::BFieldElement; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; use crate::tests_and_benchmarks::ozk::programs::recufier::verify::test::claim_to_stdin_for_stark_verifier; diff --git a/src/tests_and_benchmarks/ozk/programs/recufier/vm_proof_iter_next_as.rs b/src/tests_and_benchmarks/ozk/programs/recufier/vm_proof_iter_next_as.rs index a4a25a47..260ea330 100644 --- a/src/tests_and_benchmarks/ozk/programs/recufier/vm_proof_iter_next_as.rs +++ b/src/tests_and_benchmarks/ozk/programs/recufier/vm_proof_iter_next_as.rs @@ -9,20 +9,20 @@ mod test { use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; use crate::tests_and_benchmarks::ozk::rust_shadows; + use crate::tests_and_benchmarks::ozk::rust_shadows as tasm; + use crate::tests_and_benchmarks::ozk::rust_shadows::Tip5WithState; + use crate::tests_and_benchmarks::ozk::rust_shadows::VmProofIter; use crate::tests_and_benchmarks::test_helpers::shared_test::*; use crate::triton_vm::stark::NUM_QUOTIENT_SEGMENTS; - use crate::triton_vm::table::BaseRow; - use crate::triton_vm::table::ExtensionRow; + use crate::triton_vm::table::master_table::MasterMainTable; + use crate::triton_vm::table::master_table::MasterTable; + use crate::triton_vm::table::AuxiliaryRow; + use crate::triton_vm::table::MainRow; use crate::triton_vm::table::QuotientSegments; - use crate::triton_vm::table::NUM_BASE_COLUMNS; - use crate::triton_vm::table::NUM_EXT_COLUMNS; use tasm_lib::triton_vm::prelude::*; use tasm_lib::triton_vm::proof_item::ProofItem; use tasm_lib::triton_vm::proof_stream::ProofStream; - - use crate::tests_and_benchmarks::ozk::rust_shadows as tasm; - use crate::tests_and_benchmarks::ozk::rust_shadows::Tip5WithState; - use crate::tests_and_benchmarks::ozk::rust_shadows::VmProofIter; + use tasm_lib::triton_vm::table::master_table::MasterAuxTable; /// The function being tested here. Dual-compiled by `rustc` and `tasm-lang`. fn call_all_next_methods() { @@ -187,14 +187,14 @@ mod test { Digest::new(pseudo_digest(seed)) } - fn arbitrary_out_of_domain_base_row(from: u64) -> BaseRow { - let to = from + NUM_BASE_COLUMNS as u64; + fn arbitrary_out_of_domain_base_row(from: u64) -> MainRow { + let to = from + MasterMainTable::NUM_COLUMNS as u64; let row = (from..to).map(into_xfe).collect_vec(); row.try_into().unwrap() } - fn arbitrary_ext_row(from: u64) -> ExtensionRow { - let to = from + NUM_EXT_COLUMNS as u64; + fn arbitrary_ext_row(from: u64) -> AuxiliaryRow { + let to = from + MasterAuxTable::NUM_COLUMNS as u64; let row = (from..to).map(into_xfe).collect_vec(); row.try_into().unwrap() } @@ -208,17 +208,17 @@ mod test { (400..403).map(arbitrary_digest).collect_vec() } - fn arbitrary_base_row(from: u64) -> BaseRow { - let to = from + NUM_BASE_COLUMNS as u64; + fn arbitrary_base_row(from: u64) -> MainRow { + let to = from + MasterMainTable::NUM_COLUMNS as u64; let row = (from..to).map(BFieldElement::new).collect_vec(); row.try_into().unwrap() } - fn arbitrary_master_base_table_rows() -> Vec> { + fn arbitrary_master_base_table_rows() -> Vec> { [420, 1420, 2420].map(arbitrary_base_row).to_vec() } - fn arbitrary_ext_base_table_rows() -> Vec { + fn arbitrary_ext_base_table_rows() -> Vec { [14u64, 1014u64, 2014u64].map(arbitrary_ext_row).to_vec() } @@ -252,10 +252,10 @@ mod test { proof_stream.enqueue(ProofItem::MerkleRoot(arbitrary_digest(42))); let ood_base_row = Box::new(arbitrary_out_of_domain_base_row(1337)); - proof_stream.enqueue(ProofItem::OutOfDomainBaseRow(ood_base_row)); + proof_stream.enqueue(ProofItem::OutOfDomainMainRow(ood_base_row)); let ood_ext_row = Box::new(arbitrary_ext_row(1001)); - proof_stream.enqueue(ProofItem::OutOfDomainExtRow(ood_ext_row)); + proof_stream.enqueue(ProofItem::OutOfDomainAuxRow(ood_ext_row)); let quot_segments = arbitrary_quotient_segments(800); proof_stream.enqueue(ProofItem::OutOfDomainQuotientSegments(quot_segments)); @@ -264,10 +264,10 @@ mod test { proof_stream.enqueue(ProofItem::AuthenticationStructure(auth_structure)); let base_rows = arbitrary_master_base_table_rows(); - proof_stream.enqueue(ProofItem::MasterBaseTableRows(base_rows)); + proof_stream.enqueue(ProofItem::MasterMainTableRows(base_rows)); let ext_rows = arbitrary_ext_base_table_rows(); - proof_stream.enqueue(ProofItem::MasterExtTableRows(ext_rows)); + proof_stream.enqueue(ProofItem::MasterAuxTableRows(ext_rows)); proof_stream.enqueue(ProofItem::Log2PaddedHeight(arbitrary_log2_padded_height())); diff --git a/src/tests_and_benchmarks/ozk/programs/sponge_hasher/absorb_once_squeeze_once.rs b/src/tests_and_benchmarks/ozk/programs/sponge_hasher/absorb_once_squeeze_once.rs index e899b9b5..4470ad79 100644 --- a/src/tests_and_benchmarks/ozk/programs/sponge_hasher/absorb_once_squeeze_once.rs +++ b/src/tests_and_benchmarks/ozk/programs/sponge_hasher/absorb_once_squeeze_once.rs @@ -34,7 +34,7 @@ mod tests { use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; use crate::tests_and_benchmarks::ozk::rust_shadows::wrap_main_with_io; use itertools::Itertools; - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use tasm_lib::twenty_first::math::other::random_elements; #[test] diff --git a/src/tests_and_benchmarks/ozk/programs/sponge_hasher/pad_and_absorb_all.rs b/src/tests_and_benchmarks/ozk/programs/sponge_hasher/pad_and_absorb_all.rs index d39b6498..5d831f7c 100644 --- a/src/tests_and_benchmarks/ozk/programs/sponge_hasher/pad_and_absorb_all.rs +++ b/src/tests_and_benchmarks/ozk/programs/sponge_hasher/pad_and_absorb_all.rs @@ -32,7 +32,7 @@ fn pad_and_absorb_all() { mod tests { use rand::thread_rng; use rand::Rng; - use tasm_lib::triton_vm::program::NonDeterminism; + use tasm_lib::triton_vm::prelude::NonDeterminism; use tasm_lib::twenty_first::math::other::random_elements; use crate::tests_and_benchmarks::ozk::ozk_parsing::EntrypointLocation; diff --git a/src/tests_and_benchmarks/ozk/programs/structs/exceed_allowed_field_size.rs b/src/tests_and_benchmarks/ozk/programs/structs/exceed_allowed_field_size.rs index 4f5317fe..ce719a25 100644 --- a/src/tests_and_benchmarks/ozk/programs/structs/exceed_allowed_field_size.rs +++ b/src/tests_and_benchmarks/ozk/programs/structs/exceed_allowed_field_size.rs @@ -118,7 +118,10 @@ mod tests { .execute() .unwrap_err(); let err1 = err1.downcast::().unwrap(); - assert_eq!(InstructionError::FailedU32Conversion(negative_number), err1); + assert_eq!( + InstructionError::OpStackError(OpStackError::FailedU32Conversion(negative_number)), + err1 + ); } #[test] @@ -163,6 +166,9 @@ mod tests { .execute() .unwrap_err(); let err1 = err1.downcast::().unwrap(); - assert_eq!(InstructionError::FailedU32Conversion(negative_number), err1); + assert_eq!( + InstructionError::OpStackError(OpStackError::FailedU32Conversion(negative_number)), + err1 + ); } } diff --git a/src/tests_and_benchmarks/ozk/rust_shadows.rs b/src/tests_and_benchmarks/ozk/rust_shadows.rs index 57de98d2..c56e4dad 100644 --- a/src/tests_and_benchmarks/ozk/rust_shadows.rs +++ b/src/tests_and_benchmarks/ozk/rust_shadows.rs @@ -20,8 +20,7 @@ use tasm_lib::triton_vm; use tasm_lib::triton_vm::prelude::*; use tasm_lib::triton_vm::proof_item::ProofItem; use tasm_lib::triton_vm::proof_item::ProofItemVariant; -use tasm_lib::triton_vm::table::extension_table::Quotientable; -use tasm_lib::triton_vm::table::master_table::MasterExtTable; +use tasm_lib::triton_vm::table::master_table::MasterAuxTable; use tasm_lib::twenty_first::math::tip5::Tip5; use tasm_lib::twenty_first::math::tip5::RATE; use tasm_lib::twenty_first::math::traits::ModPowU32; @@ -36,13 +35,13 @@ use tasm_lib::verifier::master_ext_table::air_constraint_evaluation::AirConstrai use crate::tests_and_benchmarks::ozk::programs::recufier::challenges::Challenges as TasmLangChallenges; use crate::tests_and_benchmarks::ozk::programs::recufier::stark_parameters::FriVerify; use crate::triton_vm::arithmetic_domain::ArithmeticDomain; +use crate::triton_vm::challenges::Challenges; use crate::triton_vm::fri::AuthenticationStructure; use crate::triton_vm::fri::Fri; use crate::triton_vm::proof_item::FriResponse; use crate::triton_vm::proof_stream::ProofStream; -use crate::triton_vm::table::challenges::Challenges; -use crate::triton_vm::table::BaseRow; -use crate::triton_vm::table::ExtensionRow; +use crate::triton_vm::table::AuxiliaryRow; +use crate::triton_vm::table::MainRow; use crate::triton_vm::table::QuotientSegments; use crate::twenty_first::prelude::*; @@ -382,11 +381,11 @@ pub(super) fn tasmlib_array_horner_evaluation_with_4_coefficients( } pub(super) fn tasmlib_verifier_master_ext_table_air_constraint_evaluation( - curr_main: &BaseRow, - curr_aux: &ExtensionRow, - next_main: &BaseRow, - next_aux: &ExtensionRow, -) -> [XFieldElement; MasterExtTable::NUM_CONSTRAINTS] { + curr_main: &MainRow, + curr_aux: &AuxiliaryRow, + next_main: &MainRow, + next_aux: &AuxiliaryRow, +) -> [XFieldElement; MasterAuxTable::NUM_CONSTRAINTS] { const CHALLENGES_LENGTH: usize = Challenges::COUNT; let mem_layout = air_constraint_evaluation::MemoryLayout::conventional_static(); let challenges: Box<[XFieldElement; CHALLENGES_LENGTH]> = ND_MEMORY.with_borrow(|memory| { @@ -414,11 +413,11 @@ pub(super) fn tasmlib_verifier_master_ext_table_air_constraint_evaluation( } pub(super) fn tasmlib_verifier_master_ext_table_divide_out_zerofiers( - mut air_evaluation_result: [XFieldElement; MasterExtTable::NUM_CONSTRAINTS], + mut air_evaluation_result: [XFieldElement; MasterAuxTable::NUM_CONSTRAINTS], out_of_domain_point_curr_row: XFieldElement, padded_height: u32, trace_domain_generator: BFieldElement, -) -> [XFieldElement; MasterExtTable::NUM_CONSTRAINTS] { +) -> [XFieldElement; MasterAuxTable::NUM_CONSTRAINTS] { let initial_zerofier_inv: XFieldElement = (out_of_domain_point_curr_row - BFieldElement::one()).inverse(); let consistency_zerofier_inv: XFieldElement = @@ -429,26 +428,26 @@ pub(super) fn tasmlib_verifier_master_ext_table_divide_out_zerofiers( let terminal_zerofier_inv: XFieldElement = except_last_row.inverse(); let mut i: usize = 0; - while i < MasterExtTable::NUM_INITIAL_CONSTRAINTS { + while i < MasterAuxTable::NUM_INITIAL_CONSTRAINTS { air_evaluation_result[i] *= initial_zerofier_inv; i += 1; } - while i < MasterExtTable::NUM_INITIAL_CONSTRAINTS + MasterExtTable::NUM_CONSISTENCY_CONSTRAINTS + while i < MasterAuxTable::NUM_INITIAL_CONSTRAINTS + MasterAuxTable::NUM_CONSISTENCY_CONSTRAINTS { air_evaluation_result[i] *= consistency_zerofier_inv; i += 1; } - while i < MasterExtTable::NUM_INITIAL_CONSTRAINTS - + MasterExtTable::NUM_CONSISTENCY_CONSTRAINTS - + MasterExtTable::NUM_TRANSITION_CONSTRAINTS + while i < MasterAuxTable::NUM_INITIAL_CONSTRAINTS + + MasterAuxTable::NUM_CONSISTENCY_CONSTRAINTS + + MasterAuxTable::NUM_TRANSITION_CONSTRAINTS { air_evaluation_result[i] *= transition_zerofier_inv; i += 1; } - while i < MasterExtTable::NUM_INITIAL_CONSTRAINTS - + MasterExtTable::NUM_CONSISTENCY_CONSTRAINTS - + MasterExtTable::NUM_TRANSITION_CONSTRAINTS - + MasterExtTable::NUM_TERMINAL_CONSTRAINTS + while i < MasterAuxTable::NUM_INITIAL_CONSTRAINTS + + MasterAuxTable::NUM_CONSISTENCY_CONSTRAINTS + + MasterAuxTable::NUM_TRANSITION_CONSTRAINTS + + MasterAuxTable::NUM_TERMINAL_CONSTRAINTS { air_evaluation_result[i] *= terminal_zerofier_inv; i += 1; @@ -463,7 +462,7 @@ pub(super) fn tasmlib_verifier_master_ext_table_verify_Base_table_rows( merkle_tree_height: u32, merkle_tree_root: &Digest, revealed_fri_indices_and_elements: &[(u32, XFieldElement)], - base_rows: &[BaseRow], + base_rows: &[MainRow], ) { assert_eq!(base_rows.len(), num_combination_codeword_checks); let leaf_digests_base: Vec<_> = base_rows @@ -486,7 +485,7 @@ pub(super) fn tasmlib_verifier_master_ext_table_verify_Extension_table_rows( merkle_tree_height: u32, merkle_tree_root: &Digest, revealed_fri_indices_and_elements: &[(u32, XFieldElement)], - ext_rows: &[ExtensionRow], + ext_rows: &[AuxiliaryRow], ) { assert_eq!(ext_rows.len(), num_combination_codeword_checks); let leaf_digests_ext = ext_rows @@ -536,7 +535,7 @@ pub(super) fn tasmlib_verifier_fri_verify( proof_iter: &mut VmProofIter, fri_parameters: &FriVerify, ) -> Vec<(u32, XFieldElement)> { - let fri: triton_vm::fri::Fri = fri_parameters._to_fri(); + let fri = fri_parameters._to_fri(); let tasm_lib_fri: tasm_lib::verifier::fri::verify::FriVerify = fri.clone().into(); let (advance_nd_digests_by, ret) = SPONGE_STATE.with_borrow_mut(|maybe_sponge_state| { let sponge_state = maybe_sponge_state.as_mut().unwrap(); @@ -569,7 +568,7 @@ pub(super) fn tasmlib_verifier_fri_verify( } impl FriVerify { - fn _to_fri(&self) -> Fri { + fn _to_fri(&self) -> Fri { let fri_domain = ArithmeticDomain::of_length(self.domain_length as usize) .unwrap() .with_offset(self.domain_offset); @@ -694,18 +693,18 @@ macro_rules! vm_proof_iter_impl { vm_proof_iter_impl!( MerkleRoot(Digest) defines next_as_merkleroot uses try_into_merkle_root, - OutOfDomainBaseRow(Box>) defines next_as_outofdomainbaserow - uses try_into_out_of_domain_base_row, - OutOfDomainExtRow(Box) defines next_as_outofdomainextrow - uses try_into_out_of_domain_ext_row, + OutOfDomainMainRow(Box>) defines next_as_outofdomainbaserow + uses try_into_out_of_domain_main_row, + OutOfDomainAuxRow(Box) defines next_as_outofdomainextrow + uses try_into_out_of_domain_aux_row, OutOfDomainQuotientSegments(QuotientSegments) defines next_as_outofdomainquotientsegments uses try_into_out_of_domain_quot_segments, AuthenticationStructure(AuthenticationStructure) defines next_as_authenticationstructure uses try_into_authentication_structure, - MasterBaseTableRows(Vec>) defines next_as_masterbasetablerows - uses try_into_master_base_table_rows, - MasterExtTableRows(Vec) defines next_as_masterexttablerows - uses try_into_master_ext_table_rows, + MasterMainTableRows(Vec>) defines next_as_masterbasetablerows + uses try_into_master_main_table_rows, + MasterAuxTableRows(Vec) defines next_as_masterexttablerows + uses try_into_master_aux_table_rows, Log2PaddedHeight(u32) defines next_as_log2paddedheight uses try_into_log2_padded_height, QuotientSegmentsElements(Vec) defines next_as_quotientsegmentselements @@ -719,8 +718,8 @@ vm_proof_iter_impl!( #[allow(non_snake_case)] // Name must agree with `tasm-lib` pub fn tasmlib_array_inner_product_of_three_rows_with_weights_Bfe_baserowelem( - ext_row: ExtensionRow, - base_row: BaseRow, + ext_row: AuxiliaryRow, + base_row: MainRow, weights: [XFieldElement; N], ) -> XFieldElement { let mut acc: XFieldElement = XFieldElement::zero(); diff --git a/src/tests_and_benchmarks/test_helpers/shared_test.rs b/src/tests_and_benchmarks/test_helpers/shared_test.rs index f3f8b668..b79abc7f 100644 --- a/src/tests_and_benchmarks/test_helpers/shared_test.rs +++ b/src/tests_and_benchmarks/test_helpers/shared_test.rs @@ -10,7 +10,7 @@ use tasm_lib::empty_stack; use tasm_lib::memory::dyn_malloc::DYN_MALLOC_ADDRESS; use tasm_lib::rust_shadowing_helper_functions; use tasm_lib::snippet_bencher::BenchmarkResult; -use tasm_lib::triton_vm::op_stack::NUM_OP_STACK_REGISTERS; +use tasm_lib::triton_vm::isa::op_stack::NUM_OP_STACK_REGISTERS; use tasm_lib::triton_vm::prelude::*; use crate::ast; @@ -152,7 +152,7 @@ impl TritonVMTestCase { pub(crate) fn benchmark(self) -> BenchmarkResult { let program = self.program(); let vm_state = self.initial_vm_state(); - let (aet, _end_state) = program.trace_execution_of_state(vm_state).unwrap(); + let (aet, _end_state) = VM::trace_execution_of_state(&program, vm_state).unwrap(); BenchmarkResult::new(&aet) }