From ed73c510200a73de66c0a9e8eb6e1c1b761c18b0 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 2 Oct 2022 00:18:09 -0400 Subject: [PATCH 01/44] WIP --- Cargo.lock | 217 ++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 + src/abis.rs | 2 + src/cli.rs | 9 ++ src/main.rs | 157 +++++++++++++++++++++++++++++++- tests/kdl/test.kdl | 202 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 584 insertions(+), 5 deletions(-) create mode 100644 tests/kdl/test.kdl diff --git a/Cargo.lock b/Cargo.lock index 6d25b91..b2979c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,11 +7,13 @@ name = "abi-cafe" version = "0.1.0" dependencies = [ "built", - "cc", + "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", "clap", + "kdl", "libloading", "linked-hash-map", "log", + "miette", "rayon", "ron", "serde", @@ -20,6 +22,30 @@ dependencies = [ "thiserror", ] +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + [[package]] name = "atty" version = "0.2.14" @@ -37,6 +63,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.0" @@ -70,6 +111,12 @@ dependencies = [ "url", ] +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + [[package]] name = "cc" version = "1.0.73" @@ -172,6 +219,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + [[package]] name = "hashbrown" version = "0.11.2" @@ -208,12 +261,28 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + [[package]] name = "itoa" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +[[package]] +name = "kdl" +version = "4.4.1-alpha.0" +source = "git+https://github.com/Gankra/kdl-rs?branch=spanned#7554c035c89dc57e2857b036a2d35c6a0ee3d993" +dependencies = [ + "miette", + "nom", + "thiserror", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -275,6 +344,62 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miette" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" +dependencies = [ + "atty", + "backtrace", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -304,6 +429,15 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.13.1" @@ -319,6 +453,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -367,6 +507,23 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + [[package]] name = "ron" version = "0.7.0" @@ -378,6 +535,12 @@ dependencies = [ "serde", ] +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + [[package]] name = "ryu" version = "1.0.11" @@ -441,12 +604,46 @@ dependencies = [ "termcolor", ] +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "supports-color" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +dependencies = [ + "atty", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +dependencies = [ + "atty", +] + +[[package]] +name = "supports-unicode" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +dependencies = [ + "atty", +] + [[package]] name = "syn" version = "1.0.86" @@ -483,7 +680,10 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" dependencies = [ + "smawk", "terminal_size", + "unicode-linebreak", + "unicode-width", ] [[package]] @@ -547,6 +747,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-linebreak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +dependencies = [ + "regex", +] + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -556,6 +765,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + [[package]] name = "unicode-xid" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index f445b69..6dab3b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,11 @@ parallel = ["rayon"] [dependencies] cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } clap = { version = "3.1.6", features = ["cargo", "wrap_help"] } +kdl = { git = "https://github.com/Gankra/kdl-rs", branch = "spanned" } libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } log = "0.4.14" +miette = { version = "5.3.0", features = ["fancy"] } rayon = { version = "1.5.3", optional = true } ron = "0.7.0" serde = { version = "1.0.136", features = ["derive"] } diff --git a/src/abis.rs b/src/abis.rs index 6b5523b..d825145 100644 --- a/src/abis.rs +++ b/src/abis.rs @@ -84,6 +84,8 @@ pub enum GenerateError { width=.2.position.col.saturating_sub(1), )] ParseError(String, String, ron::error::Error), + #[error("kdl parse error {}", .2)] + KdlParseError(String, String, kdl::KdlError), #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] InconsistentStructDefinition { name: String, diff --git a/src/cli.rs b/src/cli.rs index 06977f9..6914f0c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,5 +1,7 @@ use crate::{abis::*, Config, OutputFormat}; use clap::{AppSettings, Arg}; +use log::LevelFilter; +use simplelog::{TermLogger, TerminalMode, ColorChoice}; pub fn make_app() -> Config { static ABI_IMPLS: &[&str] = &[ @@ -154,6 +156,13 @@ pub fn make_app() -> Config { _ => unreachable!(), }; + let _ = TermLogger::init( + LevelFilter::Info, + simplelog::Config::default(), + TerminalMode::Mixed, + ColorChoice::Auto + ).unwrap(); + Config { output_format, procgen_tests, diff --git a/src/main.rs b/src/main.rs index 97a4981..613cab9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod report; use abis::*; use linked_hash_map::LinkedHashMap; +use log::warn; use report::*; use serde::Serialize; use std::collections::HashMap; @@ -310,12 +311,160 @@ fn read_test_manifest(test_file: &Path) -> Result { let mut reader = BufReader::new(file); let mut input = String::new(); reader.read_to_string(&mut input)?; - let test: Test = ron::from_str(&input).map_err(|e| { - GenerateError::ParseError(test_file.to_string_lossy().into_owned(), input, e) - })?; - Ok(test) + + let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); + + if ext == "ron" { + let test: Test = ron::from_str(&input).map_err(|e| { + GenerateError::ParseError(test_file.to_string_lossy().into_owned(), input, e) + })?; + Ok(test) + } else if ext == "kdl" { + if let Err(e) = do_kdl(test_file, input) { + println!("failed to read doc! {:?}", e); + std::process::exit(-1); + } else { + Err(GenerateError::Skipped) + } + } else { + Err(GenerateError::Skipped) + } +} + + +struct NominalTy { + name: TyName, + attrs: Vec, + decls: Vec, +} + +struct TyAttr { + langs: Option, + impls: Option, +} + +struct TyDecl { + langs: Option, + impls: Option, + decl: Decl, +} + +enum Decl { + Alias(AliasDecl), + Union(UnionDecl), + Enum(EnumDecl), + TaggedUnion(TaggedUnionDecl), +} + +struct AliasDecl { + ty: Ty, +} +struct StructDecl { + fields: Vec<(Option, Ty)>, +} +struct UnionDecl { + fields: Vec<(Option, Ty)>, +} +struct EnumDecl { + // engh ideally we would have EnumDecl "know" its tag size + // but that doesn't really play nice with anything so let's + // say i128 tag should be enough for anyone? + fields: Vec<(Option, Option)>, +} +struct TaggedUnionDecl { + fields: Vec<(Option, Option)>, +} + +enum Ty { + Nominal(TyName), + Array(Box, usize), + ByRef(Box), +} + +type TyName = Ident; +type Ident = String; + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +enum KdlError { + #[error(transparent)] + #[diagnostic(transparent)] + UnknownTyNode(#[from] UnknownTyNodeError), +} + +pub type SourceFile = std::sync::Arc; + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +#[error("unknown node for a type: {}", node_name)] +#[diagnostic(help("we expect 'decl' or 'attr' nodes"))] +struct UnknownTyNodeError { + #[source_code] + source_code: SourceFile, + node_name: String, + #[label("here")] + span: miette::SourceSpan, +} + +fn do_kdl(test_file: &Path, input: String) -> Result { + let doc = input.parse::()?; + let src = std::sync::Arc::new(miette::NamedSource::new(test_file.to_string_lossy().to_owned(), input)); + + const NODE_TYPES: &str = "types"; + const NODE_FUNCS: &str = "funcs"; + + if let Some(types) = doc.get(NODE_TYPES) { + let tys = HashMap::::new(); + for ty in types.children().into_iter().flat_map(|d| d.nodes()) { + let ty_name = ty.name().value().to_owned(); + for node in ty.children().into_iter().flat_map(|d| d.nodes()) { + match node.name().value() { + "decl" => { + // println!(" decl"); + } + "attr" => { + // println!(" attr"); + } + unknown => { + warn!("{:?}", miette::Report::from(UnknownTyNodeError { + source_code: src.clone(), + node_name: unknown.to_owned(), + span: *node.span(), + })); + } + } + } + } + println!("got types!"); + } + + if let Some(funcs) = doc.get(NODE_FUNCS) { + // println!("got funcs!"); + for func in funcs.children().into_iter().flat_map(|d| d.nodes()) { + // println!(" func {}", func.name()); + for node in func.children().into_iter().flat_map(|d| d.nodes()) { + match node.name().value() { + "args" => { + // println!(" args"); + } + "outs" => { + // println!(" outs"); + } + "conventions" => { + // println!(" conventions"); + } + unknown => { + // println!(" unknown {}", unknown); + } + } + } + } + } + + println!("kdl done"); + std::process::exit(0); + } + fn generate_test_src( test: &Test, test_key: &TestKey, diff --git a/tests/kdl/test.kdl b/tests/kdl/test.kdl new file mode 100644 index 0000000..d2c99c9 --- /dev/null +++ b/tests/kdl/test.kdl @@ -0,0 +1,202 @@ +// Experimental sketches of specifying abi-checker tests with kdl. +// See: https://github.com/Gankra/abi-checker +// +// Basically we generate source code for different languages (c, rust, ...) +// from these abstract type/function definitions and then have them call eachother +// and check that the values didn't get corrupted along the way. + + +// Custom type definitions we want to pass across the ABI/convention of interest. +// +// By default type definitions/attributes are intended to be language agnostic. +// AbiImpl Backends (rustc, cc, cxx, swiftc, ...) is responsible for lowering the +// agnostic definition to its own concepts (or say "I don't support this"). +// +// e.g. u32 => uint32_t for the cc/cxx backends, Uint32 in swiftc +// +// The agnostic form is often psuedo-rust because it has good type names/syntax. +// Because we're interested in FFI, type definitions default to #[repr(C)]. +// Backends may support an opt-out for this like `attr lang="rust" #[repr(rust)]` +types { + MyStruct { + // Backends should emit a packed attribute for this struct + attr "packed" + garbage "wow" + decl "struct" { + x "u32" + y "u8" + z "i16" + } + more-garbage x="y" { + "garbage!!" + bad + } + } + + // typedef my_u32 = u32 + MyU32 { + decl "alias" "u32" + } + + // Here we demonstrate ability to specify different lowerings for different + // languages. In this case a transparent newtype in rust, a simple typedef in C. + // + // Both "attr" and "decl" can be prefixed with either lang="$LANG" or "impl=$COMPILER" + // to specify that they only apply in certain cases. The exact merging/fallback behaviour + // is tbd. + // + // Example langs: "rust", "c", "c++" + // Example impls: "rustc", "cc", "gcc", "g++", .. + // + // 💭 Possible lang families?: "~c" (c, c++, obj-c, ...) + U64Meters { + attr lang="rust" "#[repr(transparent)]" + decl lang="rust" "struct" { + // Fields can be named `_`, implying they should be position or autonamed + // In the case of rust, this could lower to a tuple struct. + _ "u64" + } + + decl lang="c" "alias" "u64" + } + + // Typical union + MyUnion { + decl "union" { + x "u32" + y "u8" + } + } + + // C-style enum + MyEnum { + // You can specify that the tag should have a specific backing type + // which lowers to things like `#[repr(u8)]` or `enum class my_enum: uint8_t` + attr "tag" "u8" + decl "enum" { + x + y + z + } + } + + // Rust-style tagged union + // + // As previously stated, this will default to `#[repr(C)]` in rust, which is the + // "obvious" externally-tagged layout with a c-enum-sized tag as defined in + // https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md + // + // This is the worst layout, the better one is `#[repr(rust)]` + `#[repr(u8)]` + // (also spec'd in RFC, internally tagged). + MyTaggedUnion { + decl "tagged" { + x + y "bool" + } + } + + // A struct with a trailing empty array + MyTrailingStruct { + decl "struct" { + // decls can reference other decls (backend's problem to handle ordering) + header "Header" + // Rust array syntax, can nest, can reference types + buf "[u64; 0]" + } + } + + Header { + decl "struct" { + len "usize" + cap "usize" + is_magic "bool" + } + } + +} + + + + +// Function decls, which are the actual tests that will run. +// +// We will, for each AbiImpl x AbiImpl x CallingConvention: +// +// * generate the callee and caller with the two AbiImpls and spec'd CallingConvention (fastcall::rustc_calls_cc) +// * compile them to static libs +// * link them into a harness dll/exe that calls each of the callers, which calls its paired callee +// * have each side report the bytes of each arg/subfield +// * compare the two reports for equality +funcs { + // A function that passes a u32 and my_struct (defined in `types`) by-value. + // + // By default functions are assumed valid for all conventions/impls/langs. + // + // By default values will be "byte grafitti", containing the logical field and byte index. + // The high nibble contains the field index, the low nibble the byte index. For instance, + // In the following decl we will have: + // + // ``` + // a = 0x00_01_02_03 + // b = MyStruct { + // x = 0x10_11_12_13 + // y = 0x20 + // z = 0x30_31 + // } + // ``` + // + // When ABI mismatches do happen, we will dump the offending bytes, and this tagging + // scheme makes it easier to identify where different bytes came from in the caller. + // (What this looks like for things with forbidden values is TBD but presumably we'll + // do some kind of modulo cycling through the vals.) + // + // outs are return values, passed back by the callee. + simple { + args { + a "u32" + b "MyStruct" + } + outs { + _ "bool" + } + } + + // Varargs can be declared by having an arg with the name "..." + // Arguments that follow "..." are not part of the declared interface, + // but will be passed by the caller and expected by the callee. + varargs { + args { + _ "u8" + _ "bool" + "..." + _ "u32" + } + } + + // Explicit values can be provided if desired + explicit_vals { + conventions "c" "fastcall" + args { + _ "u8" 0x69 + b "MyUnion" { + x 12 + } + } + } + + // Args and outputs can be made "by reference", which means they will be + // passed as a pointer, but the pointee is the logical value that will be + // checked. This is in contrast to the builtin "ptr" value which is treated like spicy usize. + // + // Return values that are by-ref will be lowered to out-params. + by_ref { + args { + _ "&MyEnum" + _ "&MyEnum" + } + outs { + _ "&bool" + _ "u32" + } + } +} \ No newline at end of file From 75b3ead386e51852d409dac6552c7c3da8bcd5a0 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 28 Nov 2023 22:30:14 -0500 Subject: [PATCH 02/44] WIP: kdlscript --- Cargo.lock | 413 ++++++++++++- Cargo.toml | 1 + src/abis.rs | 1 + src/abis/rust2.rs | 829 +++++++++++++++++++++++++++ src/cli.rs | 2 +- src/main.rs | 135 +---- src/test_format.rs | 29 + tests/kdl/{test.kdl => test.kdl.tmp} | 411 ++++++------- tests/kdl/types.kdl | 61 ++ 9 files changed, 1519 insertions(+), 363 deletions(-) create mode 100644 src/abis/rust2.rs create mode 100644 src/test_format.rs rename tests/kdl/{test.kdl => test.kdl.tmp} (90%) create mode 100644 tests/kdl/types.kdl diff --git a/Cargo.lock b/Cargo.lock index b2979c9..59d593a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,8 +8,9 @@ version = "0.1.0" dependencies = [ "built", "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", - "clap", - "kdl", + "clap 3.1.6", + "kdl 4.4.1-alpha.0", + "kdl-script", "libloading", "linked-hash-map", "log", @@ -52,7 +53,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -158,6 +159,43 @@ dependencies = [ "textwrap", ] +[[package]] +name = "clap" +version = "4.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +dependencies = [ + "bitflags", + "clap_derive", + "clap_lex", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -209,6 +247,33 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "form_urlencoded" version = "1.0.1" @@ -231,6 +296,12 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -240,6 +311,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "idna" version = "0.2.3" @@ -261,6 +341,28 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "is-terminal" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys", +] + [[package]] name = "is_ci" version = "1.1.1" @@ -283,6 +385,34 @@ dependencies = [ "thiserror", ] +[[package]] +name = "kdl" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062c875482ccb676fd40c804a40e3824d4464c18c364547456d1c8e8e951ae47" +dependencies = [ + "miette", + "nom", + "thiserror", +] + +[[package]] +name = "kdl-script" +version = "0.2.0" +dependencies = [ + "clap 4.0.32", + "kdl 4.6.0", + "linked-hash-map", + "miette", + "nom", + "petgraph", + "serde", + "serde_json", + "thiserror", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -291,9 +421,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.119" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libloading" @@ -314,6 +444,12 @@ dependencies = [ "serde", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "log" version = "0.4.14" @@ -400,6 +536,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -425,7 +571,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -453,6 +599,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owo-colors" version = "3.5.0" @@ -465,13 +617,53 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -541,6 +733,20 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +[[package]] +name = "rustix" +version = "0.36.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "ryu" version = "1.0.11" @@ -564,18 +770,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -584,15 +790,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + [[package]] name = "simplelog" version = "0.11.2" @@ -604,6 +819,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + [[package]] name = "smawk" version = "0.3.1" @@ -646,13 +867,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.86" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -688,24 +909,33 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + [[package]] name = "time" version = "0.1.44" @@ -741,12 +971,76 @@ dependencies = [ "serde", ] +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + [[package]] name = "unicode-bidi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + [[package]] name = "unicode-linebreak" version = "0.1.2" @@ -771,12 +1065,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "url" version = "2.2.2" @@ -789,6 +1077,18 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" @@ -825,3 +1125,60 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" diff --git a/Cargo.toml b/Cargo.toml index 6dab3b4..1c69084 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ parallel = ["rayon"] cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } clap = { version = "3.1.6", features = ["cargo", "wrap_help"] } kdl = { git = "https://github.com/Gankra/kdl-rs", branch = "spanned" } +kdl-script = { path = "../kdl-script" } libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } log = "0.4.14" diff --git a/src/abis.rs b/src/abis.rs index d825145..27d8837 100644 --- a/src/abis.rs +++ b/src/abis.rs @@ -3,6 +3,7 @@ // Backends that can generate + compile an implementation's code into a staticlib. pub mod c; pub mod rust; +pub mod rust2; use super::report::BuildError; use std::io::Write; diff --git a/src/abis/rust2.rs b/src/abis/rust2.rs new file mode 100644 index 0000000..06c790c --- /dev/null +++ b/src/abis/rust2.rs @@ -0,0 +1,829 @@ +use std::sync::Arc; + +use kdl_script::types::{FuncIdx, ArrayTy, RefTy, AliasTy, Ty, TyIdx, PrimitiveTy}; +use kdl_script::{DefinitionGraph, TypedProgram, PunEnv}; + +use super::super::*; +use super::*; + +pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); + +static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); + +#[allow(dead_code)] +pub struct RustcAbiImpl { + is_nightly: bool, + codegen_backend: Option, +} + +pub struct Test { + pub typed: Arc, + pub env: Arc, + pub graph: Arc, + pub convention: CallingConvention, +} + +pub struct GenState<'a> { + test: &'a Test, + tynames: HashMap, + borrowed_tynames: HashMap, + funcs: Vec, +} + +impl RustcAbiImpl { + fn name(&self) -> &'static str { + "rustc" + } + fn lang(&self) -> &'static str { + "rust" + } + fn src_ext(&self) -> &'static str { + "rs" + } + fn supports_convention(&self, convention: CallingConvention) -> bool { + // NOTE: Rustc spits out: + // + // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, + // vectorcall, thiscall, thiscall-unwind, aapcs, win64, sysv64, + // ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, + // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, + // wasm, system, system-unwind, rust-intrinsic, rust-call, + // platform-intrinsic, unadjusted + match convention { + CallingConvention::All => unreachable!(), + CallingConvention::Handwritten => true, + CallingConvention::C => true, + CallingConvention::Cdecl => true, + CallingConvention::System => true, + CallingConvention::Win64 => true, + CallingConvention::Sysv64 => true, + CallingConvention::Aapcs => true, + CallingConvention::Stdcall => true, + CallingConvention::Fastcall => true, + CallingConvention::Vectorcall => false, // too experimental even for nightly use? + } + } + + pub fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + query: impl Iterator, + ) -> Result<(), GenerateError> { + let mut state = GenState { + test, + tynames: HashMap::new(), + borrowed_tynames: HashMap::new(), + funcs: vec![], + }; + + self.write_rust_prefix(f, &state)?; + + for def in test.graph.definitions(query) { + match def { + kdl_script::Definition::DeclareTy(_) | + kdl_script::Definition::DeclareFunc(_) => { + // nothing to do, rust doesn't need forward-declares + }, + kdl_script::Definition::DefineTy(ty) => { + let (tyname, borrowed_tyname) = self.generate_tydef(f, &state, ty)?; + state.tynames.insert(ty, tyname); + if let Some(borrowed) = borrowed_tyname { + state.borrowed_tynames.insert(ty, borrowed); + } + }, + kdl_script::Definition::DefineFunc(func) => { + // Buffer up the funcs + state.funcs.push(func); + }, + } + } + + // Generate the extern block for all the funcs we'll call + let convention_decl = self.convention_decl(test.convention); + writeln!(f, "extern \"{convention_decl}\" {{",)?; + for &func in &state.funcs { + write!(f, " ")?; + self.generate_signature(f, &state, func)?; + writeln!(f, ";")?; + } + writeln!(f, "}}")?; + writeln!(f)?; + + // Generate the test function the harness will call + writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; + + for &func in &state.funcs { + writeln!(f, " unsafe {{")?; + self.generate_caller_body(f, &state, func)?; + writeln!(f, " }}")?; + } + + writeln!(f, "}}")?; + + Ok(()) + } + +/* + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_rust_prefix(f, test, convention)?; + let convention_decl = self.rust_convention_decl(convention); + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + // Write the signature + writeln!(f, "#[no_mangle]")?; + write!(f, "pub unsafe extern \"{convention_decl}\" ")?; + self.write_rust_signature(f, function)?; + writeln!(f, " {{")?; + + // Now the body + + // Report Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.rust_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? + )?; + } + writeln!(f)?; + + // Report outputs and return + if let Some(output) = &function.output { + let decl = self.rust_var_decl(output, OUTPUT_NAME)?; + let val = self.rust_val(output)?; + writeln!(f, " {decl} = {val};")?; + writeln!( + f, + "{}", + self.rust_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? + )?; + writeln!( + f, + " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" + )?; + writeln!( + f, + " {}", + self.rust_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? + )?; + } else { + writeln!( + f, + " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" + )?; + } + writeln!(f, "}}")?; + } + + Ok(()) + } + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + let mut cmd = Command::new("rustc"); + cmd.arg("--crate-type") + .arg("staticlib") + .arg("--out-dir") + .arg("target/temp/") + .arg("--target") + .arg(built_info::TARGET) + .arg(format!("-Cmetadata={lib_name}")) + .arg(src_path); + if let Some(codegen_backend) = &self.codegen_backend { + cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); + } + eprintln!("running: {:?}", cmd); + let out = cmd.output()?; + + if !out.status.success() { + Err(BuildError::RustCompile(out)) + } else { + Ok(String::from(lib_name)) + } + } + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + // Currently no need to be different + self.compile_callee(src_path, lib_name) + } + */ +} + +impl RustcAbiImpl { + pub fn new(codegen_backend: Option) -> Self { + Self { + is_nightly: built_info::RUSTC_VERSION.contains("nightly"), + codegen_backend, + } + } + + pub fn generate_caller_body( + &self, + f: &mut dyn Write, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.test.typed.realize_func(func); + for (_idx, arg) in function.inputs.iter().enumerate() { + let arg_name = &arg.name; + //let ty_name = state&arg.ty + } + + Ok(()) + } + + pub fn generate_tydef( + &self, + f: &mut dyn Write, + state: &GenState, + ty: TyIdx, + ) -> Result<(String, Option), GenerateError> { + let names = match state.test.typed.realize_ty(ty) { + // Structural types that don't need definitions but we should + // intern the name of + Ty::Primitive(prim) => { + let name = match prim { + PrimitiveTy::I8 => "i8", + PrimitiveTy::I16 => "i16", + PrimitiveTy::I32 => "i32", + PrimitiveTy::I64 => "i64", + PrimitiveTy::I128 => "i128", + PrimitiveTy::I256 => "i256", + PrimitiveTy::U8 => "u8", + PrimitiveTy::U16 => "u16", + PrimitiveTy::U32 => "u32", + PrimitiveTy::U64 => "u64", + PrimitiveTy::U128 => "u128", + PrimitiveTy::U256 => "u256", + PrimitiveTy::F16 => "f16", + PrimitiveTy::F32 => "f32", + PrimitiveTy::F64 => "f64", + PrimitiveTy::F128 => "f128", + PrimitiveTy::Bool => "bool", + PrimitiveTy::Ptr => "*mut ()", + }; + (name.to_owned(), None) + }, + Ty::Array(ArrayTy { elem_ty, len }) => { + + let elem_tyname = &state.tynames[elem_ty]; + let borrowed_tyname = state.borrowed_tynames.get(elem_ty).map(|elem_tyname| format!("[{elem_tyname}; {len}]")); + (format!("[{elem_tyname}; {len}]"), borrowed_tyname) + }, + Ty::Ref(RefTy { pointee_ty }) => { + let pointee_tyname = &state.tynames[pointee_ty]; + let borrowed_pointee_tyname = state.borrowed_tynames.get(pointee_ty).unwrap_or(pointee_tyname); + (format!("&mut {pointee_tyname}"), Some(format!("&'a mut {borrowed_pointee_tyname}"))) + } + Ty::Empty => { + ("()".to_owned(), None) + } + + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + assert!(struct_ty.attrs.is_empty(), "don't yet know how to apply attrs to structs"); + + let has_borrows = struct_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + + // Emit an actual struct decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "struct {}<'a> {{", struct_ty.name)?; + } else { + writeln!(f, "struct {} {{", struct_ty.name)?; + } + for field in &struct_ty.fields { + let field_name = &field.ident; + let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); + writeln!(f, " {field_name}: {field_tyname},")?; + } + writeln!(f, "}}\n")?; + + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); + ((*struct_ty.name).clone(), borrowed_tyname) + }, + Ty::Union(union_ty) => { + assert!(union_ty.attrs.is_empty(), "don't yet know how to apply attrs to unions"); + + let has_borrows = union_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + + // Emit an actual union decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "union {}<'a> {{", union_ty.name)?; + } else { + writeln!(f, "union {} {{", union_ty.name)?; + } + for field in &union_ty.fields { + let field_name = &field.ident; + let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); + writeln!(f, " {field_name}: {field_tyname},")?; + } + writeln!(f, "}}\n")?; + + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); + ((*union_ty.name).clone(), borrowed_tyname) + }, + Ty::Enum(enum_ty) => { + assert!(enum_ty.attrs.is_empty(), "don't yet know how to apply attrs to enums"); + + // Emit an actual enum decl + writeln!(f, "#[repr(C)]")?; + writeln!(f, "enum {} {{", enum_ty.name)?; + for variant in &enum_ty.variants { + let variant_name = &variant.name; + writeln!(f, " {variant_name},")?; + } + writeln!(f, "}}\n")?; + + ((*enum_ty.name).clone(), None) + }, + Ty::Tagged(tagged_ty) => { + assert!(tagged_ty.attrs.is_empty(), "don't yet know how to apply attrs to tagged unions"); + + let has_borrows = tagged_ty.variants.iter().any(|v| v.fields.as_ref().map(|fields| fields.iter().any(|field|state.borrowed_tynames.contains_key(&field.ty))).unwrap_or(false)); + + // Emit an actual enum decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; + } else { + writeln!(f, "enum {} {{", tagged_ty.name)?; + } + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + if let Some(fields) = &variant.fields { + writeln!(f, " {variant_name} {{")?; + for field in fields { + let field_name = &field.ident; + let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); + writeln!(f, " {field_name}: {field_tyname},")?; + } + } else { + writeln!(f, " {variant_name},")?; + } + writeln!(f, " }}")?; + } + writeln!(f, "}}\n")?; + + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); + ((*tagged_ty.name).clone(), borrowed_tyname) + }, + Ty::Alias(AliasTy { name, real, attrs }) => { + assert!(attrs.is_empty(), "don't yet know how to apply attrs to type aliases"); + + // Emit an actual type alias decl + if let Some(real_tyname) = state.borrowed_tynames.get(&real) { + writeln!(f, "type {name}<'a> = {real_tyname};\n")?; + ((**name).clone(), Some(format!("{name}<'a>"))) + } else { + let real_tyname = &state.tynames[&real]; + writeln!(f, "type {name} = {real_tyname};\n")?; + ((**name).clone(), None) + } + }, + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + (state.tynames[&real_ty].clone(), state.borrowed_tynames.get(&real_ty).cloned()) + }, + }; + + Ok(names) + } + + fn convention_decl(&self, convention: CallingConvention) -> &'static str { + match convention { + CallingConvention::All => { + unreachable!("CallingConvention::All is sugar that shouldn't reach here") + } + CallingConvention::Handwritten => { + unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") + } + CallingConvention::C => "C", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => "vectorcall", + } + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_rust_prefix( + &self, + f: &mut dyn Write, + state: &GenState, + ) -> Result<(), GenerateError> { + if state.test.convention == CallingConvention::Vectorcall { + writeln!(f, "#![feature(abi_vectorcall)]")?; + } + // Load test harness "headers" + writeln!(f, "{}", RUST_TEST_PREFIX)?; + writeln!(f)?; + + Ok(()) + } + + fn generate_signature( + &self, + f: &mut dyn Write, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.test.typed.realize_func(func); + + write!(f, "fn {}(", function.name)?; + + // Add inputs + for (_idx, arg) in function.inputs.iter().enumerate() { + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}, ", arg_name, arg_ty)?; + } + // Add outparams + for (_idx, arg) in function.outputs.iter().enumerate() { + let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + if !is_outparam { + // Handled in next loop + continue; + } + // NOTE: we intentionally don't use the "borrowed" tyname + // as we still don't need lifetimes here! + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}, ", arg_name, arg_ty)?; + } + // Add normal returns + let mut has_normal_return = false; + for (_idx, arg) in function.outputs.iter().enumerate() { + let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + if is_outparam { + // Already handled + continue; + } + if has_normal_return { + return Err(GenerateError::RustUnsupported(format!("multiple normal returns (should this be a tuple?)"))); + } + has_normal_return = true; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, ") -> {}", arg_ty)?; + } + if !has_normal_return { + write!(f, ")")?; + } + Ok(()) + } + +/* + /// If this value defines a nominal type, this will spit out: + /// + /// * The type name + /// * The forward-declaration of that type + /// + /// To catch buggy test definitions, you should validate that all + /// structs that claim a particular name have the same declaration. + /// This is done in write_rust_prefix. + fn rust_forward_decl(&self, val: &Val) -> Result, GenerateError> { + use Val::*; + match val { + Struct(name, fields) => { + let mut results = vec![]; + for field in fields.iter() { + results.extend(self.rust_forward_decl(field)?); + } + let mut output = String::new(); + let ref_name = name.to_string(); + output.push_str("\n#[repr(C)]\n"); + output.push_str(&format!("pub struct {name} {{\n")); + for (idx, field) in fields.iter().enumerate() { + let line = format!( + " {}: {},\n", + FIELD_NAMES[idx], + self.rust_nested_type(field)? + ); + output.push_str(&line); + } + output.push('}'); + results.push((ref_name, output)); + Ok(results) + } + Array(vals) => self.rust_forward_decl(&vals[0]), + Ref(pointee) => self.rust_forward_decl(pointee), + _ => Ok(vec![]), + } + } + + /// The decl to use for a local var (reference-ness stripped) + fn rust_var_decl(&self, val: &Val, var_name: &str) -> Result { + if let Val::Ref(pointee) = val { + Ok(self.rust_var_decl(pointee, var_name)?) + } else { + Ok(format!("let {var_name}: {}", self.rust_arg_type(val)?)) + } + } + + /// The decl to use for a function arg (apply referenceness) + fn rust_arg_decl(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(pointee) = val { + Ok(format!("{arg_name}: &{}", self.rust_arg_type(pointee)?)) + } else { + Ok(format!("{arg_name}: {}", self.rust_arg_type(val)?)) + } + } + + /// If the return type needs to be an out_param, this returns it + fn rust_out_param( + &self, + val: &Val, + out_param_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(format!( + "{out_param_name}: &mut {}", + self.rust_arg_type(pointee)? + ))) + } else { + Ok(None) + } + } + + /// If the return type needs to be an out_param, this returns it + fn rust_out_param_var( + &self, + val: &Val, + output_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(format!( + "let mut {output_name}: {} = {};", + self.rust_arg_type(pointee)?, + self.rust_default_val(pointee)? + ))) + } else { + Ok(None) + } + } + + /// How to pass an argument + fn rust_arg_pass(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(_) = val { + Ok(format!("&{arg_name}")) + } else { + Ok(arg_name.to_string()) + } + } + + /// How to return a value + fn rust_var_return( + &self, + val: &Val, + var_name: &str, + out_param_name: &str, + ) -> Result { + if let Val::Ref(_) = val { + Ok(format!("*{out_param_name} = {var_name};")) + } else { + Ok(format!("return {var_name};")) + } + } + + /// The type name to use for this value when it is stored in args/vars. + fn rust_arg_type(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let out = match val { + Ref(pointee) => format!("*mut {}", self.rust_arg_type(pointee)?), + Ptr(_) => "*mut ()".to_string(), + Bool(_) => "bool".to_string(), + Array(vals) => format!("[{}; {}]", self.rust_arg_type(&vals[0])?, vals.len()), + Struct(name, _) => name.to_string(), + Float(FloatVal::c_double(_)) => "f64".to_string(), + Float(FloatVal::c_float(_)) => "f32".to_string(), + Int(int_val) => match int_val { + c__int128(_) => { + if STRUCT_128 { + "FfiI128".to_string() + } else { + "i128".to_string() + } + } + c_int64_t(_) => "i64".to_string(), + c_int32_t(_) => "i32".to_string(), + c_int16_t(_) => "i16".to_string(), + c_int8_t(_) => "i8".to_string(), + c__uint128(_) => { + if STRUCT_128 { + "FfiU128".to_string() + } else { + "u128".to_string() + } + } + c_uint64_t(_) => "u64".to_string(), + c_uint32_t(_) => "u32".to_string(), + c_uint16_t(_) => "u16".to_string(), + c_uint8_t(_) => "u8".to_string(), + }, + }; + Ok(out) + } + + /// The type name to use for this value when it is stored in composite. + /// + /// This is separated out in case there's a type that needs different + /// handling in this context to conform to a layout (i.e. how C arrays + /// decay into pointers when used in function args). + fn rust_nested_type(&self, val: &Val) -> Result { + self.rust_arg_type(val) + } + + /// An expression that generates this value. + fn rust_val(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let out = match val { + Ref(pointee) => self.rust_val(pointee)?, + Ptr(addr) => format!("{addr:#X} as *mut ()"), + Bool(val) => format!("{val}"), + Array(vals) => { + let mut output = String::new(); + output.push('['); + for elem in vals { + let part = format!("{}, ", self.rust_val(elem)?); + output.push_str(&part); + } + output.push(']'); + output + } + Struct(name, fields) => { + let mut output = String::new(); + output.push_str(&format!("{name} {{ ")); + for (idx, field) in fields.iter().enumerate() { + let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(FloatVal::c_double(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Float(FloatVal::c_float(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Int(int_val) => match int_val { + c__int128(val) => { + if STRUCT_128 { + format!("FfiI128::new({val})") + } else { + format!("{val}") + } + } + c_int64_t(val) => format!("{val}"), + c_int32_t(val) => format!("{val}"), + c_int16_t(val) => format!("{val}"), + c_int8_t(val) => format!("{val}"), + c__uint128(val) => { + if STRUCT_128 { + format!("FfiU128::new({val:#X})") + } else { + format!("{val:#X}") + } + } + c_uint64_t(val) => format!("{val:#X}"), + c_uint32_t(val) => format!("{val:#X}"), + c_uint16_t(val) => format!("{val:#X}"), + c_uint8_t(val) => format!("{val:#X}"), + }, + }; + Ok(out) + } + + /// A suitable default value for this type + fn rust_default_val(&self, val: &Val) -> Result { + use Val::*; + let out = match val { + Ref(pointee) => self.rust_default_val(pointee)?, + Ptr(_) => "0 as *mut ()".to_string(), + Bool(_) => "false".to_string(), + Array(vals) => { + let mut output = String::new(); + output.push('['); + for elem in vals { + let part = format!("{}, ", self.rust_default_val(elem)?); + output.push_str(&part); + } + output.push(']'); + output + } + Struct(name, fields) => { + let mut output = String::new(); + output.push_str(&format!("{name} {{ ")); + for (idx, field) in fields.iter().enumerate() { + let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_default_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(..) => "0.0".to_string(), + Int(IntVal::c__int128(..)) => { + if STRUCT_128 { + "FfiI128::new(0)".to_string() + } else { + "0".to_string() + } + } + Int(IntVal::c__uint128(..)) => { + if STRUCT_128 { + "FfiU128::new(0)".to_string() + } else { + "0".to_string() + } + } + Int(..) => "0".to_string(), + }; + Ok(out) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn rust_write_val( + &self, + val: &Val, + to: &str, + from: &str, + is_var_root: bool, + ) -> Result { + use std::fmt::Write; + let mut output = String::new(); + for path in self.rust_var_paths(val, from, is_var_root)? { + writeln!(output, " WRITE_FIELD.unwrap()({to}, &{path} as *const _ as *const _, core::mem::size_of_val(&{path}) as u32);").unwrap(); + } + write!(output, " FINISHED_VAL.unwrap()({to});").unwrap(); + + Ok(output) + } + + /// Compute the paths to every subfield of this value, with `from` + /// as the base path to that value, for rust_write_val's use. + fn rust_var_paths( + &self, + val: &Val, + from: &str, + is_var_root: bool, + ) -> Result, GenerateError> { + let paths = match val { + Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + vec![format!("{from}")] + } + Val::Struct(_name, fields) => { + let mut paths = vec![]; + for (idx, field) in fields.iter().enumerate() { + let base = format!("{from}.{}", FIELD_NAMES[idx]); + paths.extend(self.rust_var_paths(field, &base, false)?); + } + paths + } + Val::Ref(pointee) => { + if is_var_root { + self.rust_var_paths(pointee, from, false)? + } else { + let base = format!("(*{from})"); + self.rust_var_paths(pointee, &base, false)? + } + } + Val::Array(vals) => { + let mut paths = vec![]; + for (i, elem) in vals.iter().enumerate() { + let base = format!("{from}[{i}]"); + paths.extend(self.rust_var_paths(elem, &base, false)?); + } + paths + } + }; + + Ok(paths) + } + */ +} diff --git a/src/cli.rs b/src/cli.rs index 6914f0c..dab5296 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -128,7 +128,7 @@ pub fn make_app() -> Config { .map(String::from) .collect(); - let rustc_codegen_backends = matches + let rustc_codegen_backends: Vec<(String, String)> = matches .values_of("add-rustc-codegen-backend") .into_iter() .flatten() diff --git a/src/main.rs b/src/main.rs index 613cab9..0989bce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ mod abis; mod cli; mod procgen; mod report; +mod test_format; use abis::*; use linked_hash_map::LinkedHashMap; @@ -320,7 +321,7 @@ fn read_test_manifest(test_file: &Path) -> Result { })?; Ok(test) } else if ext == "kdl" { - if let Err(e) = do_kdl(test_file, input) { + if let Err(e) = test_format::do_kdl(test_file, input) { println!("failed to read doc! {:?}", e); std::process::exit(-1); } else { @@ -332,138 +333,6 @@ fn read_test_manifest(test_file: &Path) -> Result { } -struct NominalTy { - name: TyName, - attrs: Vec, - decls: Vec, -} - -struct TyAttr { - langs: Option, - impls: Option, -} - -struct TyDecl { - langs: Option, - impls: Option, - decl: Decl, -} - -enum Decl { - Alias(AliasDecl), - Union(UnionDecl), - Enum(EnumDecl), - TaggedUnion(TaggedUnionDecl), -} - -struct AliasDecl { - ty: Ty, -} -struct StructDecl { - fields: Vec<(Option, Ty)>, -} -struct UnionDecl { - fields: Vec<(Option, Ty)>, -} -struct EnumDecl { - // engh ideally we would have EnumDecl "know" its tag size - // but that doesn't really play nice with anything so let's - // say i128 tag should be enough for anyone? - fields: Vec<(Option, Option)>, -} -struct TaggedUnionDecl { - fields: Vec<(Option, Option)>, -} - -enum Ty { - Nominal(TyName), - Array(Box, usize), - ByRef(Box), -} - -type TyName = Ident; -type Ident = String; - -#[derive(Debug, thiserror::Error, miette::Diagnostic)] -enum KdlError { - #[error(transparent)] - #[diagnostic(transparent)] - UnknownTyNode(#[from] UnknownTyNodeError), -} - -pub type SourceFile = std::sync::Arc; - -#[derive(Debug, thiserror::Error, miette::Diagnostic)] -#[error("unknown node for a type: {}", node_name)] -#[diagnostic(help("we expect 'decl' or 'attr' nodes"))] -struct UnknownTyNodeError { - #[source_code] - source_code: SourceFile, - node_name: String, - #[label("here")] - span: miette::SourceSpan, -} - -fn do_kdl(test_file: &Path, input: String) -> Result { - let doc = input.parse::()?; - let src = std::sync::Arc::new(miette::NamedSource::new(test_file.to_string_lossy().to_owned(), input)); - - const NODE_TYPES: &str = "types"; - const NODE_FUNCS: &str = "funcs"; - - if let Some(types) = doc.get(NODE_TYPES) { - let tys = HashMap::::new(); - for ty in types.children().into_iter().flat_map(|d| d.nodes()) { - let ty_name = ty.name().value().to_owned(); - for node in ty.children().into_iter().flat_map(|d| d.nodes()) { - match node.name().value() { - "decl" => { - // println!(" decl"); - } - "attr" => { - // println!(" attr"); - } - unknown => { - warn!("{:?}", miette::Report::from(UnknownTyNodeError { - source_code: src.clone(), - node_name: unknown.to_owned(), - span: *node.span(), - })); - } - } - } - } - println!("got types!"); - } - - if let Some(funcs) = doc.get(NODE_FUNCS) { - // println!("got funcs!"); - for func in funcs.children().into_iter().flat_map(|d| d.nodes()) { - // println!(" func {}", func.name()); - for node in func.children().into_iter().flat_map(|d| d.nodes()) { - match node.name().value() { - "args" => { - // println!(" args"); - } - "outs" => { - // println!(" outs"); - } - "conventions" => { - // println!(" conventions"); - } - unknown => { - // println!(" unknown {}", unknown); - } - } - } - } - } - - println!("kdl done"); - std::process::exit(0); - -} - fn generate_test_src( test: &Test, diff --git a/src/test_format.rs b/src/test_format.rs new file mode 100644 index 0000000..efe4d73 --- /dev/null +++ b/src/test_format.rs @@ -0,0 +1,29 @@ +use std::{path::Path, collections::HashMap, sync::Arc}; + +use kdl_script::types::{ArrayTy, RefTy, AliasTy}; + +use crate::abis::Test; +pub fn do_kdl(test_file: &Path, input: String) -> Result { + use std::fmt::Write; + let mut compiler = kdl_script::Compiler::new(); + let typed = compiler.compile_string(&test_file.to_string_lossy(), input)?; + + let env = Arc::new(kdl_script::PunEnv { + lang: "rust".to_string(), + }); + let graph = Arc::new(typed.definition_graph(&env)?); + + let abi = crate::abis::rust2::RustcAbiImpl::new(None); + let mut output = Vec::new(); + let test = crate::abis::rust2::Test { + typed, + env, + graph, + convention: crate::abis::CallingConvention::C, + }; + + abi.generate_caller(&mut output, &test, test.typed.all_funcs()).unwrap(); + let output = String::from_utf8_lossy(&output); + println!("{output}"); + todo!() +} \ No newline at end of file diff --git a/tests/kdl/test.kdl b/tests/kdl/test.kdl.tmp similarity index 90% rename from tests/kdl/test.kdl rename to tests/kdl/test.kdl.tmp index d2c99c9..38c6d70 100644 --- a/tests/kdl/test.kdl +++ b/tests/kdl/test.kdl.tmp @@ -1,202 +1,211 @@ -// Experimental sketches of specifying abi-checker tests with kdl. -// See: https://github.com/Gankra/abi-checker -// -// Basically we generate source code for different languages (c, rust, ...) -// from these abstract type/function definitions and then have them call eachother -// and check that the values didn't get corrupted along the way. - - -// Custom type definitions we want to pass across the ABI/convention of interest. -// -// By default type definitions/attributes are intended to be language agnostic. -// AbiImpl Backends (rustc, cc, cxx, swiftc, ...) is responsible for lowering the -// agnostic definition to its own concepts (or say "I don't support this"). -// -// e.g. u32 => uint32_t for the cc/cxx backends, Uint32 in swiftc -// -// The agnostic form is often psuedo-rust because it has good type names/syntax. -// Because we're interested in FFI, type definitions default to #[repr(C)]. -// Backends may support an opt-out for this like `attr lang="rust" #[repr(rust)]` -types { - MyStruct { - // Backends should emit a packed attribute for this struct - attr "packed" - garbage "wow" - decl "struct" { - x "u32" - y "u8" - z "i16" - } - more-garbage x="y" { - "garbage!!" - bad - } - } - - // typedef my_u32 = u32 - MyU32 { - decl "alias" "u32" - } - - // Here we demonstrate ability to specify different lowerings for different - // languages. In this case a transparent newtype in rust, a simple typedef in C. - // - // Both "attr" and "decl" can be prefixed with either lang="$LANG" or "impl=$COMPILER" - // to specify that they only apply in certain cases. The exact merging/fallback behaviour - // is tbd. - // - // Example langs: "rust", "c", "c++" - // Example impls: "rustc", "cc", "gcc", "g++", .. - // - // 💭 Possible lang families?: "~c" (c, c++, obj-c, ...) - U64Meters { - attr lang="rust" "#[repr(transparent)]" - decl lang="rust" "struct" { - // Fields can be named `_`, implying they should be position or autonamed - // In the case of rust, this could lower to a tuple struct. - _ "u64" - } - - decl lang="c" "alias" "u64" - } - - // Typical union - MyUnion { - decl "union" { - x "u32" - y "u8" - } - } - - // C-style enum - MyEnum { - // You can specify that the tag should have a specific backing type - // which lowers to things like `#[repr(u8)]` or `enum class my_enum: uint8_t` - attr "tag" "u8" - decl "enum" { - x - y - z - } - } - - // Rust-style tagged union - // - // As previously stated, this will default to `#[repr(C)]` in rust, which is the - // "obvious" externally-tagged layout with a c-enum-sized tag as defined in - // https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md - // - // This is the worst layout, the better one is `#[repr(rust)]` + `#[repr(u8)]` - // (also spec'd in RFC, internally tagged). - MyTaggedUnion { - decl "tagged" { - x - y "bool" - } - } - - // A struct with a trailing empty array - MyTrailingStruct { - decl "struct" { - // decls can reference other decls (backend's problem to handle ordering) - header "Header" - // Rust array syntax, can nest, can reference types - buf "[u64; 0]" - } - } - - Header { - decl "struct" { - len "usize" - cap "usize" - is_magic "bool" - } - } - -} - - - - -// Function decls, which are the actual tests that will run. -// -// We will, for each AbiImpl x AbiImpl x CallingConvention: -// -// * generate the callee and caller with the two AbiImpls and spec'd CallingConvention (fastcall::rustc_calls_cc) -// * compile them to static libs -// * link them into a harness dll/exe that calls each of the callers, which calls its paired callee -// * have each side report the bytes of each arg/subfield -// * compare the two reports for equality -funcs { - // A function that passes a u32 and my_struct (defined in `types`) by-value. - // - // By default functions are assumed valid for all conventions/impls/langs. - // - // By default values will be "byte grafitti", containing the logical field and byte index. - // The high nibble contains the field index, the low nibble the byte index. For instance, - // In the following decl we will have: - // - // ``` - // a = 0x00_01_02_03 - // b = MyStruct { - // x = 0x10_11_12_13 - // y = 0x20 - // z = 0x30_31 - // } - // ``` - // - // When ABI mismatches do happen, we will dump the offending bytes, and this tagging - // scheme makes it easier to identify where different bytes came from in the caller. - // (What this looks like for things with forbidden values is TBD but presumably we'll - // do some kind of modulo cycling through the vals.) - // - // outs are return values, passed back by the callee. - simple { - args { - a "u32" - b "MyStruct" - } - outs { - _ "bool" - } - } - - // Varargs can be declared by having an arg with the name "..." - // Arguments that follow "..." are not part of the declared interface, - // but will be passed by the caller and expected by the callee. - varargs { - args { - _ "u8" - _ "bool" - "..." - _ "u32" - } - } - - // Explicit values can be provided if desired - explicit_vals { - conventions "c" "fastcall" - args { - _ "u8" 0x69 - b "MyUnion" { - x 12 - } - } - } - - // Args and outputs can be made "by reference", which means they will be - // passed as a pointer, but the pointee is the logical value that will be - // checked. This is in contrast to the builtin "ptr" value which is treated like spicy usize. - // - // Return values that are by-ref will be lowered to out-params. - by_ref { - args { - _ "&MyEnum" - _ "&MyEnum" - } - outs { - _ "&bool" - _ "u32" - } - } +// Experimental sketches of specifying abi-checker tests with kdl. +// See: https://github.com/Gankra/abi-checker +// +// Basically we generate source code for different languages (c, rust, ...) +// from these abstract type/function definitions and then have them call eachother +// and check that the values didn't get corrupted along the way. + + +// Custom type definitions we want to pass across the ABI/convention of interest. +// +// By default type definitions/attributes are intended to be language agnostic. +// AbiImpl Backends (rustc, cc, cxx, swiftc, ...) is responsible for lowering the +// agnostic definition to its own concepts (or say "I don't support this"). +// +// e.g. u32 => uint32_t for the cc/cxx backends, Uint32 in swiftc +// +// The agnostic form is often psuedo-rust because it has good type names/syntax. +// Because we're interested in FFI, type definitions default to #[repr(C)]. +// Backends may support an opt-out for this like `attr lang="rust" #[repr(rust)]` +types { + MyStruct { + // Backends should emit a packed attribute for this struct + @packed + /-garbage "wow" + struct { + x "u32" + y "u8" + z "i16" + } + /-more-garbage x="y" { + "garbage!!" + bad + } + } + + MyGenericStruct "" { + @packed + struct { + x "T" + y "U" + z "OtherGeneric" + } + } + + // typedef my_u32 = u32 + MyU32 { + alias "u32" + } + + // Here we demonstrate ability to specify different lowerings for different + // languages. In this case a transparent newtype in rust, a simple typedef in C. + // + // Both "attr" and "decl" can be prefixed with either lang="$LANG" or "impl=$COMPILER" + // to specify that they only apply in certain cases. The exact merging/fallback behaviour + // is tbd. + // + // Example langs: "rust", "c", "c++" + // Example impls: "rustc", "cc", "gcc", "g++", .. + // + // 💭 Possible lang families?: "~c" (c, c++, obj-c, ...) + U64Meters { + @ lang="rust" "#[repr(transparent)]" + struct lang="rust" { + // Fields can be named `_`, implying they should be position or autonamed + // In the case of rust, this could lower to a tuple struct. + _ "u64" + } + + alias lang="c" "u64" + } + + // Typical union + MyUnion { + union { + x "u32" + y "u8" + } + } + + // C-style enum + MyEnum { + // You can specify that the tag should have a specific backing type + // which lowers to things like `#[repr(u8)]` or `enum class my_enum: uint8_t` + @tag "u8" + enum { + x + y + z + } + } + + // Rust-style tagged union + // + // As previously stated, this will default to `#[repr(C)]` in rust, which is the + // "obvious" externally-tagged layout with a c-enum-sized tag as defined in + // https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md + // + // This is the worst layout, the better one is `#[repr(rust)]` + `#[repr(u8)]` + // (also spec'd in RFC, internally tagged). + MyTaggedUnion { + tagged { + x + y "bool" + } + } + + // A struct with a trailing empty array + MyTrailingStruct { + struct { + // decls can reference other decls (backend's problem to handle ordering) + header "Header" + // Rust array syntax, can nest, can reference types + buf "[u64; 0]" + } + } + + Header { + struct { + len "usize" + cap "usize" + is_magic "bool" + } + } + +} + + + + +// Function decls, which are the actual tests that will run. +// +// We will, for each AbiImpl x AbiImpl x CallingConvention: +// +// * generate the callee and caller with the two AbiImpls and spec'd CallingConvention (fastcall::rustc_calls_cc) +// * compile them to static libs +// * link them into a harness dll/exe that calls each of the callers, which calls its paired callee +// * have each side report the bytes of each arg/subfield +// * compare the two reports for equality +funcs { + // A function that passes a u32 and my_struct (defined in `types`) by-value. + // + // By default functions are assumed valid for all conventions/impls/langs. + // + // By default values will be "byte grafitti", containing the logical field and byte index. + // The high nibble contains the field index, the low nibble the byte index. For instance, + // In the following decl we will have: + // + // ``` + // a = 0x00_01_02_03 + // b = MyStruct { + // x = 0x10_11_12_13 + // y = 0x20 + // z = 0x30_31 + // } + // ``` + // + // When ABI mismatches do happen, we will dump the offending bytes, and this tagging + // scheme makes it easier to identify where different bytes came from in the caller. + // (What this looks like for things with forbidden values is TBD but presumably we'll + // do some kind of modulo cycling through the vals.) + // + // outs are return values, passed back by the callee. + simple { + args { + a "u32" + b "MyStruct" + } + outs { + _ "bool" + } + } + + // Varargs can be declared by having an arg with the name "..." + // Arguments that follow "..." are not part of the declared interface, + // but will be passed by the caller and expected by the callee. + varargs { + args { + _ "u8" + _ "bool" + "..." + _ "u32" + } + } + + // Explicit values can be provided if desired + explicit_vals { + conventions "c" "fastcall" + args { + _ "u8" 0x69 + b "MyUnion" { + x 12 + } + } + } + + // Args and outputs can be made "by reference", which means they will be + // passed as a pointer, but the pointee is the logical value that will be + // checked. This is in contrast to the builtin "ptr" value which is treated like spicy usize. + // + // Return values that are by-ref will be lowered to out-params. + by_ref { + args { + _ "&MyEnum" + _ "&MyEnum" + } + outs { + _ "&bool" + _ "u32" + } + } } \ No newline at end of file diff --git a/tests/kdl/types.kdl b/tests/kdl/types.kdl new file mode 100644 index 0000000..e86286f --- /dev/null +++ b/tests/kdl/types.kdl @@ -0,0 +1,61 @@ +struct "Simple" { + a "i32" +} + +alias "Simple2" "Simple" + +struct "Complex" { + elems1 "[Simple;10]" + elems2 "[Simple;9]" + val "Simple" + reffed "&Simple" + array_ref "&[&Simple;2]" + opaque "ptr" + flag "bool" +} + +enum "ErrorCode" { + Ok 0 + FileNotFound 1 + Bad -3 +} + +tagged "OptionI32" { + None + Some { _0 "i32"; } +} + +tagged "MyResult" { + Ok { _0 "[&f128;3]"; } + Some { _0 "ErrorCode"; } +} + +union "Life" { + simple "Simple2" + complex "Complex" +} + +fn "func1" { + inputs { a "Complex"; b "Simple"; } + outputs { out "()"; } +} + +fn "func2" { + inputs { + a "[Complex;2]" + b "[Simple;10]" + c "()" + d "f128" + } + outputs { + out "Complex" + } +} + +fn "arraytime" { + inputs { + a "[i32;4]" + b "[[i32;4];5]" + c "[[[&Simple;1];2];3]" + } +} \ No newline at end of file From 917ed0e507060ee8ba42cd1d752ff6da82a856e4 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 10 Dec 2023 10:36:48 -0500 Subject: [PATCH 03/44] WIP --- CODEGEN.md | 144 +++++++++++++++++++++++++++++++++++ src/abis/rust2.rs | 188 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 314 insertions(+), 18 deletions(-) create mode 100644 CODEGEN.md diff --git a/CODEGEN.md b/CODEGEN.md new file mode 100644 index 0000000..5d79dda --- /dev/null +++ b/CODEGEN.md @@ -0,0 +1,144 @@ +# abi-cafe Codegen + +abi-cafe exists to test that two languages/compilers/backends agree on ABIs for the purposes of FFI The principle of the tool is as follows: + +1. Take something morally equivalent to a C header (a bunch of types and function signatures) +2. Define codegen backends ("ABIs") that know how to take such a header and: + * generate code for the "caller" (the user of the function) + * generate code for the "callee" (the impl of the function) + * compile the result +3. For each ABI pairing we're interested in, link and run the two halves together + +At a lower level we: + +* define a test harness with callbacks for "hi i'm the callee, i think arg1.0.3 = 7" +* have the codegen backends generate code that invokes those callbacks +* statically link the two halves together into a dylib, with the caller defining a "run the test" entrypoint +* have the harness dlopen and run the dylib +* have the harness check that both sides reported the exact same values + +However when we discover an issue, we want to be able to explain it to humans, so there are some additional features: + +* Codegen backends are expected to generate "graffiti" values, where each byte of a value signals roughly where it was supposed to come from. e.g. the 2nd byte of the 3rd value should be 0x32 (both indices are modulo 16). +* If a particular function fails (or is just requested in isolation), the codegen backend should be able to generate a cleaned up standalone version of the code for just that function for filing issues or investigating on godbolt -- only the function and types we care about are included, and all the callback gunk is replaced by prints or nothing at all. + +Within abi-cafe we regard each header as a "test suite" and each function as a "test". Or if you prefer, headers are tests, functions are subtests (FIXME: double-check which set of terminology the code actually uses). Batching multiple functions into one "header" serves the following functions: + +* type definitions can be shared, making things easier to write/maintain +* performance is significantly improved by replacing 100,000 linker calls with 1000 (there's a lot of procedural generation and combinatorics here) +* results are more organized (you can see that all your failures are "in the i128 tests") + + + +# kdl-script: the header language for abi weirdos + +See [kdl-script's docs for details](https://github.com/Gankra/kdl-script#kdl-script), but we'll give you a quick TLDR here too. Especially pay attention to [Pun Types](https://github.com/Gankra/kdl-script#pun-types) which are a totally novel concept that exists purely for the kind of thing abi-cafe is interested in doing. See [kdl_script::types for how we use kdl-script's compiler](https://docs.rs/kdl-script/latest/kdl_script/types/index.html) + + +## kdl-script tldr + +Rather than relying on a specific language's format for defining our "headers", we want a language-agnostic(ish) solution that needs to hold two contradictory concepts in its head: + +* The definitions should be vague enough that multiple languages can implement it +* The definitions should be specific enough that we can explore the breadth of the languages' ABIs + +And so we made [kdl-script](https://github.com/Gankra/kdl-script), which is a silly toy language whose syntax happens to be a [kdl document](https://kdl.dev/) for literally no other reason than "it looks kind of like rust code and it's extremely funny". + +The kdl-script language includes: + +* a set of types, each with a unique type id: + * primitives (i32, f64, bool, opaque pointer, etc.) + * nominal types (structs, unions, tagged-unions, c-like enums) + * structural types (fixed-length arrays) + * alias types (aliases, [puns](https://github.com/Gankra/kdl-script#pun-types)) + * references (tells to pass by-ref) +* a set of function signatures using those types with + * inputs + * outputs (including outparams, which are just outputs that contain references) + * calling conventions (c, fastcall, rust, etc.) + +All of these can also be decorated with attributes for e.g. overaligning a struct or whatever. Pun types also let different languages define completely different layouts, to check that non-trivial cross-language FFI puns Work. + + +## using kdl-script + +The kdl-script compiler will parse and type our program, and gives us an API that should make it relatively simple for a codegen backend to do its job. Per [kdl_script::types](https://docs.rs/kdl-script/latest/kdl_script/types/index.html), we ask it to parse the "header" into a `TypedProgram`, then each codegen backend lowers that to a `DefinitionGraph` (resolving [puns](https://github.com/Gankra/kdl-script#pun-types)). + +We then pass `DefinitionGraph::definitions` a list of the functions we want to generate code for, and it produces an iterator of `Definitions` the codegen backend needs to generate in exactly that order (forward-declare a type, define a type, define a function). + +Languages that don't need forward-declarations are technically free to ignore those messages, but in general a type will always be defined before anything that refers to it, and the forward-declarations exist to break circular dependencies. As such even the Rust backend benefits from those messages, as it can use it as a signal to intern a type's name before anything else uses that name. + +Note also that you will receive messages to "define" types which otherwise wouldn't normally need to be defined like primitives or structural-types (arrays). This is because kdl-script is trying to not make any assumptions about what's built into the target language. Most backends will treat these messages as equivalent to forward-declares: just a signal for type name interning. + +To allow for interning and circular definitions, kdl-script will always refer to types by `TyIdx` (type id). `TypedProgram::realize_ty` turns those type ids into a proper description of the type like "this is a struct named XYZ with fields A, B, C", which can then be used to generate the type definition. Because kdl-script handles sorting the type definitions you will never need to recursively descend into the fields to work out their types -- if you've been interning type names as you go you should be able to just resolve them by TyIdx. + +Here are some quirks to keep in mind: + + +### kdl-script can ask for gibberish and that's ok + +Different languages contain different concepts, and so kdl-script necessarily needs to be able to specify things that some codegen backends will have no reasonable implementation for. It's ok for the backend to return a `GenerateError::*Unsupported` in such a case. When comparing two languages this will not be treated as an error, and instead will be used to just disable that particular test. + +This allows us to define a bunch of generic tests with little concern for which languages support what. When pairing up two ABIs we will just test the functionality that both languages agree they can implement. + +FIXME(?): right now the granularity of this is per-header (suite) instead of per-function (test). It would be cool if granularity was per-function, but this would require two things: + +* handling "i can't generate this type" errors by populating type interners with poison values that bubble up until they hit a function, so that we can mark the function as unimplementable (this sounds good and desirable for diagnostics anyway) +* rerunning the whole process again whenever two ABIs we want to pair up disagree on the functions they can implement, generating the intersection of the two (kinda a pain in the ass for our abstractions, which want to be able to generate each callee/caller independently and then blindly link the pairings up). + + +### type aliases break type equality for beauty + +Many compilers attempt to "evaporate" a type alias as soon as possible for the sake of type ids defining strict type equality. Because we don't actually *care* about type equality except for the purposes of interning type names, kdl-script and abi-cafe treat type aliases as separate types. So `[u32; 5]` and `[MyU32Alias; 5]` will have different type ids, because we want to be able to generate code that actually contains either `[u32; 5]` or `[MyU32Alias; 5]`, depending on what the particular usage site actually asked for. + +I 100% get why most compiler toolchains don't try to do this, but for our purposes it's easy for us to do and produces better output. + +FIXME: we actually don't go *quite* as far as we could. This is valid Rust: + +```rust +struct RealStruct { x: u32 } +type MyStruct = RealStruct; + +let x = MyStruct { x: 0 }; +``` + +This actually wouldn't be terribly hard to do, we could tweak "generate a value" to take an optional type alias, so that when a type alias recursively asks the real type to "generate a value" it can tweak its own name on the fly (since "generate a value" is not too interned). + + +### references are a mess + +I'm so sorry. The "an output that contains a reference is sugar for an explicit outparam" shit was an absolute feverdream that really doesn't need to exist BUT here we are. + + +### annotations are half-baked + +Stubbed out the concept, but it's all very "pass a string through" right now so nothing uses them yet. + + +### variants are half-baked + +You can declare unions, tagged-unions, and c-like enums, but it's not obvious how abi-cafe should select which variant to use when generating values to pass across the ABI boundary. + +Currently abi-cafe always uses "the first one". Presumably it should be allowed to select a "random" (but deterministic?) one. It's annoying to think about missing a bug because ABI-cafe always pick MyEnum::ThirdVariant for the third argument of a function. + +It might also be reasonable to introduce a concept to kdl-script that `Option::Some` is a valid type name to use in a function signature, signaling that this is an Option, and that the Some variant should be used when generating values to pass (not super clear on how that would look codewise, but probably similar to how Pun Types both exist and don't exist, requiring an extra level of resolving to get the "real" type?). + + + + +### Coming Soon™ + +* varargs + * sketch: have a "..." input arg signal all the subsequent args should be passed as varargs + * did i hallucinate that swift supports multiple varargs lists? i think it makes sense with named args? +* simd types + * sketch: as primitives? or treated like structural types like arrays? (`[u32 x 5]`?) + * this is apparently an ABI minefield that would benefit from more attention +* tuples? + * not exactly complex to do, just not clear what would use these +* slices? + * very rust-specific... +* `_BitInt(N)` + * I can't believe C is actually standardizing these what a time to be alive +* "the whole fucking Swift ABI" + * lmfao sure thing buddy \ No newline at end of file diff --git a/src/abis/rust2.rs b/src/abis/rust2.rs index 06c790c..5045c22 100644 --- a/src/abis/rust2.rs +++ b/src/abis/rust2.rs @@ -1,3 +1,5 @@ +//! Rust(c) codegen backend backend + use std::sync::Arc; use kdl_script::types::{FuncIdx, ArrayTy, RefTy, AliasTy, Ty, TyIdx, PrimitiveTy}; @@ -16,6 +18,7 @@ pub struct RustcAbiImpl { codegen_backend: Option, } + pub struct Test { pub typed: Arc, pub env: Arc, @@ -81,7 +84,9 @@ impl RustcAbiImpl { for def in test.graph.definitions(query) { match def { - kdl_script::Definition::DeclareTy(_) | + kdl_script::Definition::DeclareTy(_) => { + todo!("we should intern this typename here!"); + } kdl_script::Definition::DeclareFunc(_) => { // nothing to do, rust doesn't need forward-declares }, @@ -102,7 +107,7 @@ impl RustcAbiImpl { // Generate the extern block for all the funcs we'll call let convention_decl = self.convention_decl(test.convention); writeln!(f, "extern \"{convention_decl}\" {{",)?; - for &func in &state.funcs { + for &func in &state.funcs { write!(f, " ")?; self.generate_signature(f, &state, func)?; writeln!(f, ";")?; @@ -120,7 +125,7 @@ impl RustcAbiImpl { } writeln!(f, "}}")?; - + Ok(()) } @@ -230,11 +235,15 @@ impl RustcAbiImpl { func: FuncIdx, ) -> Result<(), GenerateError> { let function = state.test.typed.realize_func(func); - for (_idx, arg) in function.inputs.iter().enumerate() { + let mut val_idx = 0; + for (arg_idx, arg) in function.inputs.iter().enumerate() { let arg_name = &arg.name; - //let ty_name = state&arg.ty + let ty_name = &state.tynames[&arg.ty]; + write!(f, " let {arg_name} = ")?; + self.generate_value(f, state, arg.ty, &mut val_idx)?; + writeln!(f, ";")?; } - + Ok(()) } @@ -271,7 +280,7 @@ impl RustcAbiImpl { (name.to_owned(), None) }, Ty::Array(ArrayTy { elem_ty, len }) => { - + let elem_tyname = &state.tynames[elem_ty]; let borrowed_tyname = state.borrowed_tynames.get(elem_ty).map(|elem_tyname| format!("[{elem_tyname}; {len}]")); (format!("[{elem_tyname}; {len}]"), borrowed_tyname) @@ -288,7 +297,7 @@ impl RustcAbiImpl { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { assert!(struct_ty.attrs.is_empty(), "don't yet know how to apply attrs to structs"); - + let has_borrows = struct_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); // Emit an actual struct decl @@ -326,13 +335,13 @@ impl RustcAbiImpl { writeln!(f, " {field_name}: {field_tyname},")?; } writeln!(f, "}}\n")?; - + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); ((*union_ty.name).clone(), borrowed_tyname) }, Ty::Enum(enum_ty) => { assert!(enum_ty.attrs.is_empty(), "don't yet know how to apply attrs to enums"); - + // Emit an actual enum decl writeln!(f, "#[repr(C)]")?; writeln!(f, "enum {} {{", enum_ty.name)?; @@ -341,12 +350,12 @@ impl RustcAbiImpl { writeln!(f, " {variant_name},")?; } writeln!(f, "}}\n")?; - + ((*enum_ty.name).clone(), None) }, Ty::Tagged(tagged_ty) => { assert!(tagged_ty.attrs.is_empty(), "don't yet know how to apply attrs to tagged unions"); - + let has_borrows = tagged_ty.variants.iter().any(|v| v.fields.as_ref().map(|fields| fields.iter().any(|field|state.borrowed_tynames.contains_key(&field.ty))).unwrap_or(false)); // Emit an actual enum decl @@ -377,7 +386,7 @@ impl RustcAbiImpl { }, Ty::Alias(AliasTy { name, real, attrs }) => { assert!(attrs.is_empty(), "don't yet know how to apply attrs to type aliases"); - + // Emit an actual type alias decl if let Some(real_tyname) = state.borrowed_tynames.get(&real) { writeln!(f, "type {name}<'a> = {real_tyname};\n")?; @@ -388,7 +397,7 @@ impl RustcAbiImpl { ((**name).clone(), None) } }, - + // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); @@ -399,6 +408,128 @@ impl RustcAbiImpl { Ok(names) } + pub fn generate_value( + &self, + f: &mut dyn Write, + state: &GenState, + ty: TyIdx, + val_idx: &mut usize, + ) -> Result<(), GenerateError> { + let names = match state.test.typed.realize_ty(ty) { + // Primitives are the only "real" values with actual bytes that advance val_idx + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::I16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::I32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::I64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::I128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + + PrimitiveTy::F32 => write!(f, "{}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::F64 => write!(f, "{}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::Bool => write!(f, "true")?, + PrimitiveTy::Ptr => { + if true { + write!(f, "{:X} as *mut ()", graffiti_primitive::(*val_idx))? + } else { + write!(f, "{:X} as *mut ()", graffiti_primitive::(*val_idx))? + } + }, + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have i256")))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have u256")))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f16")))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f128")))?, + }; + *val_idx += 1; + }, + Ty::Empty => { + write!(f, "()")?; + } + Ty::Ref(RefTy { pointee_ty }) => { + todo!("we need to forward declare this variable so we can pass it in") + } + Ty::Array(ArrayTy { elem_ty, len }) => { + write!(f, "[")?; + for arr_idx in 0..*len { + if arr_idx > 0 { + write!(f, ", ")?; + } + self.generate_value(f, state, *elem_ty, val_idx)?; + } + write!(f, "]")?; + }, + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let name = &struct_ty.name; + write!(f, "{name} {{ ")?; + for (field_idx, field) in struct_ty.fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + self.generate_value(f, state, field.ty, val_idx)?; + } + write!(f, " }}")?; + }, + Ty::Union(union_ty) => { + let name = &union_ty.name; + write!(f, "{name} {{ ")?; + // FIXME: have a way to pick the variant! + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + self.generate_value(f, state, field.ty, val_idx)?; + } + write!(f, " }}")?; + }, + Ty::Enum(enum_ty) => { + let name = &enum_ty.name; + // FIXME: have a way to pick the variant! + if let Some(variant) = enum_ty.variants.get(0) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + } + }, + Ty::Tagged(tagged_ty) => { + let name = &tagged_ty.name; + // FIXME: have a way to pick the variant! + if let Some(variant) = tagged_ty.variants.get(0) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + if let Some(fields) = &variant.fields { + write!(f, " {{ ")?; + for (field_idx, field) in fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + writeln!(f, "{field_name}: ")?; + self.generate_value(f, state, ty, val_idx)?; + } + write!(f, " }}")?; + } + } + }, + Ty::Alias(AliasTy { real, .. }) => { + self.generate_value(f, state, *real, val_idx)?; + }, + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + self.generate_value(f, state, real_ty, val_idx)?; + }, + }; + + Ok(names) + } + fn convention_decl(&self, convention: CallingConvention) -> &'static str { match convention { CallingConvention::All => { @@ -445,7 +576,7 @@ impl RustcAbiImpl { let function = state.test.typed.realize_func(func); write!(f, "fn {}(", function.name)?; - + // Add inputs for (_idx, arg) in function.inputs.iter().enumerate() { let arg_name = &arg.name; @@ -456,7 +587,7 @@ impl RustcAbiImpl { for (_idx, arg) in function.outputs.iter().enumerate() { let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); if !is_outparam { - // Handled in next loop + // Handled in next loop continue; } // NOTE: we intentionally don't use the "borrowed" tyname @@ -470,8 +601,8 @@ impl RustcAbiImpl { for (_idx, arg) in function.outputs.iter().enumerate() { let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); if is_outparam { - // Already handled - continue; + // Already handled + continue; } if has_normal_return { return Err(GenerateError::RustUnsupported(format!("multiple normal returns (should this be a tuple?)"))); @@ -827,3 +958,24 @@ impl RustcAbiImpl { } */ } + +/// For a given primitive type, generate an instance +/// where all the high nybbles of each byte is val_idx +/// and all the low nybbles are the number byte. +/// +/// This lets us look at a random byte a function read +/// and go "hey this was SUPPOSED to be the 3rd byte of the 7th arg", +/// which is useful for figuring out how an argument got fucked up +/// (how much it was misaligned, or passed in the wrong slot). +fn graffiti_primitive(val_idx: usize) -> T { + const MAX_SIZE: usize = 32; + const MAX_HEX: usize = 16; + assert!(std::mem::size_of::() <= MAX_SIZE, "only primitives as big as u256 are supported!"); + + let bytes: [u8; MAX_SIZE] = std::array::from_fn(|i| { + (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8) + }); + unsafe { + std::mem::transmute_copy(&bytes) + } +} \ No newline at end of file From ec2d4bbc954cbe92eec5a09545feed13d6e5d418 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 10 Dec 2023 10:37:47 -0500 Subject: [PATCH 04/44] Update CODEGEN.md --- CODEGEN.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CODEGEN.md b/CODEGEN.md index 5d79dda..bf17062 100644 --- a/CODEGEN.md +++ b/CODEGEN.md @@ -4,9 +4,9 @@ abi-cafe exists to test that two languages/compilers/backends agree on ABIs for 1. Take something morally equivalent to a C header (a bunch of types and function signatures) 2. Define codegen backends ("ABIs") that know how to take such a header and: - * generate code for the "caller" (the user of the function) - * generate code for the "callee" (the impl of the function) - * compile the result + * generate code for the "caller" (the user of the function) + * generate code for the "callee" (the impl of the function) + * compile the result 3. For each ABI pairing we're interested in, link and run the two halves together At a lower level we: @@ -141,4 +141,4 @@ It might also be reasonable to introduce a concept to kdl-script that `Option::S * `_BitInt(N)` * I can't believe C is actually standardizing these what a time to be alive * "the whole fucking Swift ABI" - * lmfao sure thing buddy \ No newline at end of file + * lmfao sure thing buddy From e15a29be15d257f5dd03a7de207fb6e7b35244e1 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 10 Dec 2023 10:38:40 -0500 Subject: [PATCH 05/44] Update CODEGEN.md --- CODEGEN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEGEN.md b/CODEGEN.md index bf17062..eceb74a 100644 --- a/CODEGEN.md +++ b/CODEGEN.md @@ -134,11 +134,11 @@ It might also be reasonable to introduce a concept to kdl-script that `Option::S * simd types * sketch: as primitives? or treated like structural types like arrays? (`[u32 x 5]`?) * this is apparently an ABI minefield that would benefit from more attention +* `_BitInt(N)` + * I can't believe C is actually standardizing these what a time to be alive * tuples? * not exactly complex to do, just not clear what would use these * slices? * very rust-specific... -* `_BitInt(N)` - * I can't believe C is actually standardizing these what a time to be alive * "the whole fucking Swift ABI" * lmfao sure thing buddy From fef0389cb1ce42be0d177393886e1fed3a2f14fd Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 11 Oct 2023 18:25:06 -0400 Subject: [PATCH 06/44] retrigger CI in 2023 --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e7611a5..5ddf571 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,6 @@ The test format support for the following types/concepts: * arrays (including multi-dimensional arrays, although C often requires arrays to be wrapped in pass-by-ref) - # Adding Tests Tests are specified as [ron](https://github.com/ron-rs/ron) files in the test/ directory, because it's more compact than JSON, has comments, and is more reliable with large integers. Because C is in some sense the "lingua franca" of FFI that everyone has to deal with, we prefer using C types in these definitions. From f1ea716ffd26e9ff45339557302ded2c81df4c3c Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 27 Apr 2024 23:41:47 -0400 Subject: [PATCH 07/44] tagged unions and reference inputs --- Cargo.lock | 330 +++++++---- harness/rust_test_prefix.rs | 22 +- src/abis/rust2.rs | 1023 ++++++++++++++++++----------------- src/test_format.rs | 8 +- tests/kdl/types.kdl | 51 +- 5 files changed, 841 insertions(+), 593 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59d593a..9238bb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,6 +47,54 @@ dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "atty" version = "0.2.14" @@ -79,6 +127,15 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + [[package]] name = "base64" version = "0.13.0" @@ -150,7 +207,7 @@ checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" dependencies = [ "atty", "bitflags", - "indexmap", + "indexmap 1.8.0", "lazy_static", "os_str_bytes", "strsim", @@ -161,27 +218,33 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.32" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "is-terminal", - "once_cell", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", "syn", @@ -189,12 +252,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "crossbeam-channel" @@ -247,6 +313,12 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -296,6 +368,12 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.4.0" @@ -338,7 +416,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", +] + +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -348,7 +436,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -360,7 +448,7 @@ dependencies = [ "hermit-abi 0.2.6", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -398,9 +486,9 @@ dependencies = [ [[package]] name = "kdl-script" -version = "0.2.0" +version = "0.2.1" dependencies = [ - "clap 4.0.32", + "clap 4.4.18", "kdl 4.6.0", "linked-hash-map", "miette", @@ -482,12 +570,13 @@ dependencies = [ [[package]] name = "miette" -version = "5.3.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ - "atty", "backtrace", + "backtrace-ext", + "is-terminal", "miette-derive", "once_cell", "owo-colors", @@ -502,9 +591,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.3.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", @@ -528,9 +617,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -619,12 +708,12 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.2.2", ] [[package]] @@ -633,44 +722,20 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.15" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -744,7 +809,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -770,18 +835,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -790,9 +855,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -839,37 +904,37 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "supports-color" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" dependencies = [ - "atty", + "is-terminal", "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "1.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" dependencies = [ - "atty", + "is-terminal", ] [[package]] name = "supports-unicode" -version = "1.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" dependencies = [ - "atty", + "is-terminal", ] [[package]] name = "syn" -version = "1.0.107" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -909,18 +974,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -973,11 +1038,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -985,9 +1049,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -996,9 +1060,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1078,16 +1142,16 @@ dependencies = [ ] [[package]] -name = "valuable" -version = "0.1.0" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] -name = "version_check" -version = "0.9.4" +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "wasi" @@ -1132,13 +1196,37 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.0", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm 0.42.0", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -1147,38 +1235,80 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/harness/rust_test_prefix.rs b/harness/rust_test_prefix.rs index 1f2195b..e52aedf 100644 --- a/harness/rust_test_prefix.rs +++ b/harness/rust_test_prefix.rs @@ -26,13 +26,13 @@ pub struct FfiI128 { #[repr(C, align(16))] pub struct FfiU128 { low: u64, - high: u64, + high: u64, } impl FfiI128 { fn new(val: i128) -> Self { Self { - low: val as u64 as i64, + low: val as u64 as i64, high: (val as u128 >> 64) as u64 as i64, } } @@ -41,8 +41,22 @@ impl FfiI128 { impl FfiU128 { fn new(val: u128) -> Self { Self { - low: val as u64, + low: val as u64, high: (val as u128 >> 64) as u64, } } -} \ No newline at end of file +} + +unsafe fn write_field(buffer: WriteBuffer, field: &T) { + WRITE_FIELD.unwrap()( + buffer, + field as *const T as *const u8, + core::mem::size_of_val(field) as u32 + ); +} +unsafe fn finished_val(buffer: WriteBuffer) { + FINISHED_VAL.unwrap()(buffer); +} +unsafe fn finished_func(inputs: WriteBuffer, outputs: WriteBuffer) { + FINISHED_FUNC.unwrap()(inputs, outputs); +} diff --git a/src/abis/rust2.rs b/src/abis/rust2.rs index 5045c22..26097ee 100644 --- a/src/abis/rust2.rs +++ b/src/abis/rust2.rs @@ -2,7 +2,8 @@ use std::sync::Arc; -use kdl_script::types::{FuncIdx, ArrayTy, RefTy, AliasTy, Ty, TyIdx, PrimitiveTy}; +use kdl_script::parse::FuncDecl; +use kdl_script::types::{FuncIdx, Func, ArrayTy, RefTy, AliasTy, Ty, TyIdx, PrimitiveTy}; use kdl_script::{DefinitionGraph, TypedProgram, PunEnv}; use super::super::*; @@ -10,6 +11,11 @@ use super::*; pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); +const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; +const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; +const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; +const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; + static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); #[allow(dead_code)] @@ -31,6 +37,13 @@ pub struct GenState<'a> { tynames: HashMap, borrowed_tynames: HashMap, funcs: Vec, + val_writer: WriteImpl, +} + +enum WriteImpl { + HarnessCallback, + Print, + Noop, } impl RustcAbiImpl { @@ -67,45 +80,67 @@ impl RustcAbiImpl { } } + /* + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + let mut cmd = Command::new("rustc"); + cmd.arg("--crate-type") + .arg("staticlib") + .arg("--out-dir") + .arg("target/temp/") + .arg("--target") + .arg(built_info::TARGET) + .arg(format!("-Cmetadata={lib_name}")) + .arg(src_path); + if let Some(codegen_backend) = &self.codegen_backend { + cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); + } + eprintln!("running: {:?}", cmd); + let out = cmd.output()?; + + if !out.status.success() { + Err(BuildError::RustCompile(out)) + } else { + Ok(String::from(lib_name)) + } + } + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + // Currently no need to be different + self.compile_callee(src_path, lib_name) + } + */ +} + +impl RustcAbiImpl { pub fn generate_caller( &self, f: &mut dyn Write, test: &Test, query: impl Iterator, ) -> Result<(), GenerateError> { - let mut state = GenState { - test, - tynames: HashMap::new(), - borrowed_tynames: HashMap::new(), - funcs: vec![], - }; + let mut state = gen_state(test); - self.write_rust_prefix(f, &state)?; + // Generate type decls and gather up functions + self.generate_definitions(f, &mut state, query)?; + // Generate decls of the functions we want to call + self.generate_caller_externs(f, &state)?; - for def in test.graph.definitions(query) { - match def { - kdl_script::Definition::DeclareTy(_) => { - todo!("we should intern this typename here!"); - } - kdl_script::Definition::DeclareFunc(_) => { - // nothing to do, rust doesn't need forward-declares - }, - kdl_script::Definition::DefineTy(ty) => { - let (tyname, borrowed_tyname) = self.generate_tydef(f, &state, ty)?; - state.tynames.insert(ty, tyname); - if let Some(borrowed) = borrowed_tyname { - state.borrowed_tynames.insert(ty, borrowed); - } - }, - kdl_script::Definition::DefineFunc(func) => { - // Buffer up the funcs - state.funcs.push(func); - }, - } + // Generate the test function the harness will call + writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; + for &func in &state.funcs { + // Generate the individual function calls + self.generate_caller_body(f, &state, func)?; } + writeln!(f, "}}")?; + + Ok(()) + } - // Generate the extern block for all the funcs we'll call - let convention_decl = self.convention_decl(test.convention); + fn generate_caller_externs( + &self, + f: &mut dyn Write, + state: &GenState, + ) -> Result<(), GenerateError> { + let convention_decl = self.convention_decl(state.test.convention)?; writeln!(f, "extern \"{convention_decl}\" {{",)?; for &func in &state.funcs { write!(f, " ")?; @@ -114,110 +149,132 @@ impl RustcAbiImpl { } writeln!(f, "}}")?; writeln!(f)?; + Ok(()) + } - // Generate the test function the harness will call - writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; + fn generate_caller_body( + &self, + f: &mut dyn Write, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + writeln!(f, " unsafe {{")?; + let function = state.test.typed.realize_func(func); + let mut val_idx = 0; - for &func in &state.funcs { - writeln!(f, " unsafe {{")?; - self.generate_caller_body(f, &state, func)?; - writeln!(f, " }}")?; + // Create vars for all the inputs + for arg in function.inputs.iter() { + // Create and report the input + self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + self.write_var(f, state, &arg.name, arg.ty, VAR_CALLER_INPUTS)?; } - writeln!(f, "}}")?; + // Call the function + self.call_function(f, state, function)?; + + // Report all the outputs + for arg in function.outputs.iter() { + let arg_name = &arg.name; + self.write_var(f, state, arg_name, arg.ty, VAR_CALLER_OUTPUTS)?; + } + + // Report the function is complete + self.end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; + writeln!(f, " }}")?; + Ok(()) + } + + fn call_function(&self, f: &mut dyn Write, state: &GenState, function: &Func) -> Result<(), GenerateError> { + let func_name = &function.name; + write!(f, " ")?; + + // if there's an output, bind it + let mut proper_outputs = function.outputs.iter().filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); + let output = proper_outputs.next(); + let too_many_outputs = proper_outputs.next(); + if too_many_outputs.is_some() { + return Err(GenerateError::RustUnsupported(format!("multiple normal returns (should this be a tuple?)"))); + } + if let Some(output) = output { + write!(f, "let {} = ", output.name)?; + } + + // Call the function + write!(f, "{func_name}(")?; + let inputs = function.inputs.iter(); + let out_params = function.outputs.iter().filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); + + for (arg_idx, arg) in inputs.chain(out_params).enumerate() { + if arg_idx > 0 { + write!(f, ", ")?; + } + self.pass_var(f, state, &arg.name, arg.ty)?; + } + writeln!(f, ");")?; + writeln!(f)?; Ok(()) } -/* - fn generate_callee( +} + +impl RustcAbiImpl { + pub fn generate_callee( &self, f: &mut dyn Write, test: &Test, - convention: CallingConvention, + query: impl Iterator, ) -> Result<(), GenerateError> { - self.write_rust_prefix(f, test, convention)?; - let convention_decl = self.rust_convention_decl(convention); - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Write the signature - writeln!(f, "#[no_mangle]")?; - write!(f, "pub unsafe extern \"{convention_decl}\" ")?; - self.write_rust_signature(f, function)?; - writeln!(f, " {{")?; - - // Now the body - - // Report Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.rust_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - - // Report outputs and return - if let Some(output) = &function.output { - let decl = self.rust_var_decl(output, OUTPUT_NAME)?; - let val = self.rust_val(output)?; - writeln!(f, " {decl} = {val};")?; - writeln!( - f, - "{}", - self.rust_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - writeln!( - f, - " {}", - self.rust_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - } - writeln!(f, "}}")?; - } + let mut state = gen_state(test); + + // Generate type decls and gather up functions + self.generate_definitions(f, &mut state, query)?; + for &func in &state.funcs { + // Generate the individual function definitions + self.generate_callee_body(f, &state, func)?; + } Ok(()) } - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - let mut cmd = Command::new("rustc"); - cmd.arg("--crate-type") - .arg("staticlib") - .arg("--out-dir") - .arg("target/temp/") - .arg("--target") - .arg(built_info::TARGET) - .arg(format!("-Cmetadata={lib_name}")) - .arg(src_path); - if let Some(codegen_backend) = &self.codegen_backend { - cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); + fn generate_callee_body( + &self, + f: &mut dyn Write, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.test.typed.realize_func(func); + let convention_decl = self.convention_decl(state.test.convention)?; + writeln!(f, "#[no_mangle]")?; + write!(f, "pub unsafe extern \"{convention_decl}\" ")?; + self.generate_signature(f, &state, func)?; + writeln!(f, " {{")?; + writeln!(f, " unsafe {{")?; + // Report the inputs + for arg in function.inputs.iter() { + let arg_name = &arg.name; + self.write_var(f, state, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; } - eprintln!("running: {:?}", cmd); - let out = cmd.output()?; - if !out.status.success() { - Err(BuildError::RustCompile(out)) - } else { - Ok(String::from(lib_name)) + // Create outputs and report them + let mut val_idx = 0; + for arg in function.outputs.iter() { + // Create and report the input + self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + self.write_var(f, state, &arg.name, arg.ty, VAR_CALLEE_OUTPUTS)?; } + + // Report the function is complete + self.end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; + + // Return the outputs + for arg in function.outputs.iter() { + self.return_var(f, state, &arg.name, arg.ty)?; + } + writeln!(f, " }}")?; + writeln!(f, "}}")?; + Ok(()) } - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - // Currently no need to be different - self.compile_callee(src_path, lib_name) - } - */ } impl RustcAbiImpl { @@ -228,32 +285,47 @@ impl RustcAbiImpl { } } - pub fn generate_caller_body( - &self, + pub fn generate_definitions(&self, f: &mut dyn Write, - state: &GenState, - func: FuncIdx, + state: &mut GenState, + query: impl Iterator ) -> Result<(), GenerateError> { - let function = state.test.typed.realize_func(func); - let mut val_idx = 0; - for (arg_idx, arg) in function.inputs.iter().enumerate() { - let arg_name = &arg.name; - let ty_name = &state.tynames[&arg.ty]; - write!(f, " let {arg_name} = ")?; - self.generate_value(f, state, arg.ty, &mut val_idx)?; - writeln!(f, ";")?; + self.write_harness_prefix(f, &state)?; + + for def in state.test.graph.definitions(query) { + match def { + kdl_script::Definition::DeclareTy(ty) => { + self.intern_tyname(f, state, ty)?; + } + kdl_script::Definition::DefineTy(ty) => { + self.generate_tydef(f, state, ty)?; + }, + kdl_script::Definition::DefineFunc(func) => { + // Buffer up the funcs + state.funcs.push(func); + }, + kdl_script::Definition::DeclareFunc(_) => { + // nothing to do, executable kdl-script isn't real and can't hurt us + }, + } } Ok(()) } - pub fn generate_tydef( + + pub fn intern_tyname( &self, f: &mut dyn Write, - state: &GenState, + state: &mut GenState, ty: TyIdx, - ) -> Result<(String, Option), GenerateError> { - let names = match state.test.typed.realize_ty(ty) { + ) -> Result<(), GenerateError> { + // Don't double-intern + if state.tynames.contains_key(&ty) { + return Ok(()); + } + + let (tyname, borrowed_tyname) = match state.test.typed.realize_ty(ty) { // Structural types that don't need definitions but we should // intern the name of Ty::Primitive(prim) => { @@ -263,24 +335,23 @@ impl RustcAbiImpl { PrimitiveTy::I32 => "i32", PrimitiveTy::I64 => "i64", PrimitiveTy::I128 => "i128", - PrimitiveTy::I256 => "i256", PrimitiveTy::U8 => "u8", PrimitiveTy::U16 => "u16", PrimitiveTy::U32 => "u32", PrimitiveTy::U64 => "u64", PrimitiveTy::U128 => "u128", - PrimitiveTy::U256 => "u256", - PrimitiveTy::F16 => "f16", PrimitiveTy::F32 => "f32", PrimitiveTy::F64 => "f64", - PrimitiveTy::F128 => "f128", PrimitiveTy::Bool => "bool", PrimitiveTy::Ptr => "*mut ()", + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have i256")))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have u256")))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f16")))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f128")))?, }; (name.to_owned(), None) }, Ty::Array(ArrayTy { elem_ty, len }) => { - let elem_tyname = &state.tynames[elem_ty]; let borrowed_tyname = state.borrowed_tynames.get(elem_ty).map(|elem_tyname| format!("[{elem_tyname}; {len}]")); (format!("[{elem_tyname}; {len}]"), borrowed_tyname) @@ -293,7 +364,55 @@ impl RustcAbiImpl { Ty::Empty => { ("()".to_owned(), None) } + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let has_borrows = struct_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); + ((*struct_ty.name).clone(), borrowed_tyname) + }, + Ty::Union(union_ty) => { + let has_borrows = union_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); + ((*union_ty.name).clone(), borrowed_tyname) + }, + Ty::Enum(enum_ty) => { + ((*enum_ty.name).clone(), None) + }, + Ty::Tagged(tagged_ty) => { + let has_borrows = tagged_ty.variants.iter().any(|v| v.fields.as_ref().map(|fields| fields.iter().any(|field|state.borrowed_tynames.contains_key(&field.ty))).unwrap_or(false)); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); + ((*tagged_ty.name).clone(), borrowed_tyname) + }, + Ty::Alias(AliasTy { name, real, attrs }) => { + let borrowed_tyname = state.borrowed_tynames.get(&real).map(|name| format!("{name}<'a>")); + ((**name).clone(), borrowed_tyname) + }, + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + (state.tynames[&real_ty].clone(), state.borrowed_tynames.get(&real_ty).cloned()) + }, + }; + + state.tynames.insert(ty, tyname); + if let Some(borrowed) = borrowed_tyname { + state.borrowed_tynames.insert(ty, borrowed); + } + + Ok(()) + } + + pub fn generate_tydef( + &self, + f: &mut dyn Write, + state: &mut GenState, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Make sure our own name is interned + self.intern_tyname(f, state, ty)?; + + match state.test.typed.realize_ty(ty) { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { assert!(struct_ty.attrs.is_empty(), "don't yet know how to apply attrs to structs"); @@ -313,9 +432,6 @@ impl RustcAbiImpl { writeln!(f, " {field_name}: {field_tyname},")?; } writeln!(f, "}}\n")?; - - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); - ((*struct_ty.name).clone(), borrowed_tyname) }, Ty::Union(union_ty) => { assert!(union_ty.attrs.is_empty(), "don't yet know how to apply attrs to unions"); @@ -335,9 +451,6 @@ impl RustcAbiImpl { writeln!(f, " {field_name}: {field_tyname},")?; } writeln!(f, "}}\n")?; - - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); - ((*union_ty.name).clone(), borrowed_tyname) }, Ty::Enum(enum_ty) => { assert!(enum_ty.attrs.is_empty(), "don't yet know how to apply attrs to enums"); @@ -350,8 +463,6 @@ impl RustcAbiImpl { writeln!(f, " {variant_name},")?; } writeln!(f, "}}\n")?; - - ((*enum_ty.name).clone(), None) }, Ty::Tagged(tagged_ty) => { assert!(tagged_ty.attrs.is_empty(), "don't yet know how to apply attrs to tagged unions"); @@ -380,9 +491,6 @@ impl RustcAbiImpl { writeln!(f, " }}")?; } writeln!(f, "}}\n")?; - - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); - ((*tagged_ty.name).clone(), borrowed_tyname) }, Ty::Alias(AliasTy { name, real, attrs }) => { assert!(attrs.is_empty(), "don't yet know how to apply attrs to type aliases"); @@ -390,22 +498,47 @@ impl RustcAbiImpl { // Emit an actual type alias decl if let Some(real_tyname) = state.borrowed_tynames.get(&real) { writeln!(f, "type {name}<'a> = {real_tyname};\n")?; - ((**name).clone(), Some(format!("{name}<'a>"))) } else { let real_tyname = &state.tynames[&real]; writeln!(f, "type {name} = {real_tyname};\n")?; - ((**name).clone(), None) } }, - - // Puns should be evaporated - Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - (state.tynames[&real_ty].clone(), state.borrowed_tynames.get(&real_ty).cloned()) + Ty::Pun(..) => { + // Puns should be evaporated by the type name interner }, - }; - - Ok(names) + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 | PrimitiveTy::I16 | PrimitiveTy::I32 | + PrimitiveTy::I64 | + PrimitiveTy::I128 | + PrimitiveTy::I256 | + PrimitiveTy::U8 | + PrimitiveTy::U16 | + PrimitiveTy::U32 | + PrimitiveTy::U64 | + PrimitiveTy::U128 | + PrimitiveTy::U256 | + PrimitiveTy::F16 | + PrimitiveTy::F32 | + PrimitiveTy::F64 | + PrimitiveTy::F128 | + PrimitiveTy::Bool | + PrimitiveTy::Ptr => { + // Builtin + }, + }; + }, + Ty::Array(ArrayTy { .. }) => { + // Builtin + }, + Ty::Ref(RefTy { .. }) => { + // Builtin + } + Ty::Empty => { + // Builtin + } + } + Ok(()) } pub fn generate_value( @@ -414,6 +547,9 @@ impl RustcAbiImpl { state: &GenState, ty: TyIdx, val_idx: &mut usize, + alias: Option<&str>, + ref_temp_name: &str, + extra_decls: &mut Vec>, ) -> Result<(), GenerateError> { let names = match state.test.typed.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx @@ -432,12 +568,12 @@ impl RustcAbiImpl { PrimitiveTy::F32 => write!(f, "{}", graffiti_primitive::(*val_idx))?, PrimitiveTy::F64 => write!(f, "{}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::Bool => write!(f, "true")?, + PrimitiveTy::Bool => write!(f, "{}", true)?, PrimitiveTy::Ptr => { if true { - write!(f, "{:X} as *mut ()", graffiti_primitive::(*val_idx))? + write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? } else { - write!(f, "{:X} as *mut ()", graffiti_primitive::(*val_idx))? + write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? } }, PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have i256")))?, @@ -451,7 +587,18 @@ impl RustcAbiImpl { write!(f, "()")?; } Ty::Ref(RefTy { pointee_ty }) => { - todo!("we need to forward declare this variable so we can pass it in") + // The value is a mutable reference to a temporary + write!(f, "&mut {ref_temp_name}")?; + + // TODO: should this be a recursive call to create_var (need create_var_inner?) + // Now do the rest of the recursion on constructing the temporary + let mut ref_temp = Vec::new(); + let ty_name = &state.tynames[pointee_ty]; + write!(&mut ref_temp, " let mut {ref_temp_name}: {ty_name} = ")?; + let ref_temp_name = format!("{ref_temp_name}_"); + self.generate_value(&mut ref_temp, state, *pointee_ty, val_idx, alias, &ref_temp_name, extra_decls)?; + write!(&mut ref_temp, ";")?; + extra_decls.push(ref_temp); } Ty::Array(ArrayTy { elem_ty, len }) => { write!(f, "[")?; @@ -459,13 +606,14 @@ impl RustcAbiImpl { if arr_idx > 0 { write!(f, ", ")?; } - self.generate_value(f, state, *elem_ty, val_idx)?; + let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); + self.generate_value(f, state, *elem_ty, val_idx, alias, &ref_temp_name, extra_decls)?; } write!(f, "]")?; }, // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - let name = &struct_ty.name; + let name = alias.unwrap_or(&struct_ty.name); write!(f, "{name} {{ ")?; for (field_idx, field) in struct_ty.fields.iter().enumerate() { if field_idx > 0 { @@ -473,32 +621,34 @@ impl RustcAbiImpl { } let field_name = &field.ident; write!(f, "{field_name}: ")?; - self.generate_value(f, state, field.ty, val_idx)?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; } write!(f, " }}")?; }, Ty::Union(union_ty) => { - let name = &union_ty.name; + let name = alias.unwrap_or(&union_ty.name); write!(f, "{name} {{ ")?; - // FIXME: have a way to pick the variant! + // FIXME(variant_select):have a way to pick the variant! if let Some(field) = union_ty.fields.get(0) { let field_name = &field.ident; write!(f, "{field_name}: ")?; - self.generate_value(f, state, field.ty, val_idx)?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; } write!(f, " }}")?; }, Ty::Enum(enum_ty) => { - let name = &enum_ty.name; - // FIXME: have a way to pick the variant! + let name = alias.unwrap_or(&enum_ty.name); + // FIXME(variant_select):have a way to pick the variant! if let Some(variant) = enum_ty.variants.get(0) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; } }, Ty::Tagged(tagged_ty) => { - let name = &tagged_ty.name; - // FIXME: have a way to pick the variant! + let name = alias.unwrap_or(&tagged_ty.name); + // FIXME(variant_select): have a way to pick the variant! if let Some(variant) = tagged_ty.variants.get(0) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; @@ -509,29 +659,31 @@ impl RustcAbiImpl { write!(f, ", ")?; } let field_name = &field.ident; - writeln!(f, "{field_name}: ")?; - self.generate_value(f, state, ty, val_idx)?; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; } write!(f, " }}")?; } } }, - Ty::Alias(AliasTy { real, .. }) => { - self.generate_value(f, state, *real, val_idx)?; + Ty::Alias(AliasTy { real, name, .. }) => { + let alias = alias.or_else(|| Some(name)); + self.generate_value(f, state, *real, val_idx, alias, ref_temp_name, extra_decls)?; }, // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - self.generate_value(f, state, real_ty, val_idx)?; + self.generate_value(f, state, real_ty, val_idx, alias, ref_temp_name, extra_decls)?; }, }; Ok(names) } - fn convention_decl(&self, convention: CallingConvention) -> &'static str { - match convention { + fn convention_decl(&self, convention: CallingConvention) -> Result<&'static str, GenerateError> { + let conv = match convention { CallingConvention::All => { unreachable!("CallingConvention::All is sugar that shouldn't reach here") } @@ -547,12 +699,13 @@ impl RustcAbiImpl { CallingConvention::Stdcall => "stdcall", CallingConvention::Fastcall => "fastcall", CallingConvention::Vectorcall => "vectorcall", - } + }; + Ok(conv) } /// Every test should start by loading in the harness' "header" /// and forward-declaring any structs that will be used. - fn write_rust_prefix( + fn write_harness_prefix( &self, f: &mut dyn Write, state: &GenState, @@ -617,346 +770,252 @@ impl RustcAbiImpl { Ok(()) } -/* - /// If this value defines a nominal type, this will spit out: - /// - /// * The type name - /// * The forward-declaration of that type - /// - /// To catch buggy test definitions, you should validate that all - /// structs that claim a particular name have the same declaration. - /// This is done in write_rust_prefix. - fn rust_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.rust_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = name.to_string(); - output.push_str("\n#[repr(C)]\n"); - output.push_str(&format!("pub struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!( - " {}: {},\n", - FIELD_NAMES[idx], - self.rust_nested_type(field)? - ); - output.push_str(&line); - } - output.push('}'); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.rust_forward_decl(&vals[0]), - Ref(pointee) => self.rust_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn rust_var_decl(&self, val: &Val, var_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(self.rust_var_decl(pointee, var_name)?) - } else { - Ok(format!("let {var_name}: {}", self.rust_arg_type(val)?)) - } - } - - /// The decl to use for a function arg (apply referenceness) - fn rust_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(format!("{arg_name}: &{}", self.rust_arg_type(pointee)?)) - } else { - Ok(format!("{arg_name}: {}", self.rust_arg_type(val)?)) - } - } - - /// If the return type needs to be an out_param, this returns it - fn rust_out_param( + fn create_var( &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "{out_param_name}: &mut {}", - self.rust_arg_type(pointee)? - ))) - } else { - Ok(None) - } - } - - /// If the return type needs to be an out_param, this returns it - fn rust_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "let mut {output_name}: {} = {};", - self.rust_arg_type(pointee)?, - self.rust_default_val(pointee)? - ))) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn rust_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(_) = val { - Ok(format!("&{arg_name}")) - } else { - Ok(arg_name.to_string()) + f: &mut dyn Write, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + val_idx: &mut usize, + ) -> Result<(), GenerateError> { + // Generate the input + let ty_name = &state.tynames[&var_ty]; + let needs_mut = false; + let let_mut = if needs_mut { "let mut" } else { "let" }; + let mut real_var_decl = Vec::new(); + let mut extra_decls = Vec::new(); + write!(&mut real_var_decl, " {let_mut} {var_name}: {ty_name} = ")?; + let ref_temp_name = format!("{var_name}_"); + self.generate_value(&mut real_var_decl, state, var_ty, val_idx, None, &ref_temp_name, &mut extra_decls)?; + writeln!(&mut real_var_decl, ";")?; + + for decl in extra_decls { + writeln!(f, "{}", std::str::from_utf8(&decl).unwrap())?; } + writeln!(f, "{}", std::str::from_utf8(&real_var_decl).unwrap())?; + Ok(()) } - /// How to return a value - fn rust_var_return( + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn write_var( &self, - val: &Val, + f: &mut dyn Write, + state: &GenState, var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!("*{out_param_name} = {var_name};")) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn rust_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => format!("*mut {}", self.rust_arg_type(pointee)?), - Ptr(_) => "*mut ()".to_string(), - Bool(_) => "bool".to_string(), - Array(vals) => format!("[{}; {}]", self.rust_arg_type(&vals[0])?, vals.len()), - Struct(name, _) => name.to_string(), - Float(FloatVal::c_double(_)) => "f64".to_string(), - Float(FloatVal::c_float(_)) => "f32".to_string(), - Int(int_val) => match int_val { - c__int128(_) => { - if STRUCT_128 { - "FfiI128".to_string() - } else { - "i128".to_string() + var_ty: TyIdx, + to: &str, + ) -> Result<(), GenerateError> { + let mut indent = 8; + use VarPathPart::*; + match state.val_writer { + WriteImpl::HarnessCallback => { + for part in self.var_paths(state, var_name, var_ty, true)? { + match part { + Gunk { text, preindent_change, postindent_change } => { + indent += preindent_change; + writeln!(f, "{:indent$}{}", "", text, indent=indent as usize)?; + indent += postindent_change; + } + Field(path) => { + writeln!(f, "{:indent$}write_field({to}, &{path});", "", indent=indent as usize)?; + } } } - c_int64_t(_) => "i64".to_string(), - c_int32_t(_) => "i32".to_string(), - c_int16_t(_) => "i16".to_string(), - c_int8_t(_) => "i8".to_string(), - c__uint128(_) => { - if STRUCT_128 { - "FfiU128".to_string() - } else { - "u128".to_string() + writeln!(f, "{:indent$}finished_val({to});", "", indent=indent as usize)?; + writeln!(f)?; + }, + WriteImpl::Print => { + for part in self.var_paths(state, var_name, var_ty, true)? { + match part { + Gunk { text, preindent_change, postindent_change } => { + indent += preindent_change; + writeln!(f, "{:indent$}{}", text, "", indent=indent as usize)?; + indent += postindent_change; + } + Field(path) => { + writeln!(f, "{:indent$}println!(\"{{}}\", {path});", "", indent=indent as usize)?; + } } } - c_uint64_t(_) => "u64".to_string(), - c_uint32_t(_) => "u32".to_string(), - c_uint16_t(_) => "u16".to_string(), - c_uint8_t(_) => "u8".to_string(), }, - }; - Ok(out) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn rust_nested_type(&self, val: &Val) -> Result { - self.rust_arg_type(val) + WriteImpl::Noop => { + // Noop, do nothing + }, + } + Ok(()) } - /// An expression that generates this value. - fn rust_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => self.rust_val(pointee)?, - Ptr(addr) => format!("{addr:#X} as *mut ()"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_val(elem)?); - output.push_str(&part); - } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Int(int_val) => match int_val { - c__int128(val) => { - if STRUCT_128 { - format!("FfiI128::new({val})") - } else { - format!("{val}") - } - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c__uint128(val) => { - if STRUCT_128 { - format!("FfiU128::new({val:#X})") - } else { - format!("{val:#X}") - } - } - c_uint64_t(val) => format!("{val:#X}"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), + fn end_function( + &self, + f: &mut dyn Write, + state: &GenState, + inputs: &str, + outputs: &str, + ) -> Result<(), GenerateError> { + match state.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, " finished_func({inputs}, {outputs});")?; }, - }; - Ok(out) + WriteImpl::Print | WriteImpl::Noop => { + // Noop + }, + } + Ok(()) } - /// A suitable default value for this type - fn rust_default_val(&self, val: &Val) -> Result { - use Val::*; - let out = match val { - Ref(pointee) => self.rust_default_val(pointee)?, - Ptr(_) => "0 as *mut ()".to_string(), - Bool(_) => "false".to_string(), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_default_val(elem)?); - output.push_str(&part); - } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_default_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(..) => "0.0".to_string(), - Int(IntVal::c__int128(..)) => { - if STRUCT_128 { - "FfiI128::new(0)".to_string() - } else { - "0".to_string() - } - } - Int(IntVal::c__uint128(..)) => { - if STRUCT_128 { - "FfiU128::new(0)".to_string() - } else { - "0".to_string() - } - } - Int(..) => "0".to_string(), - }; - Ok(out) + fn pass_var( + &self, + f: &mut dyn Write, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + write!(f, "{var_name}")?; + Ok(()) } - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn rust_write_val( + fn return_var( &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.rust_var_paths(val, from, is_var_root)? { - writeln!(output, " WRITE_FIELD.unwrap()({to}, &{path} as *const _ as *const _, core::mem::size_of_val(&{path}) as u32);").unwrap(); - } - write!(output, " FINISHED_VAL.unwrap()({to});").unwrap(); - - Ok(output) + f: &mut dyn Write, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + // TODO: implement outparam returns + write!(f, "{var_name}")?; + Ok(()) } /// Compute the paths to every subfield of this value, with `from` /// as the base path to that value, for rust_write_val's use. - fn rust_var_paths( + fn var_paths( &self, - val: &Val, + state: &GenState, from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] + var_ty: TyIdx, + is_root: bool, + ) -> Result, GenerateError> { + use VarPathPart::*; + let paths = match state.test.typed.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => vec![Field(from.to_owned())], + Ty::Empty => vec![], + Ty::Alias(alias_ty) => self.var_paths(state, from, alias_ty.real, is_root)?, + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + self.var_paths(state, from, real_ty, is_root)? } - Val::Struct(_name, fields) => { + Ty::Array(array_ty) => { let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.rust_var_paths(field, &base, false)?); + for i in 0..array_ty.len { + let base = format!("{from}[{i}]"); + paths.extend(self.var_paths(state, &base, array_ty.elem_ty, false)?) } paths } - Val::Ref(pointee) => { - if is_var_root { - self.rust_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.rust_var_paths(pointee, &base, false)? + Ty::Struct(struct_ty) => { + let mut paths = vec![]; + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + paths.extend(self.var_paths(state, &base, field.ty, false)?) } - } - Val::Array(vals) => { + paths + }, + Ty::Tagged(tagged_ty) => { let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.rust_var_paths(elem, &base, false)?); + + paths.push(Gunk { + text: format!("match &{from} {{"), + preindent_change: 0, + postindent_change: 4, + }); + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + match &variant.fields { + Some(fields) => { + let field_list = fields.iter().map(|f| f.ident.to_string()).collect::>().join(", "); + paths.push(Gunk { + text: format!("{variant_name} {{ {field_list} }} => {{"), + preindent_change: 0, + postindent_change: 4, + }); + for field in fields { + paths.extend(self.var_paths(state, &field.ident, field.ty, false)?) + } + paths.push(Gunk { + text: format!("}}"), + preindent_change: -4, + postindent_change: 0, + }); + } + None => { + paths.push(Gunk { + text: format!("{variant_name} => {{ }}"), + preindent_change: 0, + postindent_change: 0, + }); + } + } } + paths.push(Gunk { + text: format!("}}"), + preindent_change: -4, + postindent_change: 0, + }); paths - } + }, + Ty::Ref(ref_ty) => { + let base = format!("(*{from})"); + self.var_paths(state, &base, ref_ty.pointee_ty, is_root)? + }, + Ty::Union(union_ty) => { + let mut paths = vec![]; + // FIXME(variant_select): hardcoded to access field 0 for now + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + paths.extend(self.var_paths(state, &base, field.ty, false)?) + } + paths + }, }; - Ok(paths) } - */ +} + +/// We want to access all the subfields of a variable in order. +/// Ideally we would just return a list of rvalue expressions like +/// ["val.field", "val.arr[0]", "val.arr[1]", "val.field3.x"] +/// +/// but if a subfield is an enum, then we can't actually write out its rvalue expression +/// as a single expression. Instead we need to break things up with random "match" statements +/// that introduce new temporary names. These are the "gunks" which should just be emitted +/// verbatim. +enum VarPathPart { + /// Some random gunk like a fragment of a "match" that must be emitted for subsequent + /// fields (or gunks) to make sense. + Gunk { + /// Text to emit + text: String, + /// How much the indent is changed by this gunk before it's printed + preindent_change: i32, + /// How much the indent is changed by this gunk after it's printed + postindent_change: i32, + }, + /// An actual rvalue expression to a leaf of the variable + Field(String), +} + +fn gen_state(test: &Test) -> GenState { + GenState { + test, + tynames: HashMap::new(), + borrowed_tynames: HashMap::new(), + funcs: vec![], + val_writer: WriteImpl::HarnessCallback, + } } /// For a given primitive type, generate an instance diff --git a/src/test_format.rs b/src/test_format.rs index efe4d73..fe52c71 100644 --- a/src/test_format.rs +++ b/src/test_format.rs @@ -14,7 +14,6 @@ pub fn do_kdl(test_file: &Path, input: String) -> Result { let graph = Arc::new(typed.definition_graph(&env)?); let abi = crate::abis::rust2::RustcAbiImpl::new(None); - let mut output = Vec::new(); let test = crate::abis::rust2::Test { typed, env, @@ -22,8 +21,15 @@ pub fn do_kdl(test_file: &Path, input: String) -> Result { convention: crate::abis::CallingConvention::C, }; + let mut output = Vec::new(); abi.generate_caller(&mut output, &test, test.typed.all_funcs()).unwrap(); let output = String::from_utf8_lossy(&output); println!("{output}"); + + let mut output = Vec::new(); + abi.generate_callee(&mut output, &test, test.typed.all_funcs()).unwrap(); + let output = String::from_utf8_lossy(&output); + println!("{output}"); + todo!() } \ No newline at end of file diff --git a/tests/kdl/types.kdl b/tests/kdl/types.kdl index e86286f..4231ce5 100644 --- a/tests/kdl/types.kdl +++ b/tests/kdl/types.kdl @@ -8,8 +8,8 @@ struct "Complex" { elems1 "[Simple;10]" elems2 "[Simple;9]" val "Simple" - reffed "&Simple" - array_ref "&[&Simple;2]" + // reffed "&Simple" + // array_ref "&[&Simple;2]" opaque "ptr" flag "bool" } @@ -26,8 +26,14 @@ tagged "OptionI32" { } tagged "MyResult" { - Ok { _0 "[&f128;3]"; } - Some { _0 "ErrorCode"; } + Ok { _0 "[u32;3]"; } + Err { _0 "ErrorCode"; } +} + +tagged "MyDeepResult" { + Ok { _0 "MyResult"; } + Err { _0 "OptionI32"; } + FileNotFound { x "bool"; y "Simple"; } } union "Life" { @@ -35,6 +41,19 @@ union "Life" { complex "Complex" } +struct "ContainsRefs" { + valued "i32" + reffed "&i32" + deep_reffed "InnerContainsRefs" +} + +tagged "InnerContainsRefs" { + A { x "&u64"; y "&u8"; } + B { z "&i16"; } + C { w "bool"; } +} + +/* fn "func1" { inputs { a "Complex"; b "Simple"; } outputs { out "()"; } @@ -45,7 +64,7 @@ fn "func2" { a "[Complex;2]" b "[Simple;10]" c "()" - d "f128" + d "f64" } outputs { out "Complex" @@ -56,6 +75,26 @@ fn "arraytime" { inputs { a "[i32;4]" b "[[i32;4];5]" - c "[[[&Simple;1];2];3]" + // c "[[[&Simple;1];2];3]" + } +} + +fn "enumtime" { + inputs { + a "OptionI32" + b "MyResult" + c "MyDeepResult" + } +} + + +*/ + +fn "reftime" { + inputs { + a "i32" + b "&i32" + c "&Simple" + d "ContainsRefs" } } \ No newline at end of file From b961a0cd56a635ff28498318a818db1baa19c19f Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 28 Apr 2024 20:52:52 -0400 Subject: [PATCH 08/44] cleanup --- src/abis.rs | 2 + src/abis/rust2.rs | 762 +++++++++++++++++++++++++++------------------ src/cli.rs | 7 +- src/main.rs | 5 +- src/report.rs | 4 +- src/test_format.rs | 18 +- 6 files changed, 475 insertions(+), 323 deletions(-) diff --git a/src/abis.rs b/src/abis.rs index 27d8837..8997bc7 100644 --- a/src/abis.rs +++ b/src/abis.rs @@ -77,6 +77,8 @@ pub trait AbiImpl { #[derive(Debug, thiserror::Error)] #[allow(dead_code)] pub enum GenerateError { + #[error("io error\n{0}")] + Fmt(#[from] std::fmt::Error), #[error("io error\n{0}")] Io(#[from] std::io::Error), #[error("parse error {0}\n{2}\n{}\n{:width$}^", diff --git a/src/abis/rust2.rs b/src/abis/rust2.rs index 26097ee..e5c9eb9 100644 --- a/src/abis/rust2.rs +++ b/src/abis/rust2.rs @@ -3,11 +3,13 @@ use std::sync::Arc; use kdl_script::parse::FuncDecl; -use kdl_script::types::{FuncIdx, Func, ArrayTy, RefTy, AliasTy, Ty, TyIdx, PrimitiveTy}; -use kdl_script::{DefinitionGraph, TypedProgram, PunEnv}; +use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; +use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; use super::super::*; use super::*; +use crate::fivemat::Fivemat; +use std::fmt::Write; pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); @@ -15,6 +17,7 @@ const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; +const INDENT: &str = " "; static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); @@ -24,7 +27,6 @@ pub struct RustcAbiImpl { codegen_backend: Option, } - pub struct Test { pub typed: Arc, pub env: Arc, @@ -118,35 +120,37 @@ impl RustcAbiImpl { query: impl Iterator, ) -> Result<(), GenerateError> { let mut state = gen_state(test); + let mut f = Fivemat::new(f, INDENT); // Generate type decls and gather up functions - self.generate_definitions(f, &mut state, query)?; + self.generate_definitions(&mut f, &mut state, query)?; // Generate decls of the functions we want to call - self.generate_caller_externs(f, &state)?; + self.generate_caller_externs(&mut f, &state)?; // Generate the test function the harness will call - writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; + writeln!(f, "#[no_mangle]\npub extern \"C\" fn do_test() {{")?; for &func in &state.funcs { // Generate the individual function calls - self.generate_caller_body(f, &state, func)?; + self.generate_caller_body(&mut f, &state, func)?; } - writeln!(f, "}}")?; + writeln!(&mut f, "}}")?; Ok(()) } fn generate_caller_externs( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, - ) -> Result<(), GenerateError> { + ) -> Result<(), GenerateError> { let convention_decl = self.convention_decl(state.test.convention)?; writeln!(f, "extern \"{convention_decl}\" {{",)?; + f.add_indent(1); for &func in &state.funcs { - write!(f, " ")?; self.generate_signature(f, &state, func)?; writeln!(f, ";")?; } + f.sub_indent(1); writeln!(f, "}}")?; writeln!(f)?; Ok(()) @@ -154,11 +158,12 @@ impl RustcAbiImpl { fn generate_caller_body( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, func: FuncIdx, ) -> Result<(), GenerateError> { - writeln!(f, " unsafe {{")?; + writeln!(f, "unsafe {{")?; + f.add_indent(1); let function = state.test.typed.realize_func(func); let mut val_idx = 0; @@ -180,21 +185,30 @@ impl RustcAbiImpl { // Report the function is complete self.end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; - writeln!(f, " }}")?; + f.sub_indent(1); + writeln!(f, "}}")?; Ok(()) } - - fn call_function(&self, f: &mut dyn Write, state: &GenState, function: &Func) -> Result<(), GenerateError> { + fn call_function( + &self, + f: &mut Fivemat, + state: &GenState, + function: &Func, + ) -> Result<(), GenerateError> { let func_name = &function.name; - write!(f, " ")?; // if there's an output, bind it - let mut proper_outputs = function.outputs.iter().filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); + let mut proper_outputs = function + .outputs + .iter() + .filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); let output = proper_outputs.next(); let too_many_outputs = proper_outputs.next(); if too_many_outputs.is_some() { - return Err(GenerateError::RustUnsupported(format!("multiple normal returns (should this be a tuple?)"))); + return Err(GenerateError::RustUnsupported(format!( + "multiple normal returns (should this be a tuple?)" + ))); } if let Some(output) = output { write!(f, "let {} = ", output.name)?; @@ -203,7 +217,10 @@ impl RustcAbiImpl { // Call the function write!(f, "{func_name}(")?; let inputs = function.inputs.iter(); - let out_params = function.outputs.iter().filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); + let out_params = function + .outputs + .iter() + .filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); for (arg_idx, arg) in inputs.chain(out_params).enumerate() { if arg_idx > 0 { @@ -215,31 +232,31 @@ impl RustcAbiImpl { writeln!(f)?; Ok(()) } - } impl RustcAbiImpl { pub fn generate_callee( &self, - f: &mut dyn Write, + f: &mut impl std::fmt::Write, test: &Test, query: impl Iterator, ) -> Result<(), GenerateError> { let mut state = gen_state(test); + let mut f = Fivemat::new(f, INDENT); // Generate type decls and gather up functions - self.generate_definitions(f, &mut state, query)?; + self.generate_definitions(&mut f, &mut state, query)?; for &func in &state.funcs { // Generate the individual function definitions - self.generate_callee_body(f, &state, func)?; + self.generate_callee_body(&mut f, &state, func)?; } Ok(()) } fn generate_callee_body( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, func: FuncIdx, ) -> Result<(), GenerateError> { @@ -249,7 +266,9 @@ impl RustcAbiImpl { write!(f, "pub unsafe extern \"{convention_decl}\" ")?; self.generate_signature(f, &state, func)?; writeln!(f, " {{")?; - writeln!(f, " unsafe {{")?; + f.add_indent(1); + writeln!(f, "unsafe {{")?; + f.add_indent(1); // Report the inputs for arg in function.inputs.iter() { let arg_name = &arg.name; @@ -271,7 +290,9 @@ impl RustcAbiImpl { for arg in function.outputs.iter() { self.return_var(f, state, &arg.name, arg.ty)?; } - writeln!(f, " }}")?; + f.sub_indent(1); + writeln!(f, "}}")?; + f.sub_indent(1); writeln!(f, "}}")?; Ok(()) } @@ -285,10 +306,11 @@ impl RustcAbiImpl { } } - pub fn generate_definitions(&self, - f: &mut dyn Write, + pub fn generate_definitions( + &self, + f: &mut Fivemat, state: &mut GenState, - query: impl Iterator + query: impl Iterator, ) -> Result<(), GenerateError> { self.write_harness_prefix(f, &state)?; @@ -299,24 +321,23 @@ impl RustcAbiImpl { } kdl_script::Definition::DefineTy(ty) => { self.generate_tydef(f, state, ty)?; - }, + } kdl_script::Definition::DefineFunc(func) => { // Buffer up the funcs state.funcs.push(func); - }, + } kdl_script::Definition::DeclareFunc(_) => { // nothing to do, executable kdl-script isn't real and can't hurt us - }, + } } } Ok(()) } - pub fn intern_tyname( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &mut GenState, ty: TyIdx, ) -> Result<(), GenerateError> { @@ -344,55 +365,89 @@ impl RustcAbiImpl { PrimitiveTy::F64 => "f64", PrimitiveTy::Bool => "bool", PrimitiveTy::Ptr => "*mut ()", - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have i256")))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have u256")))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f16")))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f128")))?, + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have i256" + )))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have u256" + )))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f16" + )))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f128" + )))?, }; (name.to_owned(), None) - }, + } Ty::Array(ArrayTy { elem_ty, len }) => { let elem_tyname = &state.tynames[elem_ty]; - let borrowed_tyname = state.borrowed_tynames.get(elem_ty).map(|elem_tyname| format!("[{elem_tyname}; {len}]")); + let borrowed_tyname = state + .borrowed_tynames + .get(elem_ty) + .map(|elem_tyname| format!("[{elem_tyname}; {len}]")); (format!("[{elem_tyname}; {len}]"), borrowed_tyname) - }, + } Ty::Ref(RefTy { pointee_ty }) => { let pointee_tyname = &state.tynames[pointee_ty]; - let borrowed_pointee_tyname = state.borrowed_tynames.get(pointee_ty).unwrap_or(pointee_tyname); - (format!("&mut {pointee_tyname}"), Some(format!("&'a mut {borrowed_pointee_tyname}"))) - } - Ty::Empty => { - ("()".to_owned(), None) + let borrowed_pointee_tyname = state + .borrowed_tynames + .get(pointee_ty) + .unwrap_or(pointee_tyname); + ( + format!("&mut {pointee_tyname}"), + Some(format!("&'a mut {borrowed_pointee_tyname}")), + ) } + Ty::Empty => ("()".to_owned(), None), // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - let has_borrows = struct_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let has_borrows = struct_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); ((*struct_ty.name).clone(), borrowed_tyname) - }, + } Ty::Union(union_ty) => { - let has_borrows = union_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let has_borrows = union_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); ((*union_ty.name).clone(), borrowed_tyname) - }, - Ty::Enum(enum_ty) => { - ((*enum_ty.name).clone(), None) - }, + } + Ty::Enum(enum_ty) => ((*enum_ty.name).clone(), None), Ty::Tagged(tagged_ty) => { - let has_borrows = tagged_ty.variants.iter().any(|v| v.fields.as_ref().map(|fields| fields.iter().any(|field|state.borrowed_tynames.contains_key(&field.ty))).unwrap_or(false)); + let has_borrows = tagged_ty.variants.iter().any(|v| { + v.fields + .as_ref() + .map(|fields| { + fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)) + }) + .unwrap_or(false) + }); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); ((*tagged_ty.name).clone(), borrowed_tyname) - }, + } Ty::Alias(AliasTy { name, real, attrs }) => { - let borrowed_tyname = state.borrowed_tynames.get(&real).map(|name| format!("{name}<'a>")); + let borrowed_tyname = state + .borrowed_tynames + .get(&real) + .map(|name| format!("{name}<'a>")); ((**name).clone(), borrowed_tyname) - }, + } // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - (state.tynames[&real_ty].clone(), state.borrowed_tynames.get(&real_ty).cloned()) - }, + ( + state.tynames[&real_ty].clone(), + state.borrowed_tynames.get(&real_ty).cloned(), + ) + } }; state.tynames.insert(ty, tyname); @@ -405,7 +460,7 @@ impl RustcAbiImpl { pub fn generate_tydef( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &mut GenState, ty: TyIdx, ) -> Result<(), GenerateError> { @@ -415,9 +470,15 @@ impl RustcAbiImpl { match state.test.typed.realize_ty(ty) { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - assert!(struct_ty.attrs.is_empty(), "don't yet know how to apply attrs to structs"); + assert!( + struct_ty.attrs.is_empty(), + "don't yet know how to apply attrs to structs" + ); - let has_borrows = struct_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let has_borrows = struct_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); // Emit an actual struct decl writeln!(f, "#[repr(C)]")?; @@ -426,17 +487,28 @@ impl RustcAbiImpl { } else { writeln!(f, "struct {} {{", struct_ty.name)?; } + f.add_indent(1); for field in &struct_ty.fields { let field_name = &field.ident; - let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); - writeln!(f, " {field_name}: {field_tyname},")?; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; } + f.sub_indent(1); writeln!(f, "}}\n")?; - }, + } Ty::Union(union_ty) => { - assert!(union_ty.attrs.is_empty(), "don't yet know how to apply attrs to unions"); + assert!( + union_ty.attrs.is_empty(), + "don't yet know how to apply attrs to unions" + ); - let has_borrows = union_ty.fields.iter().any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let has_borrows = union_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); // Emit an actual union decl writeln!(f, "#[repr(C)]")?; @@ -445,29 +517,51 @@ impl RustcAbiImpl { } else { writeln!(f, "union {} {{", union_ty.name)?; } + f.add_indent(1); for field in &union_ty.fields { let field_name = &field.ident; - let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); - writeln!(f, " {field_name}: {field_tyname},")?; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; } + f.sub_indent(1); writeln!(f, "}}\n")?; - }, + } Ty::Enum(enum_ty) => { - assert!(enum_ty.attrs.is_empty(), "don't yet know how to apply attrs to enums"); + assert!( + enum_ty.attrs.is_empty(), + "don't yet know how to apply attrs to enums" + ); // Emit an actual enum decl writeln!(f, "#[repr(C)]")?; writeln!(f, "enum {} {{", enum_ty.name)?; + f.add_indent(1); for variant in &enum_ty.variants { let variant_name = &variant.name; - writeln!(f, " {variant_name},")?; + writeln!(f, "{variant_name},")?; } + f.sub_indent(1); writeln!(f, "}}\n")?; - }, + } Ty::Tagged(tagged_ty) => { - assert!(tagged_ty.attrs.is_empty(), "don't yet know how to apply attrs to tagged unions"); - - let has_borrows = tagged_ty.variants.iter().any(|v| v.fields.as_ref().map(|fields| fields.iter().any(|field|state.borrowed_tynames.contains_key(&field.ty))).unwrap_or(false)); + assert!( + tagged_ty.attrs.is_empty(), + "don't yet know how to apply attrs to tagged unions" + ); + + let has_borrows = tagged_ty.variants.iter().any(|v| { + v.fields + .as_ref() + .map(|fields| { + fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)) + }) + .unwrap_or(false) + }); // Emit an actual enum decl writeln!(f, "#[repr(C)]")?; @@ -476,24 +570,34 @@ impl RustcAbiImpl { } else { writeln!(f, "enum {} {{", tagged_ty.name)?; } + f.add_indent(1); for variant in &tagged_ty.variants { let variant_name = &variant.name; if let Some(fields) = &variant.fields { - writeln!(f, " {variant_name} {{")?; + writeln!(f, "{variant_name} {{")?; + f.add_indent(1); for field in fields { let field_name = &field.ident; - let field_tyname = state.borrowed_tynames.get(&field.ty).unwrap_or(&state.tynames[&field.ty]); - writeln!(f, " {field_name}: {field_tyname},")?; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; } + f.sub_indent(1); + writeln!(f, "}}")?; } else { - writeln!(f, " {variant_name},")?; + writeln!(f, "{variant_name},")?; } - writeln!(f, " }}")?; } + f.sub_indent(1); writeln!(f, "}}\n")?; - }, + } Ty::Alias(AliasTy { name, real, attrs }) => { - assert!(attrs.is_empty(), "don't yet know how to apply attrs to type aliases"); + assert!( + attrs.is_empty(), + "don't yet know how to apply attrs to type aliases" + ); // Emit an actual type alias decl if let Some(real_tyname) = state.borrowed_tynames.get(&real) { @@ -502,35 +606,37 @@ impl RustcAbiImpl { let real_tyname = &state.tynames[&real]; writeln!(f, "type {name} = {real_tyname};\n")?; } - }, + } Ty::Pun(..) => { // Puns should be evaporated by the type name interner - }, + } Ty::Primitive(prim) => { match prim { - PrimitiveTy::I8 | PrimitiveTy::I16 | PrimitiveTy::I32 | - PrimitiveTy::I64 | - PrimitiveTy::I128 | - PrimitiveTy::I256 | - PrimitiveTy::U8 | - PrimitiveTy::U16 | - PrimitiveTy::U32 | - PrimitiveTy::U64 | - PrimitiveTy::U128 | - PrimitiveTy::U256 | - PrimitiveTy::F16 | - PrimitiveTy::F32 | - PrimitiveTy::F64 | - PrimitiveTy::F128 | - PrimitiveTy::Bool | - PrimitiveTy::Ptr => { + PrimitiveTy::I8 + | PrimitiveTy::I16 + | PrimitiveTy::I32 + | PrimitiveTy::I64 + | PrimitiveTy::I128 + | PrimitiveTy::I256 + | PrimitiveTy::U8 + | PrimitiveTy::U16 + | PrimitiveTy::U32 + | PrimitiveTy::U64 + | PrimitiveTy::U128 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { // Builtin - }, + } }; - }, + } Ty::Array(ArrayTy { .. }) => { // Builtin - }, + } Ty::Ref(RefTy { .. }) => { // Builtin } @@ -543,13 +649,13 @@ impl RustcAbiImpl { pub fn generate_value( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, ty: TyIdx, val_idx: &mut usize, alias: Option<&str>, ref_temp_name: &str, - extra_decls: &mut Vec>, + extra_decls: &mut Vec, ) -> Result<(), GenerateError> { let names = match state.test.typed.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx @@ -575,14 +681,22 @@ impl RustcAbiImpl { } else { write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? } - }, - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have i256")))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!("rust doesn't have u256")))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f16")))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!("rust doesn't have f128")))?, + } + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have i256" + )))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have u256" + )))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f16" + )))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f128" + )))?, }; *val_idx += 1; - }, + } Ty::Empty => { write!(f, "()")?; } @@ -592,12 +706,21 @@ impl RustcAbiImpl { // TODO: should this be a recursive call to create_var (need create_var_inner?) // Now do the rest of the recursion on constructing the temporary - let mut ref_temp = Vec::new(); + let mut ref_temp = String::new(); + let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); let ty_name = &state.tynames[pointee_ty]; - write!(&mut ref_temp, " let mut {ref_temp_name}: {ty_name} = ")?; + write!(&mut ref_temp_f, "let mut {ref_temp_name}: {ty_name} = ")?; let ref_temp_name = format!("{ref_temp_name}_"); - self.generate_value(&mut ref_temp, state, *pointee_ty, val_idx, alias, &ref_temp_name, extra_decls)?; - write!(&mut ref_temp, ";")?; + self.generate_value( + &mut ref_temp_f, + state, + *pointee_ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; + write!(&mut ref_temp_f, ";")?; extra_decls.push(ref_temp); } Ty::Array(ArrayTy { elem_ty, len }) => { @@ -607,10 +730,18 @@ impl RustcAbiImpl { write!(f, ", ")?; } let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); - self.generate_value(f, state, *elem_ty, val_idx, alias, &ref_temp_name, extra_decls)?; + self.generate_value( + f, + state, + *elem_ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } write!(f, "]")?; - }, + } // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { let name = alias.unwrap_or(&struct_ty.name); @@ -622,10 +753,18 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } write!(f, " }}")?; - }, + } Ty::Union(union_ty) => { let name = alias.unwrap_or(&union_ty.name); write!(f, "{name} {{ ")?; @@ -634,10 +773,18 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } write!(f, " }}")?; - }, + } Ty::Enum(enum_ty) => { let name = alias.unwrap_or(&enum_ty.name); // FIXME(variant_select):have a way to pick the variant! @@ -645,7 +792,7 @@ impl RustcAbiImpl { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; } - }, + } Ty::Tagged(tagged_ty) => { let name = alias.unwrap_or(&tagged_ty.name); // FIXME(variant_select): have a way to pick the variant! @@ -661,28 +808,47 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value(f, state, field.ty, val_idx, alias, &ref_temp_name, extra_decls)?; + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } write!(f, " }}")?; } } - }, + } Ty::Alias(AliasTy { real, name, .. }) => { let alias = alias.or_else(|| Some(name)); self.generate_value(f, state, *real, val_idx, alias, ref_temp_name, extra_decls)?; - }, + } // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - self.generate_value(f, state, real_ty, val_idx, alias, ref_temp_name, extra_decls)?; - }, + self.generate_value( + f, + state, + real_ty, + val_idx, + alias, + ref_temp_name, + extra_decls, + )?; + } }; Ok(names) } - fn convention_decl(&self, convention: CallingConvention) -> Result<&'static str, GenerateError> { + fn convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { let conv = match convention { CallingConvention::All => { unreachable!("CallingConvention::All is sugar that shouldn't reach here") @@ -705,11 +871,7 @@ impl RustcAbiImpl { /// Every test should start by loading in the harness' "header" /// and forward-declaring any structs that will be used. - fn write_harness_prefix( - &self, - f: &mut dyn Write, - state: &GenState, - ) -> Result<(), GenerateError> { + fn write_harness_prefix(&self, f: &mut Fivemat, state: &GenState) -> Result<(), GenerateError> { if state.test.convention == CallingConvention::Vectorcall { writeln!(f, "#![feature(abi_vectorcall)]")?; } @@ -722,19 +884,23 @@ impl RustcAbiImpl { fn generate_signature( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, func: FuncIdx, ) -> Result<(), GenerateError> { let function = state.test.typed.realize_func(func); write!(f, "fn {}(", function.name)?; - + let mut multiarg = false; // Add inputs for (_idx, arg) in function.inputs.iter().enumerate() { + if multiarg { + write!(f, ", ")?; + } + multiarg = true; let arg_name = &arg.name; let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}, ", arg_name, arg_ty)?; + write!(f, "{}: {}", arg_name, arg_ty)?; } // Add outparams for (_idx, arg) in function.outputs.iter().enumerate() { @@ -743,11 +909,15 @@ impl RustcAbiImpl { // Handled in next loop continue; } + if multiarg { + write!(f, ", ")?; + } + multiarg = true; // NOTE: we intentionally don't use the "borrowed" tyname // as we still don't need lifetimes here! let arg_name = &arg.name; let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}, ", arg_name, arg_ty)?; + write!(f, "{}: {}", arg_name, arg_ty)?; } // Add normal returns let mut has_normal_return = false; @@ -758,7 +928,9 @@ impl RustcAbiImpl { continue; } if has_normal_return { - return Err(GenerateError::RustUnsupported(format!("multiple normal returns (should this be a tuple?)"))); + return Err(GenerateError::RustUnsupported(format!( + "multiple normal returns (should this be a tuple?)" + ))); } has_normal_return = true; let arg_ty = &state.tynames[&arg.ty]; @@ -772,7 +944,7 @@ impl RustcAbiImpl { fn create_var( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, var_name: &str, var_ty: TyIdx, @@ -782,17 +954,26 @@ impl RustcAbiImpl { let ty_name = &state.tynames[&var_ty]; let needs_mut = false; let let_mut = if needs_mut { "let mut" } else { "let" }; - let mut real_var_decl = Vec::new(); + let mut real_var_decl = String::new(); + let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); let mut extra_decls = Vec::new(); - write!(&mut real_var_decl, " {let_mut} {var_name}: {ty_name} = ")?; + write!(&mut real_var_decl_f, "{let_mut} {var_name}: {ty_name} = ")?; let ref_temp_name = format!("{var_name}_"); - self.generate_value(&mut real_var_decl, state, var_ty, val_idx, None, &ref_temp_name, &mut extra_decls)?; + self.generate_value( + &mut real_var_decl_f, + state, + var_ty, + val_idx, + None, + &ref_temp_name, + &mut extra_decls, + )?; writeln!(&mut real_var_decl, ";")?; for decl in extra_decls { - writeln!(f, "{}", std::str::from_utf8(&decl).unwrap())?; + writeln!(f, "{}", decl)?; } - writeln!(f, "{}", std::str::from_utf8(&real_var_decl).unwrap())?; + writeln!(f, "{}", real_var_decl)?; Ok(()) } @@ -801,48 +982,134 @@ impl RustcAbiImpl { /// `to` is the BUFFER to use, `from` is the variable name of the value. fn write_var( &self, - f: &mut dyn Write, + f: &mut Fivemat, state: &GenState, var_name: &str, var_ty: TyIdx, to: &str, ) -> Result<(), GenerateError> { - let mut indent = 8; - use VarPathPart::*; - match state.val_writer { - WriteImpl::HarnessCallback => { - for part in self.var_paths(state, var_name, var_ty, true)? { - match part { - Gunk { text, preindent_change, postindent_change } => { - indent += preindent_change; - writeln!(f, "{:indent$}{}", "", text, indent=indent as usize)?; - indent += postindent_change; - } - Field(path) => { - writeln!(f, "{:indent$}write_field({to}, &{path});", "", indent=indent as usize)?; - } - } + // If noop, don't bother doing anything (avoids tagged union matches being generated) + if let WriteImpl::Noop = state.val_writer { + return Ok(()); + }; + self.write_fields(f, state, to, var_name, var_ty)?; + + // If doing full harness callbacks, signal we wrote all the fields of a variable + if let WriteImpl::HarnessCallback = state.val_writer { + writeln!(f, "finished_val({to});")?; + writeln!(f)?; + } + Ok(()) + } + + /// Recursive subroutine of write_var, which builds up rvalue paths and generates + /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. + fn write_fields( + &self, + f: &mut Fivemat, + state: &GenState, + to: &str, + from: &str, + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + match state.test.typed.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it + self.write_leaf_field(f, state, to, from)?; + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + self.write_fields(f, state, to, from, alias_ty.real)?; + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + self.write_fields(f, state, to, from, real_ty)? + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{from}[{i}]"); + self.write_fields(f, state, to, &base, array_ty.elem_ty)?; } - writeln!(f, "{:indent$}finished_val({to});", "", indent=indent as usize)?; - writeln!(f)?; - }, - WriteImpl::Print => { - for part in self.var_paths(state, var_name, var_ty, true)? { - match part { - Gunk { text, preindent_change, postindent_change } => { - indent += preindent_change; - writeln!(f, "{:indent$}{}", text, "", indent=indent as usize)?; - indent += postindent_change; + } + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty)?; + } + } + Ty::Tagged(tagged_ty) => { + // generate a wrapper match, then recurse into each field of each variant + writeln!(f, "match &{from} {{")?; + f.add_indent(1); + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + match &variant.fields { + Some(fields) => { + // Variant with fields, recurse into them + let field_list = fields + .iter() + .map(|f| f.ident.to_string()) + .collect::>() + .join(", "); + writeln!(f, "{variant_name} {{ {field_list} }} => {{")?; + f.add_indent(1); + for field in fields { + self.write_fields(f, state, to, &field.ident, field.ty)?; + } + f.sub_indent(1); + writeln!(f, "}}")?; } - Field(path) => { - writeln!(f, "{:indent$}println!(\"{{}}\", {path});", "", indent=indent as usize)?; + None => { + // Variant without fields, need to include branch for exhaustiveness + writeln!(f, "{variant_name} => {{ }}")?; } } } - }, + f.sub_indent(1); + writeln!(f, "}}")?; + } + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{from})"); + self.write_fields(f, state, to, &base, ref_ty.pointee_ty)? + } + Ty::Union(union_ty) => { + // FIXME(variant_select): hardcoded to access field 0 for now + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty)?; + } + } + }; + Ok(()) + } + + /// WRITE an actual indivisible value (primitive or c-like enum) + fn write_leaf_field( + &self, + f: &mut Fivemat, + state: &GenState, + to: &str, + path: &str, + ) -> Result<(), GenerateError> { + match state.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, &{path});")?; + } + WriteImpl::Print => { + writeln!(f, "println!(\"{{}}\", {path});")?; + } WriteImpl::Noop => { // Noop, do nothing - }, + } } Ok(()) } @@ -856,11 +1123,11 @@ impl RustcAbiImpl { ) -> Result<(), GenerateError> { match state.val_writer { WriteImpl::HarnessCallback => { - writeln!(f, " finished_func({inputs}, {outputs});")?; - }, + writeln!(f, "finished_func({inputs}, {outputs});")?; + } WriteImpl::Print | WriteImpl::Noop => { // Noop - }, + } } Ok(()) } @@ -887,125 +1154,6 @@ impl RustcAbiImpl { write!(f, "{var_name}")?; Ok(()) } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for rust_write_val's use. - fn var_paths( - &self, - state: &GenState, - from: &str, - var_ty: TyIdx, - is_root: bool, - ) -> Result, GenerateError> { - use VarPathPart::*; - let paths = match state.test.typed.realize_ty(var_ty) { - Ty::Primitive(_) | Ty::Enum(_) => vec![Field(from.to_owned())], - Ty::Empty => vec![], - Ty::Alias(alias_ty) => self.var_paths(state, from, alias_ty.real, is_root)?, - Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - self.var_paths(state, from, real_ty, is_root)? - } - Ty::Array(array_ty) => { - let mut paths = vec![]; - for i in 0..array_ty.len { - let base = format!("{from}[{i}]"); - paths.extend(self.var_paths(state, &base, array_ty.elem_ty, false)?) - } - paths - } - Ty::Struct(struct_ty) => { - let mut paths = vec![]; - for field in &struct_ty.fields { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - paths.extend(self.var_paths(state, &base, field.ty, false)?) - } - paths - }, - Ty::Tagged(tagged_ty) => { - let mut paths = vec![]; - - paths.push(Gunk { - text: format!("match &{from} {{"), - preindent_change: 0, - postindent_change: 4, - }); - for variant in &tagged_ty.variants { - let variant_name = &variant.name; - match &variant.fields { - Some(fields) => { - let field_list = fields.iter().map(|f| f.ident.to_string()).collect::>().join(", "); - paths.push(Gunk { - text: format!("{variant_name} {{ {field_list} }} => {{"), - preindent_change: 0, - postindent_change: 4, - }); - for field in fields { - paths.extend(self.var_paths(state, &field.ident, field.ty, false)?) - } - paths.push(Gunk { - text: format!("}}"), - preindent_change: -4, - postindent_change: 0, - }); - } - None => { - paths.push(Gunk { - text: format!("{variant_name} => {{ }}"), - preindent_change: 0, - postindent_change: 0, - }); - } - } - } - paths.push(Gunk { - text: format!("}}"), - preindent_change: -4, - postindent_change: 0, - }); - paths - }, - Ty::Ref(ref_ty) => { - let base = format!("(*{from})"); - self.var_paths(state, &base, ref_ty.pointee_ty, is_root)? - }, - Ty::Union(union_ty) => { - let mut paths = vec![]; - // FIXME(variant_select): hardcoded to access field 0 for now - if let Some(field) = union_ty.fields.get(0) { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - paths.extend(self.var_paths(state, &base, field.ty, false)?) - } - paths - }, - }; - Ok(paths) - } -} - -/// We want to access all the subfields of a variable in order. -/// Ideally we would just return a list of rvalue expressions like -/// ["val.field", "val.arr[0]", "val.arr[1]", "val.field3.x"] -/// -/// but if a subfield is an enum, then we can't actually write out its rvalue expression -/// as a single expression. Instead we need to break things up with random "match" statements -/// that introduce new temporary names. These are the "gunks" which should just be emitted -/// verbatim. -enum VarPathPart { - /// Some random gunk like a fragment of a "match" that must be emitted for subsequent - /// fields (or gunks) to make sense. - Gunk { - /// Text to emit - text: String, - /// How much the indent is changed by this gunk before it's printed - preindent_change: i32, - /// How much the indent is changed by this gunk after it's printed - postindent_change: i32, - }, - /// An actual rvalue expression to a leaf of the variable - Field(String), } fn gen_state(test: &Test) -> GenState { @@ -1029,12 +1177,12 @@ fn gen_state(test: &Test) -> GenState { fn graffiti_primitive(val_idx: usize) -> T { const MAX_SIZE: usize = 32; const MAX_HEX: usize = 16; - assert!(std::mem::size_of::() <= MAX_SIZE, "only primitives as big as u256 are supported!"); - - let bytes: [u8; MAX_SIZE] = std::array::from_fn(|i| { - (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8) - }); - unsafe { - std::mem::transmute_copy(&bytes) - } -} \ No newline at end of file + assert!( + std::mem::size_of::() <= MAX_SIZE, + "only primitives as big as u256 are supported!" + ); + + let bytes: [u8; MAX_SIZE] = + std::array::from_fn(|i| (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8)); + unsafe { std::mem::transmute_copy(&bytes) } +} diff --git a/src/cli.rs b/src/cli.rs index dab5296..6a889e2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ use crate::{abis::*, Config, OutputFormat}; use clap::{AppSettings, Arg}; use log::LevelFilter; -use simplelog::{TermLogger, TerminalMode, ColorChoice}; +use simplelog::{ColorChoice, TermLogger, TerminalMode}; pub fn make_app() -> Config { static ABI_IMPLS: &[&str] = &[ @@ -160,8 +160,9 @@ pub fn make_app() -> Config { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ColorChoice::Auto - ).unwrap(); + ColorChoice::Auto, + ) + .unwrap(); Config { output_format, diff --git a/src/main.rs b/src/main.rs index 0989bce..7904465 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod abis; mod cli; +mod fivemat; mod procgen; mod report; mod test_format; @@ -313,7 +314,7 @@ fn read_test_manifest(test_file: &Path) -> Result { let mut input = String::new(); reader.read_to_string(&mut input)?; - let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); + let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); if ext == "ron" { let test: Test = ron::from_str(&input).map_err(|e| { @@ -332,8 +333,6 @@ fn read_test_manifest(test_file: &Path) -> Result { } } - - fn generate_test_src( test: &Test, test_key: &TestKey, diff --git a/src/report.rs b/src/report.rs index eeec614..8f3e4b9 100644 --- a/src/report.rs +++ b/src/report.rs @@ -26,7 +26,9 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl // This is Bad! Ideally we should check for all clang<->gcc pairs but to start // let's mark rust <-> C as disagreeing (because rust also disagrees with clang). if !cfg!(any(target_arch = "aarch64", target_arch = "s390x")) - && test.test_name == "ui128" && is_rust_and_c { + && test.test_name == "ui128" + && is_rust_and_c + { result.check = Busted(Check); } diff --git a/src/test_format.rs b/src/test_format.rs index fe52c71..2508faa 100644 --- a/src/test_format.rs +++ b/src/test_format.rs @@ -1,6 +1,6 @@ -use std::{path::Path, collections::HashMap, sync::Arc}; +use std::{collections::HashMap, path::Path, sync::Arc}; -use kdl_script::types::{ArrayTy, RefTy, AliasTy}; +use kdl_script::types::{AliasTy, ArrayTy, RefTy}; use crate::abis::Test; pub fn do_kdl(test_file: &Path, input: String) -> Result { @@ -21,15 +21,15 @@ pub fn do_kdl(test_file: &Path, input: String) -> Result { convention: crate::abis::CallingConvention::C, }; - let mut output = Vec::new(); - abi.generate_caller(&mut output, &test, test.typed.all_funcs()).unwrap(); - let output = String::from_utf8_lossy(&output); + let mut output = String::new(); + abi.generate_caller(&mut output, &test, test.typed.all_funcs()) + .unwrap(); println!("{output}"); - let mut output = Vec::new(); - abi.generate_callee(&mut output, &test, test.typed.all_funcs()).unwrap(); - let output = String::from_utf8_lossy(&output); + let mut output = String::new(); + abi.generate_callee(&mut output, &test, test.typed.all_funcs()) + .unwrap(); println!("{output}"); todo!() -} \ No newline at end of file +} From ff4107ee9eb36075ba4106e791724c51bdf3314b Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Fri, 3 May 2024 23:56:45 -0400 Subject: [PATCH 09/44] IT WORKSSSSSSS --- src/abis.rs | 289 -------- src/abis/c.rs | 822 +---------------------- src/abis/rust.rs | 1569 +++++++++++++++++++++++++++++-------------- src/abis/rust2.rs | 1188 -------------------------------- src/cli.rs | 6 +- src/main.rs | 221 ++++-- src/report.rs | 16 +- src/test_format.rs | 35 - tests/kdl/types.kdl | 4 - 9 files changed, 1263 insertions(+), 2887 deletions(-) delete mode 100644 src/abis.rs delete mode 100644 src/abis/rust2.rs delete mode 100644 src/test_format.rs diff --git a/src/abis.rs b/src/abis.rs deleted file mode 100644 index 8997bc7..0000000 --- a/src/abis.rs +++ /dev/null @@ -1,289 +0,0 @@ -#![allow(non_camel_case_types)] - -// Backends that can generate + compile an implementation's code into a staticlib. -pub mod c; -pub mod rust; -pub mod rust2; - -use super::report::BuildError; -use std::io::Write; -use std::path::Path; - -pub use c::CcAbiImpl; -pub use rust::RustcAbiImpl; - -pub static ABI_IMPL_RUSTC: &str = "rustc"; -pub static ABI_IMPL_CC: &str = "cc"; -pub static ABI_IMPL_GCC: &str = "gcc"; -pub static ABI_IMPL_CLANG: &str = "clang"; -pub static ABI_IMPL_MSVC: &str = "msvc"; - -// pub static ALL_ABIS: &[AbiRef] = &[RUST_ABI, C_ABI]; -pub static ALL_CONVENTIONS: &[CallingConvention] = &[ - CallingConvention::Handwritten, - CallingConvention::C, - CallingConvention::Cdecl, - CallingConvention::Stdcall, - CallingConvention::Fastcall, - CallingConvention::Vectorcall, - // Note sure if these have a purpose, so omitting them for now - // CallingConvention::System, - // CallingConvention::Win64, - // CallingConvention::Sysv64, - // CallingConvention::Aapcs, -]; - -// pre-computed arg/field names to avoid a bunch of tedious formatting, and to make -// it easy to refactor this detail if we decide we don't like this naming scheme. -pub static ARG_NAMES: &[&str] = &[ - "arg0", "arg1", "arg2", "arg3", "arg4", "arg5", "arg6", "arg7", "arg8", "arg9", "arg10", - "arg11", "arg12", "arg13", "arg14", "arg15", "arg16", "arg17", "arg18", "arg19", "arg20", - "arg21", "arg22", "arg23", "arg24", "arg25", "arg26", "arg27", "arg28", "arg29", "arg30", - "arg31", "arg32", -]; -pub static FIELD_NAMES: &[&str] = &[ - "field0", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", - "field9", "field10", "field11", "field12", "field13", "field14", "field15", "field16", - "field17", "field18", "field19", "field20", "field21", "field22", "field23", "field24", - "field25", "field26", "field27", "field28", "field29", "field30", "field31", "field32", -]; -pub static OUTPUT_NAME: &str = "output"; -pub static OUT_PARAM_NAME: &str = "out"; - -/// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. -pub trait AbiImpl { - fn name(&self) -> &'static str; - fn lang(&self) -> &'static str; - fn src_ext(&self) -> &'static str; - fn supports_convention(&self, _convention: CallingConvention) -> bool; - - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError>; - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError>; - - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; -} - -#[derive(Debug, thiserror::Error)] -#[allow(dead_code)] -pub enum GenerateError { - #[error("io error\n{0}")] - Fmt(#[from] std::fmt::Error), - #[error("io error\n{0}")] - Io(#[from] std::io::Error), - #[error("parse error {0}\n{2}\n{}\n{:width$}^", - .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), - "", - width=.2.position.col.saturating_sub(1), - )] - ParseError(String, String, ron::error::Error), - #[error("kdl parse error {}", .2)] - KdlParseError(String, String, kdl::KdlError), - #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] - InconsistentStructDefinition { - name: String, - old_decl: String, - new_decl: String, - }, - #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] - HandwrittenMixing, - #[error("No handwritten source for this pairing (skipping)")] - NoHandwrittenSource, - #[error("Unsupported Signature For Rust: {0}")] - RustUnsupported(String), - #[error("Unsupported Signature For C: {0}")] - CUnsupported(String), - #[error("ABI impl doesn't support this calling convention.")] - UnsupportedConvention, - /// Used to signal we just skipped it - #[error("")] - Skipped, -} - -/// A test, containing several subtests, each its own function -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct Test { - pub name: String, - pub funcs: Vec, -} - -/// A function's calling convention + signature which will -/// be used to generate the caller+callee automatically. -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct Func { - pub name: String, - pub conventions: Vec, - pub inputs: Vec, - pub output: Option, -} - -#[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] -pub enum CallingConvention { - // These conventions are special ones that "desugar" to others - /// Sugar for "every possible convention" - All, - /// A complete opaque convention, the implementation must be manually - /// written in the handwritten_impls directory. - Handwritten, - /// The platform's default C convention (cdecl?) - C, - /// ??? - Cdecl, - /// The platorm's default OS convention (usually C, but Windows is Weird). - System, - - // These conventions are specific ones - /// x64 windows C convention - Win64, - /// x64 non-windows C convention - Sysv64, - /// ARM C convention - Aapcs, - /// Win32 x86 system APIs - Stdcall, - /// Microsoft fastcall - /// MSVC` __fastcall` - /// GCC/Clang `__attribute__((fastcall))` - Fastcall, - /// Microsoft vectorcall - /// MSCV `__vectorcall` - /// GCC/Clang `__attribute__((vectorcall))` - Vectorcall, -} - -/// A typed value. -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum Val { - /// A Ref is passed-by-reference (is a pointer) but the - /// pointee will be regarded as the real value that we check. - /// - /// If a Ref val is used as the return value for a function, it will - /// implicitly introduce an outparam that the callee memcpy's to. - Ref(Box), - /// Some integer - Int(IntVal), - /// Some float - Float(FloatVal), - /// A bool - Bool(bool), - /// An array (homogeneous types, checked on construction) - /// - /// Arrays must be wrapped in a Ref to directly use them as args/returns - /// when compiling to C. Rust is fine with passing them by-value, but of - /// course this is pointless when the other half of the equation pukes. - /// - /// FIXME: it isn't currently enforced that this is homogeneous, anything that needs - /// the type of the elements just grabs the type of element 0 - /// - /// FIXME: it's illegal to have an array of length 0, because it's impossible to - /// attach a type to it - Array(Vec), - /// A named struct (heterogeneous type) - /// - /// Struct decls are implicitly derived from their usage as a value. - /// If any two structs claim the same name but have different layouts, - /// the ABI backends should notice this and return an error. - Struct(String, Vec), - /// An opaque pointer - /// - /// FIXME?: it's gross to just pick "u64" as the type here when ostensibly it would - /// be nice for this to be able to taget 32-bit platforms. But using usize doesn't really - /// make sense either because we're slurping these values out of a static config file! - /// I guess just truncating the pointer is "fine". - Ptr(u64), - // TODO: unions. This is hard to do with the current design where - // types are implicit in their values. You could maybe hack it in - // by having dummy vals for all the different cases and then a - // "real" value for the variant that's actually used, but, kinda gross. - // - // TODO: simd vectors (they have special passing rules!) - // - // TODO: enums (enum classes?) -} - -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum IntVal { - c__int128(i128), - c_int64_t(i64), - c_int32_t(i32), - c_int16_t(i16), - c_int8_t(i8), - - c__uint128(u128), - c_uint64_t(u64), - c_uint32_t(u32), - c_uint16_t(u16), - c_uint8_t(u8), - // TODO: nastier platform-specific-layout c-types? - // i.e. c_int(i64), c_long(i32), char(i8), ... -} - -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum FloatVal { - c_double(f64), - c_float(f32), - // Is there a reason to mess with `long double`? Surely not. -} - -impl CallingConvention { - pub fn name(&self) -> &'static str { - match self { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar and shouldn't reach here!") - } - CallingConvention::Handwritten => "handwritten", - CallingConvention::C => "c", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", - } - } - pub fn from_str(input: &str) -> Option { - Some(match input { - "all" => CallingConvention::All, - "handwritten" => CallingConvention::Handwritten, - "c" => CallingConvention::C, - "cdecl" => CallingConvention::Cdecl, - "system" => CallingConvention::System, - "win64" => CallingConvention::Win64, - "sysv64" => CallingConvention::Sysv64, - "aapcs" => CallingConvention::Aapcs, - "stdcall" => CallingConvention::Stdcall, - "fastcall" => CallingConvention::Fastcall, - "vectorcall" => CallingConvention::Vectorcall, - _ => return None, - }) - } -} - -impl Func { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - self.conventions.iter().any(|&func_cc| { - (func_cc == CallingConvention::All && convention != CallingConvention::Handwritten) - || func_cc == convention - }) - } -} - -impl Test { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - self.funcs - .iter() - .any(|func| func.has_convention(convention)) - } -} diff --git a/src/abis/c.rs b/src/abis/c.rs index 2bb0901..2270a99 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -1,822 +1,4 @@ -use crate::Config; - -use super::super::*; -use super::*; - -pub static C_TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); - +#[allow(dead_code)] pub struct CcAbiImpl { - cc_flavor: CCFlavor, - platform: Platform, - mode: &'static str, -} - -#[derive(PartialEq)] -enum CCFlavor { - Clang, - Gcc, - Msvc, -} - -#[derive(PartialEq)] -enum Platform { - Windows, - Unixy, -} - -impl AbiImpl for CcAbiImpl { - fn name(&self) -> &'static str { - self.mode - } - fn lang(&self) -> &'static str { - "c" - } - fn src_ext(&self) -> &'static str { - "c" - } - - fn supports_convention(&self, convention: CallingConvention) -> bool { - self.c_convention_decl(convention).is_ok() - } - - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - self.write_c_signature(f, function, convention)?; - writeln!(f, " {{")?; - - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - if let Some(output) = &function.output { - writeln!( - f, - " {} = {};", - self.c_var_decl(output, OUTPUT_NAME)?, - self.c_val(output)? - )?; - writeln!( - f, - "{}", - self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - writeln!( - f, - " {}", - self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - } - writeln!(f, "}}")?; - writeln!(f)?; - } - - Ok(()) - } - - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the extern block - for function in &test.funcs { - self.write_c_signature(f, function, convention)?; - writeln!(f, ";")?; - } - - writeln!(f)?; - writeln!(f, "void do_test(void) {{")?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Add an extra scope to avoid clashes between subtests - writeln!(f, "{{")?; - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.c_var_decl(input, ARG_NAMES[idx])?, - self.c_val(input)? - )?; - writeln!( - f, - "{}", - self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Output - let pass_out = if let Some(output) = &function.output { - if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {};", out_param_var)?; - write!(f, " ")?; - true - } else { - write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - write!(f, " ")?; - false - }; - - // Do the actual call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; - if function.inputs.is_empty() { - write!(f, "{}", pass)?; - } else { - write!(f, ", {}", pass)?; - } - } - writeln!(f, ");")?; - - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; - } - writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; - writeln!(f, "}}")?; - writeln!(f)?; - } - writeln!(f, "}}")?; - Ok(()) - } - - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), - } - } - - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), - } - } -} - -impl CcAbiImpl { - pub fn new(_system_info: &Config, mode: &'static str) -> Self { - let compiler = cc::Build::new().get_compiler(); - let cc_flavor = if compiler.is_like_msvc() { - CCFlavor::Msvc - } else if compiler.is_like_gnu() { - CCFlavor::Gcc - } else if compiler.is_like_clang() { - CCFlavor::Clang - } else { - panic!("Unknown compiler flavour for CC"); - }; - - let platform = if cfg!(target_os = "windows") { - Platform::Windows - } else { - Platform::Unixy - }; - - Self { - cc_flavor, - platform, - mode, - } - } - - fn compile_cc(&self, src_path: &Path, lib_name: &str) -> Result { - cc::Build::new() - .file(src_path) - .opt_level(0) - .cargo_metadata(false) - .target(built_info::TARGET) - // .warnings_into_errors(true) - .try_compile(lib_name)?; - Ok(String::from(lib_name)) - } - - fn compile_clang(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); - Command::new("clang") - .arg("-ffunction-sections") - .arg("-fdata-sections") - .arg("-fPIC") - .arg("-o") - .arg(&obj_path) - .arg("-c") - .arg(&src_path) - .status() - .unwrap(); - Command::new("ar") - .arg("cq") - .arg(&lib_path) - .arg(&obj_path) - .status() - .unwrap(); - Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); - Ok(String::from(lib_name)) - } - - fn compile_gcc(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); - Command::new("gcc") - .arg("-ffunction-sections") - .arg("-fdata-sections") - .arg("-fPIC") - .arg("-o") - .arg(&obj_path) - .arg("-c") - .arg(&src_path) - .status() - .unwrap(); - Command::new("ar") - .arg("cq") - .arg(&lib_path) - .arg(&obj_path) - .status() - .unwrap(); - Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); - Ok(String::from(lib_name)) - } - - fn compile_msvc(&self, _src_path: &Path, _lib_name: &str) -> Result { - unimplemented!() - } - - fn c_convention_decl( - &self, - convention: CallingConvention, - ) -> Result<&'static str, GenerateError> { - use CCFlavor::*; - use CallingConvention::*; - use Platform::*; - // GCC (as __attribute__'s) - // - // * x86: cdecl, fastcall, thiscall, stdcall, - // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), - // naked, interrupt, sseregparm - // * ARM: pcs="aapcs", pcs="aapcs-vfp", - // long_call, short_call, naked, - // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), - // - // MSVC (as ~keywords) - // - // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall - - let val = match convention { - Handwritten => "handwritten", - All => { - // All is sugar, we shouldn't get here! - return Err(GenerateError::UnsupportedConvention); - } - System | Win64 | Sysv64 | Aapcs => { - // Don't want to think about these yet, I think they're - // all properly convered by other ABIs - return Err(GenerateError::UnsupportedConvention); - } - C => "", - Cdecl => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__cdecl ", - Gcc | Clang => "__attribute__((cdecl)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Stdcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__stdcall ", - Gcc | Clang => "__attribute__((stdcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Fastcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__fastcall ", - Gcc | Clang => "__attribute__((fastcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Vectorcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__vectorcall ", - Gcc | Clang => "__attribute__((vectorcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - }; - - Ok(val) - } - - // Emit a function signature - fn write_c_signature( - &self, - f: &mut dyn Write, - function: &Func, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let convention_decl = self.c_convention_decl(convention)?; - - // First figure out the return (by-ref requires an out-param) - let out_param = if let Some(output) = &function.output { - let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; - if out_param.is_none() { - write!(f, "{} ", self.c_arg_type(output)?)?; - } else { - write!(f, "void ")?; - } - out_param - } else { - write!(f, "void ")?; - None - }; - - write!(f, "{}", convention_decl)?; - - // Now write out the args - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; - } - - // Add extra implicit args - if let Some(out_param) = out_param { - if !function.inputs.is_empty() { - write!(f, ", ")?; - } - write!(f, "{out_param}")?; - } else if function.inputs.is_empty() { - write!(f, "void")?; - } - write!(f, ")")?; - - Ok(()) - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { - // Load test harness "headers" - write!(f, "{}", C_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.c_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } - } - - Ok(()) - } - - fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.c_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = format!("struct {name}"); - output.push_str(&format!("struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); - output.push_str(&line); - } - output.push_str("};\n"); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.c_forward_decl(&vals[0]), - Ref(pointee) => self.c_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { - use Val::*; - let val = match val { - Ref(pointee) => self.c_var_decl(pointee, var_name)?, - Array(_) => { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) - } - normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), - }; - Ok(val) - } - - /// The decl to use for a function arg (apply referenceness) - fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - format!("{}* {arg_name}", self.c_arg_type(cur_val)?) - } else { - format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) - } - } else { - format!("{} {arg_name}", self.c_arg_type(val)?) - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param( - &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) - } else { - Some(format!( - "{} {out_param_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - } else { - None - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(self.c_var_decl(pointee, output_name)?)) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - if let Val::Array(_) = &**pointee { - Ok(arg_name.to_string()) - } else { - Ok(format!("&{arg_name}")) - } - } else { - Ok(arg_name.to_string()) - } - } - - /// How to return a value - fn c_var_return( - &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!( - "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" - )) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn c_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => { - let mut cur_val = &**pointee; - while let Val::Array(vals) = cur_val { - cur_val = &vals[0]; - } - format!("{}*", self.c_arg_type(cur_val)?) - } - Ptr(_) => "void*".to_string(), - Bool(_) => "bool".to_string(), - Array(_vals) => { - // C arrays are kinda fake due to how they decay in function arg - // position, so a ton of code needs to very delicately detect arrays - // and desugar them properly. Since most things eventually sink into - // c_arg_type, this is a good guard against something forgetting to - // specially handle arrays! - // - // But also it just isn't legal to pass an array by-value in C - // (it decays to a pointer, so you need to wrap it in Ref for - // other ABIs to understand that's what we're doing. - return Err(GenerateError::CUnsupported( - "C Arrays can't be passed directly, wrap this in Ref".to_string(), - )); - } - Struct(name, _) => format!("struct {name}"), - Float(FloatVal::c_double(_)) => "double".to_string(), - Float(FloatVal::c_float(_)) => "float".to_string(), - Int(int_val) => match int_val { - c__int128(_) => "__int128_t".to_string(), - c_int64_t(_) => "int64_t".to_string(), - c_int32_t(_) => "int32_t".to_string(), - c_int16_t(_) => "int16_t".to_string(), - c_int8_t(_) => "int8_t".to_string(), - c__uint128(_) => "__uint128_t".to_string(), - c_uint64_t(_) => "uint64_t".to_string(), - c_uint32_t(_) => "uint32_t".to_string(), - c_uint16_t(_) => "uint16_t".to_string(), - c_uint8_t(_) => "uint8_t".to_string(), - }, - }; - Ok(val) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - Ok(format!( - "{} {field_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - - /// An expression that generates this value. - pub fn c_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => self.c_val(pointee)?, - Ptr(addr) => format!("(void*){addr:#X}ull"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, elem) in vals.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = (self.c_val(elem)?).to_string(); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Struct(_name, fields) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, field) in fields.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0f") - } else { - format!("{val}f") - } - } - Int(int_val) => match *int_val { - c__int128(val) => { - let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") - } - c__uint128(val) => { - let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c_uint64_t(val) => format!("{val}ull"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(val) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn c_write_val( - &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.c_var_paths(val, from, is_var_root)? { - writeln!( - output, - " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" - ) - .unwrap(); - } - write!(output, " FINISHED_VAL({to});").unwrap(); - - Ok(output) - } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for c_write_val's use. - fn c_var_paths( - &self, - val: &Val, - from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.c_var_paths(field, &base, false)?); - } - paths - } - Val::Ref(pointee) => { - if is_var_root { - self.c_var_paths(pointee, from, false)? - } else if let Val::Array(_) = &**pointee { - self.c_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.c_var_paths(pointee, &base, false)? - } - } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.c_var_paths(elem, &base, false)?); - } - paths - } - }; - - Ok(paths) - } - - /* - /// Format specifiers for C types, for print debugging. - /// This is no longer used but it's a shame to throw out. - pub fn cfmt(&self, val: &Val) -> &'static str { - use Val::*; - use IntVal::*; - match val { - Ref(x) => self.cfmt(x), - Ptr(_) => "\"p\"", - Bool(_) => "\"d\"", - Array(_) => { - todo!() - } - Struct(_name, _fields) => { - todo!() - } - Float(FloatVal::c_double(_val)) => "\"f\"", - Float(FloatVal::c_float(_val)) => "\"f\"", - Int(int_val) => match int_val { - c_uint8_t(..) => "PRIu8", - c_uint16_t(..) => "PRIu16", - c_uint32_t(..) => "PRIu32", - c_uint64_t(..) => "PRIu64", - c_uint128_t(..) => "PRIu128", - - c_int8_t(..) => "PRId8", - c_int16_t(..) => "PRId16", - c_int32_t(..) => "PRId32", - c_int64_t(..) => "PRId64", - c_int128_t(..) => "PRId128", - } - } - } - */ + codegen_backend: Option, } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index ab31bfc..9ff4a3f 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -1,8 +1,24 @@ +//! Rust(c) codegen backend backend + +use std::sync::Arc; + +use kdl_script::parse::FuncDecl; +use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; +use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; + use super::super::*; use super::*; +use crate::fivemat::Fivemat; +use std::fmt::Write; pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); +const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; +const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; +const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; +const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; +const INDENT: &str = " "; + static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); #[allow(dead_code)] @@ -11,6 +27,27 @@ pub struct RustcAbiImpl { codegen_backend: Option, } +pub struct TestImpl { + pub typed: Arc, + pub env: Arc, + pub graph: Arc, + pub convention: CallingConvention, +} + +pub struct GenState<'a> { + test: &'a TestImpl, + tynames: HashMap, + borrowed_tynames: HashMap, + funcs: Vec, + val_writer: WriteImpl, +} + +enum WriteImpl { + HarnessCallback, + Print, + Noop, +} + impl AbiImpl for RustcAbiImpl { fn name(&self) -> &'static str { "rustc" @@ -21,6 +58,11 @@ impl AbiImpl for RustcAbiImpl { fn src_ext(&self) -> &'static str { "rs" } + fn pun_env(&self) -> Arc { + Arc::new(kdl_script::PunEnv { + lang: "rust".to_string(), + }) + } fn supports_convention(&self, convention: CallingConvention) -> bool { // NOTE: Rustc spits out: // @@ -45,160 +87,6 @@ impl AbiImpl for RustcAbiImpl { } } - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_rust_prefix(f, test, convention)?; - let convention_decl = self.rust_convention_decl(convention); - - // Generate the extern block - writeln!(f, "extern \"{convention_decl}\" {{",)?; - for function in &test.funcs { - write!(f, " ")?; - self.write_rust_signature(f, function)?; - writeln!(f, ";")?; - } - writeln!(f, "}}")?; - writeln!(f)?; - - // Now generate the body - writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; - - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - writeln!(f, " unsafe {{")?; - - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.rust_var_decl(input, ARG_NAMES[idx])?, - self.rust_val(input)? - )?; - } - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.rust_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Outputs - write!(f, " ")?; - let pass_out = if let Some(output) = &function.output { - if let Some(decl) = self.rust_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {}", decl)?; - true - } else { - write!(f, " {} = ", self.rust_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - false - }; - - // Do the call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - write!(f, "{}, ", self.rust_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - writeln!(f, "&mut {OUTPUT_NAME}")?; - } - writeln!(f, ");")?; - writeln!(f)?; - - // Report the output - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.rust_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; - } - - // Finished - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS);" - )?; - writeln!(f, " }}")?; - } - - writeln!(f, "}}")?; - - Ok(()) - } - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_rust_prefix(f, test, convention)?; - let convention_decl = self.rust_convention_decl(convention); - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Write the signature - writeln!(f, "#[no_mangle]")?; - write!(f, "pub unsafe extern \"{convention_decl}\" ")?; - self.write_rust_signature(f, function)?; - writeln!(f, " {{")?; - - // Now the body - - // Report Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.rust_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - - // Report outputs and return - if let Some(output) = &function.output { - let decl = self.rust_var_decl(output, OUTPUT_NAME)?; - let val = self.rust_val(output)?; - writeln!(f, " {decl} = {val};")?; - writeln!( - f, - "{}", - self.rust_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - writeln!( - f, - " {}", - self.rust_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - } - writeln!(f, "}}")?; - } - - Ok(()) - } - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { let mut cmd = Command::new("rustc"); cmd.arg("--crate-type") @@ -225,437 +113,1130 @@ impl AbiImpl for RustcAbiImpl { // Currently no need to be different self.compile_callee(src_path, lib_name) } + + fn generate_callee( + &self, + f: &mut dyn Write, + test: &abis::Test, + variant: &TestVariant, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + let query = test.program.all_funcs(); + let test = TestImpl { + typed: test.program.clone(), + env: variant.env.clone(), + graph: variant.graph.clone(), + convention, + }; + self.generate_callee_impl(f, &test, query) + } + + fn generate_caller( + &self, + f: &mut dyn Write, + test: &abis::Test, + variant: &TestVariant, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + let query = test.program.all_funcs(); + let test = TestImpl { + typed: test.program.clone(), + env: variant.env.clone(), + graph: variant.graph.clone(), + convention, + }; + self.generate_caller_impl(f, &test, query) + } } impl RustcAbiImpl { - pub fn new(_system_info: &Config, codegen_backend: Option) -> Self { - Self { - is_nightly: built_info::RUSTC_VERSION.contains("nightly"), - codegen_backend, + pub fn generate_caller_impl( + &self, + f: &mut dyn Write, + test: &TestImpl, + query: impl Iterator, + ) -> Result<(), GenerateError> { + let mut state = gen_state(test); + let mut f = Fivemat::new(f, INDENT); + + // Generate type decls and gather up functions + self.generate_definitions(&mut f, &mut state, query)?; + // Generate decls of the functions we want to call + self.generate_caller_externs(&mut f, &state)?; + + // Generate the test function the harness will call + writeln!(f, "#[no_mangle]\npub extern \"C\" fn do_test() {{")?; + for &func in &state.funcs { + // Generate the individual function calls + self.generate_caller_body(&mut f, &state, func)?; } + writeln!(&mut f, "}}")?; + + Ok(()) } - fn rust_convention_decl(&self, convention: CallingConvention) -> &'static str { - match convention { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar that shouldn't reach here") - } - CallingConvention::Handwritten => { - unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") - } - CallingConvention::C => "C", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", + fn generate_caller_externs( + &self, + f: &mut Fivemat, + state: &GenState, + ) -> Result<(), GenerateError> { + let convention_decl = self.convention_decl(state.test.convention)?; + writeln!(f, "extern \"{convention_decl}\" {{",)?; + f.add_indent(1); + for &func in &state.funcs { + self.generate_signature(f, &state, func)?; + writeln!(f, ";")?; } + f.sub_indent(1); + writeln!(f, "}}")?; + writeln!(f)?; + Ok(()) } - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_rust_prefix( + fn generate_caller_body( &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, + f: &mut Fivemat, + state: &GenState, + func: FuncIdx, ) -> Result<(), GenerateError> { - if convention == CallingConvention::Vectorcall { - writeln!(f, "#![feature(abi_vectorcall)]")?; + writeln!(f, "unsafe {{")?; + f.add_indent(1); + let function = state.test.typed.realize_func(func); + let mut val_idx = 0; + + // Create vars for all the inputs + for arg in function.inputs.iter() { + // Create and report the input + self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + self.write_var(f, state, &arg.name, arg.ty, VAR_CALLER_INPUTS)?; } - // Load test harness "headers" - write!(f, "{}", RUST_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.rust_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } + + // Call the function + self.call_function(f, state, function)?; + + // Report all the outputs + for arg in function.outputs.iter() { + let arg_name = &arg.name; + self.write_var(f, state, arg_name, arg.ty, VAR_CALLER_OUTPUTS)?; } + // Report the function is complete + self.end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; + f.sub_indent(1); + writeln!(f, "}}")?; Ok(()) } - fn write_rust_signature( + fn call_function( &self, - f: &mut dyn Write, + f: &mut Fivemat, + state: &GenState, function: &Func, ) -> Result<(), GenerateError> { - write!(f, "fn {}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - write!(f, "{}, ", self.rust_arg_decl(input, ARG_NAMES[idx])?)?; + let func_name = &function.name; + + // if there's an output, bind it + let mut proper_outputs = function + .outputs + .iter() + .filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); + let output = proper_outputs.next(); + let too_many_outputs = proper_outputs.next(); + if too_many_outputs.is_some() { + return Err(GenerateError::RustUnsupported(format!( + "multiple normal returns (should this be a tuple?)" + ))); } - if let Some(output) = &function.output { - if let Some(out_param) = self.rust_out_param(output, OUT_PARAM_NAME)? { - write!(f, "{}", out_param)?; - write!(f, ")")?; - } else { - write!(f, ")")?; - let ty = self.rust_arg_type(output)?; - write!(f, " -> {ty}")?; + if let Some(output) = output { + write!(f, "let {} = ", output.name)?; + } + + // Call the function + write!(f, "{func_name}(")?; + let inputs = function.inputs.iter(); + let out_params = function + .outputs + .iter() + .filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); + + for (arg_idx, arg) in inputs.chain(out_params).enumerate() { + if arg_idx > 0 { + write!(f, ", ")?; } - } else { - write!(f, ")")?; + self.pass_var(f, state, &arg.name, arg.ty)?; } + writeln!(f, ");")?; + writeln!(f)?; Ok(()) } +} - /// If this value defines a nominal type, this will spit out: - /// - /// * The type name - /// * The forward-declaration of that type - /// - /// To catch buggy test definitions, you should validate that all - /// structs that claim a particular name have the same declaration. - /// This is done in write_rust_prefix. - fn rust_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.rust_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = name.to_string(); - output.push_str("\n#[repr(C)]\n"); - output.push_str(&format!("pub struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!( - " {}: {},\n", - FIELD_NAMES[idx], - self.rust_nested_type(field)? - ); - output.push_str(&line); - } - output.push('}'); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.rust_forward_decl(&vals[0]), - Ref(pointee) => self.rust_forward_decl(pointee), - _ => Ok(vec![]), +impl RustcAbiImpl { + pub fn generate_callee_impl( + &self, + f: &mut dyn std::fmt::Write, + test: &TestImpl, + query: impl Iterator, + ) -> Result<(), GenerateError> { + let mut state = gen_state(test); + let mut f = Fivemat::new(f, INDENT); + + // Generate type decls and gather up functions + self.generate_definitions(&mut f, &mut state, query)?; + + for &func in &state.funcs { + // Generate the individual function definitions + self.generate_callee_body(&mut f, &state, func)?; } + Ok(()) } - /// The decl to use for a local var (reference-ness stripped) - fn rust_var_decl(&self, val: &Val, var_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(self.rust_var_decl(pointee, var_name)?) - } else { - Ok(format!("let {var_name}: {}", self.rust_arg_type(val)?)) + fn generate_callee_body( + &self, + f: &mut Fivemat, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.test.typed.realize_func(func); + let convention_decl = self.convention_decl(state.test.convention)?; + writeln!(f, "#[no_mangle]")?; + write!(f, "pub unsafe extern \"{convention_decl}\" ")?; + self.generate_signature(f, &state, func)?; + writeln!(f, " {{")?; + f.add_indent(1); + writeln!(f, "unsafe {{")?; + f.add_indent(1); + // Report the inputs + for arg in function.inputs.iter() { + let arg_name = &arg.name; + self.write_var(f, state, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; } + + // Create outputs and report them + let mut val_idx = 0; + for arg in function.outputs.iter() { + // Create and report the input + self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + self.write_var(f, state, &arg.name, arg.ty, VAR_CALLEE_OUTPUTS)?; + } + + // Report the function is complete + self.end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; + + // Return the outputs + for arg in function.outputs.iter() { + self.return_var(f, state, &arg.name, arg.ty)?; + } + f.sub_indent(1); + writeln!(f, "}}")?; + f.sub_indent(1); + writeln!(f, "}}")?; + Ok(()) } +} - /// The decl to use for a function arg (apply referenceness) - fn rust_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(format!("{arg_name}: &{}", self.rust_arg_type(pointee)?)) - } else { - Ok(format!("{arg_name}: {}", self.rust_arg_type(val)?)) +impl RustcAbiImpl { + pub fn new(_system_info: &Config, codegen_backend: Option) -> Self { + Self { + is_nightly: built_info::RUSTC_VERSION.contains("nightly"), + codegen_backend, } } - /// If the return type needs to be an out_param, this returns it - fn rust_out_param( + pub fn generate_definitions( &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "{out_param_name}: &mut {}", - self.rust_arg_type(pointee)? - ))) - } else { - Ok(None) + f: &mut Fivemat, + state: &mut GenState, + query: impl Iterator, + ) -> Result<(), GenerateError> { + self.write_harness_prefix(f, &state)?; + + for def in state.test.graph.definitions(query) { + match def { + kdl_script::Definition::DeclareTy(ty) => { + self.intern_tyname(f, state, ty)?; + } + kdl_script::Definition::DefineTy(ty) => { + self.generate_tydef(f, state, ty)?; + } + kdl_script::Definition::DefineFunc(func) => { + // Buffer up the funcs + state.funcs.push(func); + } + kdl_script::Definition::DeclareFunc(_) => { + // nothing to do, executable kdl-script isn't real and can't hurt us + } + } } + + Ok(()) } - /// If the return type needs to be an out_param, this returns it - fn rust_out_param_var( + pub fn intern_tyname( &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "let mut {output_name}: {} = {};", - self.rust_arg_type(pointee)?, - self.rust_default_val(pointee)? - ))) - } else { - Ok(None) + f: &mut Fivemat, + state: &mut GenState, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Don't double-intern + if state.tynames.contains_key(&ty) { + return Ok(()); } - } - /// How to pass an argument - fn rust_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(_) = val { - Ok(format!("&{arg_name}")) - } else { - Ok(arg_name.to_string()) + let (tyname, borrowed_tyname) = match state.test.typed.realize_ty(ty) { + // Structural types that don't need definitions but we should + // intern the name of + Ty::Primitive(prim) => { + let name = match prim { + PrimitiveTy::I8 => "i8", + PrimitiveTy::I16 => "i16", + PrimitiveTy::I32 => "i32", + PrimitiveTy::I64 => "i64", + PrimitiveTy::I128 => "i128", + PrimitiveTy::U8 => "u8", + PrimitiveTy::U16 => "u16", + PrimitiveTy::U32 => "u32", + PrimitiveTy::U64 => "u64", + PrimitiveTy::U128 => "u128", + PrimitiveTy::F32 => "f32", + PrimitiveTy::F64 => "f64", + PrimitiveTy::Bool => "bool", + PrimitiveTy::Ptr => "*mut ()", + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have i256" + )))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have u256" + )))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f16" + )))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f128" + )))?, + }; + (name.to_owned(), None) + } + Ty::Array(ArrayTy { elem_ty, len }) => { + let elem_tyname = &state.tynames[elem_ty]; + let borrowed_tyname = state + .borrowed_tynames + .get(elem_ty) + .map(|elem_tyname| format!("[{elem_tyname}; {len}]")); + (format!("[{elem_tyname}; {len}]"), borrowed_tyname) + } + Ty::Ref(RefTy { pointee_ty }) => { + let pointee_tyname = &state.tynames[pointee_ty]; + let borrowed_pointee_tyname = state + .borrowed_tynames + .get(pointee_ty) + .unwrap_or(pointee_tyname); + ( + format!("&mut {pointee_tyname}"), + Some(format!("&'a mut {borrowed_pointee_tyname}")), + ) + } + Ty::Empty => ("()".to_owned(), None), + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let has_borrows = struct_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); + ((*struct_ty.name).clone(), borrowed_tyname) + } + Ty::Union(union_ty) => { + let has_borrows = union_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); + ((*union_ty.name).clone(), borrowed_tyname) + } + Ty::Enum(enum_ty) => ((*enum_ty.name).clone(), None), + Ty::Tagged(tagged_ty) => { + let has_borrows = tagged_ty.variants.iter().any(|v| { + v.fields + .as_ref() + .map(|fields| { + fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)) + }) + .unwrap_or(false) + }); + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); + ((*tagged_ty.name).clone(), borrowed_tyname) + } + Ty::Alias(AliasTy { name, real, attrs }) => { + let borrowed_tyname = state + .borrowed_tynames + .get(&real) + .map(|name| format!("{name}<'a>")); + ((**name).clone(), borrowed_tyname) + } + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + ( + state.tynames[&real_ty].clone(), + state.borrowed_tynames.get(&real_ty).cloned(), + ) + } + }; + + state.tynames.insert(ty, tyname); + if let Some(borrowed) = borrowed_tyname { + state.borrowed_tynames.insert(ty, borrowed); } + + Ok(()) } - /// How to return a value - fn rust_var_return( + pub fn generate_tydef( &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!("*{out_param_name} = {var_name};")) - } else { - Ok(format!("return {var_name};")) - } - } + f: &mut Fivemat, + state: &mut GenState, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Make sure our own name is interned + self.intern_tyname(f, state, ty)?; - /// The type name to use for this value when it is stored in args/vars. - fn rust_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => format!("*mut {}", self.rust_arg_type(pointee)?), - Ptr(_) => "*mut ()".to_string(), - Bool(_) => "bool".to_string(), - Array(vals) => format!("[{}; {}]", self.rust_arg_type(&vals[0])?, vals.len()), - Struct(name, _) => name.to_string(), - Float(FloatVal::c_double(_)) => "f64".to_string(), - Float(FloatVal::c_float(_)) => "f32".to_string(), - Int(int_val) => match int_val { - c__int128(_) => { - if STRUCT_128 { - "FfiI128".to_string() - } else { - "i128".to_string() - } + match state.test.typed.realize_ty(ty) { + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + assert!( + struct_ty.attrs.is_empty(), + "don't yet know how to apply attrs to structs" + ); + + let has_borrows = struct_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); + + // Emit an actual struct decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "struct {}<'a> {{", struct_ty.name)?; + } else { + writeln!(f, "struct {} {{", struct_ty.name)?; } - c_int64_t(_) => "i64".to_string(), - c_int32_t(_) => "i32".to_string(), - c_int16_t(_) => "i16".to_string(), - c_int8_t(_) => "i8".to_string(), - c__uint128(_) => { - if STRUCT_128 { - "FfiU128".to_string() - } else { - "u128".to_string() - } + f.add_indent(1); + for field in &struct_ty.fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; } - c_uint64_t(_) => "u64".to_string(), - c_uint32_t(_) => "u32".to_string(), - c_uint16_t(_) => "u16".to_string(), - c_uint8_t(_) => "u8".to_string(), - }, - }; - Ok(out) - } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Union(union_ty) => { + assert!( + union_ty.attrs.is_empty(), + "don't yet know how to apply attrs to unions" + ); - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn rust_nested_type(&self, val: &Val) -> Result { - self.rust_arg_type(val) - } + let has_borrows = union_ty + .fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - /// An expression that generates this value. - fn rust_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => self.rust_val(pointee)?, - Ptr(addr) => format!("{addr:#X} as *mut ()"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_val(elem)?); - output.push_str(&part); + // Emit an actual union decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "union {}<'a> {{", union_ty.name)?; + } else { + writeln!(f, "union {} {{", union_ty.name)?; } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_val(field)?); - output.push_str(&part); + f.add_indent(1); + for field in &union_ty.fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; } - output.push_str(" }"); - output + f.sub_indent(1); + writeln!(f, "}}\n")?; } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") + Ty::Enum(enum_ty) => { + assert!( + enum_ty.attrs.is_empty(), + "don't yet know how to apply attrs to enums" + ); + + // Emit an actual enum decl + writeln!(f, "#[repr(C)]")?; + writeln!(f, "enum {} {{", enum_ty.name)?; + f.add_indent(1); + for variant in &enum_ty.variants { + let variant_name = &variant.name; + writeln!(f, "{variant_name},")?; } + f.sub_indent(1); + writeln!(f, "}}\n")?; } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") + Ty::Tagged(tagged_ty) => { + assert!( + tagged_ty.attrs.is_empty(), + "don't yet know how to apply attrs to tagged unions" + ); + + let has_borrows = tagged_ty.variants.iter().any(|v| { + v.fields + .as_ref() + .map(|fields| { + fields + .iter() + .any(|field| state.borrowed_tynames.contains_key(&field.ty)) + }) + .unwrap_or(false) + }); + + // Emit an actual enum decl + writeln!(f, "#[repr(C)]")?; + if has_borrows { + writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; } else { - format!("{val}") + writeln!(f, "enum {} {{", tagged_ty.name)?; } - } - Int(int_val) => match int_val { - c__int128(val) => { - if STRUCT_128 { - format!("FfiI128::new({val})") + f.add_indent(1); + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + if let Some(fields) = &variant.fields { + writeln!(f, "{variant_name} {{")?; + f.add_indent(1); + for field in fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; + } + f.sub_indent(1); + writeln!(f, "}},")?; } else { - format!("{val}") + writeln!(f, "{variant_name},")?; } } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c__uint128(val) => { - if STRUCT_128 { - format!("FfiU128::new({val:#X})") - } else { - format!("{val:#X}") - } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Alias(AliasTy { name, real, attrs }) => { + assert!( + attrs.is_empty(), + "don't yet know how to apply attrs to type aliases" + ); + + // Emit an actual type alias decl + if let Some(real_tyname) = state.borrowed_tynames.get(&real) { + writeln!(f, "type {name}<'a> = {real_tyname};\n")?; + } else { + let real_tyname = &state.tynames[&real]; + writeln!(f, "type {name} = {real_tyname};\n")?; } - c_uint64_t(val) => format!("{val:#X}"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(out) + } + Ty::Pun(..) => { + // Puns should be evaporated by the type name interner + } + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 + | PrimitiveTy::I16 + | PrimitiveTy::I32 + | PrimitiveTy::I64 + | PrimitiveTy::I128 + | PrimitiveTy::I256 + | PrimitiveTy::U8 + | PrimitiveTy::U16 + | PrimitiveTy::U32 + | PrimitiveTy::U64 + | PrimitiveTy::U128 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + // Builtin + } + }; + } + Ty::Array(ArrayTy { .. }) => { + // Builtin + } + Ty::Ref(RefTy { .. }) => { + // Builtin + } + Ty::Empty => { + // Builtin + } + } + Ok(()) } - /// A suitable default value for this type - fn rust_default_val(&self, val: &Val) -> Result { - use Val::*; - let out = match val { - Ref(pointee) => self.rust_default_val(pointee)?, - Ptr(_) => "0 as *mut ()".to_string(), - Bool(_) => "false".to_string(), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_default_val(elem)?); - output.push_str(&part); + pub fn generate_value( + &self, + f: &mut Fivemat, + state: &GenState, + ty: TyIdx, + val_idx: &mut usize, + alias: Option<&str>, + ref_temp_name: &str, + extra_decls: &mut Vec, + ) -> Result<(), GenerateError> { + let names = match state.test.typed.realize_ty(ty) { + // Primitives are the only "real" values with actual bytes that advance val_idx + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 => { + write!(f, "{:#X}u8 as i8", graffiti_primitive::(*val_idx))? + } + PrimitiveTy::I16 => { + write!(f, "{:#X}u16 as i16", graffiti_primitive::(*val_idx))? + } + PrimitiveTy::I32 => { + write!(f, "{:#X}u32 as i32", graffiti_primitive::(*val_idx))? + } + PrimitiveTy::I64 => { + write!(f, "{:#X}u64 as i64", graffiti_primitive::(*val_idx))? + } + PrimitiveTy::I128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + PrimitiveTy::U128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, + + PrimitiveTy::F32 => write!( + f, + "f32::from_bits({:#X}u32)", + graffiti_primitive::(*val_idx) + )?, + PrimitiveTy::F64 => write!( + f, + "f64::from_bits({:#X}u64)", + graffiti_primitive::(*val_idx) + )?, + PrimitiveTy::Bool => write!(f, "{}", true)?, + PrimitiveTy::Ptr => { + if true { + write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? + } else { + write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? + } + } + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have i256" + )))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have u256" + )))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f16" + )))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( + "rust doesn't have f128" + )))?, + }; + *val_idx += 1; + } + Ty::Empty => { + write!(f, "()")?; + } + Ty::Ref(RefTy { pointee_ty }) => { + // The value is a mutable reference to a temporary + write!(f, "&mut {ref_temp_name}")?; + + // TODO: should this be a recursive call to create_var (need create_var_inner?) + // Now do the rest of the recursion on constructing the temporary + let mut ref_temp = String::new(); + let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); + let ty_name = &state.tynames[pointee_ty]; + write!(&mut ref_temp_f, "let mut {ref_temp_name}: {ty_name} = ")?; + let ref_temp_name = format!("{ref_temp_name}_"); + self.generate_value( + &mut ref_temp_f, + state, + *pointee_ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; + write!(&mut ref_temp_f, ";")?; + extra_decls.push(ref_temp); + } + Ty::Array(ArrayTy { elem_ty, len }) => { + write!(f, "[")?; + for arr_idx in 0..*len { + if arr_idx > 0 { + write!(f, ", ")?; + } + let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); + self.generate_value( + f, + state, + *elem_ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_default_val(field)?); - output.push_str(&part); + write!(f, "]")?; + } + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let name = alias.unwrap_or(&struct_ty.name); + write!(f, "{name} {{ ")?; + for (field_idx, field) in struct_ty.fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } - output.push_str(" }"); - output + write!(f, " }}")?; } - Float(..) => "0.0".to_string(), - Int(IntVal::c__int128(..)) => { - if STRUCT_128 { - "FfiI128::new(0)".to_string() - } else { - "0".to_string() + Ty::Union(union_ty) => { + let name = alias.unwrap_or(&union_ty.name); + write!(f, "{name} {{ ")?; + // FIXME(variant_select):have a way to pick the variant! + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; } + write!(f, " }}")?; } - Int(IntVal::c__uint128(..)) => { - if STRUCT_128 { - "FfiU128::new(0)".to_string() - } else { - "0".to_string() + Ty::Enum(enum_ty) => { + let name = alias.unwrap_or(&enum_ty.name); + // FIXME(variant_select):have a way to pick the variant! + if let Some(variant) = enum_ty.variants.get(0) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + } + } + Ty::Tagged(tagged_ty) => { + let name = alias.unwrap_or(&tagged_ty.name); + // FIXME(variant_select): have a way to pick the variant! + if let Some(variant) = tagged_ty.variants.get(0) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + if let Some(fields) = &variant.fields { + write!(f, " {{ ")?; + for (field_idx, field) in fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + val_idx, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, " }}")?; + } } } - Int(..) => "0".to_string(), + Ty::Alias(AliasTy { real, name, .. }) => { + let alias = alias.or_else(|| Some(name)); + self.generate_value(f, state, *real, val_idx, alias, ref_temp_name, extra_decls)?; + } + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + self.generate_value( + f, + state, + real_ty, + val_idx, + alias, + ref_temp_name, + extra_decls, + )?; + } }; - Ok(out) + + Ok(names) + } + + fn convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { + let conv = match convention { + CallingConvention::All => { + unreachable!("CallingConvention::All is sugar that shouldn't reach here") + } + CallingConvention::Handwritten => { + unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") + } + CallingConvention::C => "C", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => "vectorcall", + }; + Ok(conv) + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_harness_prefix(&self, f: &mut Fivemat, state: &GenState) -> Result<(), GenerateError> { + if state.test.convention == CallingConvention::Vectorcall { + writeln!(f, "#![feature(abi_vectorcall)]")?; + } + // Load test harness "headers" + writeln!(f, "{}", RUST_TEST_PREFIX)?; + writeln!(f)?; + + Ok(()) + } + + fn generate_signature( + &self, + f: &mut Fivemat, + state: &GenState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.test.typed.realize_func(func); + + write!(f, "fn {}(", function.name)?; + let mut multiarg = false; + // Add inputs + for (_idx, arg) in function.inputs.iter().enumerate() { + if multiarg { + write!(f, ", ")?; + } + multiarg = true; + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}", arg_name, arg_ty)?; + } + // Add outparams + for (_idx, arg) in function.outputs.iter().enumerate() { + let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + if !is_outparam { + // Handled in next loop + continue; + } + if multiarg { + write!(f, ", ")?; + } + multiarg = true; + // NOTE: we intentionally don't use the "borrowed" tyname + // as we still don't need lifetimes here! + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}", arg_name, arg_ty)?; + } + // Add normal returns + let mut has_normal_return = false; + for (_idx, arg) in function.outputs.iter().enumerate() { + let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + if is_outparam { + // Already handled + continue; + } + if has_normal_return { + return Err(GenerateError::RustUnsupported(format!( + "multiple normal returns (should this be a tuple?)" + ))); + } + has_normal_return = true; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, ") -> {}", arg_ty)?; + } + if !has_normal_return { + write!(f, ")")?; + } + Ok(()) + } + + fn create_var( + &self, + f: &mut Fivemat, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + val_idx: &mut usize, + ) -> Result<(), GenerateError> { + // Generate the input + let ty_name = &state.tynames[&var_ty]; + let needs_mut = false; + let let_mut = if needs_mut { "let mut" } else { "let" }; + let mut real_var_decl = String::new(); + let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); + let mut extra_decls = Vec::new(); + write!(&mut real_var_decl_f, "{let_mut} {var_name}: {ty_name} = ")?; + let ref_temp_name = format!("{var_name}_"); + self.generate_value( + &mut real_var_decl_f, + state, + var_ty, + val_idx, + None, + &ref_temp_name, + &mut extra_decls, + )?; + writeln!(&mut real_var_decl, ";")?; + + for decl in extra_decls { + writeln!(f, "{}", decl)?; + } + writeln!(f, "{}", real_var_decl)?; + Ok(()) } /// Emit the WRITE calls and FINISHED_VAL for this value. /// This will WRITE every leaf subfield of the type. /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn rust_write_val( + fn write_var( &self, - val: &Val, + f: &mut Fivemat, + state: &GenState, + var_name: &str, + var_ty: TyIdx, to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.rust_var_paths(val, from, is_var_root)? { - writeln!(output, " WRITE_FIELD.unwrap()({to}, &{path} as *const _ as *const _, core::mem::size_of_val(&{path}) as u32);").unwrap(); - } - write!(output, " FINISHED_VAL.unwrap()({to});").unwrap(); + ) -> Result<(), GenerateError> { + // If noop, don't bother doing anything (avoids tagged union matches being generated) + if let WriteImpl::Noop = state.val_writer { + return Ok(()); + }; + self.write_fields(f, state, to, var_name, var_ty)?; - Ok(output) + // If doing full harness callbacks, signal we wrote all the fields of a variable + if let WriteImpl::HarnessCallback = state.val_writer { + writeln!(f, "finished_val({to});")?; + writeln!(f)?; + } + Ok(()) } - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for rust_write_val's use. - fn rust_var_paths( + /// Recursive subroutine of write_var, which builds up rvalue paths and generates + /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. + fn write_fields( &self, - val: &Val, + f: &mut Fivemat, + state: &GenState, + to: &str, from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.rust_var_paths(field, &base, false)?); + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + match state.test.typed.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it + self.write_leaf_field(f, state, to, from)?; + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + self.write_fields(f, state, to, from, alias_ty.real)?; + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + self.write_fields(f, state, to, from, real_ty)? + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{from}[{i}]"); + self.write_fields(f, state, to, &base, array_ty.elem_ty)?; } - paths } - Val::Ref(pointee) => { - if is_var_root { - self.rust_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.rust_var_paths(pointee, &base, false)? + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty)?; } } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.rust_var_paths(elem, &base, false)?); + Ty::Tagged(tagged_ty) => { + // generate a wrapper match, then recurse into each field of each variant + writeln!(f, "match &{from} {{")?; + f.add_indent(1); + let tagged_name = &tagged_ty.name; + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + match &variant.fields { + Some(fields) => { + // Variant with fields, recurse into them + let field_list = fields + .iter() + .map(|f| f.ident.to_string()) + .collect::>() + .join(", "); + writeln!(f, "{tagged_name}::{variant_name} {{ {field_list} }} => {{")?; + f.add_indent(1); + for field in fields { + self.write_fields(f, state, to, &field.ident, field.ty)?; + } + f.sub_indent(1); + writeln!(f, "}}")?; + } + None => { + // Variant without fields, need to include branch for exhaustiveness + writeln!(f, "{tagged_name}::{variant_name} => {{ }}")?; + } + } + } + f.sub_indent(1); + writeln!(f, "}}")?; + } + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{from})"); + self.write_fields(f, state, to, &base, ref_ty.pointee_ty)? + } + Ty::Union(union_ty) => { + // FIXME(variant_select): hardcoded to access field 0 for now + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty)?; } - paths } }; + Ok(()) + } - Ok(paths) + /// WRITE an actual indivisible value (primitive or c-like enum) + fn write_leaf_field( + &self, + f: &mut Fivemat, + state: &GenState, + to: &str, + path: &str, + ) -> Result<(), GenerateError> { + match state.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, &{path});")?; + } + WriteImpl::Print => { + writeln!(f, "println!(\"{{}}\", {path});")?; + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) } + + fn end_function( + &self, + f: &mut dyn Write, + state: &GenState, + inputs: &str, + outputs: &str, + ) -> Result<(), GenerateError> { + match state.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "finished_func({inputs}, {outputs});")?; + } + WriteImpl::Print | WriteImpl::Noop => { + // Noop + } + } + Ok(()) + } + + fn pass_var( + &self, + f: &mut dyn Write, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + write!(f, "{var_name}")?; + Ok(()) + } + + fn return_var( + &self, + f: &mut dyn Write, + state: &GenState, + var_name: &str, + var_ty: TyIdx, + ) -> Result<(), GenerateError> { + // TODO: implement outparam returns + write!(f, "{var_name}")?; + Ok(()) + } +} + +fn gen_state(test: &TestImpl) -> GenState { + GenState { + test, + tynames: HashMap::new(), + borrowed_tynames: HashMap::new(), + funcs: vec![], + val_writer: WriteImpl::HarnessCallback, + } +} + +/// For a given primitive type, generate an instance +/// where all the high nybbles of each byte is val_idx +/// and all the low nybbles are the number byte. +/// +/// This lets us look at a random byte a function read +/// and go "hey this was SUPPOSED to be the 3rd byte of the 7th arg", +/// which is useful for figuring out how an argument got fucked up +/// (how much it was misaligned, or passed in the wrong slot). +fn graffiti_primitive(val_idx: usize) -> T { + const MAX_SIZE: usize = 32; + const MAX_HEX: usize = 16; + assert!( + std::mem::size_of::() <= MAX_SIZE, + "only primitives as big as u256 are supported!" + ); + + let bytes: [u8; MAX_SIZE] = + std::array::from_fn(|i| (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8)); + unsafe { std::mem::transmute_copy(&bytes) } } diff --git a/src/abis/rust2.rs b/src/abis/rust2.rs deleted file mode 100644 index e5c9eb9..0000000 --- a/src/abis/rust2.rs +++ /dev/null @@ -1,1188 +0,0 @@ -//! Rust(c) codegen backend backend - -use std::sync::Arc; - -use kdl_script::parse::FuncDecl; -use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; -use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; - -use super::super::*; -use super::*; -use crate::fivemat::Fivemat; -use std::fmt::Write; - -pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); - -const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; -const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; -const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; -const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; -const INDENT: &str = " "; - -static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); - -#[allow(dead_code)] -pub struct RustcAbiImpl { - is_nightly: bool, - codegen_backend: Option, -} - -pub struct Test { - pub typed: Arc, - pub env: Arc, - pub graph: Arc, - pub convention: CallingConvention, -} - -pub struct GenState<'a> { - test: &'a Test, - tynames: HashMap, - borrowed_tynames: HashMap, - funcs: Vec, - val_writer: WriteImpl, -} - -enum WriteImpl { - HarnessCallback, - Print, - Noop, -} - -impl RustcAbiImpl { - fn name(&self) -> &'static str { - "rustc" - } - fn lang(&self) -> &'static str { - "rust" - } - fn src_ext(&self) -> &'static str { - "rs" - } - fn supports_convention(&self, convention: CallingConvention) -> bool { - // NOTE: Rustc spits out: - // - // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, - // vectorcall, thiscall, thiscall-unwind, aapcs, win64, sysv64, - // ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, - // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, - // wasm, system, system-unwind, rust-intrinsic, rust-call, - // platform-intrinsic, unadjusted - match convention { - CallingConvention::All => unreachable!(), - CallingConvention::Handwritten => true, - CallingConvention::C => true, - CallingConvention::Cdecl => true, - CallingConvention::System => true, - CallingConvention::Win64 => true, - CallingConvention::Sysv64 => true, - CallingConvention::Aapcs => true, - CallingConvention::Stdcall => true, - CallingConvention::Fastcall => true, - CallingConvention::Vectorcall => false, // too experimental even for nightly use? - } - } - - /* - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - let mut cmd = Command::new("rustc"); - cmd.arg("--crate-type") - .arg("staticlib") - .arg("--out-dir") - .arg("target/temp/") - .arg("--target") - .arg(built_info::TARGET) - .arg(format!("-Cmetadata={lib_name}")) - .arg(src_path); - if let Some(codegen_backend) = &self.codegen_backend { - cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); - } - eprintln!("running: {:?}", cmd); - let out = cmd.output()?; - - if !out.status.success() { - Err(BuildError::RustCompile(out)) - } else { - Ok(String::from(lib_name)) - } - } - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - // Currently no need to be different - self.compile_callee(src_path, lib_name) - } - */ -} - -impl RustcAbiImpl { - pub fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - query: impl Iterator, - ) -> Result<(), GenerateError> { - let mut state = gen_state(test); - let mut f = Fivemat::new(f, INDENT); - - // Generate type decls and gather up functions - self.generate_definitions(&mut f, &mut state, query)?; - // Generate decls of the functions we want to call - self.generate_caller_externs(&mut f, &state)?; - - // Generate the test function the harness will call - writeln!(f, "#[no_mangle]\npub extern \"C\" fn do_test() {{")?; - for &func in &state.funcs { - // Generate the individual function calls - self.generate_caller_body(&mut f, &state, func)?; - } - writeln!(&mut f, "}}")?; - - Ok(()) - } - - fn generate_caller_externs( - &self, - f: &mut Fivemat, - state: &GenState, - ) -> Result<(), GenerateError> { - let convention_decl = self.convention_decl(state.test.convention)?; - writeln!(f, "extern \"{convention_decl}\" {{",)?; - f.add_indent(1); - for &func in &state.funcs { - self.generate_signature(f, &state, func)?; - writeln!(f, ";")?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - writeln!(f)?; - Ok(()) - } - - fn generate_caller_body( - &self, - f: &mut Fivemat, - state: &GenState, - func: FuncIdx, - ) -> Result<(), GenerateError> { - writeln!(f, "unsafe {{")?; - f.add_indent(1); - let function = state.test.typed.realize_func(func); - let mut val_idx = 0; - - // Create vars for all the inputs - for arg in function.inputs.iter() { - // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; - self.write_var(f, state, &arg.name, arg.ty, VAR_CALLER_INPUTS)?; - } - - // Call the function - self.call_function(f, state, function)?; - - // Report all the outputs - for arg in function.outputs.iter() { - let arg_name = &arg.name; - self.write_var(f, state, arg_name, arg.ty, VAR_CALLER_OUTPUTS)?; - } - - // Report the function is complete - self.end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; - f.sub_indent(1); - writeln!(f, "}}")?; - Ok(()) - } - - fn call_function( - &self, - f: &mut Fivemat, - state: &GenState, - function: &Func, - ) -> Result<(), GenerateError> { - let func_name = &function.name; - - // if there's an output, bind it - let mut proper_outputs = function - .outputs - .iter() - .filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); - let output = proper_outputs.next(); - let too_many_outputs = proper_outputs.next(); - if too_many_outputs.is_some() { - return Err(GenerateError::RustUnsupported(format!( - "multiple normal returns (should this be a tuple?)" - ))); - } - if let Some(output) = output { - write!(f, "let {} = ", output.name)?; - } - - // Call the function - write!(f, "{func_name}(")?; - let inputs = function.inputs.iter(); - let out_params = function - .outputs - .iter() - .filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); - - for (arg_idx, arg) in inputs.chain(out_params).enumerate() { - if arg_idx > 0 { - write!(f, ", ")?; - } - self.pass_var(f, state, &arg.name, arg.ty)?; - } - writeln!(f, ");")?; - writeln!(f)?; - Ok(()) - } -} - -impl RustcAbiImpl { - pub fn generate_callee( - &self, - f: &mut impl std::fmt::Write, - test: &Test, - query: impl Iterator, - ) -> Result<(), GenerateError> { - let mut state = gen_state(test); - let mut f = Fivemat::new(f, INDENT); - - // Generate type decls and gather up functions - self.generate_definitions(&mut f, &mut state, query)?; - - for &func in &state.funcs { - // Generate the individual function definitions - self.generate_callee_body(&mut f, &state, func)?; - } - Ok(()) - } - - fn generate_callee_body( - &self, - f: &mut Fivemat, - state: &GenState, - func: FuncIdx, - ) -> Result<(), GenerateError> { - let function = state.test.typed.realize_func(func); - let convention_decl = self.convention_decl(state.test.convention)?; - writeln!(f, "#[no_mangle]")?; - write!(f, "pub unsafe extern \"{convention_decl}\" ")?; - self.generate_signature(f, &state, func)?; - writeln!(f, " {{")?; - f.add_indent(1); - writeln!(f, "unsafe {{")?; - f.add_indent(1); - // Report the inputs - for arg in function.inputs.iter() { - let arg_name = &arg.name; - self.write_var(f, state, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; - } - - // Create outputs and report them - let mut val_idx = 0; - for arg in function.outputs.iter() { - // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; - self.write_var(f, state, &arg.name, arg.ty, VAR_CALLEE_OUTPUTS)?; - } - - // Report the function is complete - self.end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; - - // Return the outputs - for arg in function.outputs.iter() { - self.return_var(f, state, &arg.name, arg.ty)?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - f.sub_indent(1); - writeln!(f, "}}")?; - Ok(()) - } -} - -impl RustcAbiImpl { - pub fn new(codegen_backend: Option) -> Self { - Self { - is_nightly: built_info::RUSTC_VERSION.contains("nightly"), - codegen_backend, - } - } - - pub fn generate_definitions( - &self, - f: &mut Fivemat, - state: &mut GenState, - query: impl Iterator, - ) -> Result<(), GenerateError> { - self.write_harness_prefix(f, &state)?; - - for def in state.test.graph.definitions(query) { - match def { - kdl_script::Definition::DeclareTy(ty) => { - self.intern_tyname(f, state, ty)?; - } - kdl_script::Definition::DefineTy(ty) => { - self.generate_tydef(f, state, ty)?; - } - kdl_script::Definition::DefineFunc(func) => { - // Buffer up the funcs - state.funcs.push(func); - } - kdl_script::Definition::DeclareFunc(_) => { - // nothing to do, executable kdl-script isn't real and can't hurt us - } - } - } - - Ok(()) - } - - pub fn intern_tyname( - &self, - f: &mut Fivemat, - state: &mut GenState, - ty: TyIdx, - ) -> Result<(), GenerateError> { - // Don't double-intern - if state.tynames.contains_key(&ty) { - return Ok(()); - } - - let (tyname, borrowed_tyname) = match state.test.typed.realize_ty(ty) { - // Structural types that don't need definitions but we should - // intern the name of - Ty::Primitive(prim) => { - let name = match prim { - PrimitiveTy::I8 => "i8", - PrimitiveTy::I16 => "i16", - PrimitiveTy::I32 => "i32", - PrimitiveTy::I64 => "i64", - PrimitiveTy::I128 => "i128", - PrimitiveTy::U8 => "u8", - PrimitiveTy::U16 => "u16", - PrimitiveTy::U32 => "u32", - PrimitiveTy::U64 => "u64", - PrimitiveTy::U128 => "u128", - PrimitiveTy::F32 => "f32", - PrimitiveTy::F64 => "f64", - PrimitiveTy::Bool => "bool", - PrimitiveTy::Ptr => "*mut ()", - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have i256" - )))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have u256" - )))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f16" - )))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f128" - )))?, - }; - (name.to_owned(), None) - } - Ty::Array(ArrayTy { elem_ty, len }) => { - let elem_tyname = &state.tynames[elem_ty]; - let borrowed_tyname = state - .borrowed_tynames - .get(elem_ty) - .map(|elem_tyname| format!("[{elem_tyname}; {len}]")); - (format!("[{elem_tyname}; {len}]"), borrowed_tyname) - } - Ty::Ref(RefTy { pointee_ty }) => { - let pointee_tyname = &state.tynames[pointee_ty]; - let borrowed_pointee_tyname = state - .borrowed_tynames - .get(pointee_ty) - .unwrap_or(pointee_tyname); - ( - format!("&mut {pointee_tyname}"), - Some(format!("&'a mut {borrowed_pointee_tyname}")), - ) - } - Ty::Empty => ("()".to_owned(), None), - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - let has_borrows = struct_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); - ((*struct_ty.name).clone(), borrowed_tyname) - } - Ty::Union(union_ty) => { - let has_borrows = union_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); - ((*union_ty.name).clone(), borrowed_tyname) - } - Ty::Enum(enum_ty) => ((*enum_ty.name).clone(), None), - Ty::Tagged(tagged_ty) => { - let has_borrows = tagged_ty.variants.iter().any(|v| { - v.fields - .as_ref() - .map(|fields| { - fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)) - }) - .unwrap_or(false) - }); - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); - ((*tagged_ty.name).clone(), borrowed_tyname) - } - Ty::Alias(AliasTy { name, real, attrs }) => { - let borrowed_tyname = state - .borrowed_tynames - .get(&real) - .map(|name| format!("{name}<'a>")); - ((**name).clone(), borrowed_tyname) - } - - // Puns should be evaporated - Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - ( - state.tynames[&real_ty].clone(), - state.borrowed_tynames.get(&real_ty).cloned(), - ) - } - }; - - state.tynames.insert(ty, tyname); - if let Some(borrowed) = borrowed_tyname { - state.borrowed_tynames.insert(ty, borrowed); - } - - Ok(()) - } - - pub fn generate_tydef( - &self, - f: &mut Fivemat, - state: &mut GenState, - ty: TyIdx, - ) -> Result<(), GenerateError> { - // Make sure our own name is interned - self.intern_tyname(f, state, ty)?; - - match state.test.typed.realize_ty(ty) { - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - assert!( - struct_ty.attrs.is_empty(), - "don't yet know how to apply attrs to structs" - ); - - let has_borrows = struct_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - - // Emit an actual struct decl - writeln!(f, "#[repr(C)]")?; - if has_borrows { - writeln!(f, "struct {}<'a> {{", struct_ty.name)?; - } else { - writeln!(f, "struct {} {{", struct_ty.name)?; - } - f.add_indent(1); - for field in &struct_ty.fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Union(union_ty) => { - assert!( - union_ty.attrs.is_empty(), - "don't yet know how to apply attrs to unions" - ); - - let has_borrows = union_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - - // Emit an actual union decl - writeln!(f, "#[repr(C)]")?; - if has_borrows { - writeln!(f, "union {}<'a> {{", union_ty.name)?; - } else { - writeln!(f, "union {} {{", union_ty.name)?; - } - f.add_indent(1); - for field in &union_ty.fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Enum(enum_ty) => { - assert!( - enum_ty.attrs.is_empty(), - "don't yet know how to apply attrs to enums" - ); - - // Emit an actual enum decl - writeln!(f, "#[repr(C)]")?; - writeln!(f, "enum {} {{", enum_ty.name)?; - f.add_indent(1); - for variant in &enum_ty.variants { - let variant_name = &variant.name; - writeln!(f, "{variant_name},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Tagged(tagged_ty) => { - assert!( - tagged_ty.attrs.is_empty(), - "don't yet know how to apply attrs to tagged unions" - ); - - let has_borrows = tagged_ty.variants.iter().any(|v| { - v.fields - .as_ref() - .map(|fields| { - fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)) - }) - .unwrap_or(false) - }); - - // Emit an actual enum decl - writeln!(f, "#[repr(C)]")?; - if has_borrows { - writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; - } else { - writeln!(f, "enum {} {{", tagged_ty.name)?; - } - f.add_indent(1); - for variant in &tagged_ty.variants { - let variant_name = &variant.name; - if let Some(fields) = &variant.fields { - writeln!(f, "{variant_name} {{")?; - f.add_indent(1); - for field in fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - } else { - writeln!(f, "{variant_name},")?; - } - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Alias(AliasTy { name, real, attrs }) => { - assert!( - attrs.is_empty(), - "don't yet know how to apply attrs to type aliases" - ); - - // Emit an actual type alias decl - if let Some(real_tyname) = state.borrowed_tynames.get(&real) { - writeln!(f, "type {name}<'a> = {real_tyname};\n")?; - } else { - let real_tyname = &state.tynames[&real]; - writeln!(f, "type {name} = {real_tyname};\n")?; - } - } - Ty::Pun(..) => { - // Puns should be evaporated by the type name interner - } - Ty::Primitive(prim) => { - match prim { - PrimitiveTy::I8 - | PrimitiveTy::I16 - | PrimitiveTy::I32 - | PrimitiveTy::I64 - | PrimitiveTy::I128 - | PrimitiveTy::I256 - | PrimitiveTy::U8 - | PrimitiveTy::U16 - | PrimitiveTy::U32 - | PrimitiveTy::U64 - | PrimitiveTy::U128 - | PrimitiveTy::U256 - | PrimitiveTy::F16 - | PrimitiveTy::F32 - | PrimitiveTy::F64 - | PrimitiveTy::F128 - | PrimitiveTy::Bool - | PrimitiveTy::Ptr => { - // Builtin - } - }; - } - Ty::Array(ArrayTy { .. }) => { - // Builtin - } - Ty::Ref(RefTy { .. }) => { - // Builtin - } - Ty::Empty => { - // Builtin - } - } - Ok(()) - } - - pub fn generate_value( - &self, - f: &mut Fivemat, - state: &GenState, - ty: TyIdx, - val_idx: &mut usize, - alias: Option<&str>, - ref_temp_name: &str, - extra_decls: &mut Vec, - ) -> Result<(), GenerateError> { - let names = match state.test.typed.realize_ty(ty) { - // Primitives are the only "real" values with actual bytes that advance val_idx - Ty::Primitive(prim) => { - match prim { - PrimitiveTy::I8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::I16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::I32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::I64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::I128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - - PrimitiveTy::F32 => write!(f, "{}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::F64 => write!(f, "{}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::Bool => write!(f, "{}", true)?, - PrimitiveTy::Ptr => { - if true { - write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? - } else { - write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? - } - } - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have i256" - )))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have u256" - )))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f16" - )))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f128" - )))?, - }; - *val_idx += 1; - } - Ty::Empty => { - write!(f, "()")?; - } - Ty::Ref(RefTy { pointee_ty }) => { - // The value is a mutable reference to a temporary - write!(f, "&mut {ref_temp_name}")?; - - // TODO: should this be a recursive call to create_var (need create_var_inner?) - // Now do the rest of the recursion on constructing the temporary - let mut ref_temp = String::new(); - let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); - let ty_name = &state.tynames[pointee_ty]; - write!(&mut ref_temp_f, "let mut {ref_temp_name}: {ty_name} = ")?; - let ref_temp_name = format!("{ref_temp_name}_"); - self.generate_value( - &mut ref_temp_f, - state, - *pointee_ty, - val_idx, - alias, - &ref_temp_name, - extra_decls, - )?; - write!(&mut ref_temp_f, ";")?; - extra_decls.push(ref_temp); - } - Ty::Array(ArrayTy { elem_ty, len }) => { - write!(f, "[")?; - for arr_idx in 0..*len { - if arr_idx > 0 { - write!(f, ", ")?; - } - let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); - self.generate_value( - f, - state, - *elem_ty, - val_idx, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, "]")?; - } - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - let name = alias.unwrap_or(&struct_ty.name); - write!(f, "{name} {{ ")?; - for (field_idx, field) in struct_ty.fields.iter().enumerate() { - if field_idx > 0 { - write!(f, ", ")?; - } - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - val_idx, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - Ty::Union(union_ty) => { - let name = alias.unwrap_or(&union_ty.name); - write!(f, "{name} {{ ")?; - // FIXME(variant_select):have a way to pick the variant! - if let Some(field) = union_ty.fields.get(0) { - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - val_idx, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - Ty::Enum(enum_ty) => { - let name = alias.unwrap_or(&enum_ty.name); - // FIXME(variant_select):have a way to pick the variant! - if let Some(variant) = enum_ty.variants.get(0) { - let variant_name = &variant.name; - write!(f, "{name}::{variant_name}")?; - } - } - Ty::Tagged(tagged_ty) => { - let name = alias.unwrap_or(&tagged_ty.name); - // FIXME(variant_select): have a way to pick the variant! - if let Some(variant) = tagged_ty.variants.get(0) { - let variant_name = &variant.name; - write!(f, "{name}::{variant_name}")?; - if let Some(fields) = &variant.fields { - write!(f, " {{ ")?; - for (field_idx, field) in fields.iter().enumerate() { - if field_idx > 0 { - write!(f, ", ")?; - } - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - val_idx, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - } - } - Ty::Alias(AliasTy { real, name, .. }) => { - let alias = alias.or_else(|| Some(name)); - self.generate_value(f, state, *real, val_idx, alias, ref_temp_name, extra_decls)?; - } - - // Puns should be evaporated - Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - self.generate_value( - f, - state, - real_ty, - val_idx, - alias, - ref_temp_name, - extra_decls, - )?; - } - }; - - Ok(names) - } - - fn convention_decl( - &self, - convention: CallingConvention, - ) -> Result<&'static str, GenerateError> { - let conv = match convention { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar that shouldn't reach here") - } - CallingConvention::Handwritten => { - unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") - } - CallingConvention::C => "C", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", - }; - Ok(conv) - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_harness_prefix(&self, f: &mut Fivemat, state: &GenState) -> Result<(), GenerateError> { - if state.test.convention == CallingConvention::Vectorcall { - writeln!(f, "#![feature(abi_vectorcall)]")?; - } - // Load test harness "headers" - writeln!(f, "{}", RUST_TEST_PREFIX)?; - writeln!(f)?; - - Ok(()) - } - - fn generate_signature( - &self, - f: &mut Fivemat, - state: &GenState, - func: FuncIdx, - ) -> Result<(), GenerateError> { - let function = state.test.typed.realize_func(func); - - write!(f, "fn {}(", function.name)?; - let mut multiarg = false; - // Add inputs - for (_idx, arg) in function.inputs.iter().enumerate() { - if multiarg { - write!(f, ", ")?; - } - multiarg = true; - let arg_name = &arg.name; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}", arg_name, arg_ty)?; - } - // Add outparams - for (_idx, arg) in function.outputs.iter().enumerate() { - let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); - if !is_outparam { - // Handled in next loop - continue; - } - if multiarg { - write!(f, ", ")?; - } - multiarg = true; - // NOTE: we intentionally don't use the "borrowed" tyname - // as we still don't need lifetimes here! - let arg_name = &arg.name; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}", arg_name, arg_ty)?; - } - // Add normal returns - let mut has_normal_return = false; - for (_idx, arg) in function.outputs.iter().enumerate() { - let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); - if is_outparam { - // Already handled - continue; - } - if has_normal_return { - return Err(GenerateError::RustUnsupported(format!( - "multiple normal returns (should this be a tuple?)" - ))); - } - has_normal_return = true; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, ") -> {}", arg_ty)?; - } - if !has_normal_return { - write!(f, ")")?; - } - Ok(()) - } - - fn create_var( - &self, - f: &mut Fivemat, - state: &GenState, - var_name: &str, - var_ty: TyIdx, - val_idx: &mut usize, - ) -> Result<(), GenerateError> { - // Generate the input - let ty_name = &state.tynames[&var_ty]; - let needs_mut = false; - let let_mut = if needs_mut { "let mut" } else { "let" }; - let mut real_var_decl = String::new(); - let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); - let mut extra_decls = Vec::new(); - write!(&mut real_var_decl_f, "{let_mut} {var_name}: {ty_name} = ")?; - let ref_temp_name = format!("{var_name}_"); - self.generate_value( - &mut real_var_decl_f, - state, - var_ty, - val_idx, - None, - &ref_temp_name, - &mut extra_decls, - )?; - writeln!(&mut real_var_decl, ";")?; - - for decl in extra_decls { - writeln!(f, "{}", decl)?; - } - writeln!(f, "{}", real_var_decl)?; - Ok(()) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn write_var( - &self, - f: &mut Fivemat, - state: &GenState, - var_name: &str, - var_ty: TyIdx, - to: &str, - ) -> Result<(), GenerateError> { - // If noop, don't bother doing anything (avoids tagged union matches being generated) - if let WriteImpl::Noop = state.val_writer { - return Ok(()); - }; - self.write_fields(f, state, to, var_name, var_ty)?; - - // If doing full harness callbacks, signal we wrote all the fields of a variable - if let WriteImpl::HarnessCallback = state.val_writer { - writeln!(f, "finished_val({to});")?; - writeln!(f)?; - } - Ok(()) - } - - /// Recursive subroutine of write_var, which builds up rvalue paths and generates - /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. - fn write_fields( - &self, - f: &mut Fivemat, - state: &GenState, - to: &str, - from: &str, - var_ty: TyIdx, - ) -> Result<(), GenerateError> { - match state.test.typed.realize_ty(var_ty) { - Ty::Primitive(_) | Ty::Enum(_) => { - // Hey an actual leaf, report it - self.write_leaf_field(f, state, to, from)?; - } - Ty::Empty => { - // nothing worth producing - } - Ty::Alias(alias_ty) => { - // keep going but with the type changed - self.write_fields(f, state, to, from, alias_ty.real)?; - } - Ty::Pun(pun) => { - // keep going but with the type changed - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); - self.write_fields(f, state, to, from, real_ty)? - } - Ty::Array(array_ty) => { - // recurse into each array index - for i in 0..array_ty.len { - let base = format!("{from}[{i}]"); - self.write_fields(f, state, to, &base, array_ty.elem_ty)?; - } - } - Ty::Struct(struct_ty) => { - // recurse into each field - for field in &struct_ty.fields { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty)?; - } - } - Ty::Tagged(tagged_ty) => { - // generate a wrapper match, then recurse into each field of each variant - writeln!(f, "match &{from} {{")?; - f.add_indent(1); - for variant in &tagged_ty.variants { - let variant_name = &variant.name; - match &variant.fields { - Some(fields) => { - // Variant with fields, recurse into them - let field_list = fields - .iter() - .map(|f| f.ident.to_string()) - .collect::>() - .join(", "); - writeln!(f, "{variant_name} {{ {field_list} }} => {{")?; - f.add_indent(1); - for field in fields { - self.write_fields(f, state, to, &field.ident, field.ty)?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - } - None => { - // Variant without fields, need to include branch for exhaustiveness - writeln!(f, "{variant_name} => {{ }}")?; - } - } - } - f.sub_indent(1); - writeln!(f, "}}")?; - } - Ty::Ref(ref_ty) => { - // Add a deref, and recurse into the pointee - let base = format!("(*{from})"); - self.write_fields(f, state, to, &base, ref_ty.pointee_ty)? - } - Ty::Union(union_ty) => { - // FIXME(variant_select): hardcoded to access field 0 for now - if let Some(field) = union_ty.fields.get(0) { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty)?; - } - } - }; - Ok(()) - } - - /// WRITE an actual indivisible value (primitive or c-like enum) - fn write_leaf_field( - &self, - f: &mut Fivemat, - state: &GenState, - to: &str, - path: &str, - ) -> Result<(), GenerateError> { - match state.val_writer { - WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, &{path});")?; - } - WriteImpl::Print => { - writeln!(f, "println!(\"{{}}\", {path});")?; - } - WriteImpl::Noop => { - // Noop, do nothing - } - } - Ok(()) - } - - fn end_function( - &self, - f: &mut dyn Write, - state: &GenState, - inputs: &str, - outputs: &str, - ) -> Result<(), GenerateError> { - match state.val_writer { - WriteImpl::HarnessCallback => { - writeln!(f, "finished_func({inputs}, {outputs});")?; - } - WriteImpl::Print | WriteImpl::Noop => { - // Noop - } - } - Ok(()) - } - - fn pass_var( - &self, - f: &mut dyn Write, - state: &GenState, - var_name: &str, - var_ty: TyIdx, - ) -> Result<(), GenerateError> { - write!(f, "{var_name}")?; - Ok(()) - } - - fn return_var( - &self, - f: &mut dyn Write, - state: &GenState, - var_name: &str, - var_ty: TyIdx, - ) -> Result<(), GenerateError> { - // TODO: implement outparam returns - write!(f, "{var_name}")?; - Ok(()) - } -} - -fn gen_state(test: &Test) -> GenState { - GenState { - test, - tynames: HashMap::new(), - borrowed_tynames: HashMap::new(), - funcs: vec![], - val_writer: WriteImpl::HarnessCallback, - } -} - -/// For a given primitive type, generate an instance -/// where all the high nybbles of each byte is val_idx -/// and all the low nybbles are the number byte. -/// -/// This lets us look at a random byte a function read -/// and go "hey this was SUPPOSED to be the 3rd byte of the 7th arg", -/// which is useful for figuring out how an argument got fucked up -/// (how much it was misaligned, or passed in the wrong slot). -fn graffiti_primitive(val_idx: usize) -> T { - const MAX_SIZE: usize = 32; - const MAX_HEX: usize = 16; - assert!( - std::mem::size_of::() <= MAX_SIZE, - "only primitives as big as u256 are supported!" - ); - - let bytes: [u8; MAX_SIZE] = - std::array::from_fn(|i| (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8)); - unsafe { std::mem::transmute_copy(&bytes) } -} diff --git a/src/cli.rs b/src/cli.rs index 6a889e2..a9d7724 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -13,9 +13,9 @@ pub fn make_app() -> Config { ]; /// The pairings of impls to run. LHS calls RHS. static DEFAULT_TEST_PAIRS: &[(&str, &str)] = &[ - (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C - (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust - (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C + (ABI_IMPL_RUSTC, ABI_IMPL_RUSTC), // (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C + // (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust + // (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C ]; let app = clap::Command::new("abi-cafe") diff --git a/src/main.rs b/src/main.rs index 7904465..ea51cf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,15 @@ mod abis; mod cli; mod fivemat; -mod procgen; +// mod procgen; mod report; -mod test_format; use abis::*; +use kdl_script::types::Arg; +use kdl_script::types::Ty; +use kdl_script::types::TyIdx; +use kdl_script::PunEnv; +use kdl_script::TypedProgram; use linked_hash_map::LinkedHashMap; use log::warn; use report::*; @@ -16,6 +20,7 @@ use std::error::Error; use std::fs::File; use std::io::BufReader; use std::io::Read; +use std::io::Write; use std::path::{Path, PathBuf}; use std::process::Command; @@ -53,7 +58,7 @@ fn main() -> Result<(), Box> { let cfg = cli::make_app(); eprintln!("parsed cli!"); // Before doing anything, regenerate the procgen tests, if needed. - procgen::procgen_tests(cfg.procgen_tests); + // TODO: procgen::procgen_tests(cfg.procgen_tests); eprintln!("generated tests!"); let out_dir = PathBuf::from("target/temp/"); @@ -72,6 +77,7 @@ fn main() -> Result<(), Box> { ABI_IMPL_RUSTC, Box::new(abis::RustcAbiImpl::new(&cfg, None)), ); + /* abi_impls.insert( ABI_IMPL_CC, Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_CC)), @@ -88,7 +94,7 @@ fn main() -> Result<(), Box> { ABI_IMPL_MSVC, Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_MSVC)), ); - + */ for &(ref name, ref path) in &cfg.rustc_codegen_backends { abi_impls.insert( name, @@ -114,7 +120,7 @@ fn main() -> Result<(), Box> { let test = match read_test_manifest(&entry.path()) { Ok(test) => test, Err(e) => { - eprintln!("test {:?}'s .ron file couldn't be parsed {}", entry, e); + eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); continue; } }; @@ -168,6 +174,8 @@ fn main() -> Result<(), Box> { convention: convention_name.to_owned(), caller_id: caller_id.to_owned(), callee_id: callee_id.to_owned(), + caller_variant: test.abi_variant(caller).unwrap(), + callee_variant: test.abi_variant(callee).unwrap(), }; let rules = get_test_rules(&test_key, caller, callee); let results = do_test( @@ -316,18 +324,18 @@ fn read_test_manifest(test_file: &Path) -> Result { let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); - if ext == "ron" { - let test: Test = ron::from_str(&input).map_err(|e| { - GenerateError::ParseError(test_file.to_string_lossy().into_owned(), input, e) - })?; - Ok(test) - } else if ext == "kdl" { - if let Err(e) = test_format::do_kdl(test_file, input) { - println!("failed to read doc! {:?}", e); - std::process::exit(-1); - } else { - Err(GenerateError::Skipped) - } + if ext == "kdl" { + let mut compiler = kdl_script::Compiler::new(); + let program = compiler.compile_string(&test_file.to_string_lossy(), input)?; + Ok(Test { + name: test_file + .file_stem() + .expect("test had no filename") + .to_str() + .expect("test filename wasn't utf8") + .to_owned(), + program, + }) } else { Err(GenerateError::Skipped) } @@ -387,10 +395,24 @@ fn generate_test_src( std::fs::create_dir_all(caller_src.parent().unwrap())?; std::fs::create_dir_all(callee_src.parent().unwrap())?; let mut caller_output = File::create(&caller_src)?; - caller.generate_caller(&mut caller_output, test, convention)?; + let mut caller_output_string = String::new(); + caller.generate_caller( + &mut caller_output_string, + test, + &test_key.caller_variant, + convention, + )?; + caller_output.write_all(caller_output_string.as_bytes())?; let mut callee_output = File::create(&callee_src)?; - callee.generate_callee(&mut callee_output, test, convention)?; + let mut callee_output_string = String::new(); + callee.generate_callee( + &mut callee_output_string, + test, + &test_key.callee_variant, + convention, + )?; + callee_output.write_all(callee_output_string.as_bytes())?; } Ok(GenerateOutput { @@ -604,7 +626,8 @@ fn run_dynamic_test( // As a basic sanity-check, make sure everything agrees on how // many tests actually executed. If this fails, then something // is very fundamentally broken and needs to be fixed. - let expected_test_count = test.funcs.len(); + let all_func_ids = test.program.all_funcs().collect::>(); + let expected_test_count = all_func_ids.len(); if caller_inputs.funcs.len() != expected_test_count || caller_outputs.funcs.len() != expected_test_count || callee_inputs.funcs.len() != expected_test_count @@ -636,28 +659,95 @@ fn run_dynamic_test( output } + /// Recursive subroutine of write_var, which builds up rvalue paths and generates + /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. fn add_field( + program: &TypedProgram, + env: &PunEnv, input: &[Vec], output: &mut LinkedHashMap, cur_idx: &mut usize, cur_path: String, - val: &Val, + var_ty: TyIdx, ) { - match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + match program.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it output.insert(cur_path, format_bytes(input, cur_idx)); + *cur_idx += 1; + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + add_field( + program, + env, + input, + output, + cur_idx, + cur_path, + alias_ty.real, + ); + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = program.resolve_pun(pun, env).unwrap(); + add_field(program, env, input, output, cur_idx, cur_path, real_ty); + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{cur_path}[{i}]"); + add_field(program, env, input, output, cur_idx, base, array_ty.elem_ty); + } + } + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{cur_path}.{field_name}"); + add_field(program, env, input, output, cur_idx, base, field.ty); + } } - Val::Ref(sub_val) => add_field(input, output, cur_idx, cur_path, sub_val), - Val::Array(arr) => { - for (arr_idx, sub_val) in arr.iter().enumerate() { - let sub_path = format!("{}[{}]", cur_path, arr_idx); - add_field(input, output, cur_idx, sub_path, sub_val); + Ty::Tagged(tagged_ty) => { + // FIXME(variant_select): hardcoded to access variant 0 for now + if let Some(variant) = tagged_ty.variants.get(0) { + if let Some(fields) = &variant.fields { + for field in fields { + add_field( + program, + env, + input, + output, + cur_idx, + field.ident.to_string(), + field.ty, + ); + } + } } } - Val::Struct(_struct_name, fields) => { - for (field_idx, field) in fields.iter().enumerate() { - let sub_path = format!("{}.{}", cur_path, abis::FIELD_NAMES[field_idx]); - add_field(input, output, cur_idx, sub_path, field); + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{cur_path})"); + add_field( + program, + env, + input, + output, + cur_idx, + base, + ref_ty.pointee_ty, + ); + } + Ty::Union(union_ty) => { + // FIXME(variant_select): hardcoded to access field 0 for now + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + let base = format!("{cur_path}.{field_name}"); + add_field(program, env, input, output, cur_idx, base, field.ty); } } } @@ -667,16 +757,13 @@ fn run_dynamic_test( let mut caller = report::Functions::new(); let empty_func = Vec::new(); let empty_arg = Vec::new(); - for (func_idx, func) in test.funcs.iter().enumerate() { + for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { + let func = test.program.realize_func(func_id); let caller_func = caller.entry(func.name.clone()).or_default(); let callee_func = callee.entry(func.name.clone()).or_default(); for (arg_idx, arg) in func.inputs.iter().enumerate() { - let caller_arg = caller_func - .entry(ARG_NAMES[arg_idx].to_owned()) - .or_default(); - let callee_arg = callee_func - .entry(ARG_NAMES[arg_idx].to_owned()) - .or_default(); + let caller_arg = caller_func.entry(arg.name.clone()).or_default(); + let callee_arg = callee_func.entry(arg.name.clone()).or_default(); let caller_arg_bytes = caller_inputs .funcs @@ -691,13 +778,29 @@ fn run_dynamic_test( .get(arg_idx) .unwrap_or(&empty_arg); - add_field(caller_arg_bytes, caller_arg, &mut 0, String::new(), arg); - add_field(callee_arg_bytes, callee_arg, &mut 0, String::new(), arg); + add_field( + &test.program, + &test_key.caller_variant.env, + caller_arg_bytes, + caller_arg, + &mut 0, + String::new(), + arg.ty, + ); + add_field( + &test.program, + &test_key.callee_variant.env, + callee_arg_bytes, + callee_arg, + &mut 0, + String::new(), + arg.ty, + ); } - for (arg_idx, arg) in func.output.iter().enumerate() { - let caller_arg = caller_func.entry(format!("return{}", arg_idx)).or_default(); - let callee_arg = callee_func.entry(format!("return{}", arg_idx)).or_default(); + for (arg_idx, arg) in func.outputs.iter().enumerate() { + let caller_arg = caller_func.entry(arg.name.clone()).or_default(); + let callee_arg = callee_func.entry(arg.name.clone()).or_default(); let caller_output_bytes = caller_outputs .funcs @@ -712,8 +815,24 @@ fn run_dynamic_test( .get(arg_idx) .unwrap_or(&empty_arg); - add_field(caller_output_bytes, caller_arg, &mut 0, String::new(), arg); - add_field(callee_output_bytes, callee_arg, &mut 0, String::new(), arg); + add_field( + &test.program, + &test_key.caller_variant.env, + caller_output_bytes, + caller_arg, + &mut 0, + String::new(), + arg.ty, + ); + add_field( + &test.program, + &test_key.callee_variant.env, + callee_output_bytes, + callee_arg, + &mut 0, + String::new(), + arg.ty, + ); } } @@ -794,6 +913,7 @@ fn check_test( input_idx, caller_val.clone(), callee_val.clone(), + String::from("todo"), ))); continue 'funcs; } @@ -810,6 +930,7 @@ fn check_test( field_idx, caller_field.clone(), callee_field.clone(), + String::from("todo"), ))); continue 'funcs; } @@ -860,9 +981,9 @@ fn check_test( // useful to keep a version of this near the actual compilation/execution // in case the compilers spit anything interesting to stdout/stderr. let names = test - .funcs - .iter() - .map(|test_func| full_subtest_name(test_key, &test_func.name)) + .program + .all_funcs() + .map(|func_id| full_subtest_name(test_key, &test.program.realize_func(func_id).name)) .collect::>(); let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); let num_passed = results.iter().filter(|r| r.is_ok()).count(); @@ -959,6 +1080,7 @@ fn full_test_name( convention, caller_id, callee_id, + .. }: &TestKey, ) -> String { format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}") @@ -971,6 +1093,7 @@ fn full_subtest_name( convention, caller_id, callee_id, + .. }: &TestKey, func_name: &str, ) -> String { diff --git a/src/report.rs b/src/report.rs index 8f3e4b9..32fc525 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,5 +1,6 @@ use std::path::PathBuf; +use kdl_script::spanned::Spanned; use linked_hash_map::LinkedHashMap; use serde::Serialize; use serde_json::json; @@ -72,15 +73,15 @@ pub enum BuildError { #[allow(clippy::enum_variant_names)] #[derive(Debug, thiserror::Error)] pub enum CheckFailure { - #[error("test {0} {} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}", ARG_NAMES[*.1])] - InputFieldMismatch(usize, usize, usize, Vec, Vec), + #[error("test {0} {5} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}")] + InputFieldMismatch(usize, usize, usize, Vec, Vec, String), #[error( "test {0} {} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}", OUTPUT_NAME )] OutputFieldMismatch(usize, usize, usize, Vec, Vec), - #[error("test {0} {} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}", ARG_NAMES[*.1])] - InputFieldCountMismatch(usize, usize, Vec>, Vec>), + #[error("test {0} {4} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}")] + InputFieldCountMismatch(usize, usize, Vec>, Vec>, String), #[error( "test {0} {} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}", OUTPUT_NAME @@ -188,6 +189,10 @@ pub struct TestKey { pub convention: String, pub caller_id: String, pub callee_id: String, + #[serde(skip)] + pub caller_variant: TestVariant, + #[serde(skip)] + pub callee_variant: TestVariant, } #[derive(Debug, Clone, Serialize)] @@ -290,7 +295,8 @@ pub struct RunOutput { pub callee_outputs: WriteBuffer, } -pub type Functions = LinkedHashMap>>; +pub type Functions = + LinkedHashMap, LinkedHashMap, LinkedHashMap>>; #[derive(Debug, Serialize)] pub struct CheckOutput { diff --git a/src/test_format.rs b/src/test_format.rs deleted file mode 100644 index 2508faa..0000000 --- a/src/test_format.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::{collections::HashMap, path::Path, sync::Arc}; - -use kdl_script::types::{AliasTy, ArrayTy, RefTy}; - -use crate::abis::Test; -pub fn do_kdl(test_file: &Path, input: String) -> Result { - use std::fmt::Write; - let mut compiler = kdl_script::Compiler::new(); - let typed = compiler.compile_string(&test_file.to_string_lossy(), input)?; - - let env = Arc::new(kdl_script::PunEnv { - lang: "rust".to_string(), - }); - let graph = Arc::new(typed.definition_graph(&env)?); - - let abi = crate::abis::rust2::RustcAbiImpl::new(None); - let test = crate::abis::rust2::Test { - typed, - env, - graph, - convention: crate::abis::CallingConvention::C, - }; - - let mut output = String::new(); - abi.generate_caller(&mut output, &test, test.typed.all_funcs()) - .unwrap(); - println!("{output}"); - - let mut output = String::new(); - abi.generate_callee(&mut output, &test, test.typed.all_funcs()) - .unwrap(); - println!("{output}"); - - todo!() -} diff --git a/tests/kdl/types.kdl b/tests/kdl/types.kdl index 4231ce5..18ef95c 100644 --- a/tests/kdl/types.kdl +++ b/tests/kdl/types.kdl @@ -53,7 +53,6 @@ tagged "InnerContainsRefs" { C { w "bool"; } } -/* fn "func1" { inputs { a "Complex"; b "Simple"; } outputs { out "()"; } @@ -87,9 +86,6 @@ fn "enumtime" { } } - -*/ - fn "reftime" { inputs { a "i32" From af696c67961f4450f4ca53f9a0d6cdfd3a69d017 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 4 May 2024 00:00:31 -0400 Subject: [PATCH 10/44] IT WORKS AND I CHECKED IT IN --- src/abis/mod.rs | 192 ++++++++++ src/abis_old/c.rs | 822 +++++++++++++++++++++++++++++++++++++++++++ src/abis_old/mod.rs | 288 +++++++++++++++ src/abis_old/rust.rs | 661 ++++++++++++++++++++++++++++++++++ src/fivemat.rs | 155 ++++++++ tests/kdl/types.kdl | 7 + 6 files changed, 2125 insertions(+) create mode 100644 src/abis/mod.rs create mode 100644 src/abis_old/c.rs create mode 100644 src/abis_old/mod.rs create mode 100644 src/abis_old/rust.rs create mode 100644 src/fivemat.rs diff --git a/src/abis/mod.rs b/src/abis/mod.rs new file mode 100644 index 0000000..442481c --- /dev/null +++ b/src/abis/mod.rs @@ -0,0 +1,192 @@ +pub mod c; +pub mod rust; + +use std::{fmt::Write, path::Path, sync::Arc}; + +pub use c::CcAbiImpl; +use kdl_script::{DefinitionGraph, KdlScriptError, PunEnv, TypedProgram}; +pub use rust::RustcAbiImpl; + +use crate::BuildError; + +pub static ABI_IMPL_RUSTC: &str = "rustc"; +pub static ABI_IMPL_CC: &str = "cc"; +pub static ABI_IMPL_GCC: &str = "gcc"; +pub static ABI_IMPL_CLANG: &str = "clang"; +pub static ABI_IMPL_MSVC: &str = "msvc"; + +pub static ALL_CONVENTIONS: &[CallingConvention] = &[ + CallingConvention::Handwritten, + CallingConvention::C, + CallingConvention::Cdecl, + CallingConvention::Stdcall, + CallingConvention::Fastcall, + CallingConvention::Vectorcall, + // Note sure if these have a purpose, so omitting them for now + // CallingConvention::System, + // CallingConvention::Win64, + // CallingConvention::Sysv64, + // CallingConvention::Aapcs, +]; + +pub static OUTPUT_NAME: &str = "output"; + +pub struct Test { + pub name: String, + pub program: Arc, +} + +#[derive(Debug, Clone)] +pub struct TestVariant { + pub env: Arc, + pub graph: Arc, +} + +/// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. +pub trait AbiImpl { + fn name(&self) -> &'static str; + fn lang(&self) -> &'static str; + fn src_ext(&self) -> &'static str; + fn supports_convention(&self, _convention: CallingConvention) -> bool; + fn pun_env(&self) -> Arc; + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + variant: &TestVariant, + convention: CallingConvention, + ) -> Result<(), GenerateError>; + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + variant: &TestVariant, + convention: CallingConvention, + ) -> Result<(), GenerateError>; + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; +} + +impl Test { + pub fn has_convention(&self, convention: CallingConvention) -> bool { + // TODO + true + } + pub fn abi_variant( + &self, + abi: &(dyn AbiImpl + Send + Sync), + ) -> Result { + let env = abi.pun_env(); + let graph = Arc::new(self.program.definition_graph(&env)?); + Ok(TestVariant { env, graph }) + } +} + +#[derive(Debug, thiserror::Error)] +#[allow(dead_code)] +pub enum GenerateError { + #[error("io error\n{0}")] + Fmt(#[from] std::fmt::Error), + #[error("io error\n{0}")] + Io(#[from] std::io::Error), + #[error("parse error {0}\n{2}\n{}\n{:width$}^", + .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), + "", + width=.2.position.col.saturating_sub(1), + )] + ParseError(String, String, ron::error::Error), + #[error("kdl parse error {}", .2)] + KdlParseError(String, String, kdl::KdlError), + #[error("kdl-script error {0}")] + KdlScriptError(#[from] kdl_script::KdlScriptError), + #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] + InconsistentStructDefinition { + name: String, + old_decl: String, + new_decl: String, + }, + #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] + HandwrittenMixing, + #[error("No handwritten source for this pairing (skipping)")] + NoHandwrittenSource, + #[error("Unsupported Signature For Rust: {0}")] + RustUnsupported(String), + #[error("Unsupported Signature For C: {0}")] + CUnsupported(String), + #[error("ABI impl doesn't support this calling convention.")] + UnsupportedConvention, + /// Used to signal we just skipped it + #[error("")] + Skipped, +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] +pub enum CallingConvention { + // These conventions are special ones that "desugar" to others + /// Sugar for "every possible convention" + All, + /// A complete opaque convention, the implementation must be manually + /// written in the handwritten_impls directory. + Handwritten, + /// The platform's default C convention (cdecl?) + C, + /// ??? + Cdecl, + /// The platorm's default OS convention (usually C, but Windows is Weird). + System, + + // These conventions are specific ones + /// x64 windows C convention + Win64, + /// x64 non-windows C convention + Sysv64, + /// ARM C convention + Aapcs, + /// Win32 x86 system APIs + Stdcall, + /// Microsoft fastcall + /// MSVC` __fastcall` + /// GCC/Clang `__attribute__((fastcall))` + Fastcall, + /// Microsoft vectorcall + /// MSCV `__vectorcall` + /// GCC/Clang `__attribute__((vectorcall))` + Vectorcall, +} + +impl CallingConvention { + pub fn name(&self) -> &'static str { + match self { + CallingConvention::All => { + unreachable!("CallingConvention::All is sugar and shouldn't reach here!") + } + CallingConvention::Handwritten => "handwritten", + CallingConvention::C => "c", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => "vectorcall", + } + } + pub fn from_str(input: &str) -> Option { + Some(match input { + "all" => CallingConvention::All, + "handwritten" => CallingConvention::Handwritten, + "c" => CallingConvention::C, + "cdecl" => CallingConvention::Cdecl, + "system" => CallingConvention::System, + "win64" => CallingConvention::Win64, + "sysv64" => CallingConvention::Sysv64, + "aapcs" => CallingConvention::Aapcs, + "stdcall" => CallingConvention::Stdcall, + "fastcall" => CallingConvention::Fastcall, + "vectorcall" => CallingConvention::Vectorcall, + _ => return None, + }) + } +} diff --git a/src/abis_old/c.rs b/src/abis_old/c.rs new file mode 100644 index 0000000..2bb0901 --- /dev/null +++ b/src/abis_old/c.rs @@ -0,0 +1,822 @@ +use crate::Config; + +use super::super::*; +use super::*; + +pub static C_TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); + +pub struct CcAbiImpl { + cc_flavor: CCFlavor, + platform: Platform, + mode: &'static str, +} + +#[derive(PartialEq)] +enum CCFlavor { + Clang, + Gcc, + Msvc, +} + +#[derive(PartialEq)] +enum Platform { + Windows, + Unixy, +} + +impl AbiImpl for CcAbiImpl { + fn name(&self) -> &'static str { + self.mode + } + fn lang(&self) -> &'static str { + "c" + } + fn src_ext(&self) -> &'static str { + "c" + } + + fn supports_convention(&self, convention: CallingConvention) -> bool { + self.c_convention_decl(convention).is_ok() + } + + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + self.write_c_signature(f, function, convention)?; + writeln!(f, " {{")?; + + writeln!(f)?; + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? + )?; + } + writeln!(f)?; + if let Some(output) = &function.output { + writeln!( + f, + " {} = {};", + self.c_var_decl(output, OUTPUT_NAME)?, + self.c_val(output)? + )?; + writeln!( + f, + "{}", + self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? + )?; + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + writeln!( + f, + " {}", + self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? + )?; + } else { + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + } + writeln!(f, "}}")?; + writeln!(f)?; + } + + Ok(()) + } + + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the extern block + for function in &test.funcs { + self.write_c_signature(f, function, convention)?; + writeln!(f, ";")?; + } + + writeln!(f)?; + writeln!(f, "void do_test(void) {{")?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + // Add an extra scope to avoid clashes between subtests + writeln!(f, "{{")?; + // Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + " {} = {};", + self.c_var_decl(input, ARG_NAMES[idx])?, + self.c_val(input)? + )?; + writeln!( + f, + "{}", + self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? + )?; + } + writeln!(f)?; + + // Output + let pass_out = if let Some(output) = &function.output { + if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { + writeln!(f, " {};", out_param_var)?; + write!(f, " ")?; + true + } else { + write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; + false + } + } else { + write!(f, " ")?; + false + }; + + // Do the actual call + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; + } + if pass_out { + let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; + if function.inputs.is_empty() { + write!(f, "{}", pass)?; + } else { + write!(f, ", {}", pass)?; + } + } + writeln!(f, ");")?; + + if let Some(output) = &function.output { + writeln!( + f, + "{}", + self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? + )?; + } + writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; + writeln!(f, "}}")?; + writeln!(f)?; + } + writeln!(f, "}}")?; + Ok(()) + } + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, lib_name), + "gcc" => self.compile_gcc(src_path, lib_name), + "clang" => self.compile_clang(src_path, lib_name), + "msvc" => self.compile_msvc(src_path, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } + + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, lib_name), + "gcc" => self.compile_gcc(src_path, lib_name), + "clang" => self.compile_clang(src_path, lib_name), + "msvc" => self.compile_msvc(src_path, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } +} + +impl CcAbiImpl { + pub fn new(_system_info: &Config, mode: &'static str) -> Self { + let compiler = cc::Build::new().get_compiler(); + let cc_flavor = if compiler.is_like_msvc() { + CCFlavor::Msvc + } else if compiler.is_like_gnu() { + CCFlavor::Gcc + } else if compiler.is_like_clang() { + CCFlavor::Clang + } else { + panic!("Unknown compiler flavour for CC"); + }; + + let platform = if cfg!(target_os = "windows") { + Platform::Windows + } else { + Platform::Unixy + }; + + Self { + cc_flavor, + platform, + mode, + } + } + + fn compile_cc(&self, src_path: &Path, lib_name: &str) -> Result { + cc::Build::new() + .file(src_path) + .opt_level(0) + .cargo_metadata(false) + .target(built_info::TARGET) + // .warnings_into_errors(true) + .try_compile(lib_name)?; + Ok(String::from(lib_name)) + } + + fn compile_clang(&self, src_path: &Path, lib_name: &str) -> Result { + let base_path = PathBuf::from("target/temp/"); + let obj_path = base_path.join(format!("{lib_name}.o")); + let lib_path = base_path.join(format!("lib{lib_name}.a")); + Command::new("clang") + .arg("-ffunction-sections") + .arg("-fdata-sections") + .arg("-fPIC") + .arg("-o") + .arg(&obj_path) + .arg("-c") + .arg(&src_path) + .status() + .unwrap(); + Command::new("ar") + .arg("cq") + .arg(&lib_path) + .arg(&obj_path) + .status() + .unwrap(); + Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); + Ok(String::from(lib_name)) + } + + fn compile_gcc(&self, src_path: &Path, lib_name: &str) -> Result { + let base_path = PathBuf::from("target/temp/"); + let obj_path = base_path.join(format!("{lib_name}.o")); + let lib_path = base_path.join(format!("lib{lib_name}.a")); + Command::new("gcc") + .arg("-ffunction-sections") + .arg("-fdata-sections") + .arg("-fPIC") + .arg("-o") + .arg(&obj_path) + .arg("-c") + .arg(&src_path) + .status() + .unwrap(); + Command::new("ar") + .arg("cq") + .arg(&lib_path) + .arg(&obj_path) + .status() + .unwrap(); + Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); + Ok(String::from(lib_name)) + } + + fn compile_msvc(&self, _src_path: &Path, _lib_name: &str) -> Result { + unimplemented!() + } + + fn c_convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { + use CCFlavor::*; + use CallingConvention::*; + use Platform::*; + // GCC (as __attribute__'s) + // + // * x86: cdecl, fastcall, thiscall, stdcall, + // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), + // naked, interrupt, sseregparm + // * ARM: pcs="aapcs", pcs="aapcs-vfp", + // long_call, short_call, naked, + // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), + // + // MSVC (as ~keywords) + // + // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall + + let val = match convention { + Handwritten => "handwritten", + All => { + // All is sugar, we shouldn't get here! + return Err(GenerateError::UnsupportedConvention); + } + System | Win64 | Sysv64 | Aapcs => { + // Don't want to think about these yet, I think they're + // all properly convered by other ABIs + return Err(GenerateError::UnsupportedConvention); + } + C => "", + Cdecl => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__cdecl ", + Gcc | Clang => "__attribute__((cdecl)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Stdcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__stdcall ", + Gcc | Clang => "__attribute__((stdcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Fastcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__fastcall ", + Gcc | Clang => "__attribute__((fastcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Vectorcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__vectorcall ", + Gcc | Clang => "__attribute__((vectorcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + }; + + Ok(val) + } + + // Emit a function signature + fn write_c_signature( + &self, + f: &mut dyn Write, + function: &Func, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + let convention_decl = self.c_convention_decl(convention)?; + + // First figure out the return (by-ref requires an out-param) + let out_param = if let Some(output) = &function.output { + let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; + if out_param.is_none() { + write!(f, "{} ", self.c_arg_type(output)?)?; + } else { + write!(f, "void ")?; + } + out_param + } else { + write!(f, "void ")?; + None + }; + + write!(f, "{}", convention_decl)?; + + // Now write out the args + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; + } + + // Add extra implicit args + if let Some(out_param) = out_param { + if !function.inputs.is_empty() { + write!(f, ", ")?; + } + write!(f, "{out_param}")?; + } else if function.inputs.is_empty() { + write!(f, "void")?; + } + write!(f, ")")?; + + Ok(()) + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { + // Load test harness "headers" + write!(f, "{}", C_TEST_PREFIX)?; + + // Forward-decl struct types + let mut forward_decls = std::collections::HashMap::::new(); + for function in &test.funcs { + for val in function.inputs.iter().chain(function.output.as_ref()) { + for (name, decl) in self.c_forward_decl(val)? { + match forward_decls.entry(name) { + std::collections::hash_map::Entry::Occupied(entry) => { + if entry.get() != &decl { + return Err(GenerateError::InconsistentStructDefinition { + name: entry.key().clone(), + old_decl: entry.remove(), + new_decl: decl, + }); + } + } + std::collections::hash_map::Entry::Vacant(entry) => { + writeln!(f, "{decl}")?; + entry.insert(decl); + } + } + } + } + } + + Ok(()) + } + + fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { + use Val::*; + match val { + Struct(name, fields) => { + let mut results = vec![]; + for field in fields.iter() { + results.extend(self.c_forward_decl(field)?); + } + let mut output = String::new(); + let ref_name = format!("struct {name}"); + output.push_str(&format!("struct {name} {{\n")); + for (idx, field) in fields.iter().enumerate() { + let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); + output.push_str(&line); + } + output.push_str("};\n"); + results.push((ref_name, output)); + Ok(results) + } + Array(vals) => self.c_forward_decl(&vals[0]), + Ref(pointee) => self.c_forward_decl(pointee), + _ => Ok(vec![]), + } + } + + /// The decl to use for a local var (reference-ness stripped) + fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { + use Val::*; + let val = match val { + Ref(pointee) => self.c_var_decl(pointee, var_name)?, + Array(_) => { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) + } + normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), + }; + Ok(val) + } + + /// The decl to use for a function arg (apply referenceness) + fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + format!("{}* {arg_name}", self.c_arg_type(cur_val)?) + } else { + format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) + } + } else { + format!("{} {arg_name}", self.c_arg_type(val)?) + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param( + &self, + val: &Val, + out_param_name: &str, + ) -> Result, GenerateError> { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) + } else { + Some(format!( + "{} {out_param_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + } else { + None + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param_var( + &self, + val: &Val, + output_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(self.c_var_decl(pointee, output_name)?)) + } else { + Ok(None) + } + } + + /// How to pass an argument + fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(pointee) = val { + if let Val::Array(_) = &**pointee { + Ok(arg_name.to_string()) + } else { + Ok(format!("&{arg_name}")) + } + } else { + Ok(arg_name.to_string()) + } + } + + /// How to return a value + fn c_var_return( + &self, + val: &Val, + var_name: &str, + out_param_name: &str, + ) -> Result { + if let Val::Ref(_) = val { + Ok(format!( + "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" + )) + } else { + Ok(format!("return {var_name};")) + } + } + + /// The type name to use for this value when it is stored in args/vars. + fn c_arg_type(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => { + let mut cur_val = &**pointee; + while let Val::Array(vals) = cur_val { + cur_val = &vals[0]; + } + format!("{}*", self.c_arg_type(cur_val)?) + } + Ptr(_) => "void*".to_string(), + Bool(_) => "bool".to_string(), + Array(_vals) => { + // C arrays are kinda fake due to how they decay in function arg + // position, so a ton of code needs to very delicately detect arrays + // and desugar them properly. Since most things eventually sink into + // c_arg_type, this is a good guard against something forgetting to + // specially handle arrays! + // + // But also it just isn't legal to pass an array by-value in C + // (it decays to a pointer, so you need to wrap it in Ref for + // other ABIs to understand that's what we're doing. + return Err(GenerateError::CUnsupported( + "C Arrays can't be passed directly, wrap this in Ref".to_string(), + )); + } + Struct(name, _) => format!("struct {name}"), + Float(FloatVal::c_double(_)) => "double".to_string(), + Float(FloatVal::c_float(_)) => "float".to_string(), + Int(int_val) => match int_val { + c__int128(_) => "__int128_t".to_string(), + c_int64_t(_) => "int64_t".to_string(), + c_int32_t(_) => "int32_t".to_string(), + c_int16_t(_) => "int16_t".to_string(), + c_int8_t(_) => "int8_t".to_string(), + c__uint128(_) => "__uint128_t".to_string(), + c_uint64_t(_) => "uint64_t".to_string(), + c_uint32_t(_) => "uint32_t".to_string(), + c_uint16_t(_) => "uint16_t".to_string(), + c_uint8_t(_) => "uint8_t".to_string(), + }, + }; + Ok(val) + } + + /// The type name to use for this value when it is stored in composite. + /// + /// This is separated out in case there's a type that needs different + /// handling in this context to conform to a layout (i.e. how C arrays + /// decay into pointers when used in function args). + fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + Ok(format!( + "{} {field_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + + /// An expression that generates this value. + pub fn c_val(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => self.c_val(pointee)?, + Ptr(addr) => format!("(void*){addr:#X}ull"), + Bool(val) => format!("{val}"), + Array(vals) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, elem) in vals.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = (self.c_val(elem)?).to_string(); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Struct(_name, fields) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, field) in fields.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(FloatVal::c_double(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Float(FloatVal::c_float(val)) => { + if val.fract() == 0.0 { + format!("{val}.0f") + } else { + format!("{val}f") + } + } + Int(int_val) => match *int_val { + c__int128(val) => { + let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") + } + c__uint128(val) => { + let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") + } + c_int64_t(val) => format!("{val}"), + c_int32_t(val) => format!("{val}"), + c_int16_t(val) => format!("{val}"), + c_int8_t(val) => format!("{val}"), + c_uint64_t(val) => format!("{val}ull"), + c_uint32_t(val) => format!("{val:#X}"), + c_uint16_t(val) => format!("{val:#X}"), + c_uint8_t(val) => format!("{val:#X}"), + }, + }; + Ok(val) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn c_write_val( + &self, + val: &Val, + to: &str, + from: &str, + is_var_root: bool, + ) -> Result { + use std::fmt::Write; + let mut output = String::new(); + for path in self.c_var_paths(val, from, is_var_root)? { + writeln!( + output, + " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" + ) + .unwrap(); + } + write!(output, " FINISHED_VAL({to});").unwrap(); + + Ok(output) + } + + /// Compute the paths to every subfield of this value, with `from` + /// as the base path to that value, for c_write_val's use. + fn c_var_paths( + &self, + val: &Val, + from: &str, + is_var_root: bool, + ) -> Result, GenerateError> { + let paths = match val { + Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + vec![format!("{from}")] + } + Val::Struct(_name, fields) => { + let mut paths = vec![]; + for (idx, field) in fields.iter().enumerate() { + let base = format!("{from}.{}", FIELD_NAMES[idx]); + paths.extend(self.c_var_paths(field, &base, false)?); + } + paths + } + Val::Ref(pointee) => { + if is_var_root { + self.c_var_paths(pointee, from, false)? + } else if let Val::Array(_) = &**pointee { + self.c_var_paths(pointee, from, false)? + } else { + let base = format!("(*{from})"); + self.c_var_paths(pointee, &base, false)? + } + } + Val::Array(vals) => { + let mut paths = vec![]; + for (i, elem) in vals.iter().enumerate() { + let base = format!("{from}[{i}]"); + paths.extend(self.c_var_paths(elem, &base, false)?); + } + paths + } + }; + + Ok(paths) + } + + /* + /// Format specifiers for C types, for print debugging. + /// This is no longer used but it's a shame to throw out. + pub fn cfmt(&self, val: &Val) -> &'static str { + use Val::*; + use IntVal::*; + match val { + Ref(x) => self.cfmt(x), + Ptr(_) => "\"p\"", + Bool(_) => "\"d\"", + Array(_) => { + todo!() + } + Struct(_name, _fields) => { + todo!() + } + Float(FloatVal::c_double(_val)) => "\"f\"", + Float(FloatVal::c_float(_val)) => "\"f\"", + Int(int_val) => match int_val { + c_uint8_t(..) => "PRIu8", + c_uint16_t(..) => "PRIu16", + c_uint32_t(..) => "PRIu32", + c_uint64_t(..) => "PRIu64", + c_uint128_t(..) => "PRIu128", + + c_int8_t(..) => "PRId8", + c_int16_t(..) => "PRId16", + c_int32_t(..) => "PRId32", + c_int64_t(..) => "PRId64", + c_int128_t(..) => "PRId128", + } + } + } + */ +} diff --git a/src/abis_old/mod.rs b/src/abis_old/mod.rs new file mode 100644 index 0000000..0632b3f --- /dev/null +++ b/src/abis_old/mod.rs @@ -0,0 +1,288 @@ +#![allow(non_camel_case_types)] + +// Backends that can generate + compile an implementation's code into a staticlib. +pub mod c; +pub mod rust; + +use super::report::BuildError; +use std::io::Write; +use std::path::Path; + +pub use c::CcAbiImpl; +pub use rust::RustcAbiImpl; + +pub static ABI_IMPL_RUSTC: &str = "rustc"; +pub static ABI_IMPL_CC: &str = "cc"; +pub static ABI_IMPL_GCC: &str = "gcc"; +pub static ABI_IMPL_CLANG: &str = "clang"; +pub static ABI_IMPL_MSVC: &str = "msvc"; + +// pub static ALL_ABIS: &[AbiRef] = &[RUST_ABI, C_ABI]; +pub static ALL_CONVENTIONS: &[CallingConvention] = &[ + CallingConvention::Handwritten, + CallingConvention::C, + CallingConvention::Cdecl, + CallingConvention::Stdcall, + CallingConvention::Fastcall, + CallingConvention::Vectorcall, + // Note sure if these have a purpose, so omitting them for now + // CallingConvention::System, + // CallingConvention::Win64, + // CallingConvention::Sysv64, + // CallingConvention::Aapcs, +]; + +// pre-computed arg/field names to avoid a bunch of tedious formatting, and to make +// it easy to refactor this detail if we decide we don't like this naming scheme. +pub static ARG_NAMES: &[&str] = &[ + "arg0", "arg1", "arg2", "arg3", "arg4", "arg5", "arg6", "arg7", "arg8", "arg9", "arg10", + "arg11", "arg12", "arg13", "arg14", "arg15", "arg16", "arg17", "arg18", "arg19", "arg20", + "arg21", "arg22", "arg23", "arg24", "arg25", "arg26", "arg27", "arg28", "arg29", "arg30", + "arg31", "arg32", +]; +pub static FIELD_NAMES: &[&str] = &[ + "field0", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", + "field9", "field10", "field11", "field12", "field13", "field14", "field15", "field16", + "field17", "field18", "field19", "field20", "field21", "field22", "field23", "field24", + "field25", "field26", "field27", "field28", "field29", "field30", "field31", "field32", +]; +pub static OUTPUT_NAME: &str = "output"; +pub static OUT_PARAM_NAME: &str = "out"; + +/// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. +pub trait AbiImpl { + fn name(&self) -> &'static str; + fn lang(&self) -> &'static str; + fn src_ext(&self) -> &'static str; + fn supports_convention(&self, _convention: CallingConvention) -> bool; + + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError>; + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError>; + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; +} + +#[derive(Debug, thiserror::Error)] +#[allow(dead_code)] +pub enum GenerateError { + #[error("io error\n{0}")] + Fmt(#[from] std::fmt::Error), + #[error("io error\n{0}")] + Io(#[from] std::io::Error), + #[error("parse error {0}\n{2}\n{}\n{:width$}^", + .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), + "", + width=.2.position.col.saturating_sub(1), + )] + ParseError(String, String, ron::error::Error), + #[error("kdl parse error {}", .2)] + KdlParseError(String, String, kdl::KdlError), + #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] + InconsistentStructDefinition { + name: String, + old_decl: String, + new_decl: String, + }, + #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] + HandwrittenMixing, + #[error("No handwritten source for this pairing (skipping)")] + NoHandwrittenSource, + #[error("Unsupported Signature For Rust: {0}")] + RustUnsupported(String), + #[error("Unsupported Signature For C: {0}")] + CUnsupported(String), + #[error("ABI impl doesn't support this calling convention.")] + UnsupportedConvention, + /// Used to signal we just skipped it + #[error("")] + Skipped, +} + +/// A test, containing several subtests, each its own function +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +pub struct Test { + pub name: String, + pub funcs: Vec, +} + +/// A function's calling convention + signature which will +/// be used to generate the caller+callee automatically. +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +pub struct Func { + pub name: String, + pub conventions: Vec, + pub inputs: Vec, + pub output: Option, +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] +pub enum CallingConvention { + // These conventions are special ones that "desugar" to others + /// Sugar for "every possible convention" + All, + /// A complete opaque convention, the implementation must be manually + /// written in the handwritten_impls directory. + Handwritten, + /// The platform's default C convention (cdecl?) + C, + /// ??? + Cdecl, + /// The platorm's default OS convention (usually C, but Windows is Weird). + System, + + // These conventions are specific ones + /// x64 windows C convention + Win64, + /// x64 non-windows C convention + Sysv64, + /// ARM C convention + Aapcs, + /// Win32 x86 system APIs + Stdcall, + /// Microsoft fastcall + /// MSVC` __fastcall` + /// GCC/Clang `__attribute__((fastcall))` + Fastcall, + /// Microsoft vectorcall + /// MSCV `__vectorcall` + /// GCC/Clang `__attribute__((vectorcall))` + Vectorcall, +} + +/// A typed value. +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +pub enum Val { + /// A Ref is passed-by-reference (is a pointer) but the + /// pointee will be regarded as the real value that we check. + /// + /// If a Ref val is used as the return value for a function, it will + /// implicitly introduce an outparam that the callee memcpy's to. + Ref(Box), + /// Some integer + Int(IntVal), + /// Some float + Float(FloatVal), + /// A bool + Bool(bool), + /// An array (homogeneous types, checked on construction) + /// + /// Arrays must be wrapped in a Ref to directly use them as args/returns + /// when compiling to C. Rust is fine with passing them by-value, but of + /// course this is pointless when the other half of the equation pukes. + /// + /// FIXME: it isn't currently enforced that this is homogeneous, anything that needs + /// the type of the elements just grabs the type of element 0 + /// + /// FIXME: it's illegal to have an array of length 0, because it's impossible to + /// attach a type to it + Array(Vec), + /// A named struct (heterogeneous type) + /// + /// Struct decls are implicitly derived from their usage as a value. + /// If any two structs claim the same name but have different layouts, + /// the ABI backends should notice this and return an error. + Struct(String, Vec), + /// An opaque pointer + /// + /// FIXME?: it's gross to just pick "u64" as the type here when ostensibly it would + /// be nice for this to be able to taget 32-bit platforms. But using usize doesn't really + /// make sense either because we're slurping these values out of a static config file! + /// I guess just truncating the pointer is "fine". + Ptr(u64), + // TODO: unions. This is hard to do with the current design where + // types are implicit in their values. You could maybe hack it in + // by having dummy vals for all the different cases and then a + // "real" value for the variant that's actually used, but, kinda gross. + // + // TODO: simd vectors (they have special passing rules!) + // + // TODO: enums (enum classes?) +} + +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +pub enum IntVal { + c__int128(i128), + c_int64_t(i64), + c_int32_t(i32), + c_int16_t(i16), + c_int8_t(i8), + + c__uint128(u128), + c_uint64_t(u64), + c_uint32_t(u32), + c_uint16_t(u16), + c_uint8_t(u8), + // TODO: nastier platform-specific-layout c-types? + // i.e. c_int(i64), c_long(i32), char(i8), ... +} + +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +pub enum FloatVal { + c_double(f64), + c_float(f32), + // Is there a reason to mess with `long double`? Surely not. +} + +impl CallingConvention { + pub fn name(&self) -> &'static str { + match self { + CallingConvention::All => { + unreachable!("CallingConvention::All is sugar and shouldn't reach here!") + } + CallingConvention::Handwritten => "handwritten", + CallingConvention::C => "c", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => "vectorcall", + } + } + pub fn from_str(input: &str) -> Option { + Some(match input { + "all" => CallingConvention::All, + "handwritten" => CallingConvention::Handwritten, + "c" => CallingConvention::C, + "cdecl" => CallingConvention::Cdecl, + "system" => CallingConvention::System, + "win64" => CallingConvention::Win64, + "sysv64" => CallingConvention::Sysv64, + "aapcs" => CallingConvention::Aapcs, + "stdcall" => CallingConvention::Stdcall, + "fastcall" => CallingConvention::Fastcall, + "vectorcall" => CallingConvention::Vectorcall, + _ => return None, + }) + } +} + +impl Func { + pub fn has_convention(&self, convention: CallingConvention) -> bool { + self.conventions.iter().any(|&func_cc| { + (func_cc == CallingConvention::All && convention != CallingConvention::Handwritten) + || func_cc == convention + }) + } +} + +impl Test { + pub fn has_convention(&self, convention: CallingConvention) -> bool { + self.funcs + .iter() + .any(|func| func.has_convention(convention)) + } +} diff --git a/src/abis_old/rust.rs b/src/abis_old/rust.rs new file mode 100644 index 0000000..ab31bfc --- /dev/null +++ b/src/abis_old/rust.rs @@ -0,0 +1,661 @@ +use super::super::*; +use super::*; + +pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); + +static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); + +#[allow(dead_code)] +pub struct RustcAbiImpl { + is_nightly: bool, + codegen_backend: Option, +} + +impl AbiImpl for RustcAbiImpl { + fn name(&self) -> &'static str { + "rustc" + } + fn lang(&self) -> &'static str { + "rust" + } + fn src_ext(&self) -> &'static str { + "rs" + } + fn supports_convention(&self, convention: CallingConvention) -> bool { + // NOTE: Rustc spits out: + // + // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, + // vectorcall, thiscall, thiscall-unwind, aapcs, win64, sysv64, + // ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, + // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, + // wasm, system, system-unwind, rust-intrinsic, rust-call, + // platform-intrinsic, unadjusted + match convention { + CallingConvention::All => unreachable!(), + CallingConvention::Handwritten => true, + CallingConvention::C => true, + CallingConvention::Cdecl => true, + CallingConvention::System => true, + CallingConvention::Win64 => true, + CallingConvention::Sysv64 => true, + CallingConvention::Aapcs => true, + CallingConvention::Stdcall => true, + CallingConvention::Fastcall => true, + CallingConvention::Vectorcall => false, // too experimental even for nightly use? + } + } + + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_rust_prefix(f, test, convention)?; + let convention_decl = self.rust_convention_decl(convention); + + // Generate the extern block + writeln!(f, "extern \"{convention_decl}\" {{",)?; + for function in &test.funcs { + write!(f, " ")?; + self.write_rust_signature(f, function)?; + writeln!(f, ";")?; + } + writeln!(f, "}}")?; + writeln!(f)?; + + // Now generate the body + writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; + + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + writeln!(f, " unsafe {{")?; + + // Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + " {} = {};", + self.rust_var_decl(input, ARG_NAMES[idx])?, + self.rust_val(input)? + )?; + } + writeln!(f)?; + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.rust_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? + )?; + } + writeln!(f)?; + + // Outputs + write!(f, " ")?; + let pass_out = if let Some(output) = &function.output { + if let Some(decl) = self.rust_out_param_var(output, OUTPUT_NAME)? { + writeln!(f, " {}", decl)?; + true + } else { + write!(f, " {} = ", self.rust_var_decl(output, OUTPUT_NAME)?)?; + false + } + } else { + false + }; + + // Do the call + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + write!(f, "{}, ", self.rust_arg_pass(input, ARG_NAMES[idx])?)?; + } + if pass_out { + writeln!(f, "&mut {OUTPUT_NAME}")?; + } + writeln!(f, ");")?; + writeln!(f)?; + + // Report the output + if let Some(output) = &function.output { + writeln!( + f, + "{}", + self.rust_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? + )?; + } + + // Finished + writeln!( + f, + " FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS);" + )?; + writeln!(f, " }}")?; + } + + writeln!(f, "}}")?; + + Ok(()) + } + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_rust_prefix(f, test, convention)?; + let convention_decl = self.rust_convention_decl(convention); + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + // Write the signature + writeln!(f, "#[no_mangle]")?; + write!(f, "pub unsafe extern \"{convention_decl}\" ")?; + self.write_rust_signature(f, function)?; + writeln!(f, " {{")?; + + // Now the body + + // Report Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.rust_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? + )?; + } + writeln!(f)?; + + // Report outputs and return + if let Some(output) = &function.output { + let decl = self.rust_var_decl(output, OUTPUT_NAME)?; + let val = self.rust_val(output)?; + writeln!(f, " {decl} = {val};")?; + writeln!( + f, + "{}", + self.rust_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? + )?; + writeln!( + f, + " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" + )?; + writeln!( + f, + " {}", + self.rust_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? + )?; + } else { + writeln!( + f, + " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" + )?; + } + writeln!(f, "}}")?; + } + + Ok(()) + } + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + let mut cmd = Command::new("rustc"); + cmd.arg("--crate-type") + .arg("staticlib") + .arg("--out-dir") + .arg("target/temp/") + .arg("--target") + .arg(built_info::TARGET) + .arg(format!("-Cmetadata={lib_name}")) + .arg(src_path); + if let Some(codegen_backend) = &self.codegen_backend { + cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); + } + eprintln!("running: {:?}", cmd); + let out = cmd.output()?; + + if !out.status.success() { + Err(BuildError::RustCompile(out)) + } else { + Ok(String::from(lib_name)) + } + } + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + // Currently no need to be different + self.compile_callee(src_path, lib_name) + } +} + +impl RustcAbiImpl { + pub fn new(_system_info: &Config, codegen_backend: Option) -> Self { + Self { + is_nightly: built_info::RUSTC_VERSION.contains("nightly"), + codegen_backend, + } + } + + fn rust_convention_decl(&self, convention: CallingConvention) -> &'static str { + match convention { + CallingConvention::All => { + unreachable!("CallingConvention::All is sugar that shouldn't reach here") + } + CallingConvention::Handwritten => { + unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") + } + CallingConvention::C => "C", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => "vectorcall", + } + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_rust_prefix( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + if convention == CallingConvention::Vectorcall { + writeln!(f, "#![feature(abi_vectorcall)]")?; + } + // Load test harness "headers" + write!(f, "{}", RUST_TEST_PREFIX)?; + + // Forward-decl struct types + let mut forward_decls = std::collections::HashMap::::new(); + for function in &test.funcs { + for val in function.inputs.iter().chain(function.output.as_ref()) { + for (name, decl) in self.rust_forward_decl(val)? { + match forward_decls.entry(name) { + std::collections::hash_map::Entry::Occupied(entry) => { + if entry.get() != &decl { + return Err(GenerateError::InconsistentStructDefinition { + name: entry.key().clone(), + old_decl: entry.remove(), + new_decl: decl, + }); + } + } + std::collections::hash_map::Entry::Vacant(entry) => { + writeln!(f, "{decl}")?; + entry.insert(decl); + } + } + } + } + } + + Ok(()) + } + + fn write_rust_signature( + &self, + f: &mut dyn Write, + function: &Func, + ) -> Result<(), GenerateError> { + write!(f, "fn {}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + write!(f, "{}, ", self.rust_arg_decl(input, ARG_NAMES[idx])?)?; + } + if let Some(output) = &function.output { + if let Some(out_param) = self.rust_out_param(output, OUT_PARAM_NAME)? { + write!(f, "{}", out_param)?; + write!(f, ")")?; + } else { + write!(f, ")")?; + let ty = self.rust_arg_type(output)?; + write!(f, " -> {ty}")?; + } + } else { + write!(f, ")")?; + } + Ok(()) + } + + /// If this value defines a nominal type, this will spit out: + /// + /// * The type name + /// * The forward-declaration of that type + /// + /// To catch buggy test definitions, you should validate that all + /// structs that claim a particular name have the same declaration. + /// This is done in write_rust_prefix. + fn rust_forward_decl(&self, val: &Val) -> Result, GenerateError> { + use Val::*; + match val { + Struct(name, fields) => { + let mut results = vec![]; + for field in fields.iter() { + results.extend(self.rust_forward_decl(field)?); + } + let mut output = String::new(); + let ref_name = name.to_string(); + output.push_str("\n#[repr(C)]\n"); + output.push_str(&format!("pub struct {name} {{\n")); + for (idx, field) in fields.iter().enumerate() { + let line = format!( + " {}: {},\n", + FIELD_NAMES[idx], + self.rust_nested_type(field)? + ); + output.push_str(&line); + } + output.push('}'); + results.push((ref_name, output)); + Ok(results) + } + Array(vals) => self.rust_forward_decl(&vals[0]), + Ref(pointee) => self.rust_forward_decl(pointee), + _ => Ok(vec![]), + } + } + + /// The decl to use for a local var (reference-ness stripped) + fn rust_var_decl(&self, val: &Val, var_name: &str) -> Result { + if let Val::Ref(pointee) = val { + Ok(self.rust_var_decl(pointee, var_name)?) + } else { + Ok(format!("let {var_name}: {}", self.rust_arg_type(val)?)) + } + } + + /// The decl to use for a function arg (apply referenceness) + fn rust_arg_decl(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(pointee) = val { + Ok(format!("{arg_name}: &{}", self.rust_arg_type(pointee)?)) + } else { + Ok(format!("{arg_name}: {}", self.rust_arg_type(val)?)) + } + } + + /// If the return type needs to be an out_param, this returns it + fn rust_out_param( + &self, + val: &Val, + out_param_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(format!( + "{out_param_name}: &mut {}", + self.rust_arg_type(pointee)? + ))) + } else { + Ok(None) + } + } + + /// If the return type needs to be an out_param, this returns it + fn rust_out_param_var( + &self, + val: &Val, + output_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(format!( + "let mut {output_name}: {} = {};", + self.rust_arg_type(pointee)?, + self.rust_default_val(pointee)? + ))) + } else { + Ok(None) + } + } + + /// How to pass an argument + fn rust_arg_pass(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(_) = val { + Ok(format!("&{arg_name}")) + } else { + Ok(arg_name.to_string()) + } + } + + /// How to return a value + fn rust_var_return( + &self, + val: &Val, + var_name: &str, + out_param_name: &str, + ) -> Result { + if let Val::Ref(_) = val { + Ok(format!("*{out_param_name} = {var_name};")) + } else { + Ok(format!("return {var_name};")) + } + } + + /// The type name to use for this value when it is stored in args/vars. + fn rust_arg_type(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let out = match val { + Ref(pointee) => format!("*mut {}", self.rust_arg_type(pointee)?), + Ptr(_) => "*mut ()".to_string(), + Bool(_) => "bool".to_string(), + Array(vals) => format!("[{}; {}]", self.rust_arg_type(&vals[0])?, vals.len()), + Struct(name, _) => name.to_string(), + Float(FloatVal::c_double(_)) => "f64".to_string(), + Float(FloatVal::c_float(_)) => "f32".to_string(), + Int(int_val) => match int_val { + c__int128(_) => { + if STRUCT_128 { + "FfiI128".to_string() + } else { + "i128".to_string() + } + } + c_int64_t(_) => "i64".to_string(), + c_int32_t(_) => "i32".to_string(), + c_int16_t(_) => "i16".to_string(), + c_int8_t(_) => "i8".to_string(), + c__uint128(_) => { + if STRUCT_128 { + "FfiU128".to_string() + } else { + "u128".to_string() + } + } + c_uint64_t(_) => "u64".to_string(), + c_uint32_t(_) => "u32".to_string(), + c_uint16_t(_) => "u16".to_string(), + c_uint8_t(_) => "u8".to_string(), + }, + }; + Ok(out) + } + + /// The type name to use for this value when it is stored in composite. + /// + /// This is separated out in case there's a type that needs different + /// handling in this context to conform to a layout (i.e. how C arrays + /// decay into pointers when used in function args). + fn rust_nested_type(&self, val: &Val) -> Result { + self.rust_arg_type(val) + } + + /// An expression that generates this value. + fn rust_val(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let out = match val { + Ref(pointee) => self.rust_val(pointee)?, + Ptr(addr) => format!("{addr:#X} as *mut ()"), + Bool(val) => format!("{val}"), + Array(vals) => { + let mut output = String::new(); + output.push('['); + for elem in vals { + let part = format!("{}, ", self.rust_val(elem)?); + output.push_str(&part); + } + output.push(']'); + output + } + Struct(name, fields) => { + let mut output = String::new(); + output.push_str(&format!("{name} {{ ")); + for (idx, field) in fields.iter().enumerate() { + let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(FloatVal::c_double(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Float(FloatVal::c_float(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Int(int_val) => match int_val { + c__int128(val) => { + if STRUCT_128 { + format!("FfiI128::new({val})") + } else { + format!("{val}") + } + } + c_int64_t(val) => format!("{val}"), + c_int32_t(val) => format!("{val}"), + c_int16_t(val) => format!("{val}"), + c_int8_t(val) => format!("{val}"), + c__uint128(val) => { + if STRUCT_128 { + format!("FfiU128::new({val:#X})") + } else { + format!("{val:#X}") + } + } + c_uint64_t(val) => format!("{val:#X}"), + c_uint32_t(val) => format!("{val:#X}"), + c_uint16_t(val) => format!("{val:#X}"), + c_uint8_t(val) => format!("{val:#X}"), + }, + }; + Ok(out) + } + + /// A suitable default value for this type + fn rust_default_val(&self, val: &Val) -> Result { + use Val::*; + let out = match val { + Ref(pointee) => self.rust_default_val(pointee)?, + Ptr(_) => "0 as *mut ()".to_string(), + Bool(_) => "false".to_string(), + Array(vals) => { + let mut output = String::new(); + output.push('['); + for elem in vals { + let part = format!("{}, ", self.rust_default_val(elem)?); + output.push_str(&part); + } + output.push(']'); + output + } + Struct(name, fields) => { + let mut output = String::new(); + output.push_str(&format!("{name} {{ ")); + for (idx, field) in fields.iter().enumerate() { + let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_default_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(..) => "0.0".to_string(), + Int(IntVal::c__int128(..)) => { + if STRUCT_128 { + "FfiI128::new(0)".to_string() + } else { + "0".to_string() + } + } + Int(IntVal::c__uint128(..)) => { + if STRUCT_128 { + "FfiU128::new(0)".to_string() + } else { + "0".to_string() + } + } + Int(..) => "0".to_string(), + }; + Ok(out) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn rust_write_val( + &self, + val: &Val, + to: &str, + from: &str, + is_var_root: bool, + ) -> Result { + use std::fmt::Write; + let mut output = String::new(); + for path in self.rust_var_paths(val, from, is_var_root)? { + writeln!(output, " WRITE_FIELD.unwrap()({to}, &{path} as *const _ as *const _, core::mem::size_of_val(&{path}) as u32);").unwrap(); + } + write!(output, " FINISHED_VAL.unwrap()({to});").unwrap(); + + Ok(output) + } + + /// Compute the paths to every subfield of this value, with `from` + /// as the base path to that value, for rust_write_val's use. + fn rust_var_paths( + &self, + val: &Val, + from: &str, + is_var_root: bool, + ) -> Result, GenerateError> { + let paths = match val { + Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + vec![format!("{from}")] + } + Val::Struct(_name, fields) => { + let mut paths = vec![]; + for (idx, field) in fields.iter().enumerate() { + let base = format!("{from}.{}", FIELD_NAMES[idx]); + paths.extend(self.rust_var_paths(field, &base, false)?); + } + paths + } + Val::Ref(pointee) => { + if is_var_root { + self.rust_var_paths(pointee, from, false)? + } else { + let base = format!("(*{from})"); + self.rust_var_paths(pointee, &base, false)? + } + } + Val::Array(vals) => { + let mut paths = vec![]; + for (i, elem) in vals.iter().enumerate() { + let base = format!("{from}[{i}]"); + paths.extend(self.rust_var_paths(elem, &base, false)?); + } + paths + } + }; + + Ok(paths) + } +} diff --git a/src/fivemat.rs b/src/fivemat.rs new file mode 100644 index 0000000..d5852af --- /dev/null +++ b/src/fivemat.rs @@ -0,0 +1,155 @@ +//! Indent-aware indenting + +use std::fmt::Write; + +/// A wrapper for a std::fmt::Write impl that automatically indents. +pub struct Fivemat<'a> { + indent_text: String, + indent: usize, + indent_pending: bool, + out: &'a mut dyn Write, +} + +impl<'a> Fivemat<'a> { + pub fn new(out: &'a mut dyn Write, indent_text: impl Into) -> Self { + Fivemat { + indent_text: indent_text.into(), + indent: 0, + indent_pending: true, + out, + } + } + pub fn add_indent(&mut self, count: usize) { + self.indent += count; + } + pub fn sub_indent(&mut self, count: usize) { + self.indent -= count; + } + pub fn offset_indent(&mut self, count: isize) { + self.indent = (self.indent as isize + count) as usize; + } + pub fn ensure_indent(&mut self) -> std::fmt::Result { + if !self.indent_pending { + return Ok(()); + } + for _ in 0..self.indent { + write!(&mut self.out, "{}", self.indent_text)?; + } + self.indent_pending = false; + Ok(()) + } + pub fn newline(&mut self) -> std::fmt::Result { + self.indent_pending = true; + write!(&mut self.out, "\n") + } +} + +impl<'a> std::fmt::Write for Fivemat<'a> { + fn write_str(&mut self, s: &str) -> std::fmt::Result { + let mut multiline = false; + let ends_with_newline = s.ends_with('\n') || s.ends_with("\r\n") || s.ends_with("\n\r"); + for line in s.lines() { + if multiline { + self.newline()?; + } + multiline = true; + if line.len() > 0 { + self.ensure_indent()?; + write!(&mut self.out, "{}", line)?; + } + } + if ends_with_newline { + self.newline()?; + } + Ok(()) + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn fivemat_basic() -> std::fmt::Result { + let mut out = String::new(); + let mut f = Fivemat::new(&mut out, " "); + writeln!(&mut f)?; + { + writeln!(&mut f, "struct MyStruct {{")?; + f.add_indent(1); + { + write!(&mut f, "field1: ")?; + write!(&mut f, "bool")?; + writeln!(&mut f, ",")?; + } + { + write!(&mut f, "field2: ")?; + writeln!(&mut f, "{} {{", "Inner")?; + f.add_indent(1); + { + writeln!(&mut f, "{}: {},", "x", "f64")?; + writeln!(&mut f, "y: f32,")?; + } + f.sub_indent(1); + writeln!(&mut f, "}},")?; + } + writeln!( + &mut f, + r#"field3: MyThing {{ + a: i32, + b: i64, +}},"# + )?; + f.sub_indent(1); + writeln!(&mut f, "}}")?; + } + writeln!(&mut f)?; + + { + writeln!(&mut f, "fn my_func() {{")?; + f.add_indent(1); + { + writeln!(&mut f, "let x = 0;")?; + writeln!(&mut f)?; + writeln!(&mut f, "let y = 5;")?; + writeln!(&mut f, "\n")?; + writeln!(&mut f, "let z = 10;")?; + write!(&mut f, "let w = 100;\nlet q = ")?; + write!(&mut f, "20")?; + writeln!(&mut f, ";")?; + } + f.sub_indent(1); + writeln!(&mut f, "}}")?; + } + + assert_eq!( + out, + r#" +struct MyStruct { + field1: bool, + field2: Inner { + x: f64, + y: f32, + }, + field3: MyThing { + a: i32, + b: i64, + }, +} + +fn my_func() { + let x = 0; + + let y = 5; + + + let z = 10; + let w = 100; + let q = 20; +} +"# + ); + + Ok(()) + } +} diff --git a/tests/kdl/types.kdl b/tests/kdl/types.kdl index 18ef95c..f43c67e 100644 --- a/tests/kdl/types.kdl +++ b/tests/kdl/types.kdl @@ -93,4 +93,11 @@ fn "reftime" { c "&Simple" d "ContainsRefs" } +} + +fn "simple" { + inputs { + a "i32" + b "i32" + } } \ No newline at end of file From f7f4cd41e16553d39a2af5dc5075f637b4bd9233 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 4 May 2024 11:18:31 -0400 Subject: [PATCH 11/44] cleanup a bit --- src/abis/mod.rs | 146 ++++++++++++++++++++++++++++++------- src/abis/rust.rs | 178 ++++++++++++++------------------------------- src/fivemat.rs | 3 - src/harness/mod.rs | 0 src/main.rs | 42 ++++++----- src/report.rs | 4 +- 6 files changed, 199 insertions(+), 174 deletions(-) create mode 100644 src/harness/mod.rs diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 442481c..7e31f6e 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -1,10 +1,13 @@ pub mod c; pub mod rust; -use std::{fmt::Write, path::Path, sync::Arc}; +use std::{collections::HashMap, fmt::Write, path::Path, sync::Arc}; pub use c::CcAbiImpl; -use kdl_script::{DefinitionGraph, KdlScriptError, PunEnv, TypedProgram}; +use kdl_script::{ + types::{FuncIdx, TyIdx}, + DefinitionGraph, PunEnv, TypedProgram, +}; pub use rust::RustcAbiImpl; use crate::BuildError; @@ -31,15 +34,100 @@ pub static ALL_CONVENTIONS: &[CallingConvention] = &[ pub static OUTPUT_NAME: &str = "output"; +/// A test case, fully abstract. +/// +/// An abi-cafe Test is essentially a series of function signatures +/// that we're interested in testing. That is, we want to generate a +/// caller and a callee that implement the signature, and check that +/// both sides agree on the values that were passed between them +/// (implying the two implementations agree on the ABI for that signature). +/// +/// To describe these signatures, we use a toy programming language called +/// [kdl-script][], which was designed explicitly for the purpose of declaring +/// type definitions and function signatures, without mandating a specific impl. +/// +/// At this point we have parsed and typechecked the kdl-script program, +/// giving us the signatures but no specific compiler/language to lower them to. +/// +/// Notably, at this level of abtraction kdl-script [Pun Types][pun-types] are +/// still unresolved. You can think of these as types wrapped in +/// an `ifdef`/`#[cfg]`, allowing a test program to declare that +/// two different compilers/languages have fundamentally different +/// understandings of the *shape* of a type, but are still expected +/// to interopate if a function signature puns them. +/// +/// [kdl-script]: https://github.com/Gankra/kdl-script +/// [pun-types]: https://github.com/Gankra/kdl-script/blob/main/README.md#pun-types +#[derive(Debug, Clone)] pub struct Test { + /// Name of the test (file stem) pub name: String, - pub program: Arc, + /// Parsed and Typechecked kdl-script program + pub types: Arc, } +/// A test case, specialized to a specific ABI (PunEnv) +/// +/// This refines a [`Test`][] with a specific [`AbiImpl`][] like "Rust (rustc)" or "C (gcc)". +/// The [`PunEnv`][] describes how the AbiImpl wishes to resolve any "Pun Types". +/// +/// The [`DefinitionGraph`][] provides a DAG of the type/function +/// definitions that result from applying the PunEnv to the Program. +/// This can only be computed once we know how to resolve Puns because +/// an ifdef can completely change which types are referenced. +/// +/// This DAG is queried with a list of functions we're interested +/// in generating code for, producing a topological sort of the type +/// and function declarations so each [`AbiImpl`][] doesn't need to work that out. +/// +/// Typically the query is "all functions", because we want to test everything. +/// However if a test fails we can requery with "just this one failing function" +/// to generate a minimized test-case for debugging/reporting. #[derive(Debug, Clone)] -pub struct TestVariant { +pub struct TestForAbi { + pub inner: Test, pub env: Arc, - pub graph: Arc, + pub defs: Arc, +} +impl std::ops::Deref for TestForAbi { + type Target = Test; + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +/// A test case, fully specialized to specify: +/// +/// * What [`AbiImpl`][] (compiler/language) we're using +/// * What [`CallingConvention`] we're using +/// * Which functions we're generating (usually "all of them") +/// * How to [display/report][`WriteImpl`] values (callbacks vs print vs noop) +/// * Whether we're generating the callee or caller (currently implicit) +/// +/// This also contains some utilities for interning compute type names/expressions. +#[derive(Debug, Clone)] +pub struct TestImpl { + pub inner: TestForAbi, + pub convention: CallingConvention, + pub desired_funcs: Vec, + pub val_writer: WriteImpl, + + // interning state + pub tynames: HashMap, + pub borrowed_tynames: HashMap, +} +impl std::ops::Deref for TestImpl { + type Target = TestForAbi; + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +#[derive(Debug, Clone)] +pub enum WriteImpl { + HarnessCallback, + Print, + Noop, } /// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. @@ -49,20 +137,8 @@ pub trait AbiImpl { fn src_ext(&self) -> &'static str; fn supports_convention(&self, _convention: CallingConvention) -> bool; fn pun_env(&self) -> Arc; - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - variant: &TestVariant, - convention: CallingConvention, - ) -> Result<(), GenerateError>; - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - variant: &TestVariant, - convention: CallingConvention, - ) -> Result<(), GenerateError>; + fn generate_callee(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; + fn generate_caller(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; @@ -73,13 +149,33 @@ impl Test { // TODO true } - pub fn abi_variant( - &self, - abi: &(dyn AbiImpl + Send + Sync), - ) -> Result { + pub fn for_abi(&self, abi: &(dyn AbiImpl + Send + Sync)) -> Result { let env = abi.pun_env(); - let graph = Arc::new(self.program.definition_graph(&env)?); - Ok(TestVariant { env, graph }) + let defs = Arc::new(self.types.definition_graph(&env)?); + Ok(TestForAbi { + inner: self.clone(), + env, + defs, + }) + } +} + +impl TestForAbi { + pub fn for_impl( + &self, + convention: CallingConvention, + query: impl Iterator, + val_writer: WriteImpl, + ) -> Result { + Ok(TestImpl { + inner: self.clone(), + convention, + desired_funcs: query.collect(), + val_writer, + + tynames: Default::default(), + borrowed_tynames: Default::default(), + }) } } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 9ff4a3f..6cc213c 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -2,7 +2,6 @@ use std::sync::Arc; -use kdl_script::parse::FuncDecl; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; @@ -27,27 +26,6 @@ pub struct RustcAbiImpl { codegen_backend: Option, } -pub struct TestImpl { - pub typed: Arc, - pub env: Arc, - pub graph: Arc, - pub convention: CallingConvention, -} - -pub struct GenState<'a> { - test: &'a TestImpl, - tynames: HashMap, - borrowed_tynames: HashMap, - funcs: Vec, - val_writer: WriteImpl, -} - -enum WriteImpl { - HarnessCallback, - Print, - Noop, -} - impl AbiImpl for RustcAbiImpl { fn name(&self) -> &'static str { "rustc" @@ -114,63 +92,35 @@ impl AbiImpl for RustcAbiImpl { self.compile_callee(src_path, lib_name) } - fn generate_callee( - &self, - f: &mut dyn Write, - test: &abis::Test, - variant: &TestVariant, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let query = test.program.all_funcs(); - let test = TestImpl { - typed: test.program.clone(), - env: variant.env.clone(), - graph: variant.graph.clone(), - convention, - }; - self.generate_callee_impl(f, &test, query) + fn generate_callee(&self, f: &mut dyn Write, mut test: TestImpl) -> Result<(), GenerateError> { + let mut f = Fivemat::new(f, INDENT); + self.generate_callee_impl(&mut f, &mut test) } - fn generate_caller( - &self, - f: &mut dyn Write, - test: &abis::Test, - variant: &TestVariant, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let query = test.program.all_funcs(); - let test = TestImpl { - typed: test.program.clone(), - env: variant.env.clone(), - graph: variant.graph.clone(), - convention, - }; - self.generate_caller_impl(f, &test, query) + fn generate_caller(&self, f: &mut dyn Write, mut test: TestImpl) -> Result<(), GenerateError> { + let mut f = Fivemat::new(f, INDENT); + self.generate_caller_impl(&mut f, &mut test) } } impl RustcAbiImpl { pub fn generate_caller_impl( &self, - f: &mut dyn Write, - test: &TestImpl, - query: impl Iterator, + f: &mut Fivemat, + state: &mut TestImpl, ) -> Result<(), GenerateError> { - let mut state = gen_state(test); - let mut f = Fivemat::new(f, INDENT); - // Generate type decls and gather up functions - self.generate_definitions(&mut f, &mut state, query)?; + self.generate_definitions(f, state)?; // Generate decls of the functions we want to call - self.generate_caller_externs(&mut f, &state)?; + self.generate_caller_externs(f, &state)?; // Generate the test function the harness will call writeln!(f, "#[no_mangle]\npub extern \"C\" fn do_test() {{")?; - for &func in &state.funcs { + for &func in &state.desired_funcs { // Generate the individual function calls - self.generate_caller_body(&mut f, &state, func)?; + self.generate_caller_body(f, &state, func)?; } - writeln!(&mut f, "}}")?; + writeln!(f, "}}")?; Ok(()) } @@ -178,12 +128,12 @@ impl RustcAbiImpl { fn generate_caller_externs( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, ) -> Result<(), GenerateError> { - let convention_decl = self.convention_decl(state.test.convention)?; + let convention_decl = self.convention_decl(state.convention)?; writeln!(f, "extern \"{convention_decl}\" {{",)?; f.add_indent(1); - for &func in &state.funcs { + for &func in &state.desired_funcs { self.generate_signature(f, &state, func)?; writeln!(f, ";")?; } @@ -196,12 +146,12 @@ impl RustcAbiImpl { fn generate_caller_body( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, func: FuncIdx, ) -> Result<(), GenerateError> { writeln!(f, "unsafe {{")?; f.add_indent(1); - let function = state.test.typed.realize_func(func); + let function = state.types.realize_func(func); let mut val_idx = 0; // Create vars for all the inputs @@ -230,7 +180,7 @@ impl RustcAbiImpl { fn call_function( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, function: &Func, ) -> Result<(), GenerateError> { let func_name = &function.name; @@ -274,19 +224,15 @@ impl RustcAbiImpl { impl RustcAbiImpl { pub fn generate_callee_impl( &self, - f: &mut dyn std::fmt::Write, - test: &TestImpl, - query: impl Iterator, + f: &mut Fivemat, + state: &mut TestImpl, ) -> Result<(), GenerateError> { - let mut state = gen_state(test); - let mut f = Fivemat::new(f, INDENT); - // Generate type decls and gather up functions - self.generate_definitions(&mut f, &mut state, query)?; + self.generate_definitions(f, state)?; - for &func in &state.funcs { + for &func in &state.desired_funcs { // Generate the individual function definitions - self.generate_callee_body(&mut f, &state, func)?; + self.generate_callee_body(f, &state, func)?; } Ok(()) } @@ -294,11 +240,11 @@ impl RustcAbiImpl { fn generate_callee_body( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, func: FuncIdx, ) -> Result<(), GenerateError> { - let function = state.test.typed.realize_func(func); - let convention_decl = self.convention_decl(state.test.convention)?; + let function = state.types.realize_func(func); + let convention_decl = self.convention_decl(state.convention)?; writeln!(f, "#[no_mangle]")?; write!(f, "pub unsafe extern \"{convention_decl}\" ")?; self.generate_signature(f, &state, func)?; @@ -346,22 +292,21 @@ impl RustcAbiImpl { pub fn generate_definitions( &self, f: &mut Fivemat, - state: &mut GenState, - query: impl Iterator, + state: &mut TestImpl, ) -> Result<(), GenerateError> { self.write_harness_prefix(f, &state)?; - for def in state.test.graph.definitions(query) { + for def in state.defs.definitions(state.desired_funcs.iter().copied()) { match def { kdl_script::Definition::DeclareTy(ty) => { - self.intern_tyname(f, state, ty)?; + self.intern_tyname(state, ty)?; } kdl_script::Definition::DefineTy(ty) => { self.generate_tydef(f, state, ty)?; } kdl_script::Definition::DefineFunc(func) => { - // Buffer up the funcs - state.funcs.push(func); + // we'd buffer these up to generate them all at the end, + // but we've already got them buffered, so... do nothing. } kdl_script::Definition::DeclareFunc(_) => { // nothing to do, executable kdl-script isn't real and can't hurt us @@ -372,18 +317,13 @@ impl RustcAbiImpl { Ok(()) } - pub fn intern_tyname( - &self, - f: &mut Fivemat, - state: &mut GenState, - ty: TyIdx, - ) -> Result<(), GenerateError> { + pub fn intern_tyname(&self, state: &mut TestImpl, ty: TyIdx) -> Result<(), GenerateError> { // Don't double-intern if state.tynames.contains_key(&ty) { return Ok(()); } - let (tyname, borrowed_tyname) = match state.test.typed.realize_ty(ty) { + let (tyname, borrowed_tyname) = match state.types.realize_ty(ty) { // Structural types that don't need definitions but we should // intern the name of Ty::Primitive(prim) => { @@ -479,7 +419,7 @@ impl RustcAbiImpl { // Puns should be evaporated Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); ( state.tynames[&real_ty].clone(), state.borrowed_tynames.get(&real_ty).cloned(), @@ -498,13 +438,13 @@ impl RustcAbiImpl { pub fn generate_tydef( &self, f: &mut Fivemat, - state: &mut GenState, + state: &mut TestImpl, ty: TyIdx, ) -> Result<(), GenerateError> { // Make sure our own name is interned - self.intern_tyname(f, state, ty)?; + self.intern_tyname(state, ty)?; - match state.test.typed.realize_ty(ty) { + match state.types.realize_ty(ty) { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { assert!( @@ -687,14 +627,14 @@ impl RustcAbiImpl { pub fn generate_value( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, ty: TyIdx, val_idx: &mut usize, alias: Option<&str>, ref_temp_name: &str, extra_decls: &mut Vec, ) -> Result<(), GenerateError> { - let names = match state.test.typed.realize_ty(ty) { + let names = match state.types.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx Ty::Primitive(prim) => { match prim { @@ -882,7 +822,7 @@ impl RustcAbiImpl { // Puns should be evaporated Ty::Pun(pun) => { - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); self.generate_value( f, state, @@ -924,8 +864,8 @@ impl RustcAbiImpl { /// Every test should start by loading in the harness' "header" /// and forward-declaring any structs that will be used. - fn write_harness_prefix(&self, f: &mut Fivemat, state: &GenState) -> Result<(), GenerateError> { - if state.test.convention == CallingConvention::Vectorcall { + fn write_harness_prefix(&self, f: &mut Fivemat, state: &TestImpl) -> Result<(), GenerateError> { + if state.convention == CallingConvention::Vectorcall { writeln!(f, "#![feature(abi_vectorcall)]")?; } // Load test harness "headers" @@ -938,10 +878,10 @@ impl RustcAbiImpl { fn generate_signature( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, func: FuncIdx, ) -> Result<(), GenerateError> { - let function = state.test.typed.realize_func(func); + let function = state.types.realize_func(func); write!(f, "fn {}(", function.name)?; let mut multiarg = false; @@ -998,7 +938,7 @@ impl RustcAbiImpl { fn create_var( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, var_name: &str, var_ty: TyIdx, val_idx: &mut usize, @@ -1036,7 +976,7 @@ impl RustcAbiImpl { fn write_var( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, var_name: &str, var_ty: TyIdx, to: &str, @@ -1060,12 +1000,12 @@ impl RustcAbiImpl { fn write_fields( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, to: &str, from: &str, var_ty: TyIdx, ) -> Result<(), GenerateError> { - match state.test.typed.realize_ty(var_ty) { + match state.types.realize_ty(var_ty) { Ty::Primitive(_) | Ty::Enum(_) => { // Hey an actual leaf, report it self.write_leaf_field(f, state, to, from)?; @@ -1079,7 +1019,7 @@ impl RustcAbiImpl { } Ty::Pun(pun) => { // keep going but with the type changed - let real_ty = state.test.typed.resolve_pun(pun, &state.test.env).unwrap(); + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); self.write_fields(f, state, to, from, real_ty)? } Ty::Array(array_ty) => { @@ -1150,7 +1090,7 @@ impl RustcAbiImpl { fn write_leaf_field( &self, f: &mut Fivemat, - state: &GenState, + state: &TestImpl, to: &str, path: &str, ) -> Result<(), GenerateError> { @@ -1171,7 +1111,7 @@ impl RustcAbiImpl { fn end_function( &self, f: &mut dyn Write, - state: &GenState, + state: &TestImpl, inputs: &str, outputs: &str, ) -> Result<(), GenerateError> { @@ -1189,7 +1129,7 @@ impl RustcAbiImpl { fn pass_var( &self, f: &mut dyn Write, - state: &GenState, + state: &TestImpl, var_name: &str, var_ty: TyIdx, ) -> Result<(), GenerateError> { @@ -1200,7 +1140,7 @@ impl RustcAbiImpl { fn return_var( &self, f: &mut dyn Write, - state: &GenState, + state: &TestImpl, var_name: &str, var_ty: TyIdx, ) -> Result<(), GenerateError> { @@ -1210,16 +1150,6 @@ impl RustcAbiImpl { } } -fn gen_state(test: &TestImpl) -> GenState { - GenState { - test, - tynames: HashMap::new(), - borrowed_tynames: HashMap::new(), - funcs: vec![], - val_writer: WriteImpl::HarnessCallback, - } -} - /// For a given primitive type, generate an instance /// where all the high nybbles of each byte is val_idx /// and all the low nybbles are the number byte. diff --git a/src/fivemat.rs b/src/fivemat.rs index d5852af..220d92e 100644 --- a/src/fivemat.rs +++ b/src/fivemat.rs @@ -25,9 +25,6 @@ impl<'a> Fivemat<'a> { pub fn sub_indent(&mut self, count: usize) { self.indent -= count; } - pub fn offset_indent(&mut self, count: isize) { - self.indent = (self.indent as isize + count) as usize; - } pub fn ensure_indent(&mut self) -> std::fmt::Result { if !self.indent_pending { return Ok(()); diff --git a/src/harness/mod.rs b/src/harness/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/main.rs b/src/main.rs index ea51cf6..d9a04e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,13 +5,11 @@ mod fivemat; mod report; use abis::*; -use kdl_script::types::Arg; use kdl_script::types::Ty; use kdl_script::types::TyIdx; use kdl_script::PunEnv; use kdl_script::TypedProgram; use linked_hash_map::LinkedHashMap; -use log::warn; use report::*; use serde::Serialize; use std::collections::HashMap; @@ -174,8 +172,8 @@ fn main() -> Result<(), Box> { convention: convention_name.to_owned(), caller_id: caller_id.to_owned(), callee_id: callee_id.to_owned(), - caller_variant: test.abi_variant(caller).unwrap(), - callee_variant: test.abi_variant(callee).unwrap(), + caller_variant: test.for_abi(caller).unwrap(), + callee_variant: test.for_abi(callee).unwrap(), }; let rules = get_test_rules(&test_key, caller, callee); let results = do_test( @@ -326,7 +324,7 @@ fn read_test_manifest(test_file: &Path) -> Result { if ext == "kdl" { let mut compiler = kdl_script::Compiler::new(); - let program = compiler.compile_string(&test_file.to_string_lossy(), input)?; + let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; Ok(Test { name: test_file .file_stem() @@ -334,7 +332,7 @@ fn read_test_manifest(test_file: &Path) -> Result { .to_str() .expect("test filename wasn't utf8") .to_owned(), - program, + types, }) } else { Err(GenerateError::Skipped) @@ -398,9 +396,11 @@ fn generate_test_src( let mut caller_output_string = String::new(); caller.generate_caller( &mut caller_output_string, - test, - &test_key.caller_variant, - convention, + test_key.caller_variant.for_impl( + convention, + test_key.caller_variant.types.all_funcs(), + WriteImpl::HarnessCallback, + )?, )?; caller_output.write_all(caller_output_string.as_bytes())?; @@ -408,9 +408,11 @@ fn generate_test_src( let mut callee_output_string = String::new(); callee.generate_callee( &mut callee_output_string, - test, - &test_key.callee_variant, - convention, + test_key.callee_variant.for_impl( + convention, + test_key.callee_variant.types.all_funcs(), + WriteImpl::HarnessCallback, + )?, )?; callee_output.write_all(callee_output_string.as_bytes())?; } @@ -626,7 +628,7 @@ fn run_dynamic_test( // As a basic sanity-check, make sure everything agrees on how // many tests actually executed. If this fails, then something // is very fundamentally broken and needs to be fixed. - let all_func_ids = test.program.all_funcs().collect::>(); + let all_func_ids = test.types.all_funcs().collect::>(); let expected_test_count = all_func_ids.len(); if caller_inputs.funcs.len() != expected_test_count || caller_outputs.funcs.len() != expected_test_count @@ -758,7 +760,7 @@ fn run_dynamic_test( let empty_func = Vec::new(); let empty_arg = Vec::new(); for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { - let func = test.program.realize_func(func_id); + let func = test.types.realize_func(func_id); let caller_func = caller.entry(func.name.clone()).or_default(); let callee_func = callee.entry(func.name.clone()).or_default(); for (arg_idx, arg) in func.inputs.iter().enumerate() { @@ -779,7 +781,7 @@ fn run_dynamic_test( .unwrap_or(&empty_arg); add_field( - &test.program, + &test.types, &test_key.caller_variant.env, caller_arg_bytes, caller_arg, @@ -788,7 +790,7 @@ fn run_dynamic_test( arg.ty, ); add_field( - &test.program, + &test.types, &test_key.callee_variant.env, callee_arg_bytes, callee_arg, @@ -816,7 +818,7 @@ fn run_dynamic_test( .unwrap_or(&empty_arg); add_field( - &test.program, + &test.types, &test_key.caller_variant.env, caller_output_bytes, caller_arg, @@ -825,7 +827,7 @@ fn run_dynamic_test( arg.ty, ); add_field( - &test.program, + &test.types, &test_key.callee_variant.env, callee_output_bytes, callee_arg, @@ -981,9 +983,9 @@ fn check_test( // useful to keep a version of this near the actual compilation/execution // in case the compilers spit anything interesting to stdout/stderr. let names = test - .program + .types .all_funcs() - .map(|func_id| full_subtest_name(test_key, &test.program.realize_func(func_id).name)) + .map(|func_id| full_subtest_name(test_key, &test.types.realize_func(func_id).name)) .collect::>(); let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); let num_passed = results.iter().filter(|r| r.is_ok()).count(); diff --git a/src/report.rs b/src/report.rs index 32fc525..0ef1d45 100644 --- a/src/report.rs +++ b/src/report.rs @@ -190,9 +190,9 @@ pub struct TestKey { pub caller_id: String, pub callee_id: String, #[serde(skip)] - pub caller_variant: TestVariant, + pub caller_variant: TestForAbi, #[serde(skip)] - pub callee_variant: TestVariant, + pub callee_variant: TestForAbi, } #[derive(Debug, Clone, Serialize)] From 05dd9e7a510b7af3d070cd2fcfb8bf130f9e5f80 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 4 May 2024 12:58:52 -0400 Subject: [PATCH 12/44] break up into more files --- src/abis/mod.rs | 40 +- src/abis/rust.rs | 2 + src/error.rs | 92 +++++ src/harness/build.rs | 79 ++++ src/harness/check.rs | 172 +++++++++ src/harness/generate.rs | 93 +++++ src/harness/mod.rs | 40 ++ src/harness/read.rs | 63 +++ src/harness/run.rs | 378 ++++++++++++++++++ src/main.rs | 830 +--------------------------------------- src/report.rs | 144 +++---- 11 files changed, 1002 insertions(+), 931 deletions(-) create mode 100644 src/error.rs create mode 100644 src/harness/build.rs create mode 100644 src/harness/check.rs create mode 100644 src/harness/generate.rs create mode 100644 src/harness/read.rs create mode 100644 src/harness/run.rs diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 7e31f6e..719304d 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -10,7 +10,7 @@ use kdl_script::{ }; pub use rust::RustcAbiImpl; -use crate::BuildError; +use crate::error::{BuildError, GenerateError}; pub static ABI_IMPL_RUSTC: &str = "rustc"; pub static ABI_IMPL_CC: &str = "cc"; @@ -179,44 +179,6 @@ impl TestForAbi { } } -#[derive(Debug, thiserror::Error)] -#[allow(dead_code)] -pub enum GenerateError { - #[error("io error\n{0}")] - Fmt(#[from] std::fmt::Error), - #[error("io error\n{0}")] - Io(#[from] std::io::Error), - #[error("parse error {0}\n{2}\n{}\n{:width$}^", - .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), - "", - width=.2.position.col.saturating_sub(1), - )] - ParseError(String, String, ron::error::Error), - #[error("kdl parse error {}", .2)] - KdlParseError(String, String, kdl::KdlError), - #[error("kdl-script error {0}")] - KdlScriptError(#[from] kdl_script::KdlScriptError), - #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] - InconsistentStructDefinition { - name: String, - old_decl: String, - new_decl: String, - }, - #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] - HandwrittenMixing, - #[error("No handwritten source for this pairing (skipping)")] - NoHandwrittenSource, - #[error("Unsupported Signature For Rust: {0}")] - RustUnsupported(String), - #[error("Unsupported Signature For C: {0}")] - CUnsupported(String), - #[error("ABI impl doesn't support this calling convention.")] - UnsupportedConvention, - /// Used to signal we just skipped it - #[error("")] - Skipped, -} - #[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] pub enum CallingConvention { // These conventions are special ones that "desugar" to others diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 6cc213c..4579796 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,6 +5,8 @@ use std::sync::Arc; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; +use self::error::GenerateError; + use super::super::*; use super::*; use crate::fivemat::Fivemat; diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..84977ab --- /dev/null +++ b/src/error.rs @@ -0,0 +1,92 @@ +use crate::OUTPUT_NAME; + +#[derive(Debug, thiserror::Error)] +#[allow(dead_code)] +pub enum GenerateError { + #[error("io error\n{0}")] + Fmt(#[from] std::fmt::Error), + #[error("io error\n{0}")] + Io(#[from] std::io::Error), + #[error("parse error {0}\n{2}\n{}\n{:width$}^", + .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), + "", + width=.2.position.col.saturating_sub(1), + )] + ParseError(String, String, ron::error::Error), + #[error("kdl parse error {}", .2)] + KdlParseError(String, String, kdl::KdlError), + #[error("kdl-script error {0}")] + KdlScriptError(#[from] kdl_script::KdlScriptError), + #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] + InconsistentStructDefinition { + name: String, + old_decl: String, + new_decl: String, + }, + #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] + HandwrittenMixing, + #[error("No handwritten source for this pairing (skipping)")] + NoHandwrittenSource, + #[error("Unsupported Signature For Rust: {0}")] + RustUnsupported(String), + #[error("Unsupported Signature For C: {0}")] + CUnsupported(String), + #[error("ABI impl doesn't support this calling convention.")] + UnsupportedConvention, + /// Used to signal we just skipped it + #[error("")] + Skipped, +} + +#[derive(Debug, thiserror::Error)] +pub enum BuildError { + #[error("io error\n{0}")] + Io(#[from] std::io::Error), + #[error("rust compile error \n{} \n{}", + std::str::from_utf8(&.0.stdout).unwrap(), + std::str::from_utf8(&.0.stderr).unwrap())] + RustCompile(std::process::Output), + #[error("c compile errror\n{0}")] + CCompile(#[from] cc::Error), +} + +#[allow(clippy::enum_variant_names)] +#[derive(Debug, thiserror::Error)] +pub enum CheckFailure { + #[error("test {0} {5} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}")] + InputFieldMismatch(usize, usize, usize, Vec, Vec, String), + #[error( + "test {0} {} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}", + OUTPUT_NAME + )] + OutputFieldMismatch(usize, usize, usize, Vec, Vec), + #[error("test {0} {4} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}")] + InputFieldCountMismatch(usize, usize, Vec>, Vec>, String), + #[error( + "test {0} {} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}", + OUTPUT_NAME + )] + OutputFieldCountMismatch(usize, usize, Vec>, Vec>), + #[error("test {0} input count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] + InputCountMismatch(usize, Vec>>, Vec>>), + #[error("test {0} output count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] + OutputCountMismatch(usize, Vec>>, Vec>>), +} + +#[derive(Debug, thiserror::Error)] +pub enum LinkError { + #[error("io error\n{0}")] + Io(#[from] std::io::Error), + #[error("rust link error \n{} \n{}", + std::str::from_utf8(&.0.stdout).unwrap(), + std::str::from_utf8(&.0.stderr).unwrap())] + RustLink(std::process::Output), +} + +#[derive(Debug, thiserror::Error)] +pub enum RunError { + #[error("test loading error (dynamic linking failed)\n{0}")] + LoadError(#[from] libloading::Error), + #[error("wrong number of tests reported! \nExpected {0} \nGot (caller_in: {1}, caller_out: {2}, callee_in: {3}, callee_out: {4})")] + TestCountMismatch(usize, usize, usize, usize, usize), +} diff --git a/src/harness/build.rs b/src/harness/build.rs new file mode 100644 index 0000000..6720ad9 --- /dev/null +++ b/src/harness/build.rs @@ -0,0 +1,79 @@ +use std::path::PathBuf; +use std::process::Command; + +use crate::error::*; +use crate::harness::full_test_name; +use crate::report::*; +use crate::{built_info, AbiImpl, Test, TestKey}; + +pub fn build_test( + _test: &Test, + test_key: &TestKey, + caller: &dyn AbiImpl, + callee: &dyn AbiImpl, + src: &GenerateOutput, +) -> Result { + let test_name = &test_key.test_name; + let convention_name = &test_key.convention; + let full_test_name = full_test_name(test_key); + let caller_id = &test_key.caller_id; + let callee_id = &test_key.callee_id; + eprintln!("compiling {full_test_name}"); + + let caller_lib = format!("{test_name}_{convention_name}_{caller_id}_caller"); + let callee_lib = format!("{test_name}_{convention_name}_{callee_id}_callee"); + + // Compile the tests (and let them change the lib name). + let caller_lib = caller.compile_caller(&src.caller_src, &caller_lib)?; + let callee_lib = callee.compile_callee(&src.callee_src, &callee_lib)?; + + Ok(BuildOutput { + caller_lib, + callee_lib, + }) +} + +/// Compile and link the test harness with the two sides of the FFI boundary. +pub fn link_test( + _test: &Test, + test_key: &TestKey, + build: &BuildOutput, +) -> Result { + let test_name = &test_key.test_name; + let caller_id = &test_key.caller_id; + let callee_id = &test_key.callee_id; + let full_test_name = full_test_name(test_key); + let src = PathBuf::from("harness/harness.rs"); + let output = format!("target/temp/{test_name}_{caller_id}_calls_{callee_id}_harness.dll"); + eprintln!("linking {full_test_name}"); + + let mut cmd = Command::new("rustc"); + cmd.arg("-v") + .arg("-L") + .arg("target/temp/") + .arg("-l") + .arg(&build.caller_lib) + .arg("-l") + .arg(&build.callee_lib) + .arg("--crate-type") + .arg("cdylib") + .arg("--target") + .arg(built_info::TARGET) + // .arg("-Csave-temps=y") + // .arg("--out-dir") + // .arg("target/temp/") + .arg("-o") + .arg(&output) + .arg(&src); + + eprintln!("running: {:?}", cmd); + let out = cmd.output()?; + + if !out.status.success() { + Err(LinkError::RustLink(out)) + } else { + Ok(LinkOutput { + test_bin: PathBuf::from(output), + }) + } +} diff --git a/src/harness/check.rs b/src/harness/check.rs new file mode 100644 index 0000000..9ae6a8a --- /dev/null +++ b/src/harness/check.rs @@ -0,0 +1,172 @@ +use crate::error::*; +use crate::harness::full_subtest_name; +use crate::report::*; +use crate::Test; + +pub fn check_test( + test: &Test, + test_key: &TestKey, + RunOutput { + caller_inputs, + caller_outputs, + callee_inputs, + callee_outputs, + .. + }: &RunOutput, +) -> CheckOutput { + // Now check the results + + // Start peeling back the layers of the buffers. + // funcs (subtests) -> vals (args/returns) -> fields -> bytes + + let mut results: Vec> = Vec::new(); + + // Layer 1 is the funcs/subtests. Because we have already checked + // that they agree on their lengths, we can zip them together + // to walk through their views of each subtest's execution. + 'funcs: for (func_idx, (((caller_inputs, caller_outputs), callee_inputs), callee_outputs)) in + caller_inputs + .funcs + .iter() + .zip(&caller_outputs.funcs) + .zip(&callee_inputs.funcs) + .zip(&callee_outputs.funcs) + .enumerate() + { + // Now we must enforce that the caller and callee agree on how + // many inputs and outputs there were. If this fails that's a + // very fundamental issue, and indicative of a bad test generator. + if caller_inputs.len() != callee_inputs.len() { + results.push(Err(CheckFailure::InputCountMismatch( + func_idx, + caller_inputs.clone(), + callee_inputs.clone(), + ))); + continue 'funcs; + } + if caller_outputs.len() != callee_outputs.len() { + results.push(Err(CheckFailure::OutputCountMismatch( + func_idx, + caller_outputs.clone(), + callee_outputs.clone(), + ))); + continue 'funcs; + } + + // Layer 2 is the values (arguments/returns). + // The inputs and outputs loop do basically the same work, + // but are separate for the sake of error-reporting quality. + + // Process Inputs + for (input_idx, (caller_val, callee_val)) in + caller_inputs.iter().zip(callee_inputs).enumerate() + { + // Now we must enforce that the caller and callee agree on how + // many fields each value had. + if caller_val.len() != callee_val.len() { + results.push(Err(CheckFailure::InputFieldCountMismatch( + func_idx, + input_idx, + caller_val.clone(), + callee_val.clone(), + String::from("todo"), + ))); + continue 'funcs; + } + + // Layer 3 is the leaf subfields of the values. + // At this point we just need to assert that they agree on the bytes. + for (field_idx, (caller_field, callee_field)) in + caller_val.iter().zip(callee_val).enumerate() + { + if caller_field != callee_field { + results.push(Err(CheckFailure::InputFieldMismatch( + func_idx, + input_idx, + field_idx, + caller_field.clone(), + callee_field.clone(), + String::from("todo"), + ))); + continue 'funcs; + } + } + } + + // Process Outputs + for (output_idx, (caller_val, callee_val)) in + caller_outputs.iter().zip(callee_outputs).enumerate() + { + // Now we must enforce that the caller and callee agree on how + // many fields each value had. + if caller_val.len() != callee_val.len() { + results.push(Err(CheckFailure::OutputFieldCountMismatch( + func_idx, + output_idx, + caller_val.clone(), + callee_val.clone(), + ))); + continue 'funcs; + } + + // Layer 3 is the leaf subfields of the values. + // At this point we just need to assert that they agree on the bytes. + for (field_idx, (caller_field, callee_field)) in + caller_val.iter().zip(callee_val).enumerate() + { + if caller_field != callee_field { + results.push(Err(CheckFailure::OutputFieldMismatch( + func_idx, + output_idx, + field_idx, + caller_field.clone(), + callee_field.clone(), + ))); + continue 'funcs; + } + } + } + + // If we got this far then the test passes + results.push(Ok(())); + } + + // Report the results of each subtest + // + // This will be done again after all tests have been run, but it's + // useful to keep a version of this near the actual compilation/execution + // in case the compilers spit anything interesting to stdout/stderr. + let names = test + .types + .all_funcs() + .map(|func_id| full_subtest_name(test_key, &test.types.realize_func(func_id).name)) + .collect::>(); + let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); + let num_passed = results.iter().filter(|r| r.is_ok()).count(); + let all_passed = num_passed == results.len(); + + for (subtest_name, result) in names.iter().zip(&results) { + match result { + Ok(()) => { + eprintln!("Test {subtest_name:width$} passed", width = max_name_len); + } + Err(e) => { + eprintln!("Test {subtest_name:width$} failed!", width = max_name_len); + eprintln!("{}", e); + } + } + } + + if all_passed { + eprintln!("all tests passed"); + } else { + eprintln!("only {}/{} tests passed!", num_passed, results.len()); + } + eprintln!(); + + CheckOutput { + all_passed, + subtest_names: names, + subtest_checks: results, + } +} diff --git a/src/harness/generate.rs b/src/harness/generate.rs new file mode 100644 index 0000000..be8582f --- /dev/null +++ b/src/harness/generate.rs @@ -0,0 +1,93 @@ +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; + +use crate::abis::*; +use crate::error::*; +use crate::report::*; + +use super::full_test_name; + +pub fn generate_test_src( + test: &Test, + test_key: &TestKey, + convention: CallingConvention, + caller: &dyn AbiImpl, + callee: &dyn AbiImpl, +) -> Result { + let test_name = &test_key.test_name; + let convention_name = &test_key.convention; + let caller_src_ext = caller.src_ext(); + let callee_src_ext = callee.src_ext(); + let full_test_name = full_test_name(test_key); + let caller_id = &test_key.caller_id; + let callee_id = &test_key.callee_id; + + if !caller.supports_convention(convention) { + eprintln!( + "skipping {full_test_name}: {caller_id} doesn't support convention {convention_name}" + ); + return Err(GenerateError::Skipped); + } + if !callee.supports_convention(convention) { + eprintln!( + "skipping {full_test_name}: {callee_id} doesn't support convention {convention_name}" + ); + return Err(GenerateError::Skipped); + } + + let src_dir = if convention == CallingConvention::Handwritten { + PathBuf::from("handwritten_impls/") + } else { + PathBuf::from("generated_impls/") + }; + + let caller_src = src_dir.join(format!( + "{caller_id}/{test_name}_{convention_name}_{caller_id}_caller.{caller_src_ext}" + )); + let callee_src = src_dir.join(format!( + "{callee_id}/{test_name}_{convention_name}_{callee_id}_callee.{callee_src_ext}" + )); + + if convention == CallingConvention::Handwritten { + if !caller_src.exists() || !callee_src.exists() { + eprintln!("skipping {full_test_name}: source for callee and caller doesn't exist"); + return Err(GenerateError::Skipped); + } + } else { + eprintln!("generating {full_test_name}"); + // If the impl isn't handwritten, then we need to generate it. + std::fs::create_dir_all(&src_dir).unwrap(); + std::fs::remove_dir_all(&src_dir).unwrap(); + std::fs::create_dir_all(caller_src.parent().unwrap())?; + std::fs::create_dir_all(callee_src.parent().unwrap())?; + let mut caller_output = File::create(&caller_src)?; + let mut caller_output_string = String::new(); + caller.generate_caller( + &mut caller_output_string, + test_key.caller_variant.for_impl( + convention, + test_key.caller_variant.types.all_funcs(), + WriteImpl::HarnessCallback, + )?, + )?; + caller_output.write_all(caller_output_string.as_bytes())?; + + let mut callee_output = File::create(&callee_src)?; + let mut callee_output_string = String::new(); + callee.generate_callee( + &mut callee_output_string, + test_key.callee_variant.for_impl( + convention, + test_key.callee_variant.types.all_funcs(), + WriteImpl::HarnessCallback, + )?, + )?; + callee_output.write_all(callee_output_string.as_bytes())?; + } + + Ok(GenerateOutput { + caller_src, + callee_src, + }) +} diff --git a/src/harness/mod.rs b/src/harness/mod.rs index e69de29..b33135d 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -0,0 +1,40 @@ +use crate::TestKey; + +mod build; +mod check; +mod generate; +mod read; +mod run; + +pub use build::{build_test, link_test}; +pub use check::check_test; +pub use generate::generate_test_src; +pub use read::read_tests; +pub use run::{run_dynamic_test, WriteBuffer}; + +/// The name of a test for pretty-printing. +pub fn full_test_name( + TestKey { + test_name, + convention, + caller_id, + callee_id, + .. + }: &TestKey, +) -> String { + format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}") +} + +/// The name of a subtest for pretty-printing. +pub fn full_subtest_name( + TestKey { + test_name, + convention, + caller_id, + callee_id, + .. + }: &TestKey, + func_name: &str, +) -> String { + format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}::{func_name}") +} diff --git a/src/harness/read.rs b/src/harness/read.rs new file mode 100644 index 0000000..70a7cb3 --- /dev/null +++ b/src/harness/read.rs @@ -0,0 +1,63 @@ +use std::{ + fs::File, + io::{BufReader, Read}, + path::{Path, PathBuf}, +}; + +use crate::{error::*, Test}; + +pub fn read_tests() -> Result, GenerateError> { + let mut tests = vec![]; + let mut dirs = vec![PathBuf::from("tests")]; + while let Some(dir) = dirs.pop() { + for entry in std::fs::read_dir(dir)? { + let entry = entry?; + + // If it's a dir, add it to the working set + if entry.file_type()?.is_dir() { + dirs.push(entry.path()); + continue; + } + + // Otherwise, assume it's a test and parse it + let test = match read_test_manifest(&entry.path()) { + Ok(test) => test, + Err(e) => { + eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); + continue; + } + }; + tests.push(test); + } + } + tests.sort_by(|t1, t2| t1.name.cmp(&t2.name)); + // FIXME: assert test names don't collide! + + Ok(tests) +} + +/// Read a test .kdl file +pub fn read_test_manifest(test_file: &Path) -> Result { + let file = File::open(&test_file)?; + let mut reader = BufReader::new(file); + let mut input = String::new(); + reader.read_to_string(&mut input)?; + + let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); + + if ext == "kdl" { + let mut compiler = kdl_script::Compiler::new(); + let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; + Ok(Test { + name: test_file + .file_stem() + .expect("test had no filename") + .to_str() + .expect("test filename wasn't utf8") + .to_owned(), + types, + }) + } else { + Err(GenerateError::Skipped) + } +} diff --git a/src/harness/run.rs b/src/harness/run.rs new file mode 100644 index 0000000..1ee5a83 --- /dev/null +++ b/src/harness/run.rs @@ -0,0 +1,378 @@ +//! The runtime actual types and functions that are injected into +//! compiled tests. + +use kdl_script::types::{Ty, TyIdx}; +use kdl_script::{PunEnv, TypedProgram}; +use linked_hash_map::LinkedHashMap; +use serde::Serialize; + +use crate::error::*; +use crate::harness::full_test_name; +use crate::report::*; +use crate::{LinkOutput, Test, TestKey}; + +/// Tests write back the raw bytes of their values to a WriteBuffer. +/// +/// This hierarchical design is confusing as hell, but represents the +/// nested levels of abstraction we are concerned with: +/// +/// subtests (functions) => values (args/returns) => subfields => bytes. +/// +/// Having this much hierarchy means that we can specifically say +/// "ah yeah, on test 3 the two sides disagreed on arg2.field1.field2" +/// and also reduces the chance of failures in one test "cascading" +/// into the subsequent ones. +#[derive(Debug, Serialize)] +pub struct WriteBuffer { + pub funcs: Vec>>>, +} + +impl WriteBuffer { + fn new() -> Self { + // Preload the hierarchy for the first test. + WriteBuffer { + funcs: vec![vec![vec![]]], + } + } + fn finish_tests(&mut self) { + // Remove the pending test + self.funcs.pop(); + } +} + +// The signatures of the interface from our perspective. +// From the test's perspective the WriteBuffers are totally opaque. +pub type WriteCallback = unsafe extern "C" fn(&mut WriteBuffer, *const u8, u32) -> (); +pub type FinishedValCallback = unsafe extern "C" fn(&mut WriteBuffer) -> (); +pub type FinishedFuncCallback = unsafe extern "C" fn(&mut WriteBuffer, &mut WriteBuffer) -> (); +pub type TestInit = unsafe extern "C" fn( + WriteCallback, + FinishedValCallback, + FinishedFuncCallback, + &mut WriteBuffer, + &mut WriteBuffer, + &mut WriteBuffer, + &mut WriteBuffer, +) -> (); + +pub unsafe extern "C" fn write_field(output: &mut WriteBuffer, input: *const u8, size: u32) { + // Push the bytes of an individual field + let data = std::slice::from_raw_parts(input, size as usize); + output + .funcs + .last_mut() // values + .unwrap() + .last_mut() // fields + .unwrap() + .push(data.to_vec()); +} +pub unsafe extern "C" fn finished_val(output: &mut WriteBuffer) { + // This value is finished, push a new entry + output + .funcs + .last_mut() // values + .unwrap() + .push(vec![]); +} +pub unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut WriteBuffer) { + // Remove the pending value + output1 + .funcs + .last_mut() // values + .unwrap() + .pop() + .unwrap(); + output2 + .funcs + .last_mut() // values + .unwrap() + .pop() + .unwrap(); + + // Push a new pending function + output1.funcs.push(vec![vec![]]); + output2.funcs.push(vec![vec![]]); +} + +/// Run the test! +/// +/// See the README for a high-level description of this design. +pub fn run_dynamic_test( + test: &Test, + test_key: &TestKey, + test_dylib: &LinkOutput, +) -> Result { + // Initialize all the buffers the tests will write to + let mut caller_inputs = WriteBuffer::new(); + let mut caller_outputs = WriteBuffer::new(); + let mut callee_inputs = WriteBuffer::new(); + let mut callee_outputs = WriteBuffer::new(); + + unsafe { + let full_test_name = full_test_name(test_key); + + // Load the dylib of the test, and get its test_start symbol + eprintln!("loading: {}", &test_dylib.test_bin.display()); + let lib = libloading::Library::new(&test_dylib.test_bin)?; + let do_test: libloading::Symbol = lib.get(b"test_start")?; + eprintln!("running {full_test_name}"); + + // Actually run the test! + do_test( + write_field, + finished_val, + finished_func, + &mut caller_inputs, + &mut caller_outputs, + &mut callee_inputs, + &mut callee_outputs, + ); + + // Finalize the buffers (clear all the pending values). + caller_inputs.finish_tests(); + caller_outputs.finish_tests(); + callee_inputs.finish_tests(); + callee_outputs.finish_tests(); + } + + digest_test_run( + test, + test_key, + caller_inputs, + caller_outputs, + callee_inputs, + callee_outputs, + ) +} + +fn digest_test_run( + test: &Test, + test_key: &TestKey, + caller_inputs: WriteBuffer, + caller_outputs: WriteBuffer, + callee_inputs: WriteBuffer, + callee_outputs: WriteBuffer, +) -> Result { + let mut callee = Functions::new(); + let mut caller = Functions::new(); + + // As a basic sanity-check, make sure everything agrees on how + // many tests actually executed. If this fails, then something + // is very fundamentally broken and needs to be fixed. + let all_func_ids = test.types.all_funcs().collect::>(); + let expected_test_count = all_func_ids.len(); + if caller_inputs.funcs.len() != expected_test_count + || caller_outputs.funcs.len() != expected_test_count + || callee_inputs.funcs.len() != expected_test_count + || callee_outputs.funcs.len() != expected_test_count + { + return Err(RunError::TestCountMismatch( + expected_test_count, + caller_inputs.funcs.len(), + caller_outputs.funcs.len(), + callee_inputs.funcs.len(), + callee_outputs.funcs.len(), + )); + } + + let empty_func = Vec::new(); + let empty_arg = Vec::new(); + for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { + let func = test.types.realize_func(func_id); + let caller_func = caller.entry(func.name.clone()).or_default(); + let callee_func = callee.entry(func.name.clone()).or_default(); + for (arg_idx, arg) in func.inputs.iter().enumerate() { + let caller_arg = caller_func.entry(arg.name.clone()).or_default(); + let callee_arg = callee_func.entry(arg.name.clone()).or_default(); + + let caller_arg_bytes = caller_inputs + .funcs + .get(func_idx) + .unwrap_or(&empty_func) + .get(arg_idx) + .unwrap_or(&empty_arg); + let callee_arg_bytes = callee_inputs + .funcs + .get(func_idx) + .unwrap_or(&empty_func) + .get(arg_idx) + .unwrap_or(&empty_arg); + + add_field( + &test.types, + &test_key.caller_variant.env, + caller_arg_bytes, + caller_arg, + &mut 0, + String::new(), + arg.ty, + ); + add_field( + &test.types, + &test_key.callee_variant.env, + callee_arg_bytes, + callee_arg, + &mut 0, + String::new(), + arg.ty, + ); + } + + for (arg_idx, arg) in func.outputs.iter().enumerate() { + let caller_arg = caller_func.entry(arg.name.clone()).or_default(); + let callee_arg = callee_func.entry(arg.name.clone()).or_default(); + + let caller_output_bytes = caller_outputs + .funcs + .get(func_idx) + .unwrap_or(&empty_func) + .get(arg_idx) + .unwrap_or(&empty_arg); + let callee_output_bytes = callee_outputs + .funcs + .get(func_idx) + .unwrap_or(&empty_func) + .get(arg_idx) + .unwrap_or(&empty_arg); + + add_field( + &test.types, + &test_key.caller_variant.env, + caller_output_bytes, + caller_arg, + &mut 0, + String::new(), + arg.ty, + ); + add_field( + &test.types, + &test_key.callee_variant.env, + callee_output_bytes, + callee_arg, + &mut 0, + String::new(), + arg.ty, + ); + } + } + + Ok(RunOutput { + callee, + caller, + caller_inputs, + caller_outputs, + callee_inputs, + callee_outputs, + }) +} + +fn format_bytes(input: &[Vec], cur_idx: &mut usize) -> String { + use std::fmt::Write; + + let bytes = input.get(*cur_idx).map(|v| &v[..]).unwrap_or(&[]); + let mut output = String::new(); + let mut looped = false; + for byte in bytes { + if looped { + write!(&mut output, " ").unwrap(); + } + write!(&mut output, "{:02x}", byte).unwrap(); + looped = true; + } + *cur_idx += 1; + output +} + +/// Recursive subroutine of write_var, which builds up rvalue paths and generates +/// appropriate match statements. Actual WRITE calls are done by write_leaf_field. +fn add_field( + program: &TypedProgram, + env: &PunEnv, + input: &[Vec], + output: &mut LinkedHashMap, + cur_idx: &mut usize, + cur_path: String, + var_ty: TyIdx, +) { + match program.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it + output.insert(cur_path, format_bytes(input, cur_idx)); + *cur_idx += 1; + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + add_field( + program, + env, + input, + output, + cur_idx, + cur_path, + alias_ty.real, + ); + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = program.resolve_pun(pun, env).unwrap(); + add_field(program, env, input, output, cur_idx, cur_path, real_ty); + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{cur_path}[{i}]"); + add_field(program, env, input, output, cur_idx, base, array_ty.elem_ty); + } + } + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{cur_path}.{field_name}"); + add_field(program, env, input, output, cur_idx, base, field.ty); + } + } + Ty::Tagged(tagged_ty) => { + // FIXME(variant_select): hardcoded to access variant 0 for now + if let Some(variant) = tagged_ty.variants.get(0) { + if let Some(fields) = &variant.fields { + for field in fields { + add_field( + program, + env, + input, + output, + cur_idx, + field.ident.to_string(), + field.ty, + ); + } + } + } + } + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{cur_path})"); + add_field( + program, + env, + input, + output, + cur_idx, + base, + ref_ty.pointee_ty, + ); + } + Ty::Union(union_ty) => { + // FIXME(variant_select): hardcoded to access field 0 for now + if let Some(field) = union_ty.fields.get(0) { + let field_name = &field.ident; + let base = format!("{cur_path}.{field_name}"); + add_field(program, env, input, output, cur_idx, base, field.ty); + } + } + } +} diff --git a/src/main.rs b/src/main.rs index d9a04e2..8b0e31b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,24 +1,19 @@ mod abis; mod cli; +mod error; mod fivemat; +mod harness; + // mod procgen; mod report; use abis::*; -use kdl_script::types::Ty; -use kdl_script::types::TyIdx; -use kdl_script::PunEnv; -use kdl_script::TypedProgram; -use linked_hash_map::LinkedHashMap; +use error::*; +use harness::*; use report::*; -use serde::Serialize; use std::collections::HashMap; use std::env; use std::error::Error; -use std::fs::File; -use std::io::BufReader; -use std::io::Read; -use std::io::Write; use std::path::{Path, PathBuf}; use std::process::Command; @@ -102,32 +97,8 @@ fn main() -> Result<(), Box> { eprintln!("configured ABIs!"); // Grab all the tests - let mut tests = vec![]; - let mut dirs = vec![PathBuf::from("tests")]; - while let Some(dir) = dirs.pop() { - for entry in std::fs::read_dir(dir)? { - let entry = entry?; - - // If it's a dir, add it to the working set - if entry.file_type()?.is_dir() { - dirs.push(entry.path()); - continue; - } - - // Otherwise, assume it's a test and parse it - let test = match read_test_manifest(&entry.path()) { - Ok(test) => test, - Err(e) => { - eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); - continue; - } - }; - tests.push(test); - } - } - tests.sort_by(|t1, t2| t1.name.cmp(&t2.name)); + let tests = read_tests()?; eprintln!("got tests!"); - // FIXME: assert test names don't collide! // Run the tests use TestConclusion::*; @@ -312,792 +283,3 @@ fn do_test( run_results } - -/// Read a test .ron file -fn read_test_manifest(test_file: &Path) -> Result { - let file = File::open(&test_file)?; - let mut reader = BufReader::new(file); - let mut input = String::new(); - reader.read_to_string(&mut input)?; - - let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); - - if ext == "kdl" { - let mut compiler = kdl_script::Compiler::new(); - let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; - Ok(Test { - name: test_file - .file_stem() - .expect("test had no filename") - .to_str() - .expect("test filename wasn't utf8") - .to_owned(), - types, - }) - } else { - Err(GenerateError::Skipped) - } -} - -fn generate_test_src( - test: &Test, - test_key: &TestKey, - convention: CallingConvention, - caller: &dyn AbiImpl, - callee: &dyn AbiImpl, -) -> Result { - let test_name = &test_key.test_name; - let convention_name = &test_key.convention; - let caller_src_ext = caller.src_ext(); - let callee_src_ext = callee.src_ext(); - let full_test_name = full_test_name(test_key); - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; - - if !caller.supports_convention(convention) { - eprintln!( - "skipping {full_test_name}: {caller_id} doesn't support convention {convention_name}" - ); - return Err(GenerateError::Skipped); - } - if !callee.supports_convention(convention) { - eprintln!( - "skipping {full_test_name}: {callee_id} doesn't support convention {convention_name}" - ); - return Err(GenerateError::Skipped); - } - - let src_dir = if convention == CallingConvention::Handwritten { - PathBuf::from("handwritten_impls/") - } else { - PathBuf::from("generated_impls/") - }; - - let caller_src = src_dir.join(format!( - "{caller_id}/{test_name}_{convention_name}_{caller_id}_caller.{caller_src_ext}" - )); - let callee_src = src_dir.join(format!( - "{callee_id}/{test_name}_{convention_name}_{callee_id}_callee.{callee_src_ext}" - )); - - if convention == CallingConvention::Handwritten { - if !caller_src.exists() || !callee_src.exists() { - eprintln!("skipping {full_test_name}: source for callee and caller doesn't exist"); - return Err(GenerateError::Skipped); - } - } else { - eprintln!("generating {full_test_name}"); - // If the impl isn't handwritten, then we need to generate it. - std::fs::create_dir_all(&src_dir).unwrap(); - std::fs::remove_dir_all(&src_dir).unwrap(); - std::fs::create_dir_all(caller_src.parent().unwrap())?; - std::fs::create_dir_all(callee_src.parent().unwrap())?; - let mut caller_output = File::create(&caller_src)?; - let mut caller_output_string = String::new(); - caller.generate_caller( - &mut caller_output_string, - test_key.caller_variant.for_impl( - convention, - test_key.caller_variant.types.all_funcs(), - WriteImpl::HarnessCallback, - )?, - )?; - caller_output.write_all(caller_output_string.as_bytes())?; - - let mut callee_output = File::create(&callee_src)?; - let mut callee_output_string = String::new(); - callee.generate_callee( - &mut callee_output_string, - test_key.callee_variant.for_impl( - convention, - test_key.callee_variant.types.all_funcs(), - WriteImpl::HarnessCallback, - )?, - )?; - callee_output.write_all(callee_output_string.as_bytes())?; - } - - Ok(GenerateOutput { - caller_src, - callee_src, - }) -} - -fn build_test( - _test: &Test, - test_key: &TestKey, - caller: &dyn AbiImpl, - callee: &dyn AbiImpl, - src: &GenerateOutput, -) -> Result { - let test_name = &test_key.test_name; - let convention_name = &test_key.convention; - let full_test_name = full_test_name(test_key); - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; - eprintln!("compiling {full_test_name}"); - - let caller_lib = format!("{test_name}_{convention_name}_{caller_id}_caller"); - let callee_lib = format!("{test_name}_{convention_name}_{callee_id}_callee"); - - // Compile the tests (and let them change the lib name). - let caller_lib = caller.compile_caller(&src.caller_src, &caller_lib)?; - let callee_lib = callee.compile_callee(&src.callee_src, &callee_lib)?; - - Ok(BuildOutput { - caller_lib, - callee_lib, - }) -} - -/// Compile and link the test harness with the two sides of the FFI boundary. -fn link_test( - _test: &Test, - test_key: &TestKey, - build: &BuildOutput, -) -> Result { - let test_name = &test_key.test_name; - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; - let full_test_name = full_test_name(test_key); - let src = PathBuf::from("harness/harness.rs"); - let output = format!("target/temp/{test_name}_{caller_id}_calls_{callee_id}_harness.dll"); - eprintln!("linking {full_test_name}"); - - let mut cmd = Command::new("rustc"); - cmd.arg("-v") - .arg("-L") - .arg("target/temp/") - .arg("-l") - .arg(&build.caller_lib) - .arg("-l") - .arg(&build.callee_lib) - .arg("--crate-type") - .arg("cdylib") - .arg("--target") - .arg(built_info::TARGET) - // .arg("-Csave-temps=y") - // .arg("--out-dir") - // .arg("target/temp/") - .arg("-o") - .arg(&output) - .arg(&src); - - eprintln!("running: {:?}", cmd); - let out = cmd.output()?; - - if !out.status.success() { - Err(LinkError::RustLink(out)) - } else { - Ok(LinkOutput { - test_bin: PathBuf::from(output), - }) - } -} - -/// Tests write back the raw bytes of their values to a WriteBuffer. -/// -/// This hierarchical design is confusing as hell, but represents the -/// nested levels of abstraction we are concerned with: -/// -/// subtests (functions) => values (args/returns) => subfields => bytes. -/// -/// Having this much hierarchy means that we can specifically say -/// "ah yeah, on test 3 the two sides disagreed on arg2.field1.field2" -/// and also reduces the chance of failures in one test "cascading" -/// into the subsequent ones. -#[derive(Debug, Serialize)] -pub struct WriteBuffer { - pub funcs: Vec>>>, -} - -impl WriteBuffer { - fn new() -> Self { - // Preload the hierarchy for the first test. - WriteBuffer { - funcs: vec![vec![vec![]]], - } - } - fn finish_tests(&mut self) { - // Remove the pending test - self.funcs.pop(); - } -} - -/// Run the test! -fn run_dynamic_test( - test: &Test, - test_key: &TestKey, - test_dylib: &LinkOutput, -) -> Result { - // See the README for a high-level description of this design. - - //////////////////////////////////////////////////////////////////// - //////////////////// DEFINING THE TEST HARNESS ///////////////////// - //////////////////////////////////////////////////////////////////// - - // The signatures of the interface from our perspective. - // From the test's perspective the WriteBuffers are totally opaque. - type WriteCallback = unsafe extern "C" fn(&mut WriteBuffer, *const u8, u32) -> (); - type FinishedValCallback = unsafe extern "C" fn(&mut WriteBuffer) -> (); - type FinishedFuncCallback = unsafe extern "C" fn(&mut WriteBuffer, &mut WriteBuffer) -> (); - type TestInit = unsafe extern "C" fn( - WriteCallback, - FinishedValCallback, - FinishedFuncCallback, - &mut WriteBuffer, - &mut WriteBuffer, - &mut WriteBuffer, - &mut WriteBuffer, - ) -> (); - - unsafe extern "C" fn write_field(output: &mut WriteBuffer, input: *const u8, size: u32) { - // Push the bytes of an individual field - let data = std::slice::from_raw_parts(input, size as usize); - output - .funcs - .last_mut() // values - .unwrap() - .last_mut() // fields - .unwrap() - .push(data.to_vec()); - } - unsafe extern "C" fn finished_val(output: &mut WriteBuffer) { - // This value is finished, push a new entry - output - .funcs - .last_mut() // values - .unwrap() - .push(vec![]); - } - unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut WriteBuffer) { - // Remove the pending value - output1 - .funcs - .last_mut() // values - .unwrap() - .pop() - .unwrap(); - output2 - .funcs - .last_mut() // values - .unwrap() - .pop() - .unwrap(); - - // Push a new pending function - output1.funcs.push(vec![vec![]]); - output2.funcs.push(vec![vec![]]); - } - - //////////////////////////////////////////////////////////////////// - //////////////////// THE ACTUAL TEST EXECUTION ///////////////////// - //////////////////////////////////////////////////////////////////// - - unsafe { - let full_test_name = full_test_name(test_key); - // Initialize all the buffers the tests will write to - let mut caller_inputs = WriteBuffer::new(); - let mut caller_outputs = WriteBuffer::new(); - let mut callee_inputs = WriteBuffer::new(); - let mut callee_outputs = WriteBuffer::new(); - - // Load the dylib of the test, and get its test_start symbol - eprintln!("loading: {}", &test_dylib.test_bin.display()); - let lib = libloading::Library::new(&test_dylib.test_bin)?; - let do_test: libloading::Symbol = lib.get(b"test_start")?; - eprintln!("running {full_test_name}"); - - // Actually run the test! - do_test( - write_field, - finished_val, - finished_func, - &mut caller_inputs, - &mut caller_outputs, - &mut callee_inputs, - &mut callee_outputs, - ); - - // Finalize the buffers (clear all the pending values). - caller_inputs.finish_tests(); - caller_outputs.finish_tests(); - callee_inputs.finish_tests(); - callee_outputs.finish_tests(); - - // As a basic sanity-check, make sure everything agrees on how - // many tests actually executed. If this fails, then something - // is very fundamentally broken and needs to be fixed. - let all_func_ids = test.types.all_funcs().collect::>(); - let expected_test_count = all_func_ids.len(); - if caller_inputs.funcs.len() != expected_test_count - || caller_outputs.funcs.len() != expected_test_count - || callee_inputs.funcs.len() != expected_test_count - || callee_outputs.funcs.len() != expected_test_count - { - return Err(RunError::TestCountMismatch( - expected_test_count, - caller_inputs.funcs.len(), - caller_outputs.funcs.len(), - callee_inputs.funcs.len(), - callee_outputs.funcs.len(), - )); - } - - fn format_bytes(input: &[Vec], cur_idx: &mut usize) -> String { - use std::fmt::Write; - - let bytes = input.get(*cur_idx).map(|v| &v[..]).unwrap_or(&[]); - let mut output = String::new(); - let mut looped = false; - for byte in bytes { - if looped { - write!(&mut output, " ").unwrap(); - } - write!(&mut output, "{:02x}", byte).unwrap(); - looped = true; - } - *cur_idx += 1; - output - } - - /// Recursive subroutine of write_var, which builds up rvalue paths and generates - /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. - fn add_field( - program: &TypedProgram, - env: &PunEnv, - input: &[Vec], - output: &mut LinkedHashMap, - cur_idx: &mut usize, - cur_path: String, - var_ty: TyIdx, - ) { - match program.realize_ty(var_ty) { - Ty::Primitive(_) | Ty::Enum(_) => { - // Hey an actual leaf, report it - output.insert(cur_path, format_bytes(input, cur_idx)); - *cur_idx += 1; - } - Ty::Empty => { - // nothing worth producing - } - Ty::Alias(alias_ty) => { - // keep going but with the type changed - add_field( - program, - env, - input, - output, - cur_idx, - cur_path, - alias_ty.real, - ); - } - Ty::Pun(pun) => { - // keep going but with the type changed - let real_ty = program.resolve_pun(pun, env).unwrap(); - add_field(program, env, input, output, cur_idx, cur_path, real_ty); - } - Ty::Array(array_ty) => { - // recurse into each array index - for i in 0..array_ty.len { - let base = format!("{cur_path}[{i}]"); - add_field(program, env, input, output, cur_idx, base, array_ty.elem_ty); - } - } - Ty::Struct(struct_ty) => { - // recurse into each field - for field in &struct_ty.fields { - let field_name = &field.ident; - let base = format!("{cur_path}.{field_name}"); - add_field(program, env, input, output, cur_idx, base, field.ty); - } - } - Ty::Tagged(tagged_ty) => { - // FIXME(variant_select): hardcoded to access variant 0 for now - if let Some(variant) = tagged_ty.variants.get(0) { - if let Some(fields) = &variant.fields { - for field in fields { - add_field( - program, - env, - input, - output, - cur_idx, - field.ident.to_string(), - field.ty, - ); - } - } - } - } - Ty::Ref(ref_ty) => { - // Add a deref, and recurse into the pointee - let base = format!("(*{cur_path})"); - add_field( - program, - env, - input, - output, - cur_idx, - base, - ref_ty.pointee_ty, - ); - } - Ty::Union(union_ty) => { - // FIXME(variant_select): hardcoded to access field 0 for now - if let Some(field) = union_ty.fields.get(0) { - let field_name = &field.ident; - let base = format!("{cur_path}.{field_name}"); - add_field(program, env, input, output, cur_idx, base, field.ty); - } - } - } - } - - let mut callee = report::Functions::new(); - let mut caller = report::Functions::new(); - let empty_func = Vec::new(); - let empty_arg = Vec::new(); - for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { - let func = test.types.realize_func(func_id); - let caller_func = caller.entry(func.name.clone()).or_default(); - let callee_func = callee.entry(func.name.clone()).or_default(); - for (arg_idx, arg) in func.inputs.iter().enumerate() { - let caller_arg = caller_func.entry(arg.name.clone()).or_default(); - let callee_arg = callee_func.entry(arg.name.clone()).or_default(); - - let caller_arg_bytes = caller_inputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - let callee_arg_bytes = callee_inputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - - add_field( - &test.types, - &test_key.caller_variant.env, - caller_arg_bytes, - caller_arg, - &mut 0, - String::new(), - arg.ty, - ); - add_field( - &test.types, - &test_key.callee_variant.env, - callee_arg_bytes, - callee_arg, - &mut 0, - String::new(), - arg.ty, - ); - } - - for (arg_idx, arg) in func.outputs.iter().enumerate() { - let caller_arg = caller_func.entry(arg.name.clone()).or_default(); - let callee_arg = callee_func.entry(arg.name.clone()).or_default(); - - let caller_output_bytes = caller_outputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - let callee_output_bytes = callee_outputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - - add_field( - &test.types, - &test_key.caller_variant.env, - caller_output_bytes, - caller_arg, - &mut 0, - String::new(), - arg.ty, - ); - add_field( - &test.types, - &test_key.callee_variant.env, - callee_output_bytes, - callee_arg, - &mut 0, - String::new(), - arg.ty, - ); - } - } - - Ok(RunOutput { - callee, - caller, - caller_inputs, - caller_outputs, - callee_inputs, - callee_outputs, - }) - } -} - -fn check_test( - test: &Test, - test_key: &TestKey, - RunOutput { - caller_inputs, - caller_outputs, - callee_inputs, - callee_outputs, - .. - }: &RunOutput, -) -> CheckOutput { - // Now check the results - - // Start peeling back the layers of the buffers. - // funcs (subtests) -> vals (args/returns) -> fields -> bytes - - let mut results: Vec> = Vec::new(); - - // Layer 1 is the funcs/subtests. Because we have already checked - // that they agree on their lengths, we can zip them together - // to walk through their views of each subtest's execution. - 'funcs: for (func_idx, (((caller_inputs, caller_outputs), callee_inputs), callee_outputs)) in - caller_inputs - .funcs - .iter() - .zip(&caller_outputs.funcs) - .zip(&callee_inputs.funcs) - .zip(&callee_outputs.funcs) - .enumerate() - { - // Now we must enforce that the caller and callee agree on how - // many inputs and outputs there were. If this fails that's a - // very fundamental issue, and indicative of a bad test generator. - if caller_inputs.len() != callee_inputs.len() { - results.push(Err(CheckFailure::InputCountMismatch( - func_idx, - caller_inputs.clone(), - callee_inputs.clone(), - ))); - continue 'funcs; - } - if caller_outputs.len() != callee_outputs.len() { - results.push(Err(CheckFailure::OutputCountMismatch( - func_idx, - caller_outputs.clone(), - callee_outputs.clone(), - ))); - continue 'funcs; - } - - // Layer 2 is the values (arguments/returns). - // The inputs and outputs loop do basically the same work, - // but are separate for the sake of error-reporting quality. - - // Process Inputs - for (input_idx, (caller_val, callee_val)) in - caller_inputs.iter().zip(callee_inputs).enumerate() - { - // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::InputFieldCountMismatch( - func_idx, - input_idx, - caller_val.clone(), - callee_val.clone(), - String::from("todo"), - ))); - continue 'funcs; - } - - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() - { - if caller_field != callee_field { - results.push(Err(CheckFailure::InputFieldMismatch( - func_idx, - input_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), - String::from("todo"), - ))); - continue 'funcs; - } - } - } - - // Process Outputs - for (output_idx, (caller_val, callee_val)) in - caller_outputs.iter().zip(callee_outputs).enumerate() - { - // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::OutputFieldCountMismatch( - func_idx, - output_idx, - caller_val.clone(), - callee_val.clone(), - ))); - continue 'funcs; - } - - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() - { - if caller_field != callee_field { - results.push(Err(CheckFailure::OutputFieldMismatch( - func_idx, - output_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), - ))); - continue 'funcs; - } - } - } - - // If we got this far then the test passes - results.push(Ok(())); - } - - // Report the results of each subtest - // - // This will be done again after all tests have been run, but it's - // useful to keep a version of this near the actual compilation/execution - // in case the compilers spit anything interesting to stdout/stderr. - let names = test - .types - .all_funcs() - .map(|func_id| full_subtest_name(test_key, &test.types.realize_func(func_id).name)) - .collect::>(); - let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); - let num_passed = results.iter().filter(|r| r.is_ok()).count(); - let all_passed = num_passed == results.len(); - - for (subtest_name, result) in names.iter().zip(&results) { - match result { - Ok(()) => { - eprintln!("Test {subtest_name:width$} passed", width = max_name_len); - } - Err(e) => { - eprintln!("Test {subtest_name:width$} failed!", width = max_name_len); - eprintln!("{}", e); - } - } - } - - if all_passed { - eprintln!("all tests passed"); - } else { - eprintln!("only {}/{} tests passed!", num_passed, results.len()); - } - eprintln!(); - - CheckOutput { - all_passed, - subtest_names: names, - subtest_checks: results, - } -} - -fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> TestReport { - use TestConclusion::*; - use TestRunMode::*; - // Ok now check if it matched our expectation - let conclusion = if rules.run == Skip { - // If we were told to skip, we skipped - Skipped - } else if let Some(Err(GenerateError::Skipped)) = results.source { - // The generate step is allowed to unilaterally skip things - // to avoid different configs having to explicitly disable - // a million unsupported combinations - Skipped - } else { - let passed = match &rules.check { - TestCheckMode::Pass(must_pass) => match must_pass { - Skip => true, - Generate => results.source.as_ref().map(|r| r.is_ok()).unwrap_or(false), - Build => results.build.as_ref().map(|r| r.is_ok()).unwrap_or(false), - Link => results.link.as_ref().map(|r| r.is_ok()).unwrap_or(false), - Run => results.run.as_ref().map(|r| r.is_ok()).unwrap_or(false), - Check => results - .check - .as_ref() - .map(|r| r.all_passed) - .unwrap_or(false), - }, - TestCheckMode::Fail(must_fail) | TestCheckMode::Busted(must_fail) => match must_fail { - Skip => true, - Generate => results.source.as_ref().map(|r| !r.is_ok()).unwrap_or(false), - Build => results.build.as_ref().map(|r| !r.is_ok()).unwrap_or(false), - Link => results.link.as_ref().map(|r| !r.is_ok()).unwrap_or(false), - Run => results.run.as_ref().map(|r| !r.is_ok()).unwrap_or(false), - Check => results - .check - .as_ref() - .map(|r| !r.all_passed) - .unwrap_or(false), - }, - TestCheckMode::Random => true, - }; - if passed { - if matches!(rules.check, TestCheckMode::Busted(_)) { - TestConclusion::Busted - } else { - TestConclusion::Passed - } - } else { - TestConclusion::Failed - } - }; - TestReport { - key, - rules, - conclusion, - results, - } -} - -/// The name of a test for pretty-printing. -fn full_test_name( - TestKey { - test_name, - convention, - caller_id, - callee_id, - .. - }: &TestKey, -) -> String { - format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}") -} - -/// The name of a subtest for pretty-printing. -fn full_subtest_name( - TestKey { - test_name, - convention, - caller_id, - callee_id, - .. - }: &TestKey, - func_name: &str, -) -> String { - format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}::{func_name}") -} diff --git a/src/report.rs b/src/report.rs index 0ef1d45..ae20cc0 100644 --- a/src/report.rs +++ b/src/report.rs @@ -5,7 +5,10 @@ use linked_hash_map::LinkedHashMap; use serde::Serialize; use serde_json::json; -use crate::{abis::*, full_test_name, WriteBuffer}; +use crate::abis::*; +use crate::error::*; +use crate::full_test_name; +use crate::WriteBuffer; /// These are the builtin test-expectations, edit these if there are new rules! pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl) -> TestRules { @@ -58,59 +61,6 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl result } -#[derive(Debug, thiserror::Error)] -pub enum BuildError { - #[error("io error\n{0}")] - Io(#[from] std::io::Error), - #[error("rust compile error \n{} \n{}", - std::str::from_utf8(&.0.stdout).unwrap(), - std::str::from_utf8(&.0.stderr).unwrap())] - RustCompile(std::process::Output), - #[error("c compile errror\n{0}")] - CCompile(#[from] cc::Error), -} - -#[allow(clippy::enum_variant_names)] -#[derive(Debug, thiserror::Error)] -pub enum CheckFailure { - #[error("test {0} {5} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}")] - InputFieldMismatch(usize, usize, usize, Vec, Vec, String), - #[error( - "test {0} {} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}", - OUTPUT_NAME - )] - OutputFieldMismatch(usize, usize, usize, Vec, Vec), - #[error("test {0} {4} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}")] - InputFieldCountMismatch(usize, usize, Vec>, Vec>, String), - #[error( - "test {0} {} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}", - OUTPUT_NAME - )] - OutputFieldCountMismatch(usize, usize, Vec>, Vec>), - #[error("test {0} input count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] - InputCountMismatch(usize, Vec>>, Vec>>), - #[error("test {0} output count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] - OutputCountMismatch(usize, Vec>>, Vec>>), -} - -#[derive(Debug, thiserror::Error)] -pub enum LinkError { - #[error("io error\n{0}")] - Io(#[from] std::io::Error), - #[error("rust link error \n{} \n{}", - std::str::from_utf8(&.0.stdout).unwrap(), - std::str::from_utf8(&.0.stderr).unwrap())] - RustLink(std::process::Output), -} - -#[derive(Debug, thiserror::Error)] -pub enum RunError { - #[error("test loading error (dynamic linking failed)\n{0}")] - LoadError(#[from] libloading::Error), - #[error("wrong number of tests reported! \nExpected {0} \nGot (caller_in: {1}, caller_out: {2}, callee_in: {3}, callee_out: {4})")] - TestCountMismatch(usize, usize, usize, usize, usize), -} - impl Serialize for BuildError { fn serialize(&self, serializer: S) -> Result where @@ -157,6 +107,78 @@ impl Serialize for GenerateError { } } +#[derive(Debug, Serialize)] +pub struct RunOutput { + pub caller: Functions, + pub callee: Functions, + #[serde(skip)] + pub caller_inputs: WriteBuffer, + #[serde(skip)] + pub caller_outputs: WriteBuffer, + #[serde(skip)] + pub callee_inputs: WriteBuffer, + #[serde(skip)] + pub callee_outputs: WriteBuffer, +} + +pub fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> TestReport { + use TestConclusion::*; + use TestRunMode::*; + // Ok now check if it matched our expectation + let conclusion = if rules.run == Skip { + // If we were told to skip, we skipped + Skipped + } else if let Some(Err(GenerateError::Skipped)) = results.source { + // The generate step is allowed to unilaterally skip things + // to avoid different configs having to explicitly disable + // a million unsupported combinations + Skipped + } else { + let passed = match &rules.check { + TestCheckMode::Pass(must_pass) => match must_pass { + Skip => true, + Generate => results.source.as_ref().map(|r| r.is_ok()).unwrap_or(false), + Build => results.build.as_ref().map(|r| r.is_ok()).unwrap_or(false), + Link => results.link.as_ref().map(|r| r.is_ok()).unwrap_or(false), + Run => results.run.as_ref().map(|r| r.is_ok()).unwrap_or(false), + Check => results + .check + .as_ref() + .map(|r| r.all_passed) + .unwrap_or(false), + }, + TestCheckMode::Fail(must_fail) | TestCheckMode::Busted(must_fail) => match must_fail { + Skip => true, + Generate => results.source.as_ref().map(|r| !r.is_ok()).unwrap_or(false), + Build => results.build.as_ref().map(|r| !r.is_ok()).unwrap_or(false), + Link => results.link.as_ref().map(|r| !r.is_ok()).unwrap_or(false), + Run => results.run.as_ref().map(|r| !r.is_ok()).unwrap_or(false), + Check => results + .check + .as_ref() + .map(|r| !r.all_passed) + .unwrap_or(false), + }, + TestCheckMode::Random => true, + }; + if passed { + if matches!(rules.check, TestCheckMode::Busted(_)) { + TestConclusion::Busted + } else { + TestConclusion::Passed + } + } else { + TestConclusion::Failed + } + }; + TestReport { + key, + rules, + conclusion, + results, + } +} + #[derive(Debug, Serialize)] pub struct FullReport { pub summary: TestSummary, @@ -281,20 +303,6 @@ pub struct LinkOutput { pub test_bin: PathBuf, } -#[derive(Debug, Serialize)] -pub struct RunOutput { - pub caller: Functions, - pub callee: Functions, - #[serde(skip)] - pub caller_inputs: WriteBuffer, - #[serde(skip)] - pub caller_outputs: WriteBuffer, - #[serde(skip)] - pub callee_inputs: WriteBuffer, - #[serde(skip)] - pub callee_outputs: WriteBuffer, -} - pub type Functions = LinkedHashMap, LinkedHashMap, LinkedHashMap>>; From 76196c9f3fa3df8cd6dcc1c93321bf7c51d8de6d Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 4 May 2024 13:05:12 -0400 Subject: [PATCH 13/44] tidy --- src/harness/read.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/harness/read.rs b/src/harness/read.rs index 70a7cb3..8b639ec 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -37,7 +37,7 @@ pub fn read_tests() -> Result, GenerateError> { } /// Read a test .kdl file -pub fn read_test_manifest(test_file: &Path) -> Result { +fn read_test_manifest(test_file: &Path) -> Result { let file = File::open(&test_file)?; let mut reader = BufReader::new(file); let mut input = String::new(); From 5a89defdd3b6feeff3d78166e6abd6a8a71bc6db Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 4 May 2024 13:40:07 -0400 Subject: [PATCH 14/44] add notes --- src/abis/c.rs | 2 ++ src/abis/mod.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++ src/abis_old/mod.rs | 6 +++--- src/fivemat.rs | 7 +++++++ src/harness/mod.rs | 8 ++++++++ src/main.rs | 2 +- src/procgen.rs | 1 - 7 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/abis/c.rs b/src/abis/c.rs index 2270a99..e9afb9c 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -1,3 +1,5 @@ +//! TODO (but tidy up / factor the rust impl first) + #[allow(dead_code)] pub struct CcAbiImpl { codegen_backend: Option, diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 719304d..1252304 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -64,6 +64,53 @@ pub struct Test { pub name: String, /// Parsed and Typechecked kdl-script program pub types: Arc, + // TODO: add some kind of ValueSelector type here, so that when faced with the + // question of "what value is this function argument SUPPOSED to have?", + // all implementations of the test (and the checker) can consistently agree. + // + // This is important for 5 reasons: + // + // * most fundamentally: AbiImpls are tasked with essentially implementing + // `#[derive(Display)]` for every type we hand it, but we support handing it + // c-like unions, which require you to "just know" which variant is active. + // + // * still quite importantly: even for tagged unions where we *can* generate + // match statements for them, we need to make some arbitrary decision on which + // variant we should initialize values to. If we need a way to "just know" + // for untagged unions, then we should reuse it for tagged unions. + // (Right now we just always pick the first variant, which is bad for coverage.) + // + // * usefully: this unlocks the test/harness selecting from a suite of value-selection + // strategies, including the ability for the test to require "specific values", + // the "grafitti values" system we default to, and a (seeded) "random fuzzing" mode. + // + // * nice to have: this almost certainly unlocks better error reporting + // + // * nice to have: this theoretically unlocks more extreme test minimization mode, + // where instead of generating full matches when trying to access a value, + // we can generate the equivalent of .unwrap() using if-lets, as the reader + // of a value will "just know" which variant to expect. + // + // Note however that the concept has a fundamental problem around PunTypes: + // if two implementations of the same test can fundamentally disagree on the + // "shape" of a type, it becomes extremely difficult to keep them in sync + // on what the value should be. + // + // As in, I imagine the ValueSelector's job is to basically go + // "on variable 3, field 1, subfield 8: select variant 5". These kinds of + // directions only make sense if every implementation agrees that there's a union + // at that rvalue path. If one implementation has `NewtypeTransparentU32(u32)` and + // the other has u32, such a path would desync, as there's an extra "layer" for + // the NewtypeTransparentU32 user. + // + // I can imagine solutions for that case, but something like `Option<&T>` vs `*T` + // where one has an enum and the other doesn't (and one sometimes doesn't even + // have a FIELD) are... Problematic. + // + // The "good news" is that the increasingly problematic cases are *also* a huge + // fucking problem for even validating that the two tests agreed on the value, + // so I think a ValueSelector API can pretend this isn't a thing and solve the + // easy cases. } /// A test case, specialized to a specific ABI (PunEnv) diff --git a/src/abis_old/mod.rs b/src/abis_old/mod.rs index 0632b3f..ef82dde 100644 --- a/src/abis_old/mod.rs +++ b/src/abis_old/mod.rs @@ -200,14 +200,14 @@ pub enum Val { /// make sense either because we're slurping these values out of a static config file! /// I guess just truncating the pointer is "fine". Ptr(u64), - // TODO: unions. This is hard to do with the current design where + // FIXME: unions. This is hard to do with the current design where // types are implicit in their values. You could maybe hack it in // by having dummy vals for all the different cases and then a // "real" value for the variant that's actually used, but, kinda gross. // - // TODO: simd vectors (they have special passing rules!) + // FIXME: simd vectors (they have special passing rules!) // - // TODO: enums (enum classes?) + // FIXME: enums (enum classes?) } #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] diff --git a/src/fivemat.rs b/src/fivemat.rs index 220d92e..37536ac 100644 --- a/src/fivemat.rs +++ b/src/fivemat.rs @@ -1,4 +1,11 @@ //! Indent-aware indenting +//! +//! FIXME: it would be *great* if this had APIs for like +//! "I am starting/ending a function" and "I am starting/ending a variable" +//! so that it could implicitly constructs spans for them. In theory +//! this would unlock the ability for the test harness' error-reporting +//! facilities to say "hey these two impls disagreed on the values of var 1 field 3" +//! **and actually show the Rust/C sourcecode that corresponds to**. use std::fmt::Write; diff --git a/src/harness/mod.rs b/src/harness/mod.rs index b33135d..832324a 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -1,3 +1,11 @@ +//! The test harness, which provides: +//! +//! 1. reading test .kdl files (kdl-script) +//! 2. generating impls of the tests +//! 3. building + linking the test impls together +//! 4. running the test impls +//! 5. checking the test results + use crate::TestKey; mod build; diff --git a/src/main.rs b/src/main.rs index 8b0e31b..b848411 100644 --- a/src/main.rs +++ b/src/main.rs @@ -189,7 +189,7 @@ fn main() -> Result<(), Box> { num_failed, num_skipped, }, - // TODO: put in a bunch of metadata here? + // FIXME: put in a bunch of metadata here? config: TestConfig {}, tests: reports, }; diff --git a/src/procgen.rs b/src/procgen.rs index 7b612cd..9eda087 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -72,7 +72,6 @@ pub fn procgen_tests(regenerate: bool) { for val in vals.iter() { let new_val = |i| -> Val { - // TODO: actually perturb the values? let mut new_val = val.clone(); let mut cur_val = Some(&mut new_val); while let Some(temp) = cur_val.take() { From eca720457e1f9721e552adda2fcadc037afb8f9c Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 27 May 2024 00:12:29 -0400 Subject: [PATCH 15/44] chore: refactor harness to have more parallelizable/cached dataflow --- Cargo.lock | 348 +++++++++++++++++++++++-------- Cargo.toml | 4 +- src/abis/mod.rs | 79 +++++-- src/abis/rust.rs | 30 ++- src/cli.rs | 142 ++++--------- src/harness/build.rs | 66 ++++-- src/harness/check.rs | 11 +- src/harness/generate.rs | 133 +++++------- src/harness/mod.rs | 28 ++- src/harness/run.rs | 72 +++---- src/main.rs | 444 +++++++++++++++++++++++++++------------- src/report.rs | 34 +-- 12 files changed, 864 insertions(+), 527 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9238bb4..e707fda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,8 +7,9 @@ name = "abi-cafe" version = "0.1.0" dependencies = [ "built", + "camino", "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", - "clap 3.1.6", + "clap", "kdl 4.4.1-alpha.0", "kdl-script", "libloading", @@ -21,6 +22,7 @@ dependencies = [ "serde_json", "simplelog", "thiserror", + "tokio", ] [[package]] @@ -95,17 +97,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -148,6 +139,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + [[package]] name = "built" version = "0.5.1" @@ -157,6 +154,21 @@ dependencies = [ "cargo-lock", ] +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "camino" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +dependencies = [ + "serde", +] + [[package]] name = "cargo-lock" version = "7.0.1" @@ -201,26 +213,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" -dependencies = [ - "atty", - "bitflags", - "indexmap 1.8.0", - "lazy_static", - "os_str_bytes", - "strsim", - "termcolor", - "terminal_size", - "textwrap", -] - -[[package]] -name = "clap" -version = "4.4.18" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -228,21 +223,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", + "terminal_size 0.3.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", "proc-macro2", @@ -252,9 +248,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -330,6 +326,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -362,12 +368,6 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" - [[package]] name = "hashbrown" version = "0.14.3" @@ -376,9 +376,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -409,16 +409,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" -dependencies = [ - "autocfg", - "hashbrown 0.11.2", -] - [[package]] name = "indexmap" version = "2.2.2" @@ -426,7 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -447,7 +437,7 @@ checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", "io-lifetimes", - "rustix", + "rustix 0.36.6", "windows-sys 0.42.0", ] @@ -488,7 +478,7 @@ dependencies = [ name = "kdl-script" version = "0.2.1" dependencies = [ - "clap 4.4.18", + "clap", "kdl 4.6.0", "linked-hash-map", "miette", @@ -509,9 +499,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -538,6 +528,22 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.14" @@ -583,7 +589,7 @@ dependencies = [ "supports-color", "supports-hyperlinks", "supports-unicode", - "terminal_size", + "terminal_size 0.1.17", "textwrap", "thiserror", "unicode-width", @@ -615,6 +621,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "nom" version = "7.1.3" @@ -679,15 +696,6 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" -[[package]] -name = "os_str_bytes" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" -dependencies = [ - "memchr", -] - [[package]] name = "overload" version = "0.1.1" @@ -700,6 +708,29 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.0", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -713,14 +744,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.2", + "indexmap", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "proc-macro2" @@ -764,6 +795,15 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" version = "1.6.0" @@ -788,7 +828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "serde", ] @@ -804,14 +844,27 @@ version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ - "bitflags", - "errno", + "bitflags 1.3.2", + "errno 0.2.8", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.1.4", "windows-sys 0.42.0", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno 0.3.9", + "libc", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" version = "1.0.11" @@ -873,6 +926,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "simplelog" version = "0.11.2" @@ -896,11 +958,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "supports-color" @@ -960,6 +1032,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix 0.38.34", + "windows-sys 0.48.0", +] + [[package]] name = "textwrap" version = "0.15.0" @@ -967,7 +1049,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" dependencies = [ "smawk", - "terminal_size", "unicode-linebreak", "unicode-width", ] @@ -1008,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", - "wasi", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -1027,6 +1108,37 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "toml" version = "0.5.8" @@ -1159,6 +1271,12 @@ version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "winapi" version = "0.3.9" @@ -1205,13 +1323,37 @@ dependencies = [ "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1235,6 +1377,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" @@ -1247,6 +1395,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.0" @@ -1259,6 +1413,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.0" @@ -1271,6 +1431,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.0" @@ -1283,6 +1449,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.0" @@ -1295,6 +1467,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" @@ -1307,6 +1485,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index 1c69084..7b72105 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,9 @@ parallel = ["rayon"] [dependencies] +camino = { version = "1.1.7", features = ["serde1"] } cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } -clap = { version = "3.1.6", features = ["cargo", "wrap_help"] } +clap = { version = "4.5.4", features = ["cargo", "wrap_help"] } kdl = { git = "https://github.com/Gankra/kdl-rs", branch = "spanned" } kdl-script = { path = "../kdl-script" } libloading = "0.7.3" @@ -28,6 +29,7 @@ serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.83" simplelog = "0.11.2" thiserror = "1.0.30" +tokio = { version = "1.37.0", features = ["full", "tracing"] } diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 1252304..e8ed05e 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -1,14 +1,16 @@ pub mod c; pub mod rust; -use std::{collections::HashMap, fmt::Write, path::Path, sync::Arc}; +use std::{collections::HashMap, fmt::Write, sync::Arc}; pub use c::CcAbiImpl; +use camino::Utf8Path; use kdl_script::{ types::{FuncIdx, TyIdx}, DefinitionGraph, PunEnv, TypedProgram, }; pub use rust::RustcAbiImpl; +use serde::Serialize; use crate::error::{BuildError, GenerateError}; @@ -113,6 +115,27 @@ pub struct Test { // easy cases. } +/// Options for a test +#[derive(Clone, Debug, Serialize)] +pub struct TestOptions { + /// The calling convention + pub convention: CallingConvention, +} + +#[derive(Copy, Clone, Debug)] +pub enum CallSide { + Caller, + Callee, +} +impl CallSide { + pub fn name(&self) -> &'static str { + match self { + CallSide::Caller => "caller", + CallSide::Callee => "callee", + } + } +} + /// A test case, specialized to a specific ABI (PunEnv) /// /// This refines a [`Test`][] with a specific [`AbiImpl`][] like "Rust (rustc)" or "C (gcc)". @@ -155,7 +178,7 @@ impl std::ops::Deref for TestForAbi { #[derive(Debug, Clone)] pub struct TestImpl { pub inner: TestForAbi, - pub convention: CallingConvention, + pub options: TestOptions, pub desired_funcs: Vec, pub val_writer: WriteImpl, @@ -182,13 +205,23 @@ pub trait AbiImpl { fn name(&self) -> &'static str; fn lang(&self) -> &'static str; fn src_ext(&self) -> &'static str; - fn supports_convention(&self, _convention: CallingConvention) -> bool; + fn supports_options(&self, options: &TestOptions) -> bool; fn pun_env(&self) -> Arc; fn generate_callee(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; fn generate_caller(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; + fn compile_callee( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result; + fn compile_caller( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result; } impl Test { @@ -196,27 +229,30 @@ impl Test { // TODO true } - pub fn for_abi(&self, abi: &(dyn AbiImpl + Send + Sync)) -> Result { + pub async fn for_abi( + &self, + abi: &(dyn AbiImpl + Send + Sync), + ) -> Result, GenerateError> { let env = abi.pun_env(); let defs = Arc::new(self.types.definition_graph(&env)?); - Ok(TestForAbi { + Ok(Arc::new(TestForAbi { inner: self.clone(), env, defs, - }) + })) } } impl TestForAbi { - pub fn for_impl( + pub fn with_options( &self, - convention: CallingConvention, + options: TestOptions, query: impl Iterator, val_writer: WriteImpl, ) -> Result { Ok(TestImpl { inner: self.clone(), - convention, + options, desired_funcs: query.collect(), val_writer, @@ -227,6 +263,7 @@ impl TestForAbi { } #[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] +#[serde(rename = "lowercase")] pub enum CallingConvention { // These conventions are special ones that "desugar" to others /// Sugar for "every possible convention" @@ -278,8 +315,19 @@ impl CallingConvention { CallingConvention::Vectorcall => "vectorcall", } } - pub fn from_str(input: &str) -> Option { - Some(match input { +} + +impl std::fmt::Display for CallingConvention { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} + +impl std::str::FromStr for CallingConvention { + type Err = String; + + fn from_str(s: &str) -> Result { + let val = match s { "all" => CallingConvention::All, "handwritten" => CallingConvention::Handwritten, "c" => CallingConvention::C, @@ -291,7 +339,8 @@ impl CallingConvention { "stdcall" => CallingConvention::Stdcall, "fastcall" => CallingConvention::Fastcall, "vectorcall" => CallingConvention::Vectorcall, - _ => return None, - }) + _ => return Err(format!("unknown CallingConvention: {s}")), + }; + Ok(val) } } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 4579796..1f471fc 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -2,8 +2,9 @@ use std::sync::Arc; +use camino::Utf8Path; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; -use kdl_script::{DefinitionGraph, PunEnv, TypedProgram}; +use kdl_script::PunEnv; use self::error::GenerateError; @@ -43,7 +44,8 @@ impl AbiImpl for RustcAbiImpl { lang: "rust".to_string(), }) } - fn supports_convention(&self, convention: CallingConvention) -> bool { + fn supports_options(&self, options: &TestOptions) -> bool { + let TestOptions { convention } = options; // NOTE: Rustc spits out: // // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, @@ -67,12 +69,17 @@ impl AbiImpl for RustcAbiImpl { } } - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + fn compile_callee( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { let mut cmd = Command::new("rustc"); cmd.arg("--crate-type") .arg("staticlib") .arg("--out-dir") - .arg("target/temp/") + .arg(out_dir) .arg("--target") .arg(built_info::TARGET) .arg(format!("-Cmetadata={lib_name}")) @@ -89,9 +96,14 @@ impl AbiImpl for RustcAbiImpl { Ok(String::from(lib_name)) } } - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + fn compile_caller( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { // Currently no need to be different - self.compile_callee(src_path, lib_name) + self.compile_callee(src_path, out_dir, lib_name) } fn generate_callee(&self, f: &mut dyn Write, mut test: TestImpl) -> Result<(), GenerateError> { @@ -132,7 +144,7 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &TestImpl, ) -> Result<(), GenerateError> { - let convention_decl = self.convention_decl(state.convention)?; + let convention_decl = self.convention_decl(state.options.convention)?; writeln!(f, "extern \"{convention_decl}\" {{",)?; f.add_indent(1); for &func in &state.desired_funcs { @@ -246,7 +258,7 @@ impl RustcAbiImpl { func: FuncIdx, ) -> Result<(), GenerateError> { let function = state.types.realize_func(func); - let convention_decl = self.convention_decl(state.convention)?; + let convention_decl = self.convention_decl(state.options.convention)?; writeln!(f, "#[no_mangle]")?; write!(f, "pub unsafe extern \"{convention_decl}\" ")?; self.generate_signature(f, &state, func)?; @@ -867,7 +879,7 @@ impl RustcAbiImpl { /// Every test should start by loading in the harness' "header" /// and forward-declaring any structs that will be used. fn write_harness_prefix(&self, f: &mut Fivemat, state: &TestImpl) -> Result<(), GenerateError> { - if state.convention == CallingConvention::Vectorcall { + if state.options.convention == CallingConvention::Vectorcall { writeln!(f, "#![feature(abi_vectorcall)]")?; } // Load test harness "headers" diff --git a/src/cli.rs b/src/cli.rs index a9d7724..d600ac6 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,8 +1,26 @@ use crate::{abis::*, Config, OutputFormat}; -use clap::{AppSettings, Arg}; +use clap::Parser; use log::LevelFilter; use simplelog::{ColorChoice, TermLogger, TerminalMode}; +#[derive(Parser)] +struct Cli { + #[clap(long)] + procgen_tests: bool, + #[clap(long)] + conventions: Vec, + #[clap(long)] + impls: Vec, + #[clap(long)] + pairs: Vec, + #[clap(long)] + tests: Vec, + #[clap(long)] + add_rustc_codegen_backend: Vec, + #[clap(long, default_value_t = OutputFormat::Human)] + output_format: OutputFormat, +} + pub fn make_app() -> Config { static ABI_IMPLS: &[&str] = &[ ABI_IMPL_RUSTC, @@ -18,120 +36,36 @@ pub fn make_app() -> Config { // (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C ]; - let app = clap::Command::new("abi-cafe") - .version(clap::crate_version!()) - .about("Compares the FFI ABIs of different langs/compilers by generating and running them.") - .next_line_help(true) - .setting(AppSettings::DeriveDisplayOrder) - .arg( - Arg::new("procgen-tests") - .long("procgen-tests") - .long_help("Regenerate the procgen test manifests"), - ) - .arg( - Arg::new("conventions") - .long("conventions") - .long_help("Only run the given calling conventions") - .possible_values(&[ - "c", - "cdecl", - "fastcall", - "stdcall", - "vectorcall", - "handwritten", - ]) - .multiple_values(true) - .takes_value(true), - ) - .arg( - Arg::new("impls") - .long("impls") - .long_help("Only run the given impls (compilers/languages)") - .possible_values(ABI_IMPLS) - .multiple_values(true) - .takes_value(true), - ) - .arg( - Arg::new("tests") - .long("tests") - .long_help("Only run the given tests") - .multiple_values(true) - .takes_value(true), - ) - .arg( - Arg::new("pairs") - .long("pairs") - .long_help("Only run the given impl pairs, in the form of impl_calls_impl") - .multiple_values(true) - .takes_value(true), - ) - .arg( - Arg::new("add-rustc-codegen-backend") - .long("add-rustc-codegen-backend") - .long_help("Add a rustc codegen backend, in the form of impl_name:path/to/backend") - .multiple_values(true) - .takes_value(true), - ) - .arg( - Arg::new("output-format") - .long("output-format") - .long_help("Set the output format") - .possible_values(&["human", "json", "rustc-json"]) - .default_value("human") - .takes_value(true), - ) - .after_help(""); - - let matches = app.get_matches(); - let procgen_tests = matches.is_present("procgen-tests"); - - let mut run_conventions: Vec<_> = matches - .values_of("conventions") - .into_iter() - .flatten() - .map(|conv| CallingConvention::from_str(conv).unwrap()) - .collect(); - - if run_conventions.is_empty() { - run_conventions = ALL_CONVENTIONS.to_vec(); - } + let config = Cli::parse(); + let procgen_tests = config.procgen_tests; + let run_conventions = if config.conventions.is_empty() { + ALL_CONVENTIONS.to_vec() + } else { + config.conventions + }; - let run_impls = matches - .values_of("impls") - .into_iter() - .flatten() - .map(String::from) - .collect(); + let run_impls = config.impls; - let mut run_pairs: Vec<_> = matches - .values_of("pairs") - .into_iter() - .flatten() + let mut run_pairs: Vec<_> = config + .pairs + .iter() .map(|pair| { pair.split_once("_calls_") .expect("invalid 'pair' syntax, must be 'impl_calls_impl'") }) .map(|(a, b)| (String::from(a), String::from(b))) .collect(); - if run_pairs.is_empty() { run_pairs = DEFAULT_TEST_PAIRS .iter() .map(|&(a, b)| (String::from(a), String::from(b))) .collect() } + let run_tests = config.tests; - let run_tests = matches - .values_of("tests") - .into_iter() - .flatten() - .map(String::from) - .collect(); - - let rustc_codegen_backends: Vec<(String, String)> = matches - .values_of("add-rustc-codegen-backend") - .into_iter() - .flatten() + let rustc_codegen_backends: Vec<(String, String)> = config + .add_rustc_codegen_backend + .iter() .map(|pair| { pair.split_once(':') .expect("invalid syntax, must be 'impl_name:path/to/backend'") @@ -149,13 +83,7 @@ pub fn make_app() -> Config { } } - let output_format = match matches.value_of("output-format").unwrap() { - "human" => OutputFormat::Human, - "json" => OutputFormat::Json, - "rustc-json" => OutputFormat::RustcJson, - _ => unreachable!(), - }; - + let output_format = config.output_format; let _ = TermLogger::init( LevelFilter::Info, simplelog::Config::default(), diff --git a/src/harness/build.rs b/src/harness/build.rs index 6720ad9..2355fac 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -1,31 +1,53 @@ +use std::env; use std::path::PathBuf; use std::process::Command; -use crate::error::*; +use camino::{Utf8Path, Utf8PathBuf}; + use crate::harness::full_test_name; use crate::report::*; -use crate::{built_info, AbiImpl, Test, TestKey}; +use crate::{built_info, AbiImpl, TestKey}; +use crate::{error::*, TestOptions}; + +const OUT_DIR: &str = "target/temp"; + +/// Delete and recreate the build dir +pub fn init_build_dir() -> Result { + let out_dir = Utf8PathBuf::from(OUT_DIR); + std::fs::create_dir_all(&out_dir)?; + std::fs::remove_dir_all(&out_dir)?; + std::fs::create_dir_all(&out_dir)?; + + // Set up env vars for CC + env::set_var("OUT_DIR", &out_dir); + env::set_var("HOST", built_info::HOST); + env::set_var("TARGET", built_info::TARGET); + env::set_var("OPT_LEVEL", "0"); + + Ok(out_dir) +} pub fn build_test( - _test: &Test, - test_key: &TestKey, + test_key @ TestKey { + test: test_id, + caller: caller_id, + callee: callee_id, + options: TestOptions { convention }, + }: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl, src: &GenerateOutput, + out_dir: &Utf8Path, ) -> Result { - let test_name = &test_key.test_name; - let convention_name = &test_key.convention; let full_test_name = full_test_name(test_key); - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; eprintln!("compiling {full_test_name}"); - let caller_lib = format!("{test_name}_{convention_name}_{caller_id}_caller"); - let callee_lib = format!("{test_name}_{convention_name}_{callee_id}_callee"); + let caller_lib = format!("{test_id}_{convention}_{caller_id}_caller"); + let callee_lib = format!("{test_id}_{convention}_{callee_id}_callee"); // Compile the tests (and let them change the lib name). - let caller_lib = caller.compile_caller(&src.caller_src, &caller_lib)?; - let callee_lib = callee.compile_callee(&src.callee_src, &callee_lib)?; + let caller_lib = caller.compile_caller(&src.caller_src, out_dir, &caller_lib)?; + let callee_lib = callee.compile_callee(&src.callee_src, out_dir, &callee_lib)?; Ok(BuildOutput { caller_lib, @@ -35,22 +57,26 @@ pub fn build_test( /// Compile and link the test harness with the two sides of the FFI boundary. pub fn link_test( - _test: &Test, - test_key: &TestKey, + test_key @ TestKey { + test: test_id, + caller: caller_id, + callee: callee_id, + options: TestOptions { convention }, + }: &TestKey, build: &BuildOutput, + out_dir: &Utf8Path, ) -> Result { - let test_name = &test_key.test_name; - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; let full_test_name = full_test_name(test_key); let src = PathBuf::from("harness/harness.rs"); - let output = format!("target/temp/{test_name}_{caller_id}_calls_{callee_id}_harness.dll"); + let output = out_dir.join(format!( + "{test_id}_{convention}_{caller_id}_calls_{callee_id}_harness.dll" + )); eprintln!("linking {full_test_name}"); let mut cmd = Command::new("rustc"); cmd.arg("-v") .arg("-L") - .arg("target/temp/") + .arg(out_dir) .arg("-l") .arg(&build.caller_lib) .arg("-l") @@ -73,7 +99,7 @@ pub fn link_test( Err(LinkError::RustLink(out)) } else { Ok(LinkOutput { - test_bin: PathBuf::from(output), + test_bin: Utf8PathBuf::from(output), }) } } diff --git a/src/harness/check.rs b/src/harness/check.rs index 9ae6a8a..1604eae 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -1,11 +1,14 @@ +use std::sync::Arc; + use crate::error::*; use crate::harness::full_subtest_name; use crate::report::*; -use crate::Test; +use crate::TestForAbi; pub fn check_test( - test: &Test, test_key: &TestKey, + caller_impl: Arc, + _callee_impl: Arc, RunOutput { caller_inputs, caller_outputs, @@ -136,10 +139,10 @@ pub fn check_test( // This will be done again after all tests have been run, but it's // useful to keep a version of this near the actual compilation/execution // in case the compilers spit anything interesting to stdout/stderr. - let names = test + let names = caller_impl .types .all_funcs() - .map(|func_id| full_subtest_name(test_key, &test.types.realize_func(func_id).name)) + .map(|func_id| full_subtest_name(test_key, &caller_impl.types.realize_func(func_id).name)) .collect::>(); let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); let num_passed = results.iter().filter(|r| r.is_ok()).count(); diff --git a/src/harness/generate.rs b/src/harness/generate.rs index be8582f..a178dfe 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -1,93 +1,72 @@ +use camino::Utf8Path; +use camino::Utf8PathBuf; use std::fs::File; use std::io::Write; -use std::path::PathBuf; +use std::sync::Arc; use crate::abis::*; use crate::error::*; -use crate::report::*; +use crate::{AbiImplId, CallSide, TestId, TestOptions}; -use super::full_test_name; +const GENERATED_SRC_DIR: &str = "generated_impls"; +const HANDWRITTEN_SRC_DIR: &str = "handwritten_impls"; -pub fn generate_test_src( - test: &Test, - test_key: &TestKey, - convention: CallingConvention, - caller: &dyn AbiImpl, - callee: &dyn AbiImpl, -) -> Result { - let test_name = &test_key.test_name; - let convention_name = &test_key.convention; - let caller_src_ext = caller.src_ext(); - let callee_src_ext = callee.src_ext(); - let full_test_name = full_test_name(test_key); - let caller_id = &test_key.caller_id; - let callee_id = &test_key.callee_id; - - if !caller.supports_convention(convention) { - eprintln!( - "skipping {full_test_name}: {caller_id} doesn't support convention {convention_name}" - ); - return Err(GenerateError::Skipped); - } - if !callee.supports_convention(convention) { - eprintln!( - "skipping {full_test_name}: {callee_id} doesn't support convention {convention_name}" - ); - return Err(GenerateError::Skipped); - } - - let src_dir = if convention == CallingConvention::Handwritten { - PathBuf::from("handwritten_impls/") +pub fn src_path( + test_id: &TestId, + abi_id: &AbiImplId, + abi: &dyn AbiImpl, + call_side: CallSide, + options: &TestOptions, +) -> Utf8PathBuf { + let src_ext = abi.src_ext(); + let convention_name = options.convention.name(); + let call_side = call_side.name(); + let src_dir = if options.convention == CallingConvention::Handwritten { + Utf8PathBuf::from(HANDWRITTEN_SRC_DIR) } else { - PathBuf::from("generated_impls/") + Utf8PathBuf::from(GENERATED_SRC_DIR) }; - let caller_src = src_dir.join(format!( - "{caller_id}/{test_name}_{convention_name}_{caller_id}_caller.{caller_src_ext}" - )); - let callee_src = src_dir.join(format!( - "{callee_id}/{test_name}_{convention_name}_{callee_id}_callee.{callee_src_ext}" - )); + src_dir.join(abi_id).join(format!( + "{test_id}_{convention_name}_{abi_id}_{call_side}.{src_ext}" + )) +} - if convention == CallingConvention::Handwritten { - if !caller_src.exists() || !callee_src.exists() { - eprintln!("skipping {full_test_name}: source for callee and caller doesn't exist"); +/// Delete and recreate the generated src dir +pub fn init_generate_dir() -> Result<(), GenerateError> { + std::fs::create_dir_all(GENERATED_SRC_DIR)?; + std::fs::remove_dir_all(GENERATED_SRC_DIR)?; + std::fs::create_dir_all(GENERATED_SRC_DIR)?; + Ok(()) +} + +pub async fn generate_src( + src_path: &Utf8Path, + abi: Arc, + test_with_abi: Arc, + call_side: CallSide, + options: TestOptions, +) -> Result<(), GenerateError> { + if let CallingConvention::Handwritten = options.convention { + if src_path.exists() { + return Ok(()); + } else { return Err(GenerateError::Skipped); } - } else { - eprintln!("generating {full_test_name}"); - // If the impl isn't handwritten, then we need to generate it. - std::fs::create_dir_all(&src_dir).unwrap(); - std::fs::remove_dir_all(&src_dir).unwrap(); - std::fs::create_dir_all(caller_src.parent().unwrap())?; - std::fs::create_dir_all(callee_src.parent().unwrap())?; - let mut caller_output = File::create(&caller_src)?; - let mut caller_output_string = String::new(); - caller.generate_caller( - &mut caller_output_string, - test_key.caller_variant.for_impl( - convention, - test_key.caller_variant.types.all_funcs(), - WriteImpl::HarnessCallback, - )?, - )?; - caller_output.write_all(caller_output_string.as_bytes())?; - - let mut callee_output = File::create(&callee_src)?; - let mut callee_output_string = String::new(); - callee.generate_callee( - &mut callee_output_string, - test_key.callee_variant.for_impl( - convention, - test_key.callee_variant.types.all_funcs(), - WriteImpl::HarnessCallback, - )?, - )?; - callee_output.write_all(callee_output_string.as_bytes())?; } + let mut output_string = String::new(); + let query = test_with_abi.types.all_funcs(); + let write_impl = WriteImpl::HarnessCallback; + let test = test_with_abi.with_options(options, query, write_impl)?; + match call_side { + CallSide::Callee => abi.generate_callee(&mut output_string, test)?, + CallSide::Caller => abi.generate_caller(&mut output_string, test)?, + } + + // Write the result to disk + std::fs::create_dir_all(src_path.parent().expect("source file had no parent!?"))?; + let mut output = File::create(src_path)?; + output.write_all(output_string.as_bytes())?; - Ok(GenerateOutput { - caller_src, - callee_src, - }) + Ok(()) } diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 832324a..d080e24 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -6,7 +6,7 @@ //! 4. running the test impls //! 5. checking the test results -use crate::TestKey; +use crate::{TestKey, TestOptions}; mod build; mod check; @@ -14,35 +14,33 @@ mod generate; mod read; mod run; -pub use build::{build_test, link_test}; +pub use build::{build_test, init_build_dir, link_test}; pub use check::check_test; -pub use generate::generate_test_src; +pub use generate::{generate_src, init_generate_dir, src_path}; pub use read::read_tests; pub use run::{run_dynamic_test, WriteBuffer}; /// The name of a test for pretty-printing. pub fn full_test_name( TestKey { - test_name, - convention, - caller_id, - callee_id, - .. + test, + options: TestOptions { convention }, + caller, + callee, }: &TestKey, ) -> String { - format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}") + format!("{test}::{convention}::{caller}_calls_{callee}") } /// The name of a subtest for pretty-printing. pub fn full_subtest_name( TestKey { - test_name, - convention, - caller_id, - callee_id, - .. + test, + options: TestOptions { convention }, + caller, + callee, }: &TestKey, func_name: &str, ) -> String { - format!("{test_name}::{convention}::{caller_id}_calls_{callee_id}::{func_name}") + format!("{test}::{convention}::{caller}_calls_{callee}::{func_name}") } diff --git a/src/harness/run.rs b/src/harness/run.rs index 1ee5a83..b072d3c 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -1,14 +1,15 @@ //! The runtime actual types and functions that are injected into //! compiled tests. +use std::sync::Arc; + use kdl_script::types::{Ty, TyIdx}; -use kdl_script::{PunEnv, TypedProgram}; use linked_hash_map::LinkedHashMap; use serde::Serialize; -use crate::error::*; use crate::harness::full_test_name; use crate::report::*; +use crate::{error::*, TestForAbi}; use crate::{LinkOutput, Test, TestKey}; /// Tests write back the raw bytes of their values to a WriteBuffer. @@ -98,8 +99,9 @@ pub unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut /// /// See the README for a high-level description of this design. pub fn run_dynamic_test( - test: &Test, test_key: &TestKey, + caller_impl: Arc, + callee_impl: Arc, test_dylib: &LinkOutput, ) -> Result { // Initialize all the buffers the tests will write to @@ -112,7 +114,7 @@ pub fn run_dynamic_test( let full_test_name = full_test_name(test_key); // Load the dylib of the test, and get its test_start symbol - eprintln!("loading: {}", &test_dylib.test_bin.display()); + eprintln!("loading: {}", &test_dylib.test_bin); let lib = libloading::Library::new(&test_dylib.test_bin)?; let do_test: libloading::Symbol = lib.get(b"test_start")?; eprintln!("running {full_test_name}"); @@ -136,8 +138,8 @@ pub fn run_dynamic_test( } digest_test_run( - test, - test_key, + caller_impl, + callee_impl, caller_inputs, caller_outputs, callee_inputs, @@ -146,8 +148,8 @@ pub fn run_dynamic_test( } fn digest_test_run( - test: &Test, - test_key: &TestKey, + caller_impl: Arc, + callee_impl: Arc, caller_inputs: WriteBuffer, caller_outputs: WriteBuffer, callee_inputs: WriteBuffer, @@ -159,7 +161,7 @@ fn digest_test_run( // As a basic sanity-check, make sure everything agrees on how // many tests actually executed. If this fails, then something // is very fundamentally broken and needs to be fixed. - let all_func_ids = test.types.all_funcs().collect::>(); + let all_func_ids = caller_impl.types.all_funcs().collect::>(); let expected_test_count = all_func_ids.len(); if caller_inputs.funcs.len() != expected_test_count || caller_outputs.funcs.len() != expected_test_count @@ -178,7 +180,7 @@ fn digest_test_run( let empty_func = Vec::new(); let empty_arg = Vec::new(); for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { - let func = test.types.realize_func(func_id); + let func = caller_impl.types.realize_func(func_id); let caller_func = caller.entry(func.name.clone()).or_default(); let callee_func = callee.entry(func.name.clone()).or_default(); for (arg_idx, arg) in func.inputs.iter().enumerate() { @@ -199,8 +201,7 @@ fn digest_test_run( .unwrap_or(&empty_arg); add_field( - &test.types, - &test_key.caller_variant.env, + &callee_impl, caller_arg_bytes, caller_arg, &mut 0, @@ -208,8 +209,7 @@ fn digest_test_run( arg.ty, ); add_field( - &test.types, - &test_key.callee_variant.env, + &callee_impl, callee_arg_bytes, callee_arg, &mut 0, @@ -236,8 +236,7 @@ fn digest_test_run( .unwrap_or(&empty_arg); add_field( - &test.types, - &test_key.caller_variant.env, + &caller_impl, caller_output_bytes, caller_arg, &mut 0, @@ -245,8 +244,7 @@ fn digest_test_run( arg.ty, ); add_field( - &test.types, - &test_key.callee_variant.env, + &callee_impl, callee_output_bytes, callee_arg, &mut 0, @@ -286,8 +284,11 @@ fn format_bytes(input: &[Vec], cur_idx: &mut usize) -> String { /// Recursive subroutine of write_var, which builds up rvalue paths and generates /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. fn add_field( - program: &TypedProgram, - env: &PunEnv, + test_impl @ TestForAbi { + inner: Test { types: program, .. }, + env, + .. + }: &TestForAbi, input: &[Vec], output: &mut LinkedHashMap, cur_idx: &mut usize, @@ -305,26 +306,18 @@ fn add_field( } Ty::Alias(alias_ty) => { // keep going but with the type changed - add_field( - program, - env, - input, - output, - cur_idx, - cur_path, - alias_ty.real, - ); + add_field(test_impl, input, output, cur_idx, cur_path, alias_ty.real); } Ty::Pun(pun) => { // keep going but with the type changed let real_ty = program.resolve_pun(pun, env).unwrap(); - add_field(program, env, input, output, cur_idx, cur_path, real_ty); + add_field(test_impl, input, output, cur_idx, cur_path, real_ty); } Ty::Array(array_ty) => { // recurse into each array index for i in 0..array_ty.len { let base = format!("{cur_path}[{i}]"); - add_field(program, env, input, output, cur_idx, base, array_ty.elem_ty); + add_field(test_impl, input, output, cur_idx, base, array_ty.elem_ty); } } Ty::Struct(struct_ty) => { @@ -332,7 +325,7 @@ fn add_field( for field in &struct_ty.fields { let field_name = &field.ident; let base = format!("{cur_path}.{field_name}"); - add_field(program, env, input, output, cur_idx, base, field.ty); + add_field(test_impl, input, output, cur_idx, base, field.ty); } } Ty::Tagged(tagged_ty) => { @@ -341,8 +334,7 @@ fn add_field( if let Some(fields) = &variant.fields { for field in fields { add_field( - program, - env, + test_impl, input, output, cur_idx, @@ -356,22 +348,14 @@ fn add_field( Ty::Ref(ref_ty) => { // Add a deref, and recurse into the pointee let base = format!("(*{cur_path})"); - add_field( - program, - env, - input, - output, - cur_idx, - base, - ref_ty.pointee_ty, - ); + add_field(test_impl, input, output, cur_idx, base, ref_ty.pointee_ty); } Ty::Union(union_ty) => { // FIXME(variant_select): hardcoded to access field 0 for now if let Some(field) = union_ty.fields.get(0) { let field_name = &field.ident; let base = format!("{cur_path}.{field_name}"); - add_field(program, env, input, output, cur_idx, base, field.ty); + add_field(test_impl, input, output, cur_idx, base, field.ty); } } } diff --git a/src/main.rs b/src/main.rs index b848411..f9f39ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,14 +8,18 @@ mod harness; mod report; use abis::*; +use camino::{Utf8Path, Utf8PathBuf}; use error::*; use harness::*; use report::*; -use std::collections::HashMap; -use std::env; use std::error::Error; -use std::path::{Path, PathBuf}; use std::process::Command; +use std::sync::{Arc, Mutex}; +use tokio::sync::OnceCell; + +pub type SortedMap = std::collections::BTreeMap; +pub type AbiImplId = String; +pub type TestId = String; /// Slurps up details of how this crate was compiled, which we can use /// to better compile the actual tests since we're currently compiling them on @@ -30,6 +34,29 @@ pub enum OutputFormat { Json, RustcJson, } +impl std::fmt::Display for OutputFormat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let string = match self { + OutputFormat::Human => "human", + OutputFormat::Json => "json", + OutputFormat::RustcJson => "rustc-json", + }; + string.fmt(f) + } +} +impl std::str::FromStr for OutputFormat { + type Err = String; + + fn from_str(s: &str) -> Result { + let val = match s { + "human" => OutputFormat::Human, + "json" => OutputFormat::Json, + "rustc-json" => OutputFormat::RustcJson, + _ => return Err(format!("unknown output format: {s}")), + }; + Ok(val) + } +} #[derive(Debug, Clone)] pub struct Config { @@ -46,6 +73,228 @@ pub struct Config { #[error("some tests failed")] pub struct TestsFailed {} +#[derive(Default)] +pub struct TestRunner { + pub tests: SortedMap>, + pub abi_impls: SortedMap>, + pub test_with_abi_impls: Mutex>>>>, + pub sources: Mutex>>>, + pub static_libs: Mutex>>>, + pub dynamic_libs: Mutex>>>, +} + +impl TestRunner { + pub fn new() -> Self { + Self::default() + } + pub fn add_abi_impl(&mut self, id: AbiImplId, abi_impl: A) { + let old = self.abi_impls.insert(id.clone(), Arc::new(abi_impl)); + assert!(old.is_none(), "duplicate abi impl id: {}", id); + } + pub fn set_tests(&mut self, tests: Vec) { + for test in tests { + let id = test.name.clone(); + let old = self.tests.insert(id.clone(), Arc::new(test)); + assert!(old.is_none(), "duplicate test id: {}", id); + } + } + pub async fn test_with_abi_impl( + &self, + test: &Test, + abi_id: AbiImplId, + ) -> Result, GenerateError> { + let test_id = test.name.clone(); + let abi_impl = self.abi_impls[&abi_id].clone(); + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .test_with_abi_impls + .lock() + .unwrap() + .entry((test_id, abi_id.clone())) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let output = once + .get_or_try_init(|| test.for_abi(&*abi_impl)) + .await? + .clone(); + Ok(output) + } + pub async fn generate_src( + &self, + test_id: TestId, + abi_id: AbiImplId, + call_side: CallSide, + options: TestOptions, + ) -> Result { + let abi_impl = self.abi_impls[&abi_id].clone(); + let src_path = harness::src_path(&test_id, &abi_id, &*abi_impl, call_side, &options); + let test = self.tests[&test_id].clone(); + let test_with_abi = self.test_with_abi_impl(&test, abi_id).await?; + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .sources + .lock() + .unwrap() + .entry(src_path.clone()) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let _ = once + .get_or_try_init(|| { + generate_src(&src_path, abi_impl, test_with_abi, call_side, options) + }) + .await?; + Ok(src_path) + } + pub fn get_test_rules(&self, test_key: &TestKey) -> TestRules { + let caller = self.abi_impls[&test_key.caller].clone(); + let callee = self.abi_impls[&test_key.callee].clone(); + + get_test_rules(test_key, &*caller, &*callee) + } + /// Generate, Compile, Link, Load, and Run this test. + pub async fn do_test( + &self, + test_key: TestKey, + test_rules: TestRules, + out_dir: Utf8PathBuf, + ) -> TestRunResults { + use TestRunMode::*; + + let mut run_results = TestRunResults::default(); + if test_rules.run <= Skip { + return run_results; + } + + run_results.ran_to = Generate; + run_results.source = Some(self.generate_test(&test_key).await); + let source = match run_results.source.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + eprintln!("Failed to generate source: {}", e); + return run_results; + } + }; + if test_rules.run <= Generate { + return run_results; + } + + run_results.ran_to = Build; + run_results.build = Some(self.build_test(&test_key, source, &out_dir).await); + let build = match run_results.build.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + eprintln!("Failed to build test: {}", e); + return run_results; + } + }; + if test_rules.run <= Build { + return run_results; + } + + run_results.ran_to = Link; + run_results.link = Some(self.link_test(&test_key, build, &out_dir).await); + let link = match run_results.link.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + eprintln!("Failed to link test: {}", e); + return run_results; + } + }; + if test_rules.run <= Link { + return run_results; + } + + run_results.ran_to = Run; + run_results.run = Some(self.run_dynamic_test(&test_key, link).await); + let run = match run_results.run.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + eprintln!("Failed to run test: {}", e); + return run_results; + } + }; + if test_rules.run <= Run { + return run_results; + } + + run_results.ran_to = Check; + run_results.check = Some(self.check_test(&test_key, run).await); + + run_results + } + pub async fn generate_test(&self, key: &TestKey) -> Result { + let caller_src = self + .generate_src( + key.test.clone(), + key.caller.clone(), + CallSide::Caller, + key.options.clone(), + ) + .await?; + let callee_src = self + .generate_src( + key.test.clone(), + key.callee.clone(), + CallSide::Callee, + key.options.clone(), + ) + .await?; + + Ok(GenerateOutput { + caller_src, + callee_src, + }) + } + pub async fn build_test( + &self, + key: &TestKey, + src: &GenerateOutput, + out_dir: &Utf8Path, + ) -> Result { + let caller = self.abi_impls[&key.caller].clone(); + let callee = self.abi_impls[&key.callee].clone(); + build_test(key, &*caller, &*callee, src, out_dir) + } + pub async fn link_test( + &self, + key: &TestKey, + build: &BuildOutput, + out_dir: &Utf8Path, + ) -> Result { + link_test(key, build, out_dir) + } + pub async fn run_dynamic_test( + &self, + key: &TestKey, + test_dylib: &LinkOutput, + ) -> Result { + let test = self.tests[&key.test].clone(); + let caller_impl = self + .test_with_abi_impl(&test, key.caller.clone()) + .await + .unwrap(); + let callee_impl = self + .test_with_abi_impl(&test, key.callee.clone()) + .await + .unwrap(); + run_dynamic_test(key, caller_impl, callee_impl, test_dylib) + } + pub async fn check_test(&self, key: &TestKey, results: &RunOutput) -> CheckOutput { + let test = self.tests[&key.test].clone(); + let caller_impl = self + .test_with_abi_impl(&test, key.caller.clone()) + .await + .unwrap(); + let callee_impl = self + .test_with_abi_impl(&test, key.callee.clone()) + .await + .unwrap(); + check_test(key, caller_impl, callee_impl, results) + } +} + fn main() -> Result<(), Box> { eprintln!("starting!"); let cfg = cli::make_app(); @@ -53,61 +302,56 @@ fn main() -> Result<(), Box> { // Before doing anything, regenerate the procgen tests, if needed. // TODO: procgen::procgen_tests(cfg.procgen_tests); eprintln!("generated tests!"); + init_generate_dir()?; + let out_dir = init_build_dir()?; - let out_dir = PathBuf::from("target/temp/"); - std::fs::create_dir_all(&out_dir).unwrap(); - std::fs::remove_dir_all(&out_dir).unwrap(); - std::fs::create_dir_all(&out_dir).unwrap(); - - // Set up env vars for CC - env::set_var("OUT_DIR", &out_dir); - env::set_var("HOST", built_info::HOST); - env::set_var("TARGET", built_info::TARGET); - env::set_var("OPT_LEVEL", "0"); + let mut runner = TestRunner::new(); - let mut abi_impls: HashMap<&str, Box> = HashMap::new(); - abi_impls.insert( - ABI_IMPL_RUSTC, - Box::new(abis::RustcAbiImpl::new(&cfg, None)), + runner.add_abi_impl( + ABI_IMPL_RUSTC.to_owned(), + abis::RustcAbiImpl::new(&cfg, None), ); /* - abi_impls.insert( - ABI_IMPL_CC, - Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_CC)), + runner.add_abi_impl( + ABI_IMPL_CC.to_owned(), + abis::CcAbiImpl::new(&cfg, ABI_IMPL_CC), ); - abi_impls.insert( - ABI_IMPL_GCC, - Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_GCC)), + runner.add_abi_impl( + ABI_IMPL_GCC.to_owned(), + abis::CcAbiImpl::new(&cfg, ABI_IMPL_GCC), ); - abi_impls.insert( - ABI_IMPL_CLANG, - Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_CLANG)), + runner.add_abi_impl( + ABI_IMPL_CLANG.to_owned(), + abis::CcAbiImpl::new(&cfg, ABI_IMPL_CLANG), ); - abi_impls.insert( - ABI_IMPL_MSVC, - Box::new(abis::CcAbiImpl::new(&cfg, ABI_IMPL_MSVC)), + runner.add_abi_impl( + ABI_IMPL_MSVC.to_owned(), + abis::CcAbiImpl::new(&cfg, ABI_IMPL_MSVC), ); */ for &(ref name, ref path) in &cfg.rustc_codegen_backends { - abi_impls.insert( - name, - Box::new(abis::RustcAbiImpl::new(&cfg, Some(path.to_owned()))), + runner.add_abi_impl( + name.to_owned(), + abis::RustcAbiImpl::new(&cfg, Some(path.to_owned())), ); } eprintln!("configured ABIs!"); // Grab all the tests let tests = read_tests()?; + runner.set_tests(tests); eprintln!("got tests!"); - + let runner = Arc::new(runner); // Run the tests use TestConclusion::*; - + let rt = tokio::runtime::Runtime::new().expect("failed to init tokio runtime"); + let _handle = rt.enter(); // This is written as nested iterator adaptors so that it can maybe be changed to use // rayon's par_iter, but currently the code isn't properly threadsafe due to races on // the filesystem when setting up the various output dirs :( - let reports = tests - .iter() + let tasks = runner + .tests + .values() .flat_map(|test| { // If the cli has test filters, apply those if !cfg.run_tests.is_empty() && !cfg.run_tests.contains(&test.name) { @@ -130,34 +374,34 @@ fn main() -> Result<(), Box> { { return None; } - let caller = - &**abi_impls.get(&**caller_id).expect("invalid id for caller!"); - let callee = - &**abi_impls.get(&**callee_id).expect("invalid id for callee!"); - - let convention_name = convention.name(); // Run the test! let test_key = TestKey { - test_name: test.name.to_owned(), - convention: convention_name.to_owned(), - caller_id: caller_id.to_owned(), - callee_id: callee_id.to_owned(), - caller_variant: test.for_abi(caller).unwrap(), - callee_variant: test.for_abi(callee).unwrap(), + test: test.name.to_owned(), + caller: caller_id.to_owned(), + callee: callee_id.to_owned(), + options: TestOptions { + convention: convention.clone(), + }, }; - let rules = get_test_rules(&test_key, caller, callee); - let results = do_test( - test, - &test_key, - &rules, - *convention, - caller, - callee, - &out_dir, - ); - let report = report_test(test_key, rules, results); - Some(report) + let rules = runner.get_test_rules(&test_key); + + let task = { + let runner = runner.clone(); + let rules = rules.clone(); + let test_key = test_key.clone(); + let out_dir = out_dir.clone(); + rt.spawn( + async move { runner.do_test(test_key, rules, out_dir).await }, + ) + }; + // FIXME: we can make everything parallel by immediately returning + // and making the following code happen in subsequent pass. For now + // let's stay single-threaded to do things one step at a time. + // Some((test_key, rules, task)) + + let results = rt.block_on(task).expect("failed to join task"); + Some(report_test(test_key, rules, results)) }) .collect() }) @@ -165,6 +409,9 @@ fn main() -> Result<(), Box> { }) .collect::>(); + // Join on all the tasks, and compute their results + let reports = tasks.into_iter().map(|report| report).collect::>(); + // Compute the final report let mut num_tests = 0; let mut num_passed = 0; @@ -206,80 +453,3 @@ fn main() -> Result<(), Box> { } Ok(()) } - -/// Generate, Compile, Link, Load, and Run this test. -fn do_test( - test: &Test, - test_key: &TestKey, - test_rules: &TestRules, - convention: CallingConvention, - caller: &dyn AbiImpl, - callee: &dyn AbiImpl, - _out_dir: &Path, -) -> TestRunResults { - use TestRunMode::*; - - let mut run_results = TestRunResults::default(); - if test_rules.run <= Skip { - return run_results; - } - - run_results.ran_to = Generate; - run_results.source = Some(generate_test_src( - test, test_key, convention, caller, callee, - )); - let source = match run_results.source.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - eprintln!("Failed to generate source: {}", e); - return run_results; - } - }; - if test_rules.run <= Generate { - return run_results; - } - - run_results.ran_to = Build; - run_results.build = Some(build_test(test, test_key, caller, callee, source)); - let build = match run_results.build.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - eprintln!("Failed to build test: {}", e); - return run_results; - } - }; - if test_rules.run <= Build { - return run_results; - } - - run_results.ran_to = Link; - run_results.link = Some(link_test(test, test_key, build)); - let link = match run_results.link.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - eprintln!("Failed to link test: {}", e); - return run_results; - } - }; - if test_rules.run <= Link { - return run_results; - } - - run_results.ran_to = Run; - run_results.run = Some(run_dynamic_test(test, test_key, link)); - let run = match run_results.run.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - eprintln!("Failed to run test: {}", e); - return run_results; - } - }; - if test_rules.run <= Run { - return run_results; - } - - run_results.ran_to = Check; - run_results.check = Some(check_test(test, test_key, run)); - - run_results -} diff --git a/src/report.rs b/src/report.rs index ae20cc0..dfdf320 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,5 +1,4 @@ -use std::path::PathBuf; - +use camino::Utf8PathBuf; use kdl_script::spanned::Spanned; use linked_hash_map::LinkedHashMap; use serde::Serialize; @@ -8,6 +7,8 @@ use serde_json::json; use crate::abis::*; use crate::error::*; use crate::full_test_name; +use crate::AbiImplId; +use crate::TestId; use crate::WriteBuffer; /// These are the builtin test-expectations, edit these if there are new rules! @@ -21,6 +22,11 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl check: Pass(Check), }; + // If the caller/callee don't support these options, skip them + if !caller.supports_options(&test.options) || !callee.supports_options(&test.options) { + result.run = Skip; + } + // Now apply specific custom expectations for platforms/suites let is_c = caller.lang() == "c" || callee.lang() == "c"; let is_rust = caller.lang() == "rust" || callee.lang() == "rust"; @@ -30,7 +36,7 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl // This is Bad! Ideally we should check for all clang<->gcc pairs but to start // let's mark rust <-> C as disagreeing (because rust also disagrees with clang). if !cfg!(any(target_arch = "aarch64", target_arch = "s390x")) - && test.test_name == "ui128" + && test.test == "ui128" && is_rust_and_c { result.check = Busted(Check); @@ -41,12 +47,12 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl // so let's keep running them and just ignore the result for now. // // Anyone who cares about this situation more can make the expectations more precise. - if cfg!(windows) && test.test_name == "ui128" { + if cfg!(windows) && test.test == "ui128" { result.check = Random; } // This test is just for investigation right now, nothing normative - if test.test_name == "sysv_i128_emulation" { + if test.test == "sysv_i128_emulation" { result.check = Random; } @@ -207,14 +213,10 @@ pub struct TestSummary { #[derive(Debug, Clone, Serialize)] pub struct TestKey { - pub test_name: String, - pub convention: String, - pub caller_id: String, - pub callee_id: String, - #[serde(skip)] - pub caller_variant: TestForAbi, - #[serde(skip)] - pub callee_variant: TestForAbi, + pub test: TestId, + pub caller: AbiImplId, + pub callee: AbiImplId, + pub options: TestOptions, } #[derive(Debug, Clone, Serialize)] @@ -288,8 +290,8 @@ impl Default for TestRunResults { #[derive(Debug, Serialize)] pub struct GenerateOutput { - pub caller_src: PathBuf, - pub callee_src: PathBuf, + pub caller_src: Utf8PathBuf, + pub callee_src: Utf8PathBuf, } #[derive(Debug, Serialize)] @@ -300,7 +302,7 @@ pub struct BuildOutput { #[derive(Debug, Serialize)] pub struct LinkOutput { - pub test_bin: PathBuf, + pub test_bin: Utf8PathBuf, } pub type Functions = From 236495e5a06417b9ea6a1a4075af43dc515b7260 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 27 May 2024 00:45:00 -0400 Subject: [PATCH 16/44] fix: actually cache builds --- src/abis/mod.rs | 5 +++ src/harness/build.rs | 48 ++++++++++++++--------------- src/harness/mod.rs | 2 +- src/main.rs | 72 ++++++++++++++++++++++++++++++++++++++------ 4 files changed, 92 insertions(+), 35 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index e8ed05e..95d6d0c 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -135,6 +135,11 @@ impl CallSide { } } } +impl std::fmt::Display for CallSide { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} /// A test case, specialized to a specific ABI (PunEnv) /// diff --git a/src/harness/build.rs b/src/harness/build.rs index 2355fac..d9c4059 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -1,13 +1,14 @@ use std::env; use std::path::PathBuf; use std::process::Command; +use std::sync::Arc; use camino::{Utf8Path, Utf8PathBuf}; use crate::harness::full_test_name; -use crate::report::*; use crate::{built_info, AbiImpl, TestKey}; use crate::{error::*, TestOptions}; +use crate::{report::*, AbiImplId, CallSide, TestId}; const OUT_DIR: &str = "target/temp"; @@ -27,32 +28,29 @@ pub fn init_build_dir() -> Result { Ok(out_dir) } -pub fn build_test( - test_key @ TestKey { - test: test_id, - caller: caller_id, - callee: callee_id, - options: TestOptions { convention }, - }: &TestKey, - caller: &dyn AbiImpl, - callee: &dyn AbiImpl, - src: &GenerateOutput, - out_dir: &Utf8Path, -) -> Result { - let full_test_name = full_test_name(test_key); - eprintln!("compiling {full_test_name}"); - - let caller_lib = format!("{test_id}_{convention}_{caller_id}_caller"); - let callee_lib = format!("{test_id}_{convention}_{callee_id}_callee"); +pub fn lib_name( + test_id: &TestId, + abi_impl: &AbiImplId, + call_side: CallSide, + options: &TestOptions, +) -> String { + let TestOptions { convention } = options; + format!("{test_id}_{convention}_{abi_impl}_{call_side}") +} - // Compile the tests (and let them change the lib name). - let caller_lib = caller.compile_caller(&src.caller_src, out_dir, &caller_lib)?; - let callee_lib = callee.compile_callee(&src.callee_src, out_dir, &callee_lib)?; +pub async fn compile_lib( + src_path: &Utf8Path, + abi: Arc, + call_side: CallSide, + out_dir: &Utf8Path, + lib_name: &str, +) -> Result { + let lib_name = match call_side { + CallSide::Callee => abi.compile_callee(src_path, out_dir, lib_name)?, + CallSide::Caller => abi.compile_caller(src_path, out_dir, lib_name)?, + }; - Ok(BuildOutput { - caller_lib, - callee_lib, - }) + Ok(lib_name) } /// Compile and link the test harness with the two sides of the FFI boundary. diff --git a/src/harness/mod.rs b/src/harness/mod.rs index d080e24..f1fe230 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -14,7 +14,7 @@ mod generate; mod read; mod run; -pub use build::{build_test, init_build_dir, link_test}; +pub use build::{compile_lib, init_build_dir, lib_name, link_test}; pub use check::check_test; pub use generate::{generate_src, init_generate_dir, src_path}; pub use read::read_tests; diff --git a/src/main.rs b/src/main.rs index f9f39ff..4ec5fbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,12 +75,11 @@ pub struct TestsFailed {} #[derive(Default)] pub struct TestRunner { - pub tests: SortedMap>, - pub abi_impls: SortedMap>, - pub test_with_abi_impls: Mutex>>>>, - pub sources: Mutex>>>, - pub static_libs: Mutex>>>, - pub dynamic_libs: Mutex>>>, + tests: SortedMap>, + abi_impls: SortedMap>, + test_with_abi_impls: Mutex>>>>, + sources: Mutex>>>, + static_libs: Mutex>>>, } impl TestRunner { @@ -147,6 +146,32 @@ impl TestRunner { .await?; Ok(src_path) } + pub async fn build_lib( + &self, + test_id: TestId, + abi_id: AbiImplId, + call_side: CallSide, + options: TestOptions, + src_path: &Utf8Path, + out_dir: &Utf8Path, + ) -> Result { + let abi_impl = self.abi_impls[&abi_id].clone(); + let lib_name = harness::lib_name(&test_id, &abi_id, call_side, &options); + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .static_libs + .lock() + .unwrap() + .entry(lib_name.clone()) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let real_lib_name = once + .get_or_try_init(|| compile_lib(&src_path, abi_impl, call_side, out_dir, &lib_name)) + .await? + .clone(); + Ok(real_lib_name) + } pub fn get_test_rules(&self, test_key: &TestKey) -> TestRules { let caller = self.abi_impls[&test_key.caller].clone(); let callee = self.abi_impls[&test_key.callee].clone(); @@ -225,6 +250,10 @@ impl TestRunner { run_results } pub async fn generate_test(&self, key: &TestKey) -> Result { + let full_test_name = full_test_name(key); + eprintln!("generating {full_test_name}"); + + // FIXME: these two could be done concurrently let caller_src = self .generate_src( key.test.clone(), @@ -253,9 +282,34 @@ impl TestRunner { src: &GenerateOutput, out_dir: &Utf8Path, ) -> Result { - let caller = self.abi_impls[&key.caller].clone(); - let callee = self.abi_impls[&key.callee].clone(); - build_test(key, &*caller, &*callee, src, out_dir) + let full_test_name = full_test_name(key); + eprintln!("compiling {full_test_name}"); + + // FIXME: these two could be done concurrently + let caller_lib = self + .build_lib( + key.test.clone(), + key.caller.clone(), + CallSide::Caller, + key.options.clone(), + &src.caller_src, + out_dir, + ) + .await?; + let callee_lib = self + .build_lib( + key.test.clone(), + key.callee.clone(), + CallSide::Callee, + key.options.clone(), + &src.callee_src, + out_dir, + ) + .await?; + Ok(BuildOutput { + caller_lib, + callee_lib, + }) } pub async fn link_test( &self, From f5ad20499db433a6e8de9134d2fedf6b6a4f6743 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 27 May 2024 14:40:07 -0400 Subject: [PATCH 17/44] chore: move logic back into dedicated modules --- src/abis/mod.rs | 3 + src/harness/build.rs | 83 +++++++++++++++++++-- src/harness/check.rs | 20 ++++- src/harness/generate.rs | 64 +++++++++++++++- src/harness/mod.rs | 16 +++- src/harness/run.rs | 24 +++++- src/main.rs | 158 +--------------------------------------- 7 files changed, 194 insertions(+), 174 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 95d6d0c..dcf961b 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -14,6 +14,9 @@ use serde::Serialize; use crate::error::{BuildError, GenerateError}; +pub type AbiImplId = String; +pub type TestId = String; + pub static ABI_IMPL_RUSTC: &str = "rustc"; pub static ABI_IMPL_CC: &str = "cc"; pub static ABI_IMPL_GCC: &str = "gcc"; diff --git a/src/harness/build.rs b/src/harness/build.rs index d9c4059..f7ff599 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -5,13 +5,86 @@ use std::sync::Arc; use camino::{Utf8Path, Utf8PathBuf}; -use crate::harness::full_test_name; -use crate::{built_info, AbiImpl, TestKey}; -use crate::{error::*, TestOptions}; -use crate::{report::*, AbiImplId, CallSide, TestId}; +use crate::error::*; +use crate::report::*; +use crate::*; const OUT_DIR: &str = "target/temp"; +impl TestRunner { + pub async fn build_test( + &self, + key: &TestKey, + src: &GenerateOutput, + out_dir: &Utf8Path, + ) -> Result { + let full_test_name = full_test_name(key); + eprintln!("compiling {full_test_name}"); + + // FIXME: these two could be done concurrently + let caller_lib = self + .build_lib( + key.test.clone(), + key.caller.clone(), + CallSide::Caller, + key.options.clone(), + &src.caller_src, + out_dir, + ) + .await?; + let callee_lib = self + .build_lib( + key.test.clone(), + key.callee.clone(), + CallSide::Callee, + key.options.clone(), + &src.callee_src, + out_dir, + ) + .await?; + Ok(BuildOutput { + caller_lib, + callee_lib, + }) + } + + async fn build_lib( + &self, + test_id: TestId, + abi_id: AbiImplId, + call_side: CallSide, + options: TestOptions, + src_path: &Utf8Path, + out_dir: &Utf8Path, + ) -> Result { + let abi_impl = self.abi_impls[&abi_id].clone(); + let lib_name = lib_name(&test_id, &abi_id, call_side, &options); + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .static_libs + .lock() + .unwrap() + .entry(lib_name.clone()) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let real_lib_name = once + .get_or_try_init(|| compile_lib(&src_path, abi_impl, call_side, out_dir, &lib_name)) + .await? + .clone(); + Ok(real_lib_name) + } + + pub async fn link_test( + &self, + key: &TestKey, + build: &BuildOutput, + out_dir: &Utf8Path, + ) -> Result { + link_test(key, build, out_dir) + } +} + /// Delete and recreate the build dir pub fn init_build_dir() -> Result { let out_dir = Utf8PathBuf::from(OUT_DIR); @@ -28,7 +101,7 @@ pub fn init_build_dir() -> Result { Ok(out_dir) } -pub fn lib_name( +fn lib_name( test_id: &TestId, abi_impl: &AbiImplId, call_side: CallSide, diff --git a/src/harness/check.rs b/src/harness/check.rs index 1604eae..e57cbab 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -1,11 +1,25 @@ use std::sync::Arc; use crate::error::*; -use crate::harness::full_subtest_name; use crate::report::*; -use crate::TestForAbi; +use crate::*; -pub fn check_test( +impl TestRunner { + pub async fn check_test(&self, key: &TestKey, results: &RunOutput) -> CheckOutput { + let test = self.tests[&key.test].clone(); + let caller_impl = self + .test_with_abi_impl(&test, key.caller.clone()) + .await + .unwrap(); + let callee_impl = self + .test_with_abi_impl(&test, key.callee.clone()) + .await + .unwrap(); + check_test(key, caller_impl, callee_impl, results) + } +} + +fn check_test( test_key: &TestKey, caller_impl: Arc, _callee_impl: Arc, diff --git a/src/harness/generate.rs b/src/harness/generate.rs index a178dfe..4caa90b 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -3,15 +3,73 @@ use camino::Utf8PathBuf; use std::fs::File; use std::io::Write; use std::sync::Arc; +use tokio::sync::OnceCell; use crate::abis::*; use crate::error::*; -use crate::{AbiImplId, CallSide, TestId, TestOptions}; - +use crate::*; const GENERATED_SRC_DIR: &str = "generated_impls"; const HANDWRITTEN_SRC_DIR: &str = "handwritten_impls"; -pub fn src_path( +impl TestRunner { + pub async fn generate_test(&self, key: &TestKey) -> Result { + let full_test_name = full_test_name(key); + eprintln!("generating {full_test_name}"); + + // FIXME: these two could be done concurrently + let caller_src = self + .generate_src( + key.test.clone(), + key.caller.clone(), + CallSide::Caller, + key.options.clone(), + ) + .await?; + let callee_src = self + .generate_src( + key.test.clone(), + key.callee.clone(), + CallSide::Callee, + key.options.clone(), + ) + .await?; + + Ok(GenerateOutput { + caller_src, + callee_src, + }) + } + + async fn generate_src( + &self, + test_id: TestId, + abi_id: AbiImplId, + call_side: CallSide, + options: TestOptions, + ) -> Result { + let abi_impl = self.abi_impls[&abi_id].clone(); + let src_path = src_path(&test_id, &abi_id, &*abi_impl, call_side, &options); + let test = self.tests[&test_id].clone(); + let test_with_abi = self.test_with_abi_impl(&test, abi_id).await?; + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .sources + .lock() + .unwrap() + .entry(src_path.clone()) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let _ = once + .get_or_try_init(|| { + generate_src(&src_path, abi_impl, test_with_abi, call_side, options) + }) + .await?; + Ok(src_path) + } +} + +fn src_path( test_id: &TestId, abi_id: &AbiImplId, abi: &dyn AbiImpl, diff --git a/src/harness/mod.rs b/src/harness/mod.rs index f1fe230..9254bc3 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -6,6 +6,8 @@ //! 4. running the test impls //! 5. checking the test results +use std::error::Error; + use crate::{TestKey, TestOptions}; mod build; @@ -14,11 +16,17 @@ mod generate; mod read; mod run; -pub use build::{compile_lib, init_build_dir, lib_name, link_test}; -pub use check::check_test; -pub use generate::{generate_src, init_generate_dir, src_path}; +use build::init_build_dir; +use camino::Utf8PathBuf; +use generate::init_generate_dir; pub use read::read_tests; -pub use run::{run_dynamic_test, WriteBuffer}; +pub use run::WriteBuffer; + +pub fn init_dirs() -> Result> { + init_generate_dir()?; + let build_dir = init_build_dir()?; + Ok(build_dir) +} /// The name of a test for pretty-printing. pub fn full_test_name( diff --git a/src/harness/run.rs b/src/harness/run.rs index b072d3c..1c44a88 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -7,10 +7,28 @@ use kdl_script::types::{Ty, TyIdx}; use linked_hash_map::LinkedHashMap; use serde::Serialize; -use crate::harness::full_test_name; +use crate::error::*; use crate::report::*; -use crate::{error::*, TestForAbi}; -use crate::{LinkOutput, Test, TestKey}; +use crate::*; + +impl TestRunner { + pub async fn run_dynamic_test( + &self, + key: &TestKey, + test_dylib: &LinkOutput, + ) -> Result { + let test = self.tests[&key.test].clone(); + let caller_impl = self + .test_with_abi_impl(&test, key.caller.clone()) + .await + .unwrap(); + let callee_impl = self + .test_with_abi_impl(&test, key.callee.clone()) + .await + .unwrap(); + run_dynamic_test(key, caller_impl, callee_impl, test_dylib) + } +} /// Tests write back the raw bytes of their values to a WriteBuffer. /// diff --git a/src/main.rs b/src/main.rs index 4ec5fbc..324ec68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ mod harness; mod report; use abis::*; -use camino::{Utf8Path, Utf8PathBuf}; +use camino::Utf8PathBuf; use error::*; use harness::*; use report::*; @@ -18,8 +18,6 @@ use std::sync::{Arc, Mutex}; use tokio::sync::OnceCell; pub type SortedMap = std::collections::BTreeMap; -pub type AbiImplId = String; -pub type TestId = String; /// Slurps up details of how this crate was compiled, which we can use /// to better compile the actual tests since we're currently compiling them on @@ -119,59 +117,6 @@ impl TestRunner { .clone(); Ok(output) } - pub async fn generate_src( - &self, - test_id: TestId, - abi_id: AbiImplId, - call_side: CallSide, - options: TestOptions, - ) -> Result { - let abi_impl = self.abi_impls[&abi_id].clone(); - let src_path = harness::src_path(&test_id, &abi_id, &*abi_impl, call_side, &options); - let test = self.tests[&test_id].clone(); - let test_with_abi = self.test_with_abi_impl(&test, abi_id).await?; - // Briefly lock this map to insert/acquire a OnceCell and then release the lock - let once = self - .sources - .lock() - .unwrap() - .entry(src_path.clone()) - .or_insert_with(|| Arc::new(OnceCell::new())) - .clone(); - // Either acquire the cached result, or make it - let _ = once - .get_or_try_init(|| { - generate_src(&src_path, abi_impl, test_with_abi, call_side, options) - }) - .await?; - Ok(src_path) - } - pub async fn build_lib( - &self, - test_id: TestId, - abi_id: AbiImplId, - call_side: CallSide, - options: TestOptions, - src_path: &Utf8Path, - out_dir: &Utf8Path, - ) -> Result { - let abi_impl = self.abi_impls[&abi_id].clone(); - let lib_name = harness::lib_name(&test_id, &abi_id, call_side, &options); - // Briefly lock this map to insert/acquire a OnceCell and then release the lock - let once = self - .static_libs - .lock() - .unwrap() - .entry(lib_name.clone()) - .or_insert_with(|| Arc::new(OnceCell::new())) - .clone(); - // Either acquire the cached result, or make it - let real_lib_name = once - .get_or_try_init(|| compile_lib(&src_path, abi_impl, call_side, out_dir, &lib_name)) - .await? - .clone(); - Ok(real_lib_name) - } pub fn get_test_rules(&self, test_key: &TestKey) -> TestRules { let caller = self.abi_impls[&test_key.caller].clone(); let callee = self.abi_impls[&test_key.callee].clone(); @@ -249,104 +194,6 @@ impl TestRunner { run_results } - pub async fn generate_test(&self, key: &TestKey) -> Result { - let full_test_name = full_test_name(key); - eprintln!("generating {full_test_name}"); - - // FIXME: these two could be done concurrently - let caller_src = self - .generate_src( - key.test.clone(), - key.caller.clone(), - CallSide::Caller, - key.options.clone(), - ) - .await?; - let callee_src = self - .generate_src( - key.test.clone(), - key.callee.clone(), - CallSide::Callee, - key.options.clone(), - ) - .await?; - - Ok(GenerateOutput { - caller_src, - callee_src, - }) - } - pub async fn build_test( - &self, - key: &TestKey, - src: &GenerateOutput, - out_dir: &Utf8Path, - ) -> Result { - let full_test_name = full_test_name(key); - eprintln!("compiling {full_test_name}"); - - // FIXME: these two could be done concurrently - let caller_lib = self - .build_lib( - key.test.clone(), - key.caller.clone(), - CallSide::Caller, - key.options.clone(), - &src.caller_src, - out_dir, - ) - .await?; - let callee_lib = self - .build_lib( - key.test.clone(), - key.callee.clone(), - CallSide::Callee, - key.options.clone(), - &src.callee_src, - out_dir, - ) - .await?; - Ok(BuildOutput { - caller_lib, - callee_lib, - }) - } - pub async fn link_test( - &self, - key: &TestKey, - build: &BuildOutput, - out_dir: &Utf8Path, - ) -> Result { - link_test(key, build, out_dir) - } - pub async fn run_dynamic_test( - &self, - key: &TestKey, - test_dylib: &LinkOutput, - ) -> Result { - let test = self.tests[&key.test].clone(); - let caller_impl = self - .test_with_abi_impl(&test, key.caller.clone()) - .await - .unwrap(); - let callee_impl = self - .test_with_abi_impl(&test, key.callee.clone()) - .await - .unwrap(); - run_dynamic_test(key, caller_impl, callee_impl, test_dylib) - } - pub async fn check_test(&self, key: &TestKey, results: &RunOutput) -> CheckOutput { - let test = self.tests[&key.test].clone(); - let caller_impl = self - .test_with_abi_impl(&test, key.caller.clone()) - .await - .unwrap(); - let callee_impl = self - .test_with_abi_impl(&test, key.callee.clone()) - .await - .unwrap(); - check_test(key, caller_impl, callee_impl, results) - } } fn main() -> Result<(), Box> { @@ -356,8 +203,7 @@ fn main() -> Result<(), Box> { // Before doing anything, regenerate the procgen tests, if needed. // TODO: procgen::procgen_tests(cfg.procgen_tests); eprintln!("generated tests!"); - init_generate_dir()?; - let out_dir = init_build_dir()?; + let out_dir = init_dirs()?; let mut runner = TestRunner::new(); From ee28ca62f9bc1711d8ab7a6fa3572700125ae640 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 2 Jun 2024 22:10:10 -0400 Subject: [PATCH 18/44] refactor to put all options in test key --- src/abis/mod.rs | 13 ++ src/abis/rust.rs | 9 +- src/harness/build.rs | 92 +++++--------- src/harness/check.rs | 271 ++++++++++++++++++++-------------------- src/harness/generate.rs | 70 ++++------- src/harness/mod.rs | 85 +++++++++---- src/harness/run.rs | 11 +- src/main.rs | 38 +++--- src/report.rs | 32 ++++- 9 files changed, 329 insertions(+), 292 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index dcf961b..b96e627 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -123,6 +123,19 @@ pub struct Test { pub struct TestOptions { /// The calling convention pub convention: CallingConvention, + pub functions: FunctionSelector, +} + +#[derive(Clone, Debug, Serialize)] +pub enum FunctionSelector { + All, + One { idx: FuncIdx, args: ArgSelector }, +} + +#[derive(Clone, Debug, Serialize)] +pub enum ArgSelector { + All, + One { idx: usize }, } #[derive(Copy, Clone, Debug)] diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 1f471fc..494ac70 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -44,8 +44,13 @@ impl AbiImpl for RustcAbiImpl { lang: "rust".to_string(), }) } - fn supports_options(&self, options: &TestOptions) -> bool { - let TestOptions { convention } = options; + fn supports_options( + &self, + TestOptions { + convention, + functions, + }: &TestOptions, + ) -> bool { // NOTE: Rustc spits out: // // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, diff --git a/src/harness/build.rs b/src/harness/build.rs index f7ff599..7575f2f 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -11,36 +11,19 @@ use crate::*; const OUT_DIR: &str = "target/temp"; -impl TestRunner { +impl TestHarness { pub async fn build_test( &self, key: &TestKey, src: &GenerateOutput, out_dir: &Utf8Path, ) -> Result { - let full_test_name = full_test_name(key); - eprintln!("compiling {full_test_name}"); - // FIXME: these two could be done concurrently let caller_lib = self - .build_lib( - key.test.clone(), - key.caller.clone(), - CallSide::Caller, - key.options.clone(), - &src.caller_src, - out_dir, - ) + .build_static_lib(key, CallSide::Caller, &src.caller_src, out_dir) .await?; let callee_lib = self - .build_lib( - key.test.clone(), - key.callee.clone(), - CallSide::Callee, - key.options.clone(), - &src.callee_src, - out_dir, - ) + .build_static_lib(key, CallSide::Callee, &src.callee_src, out_dir) .await?; Ok(BuildOutput { caller_lib, @@ -48,17 +31,15 @@ impl TestRunner { }) } - async fn build_lib( + async fn build_static_lib( &self, - test_id: TestId, - abi_id: AbiImplId, + key: &TestKey, call_side: CallSide, - options: TestOptions, src_path: &Utf8Path, out_dir: &Utf8Path, ) -> Result { - let abi_impl = self.abi_impls[&abi_id].clone(); - let lib_name = lib_name(&test_id, &abi_id, call_side, &options); + let abi_impl = self.abi_by_test_key(key, call_side); + let lib_name = self.static_lib_name(key, call_side); // Briefly lock this map to insert/acquire a OnceCell and then release the lock let once = self .static_libs @@ -69,19 +50,35 @@ impl TestRunner { .clone(); // Either acquire the cached result, or make it let real_lib_name = once - .get_or_try_init(|| compile_lib(&src_path, abi_impl, call_side, out_dir, &lib_name)) + .get_or_try_init(|| { + eprintln!("compiling {lib_name}"); + build_static_lib(&src_path, abi_impl, call_side, out_dir, &lib_name) + }) .await? .clone(); Ok(real_lib_name) } - pub async fn link_test( + pub async fn link_dynamic_lib( &self, key: &TestKey, build: &BuildOutput, out_dir: &Utf8Path, ) -> Result { - link_test(key, build, out_dir) + let full_test_name = self.full_test_name(key); + let dynamic_lib_name = self.dynamic_lib_name(key); + eprintln!("linking {full_test_name}"); + link_dynamic_lib(build, out_dir, &dynamic_lib_name) + } + + fn static_lib_name(&self, key: &TestKey, call_side: CallSide) -> String { + self.base_id(key, Some(call_side), "_") + } + + fn dynamic_lib_name(&self, key: &TestKey) -> String { + let mut output = self.base_id(key, None, "_"); + output.push_str(".dll"); + output } } @@ -101,49 +98,28 @@ pub fn init_build_dir() -> Result { Ok(out_dir) } -fn lib_name( - test_id: &TestId, - abi_impl: &AbiImplId, - call_side: CallSide, - options: &TestOptions, -) -> String { - let TestOptions { convention } = options; - format!("{test_id}_{convention}_{abi_impl}_{call_side}") -} - -pub async fn compile_lib( +async fn build_static_lib( src_path: &Utf8Path, abi: Arc, call_side: CallSide, out_dir: &Utf8Path, - lib_name: &str, + static_lib_name: &str, ) -> Result { let lib_name = match call_side { - CallSide::Callee => abi.compile_callee(src_path, out_dir, lib_name)?, - CallSide::Caller => abi.compile_caller(src_path, out_dir, lib_name)?, + CallSide::Callee => abi.compile_callee(src_path, out_dir, static_lib_name)?, + CallSide::Caller => abi.compile_caller(src_path, out_dir, static_lib_name)?, }; Ok(lib_name) } /// Compile and link the test harness with the two sides of the FFI boundary. -pub fn link_test( - test_key @ TestKey { - test: test_id, - caller: caller_id, - callee: callee_id, - options: TestOptions { convention }, - }: &TestKey, +fn link_dynamic_lib( build: &BuildOutput, out_dir: &Utf8Path, + dynamic_lib_name: &str, ) -> Result { - let full_test_name = full_test_name(test_key); let src = PathBuf::from("harness/harness.rs"); - let output = out_dir.join(format!( - "{test_id}_{convention}_{caller_id}_calls_{callee_id}_harness.dll" - )); - eprintln!("linking {full_test_name}"); - let mut cmd = Command::new("rustc"); cmd.arg("-v") .arg("-L") @@ -160,7 +136,7 @@ pub fn link_test( // .arg("--out-dir") // .arg("target/temp/") .arg("-o") - .arg(&output) + .arg(&dynamic_lib_name) .arg(&src); eprintln!("running: {:?}", cmd); @@ -170,7 +146,7 @@ pub fn link_test( Err(LinkError::RustLink(out)) } else { Ok(LinkOutput { - test_bin: Utf8PathBuf::from(output), + test_bin: Utf8PathBuf::from(dynamic_lib_name), }) } } diff --git a/src/harness/check.rs b/src/harness/check.rs index e57cbab..60e428a 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -1,189 +1,184 @@ -use std::sync::Arc; - use crate::error::*; use crate::report::*; use crate::*; -impl TestRunner { - pub async fn check_test(&self, key: &TestKey, results: &RunOutput) -> CheckOutput { +impl TestHarness { + pub async fn check_test( + &self, + key: &TestKey, + RunOutput { + caller: _, + callee: _, + caller_inputs, + caller_outputs, + callee_inputs, + callee_outputs, + }: &RunOutput, + ) -> CheckOutput { let test = self.tests[&key.test].clone(); let caller_impl = self .test_with_abi_impl(&test, key.caller.clone()) .await .unwrap(); - let callee_impl = self - .test_with_abi_impl(&test, key.callee.clone()) - .await - .unwrap(); - check_test(key, caller_impl, callee_impl, results) - } -} -fn check_test( - test_key: &TestKey, - caller_impl: Arc, - _callee_impl: Arc, - RunOutput { - caller_inputs, - caller_outputs, - callee_inputs, - callee_outputs, - .. - }: &RunOutput, -) -> CheckOutput { - // Now check the results + // Now check the results - // Start peeling back the layers of the buffers. - // funcs (subtests) -> vals (args/returns) -> fields -> bytes + // Start peeling back the layers of the buffers. + // funcs (subtests) -> vals (args/returns) -> fields -> bytes - let mut results: Vec> = Vec::new(); + let mut results: Vec> = Vec::new(); - // Layer 1 is the funcs/subtests. Because we have already checked - // that they agree on their lengths, we can zip them together - // to walk through their views of each subtest's execution. - 'funcs: for (func_idx, (((caller_inputs, caller_outputs), callee_inputs), callee_outputs)) in - caller_inputs + // Layer 1 is the funcs/subtests. Because we have already checked + // that they agree on their lengths, we can zip them together + // to walk through their views of each subtest's execution. + 'funcs: for ( + func_idx, + (((caller_inputs, caller_outputs), callee_inputs), callee_outputs), + ) in caller_inputs .funcs .iter() .zip(&caller_outputs.funcs) .zip(&callee_inputs.funcs) .zip(&callee_outputs.funcs) .enumerate() - { - // Now we must enforce that the caller and callee agree on how - // many inputs and outputs there were. If this fails that's a - // very fundamental issue, and indicative of a bad test generator. - if caller_inputs.len() != callee_inputs.len() { - results.push(Err(CheckFailure::InputCountMismatch( - func_idx, - caller_inputs.clone(), - callee_inputs.clone(), - ))); - continue 'funcs; - } - if caller_outputs.len() != callee_outputs.len() { - results.push(Err(CheckFailure::OutputCountMismatch( - func_idx, - caller_outputs.clone(), - callee_outputs.clone(), - ))); - continue 'funcs; - } - - // Layer 2 is the values (arguments/returns). - // The inputs and outputs loop do basically the same work, - // but are separate for the sake of error-reporting quality. - - // Process Inputs - for (input_idx, (caller_val, callee_val)) in - caller_inputs.iter().zip(callee_inputs).enumerate() { // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::InputFieldCountMismatch( + // many inputs and outputs there were. If this fails that's a + // very fundamental issue, and indicative of a bad test generator. + if caller_inputs.len() != callee_inputs.len() { + results.push(Err(CheckFailure::InputCountMismatch( func_idx, - input_idx, - caller_val.clone(), - callee_val.clone(), - String::from("todo"), + caller_inputs.clone(), + callee_inputs.clone(), ))); continue 'funcs; } + if caller_outputs.len() != callee_outputs.len() { + results.push(Err(CheckFailure::OutputCountMismatch( + func_idx, + caller_outputs.clone(), + callee_outputs.clone(), + ))); + continue 'funcs; + } + + // Layer 2 is the values (arguments/returns). + // The inputs and outputs loop do basically the same work, + // but are separate for the sake of error-reporting quality. - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() + // Process Inputs + for (input_idx, (caller_val, callee_val)) in + caller_inputs.iter().zip(callee_inputs).enumerate() { - if caller_field != callee_field { - results.push(Err(CheckFailure::InputFieldMismatch( + // Now we must enforce that the caller and callee agree on how + // many fields each value had. + if caller_val.len() != callee_val.len() { + results.push(Err(CheckFailure::InputFieldCountMismatch( func_idx, input_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), + caller_val.clone(), + callee_val.clone(), String::from("todo"), ))); continue 'funcs; } - } - } - // Process Outputs - for (output_idx, (caller_val, callee_val)) in - caller_outputs.iter().zip(callee_outputs).enumerate() - { - // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::OutputFieldCountMismatch( - func_idx, - output_idx, - caller_val.clone(), - callee_val.clone(), - ))); - continue 'funcs; + // Layer 3 is the leaf subfields of the values. + // At this point we just need to assert that they agree on the bytes. + for (field_idx, (caller_field, callee_field)) in + caller_val.iter().zip(callee_val).enumerate() + { + if caller_field != callee_field { + results.push(Err(CheckFailure::InputFieldMismatch( + func_idx, + input_idx, + field_idx, + caller_field.clone(), + callee_field.clone(), + String::from("todo"), + ))); + continue 'funcs; + } + } } - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() + // Process Outputs + for (output_idx, (caller_val, callee_val)) in + caller_outputs.iter().zip(callee_outputs).enumerate() { - if caller_field != callee_field { - results.push(Err(CheckFailure::OutputFieldMismatch( + // Now we must enforce that the caller and callee agree on how + // many fields each value had. + if caller_val.len() != callee_val.len() { + results.push(Err(CheckFailure::OutputFieldCountMismatch( func_idx, output_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), + caller_val.clone(), + callee_val.clone(), ))); continue 'funcs; } - } - } - // If we got this far then the test passes - results.push(Ok(())); - } + // Layer 3 is the leaf subfields of the values. + // At this point we just need to assert that they agree on the bytes. + for (field_idx, (caller_field, callee_field)) in + caller_val.iter().zip(callee_val).enumerate() + { + if caller_field != callee_field { + results.push(Err(CheckFailure::OutputFieldMismatch( + func_idx, + output_idx, + field_idx, + caller_field.clone(), + callee_field.clone(), + ))); + continue 'funcs; + } + } + } - // Report the results of each subtest - // - // This will be done again after all tests have been run, but it's - // useful to keep a version of this near the actual compilation/execution - // in case the compilers spit anything interesting to stdout/stderr. - let names = caller_impl - .types - .all_funcs() - .map(|func_id| full_subtest_name(test_key, &caller_impl.types.realize_func(func_id).name)) - .collect::>(); - let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); - let num_passed = results.iter().filter(|r| r.is_ok()).count(); - let all_passed = num_passed == results.len(); + // If we got this far then the test passes + results.push(Ok(())); + } - for (subtest_name, result) in names.iter().zip(&results) { - match result { - Ok(()) => { - eprintln!("Test {subtest_name:width$} passed", width = max_name_len); - } - Err(e) => { - eprintln!("Test {subtest_name:width$} failed!", width = max_name_len); - eprintln!("{}", e); + // Report the results of each subtest + // + // This will be done again after all tests have been run, but it's + // useful to keep a version of this near the actual compilation/execution + // in case the compilers spit anything interesting to stdout/stderr. + let names = caller_impl + .types + .all_funcs() + .map(|func_id| { + self.full_subtest_name(key, &caller_impl.types.realize_func(func_id).name) + }) + .collect::>(); + let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); + let num_passed = results.iter().filter(|r| r.is_ok()).count(); + let all_passed = num_passed == results.len(); + + for (subtest_name, result) in names.iter().zip(&results) { + match result { + Ok(()) => { + eprintln!("Test {subtest_name:width$} passed", width = max_name_len); + } + Err(e) => { + eprintln!("Test {subtest_name:width$} failed!", width = max_name_len); + eprintln!("{}", e); + } } } - } - if all_passed { - eprintln!("all tests passed"); - } else { - eprintln!("only {}/{} tests passed!", num_passed, results.len()); - } - eprintln!(); + if all_passed { + eprintln!("all tests passed"); + } else { + eprintln!("only {}/{} tests passed!", num_passed, results.len()); + } + eprintln!(); - CheckOutput { - all_passed, - subtest_names: names, - subtest_checks: results, + CheckOutput { + all_passed, + subtest_names: names, + subtest_checks: results, + } } } diff --git a/src/harness/generate.rs b/src/harness/generate.rs index 4caa90b..fbc94f5 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -8,31 +8,15 @@ use tokio::sync::OnceCell; use crate::abis::*; use crate::error::*; use crate::*; + const GENERATED_SRC_DIR: &str = "generated_impls"; const HANDWRITTEN_SRC_DIR: &str = "handwritten_impls"; -impl TestRunner { +impl TestHarness { pub async fn generate_test(&self, key: &TestKey) -> Result { - let full_test_name = full_test_name(key); - eprintln!("generating {full_test_name}"); - // FIXME: these two could be done concurrently - let caller_src = self - .generate_src( - key.test.clone(), - key.caller.clone(), - CallSide::Caller, - key.options.clone(), - ) - .await?; - let callee_src = self - .generate_src( - key.test.clone(), - key.callee.clone(), - CallSide::Callee, - key.options.clone(), - ) - .await?; + let caller_src = self.generate_src(key, CallSide::Caller).await?; + let callee_src = self.generate_src(key, CallSide::Callee).await?; Ok(GenerateOutput { caller_src, @@ -42,15 +26,14 @@ impl TestRunner { async fn generate_src( &self, - test_id: TestId, - abi_id: AbiImplId, + key: &TestKey, call_side: CallSide, - options: TestOptions, ) -> Result { - let abi_impl = self.abi_impls[&abi_id].clone(); - let src_path = src_path(&test_id, &abi_id, &*abi_impl, call_side, &options); - let test = self.tests[&test_id].clone(); + let test = self.tests[&key.test].clone(); + let abi_id = key.abi_id(call_side).to_owned(); let test_with_abi = self.test_with_abi_impl(&test, abi_id).await?; + let src_path = self.src_path(key, call_side); + // Briefly lock this map to insert/acquire a OnceCell and then release the lock let once = self .sources @@ -62,32 +45,29 @@ impl TestRunner { // Either acquire the cached result, or make it let _ = once .get_or_try_init(|| { + let abi_impl = self.abi_by_test_key(key, call_side); + let options = key.options.clone(); + eprintln!("generating {}", &src_path); generate_src(&src_path, abi_impl, test_with_abi, call_side, options) }) .await?; Ok(src_path) } -} -fn src_path( - test_id: &TestId, - abi_id: &AbiImplId, - abi: &dyn AbiImpl, - call_side: CallSide, - options: &TestOptions, -) -> Utf8PathBuf { - let src_ext = abi.src_ext(); - let convention_name = options.convention.name(); - let call_side = call_side.name(); - let src_dir = if options.convention == CallingConvention::Handwritten { - Utf8PathBuf::from(HANDWRITTEN_SRC_DIR) - } else { - Utf8PathBuf::from(GENERATED_SRC_DIR) - }; + fn src_path(&self, key: &TestKey, call_side: CallSide) -> Utf8PathBuf { + let src_dir = if key.options.convention == CallingConvention::Handwritten { + Utf8PathBuf::from(HANDWRITTEN_SRC_DIR) + } else { + Utf8PathBuf::from(GENERATED_SRC_DIR) + }; - src_dir.join(abi_id).join(format!( - "{test_id}_{convention_name}_{abi_id}_{call_side}.{src_ext}" - )) + let abi_id = key.abi_id(call_side); + let abi = self.abi_by_test_key(key, call_side); + let mut output = self.base_id(key, Some(call_side), "_"); + output.push_str("."); + output.push_str(abi.src_ext()); + src_dir.join(abi_id).join(output) + } } /// Delete and recreate the generated src dir diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 9254bc3..2bbfcb7 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -8,7 +8,7 @@ use std::error::Error; -use crate::{TestKey, TestOptions}; +use crate::{ArgSelector, CallSide, FunctionSelector, TestHarness, TestKey, TestOptions}; mod build; mod check; @@ -28,27 +28,66 @@ pub fn init_dirs() -> Result> { Ok(build_dir) } -/// The name of a test for pretty-printing. -pub fn full_test_name( - TestKey { - test, - options: TestOptions { convention }, - caller, - callee, - }: &TestKey, -) -> String { - format!("{test}::{convention}::{caller}_calls_{callee}") -} +impl TestHarness { + fn base_id( + &self, + TestKey { + test, + options: + TestOptions { + convention, + functions, + }, + caller, + callee, + }: &TestKey, + call_side: Option, + separator: &str, + ) -> String { + let mut output = format!("{test}{separator}{convention}"); + if let FunctionSelector::One { idx, args } = functions { + let test = self.tests[test].clone(); + let func = test.types.realize_func(*idx); + output.push_str(separator); + output.push_str(&func.name); + if let ArgSelector::One { idx } = args { + let arg = func + .inputs + .iter() + .chain(&func.outputs) + .nth(*idx) + .expect("argument index out of bounds"); + output.push_str(separator); + output.push_str(&arg.name); + } + } + output.push_str(separator); + match call_side { + None => { + output.push_str(caller); + output.push_str("_calls_"); + output.push_str(callee); + } + Some(CallSide::Caller) => { + output.push_str(caller); + output.push_str("_caller"); + } + Some(CallSide::Callee) => { + output.push_str(callee); + output.push_str("_callee"); + } + } + output + } + + /// The name of a test for pretty-printing. + pub fn full_test_name(&self, key: &TestKey) -> String { + self.base_id(key, None, "::") + } -/// The name of a subtest for pretty-printing. -pub fn full_subtest_name( - TestKey { - test, - options: TestOptions { convention }, - caller, - callee, - }: &TestKey, - func_name: &str, -) -> String { - format!("{test}::{convention}::{caller}_calls_{callee}::{func_name}") + /// The name of a subtest for pretty-printing. + pub fn full_subtest_name(&self, key: &TestKey, func_name: &str) -> String { + let base = self.full_test_name(key); + format!("{base}::{func_name}") + } } diff --git a/src/harness/run.rs b/src/harness/run.rs index 1c44a88..051e146 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -11,13 +11,14 @@ use crate::error::*; use crate::report::*; use crate::*; -impl TestRunner { +impl TestHarness { pub async fn run_dynamic_test( &self, key: &TestKey, test_dylib: &LinkOutput, ) -> Result { let test = self.tests[&key.test].clone(); + let full_test_name = self.full_test_name(key); let caller_impl = self .test_with_abi_impl(&test, key.caller.clone()) .await @@ -26,7 +27,7 @@ impl TestRunner { .test_with_abi_impl(&test, key.callee.clone()) .await .unwrap(); - run_dynamic_test(key, caller_impl, callee_impl, test_dylib) + run_dynamic_test(caller_impl, callee_impl, test_dylib, &full_test_name) } } @@ -116,11 +117,11 @@ pub unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut /// Run the test! /// /// See the README for a high-level description of this design. -pub fn run_dynamic_test( - test_key: &TestKey, +fn run_dynamic_test( caller_impl: Arc, callee_impl: Arc, test_dylib: &LinkOutput, + full_test_name: &str, ) -> Result { // Initialize all the buffers the tests will write to let mut caller_inputs = WriteBuffer::new(); @@ -129,8 +130,6 @@ pub fn run_dynamic_test( let mut callee_outputs = WriteBuffer::new(); unsafe { - let full_test_name = full_test_name(test_key); - // Load the dylib of the test, and get its test_start symbol eprintln!("loading: {}", &test_dylib.test_bin); let lib = libloading::Library::new(&test_dylib.test_bin)?; diff --git a/src/main.rs b/src/main.rs index 324ec68..9dfba75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,7 +72,7 @@ pub struct Config { pub struct TestsFailed {} #[derive(Default)] -pub struct TestRunner { +pub struct TestHarness { tests: SortedMap>, abi_impls: SortedMap>, test_with_abi_impls: Mutex>>>>, @@ -80,7 +80,7 @@ pub struct TestRunner { static_libs: Mutex>>>, } -impl TestRunner { +impl TestHarness { pub fn new() -> Self { Self::default() } @@ -88,6 +88,15 @@ impl TestRunner { let old = self.abi_impls.insert(id.clone(), Arc::new(abi_impl)); assert!(old.is_none(), "duplicate abi impl id: {}", id); } + pub fn abi_by_test_key( + &self, + key: &TestKey, + call_side: CallSide, + ) -> Arc { + let abi_id = key.abi_id(call_side); + self.abi_impls[abi_id].clone() + } + pub fn set_tests(&mut self, tests: Vec) { for test in tests { let id = test.name.clone(); @@ -164,7 +173,7 @@ impl TestRunner { } run_results.ran_to = Link; - run_results.link = Some(self.link_test(&test_key, build, &out_dir).await); + run_results.link = Some(self.link_dynamic_lib(&test_key, build, &out_dir).await); let link = match run_results.link.as_ref().unwrap() { Ok(v) => v, Err(e) => { @@ -205,9 +214,9 @@ fn main() -> Result<(), Box> { eprintln!("generated tests!"); let out_dir = init_dirs()?; - let mut runner = TestRunner::new(); + let mut harness = TestHarness::new(); - runner.add_abi_impl( + harness.add_abi_impl( ABI_IMPL_RUSTC.to_owned(), abis::RustcAbiImpl::new(&cfg, None), ); @@ -230,7 +239,7 @@ fn main() -> Result<(), Box> { ); */ for &(ref name, ref path) in &cfg.rustc_codegen_backends { - runner.add_abi_impl( + harness.add_abi_impl( name.to_owned(), abis::RustcAbiImpl::new(&cfg, Some(path.to_owned())), ); @@ -239,9 +248,9 @@ fn main() -> Result<(), Box> { // Grab all the tests let tests = read_tests()?; - runner.set_tests(tests); + harness.set_tests(tests); eprintln!("got tests!"); - let runner = Arc::new(runner); + let harness = Arc::new(harness); // Run the tests use TestConclusion::*; let rt = tokio::runtime::Runtime::new().expect("failed to init tokio runtime"); @@ -249,7 +258,7 @@ fn main() -> Result<(), Box> { // This is written as nested iterator adaptors so that it can maybe be changed to use // rayon's par_iter, but currently the code isn't properly threadsafe due to races on // the filesystem when setting up the various output dirs :( - let tasks = runner + let tasks = harness .tests .values() .flat_map(|test| { @@ -282,12 +291,13 @@ fn main() -> Result<(), Box> { callee: callee_id.to_owned(), options: TestOptions { convention: convention.clone(), + functions: FunctionSelector::All, }, }; - let rules = runner.get_test_rules(&test_key); + let rules = harness.get_test_rules(&test_key); let task = { - let runner = runner.clone(); + let runner = harness.clone(); let rules = rules.clone(); let test_key = test_key.clone(); let out_dir = out_dir.clone(); @@ -343,9 +353,9 @@ fn main() -> Result<(), Box> { let mut output = std::io::stdout(); match cfg.output_format { - OutputFormat::Human => full_report.print_human(&mut output).unwrap(), - OutputFormat::Json => full_report.print_json(&mut output).unwrap(), - OutputFormat::RustcJson => full_report.print_rustc_json(&mut output).unwrap(), + OutputFormat::Human => full_report.print_human(&harness, &mut output).unwrap(), + OutputFormat::Json => full_report.print_json(&harness, &mut output).unwrap(), + OutputFormat::RustcJson => full_report.print_rustc_json(&harness, &mut output).unwrap(), } if full_report.failed() { diff --git a/src/report.rs b/src/report.rs index dfdf320..f331d18 100644 --- a/src/report.rs +++ b/src/report.rs @@ -6,8 +6,8 @@ use serde_json::json; use crate::abis::*; use crate::error::*; -use crate::full_test_name; use crate::AbiImplId; +use crate::TestHarness; use crate::TestId; use crate::WriteBuffer; @@ -218,6 +218,14 @@ pub struct TestKey { pub callee: AbiImplId, pub options: TestOptions, } +impl TestKey { + pub(crate) fn abi_id(&self, call_side: CallSide) -> &str { + match call_side { + CallSide::Caller => &self.caller, + CallSide::Callee => &self.callee, + } + } +} #[derive(Debug, Clone, Serialize)] pub struct TestRules { @@ -324,13 +332,17 @@ pub enum TestConclusion { } impl FullReport { - pub fn print_human(&self, mut f: impl std::io::Write) -> Result<(), std::io::Error> { + pub fn print_human( + &self, + harness: &TestHarness, + mut f: impl std::io::Write, + ) -> Result<(), std::io::Error> { use TestCheckMode::*; use TestConclusion::*; writeln!(f, "Final Results:")?; for test in &self.tests { - let pretty_test_name = full_test_name(&test.key); + let pretty_test_name = harness.full_test_name(&test.key); write!(f, "{pretty_test_name:<40} ")?; match (&test.conclusion, &test.rules.check) { (Skipped, _) => write!(f, "skipped")?, @@ -394,11 +406,19 @@ impl FullReport { Ok(()) } - pub fn print_json(&self, f: impl std::io::Write) -> Result<(), std::io::Error> { + pub fn print_json( + &self, + _harness: &TestHarness, + f: impl std::io::Write, + ) -> Result<(), std::io::Error> { serde_json::to_writer_pretty(f, self) .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)) } - pub fn print_rustc_json(&self, mut f: impl std::io::Write) -> Result<(), std::io::Error> { + pub fn print_rustc_json( + &self, + harness: &TestHarness, + mut f: impl std::io::Write, + ) -> Result<(), std::io::Error> { serde_json::to_writer( &mut f, &json!({ @@ -417,7 +437,7 @@ impl FullReport { TestConclusion::Failed => ("failed", Some("todo fill this message in")), TestConclusion::Busted => ("ok", None), }; - let test_name = full_test_name(&test.key); + let test_name = harness.full_test_name(&test.key); serde_json::to_writer( &mut f, &json!({ From c6975bba05cec71a43a6cd5035b25b12cc52a99b Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 2 Jun 2024 22:56:21 -0400 Subject: [PATCH 19/44] finish refactor of subsetting --- harness/rust_test_prefix.rs | 29 ------------- src/abis/mod.rs | 39 ++++++++++++------ src/abis/rust.rs | 82 ++++++++++++++++++++++++++++++------- src/harness/build.rs | 7 ++-- src/harness/generate.rs | 6 +-- src/harness/mod.rs | 14 +++++++ src/main.rs | 1 + 7 files changed, 115 insertions(+), 63 deletions(-) diff --git a/harness/rust_test_prefix.rs b/harness/rust_test_prefix.rs index e52aedf..5552aed 100644 --- a/harness/rust_test_prefix.rs +++ b/harness/rust_test_prefix.rs @@ -18,35 +18,6 @@ extern { pub static mut FINISHED_FUNC: Option; } -#[repr(C, align(16))] -pub struct FfiI128 { - low: i64, - high: i64, -} -#[repr(C, align(16))] -pub struct FfiU128 { - low: u64, - high: u64, -} - -impl FfiI128 { - fn new(val: i128) -> Self { - Self { - low: val as u64 as i64, - high: (val as u128 >> 64) as u64 as i64, - } - } -} - -impl FfiU128 { - fn new(val: u128) -> Self { - Self { - low: val as u64, - high: (val as u128 >> 64) as u64, - } - } -} - unsafe fn write_field(buffer: WriteBuffer, field: &T) { WRITE_FIELD.unwrap()( buffer, diff --git a/src/abis/mod.rs b/src/abis/mod.rs index b96e627..a9407d2 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -124,6 +124,24 @@ pub struct TestOptions { /// The calling convention pub convention: CallingConvention, pub functions: FunctionSelector, + pub val_writer: WriteImpl, +} +impl TestOptions { + fn should_write_arg(&self, func_idx: usize, arg_idx: usize) -> bool { + match &self.functions { + FunctionSelector::All => true, + FunctionSelector::One { idx, args } => { + if func_idx != *idx { + false + } else { + match args { + ArgSelector::All => true, + ArgSelector::One { idx } => arg_idx == *idx, + } + } + } + } + } } #[derive(Clone, Debug, Serialize)] @@ -200,10 +218,9 @@ impl std::ops::Deref for TestForAbi { pub struct TestImpl { pub inner: TestForAbi, pub options: TestOptions, - pub desired_funcs: Vec, - pub val_writer: WriteImpl, // interning state + pub desired_funcs: Vec, pub tynames: HashMap, pub borrowed_tynames: HashMap, } @@ -214,7 +231,7 @@ impl std::ops::Deref for TestImpl { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, PartialEq, Eq)] pub enum WriteImpl { HarnessCallback, Print, @@ -265,18 +282,16 @@ impl Test { } impl TestForAbi { - pub fn with_options( - &self, - options: TestOptions, - query: impl Iterator, - val_writer: WriteImpl, - ) -> Result { + pub fn with_options(&self, options: TestOptions) -> Result { + let desired_funcs = match &options.functions { + FunctionSelector::All => self.types.all_funcs().collect(), + FunctionSelector::One { idx, args } => vec![*idx], + }; + let write_impl = WriteImpl::HarnessCallback; Ok(TestImpl { inner: self.clone(), options, - desired_funcs: query.collect(), - val_writer, - + desired_funcs, tynames: Default::default(), borrowed_tynames: Default::default(), }) diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 494ac70..a47e791 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -21,8 +21,6 @@ const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; const INDENT: &str = " "; -static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); - #[allow(dead_code)] pub struct RustcAbiImpl { is_nightly: bool, @@ -49,6 +47,7 @@ impl AbiImpl for RustcAbiImpl { TestOptions { convention, functions, + val_writer, }: &TestOptions, ) -> bool { // NOTE: Rustc spits out: @@ -59,7 +58,7 @@ impl AbiImpl for RustcAbiImpl { // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, // wasm, system, system-unwind, rust-intrinsic, rust-call, // platform-intrinsic, unadjusted - match convention { + let supports_convention = match convention { CallingConvention::All => unreachable!(), CallingConvention::Handwritten => true, CallingConvention::C => true, @@ -71,7 +70,21 @@ impl AbiImpl for RustcAbiImpl { CallingConvention::Stdcall => true, CallingConvention::Fastcall => true, CallingConvention::Vectorcall => false, // too experimental even for nightly use? - } + }; + let supports_writer = match val_writer { + WriteImpl::HarnessCallback => true, + WriteImpl::Print => true, + WriteImpl::Noop => true, + }; + let supports_query = match functions { + FunctionSelector::All => true, + FunctionSelector::One { idx: _, args } => match args { + ArgSelector::All => true, + ArgSelector::One { idx: _ } => true, + }, + }; + + supports_convention && supports_writer && supports_query } fn compile_callee( @@ -101,6 +114,7 @@ impl AbiImpl for RustcAbiImpl { Ok(String::from(lib_name)) } } + fn compile_caller( &self, src_path: &Utf8Path, @@ -174,10 +188,20 @@ impl RustcAbiImpl { let mut val_idx = 0; // Create vars for all the inputs + let mut arg_idx = 0; for arg in function.inputs.iter() { // Create and report the input self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; - self.write_var(f, state, &arg.name, arg.ty, VAR_CALLER_INPUTS)?; + self.write_var( + f, + state, + func, + arg_idx, + &arg.name, + arg.ty, + VAR_CALLER_INPUTS, + )?; + arg_idx += 1; } // Call the function @@ -186,7 +210,16 @@ impl RustcAbiImpl { // Report all the outputs for arg in function.outputs.iter() { let arg_name = &arg.name; - self.write_var(f, state, arg_name, arg.ty, VAR_CALLER_OUTPUTS)?; + self.write_var( + f, + state, + func, + arg_idx, + arg_name, + arg.ty, + VAR_CALLER_OUTPUTS, + )?; + arg_idx += 1; } // Report the function is complete @@ -272,9 +305,11 @@ impl RustcAbiImpl { writeln!(f, "unsafe {{")?; f.add_indent(1); // Report the inputs + let mut arg_idx = 0; for arg in function.inputs.iter() { let arg_name = &arg.name; - self.write_var(f, state, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; + self.write_var(f, state, func, arg_idx, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; + arg_idx += 1; } // Create outputs and report them @@ -282,7 +317,16 @@ impl RustcAbiImpl { for arg in function.outputs.iter() { // Create and report the input self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; - self.write_var(f, state, &arg.name, arg.ty, VAR_CALLEE_OUTPUTS)?; + self.write_var( + f, + state, + func, + arg_idx, + &arg.name, + arg.ty, + VAR_CALLEE_OUTPUTS, + )?; + arg_idx += 1; } // Report the function is complete @@ -884,6 +928,10 @@ impl RustcAbiImpl { /// Every test should start by loading in the harness' "header" /// and forward-declaring any structs that will be used. fn write_harness_prefix(&self, f: &mut Fivemat, state: &TestImpl) -> Result<(), GenerateError> { + // No extra harness gunk if not needed + if state.options.val_writer != WriteImpl::HarnessCallback { + return Ok(()); + } if state.options.convention == CallingConvention::Vectorcall { writeln!(f, "#![feature(abi_vectorcall)]")?; } @@ -996,18 +1044,24 @@ impl RustcAbiImpl { &self, f: &mut Fivemat, state: &TestImpl, + func_idx: usize, + arg_idx: usize, var_name: &str, var_ty: TyIdx, to: &str, ) -> Result<(), GenerateError> { + // If we're generating a minimized test, skip this + if !state.options.should_write_arg(func_idx, arg_idx) { + return Ok(()); + } // If noop, don't bother doing anything (avoids tagged union matches being generated) - if let WriteImpl::Noop = state.val_writer { + if let WriteImpl::Noop = state.options.val_writer { return Ok(()); }; self.write_fields(f, state, to, var_name, var_ty)?; // If doing full harness callbacks, signal we wrote all the fields of a variable - if let WriteImpl::HarnessCallback = state.val_writer { + if let WriteImpl::HarnessCallback = state.options.val_writer { writeln!(f, "finished_val({to});")?; writeln!(f)?; } @@ -1113,12 +1167,12 @@ impl RustcAbiImpl { to: &str, path: &str, ) -> Result<(), GenerateError> { - match state.val_writer { + match state.options.val_writer { WriteImpl::HarnessCallback => { writeln!(f, "write_field({to}, &{path});")?; } WriteImpl::Print => { - writeln!(f, "println!(\"{{}}\", {path});")?; + writeln!(f, "println!(\"{{:?}}\", {path});")?; } WriteImpl::Noop => { // Noop, do nothing @@ -1134,7 +1188,7 @@ impl RustcAbiImpl { inputs: &str, outputs: &str, ) -> Result<(), GenerateError> { - match state.val_writer { + match state.options.val_writer { WriteImpl::HarnessCallback => { writeln!(f, "finished_func({inputs}, {outputs});")?; } @@ -1164,7 +1218,7 @@ impl RustcAbiImpl { var_ty: TyIdx, ) -> Result<(), GenerateError> { // TODO: implement outparam returns - write!(f, "{var_name}")?; + writeln!(f, "{var_name}")?; Ok(()) } } diff --git a/src/harness/build.rs b/src/harness/build.rs index 7575f2f..57f61bb 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -120,6 +120,7 @@ fn link_dynamic_lib( dynamic_lib_name: &str, ) -> Result { let src = PathBuf::from("harness/harness.rs"); + let output = out_dir.join(dynamic_lib_name); let mut cmd = Command::new("rustc"); cmd.arg("-v") .arg("-L") @@ -136,7 +137,7 @@ fn link_dynamic_lib( // .arg("--out-dir") // .arg("target/temp/") .arg("-o") - .arg(&dynamic_lib_name) + .arg(&output) .arg(&src); eprintln!("running: {:?}", cmd); @@ -145,8 +146,6 @@ fn link_dynamic_lib( if !out.status.success() { Err(LinkError::RustLink(out)) } else { - Ok(LinkOutput { - test_bin: Utf8PathBuf::from(dynamic_lib_name), - }) + Ok(LinkOutput { test_bin: output }) } } diff --git a/src/harness/generate.rs b/src/harness/generate.rs index fbc94f5..0208d93 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -78,7 +78,7 @@ pub fn init_generate_dir() -> Result<(), GenerateError> { Ok(()) } -pub async fn generate_src( +async fn generate_src( src_path: &Utf8Path, abi: Arc, test_with_abi: Arc, @@ -93,9 +93,7 @@ pub async fn generate_src( } } let mut output_string = String::new(); - let query = test_with_abi.types.all_funcs(); - let write_impl = WriteImpl::HarnessCallback; - let test = test_with_abi.with_options(options, query, write_impl)?; + let test = test_with_abi.with_options(options)?; match call_side { CallSide::Callee => abi.generate_callee(&mut output_string, test)?, CallSide::Caller => abi.generate_caller(&mut output_string, test)?, diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 2bbfcb7..d655f48 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -37,6 +37,7 @@ impl TestHarness { TestOptions { convention, functions, + val_writer, }, caller, callee, @@ -77,6 +78,19 @@ impl TestHarness { output.push_str("_callee"); } } + match val_writer { + crate::WriteImpl::HarnessCallback => { + // Do nothing, implicit default + } + crate::WriteImpl::Print => { + output.push_str(separator); + output.push_str("print"); + } + crate::WriteImpl::Noop => { + output.push_str(separator); + output.push_str("noop"); + } + } output } diff --git a/src/main.rs b/src/main.rs index 9dfba75..956254c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,6 +292,7 @@ fn main() -> Result<(), Box> { options: TestOptions { convention: convention.clone(), functions: FunctionSelector::All, + val_writer: WriteImpl::HarnessCallback, }, }; let rules = harness.get_test_rules(&test_key); From 1f0d9e9fe24d8397ec9be81ac9c9d37b8fad04cc Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 2 Jun 2024 23:11:21 -0400 Subject: [PATCH 20/44] resolve some warnings --- Cargo.toml | 3 +- src/abis/mod.rs | 3 +- src/abis/rust.rs | 102 +++++++++++++++++++++------------------- src/cli.rs | 6 +-- src/fivemat.rs | 4 +- src/harness/build.rs | 2 +- src/harness/generate.rs | 2 +- src/harness/read.rs | 2 +- src/harness/run.rs | 6 ++- src/main.rs | 4 +- 10 files changed, 70 insertions(+), 64 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7b72105..ca14ee8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,8 @@ simplelog = "0.11.2" thiserror = "1.0.30" tokio = { version = "1.37.0", features = ["full", "tracing"] } - +[lints.clippy] +result_large_err = "allow" [build-dependencies] built = "0.5.1" diff --git a/src/abis/mod.rs b/src/abis/mod.rs index a9407d2..af003f7 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -285,9 +285,8 @@ impl TestForAbi { pub fn with_options(&self, options: TestOptions) -> Result { let desired_funcs = match &options.functions { FunctionSelector::All => self.types.all_funcs().collect(), - FunctionSelector::One { idx, args } => vec![*idx], + FunctionSelector::One { idx, args: _ } => vec![*idx], }; - let write_impl = WriteImpl::HarnessCallback; Ok(TestImpl { inner: self.clone(), options, diff --git a/src/abis/rust.rs b/src/abis/rust.rs index a47e791..208fb05 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -145,13 +145,13 @@ impl RustcAbiImpl { // Generate type decls and gather up functions self.generate_definitions(f, state)?; // Generate decls of the functions we want to call - self.generate_caller_externs(f, &state)?; + self.generate_caller_externs(f, state)?; // Generate the test function the harness will call writeln!(f, "#[no_mangle]\npub extern \"C\" fn do_test() {{")?; for &func in &state.desired_funcs { // Generate the individual function calls - self.generate_caller_body(f, &state, func)?; + self.generate_caller_body(f, state, func)?; } writeln!(f, "}}")?; @@ -167,7 +167,7 @@ impl RustcAbiImpl { writeln!(f, "extern \"{convention_decl}\" {{",)?; f.add_indent(1); for &func in &state.desired_funcs { - self.generate_signature(f, &state, func)?; + self.generate_signature(f, state, func)?; writeln!(f, ";")?; } f.sub_indent(1); @@ -245,9 +245,9 @@ impl RustcAbiImpl { let output = proper_outputs.next(); let too_many_outputs = proper_outputs.next(); if too_many_outputs.is_some() { - return Err(GenerateError::RustUnsupported(format!( - "multiple normal returns (should this be a tuple?)" - ))); + return Err(GenerateError::RustUnsupported( + "multiple normal returns (should this be a tuple?)".to_owned(), + )); } if let Some(output) = output { write!(f, "let {} = ", output.name)?; @@ -284,7 +284,7 @@ impl RustcAbiImpl { for &func in &state.desired_funcs { // Generate the individual function definitions - self.generate_callee_body(f, &state, func)?; + self.generate_callee_body(f, state, func)?; } Ok(()) } @@ -299,7 +299,7 @@ impl RustcAbiImpl { let convention_decl = self.convention_decl(state.options.convention)?; writeln!(f, "#[no_mangle]")?; write!(f, "pub unsafe extern \"{convention_decl}\" ")?; - self.generate_signature(f, &state, func)?; + self.generate_signature(f, state, func)?; writeln!(f, " {{")?; f.add_indent(1); writeln!(f, "unsafe {{")?; @@ -357,7 +357,7 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &mut TestImpl, ) -> Result<(), GenerateError> { - self.write_harness_prefix(f, &state)?; + self.write_harness_prefix(f, state)?; for def in state.defs.definitions(state.desired_funcs.iter().copied()) { match def { @@ -367,7 +367,7 @@ impl RustcAbiImpl { kdl_script::Definition::DefineTy(ty) => { self.generate_tydef(f, state, ty)?; } - kdl_script::Definition::DefineFunc(func) => { + kdl_script::Definition::DefineFunc(_) => { // we'd buffer these up to generate them all at the end, // but we've already got them buffered, so... do nothing. } @@ -405,18 +405,18 @@ impl RustcAbiImpl { PrimitiveTy::F64 => "f64", PrimitiveTy::Bool => "bool", PrimitiveTy::Ptr => "*mut ()", - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have i256" - )))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have u256" - )))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f16" - )))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f128" - )))?, + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( + "rust doesn't have i256".to_owned(), + ))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( + "rust doesn't have u256".to_owned(), + ))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( + "rust doesn't have f16".to_owned(), + ))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( + "rust doesn't have f128".to_owned(), + ))?, }; (name.to_owned(), None) } @@ -475,7 +475,7 @@ impl RustcAbiImpl { Ty::Alias(AliasTy { name, real, attrs }) => { let borrowed_tyname = state .borrowed_tynames - .get(&real) + .get(real) .map(|name| format!("{name}<'a>")); ((**name).clone(), borrowed_tyname) } @@ -640,7 +640,7 @@ impl RustcAbiImpl { ); // Emit an actual type alias decl - if let Some(real_tyname) = state.borrowed_tynames.get(&real) { + if let Some(real_tyname) = state.borrowed_tynames.get(real) { writeln!(f, "type {name}<'a> = {real_tyname};\n")?; } else { let real_tyname = &state.tynames[&real]; @@ -697,7 +697,7 @@ impl RustcAbiImpl { ref_temp_name: &str, extra_decls: &mut Vec, ) -> Result<(), GenerateError> { - let names = match state.types.realize_ty(ty) { + match state.types.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx Ty::Primitive(prim) => { match prim { @@ -730,7 +730,7 @@ impl RustcAbiImpl { "f64::from_bits({:#X}u64)", graffiti_primitive::(*val_idx) )?, - PrimitiveTy::Bool => write!(f, "{}", true)?, + PrimitiveTy::Bool => write!(f, "true")?, PrimitiveTy::Ptr => { if true { write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? @@ -738,18 +738,18 @@ impl RustcAbiImpl { write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? } } - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have i256" - )))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have u256" - )))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f16" - )))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported(format!( - "rust doesn't have f128" - )))?, + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( + "rust doesn't have i256".to_owned(), + ))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( + "rust doesn't have u256".to_owned(), + ))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( + "rust doesn't have f16".to_owned(), + ))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( + "rust doesn't have f128".to_owned(), + ))?, }; *val_idx += 1; } @@ -825,7 +825,8 @@ impl RustcAbiImpl { let name = alias.unwrap_or(&union_ty.name); write!(f, "{name} {{ ")?; // FIXME(variant_select):have a way to pick the variant! - if let Some(field) = union_ty.fields.get(0) { + let idx = 0; + if let Some(field) = union_ty.fields.get(idx) { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); @@ -844,7 +845,8 @@ impl RustcAbiImpl { Ty::Enum(enum_ty) => { let name = alias.unwrap_or(&enum_ty.name); // FIXME(variant_select):have a way to pick the variant! - if let Some(variant) = enum_ty.variants.get(0) { + let idx = 0; + if let Some(variant) = enum_ty.variants.get(idx) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; } @@ -852,7 +854,8 @@ impl RustcAbiImpl { Ty::Tagged(tagged_ty) => { let name = alias.unwrap_or(&tagged_ty.name); // FIXME(variant_select): have a way to pick the variant! - if let Some(variant) = tagged_ty.variants.get(0) { + let idx = 0; + if let Some(variant) = tagged_ty.variants.get(idx) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; if let Some(fields) = &variant.fields { @@ -898,7 +901,7 @@ impl RustcAbiImpl { } }; - Ok(names) + Ok(()) } fn convention_decl( @@ -953,7 +956,7 @@ impl RustcAbiImpl { write!(f, "fn {}(", function.name)?; let mut multiarg = false; // Add inputs - for (_idx, arg) in function.inputs.iter().enumerate() { + for arg in &function.inputs { if multiarg { write!(f, ", ")?; } @@ -963,7 +966,7 @@ impl RustcAbiImpl { write!(f, "{}: {}", arg_name, arg_ty)?; } // Add outparams - for (_idx, arg) in function.outputs.iter().enumerate() { + for arg in &function.outputs { let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); if !is_outparam { // Handled in next loop @@ -981,16 +984,16 @@ impl RustcAbiImpl { } // Add normal returns let mut has_normal_return = false; - for (_idx, arg) in function.outputs.iter().enumerate() { + for arg in &function.outputs { let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); if is_outparam { // Already handled continue; } if has_normal_return { - return Err(GenerateError::RustUnsupported(format!( - "multiple normal returns (should this be a tuple?)" - ))); + return Err(GenerateError::RustUnsupported( + "multiple normal returns (should this be a tuple?)".to_owned(), + )); } has_normal_return = true; let arg_ty = &state.tynames[&arg.ty]; @@ -1149,7 +1152,8 @@ impl RustcAbiImpl { } Ty::Union(union_ty) => { // FIXME(variant_select): hardcoded to access field 0 for now - if let Some(field) = union_ty.fields.get(0) { + let idx = 0; + if let Some(field) = union_ty.fields.get(idx) { let field_name = &field.ident; let base = format!("{from}.{field_name}"); self.write_fields(f, state, to, &base, field.ty)?; diff --git a/src/cli.rs b/src/cli.rs index d600ac6..f9a0239 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -73,7 +73,7 @@ pub fn make_app() -> Config { .map(|(a, b)| (String::from(a), String::from(b))) .collect(); - for &(ref name, ref _path) in &rustc_codegen_backends { + for (name, _path) in &rustc_codegen_backends { if !run_pairs.iter().any(|(a, b)| a == name || b == name) { eprintln!("Warning: Rustc codegen backend `{name}` is not tested."); eprintln!( @@ -84,13 +84,13 @@ pub fn make_app() -> Config { } let output_format = config.output_format; - let _ = TermLogger::init( + TermLogger::init( LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, ColorChoice::Auto, ) - .unwrap(); + .expect("failed to initialize logger"); Config { output_format, diff --git a/src/fivemat.rs b/src/fivemat.rs index 37536ac..ed63446 100644 --- a/src/fivemat.rs +++ b/src/fivemat.rs @@ -44,7 +44,7 @@ impl<'a> Fivemat<'a> { } pub fn newline(&mut self) -> std::fmt::Result { self.indent_pending = true; - write!(&mut self.out, "\n") + writeln!(&mut self.out) } } @@ -57,7 +57,7 @@ impl<'a> std::fmt::Write for Fivemat<'a> { self.newline()?; } multiline = true; - if line.len() > 0 { + if !line.is_empty() { self.ensure_indent()?; write!(&mut self.out, "{}", line)?; } diff --git a/src/harness/build.rs b/src/harness/build.rs index 57f61bb..dcaef44 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -52,7 +52,7 @@ impl TestHarness { let real_lib_name = once .get_or_try_init(|| { eprintln!("compiling {lib_name}"); - build_static_lib(&src_path, abi_impl, call_side, out_dir, &lib_name) + build_static_lib(src_path, abi_impl, call_side, out_dir, &lib_name) }) .await? .clone(); diff --git a/src/harness/generate.rs b/src/harness/generate.rs index 0208d93..dd5d52c 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -64,7 +64,7 @@ impl TestHarness { let abi_id = key.abi_id(call_side); let abi = self.abi_by_test_key(key, call_side); let mut output = self.base_id(key, Some(call_side), "_"); - output.push_str("."); + output.push('.'); output.push_str(abi.src_ext()); src_dir.join(abi_id).join(output) } diff --git a/src/harness/read.rs b/src/harness/read.rs index 8b639ec..b8bc5dc 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -38,7 +38,7 @@ pub fn read_tests() -> Result, GenerateError> { /// Read a test .kdl file fn read_test_manifest(test_file: &Path) -> Result { - let file = File::open(&test_file)?; + let file = File::open(test_file)?; let mut reader = BufReader::new(file); let mut input = String::new(); reader.read_to_string(&mut input)?; diff --git a/src/harness/run.rs b/src/harness/run.rs index 051e146..63d576a 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -347,7 +347,8 @@ fn add_field( } Ty::Tagged(tagged_ty) => { // FIXME(variant_select): hardcoded to access variant 0 for now - if let Some(variant) = tagged_ty.variants.get(0) { + let idx = 0; + if let Some(variant) = tagged_ty.variants.get(idx) { if let Some(fields) = &variant.fields { for field in fields { add_field( @@ -369,7 +370,8 @@ fn add_field( } Ty::Union(union_ty) => { // FIXME(variant_select): hardcoded to access field 0 for now - if let Some(field) = union_ty.fields.get(0) { + let idx = 0; + if let Some(field) = union_ty.fields.get(idx) { let field_name = &field.ident; let base = format!("{cur_path}.{field_name}"); add_field(test_impl, input, output, cur_idx, base, field.ty); diff --git a/src/main.rs b/src/main.rs index 956254c..c0c6d1a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -238,7 +238,7 @@ fn main() -> Result<(), Box> { abis::CcAbiImpl::new(&cfg, ABI_IMPL_MSVC), ); */ - for &(ref name, ref path) in &cfg.rustc_codegen_backends { + for (name, path) in &cfg.rustc_codegen_backends { harness.add_abi_impl( name.to_owned(), abis::RustcAbiImpl::new(&cfg, Some(path.to_owned())), @@ -290,7 +290,7 @@ fn main() -> Result<(), Box> { caller: caller_id.to_owned(), callee: callee_id.to_owned(), options: TestOptions { - convention: convention.clone(), + convention: *convention, functions: FunctionSelector::All, val_writer: WriteImpl::HarnessCallback, }, From 83eacdf47fcb3258dfade4d2df7e2aa04d87dd01 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 22 Jun 2024 11:35:37 -0400 Subject: [PATCH 21/44] feat: ValueGenerator workssss --- Cargo.lock | 59 ++++++++++ Cargo.toml | 3 + src/abis/mod.rs | 6 + src/abis/rust.rs | 266 ++++++++++++++++++++++++-------------------- src/abis/vals.rs | 263 +++++++++++++++++++++++++++++++++++++++++++ src/harness/mod.rs | 21 +++- src/main.rs | 2 + tests/kdl/types.kdl | 13 ++- 8 files changed, 505 insertions(+), 128 deletions(-) create mode 100644 src/abis/vals.rs diff --git a/Cargo.lock b/Cargo.lock index e707fda..686df51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,6 +16,9 @@ dependencies = [ "linked-hash-map", "log", "miette", + "rand", + "rand_core", + "rand_pcg", "rayon", "ron", "serde", @@ -362,6 +365,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + [[package]] name = "gimli" version = "0.26.2" @@ -753,6 +767,12 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "proc-macro2" version = "1.0.78" @@ -771,6 +791,45 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.5.3" diff --git a/Cargo.toml b/Cargo.toml index ca14ee8..992ff6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,9 @@ libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } log = "0.4.14" miette = { version = "5.3.0", features = ["fancy"] } +rand = "0.8.5" +rand_core = "0.6.4" +rand_pcg = "0.3.1" rayon = { version = "1.5.3", optional = true } ron = "0.7.0" serde = { version = "1.0.136", features = ["derive"] } diff --git a/src/abis/mod.rs b/src/abis/mod.rs index af003f7..7f3bdd1 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -1,5 +1,6 @@ pub mod c; pub mod rust; +pub mod vals; use std::{collections::HashMap, fmt::Write, sync::Arc}; @@ -11,6 +12,7 @@ use kdl_script::{ }; pub use rust::RustcAbiImpl; use serde::Serialize; +use vals::{ValueGeneratorKind, ValueTree}; use crate::error::{BuildError, GenerateError}; @@ -125,6 +127,7 @@ pub struct TestOptions { pub convention: CallingConvention, pub functions: FunctionSelector, pub val_writer: WriteImpl, + pub val_generator: ValueGeneratorKind, } impl TestOptions { fn should_write_arg(&self, func_idx: usize, arg_idx: usize) -> bool { @@ -223,6 +226,7 @@ pub struct TestImpl { pub desired_funcs: Vec, pub tynames: HashMap, pub borrowed_tynames: HashMap, + pub vals: ValueTree, } impl std::ops::Deref for TestImpl { type Target = TestForAbi; @@ -287,12 +291,14 @@ impl TestForAbi { FunctionSelector::All => self.types.all_funcs().collect(), FunctionSelector::One { idx, args: _ } => vec![*idx], }; + let vals = ValueTree::new(&self.types, options.val_generator.clone()); Ok(TestImpl { inner: self.clone(), options, desired_funcs, tynames: Default::default(), borrowed_tynames: Default::default(), + vals, }) } } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 208fb05..50f04fb 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use camino::Utf8Path; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::PunEnv; +use vals::{ValIter, ValueGenerator}; use self::error::GenerateError; @@ -48,6 +49,7 @@ impl AbiImpl for RustcAbiImpl { convention, functions, val_writer, + val_generator: _, }: &TestOptions, ) -> bool { // NOTE: Rustc spits out: @@ -185,13 +187,13 @@ impl RustcAbiImpl { writeln!(f, "unsafe {{")?; f.add_indent(1); let function = state.types.realize_func(func); - let mut val_idx = 0; // Create vars for all the inputs let mut arg_idx = 0; - for arg in function.inputs.iter() { + for arg in &function.inputs { + let vals = &state.vals.funcs[func].args[arg_idx].vals; // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + self.create_var(f, state, &arg.name, arg.ty, vals)?; self.write_var( f, state, @@ -199,6 +201,7 @@ impl RustcAbiImpl { arg_idx, &arg.name, arg.ty, + vals, VAR_CALLER_INPUTS, )?; arg_idx += 1; @@ -208,15 +211,16 @@ impl RustcAbiImpl { self.call_function(f, state, function)?; // Report all the outputs - for arg in function.outputs.iter() { - let arg_name = &arg.name; + for arg in &function.outputs { + let vals = &state.vals.funcs[func].args[arg_idx].vals; self.write_var( f, state, func, arg_idx, - arg_name, + &arg.name, arg.ty, + vals, VAR_CALLER_OUTPUTS, )?; arg_idx += 1; @@ -306,17 +310,26 @@ impl RustcAbiImpl { f.add_indent(1); // Report the inputs let mut arg_idx = 0; - for arg in function.inputs.iter() { + for arg in &function.inputs { + let vals = &state.vals.funcs[func].args[arg_idx].vals; let arg_name = &arg.name; - self.write_var(f, state, func, arg_idx, arg_name, arg.ty, VAR_CALLEE_INPUTS)?; + self.write_var( + f, + state, + func, + arg_idx, + arg_name, + arg.ty, + vals, + VAR_CALLEE_INPUTS, + )?; arg_idx += 1; } // Create outputs and report them - let mut val_idx = 0; - for arg in function.outputs.iter() { - // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, &mut val_idx)?; + for arg in &function.outputs { + let vals = &state.vals.funcs[func].args[arg_idx].vals; + self.create_var(f, state, &arg.name, arg.ty, vals)?; self.write_var( f, state, @@ -324,6 +337,7 @@ impl RustcAbiImpl { arg_idx, &arg.name, arg.ty, + vals, VAR_CALLEE_OUTPUTS, )?; arg_idx += 1; @@ -525,6 +539,7 @@ impl RustcAbiImpl { if has_borrows { writeln!(f, "struct {}<'a> {{", struct_ty.name)?; } else { + writeln!(f, "#[derive(Copy, Clone)]")?; writeln!(f, "struct {} {{", struct_ty.name)?; } f.add_indent(1); @@ -555,6 +570,7 @@ impl RustcAbiImpl { if has_borrows { writeln!(f, "union {}<'a> {{", union_ty.name)?; } else { + writeln!(f, "#[derive(Copy, Clone)]")?; writeln!(f, "union {} {{", union_ty.name)?; } f.add_indent(1); @@ -577,6 +593,7 @@ impl RustcAbiImpl { // Emit an actual enum decl writeln!(f, "#[repr(C)]")?; + writeln!(f, "#[derive(Copy, Clone)]")?; writeln!(f, "enum {} {{", enum_ty.name)?; f.add_indent(1); for variant in &enum_ty.variants { @@ -608,6 +625,7 @@ impl RustcAbiImpl { if has_borrows { writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; } else { + writeln!(f, "#[derive(Copy, Clone)]")?; writeln!(f, "enum {} {{", tagged_ty.name)?; } f.add_indent(1); @@ -692,7 +710,7 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &TestImpl, ty: TyIdx, - val_idx: &mut usize, + vals: &mut ValIter, alias: Option<&str>, ref_temp_name: &str, extra_decls: &mut Vec, @@ -700,42 +718,27 @@ impl RustcAbiImpl { match state.types.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx Ty::Primitive(prim) => { + let val = vals.next().expect("internal error: ran out of values!?"); match prim { - PrimitiveTy::I8 => { - write!(f, "{:#X}u8 as i8", graffiti_primitive::(*val_idx))? - } - PrimitiveTy::I16 => { - write!(f, "{:#X}u16 as i16", graffiti_primitive::(*val_idx))? - } - PrimitiveTy::I32 => { - write!(f, "{:#X}u32 as i32", graffiti_primitive::(*val_idx))? - } - PrimitiveTy::I64 => { - write!(f, "{:#X}u64 as i64", graffiti_primitive::(*val_idx))? - } - PrimitiveTy::I128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U8 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U16 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U32 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U64 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - PrimitiveTy::U128 => write!(f, "{:#X}", graffiti_primitive::(*val_idx))?, - - PrimitiveTy::F32 => write!( - f, - "f32::from_bits({:#X}u32)", - graffiti_primitive::(*val_idx) - )?, - PrimitiveTy::F64 => write!( - f, - "f64::from_bits({:#X}u64)", - graffiti_primitive::(*val_idx) - )?, + PrimitiveTy::I8 => write!(f, "{:#X}u8 as i8", val.generate_u8())?, + PrimitiveTy::I16 => write!(f, "{:#X}u16 as i16", val.generate_u16())?, + PrimitiveTy::I32 => write!(f, "{:#X}u32 as i32", val.generate_u32())?, + PrimitiveTy::I64 => write!(f, "{:#X}u64 as i64", val.generate_u64())?, + PrimitiveTy::I128 => write!(f, "{:#X}", val.generate_u128())?, + PrimitiveTy::U8 => write!(f, "{:#X}", val.generate_u8())?, + PrimitiveTy::U16 => write!(f, "{:#X}", val.generate_u16())?, + PrimitiveTy::U32 => write!(f, "{:#X}", val.generate_u32())?, + PrimitiveTy::U64 => write!(f, "{:#X}", val.generate_u64())?, + PrimitiveTy::U128 => write!(f, "{:#X}", val.generate_u128())?, + + PrimitiveTy::F32 => write!(f, "f32::from_bits({:#X})", val.generate_u32())?, + PrimitiveTy::F64 => write!(f, "f64::from_bits({:#X})", val.generate_u64())?, PrimitiveTy::Bool => write!(f, "true")?, PrimitiveTy::Ptr => { if true { - write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? + write!(f, "{:#X} as *mut ()", val.generate_u64())? } else { - write!(f, "{:#X} as *mut ()", graffiti_primitive::(*val_idx))? + write!(f, "{:#X} as *mut ()", val.generate_u32())? } } PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( @@ -751,7 +754,6 @@ impl RustcAbiImpl { "rust doesn't have f128".to_owned(), ))?, }; - *val_idx += 1; } Ty::Empty => { write!(f, "()")?; @@ -771,7 +773,7 @@ impl RustcAbiImpl { &mut ref_temp_f, state, *pointee_ty, - val_idx, + vals, alias, &ref_temp_name, extra_decls, @@ -790,7 +792,7 @@ impl RustcAbiImpl { f, state, *elem_ty, - val_idx, + vals, alias, &ref_temp_name, extra_decls, @@ -813,7 +815,7 @@ impl RustcAbiImpl { f, state, field.ty, - val_idx, + vals, alias, &ref_temp_name, extra_decls, @@ -824,9 +826,8 @@ impl RustcAbiImpl { Ty::Union(union_ty) => { let name = alias.unwrap_or(&union_ty.name); write!(f, "{name} {{ ")?; - // FIXME(variant_select):have a way to pick the variant! - let idx = 0; - if let Some(field) = union_ty.fields.get(idx) { + let tag_val = vals.next().expect("internal error: ran out of values!?"); + if let Some(field) = tag_val.select_val(&union_ty.fields) { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); @@ -834,7 +835,7 @@ impl RustcAbiImpl { f, state, field.ty, - val_idx, + vals, alias, &ref_temp_name, extra_decls, @@ -844,18 +845,16 @@ impl RustcAbiImpl { } Ty::Enum(enum_ty) => { let name = alias.unwrap_or(&enum_ty.name); - // FIXME(variant_select):have a way to pick the variant! - let idx = 0; - if let Some(variant) = enum_ty.variants.get(idx) { + let tag_val = vals.next().expect("internal error: ran out of values!?"); + if let Some(variant) = tag_val.select_val(&enum_ty.variants) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; } } Ty::Tagged(tagged_ty) => { let name = alias.unwrap_or(&tagged_ty.name); - // FIXME(variant_select): have a way to pick the variant! - let idx = 0; - if let Some(variant) = tagged_ty.variants.get(idx) { + let tag_val = vals.next().expect("internal error: ran out of values!?"); + if let Some(variant) = tag_val.select_val(&tagged_ty.variants) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; if let Some(fields) = &variant.fields { @@ -871,7 +870,7 @@ impl RustcAbiImpl { f, state, field.ty, - val_idx, + vals, alias, &ref_temp_name, extra_decls, @@ -883,21 +882,13 @@ impl RustcAbiImpl { } Ty::Alias(AliasTy { real, name, .. }) => { let alias = alias.or_else(|| Some(name)); - self.generate_value(f, state, *real, val_idx, alias, ref_temp_name, extra_decls)?; + self.generate_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; } // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - self.generate_value( - f, - state, - real_ty, - val_idx, - alias, - ref_temp_name, - extra_decls, - )?; + self.generate_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; } }; @@ -1011,7 +1002,7 @@ impl RustcAbiImpl { state: &TestImpl, var_name: &str, var_ty: TyIdx, - val_idx: &mut usize, + vals: &[ValueGenerator], ) -> Result<(), GenerateError> { // Generate the input let ty_name = &state.tynames[&var_ty]; @@ -1026,7 +1017,7 @@ impl RustcAbiImpl { &mut real_var_decl_f, state, var_ty, - val_idx, + &mut vals.iter(), None, &ref_temp_name, &mut extra_decls, @@ -1051,6 +1042,7 @@ impl RustcAbiImpl { arg_idx: usize, var_name: &str, var_ty: TyIdx, + vals: &[ValueGenerator], to: &str, ) -> Result<(), GenerateError> { // If we're generating a minimized test, skip this @@ -1061,7 +1053,7 @@ impl RustcAbiImpl { if let WriteImpl::Noop = state.options.val_writer { return Ok(()); }; - self.write_fields(f, state, to, var_name, var_ty)?; + self.write_fields(f, state, to, var_name, var_ty, &mut vals.iter())?; // If doing full harness callbacks, signal we wrote all the fields of a variable if let WriteImpl::HarnessCallback = state.options.val_writer { @@ -1080,10 +1072,12 @@ impl RustcAbiImpl { to: &str, from: &str, var_ty: TyIdx, + vals: &mut ValIter, ) -> Result<(), GenerateError> { match state.types.realize_ty(var_ty) { Ty::Primitive(_) | Ty::Enum(_) => { - // Hey an actual leaf, report it + // Hey an actual leaf, report it (and burn a value) + vals.next().expect("internal error: ran out of values!?"); self.write_leaf_field(f, state, to, from)?; } Ty::Empty => { @@ -1091,18 +1085,18 @@ impl RustcAbiImpl { } Ty::Alias(alias_ty) => { // keep going but with the type changed - self.write_fields(f, state, to, from, alias_ty.real)?; + self.write_fields(f, state, to, from, alias_ty.real, vals)?; } Ty::Pun(pun) => { // keep going but with the type changed let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - self.write_fields(f, state, to, from, real_ty)? + self.write_fields(f, state, to, from, real_ty, vals)? } Ty::Array(array_ty) => { // recurse into each array index for i in 0..array_ty.len { let base = format!("{from}[{i}]"); - self.write_fields(f, state, to, &base, array_ty.elem_ty)?; + self.write_fields(f, state, to, &base, array_ty.elem_ty, vals)?; } } Ty::Struct(struct_ty) => { @@ -1110,17 +1104,16 @@ impl RustcAbiImpl { for field in &struct_ty.fields { let field_name = &field.ident; let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty)?; + self.write_fields(f, state, to, &base, field.ty, vals)?; } } Ty::Tagged(tagged_ty) => { - // generate a wrapper match, then recurse into each field of each variant - writeln!(f, "match &{from} {{")?; - f.add_indent(1); - let tagged_name = &tagged_ty.name; - for variant in &tagged_ty.variants { + // Process the implicit "tag" value + let tag_generator = vals.next().expect("internal error: ran out of values!?"); + if let Some(variant) = tag_generator.select_val(&tagged_ty.variants) { + let tagged_name = &tagged_ty.name; let variant_name = &variant.name; - match &variant.fields { + let pat = match &variant.fields { Some(fields) => { // Variant with fields, recurse into them let field_list = fields @@ -1128,35 +1121,47 @@ impl RustcAbiImpl { .map(|f| f.ident.to_string()) .collect::>() .join(", "); - writeln!(f, "{tagged_name}::{variant_name} {{ {field_list} }} => {{")?; - f.add_indent(1); - for field in fields { - self.write_fields(f, state, to, &field.ident, field.ty)?; - } - f.sub_indent(1); - writeln!(f, "}}")?; + format!("{tagged_name}::{variant_name} {{ {field_list} }}") } None => { - // Variant without fields, need to include branch for exhaustiveness - writeln!(f, "{tagged_name}::{variant_name} => {{ }}")?; + // Variant without fields, still need the pattern to check the tag + format!("{tagged_name}::{variant_name}") + } + }; + // Generate an if-let + writeln!(f, "if let {pat} = &{from} {{")?; + if let Some(fields) = &variant.fields { + f.add_indent(1); + for field in fields { + // Do the ugly deref thing to deal with pattern autoref + let base = format!("(*{})", field.ident); + self.write_fields(f, state, to, &base, field.ty, vals)?; } + f.sub_indent(1); } + // Add an else case to complain that the variant is wrong + writeln!(f, "}} else {{")?; + f.add_indent(1); + writeln!( + f, + r#"unreachable!("expected {tagged_name}::{variant_name} for {from}")"# + )?; + f.sub_indent(1); + writeln!(f, "}}")?; } - f.sub_indent(1); - writeln!(f, "}}")?; } Ty::Ref(ref_ty) => { // Add a deref, and recurse into the pointee let base = format!("(*{from})"); - self.write_fields(f, state, to, &base, ref_ty.pointee_ty)? + self.write_fields(f, state, to, &base, ref_ty.pointee_ty, vals)? } Ty::Union(union_ty) => { - // FIXME(variant_select): hardcoded to access field 0 for now - let idx = 0; - if let Some(field) = union_ty.fields.get(idx) { + // Process the implicit "tag" value + let tag_generator = vals.next().expect("internal error: ran out of values!?"); + if let Some(field) = tag_generator.select_val(&union_ty.fields) { let field_name = &field.ident; let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty)?; + self.write_fields(f, state, to, &base, field.ty, vals)?; } } }; @@ -1206,9 +1211,9 @@ impl RustcAbiImpl { fn pass_var( &self, f: &mut dyn Write, - state: &TestImpl, + _state: &TestImpl, var_name: &str, - var_ty: TyIdx, + _var_ty: TyIdx, ) -> Result<(), GenerateError> { write!(f, "{var_name}")?; Ok(()) @@ -1217,9 +1222,9 @@ impl RustcAbiImpl { fn return_var( &self, f: &mut dyn Write, - state: &TestImpl, + _state: &TestImpl, var_name: &str, - var_ty: TyIdx, + _var_ty: TyIdx, ) -> Result<(), GenerateError> { // TODO: implement outparam returns writeln!(f, "{var_name}")?; @@ -1227,23 +1232,40 @@ impl RustcAbiImpl { } } -/// For a given primitive type, generate an instance -/// where all the high nybbles of each byte is val_idx -/// and all the low nybbles are the number byte. -/// -/// This lets us look at a random byte a function read -/// and go "hey this was SUPPOSED to be the 3rd byte of the 7th arg", -/// which is useful for figuring out how an argument got fucked up -/// (how much it was misaligned, or passed in the wrong slot). -fn graffiti_primitive(val_idx: usize) -> T { - const MAX_SIZE: usize = 32; - const MAX_HEX: usize = 16; - assert!( - std::mem::size_of::() <= MAX_SIZE, - "only primitives as big as u256 are supported!" - ); - - let bytes: [u8; MAX_SIZE] = - std::array::from_fn(|i| (0x10 * (val_idx % MAX_HEX) as u8) | ((i % MAX_HEX) as u8)); - unsafe { std::mem::transmute_copy(&bytes) } +/* +old impl for emitting a full match, which is now replaced with if-let. +Maybe we'll want this again? + +// generate a wrapper match, then recurse into each field of each variant +writeln!(f, "match &{from} {{")?; +f.add_indent(1); +let tagged_name = &tagged_ty.name; +// Process the implicit "tag" value +let tag_val = vals.next().expect("internal error: ran out of values!?"); +for variant in &tagged_ty.variants { + let variant_name = &variant.name; + match &variant.fields { + Some(fields) => { + // Variant with fields, recurse into them + let field_list = fields + .iter() + .map(|f| f.ident.to_string()) + .collect::>() + .join(", "); + writeln!(f, "{tagged_name}::{variant_name} {{ {field_list} }} => {{")?; + f.add_indent(1); + for field in fields { + self.write_fields(f, state, to, &field.ident, field.ty, vals)?; + } + f.sub_indent(1); + writeln!(f, "}}")?; + } + None => { + // Variant without fields, need to include branch for exhaustiveness + writeln!(f, "{tagged_name}::{variant_name} => {{ }}")?; + } + } } +f.sub_indent(1); +writeln!(f, "}}")?; +*/ diff --git a/src/abis/vals.rs b/src/abis/vals.rs new file mode 100644 index 0000000..7539783 --- /dev/null +++ b/src/abis/vals.rs @@ -0,0 +1,263 @@ +use kdl_script::types::*; +use rand::Rng; +use rand_core::{RngCore, SeedableRng}; +use serde::Serialize; + +pub type ValIter<'a> = std::slice::Iter<'a, ValueGenerator>; +type RngImpl = rand_pcg::Pcg64; + +#[derive(Debug, Clone)] +pub struct ValueTree { + pub generator_kind: ValueGeneratorKind, + pub funcs: Vec, +} + +#[derive(Debug, Clone)] +pub struct FuncValues { + pub args: Vec, +} + +#[derive(Debug, Clone)] +pub struct ArgValues { + pub vals: Vec, +} + +#[derive(Debug, Clone)] +pub enum ValueGenerator { + Graffiti { idx: u64 }, + Random { seed: u64 }, +} + +#[derive(Debug, Clone)] +enum ValueGeneratorBuilder { + Graffiti { idx: u64 }, + Random { rng: RngImpl }, +} + +#[derive(Debug, Clone, Serialize)] +pub enum ValueGeneratorKind { + Graffiti, + Random { seed: u64 }, +} + +impl ValueTree { + /// Create the ValueTree for an entire program + pub fn new(types: &TypedProgram, generator_kind: ValueGeneratorKind) -> Self { + let mut generators = generator_kind.builder(); + // Construct value generators for every function + let funcs = types + .all_funcs() + .map(|func_idx| { + let func = types.realize_func(func_idx); + let args = func + .inputs + .iter() + .chain(&func.outputs) + .map(|arg| { + let mut vals = vec![]; + generators.build_values(types, arg.ty, &mut vals); + ArgValues { vals } + }) + .collect(); + FuncValues { args } + }) + .collect(); + + ValueTree { + generator_kind, + funcs, + } + } +} + +impl ValueGeneratorKind { + fn builder(&self) -> ValueGeneratorBuilder { + match self { + ValueGeneratorKind::Graffiti => ValueGeneratorBuilder::Graffiti { idx: 0 }, + // We use the given seed to construct an RNG, and make new RNG seeds with it. + // This isn't to "increase randomness" or anything, but instead to create N + // random streams of bytes that can be repeatably and independently queried, + // while still having them all deterministically derived from the root seed. + ValueGeneratorKind::Random { seed } => ValueGeneratorBuilder::Random { + rng: RngImpl::seed_from_u64(*seed), + }, + } + } +} + +impl ValueGeneratorBuilder { + fn next(&mut self) -> ValueGenerator { + match self { + ValueGeneratorBuilder::Graffiti { idx } => { + let res = ValueGenerator::Graffiti { idx: *idx }; + *idx += 1; + res + } + ValueGeneratorBuilder::Random { rng } => ValueGenerator::Random { + seed: rng.next_u64(), + }, + } + } + + fn build_values( + &mut self, + types: &TypedProgram, + ty_idx: TyIdx, + vals: &mut Vec, + ) { + let ty = types.realize_ty(ty_idx); + match ty { + // Primitives and enums just have the one value + Ty::Primitive(_) => vals.push(self.next()), + Ty::Enum(_) => vals.push(self.next()), + + // Empty has no values + Ty::Empty => {} + + // Alias and ref are just wrappers + Ty::Alias(ty) => self.build_values(types, ty.real, vals), + Ty::Ref(ty) => self.build_values(types, ty.pointee_ty, vals), + + // Struct and array are just all of their fields combined + Ty::Struct(ty) => { + for field in &ty.fields { + self.build_values(types, field.ty, vals); + } + } + Ty::Array(ty) => { + for _ in 0..ty.len { + self.build_values(types, ty.elem_ty, vals); + } + } + + // Union and Tagged need an implicit "tag" field for selecting the active variant + Ty::Union(ty) => { + // generate the tag value + let tag_generator = self.next(); + let active_variant_idx = tag_generator.generate_idx(ty.fields.len()); + vals.push(tag_generator); + + // now visit the active variant + if let Some(field) = ty.fields.get(active_variant_idx) { + self.build_values(types, field.ty, vals); + } + } + Ty::Tagged(ty) => { + // generate the tag value + let tag_generator = self.next(); + let active_variant_idx = tag_generator.generate_idx(ty.variants.len()); + vals.push(tag_generator); + + // now visit the active variant + if let Some(variant) = ty.variants.get(active_variant_idx) { + if let Some(fields) = &variant.fields { + // And all of its fields + for field in fields { + self.build_values(types, field.ty, vals); + } + } + } + } + + // Pun ty is similar to a union, but for integrity we want to enforce that all paths + // produce the same number of values + Ty::Pun(ty) => { + let mut out_vals = None::>; + let saved_self = self.clone(); + for block in &ty.blocks { + // Every time we re-enter here, restore our state to before we started. + // This ensures our state is mutated for good after the last iteration, + // but the same state is used for each one. + *self = saved_self.clone(); + + // Shove values into a temp buffer instead of the main one + let mut new_vals = vec![]; + self.build_values(types, block.real, &mut new_vals); + + // If there are multiple blocks, check that this new one matches + // all the other ones in length (making the pun semantically comprehensible) + if let Some(old_vals) = out_vals { + assert!(old_vals.len() != new_vals.len(), "pun {} had cases with different numbers of values (~leaf fields), this is unsupported", ty.name); + } + + // Finally store the result + out_vals = Some(new_vals); + } + + // If we visited any blocks, properly add the values to the output + if let Some(out_vals) = out_vals { + vals.extend(out_vals); + } + } + } + } +} + +impl ValueGenerator { + pub fn fill_bytes(&self, output: &mut [u8]) { + match self { + ValueGenerator::Graffiti { idx } => { + // Graffiti bytes: + // high nibble is the field index (wrapping) + // low nibble is the byte index (wrapping) + for (byte_idx, byte) in output.iter_mut().enumerate() { + *byte = ((*idx as u8) << 4) | ((byte_idx as u8) & 0b1111); + } + } + ValueGenerator::Random { seed } => { + // Construct an RNG from this seed and ask it to fill in the bytes + let mut rng = RngImpl::seed_from_u64(*seed); + rng.fill_bytes(output); + } + } + } + + pub fn select_val<'a, T>(&self, options: &'a [T]) -> Option<&'a T> { + let idx = self.generate_idx(options.len()); + options.get(idx) + } + + // Generate an index in the range 0..len + pub fn generate_idx(&self, len: usize) -> usize { + // Convenient special case for empty lists + if len == 0 { + return 0; + } + let mut rng = match self { + ValueGenerator::Graffiti { .. } => { + // To turn our pattern value into a fairly evenly distributed selection + // of the possible values in the range, just generate a grafitti u64 and + // use it as the seed for an rng, then ask rand to figure it out! + let seed = self.generate_u64(); + RngImpl::seed_from_u64(seed) + } + ValueGenerator::Random { seed } => RngImpl::seed_from_u64(*seed), + }; + rng.gen_range(0..len) + } + pub fn generate_u8(&self) -> u8 { + let mut buf = [0; 1]; + self.fill_bytes(&mut buf); + u8::from_le_bytes(buf) + } + pub fn generate_u16(&self) -> u16 { + let mut buf = [0; 2]; + self.fill_bytes(&mut buf); + u16::from_le_bytes(buf) + } + pub fn generate_u32(&self) -> u32 { + let mut buf = [0; 4]; + self.fill_bytes(&mut buf); + u32::from_le_bytes(buf) + } + pub fn generate_u64(&self) -> u64 { + let mut buf = [0; 8]; + self.fill_bytes(&mut buf); + u64::from_le_bytes(buf) + } + pub fn generate_u128(&self) -> u128 { + let mut buf = [0; 16]; + self.fill_bytes(&mut buf); + u128::from_le_bytes(buf) + } +} diff --git a/src/harness/mod.rs b/src/harness/mod.rs index d655f48..2f220d8 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -8,7 +8,10 @@ use std::error::Error; -use crate::{ArgSelector, CallSide, FunctionSelector, TestHarness, TestKey, TestOptions}; +use crate::{ + vals::ValueGeneratorKind, ArgSelector, CallSide, FunctionSelector, TestHarness, TestKey, + TestOptions, WriteImpl, +}; mod build; mod check; @@ -38,6 +41,7 @@ impl TestHarness { convention, functions, val_writer, + val_generator, }, caller, callee, @@ -79,18 +83,27 @@ impl TestHarness { } } match val_writer { - crate::WriteImpl::HarnessCallback => { + WriteImpl::HarnessCallback => { // Do nothing, implicit default } - crate::WriteImpl::Print => { + WriteImpl::Print => { output.push_str(separator); output.push_str("print"); } - crate::WriteImpl::Noop => { + WriteImpl::Noop => { output.push_str(separator); output.push_str("noop"); } } + match val_generator { + ValueGeneratorKind::Graffiti => { + // Do nothing, implicit default + } + ValueGeneratorKind::Random { seed } => { + output.push_str(separator); + output.push_str(&format!("random{seed}")); + } + } output } diff --git a/src/main.rs b/src/main.rs index c0c6d1a..b75f418 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ use std::error::Error; use std::process::Command; use std::sync::{Arc, Mutex}; use tokio::sync::OnceCell; +use vals::ValueGeneratorKind; pub type SortedMap = std::collections::BTreeMap; @@ -293,6 +294,7 @@ fn main() -> Result<(), Box> { convention: *convention, functions: FunctionSelector::All, val_writer: WriteImpl::HarnessCallback, + val_generator: ValueGeneratorKind::Graffiti, }, }; let rules = harness.get_test_rules(&test_key); diff --git a/tests/kdl/types.kdl b/tests/kdl/types.kdl index f43c67e..1dc97cb 100644 --- a/tests/kdl/types.kdl +++ b/tests/kdl/types.kdl @@ -37,8 +37,9 @@ tagged "MyDeepResult" { } union "Life" { - simple "Simple2" - complex "Complex" + simple "Simple" + complex "OptionI32" + empty "()" } struct "ContainsRefs" { @@ -86,6 +87,14 @@ fn "enumtime" { } } +fn "uniontime" { + inputs { + a "Life" + b "[Life; 3]" + c "&Life" + } +} + fn "reftime" { inputs { a "i32" From e5ea525fdb7e9cc2550b9293031deb63fe85d787 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 22 Jun 2024 12:40:01 -0400 Subject: [PATCH 22/44] feat: reimplement procgen --- src/abis/rust.rs | 2 +- src/main.rs | 4 +- src/procgen.rs | 483 ++++--------- tests/procgen/bool.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/bool.ron | 1 - tests/procgen/f32.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/f32.ron | 1 - tests/procgen/f64.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/f64.ron | 1 - tests/procgen/i128.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/i16.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/i16.ron | 1 - tests/procgen/i32.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/i32.ron | 1 - tests/procgen/i64.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/i64.ron | 1 - tests/procgen/i8.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/i8.ron | 1 - tests/procgen/ptr.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/ptr.ron | 1 - tests/procgen/u128.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/u16.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/u16.ron | 1 - tests/procgen/u32.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/u32.ron | 1 - tests/procgen/u64.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/u64.ron | 1 - tests/procgen/u8.kdl | 1490 +++++++++++++++++++++++++++++++++++++++ tests/procgen/u8.ron | 1 - tests/procgen/ui128.ron | 1 - 30 files changed, 21012 insertions(+), 350 deletions(-) create mode 100644 tests/procgen/bool.kdl delete mode 100644 tests/procgen/bool.ron create mode 100644 tests/procgen/f32.kdl delete mode 100644 tests/procgen/f32.ron create mode 100644 tests/procgen/f64.kdl delete mode 100644 tests/procgen/f64.ron create mode 100644 tests/procgen/i128.kdl create mode 100644 tests/procgen/i16.kdl delete mode 100644 tests/procgen/i16.ron create mode 100644 tests/procgen/i32.kdl delete mode 100644 tests/procgen/i32.ron create mode 100644 tests/procgen/i64.kdl delete mode 100644 tests/procgen/i64.ron create mode 100644 tests/procgen/i8.kdl delete mode 100644 tests/procgen/i8.ron create mode 100644 tests/procgen/ptr.kdl delete mode 100644 tests/procgen/ptr.ron create mode 100644 tests/procgen/u128.kdl create mode 100644 tests/procgen/u16.kdl delete mode 100644 tests/procgen/u16.ron create mode 100644 tests/procgen/u32.kdl delete mode 100644 tests/procgen/u32.ron create mode 100644 tests/procgen/u64.kdl delete mode 100644 tests/procgen/u64.ron create mode 100644 tests/procgen/u8.kdl delete mode 100644 tests/procgen/u8.ron delete mode 100644 tests/procgen/ui128.ron diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 50f04fb..5871cae 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -724,7 +724,7 @@ impl RustcAbiImpl { PrimitiveTy::I16 => write!(f, "{:#X}u16 as i16", val.generate_u16())?, PrimitiveTy::I32 => write!(f, "{:#X}u32 as i32", val.generate_u32())?, PrimitiveTy::I64 => write!(f, "{:#X}u64 as i64", val.generate_u64())?, - PrimitiveTy::I128 => write!(f, "{:#X}", val.generate_u128())?, + PrimitiveTy::I128 => write!(f, "{:#X}u128 as i128", val.generate_u128())?, PrimitiveTy::U8 => write!(f, "{:#X}", val.generate_u8())?, PrimitiveTy::U16 => write!(f, "{:#X}", val.generate_u16())?, PrimitiveTy::U32 => write!(f, "{:#X}", val.generate_u32())?, diff --git a/src/main.rs b/src/main.rs index b75f418..ce411e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ mod error; mod fivemat; mod harness; -// mod procgen; +mod procgen; mod report; use abis::*; @@ -211,7 +211,7 @@ fn main() -> Result<(), Box> { let cfg = cli::make_app(); eprintln!("parsed cli!"); // Before doing anything, regenerate the procgen tests, if needed. - // TODO: procgen::procgen_tests(cfg.procgen_tests); + procgen::procgen_tests(cfg.procgen_tests); eprintln!("generated tests!"); let out_dir = init_dirs()?; diff --git a/src/procgen.rs b/src/procgen.rs index 9eda087..363fef9 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -1,4 +1,3 @@ -use crate::abis::*; use std::io::Write; use std::path::PathBuf; @@ -20,356 +19,172 @@ pub fn procgen_tests(regenerate: bool) { std::fs::remove_dir_all(&proc_gen_root).unwrap(); std::fs::create_dir_all(&proc_gen_root).unwrap(); - let tests: &[(&str, &[Val])] = &[ - // Just run basic primitives that everyone should support through their paces. - // This is chunked out a bit to avoid stressing the compilers/linkers too much, - // in case some work scales non-linearly. It also keeps the test suite - // a bit more "responsive" instead of just stalling one enormous supertest. - ("i64", &[Val::Int(IntVal::c_int64_t(0x1a2b_3c4d_23ea_f142))]), - ("i32", &[Val::Int(IntVal::c_int32_t(0x1a2b3c4d))]), - ("i16", &[Val::Int(IntVal::c_int16_t(0x1a2b))]), - ("i8", &[Val::Int(IntVal::c_int8_t(0x1a))]), - ( - "u64", - &[Val::Int(IntVal::c_uint64_t(0x1a2b_3c4d_23ea_f142))], - ), - ("u32", &[Val::Int(IntVal::c_uint32_t(0x1a2b3c4d))]), - ("u16", &[Val::Int(IntVal::c_uint16_t(0x1a2b))]), - ("u8", &[Val::Int(IntVal::c_uint8_t(0x1a))]), - ("ptr", &[Val::Ptr(0x1a2b_3c4d_23ea_f142)]), - ("bool", &[Val::Bool(true)]), - ("f64", &[Val::Float(FloatVal::c_double(809239021.392))]), - ("f32", &[Val::Float(FloatVal::c_float(-4921.3527))]), - // These are split out because they are the buggy mess that inspired this whole enterprise! - // These types are a GCC exenstion. Windows is a huge dumpster fire where no one agrees on - // it (MSVC doesn't even define __(u)int128_t afaict, but has some equivalent extension). - // - // On linux-based platforms where this is a more established thing, current versions of - // rustc underalign the value (as if it's emulated, like u64 on x86). This isn't a problem - // in-and-of-itself because rustc accurately says "this isn't usable for FFI". - // Unfortunately platforms like aarch64 (arm64) use this type in their definitions for - // saving/restoring float registers, so it's very much so part of the platform ABI, - // and Rust should just *fix this*. - ( - "ui128", - &[ - Val::Int(IntVal::c__int128(0x1a2b_3c4d_23ea_f142_7a32_0c01_e012_0a82)), - Val::Int(IntVal::c__uint128( - 0x1a2b_3c4d_23ea_f142_7a32_0c01_e012_0a82, - )), - ], - ), + let tests = &[ + "i128", "i64", "i32", "i16", "i8", "u128", "u64", "u32", "u16", "u8", "ptr", "bool", "f64", + "f32", ]; - for (test_name, vals) in tests { - let mut test = Test { - name: test_name.to_string(), - funcs: Vec::new(), - }; + for test_name in tests { + let mut test_body = String::new(); - let mut perturb_float = 0.0f32; - let mut perturb_byte = 0u8; + procgen_test_for_ty(&mut test_body, test_name, None).unwrap(); - for val in vals.iter() { - let new_val = |i| -> Val { - let mut new_val = val.clone(); - let mut cur_val = Some(&mut new_val); - while let Some(temp) = cur_val.take() { - match temp { - Val::Ref(pointee) => { - cur_val = Some(&mut **pointee); - continue; - } - Val::Struct(_, _) => unimplemented!(), - Val::Array(_) => unimplemented!(), - Val::Ptr(out) => graffiti_primitive(out, i), - Val::Int(int_val) => match int_val { - IntVal::c__int128(out) => graffiti_primitive(out, i), - IntVal::c_int64_t(out) => graffiti_primitive(out, i), - IntVal::c_int32_t(out) => graffiti_primitive(out, i), - IntVal::c_int16_t(out) => graffiti_primitive(out, i), - IntVal::c_int8_t(out) => graffiti_primitive(out, i), - IntVal::c__uint128(out) => graffiti_primitive(out, i), - IntVal::c_uint64_t(out) => graffiti_primitive(out, i), - IntVal::c_uint32_t(out) => graffiti_primitive(out, i), - IntVal::c_uint16_t(out) => graffiti_primitive(out, i), - IntVal::c_uint8_t(out) => graffiti_primitive(out, i), - }, - Val::Float(float_val) => match float_val { - FloatVal::c_double(out) => graffiti_primitive(out, i), - FloatVal::c_float(out) => graffiti_primitive(out, i), - }, - Val::Bool(out) => *out = true, - } - } - - new_val - }; - - let val_name = arg_ty(val); - - // Start gentle with basic one value in/out tests - test.funcs.push(Func { - name: format!("{val_name}_val_in"), - conventions: vec![CallingConvention::All], - inputs: vec![new_val(0)], - output: None, - }); - - test.funcs.push(Func { - name: format!("{val_name}_val_out"), - conventions: vec![CallingConvention::All], - inputs: vec![], - output: Some(new_val(0)), - }); - - test.funcs.push(Func { - name: format!("{val_name}_val_in_out"), - conventions: vec![CallingConvention::All], - inputs: vec![new_val(0)], - output: Some(new_val(1)), - }); - - // Start gentle with basic one value in/out tests - test.funcs.push(Func { - name: format!("{val_name}_ref_in"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Ref(Box::new(new_val(0)))], - output: None, - }); - - test.funcs.push(Func { - name: format!("{val_name}_ref_out"), - conventions: vec![CallingConvention::All], - inputs: vec![], - output: Some(Val::Ref(Box::new(new_val(0)))), - }); - - test.funcs.push(Func { - name: format!("{val_name}_ref_in_out"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Ref(Box::new(new_val(0)))], - output: Some(Val::Ref(Box::new(new_val(1)))), - }); - - // Stress out the calling convention and try lots of different - // input counts. For many types this will result in register - // exhaustion and get some things passed on the stack. - for len in 2..=16 { - test.funcs.push(Func { - name: format!("{val_name}_val_in_{len}"), - conventions: vec![CallingConvention::All], - inputs: (0..len).map(new_val).collect(), - output: None, - }); - } - - // Stress out the calling convention with a struct full of values. - // Some conventions will just shove this in a pointer/stack, - // others will try to scalarize this into registers anyway. - for len in 1..=16 { - test.funcs.push(Func { - name: format!("{val_name}_struct_in_{len}"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Struct( - format!("{val_name}_{len}"), - (0..len).map(new_val).collect(), - )], - output: None, - }); - } - // Check that by-ref works, for good measure - for len in 1..=16 { - test.funcs.push(Func { - name: format!("{val_name}_ref_struct_in_{len}"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Ref(Box::new(Val::Struct( - format!("{val_name}_{len}"), - (0..len).map(new_val).collect(), - )))], - output: None, - }); - } - - // Now perturb the arguments by including a byte and a float in - // the argument list. This will mess with alignment and also mix - // up the "type classes" (float vs int) and trigger more corner - // cases in the ABIs as things get distributed to different classes - // of register. - - // We do small and big versions to check the cases where everything - // should fit in registers vs not. - let small_count = 4; - let big_count = 16; - - for idx in 0..small_count { - let mut inputs = (0..small_count).map(new_val).collect::>(); - - let byte_idx = idx; - let float_idx = small_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); - - test.funcs.push(Func { - name: format!("{val_name}_val_in_{idx}_perturbed_small"), - conventions: vec![CallingConvention::All], - inputs, - output: None, - }); - } - for idx in 0..big_count { - let mut inputs = (0..big_count).map(new_val).collect::>(); - - let byte_idx = idx; - let float_idx = big_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); - - test.funcs.push(Func { - name: format!("{val_name}_val_in_{idx}_perturbed_big"), - conventions: vec![CallingConvention::All], - inputs, - output: None, - }); - } - - for idx in 0..small_count { - let mut inputs = (0..small_count).map(new_val).collect::>(); - - let byte_idx = idx; - let float_idx = small_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); - - test.funcs.push(Func { - name: format!("{val_name}_struct_in_{idx}_perturbed_small"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Struct( - format!("{val_name}_{idx}_perturbed_small"), - inputs, - )], - output: None, - }); - } - for idx in 0..big_count { - let mut inputs = (0..big_count).map(new_val).collect::>(); + let mut file = + std::fs::File::create(proc_gen_root.join(format!("{test_name}.kdl"))).unwrap(); + file.write_all(test_body.as_bytes()).unwrap(); + } +} - let byte_idx = idx; - let float_idx = big_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); +fn procgen_test_for_ty( + out: &mut dyn std::fmt::Write, + ty_name: &str, + ty_def: Option<&str>, +) -> std::fmt::Result { + let ty = ty_name; + let ty_ref = format!("&{ty_name}"); + if let Some(ty_def) = ty_def { + writeln!(out, "{}", ty_def)?; + } - test.funcs.push(Func { - name: format!("{val_name}_struct_in_{idx}_perturbed_big"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Struct( - format!("{val_name}_{idx}_perturbed_big"), - inputs, - )], - output: None, - }); - } + // Start gentle with basic one value in/out tests + add_func(out, &format!("{ty_name}_val_in"), &[ty], &[])?; + add_func(out, &format!("{ty_name}_val_out"), &[], &[ty])?; + add_func(out, &format!("{ty_name}_val_in_out"), &[ty], &[ty])?; + add_func(out, &format!("{ty_name}_ref_in"), &[&ty_ref], &[])?; + // add_func(out, &format!("{ty_name}_ref_out"), &[], &[&ty_ref])?; + // add_func(out, &format!("{ty_name}_ref_in_out"), &[&ty_ref], &[&ty_ref])?; + + // Stress out the calling convention and try lots of different + // input counts. For many types this will result in register + // exhaustion and get some things passed on the stack. + for len in 2..=16 { + add_func(out, &format!("{ty_name}_val_in_{len}"), &vec![ty; len], &[])?; + } - // Should be an exact copy-paste of the above but with Ref's added - for idx in 0..small_count { - let mut inputs = (0..small_count).map(new_val).collect::>(); + // Stress out the calling convention with a struct full of values. + // Some conventions will just shove this in a pointer/stack, + // others will try to scalarize this into registers anyway. + add_structs(out, ty)?; + + // Now perturb the arguments by including a byte and a float in + // the argument list. This will mess with alignment and also mix + // up the "type classes" (float vs int) and trigger more corner + // cases in the ABIs as things get distributed to different classes + // of register. + + // We do small and big versions to check the cases where everything + // should fit in registers vs not. + let small_count = 4; + let big_count = 16; + + add_perturbs(out, ty, small_count, "small")?; + add_perturbs(out, ty, big_count, "big")?; + add_perturbs_struct(out, ty, small_count, "small")?; + add_perturbs_struct(out, ty, big_count, "big")?; + Ok(()) +} - let byte_idx = idx; - let float_idx = small_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); +fn add_structs(out: &mut dyn std::fmt::Write, ty: &str) -> std::fmt::Result { + for len in 1..=16 { + // Establish type names + let struct_ty = format!("Many{len}"); + let struct_ty_ref = format!("&{struct_ty}"); - test.funcs.push(Func { - name: format!("{val_name}_ref_struct_in_{idx}_perturbed_small"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Ref(Box::new(Val::Struct( - format!("{val_name}_{idx}_perturbed_small"), - inputs, - )))], - output: None, - }); - } - for idx in 0..big_count { - let mut inputs = (0..big_count).map(new_val).collect::>(); + // Emit struct defs + writeln!(out, r#"struct "{struct_ty}" {{"#)?; + for field_idx in 0..len { + writeln!(out, r#" f{field_idx} "{ty}""#)?; + } + writeln!(out, r#"}}"#)?; + + // Check that by-val works + add_func(out, &format!("{ty}_struct_in_{len}"), &[&struct_ty], &[])?; + // Check that by-ref works, for good measure + add_func( + out, + &format!("{ty}_ref_struct_in_{len}"), + &[&struct_ty_ref], + &[], + )?; + } + Ok(()) +} - let byte_idx = idx; - let float_idx = big_count - 1 - idx; - graffiti_primitive(&mut perturb_byte, byte_idx); - graffiti_primitive(&mut perturb_float, float_idx); - inputs[byte_idx] = Val::Int(IntVal::c_uint8_t(perturb_byte)); - inputs[float_idx] = Val::Float(FloatVal::c_float(perturb_float)); +fn add_perturbs( + out: &mut dyn std::fmt::Write, + ty: &str, + count: usize, + label: &str, +) -> std::fmt::Result { + for idx in 0..count { + let inputs = perturb_list(ty, count, idx); + add_func( + out, + &format!("{ty}_val_in_{idx}_perturbed_{label}"), + &inputs, + &[], + )?; + } + Ok(()) +} - test.funcs.push(Func { - name: format!("{val_name}_ref_struct_in_{idx}_perturbed_big"), - conventions: vec![CallingConvention::All], - inputs: vec![Val::Ref(Box::new(Val::Struct( - format!("{val_name}_{idx}_perturbed_big"), - inputs, - )))], - output: None, - }); - } +fn add_perturbs_struct( + out: &mut dyn std::fmt::Write, + ty: &str, + count: usize, + label: &str, +) -> std::fmt::Result { + for idx in 0..count { + let inputs = perturb_list(ty, count, idx); + + // Establish type names + let struct_ty = format!("Perturbed{label}{idx}"); + + // Emit struct defs + writeln!(out, r#"struct "{struct_ty}" {{"#)?; + for (field_idx, field_ty) in inputs.iter().enumerate() { + writeln!(out, r#" f{field_idx} "{field_ty}""#)?; } - let mut file = - std::fs::File::create(proc_gen_root.join(format!("{test_name}.ron"))).unwrap(); - let output = ron::to_string(&test).unwrap(); - file.write_all(output.as_bytes()).unwrap(); + writeln!(out, r#"}}"#)?; + + // Add the function + add_func( + out, + &format!("{ty}_val_in_{idx}_perturbed_{label}"), + &[&struct_ty], + &[], + )?; } + Ok(()) } -/// The type name to use for this value when it is stored in args/vars. -pub fn arg_ty(val: &Val) -> String { - use IntVal::*; - use Val::*; - match val { - Ref(x) => format!("ref_{}", arg_ty(x)), - Ptr(_) => "ptr".to_string(), - Bool(_) => "bool".to_string(), - Array(vals) => format!( - "arr_{}_{}", - vals.len(), - arg_ty(vals.get(0).expect("arrays must have length > 0")), - ), - Struct(name, _) => format!("struct_{name}"), - Float(FloatVal::c_double(_)) => "f64".to_string(), - Float(FloatVal::c_float(_)) => "f32".to_string(), - Int(int_val) => match int_val { - c__int128(_) => "i128".to_string(), - c_int64_t(_) => "i64".to_string(), - c_int32_t(_) => "i32".to_string(), - c_int16_t(_) => "i16".to_string(), - c_int8_t(_) => "i8".to_string(), - c__uint128(_) => "u128".to_string(), - c_uint64_t(_) => "u64".to_string(), - c_uint32_t(_) => "u32".to_string(), - c_uint16_t(_) => "u16".to_string(), - c_uint8_t(_) => "u8".to_string(), - }, - } +fn perturb_list(ty: &str, count: usize, idx: usize) -> Vec<&str> { + let mut inputs = vec![ty; count]; + + let byte_idx = idx; + let float_idx = count - 1 - idx; + inputs[byte_idx] = "u8"; + inputs[float_idx] = "f32"; + inputs } -fn graffiti_primitive(output: &mut T, idx: usize) { - let mut input = [ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, - ]; - for byte in &mut input { - *byte |= 0x10 * idx as u8; +fn add_func( + out: &mut dyn std::fmt::Write, + func_name: &str, + inputs: &[&str], + outputs: &[&str], +) -> std::fmt::Result { + writeln!(out, r#"fn "{func_name}" {{"#)?; + writeln!(out, r#" inputs {{"#)?; + for (idx, arg_ty) in inputs.iter().enumerate() { + writeln!(out, r#" arg{idx} "{arg_ty}""#)?; } - unsafe { - let out_size = std::mem::size_of::(); - assert!(out_size <= input.len()); - let raw_out = output as *mut T as *mut u8; - raw_out.copy_from(input.as_ptr(), out_size) + writeln!(out, r#" }}"#)?; + writeln!(out, r#" outputs {{"#)?; + for (idx, arg_ty) in outputs.iter().enumerate() { + writeln!(out, r#" arg{idx} "{arg_ty}""#)?; } + writeln!(out, r#" }}"#)?; + writeln!(out, r#"}}"#)?; + Ok(()) } diff --git a/tests/procgen/bool.kdl b/tests/procgen/bool.kdl new file mode 100644 index 0000000..688a2f2 --- /dev/null +++ b/tests/procgen/bool.kdl @@ -0,0 +1,1490 @@ +fn "bool_val_in" { + inputs { + arg0 "bool" + } + outputs { + } +} +fn "bool_val_out" { + inputs { + } + outputs { + arg0 "bool" + } +} +fn "bool_val_in_out" { + inputs { + arg0 "bool" + } + outputs { + arg0 "bool" + } +} +fn "bool_ref_in" { + inputs { + arg0 "&bool" + } + outputs { + } +} +fn "bool_val_in_2" { + inputs { + arg0 "bool" + arg1 "bool" + } + outputs { + } +} +fn "bool_val_in_3" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + } + outputs { + } +} +fn "bool_val_in_4" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + } + outputs { + } +} +fn "bool_val_in_5" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + } + outputs { + } +} +fn "bool_val_in_6" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + } + outputs { + } +} +fn "bool_val_in_7" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + } + outputs { + } +} +fn "bool_val_in_8" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + } + outputs { + } +} +fn "bool_val_in_9" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + } + outputs { + } +} +fn "bool_val_in_10" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + } + outputs { + } +} +fn "bool_val_in_11" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + } + outputs { + } +} +fn "bool_val_in_12" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + } + outputs { + } +} +fn "bool_val_in_13" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + } + outputs { + } +} +fn "bool_val_in_14" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + } + outputs { + } +} +fn "bool_val_in_15" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + } + outputs { + } +} +fn "bool_val_in_16" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +struct "Many1" { + f0 "bool" +} +fn "bool_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "bool_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "bool" + f1 "bool" +} +fn "bool_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "bool_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "bool" + f1 "bool" + f2 "bool" +} +fn "bool_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "bool_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" +} +fn "bool_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "bool_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" +} +fn "bool_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "bool_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" +} +fn "bool_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "bool_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" +} +fn "bool_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "bool_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" +} +fn "bool_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "bool_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" +} +fn "bool_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "bool_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" +} +fn "bool_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "bool_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" +} +fn "bool_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "bool_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" +} +fn "bool_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "bool_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" +} +fn "bool_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "bool_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" +} +fn "bool_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "bool_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" +} +fn "bool_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "bool_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "bool_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "bool_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "bool" + arg2 "bool" + arg3 "f32" + } + outputs { + } +} +fn "bool_val_in_1_perturbed_small" { + inputs { + arg0 "bool" + arg1 "u8" + arg2 "f32" + arg3 "bool" + } + outputs { + } +} +fn "bool_val_in_2_perturbed_small" { + inputs { + arg0 "bool" + arg1 "f32" + arg2 "u8" + arg3 "bool" + } + outputs { + } +} +fn "bool_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "bool" + arg2 "bool" + arg3 "u8" + } + outputs { + } +} +fn "bool_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "f32" + } + outputs { + } +} +fn "bool_val_in_1_perturbed_big" { + inputs { + arg0 "bool" + arg1 "u8" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "f32" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_2_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "u8" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "f32" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_3_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "u8" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "f32" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_4_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "u8" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "f32" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_5_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "u8" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "f32" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_6_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "u8" + arg7 "bool" + arg8 "bool" + arg9 "f32" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_7_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "u8" + arg8 "f32" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_8_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "f32" + arg8 "u8" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_9_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "f32" + arg7 "bool" + arg8 "bool" + arg9 "u8" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_10_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "f32" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "u8" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_11_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "f32" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "u8" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_12_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "bool" + arg3 "f32" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "u8" + arg13 "bool" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_13_perturbed_big" { + inputs { + arg0 "bool" + arg1 "bool" + arg2 "f32" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "u8" + arg14 "bool" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_14_perturbed_big" { + inputs { + arg0 "bool" + arg1 "f32" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "u8" + arg15 "bool" + } + outputs { + } +} +fn "bool_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "bool" + arg2 "bool" + arg3 "bool" + arg4 "bool" + arg5 "bool" + arg6 "bool" + arg7 "bool" + arg8 "bool" + arg9 "bool" + arg10 "bool" + arg11 "bool" + arg12 "bool" + arg13 "bool" + arg14 "bool" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "bool" + f2 "bool" + f3 "f32" +} +fn "bool_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "bool" + f1 "u8" + f2 "f32" + f3 "bool" +} +fn "bool_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "bool" + f1 "f32" + f2 "u8" + f3 "bool" +} +fn "bool_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "bool" + f2 "bool" + f3 "u8" +} +fn "bool_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "f32" +} +fn "bool_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "bool" + f1 "u8" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "f32" + f15 "bool" +} +fn "bool_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "bool" + f1 "bool" + f2 "u8" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "f32" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "u8" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "f32" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "u8" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "f32" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "u8" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "f32" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "u8" + f7 "bool" + f8 "bool" + f9 "f32" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "u8" + f8 "f32" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "f32" + f8 "u8" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "f32" + f7 "bool" + f8 "bool" + f9 "u8" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "f32" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "u8" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "f32" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "u8" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "bool" + f1 "bool" + f2 "bool" + f3 "f32" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "u8" + f13 "bool" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "bool" + f1 "bool" + f2 "f32" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "u8" + f14 "bool" + f15 "bool" +} +fn "bool_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "bool" + f1 "f32" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "u8" + f15 "bool" +} +fn "bool_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "bool" + f2 "bool" + f3 "bool" + f4 "bool" + f5 "bool" + f6 "bool" + f7 "bool" + f8 "bool" + f9 "bool" + f10 "bool" + f11 "bool" + f12 "bool" + f13 "bool" + f14 "bool" + f15 "u8" +} +fn "bool_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/bool.ron b/tests/procgen/bool.ron deleted file mode 100644 index 6148113..0000000 --- a/tests/procgen/bool.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"bool",funcs:[(name:"bool_val_in",conventions:[All],inputs:[Bool(true)],output:None),(name:"bool_val_out",conventions:[All],inputs:[],output:Some(Bool(true))),(name:"bool_val_in_out",conventions:[All],inputs:[Bool(true)],output:Some(Bool(true))),(name:"bool_ref_in",conventions:[All],inputs:[Ref(Bool(true))],output:None),(name:"bool_ref_out",conventions:[All],inputs:[],output:Some(Ref(Bool(true)))),(name:"bool_ref_in_out",conventions:[All],inputs:[Ref(Bool(true))],output:Some(Ref(Bool(true)))),(name:"bool_val_in_2",conventions:[All],inputs:[Bool(true),Bool(true)],output:None),(name:"bool_val_in_3",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_4",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_5",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_6",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_7",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_8",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_9",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_10",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_11",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_12",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_13",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_14",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_15",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_16",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_struct_in_1",conventions:[All],inputs:[Struct("bool_1",[Bool(true)])],output:None),(name:"bool_struct_in_2",conventions:[All],inputs:[Struct("bool_2",[Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_3",conventions:[All],inputs:[Struct("bool_3",[Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_4",conventions:[All],inputs:[Struct("bool_4",[Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_5",conventions:[All],inputs:[Struct("bool_5",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_6",conventions:[All],inputs:[Struct("bool_6",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_7",conventions:[All],inputs:[Struct("bool_7",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_8",conventions:[All],inputs:[Struct("bool_8",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_9",conventions:[All],inputs:[Struct("bool_9",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_10",conventions:[All],inputs:[Struct("bool_10",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_11",conventions:[All],inputs:[Struct("bool_11",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_12",conventions:[All],inputs:[Struct("bool_12",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_13",conventions:[All],inputs:[Struct("bool_13",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_14",conventions:[All],inputs:[Struct("bool_14",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_15",conventions:[All],inputs:[Struct("bool_15",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_16",conventions:[All],inputs:[Struct("bool_16",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("bool_1",[Bool(true)]))],output:None),(name:"bool_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("bool_2",[Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("bool_3",[Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("bool_4",[Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("bool_5",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("bool_6",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("bool_7",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("bool_8",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("bool_9",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("bool_10",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("bool_11",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("bool_12",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("bool_13",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("bool_14",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("bool_15",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("bool_16",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Bool(true),Bool(true),Float(c_float(0.00000004148859))],output:None),(name:"bool_val_in_1_perturbed_small",conventions:[All],inputs:[Bool(true),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Bool(true)],output:None),(name:"bool_val_in_2_perturbed_small",conventions:[All],inputs:[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Bool(true)],output:None),(name:"bool_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Int(c_uint8_t(48))],output:None),(name:"bool_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"bool_val_in_1_perturbed_big",conventions:[All],inputs:[Bool(true),Int(c_uint8_t(16)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-8370480300000000000000)),Bool(true)],output:None),(name:"bool_val_in_2_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Int(c_uint8_t(32)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-1810926400000)),Bool(true),Bool(true)],output:None),(name:"bool_val_in_3_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Int(c_uint8_t(48)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-389.51367)),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_4_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(64)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.00000008321092)),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_5_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(80)),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.000000000000000017632526)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_6_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(96)),Bool(true),Bool(true),Float(c_float(-0.0000000000000000000000000036999117)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_7_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_8_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_9_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(4175980800000000000000)),Bool(true),Bool(true),Int(c_uint8_t(144)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_10_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(903307300000)),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(160)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_11_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(194.25488)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(176)),Bool(true),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_12_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Bool(true),Float(c_float(0.00000004148859)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(192)),Bool(true),Bool(true),Bool(true)],output:None),(name:"bool_val_in_13_perturbed_big",conventions:[All],inputs:[Bool(true),Bool(true),Float(c_float(0.000000000000000008789052)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(208)),Bool(true),Bool(true)],output:None),(name:"bool_val_in_14_perturbed_big",conventions:[All],inputs:[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(224)),Bool(true)],output:None),(name:"bool_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(240))],output:None),(name:"bool_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("bool_0_perturbed_small",[Int(c_uint8_t(0)),Bool(true),Bool(true),Float(c_float(0.00000004148859))])],output:None),(name:"bool_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("bool_1_perturbed_small",[Bool(true),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Bool(true)])],output:None),(name:"bool_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("bool_2_perturbed_small",[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Bool(true)])],output:None),(name:"bool_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("bool_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Int(c_uint8_t(48))])],output:None),(name:"bool_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("bool_0_perturbed_big",[Int(c_uint8_t(0)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"bool_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("bool_1_perturbed_big",[Bool(true),Int(c_uint8_t(16)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-8370480300000000000000)),Bool(true)])],output:None),(name:"bool_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("bool_2_perturbed_big",[Bool(true),Bool(true),Int(c_uint8_t(32)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-1810926400000)),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("bool_3_perturbed_big",[Bool(true),Bool(true),Bool(true),Int(c_uint8_t(48)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-389.51367)),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("bool_4_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(64)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.00000008321092)),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("bool_5_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(80)),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.000000000000000017632526)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("bool_6_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(96)),Bool(true),Bool(true),Float(c_float(-0.0000000000000000000000000036999117)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("bool_7_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("bool_8_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("bool_9_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(4175980800000000000000)),Bool(true),Bool(true),Int(c_uint8_t(144)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("bool_10_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(903307300000)),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(160)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("bool_11_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(194.25488)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(176)),Bool(true),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("bool_12_perturbed_big",[Bool(true),Bool(true),Bool(true),Float(c_float(0.00000004148859)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(192)),Bool(true),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("bool_13_perturbed_big",[Bool(true),Bool(true),Float(c_float(0.000000000000000008789052)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(208)),Bool(true),Bool(true)])],output:None),(name:"bool_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("bool_14_perturbed_big",[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(224)),Bool(true)])],output:None),(name:"bool_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("bool_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(240))])],output:None),(name:"bool_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("bool_0_perturbed_small",[Int(c_uint8_t(0)),Bool(true),Bool(true),Float(c_float(0.00000004148859))]))],output:None),(name:"bool_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("bool_1_perturbed_small",[Bool(true),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Bool(true)]))],output:None),(name:"bool_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("bool_2_perturbed_small",[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Bool(true)]))],output:None),(name:"bool_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("bool_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Int(c_uint8_t(48))]))],output:None),(name:"bool_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_0_perturbed_big",[Int(c_uint8_t(0)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"bool_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_1_perturbed_big",[Bool(true),Int(c_uint8_t(16)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-8370480300000000000000)),Bool(true)]))],output:None),(name:"bool_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_2_perturbed_big",[Bool(true),Bool(true),Int(c_uint8_t(32)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-1810926400000)),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_3_perturbed_big",[Bool(true),Bool(true),Bool(true),Int(c_uint8_t(48)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-389.51367)),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_4_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(64)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.00000008321092)),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_5_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(80)),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(-0.000000000000000017632526)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_6_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(96)),Bool(true),Bool(true),Float(c_float(-0.0000000000000000000000000036999117)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_7_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_8_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_9_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(4175980800000000000000)),Bool(true),Bool(true),Int(c_uint8_t(144)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_10_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(903307300000)),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(160)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_11_perturbed_big",[Bool(true),Bool(true),Bool(true),Bool(true),Float(c_float(194.25488)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(176)),Bool(true),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_12_perturbed_big",[Bool(true),Bool(true),Bool(true),Float(c_float(0.00000004148859)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(192)),Bool(true),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_13_perturbed_big",[Bool(true),Bool(true),Float(c_float(0.000000000000000008789052)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(208)),Bool(true),Bool(true)]))],output:None),(name:"bool_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_14_perturbed_big",[Bool(true),Float(c_float(0.0000000000000000000000000018436203)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(224)),Bool(true)]))],output:None),(name:"bool_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("bool_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Bool(true),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/f32.kdl b/tests/procgen/f32.kdl new file mode 100644 index 0000000..ed62058 --- /dev/null +++ b/tests/procgen/f32.kdl @@ -0,0 +1,1490 @@ +fn "f32_val_in" { + inputs { + arg0 "f32" + } + outputs { + } +} +fn "f32_val_out" { + inputs { + } + outputs { + arg0 "f32" + } +} +fn "f32_val_in_out" { + inputs { + arg0 "f32" + } + outputs { + arg0 "f32" + } +} +fn "f32_ref_in" { + inputs { + arg0 "&f32" + } + outputs { + } +} +fn "f32_val_in_2" { + inputs { + arg0 "f32" + arg1 "f32" + } + outputs { + } +} +fn "f32_val_in_3" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + } + outputs { + } +} +fn "f32_val_in_4" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + } + outputs { + } +} +fn "f32_val_in_5" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + } + outputs { + } +} +fn "f32_val_in_6" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + } + outputs { + } +} +fn "f32_val_in_7" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + } + outputs { + } +} +fn "f32_val_in_8" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + } + outputs { + } +} +fn "f32_val_in_9" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + } + outputs { + } +} +fn "f32_val_in_10" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + } + outputs { + } +} +fn "f32_val_in_11" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + } + outputs { + } +} +fn "f32_val_in_12" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + } + outputs { + } +} +fn "f32_val_in_13" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + } + outputs { + } +} +fn "f32_val_in_14" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + } + outputs { + } +} +fn "f32_val_in_15" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + } + outputs { + } +} +fn "f32_val_in_16" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +struct "Many1" { + f0 "f32" +} +fn "f32_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "f32_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "f32" + f1 "f32" +} +fn "f32_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "f32_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "f32" + f1 "f32" + f2 "f32" +} +fn "f32_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "f32_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" +} +fn "f32_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "f32_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" +} +fn "f32_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "f32_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" +} +fn "f32_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "f32_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" +} +fn "f32_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "f32_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" +} +fn "f32_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "f32_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" +} +fn "f32_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "f32_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" +} +fn "f32_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "f32_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" +} +fn "f32_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "f32_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" +} +fn "f32_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "f32_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" +} +fn "f32_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "f32_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" +} +fn "f32_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "f32_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" +} +fn "f32_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "f32_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "f32_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "f32_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "f32" + arg2 "f32" + arg3 "f32" + } + outputs { + } +} +fn "f32_val_in_1_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u8" + arg2 "f32" + arg3 "f32" + } + outputs { + } +} +fn "f32_val_in_2_perturbed_small" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "u8" + arg3 "f32" + } + outputs { + } +} +fn "f32_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "u8" + } + outputs { + } +} +fn "f32_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_1_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u8" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_2_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "u8" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_3_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "u8" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_4_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "u8" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_5_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "u8" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_6_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "u8" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_7_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "u8" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_8_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "u8" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_9_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "u8" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_10_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "u8" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_11_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "u8" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_12_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "u8" + arg13 "f32" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_13_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "u8" + arg14 "f32" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_14_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "u8" + arg15 "f32" + } + outputs { + } +} +fn "f32_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f32" + arg2 "f32" + arg3 "f32" + arg4 "f32" + arg5 "f32" + arg6 "f32" + arg7 "f32" + arg8 "f32" + arg9 "f32" + arg10 "f32" + arg11 "f32" + arg12 "f32" + arg13 "f32" + arg14 "f32" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "f32" + f2 "f32" + f3 "f32" +} +fn "f32_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "f32" + f1 "u8" + f2 "f32" + f3 "f32" +} +fn "f32_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "f32" + f1 "f32" + f2 "u8" + f3 "f32" +} +fn "f32_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "u8" +} +fn "f32_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "f32" + f1 "u8" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "f32" + f1 "f32" + f2 "u8" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "u8" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "u8" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "u8" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "u8" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "u8" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "u8" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "u8" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "u8" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "u8" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "u8" + f13 "f32" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "u8" + f14 "f32" + f15 "f32" +} +fn "f32_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "u8" + f15 "f32" +} +fn "f32_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "f32" + f2 "f32" + f3 "f32" + f4 "f32" + f5 "f32" + f6 "f32" + f7 "f32" + f8 "f32" + f9 "f32" + f10 "f32" + f11 "f32" + f12 "f32" + f13 "f32" + f14 "f32" + f15 "u8" +} +fn "f32_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/f32.ron b/tests/procgen/f32.ron deleted file mode 100644 index 618da94..0000000 --- a/tests/procgen/f32.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"f32",funcs:[(name:"f32_val_in",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714))],output:None),(name:"f32_val_out",conventions:[All],inputs:[],output:Some(Float(c_float(0.00000000000000000000000000000000000038204714)))),(name:"f32_val_in_out",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714))],output:Some(Float(c_float(0.0000000000000000000000000018436203)))),(name:"f32_ref_in",conventions:[All],inputs:[Ref(Float(c_float(0.00000000000000000000000000000000000038204714)))],output:None),(name:"f32_ref_out",conventions:[All],inputs:[],output:Some(Ref(Float(c_float(0.00000000000000000000000000000000000038204714))))),(name:"f32_ref_in_out",conventions:[All],inputs:[Ref(Float(c_float(0.00000000000000000000000000000000000038204714)))],output:Some(Ref(Float(c_float(0.0000000000000000000000000018436203))))),(name:"f32_val_in_2",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203))],output:None),(name:"f32_val_in_3",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052))],output:None),(name:"f32_val_in_4",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))],output:None),(name:"f32_val_in_5",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488))],output:None),(name:"f32_val_in_6",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000))],output:None),(name:"f32_val_in_7",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000))],output:None),(name:"f32_val_in_8",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000))],output:None),(name:"f32_val_in_9",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445))],output:None),(name:"f32_val_in_10",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117))],output:None),(name:"f32_val_in_11",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526))],output:None),(name:"f32_val_in_12",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092))],output:None),(name:"f32_val_in_13",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367))],output:None),(name:"f32_val_in_14",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000))],output:None),(name:"f32_val_in_15",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000))],output:None),(name:"f32_val_in_16",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_struct_in_1",conventions:[All],inputs:[Struct("f32_1",[Float(c_float(0.00000000000000000000000000000000000038204714))])],output:None),(name:"f32_struct_in_2",conventions:[All],inputs:[Struct("f32_2",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203))])],output:None),(name:"f32_struct_in_3",conventions:[All],inputs:[Struct("f32_3",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052))])],output:None),(name:"f32_struct_in_4",conventions:[All],inputs:[Struct("f32_4",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))])],output:None),(name:"f32_struct_in_5",conventions:[All],inputs:[Struct("f32_5",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488))])],output:None),(name:"f32_struct_in_6",conventions:[All],inputs:[Struct("f32_6",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000))])],output:None),(name:"f32_struct_in_7",conventions:[All],inputs:[Struct("f32_7",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000))])],output:None),(name:"f32_struct_in_8",conventions:[All],inputs:[Struct("f32_8",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000))])],output:None),(name:"f32_struct_in_9",conventions:[All],inputs:[Struct("f32_9",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445))])],output:None),(name:"f32_struct_in_10",conventions:[All],inputs:[Struct("f32_10",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117))])],output:None),(name:"f32_struct_in_11",conventions:[All],inputs:[Struct("f32_11",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526))])],output:None),(name:"f32_struct_in_12",conventions:[All],inputs:[Struct("f32_12",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092))])],output:None),(name:"f32_struct_in_13",conventions:[All],inputs:[Struct("f32_13",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367))])],output:None),(name:"f32_struct_in_14",conventions:[All],inputs:[Struct("f32_14",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000))])],output:None),(name:"f32_struct_in_15",conventions:[All],inputs:[Struct("f32_15",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000))])],output:None),(name:"f32_struct_in_16",conventions:[All],inputs:[Struct("f32_16",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("f32_1",[Float(c_float(0.00000000000000000000000000000000000038204714))]))],output:None),(name:"f32_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("f32_2",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203))]))],output:None),(name:"f32_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("f32_3",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052))]))],output:None),(name:"f32_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("f32_4",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))]))],output:None),(name:"f32_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("f32_5",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488))]))],output:None),(name:"f32_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("f32_6",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000))]))],output:None),(name:"f32_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("f32_7",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000))]))],output:None),(name:"f32_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("f32_8",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("f32_9",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445))]))],output:None),(name:"f32_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("f32_10",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117))]))],output:None),(name:"f32_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("f32_11",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526))]))],output:None),(name:"f32_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("f32_12",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092))]))],output:None),(name:"f32_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("f32_13",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367))]))],output:None),(name:"f32_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("f32_14",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000))]))],output:None),(name:"f32_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("f32_15",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000))]))],output:None),(name:"f32_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("f32_16",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))],output:None),(name:"f32_val_in_1_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))],output:None),(name:"f32_val_in_2_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))],output:None),(name:"f32_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))],output:None),(name:"f32_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_1_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_2_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_3_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_4_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_5_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_6_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_7_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_8_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_9_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_10_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_11_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_12_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_13_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_14_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f32_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))],output:None),(name:"f32_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("f32_0_perturbed_small",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))])],output:None),(name:"f32_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("f32_1_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))])],output:None),(name:"f32_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("f32_2_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))])],output:None),(name:"f32_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("f32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))])],output:None),(name:"f32_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("f32_0_perturbed_big",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("f32_1_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("f32_2_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("f32_3_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("f32_4_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("f32_5_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("f32_6_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("f32_7_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("f32_8_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("f32_9_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("f32_10_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("f32_11_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("f32_12_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("f32_13_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("f32_14_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f32_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("f32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))])],output:None),(name:"f32_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("f32_0_perturbed_small",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))]))],output:None),(name:"f32_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("f32_1_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859))]))],output:None),(name:"f32_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("f32_2_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))]))],output:None),(name:"f32_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("f32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))]))],output:None),(name:"f32_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_0_perturbed_big",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_1_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_2_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_3_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_4_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_5_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_6_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_7_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_8_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_9_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_10_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_11_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_12_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_13_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_14_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f32_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("f32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_float(0.000000000000000008789052)),Float(c_float(0.00000004148859)),Float(c_float(194.25488)),Float(c_float(903307300000)),Float(c_float(4175980800000000000000)),Float(c_float(19208323000000000000000000000000)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_float(-0.000000000000000017632526)),Float(c_float(-0.00000008321092)),Float(c_float(-389.51367)),Float(c_float(-1810926400000)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/f64.kdl b/tests/procgen/f64.kdl new file mode 100644 index 0000000..a5a243e --- /dev/null +++ b/tests/procgen/f64.kdl @@ -0,0 +1,1490 @@ +fn "f64_val_in" { + inputs { + arg0 "f64" + } + outputs { + } +} +fn "f64_val_out" { + inputs { + } + outputs { + arg0 "f64" + } +} +fn "f64_val_in_out" { + inputs { + arg0 "f64" + } + outputs { + arg0 "f64" + } +} +fn "f64_ref_in" { + inputs { + arg0 "&f64" + } + outputs { + } +} +fn "f64_val_in_2" { + inputs { + arg0 "f64" + arg1 "f64" + } + outputs { + } +} +fn "f64_val_in_3" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + } + outputs { + } +} +fn "f64_val_in_4" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + } + outputs { + } +} +fn "f64_val_in_5" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + } + outputs { + } +} +fn "f64_val_in_6" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + } + outputs { + } +} +fn "f64_val_in_7" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + } + outputs { + } +} +fn "f64_val_in_8" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + } + outputs { + } +} +fn "f64_val_in_9" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + } + outputs { + } +} +fn "f64_val_in_10" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + } + outputs { + } +} +fn "f64_val_in_11" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + } + outputs { + } +} +fn "f64_val_in_12" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + } + outputs { + } +} +fn "f64_val_in_13" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + } + outputs { + } +} +fn "f64_val_in_14" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + } + outputs { + } +} +fn "f64_val_in_15" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + } + outputs { + } +} +fn "f64_val_in_16" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +struct "Many1" { + f0 "f64" +} +fn "f64_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "f64_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "f64" + f1 "f64" +} +fn "f64_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "f64_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "f64" + f1 "f64" + f2 "f64" +} +fn "f64_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "f64_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" +} +fn "f64_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "f64_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" +} +fn "f64_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "f64_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" +} +fn "f64_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "f64_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" +} +fn "f64_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "f64_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" +} +fn "f64_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "f64_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" +} +fn "f64_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "f64_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" +} +fn "f64_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "f64_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" +} +fn "f64_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "f64_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" +} +fn "f64_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "f64_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" +} +fn "f64_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "f64_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" +} +fn "f64_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "f64_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" +} +fn "f64_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "f64_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "f64_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "f64_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "f64" + arg2 "f64" + arg3 "f32" + } + outputs { + } +} +fn "f64_val_in_1_perturbed_small" { + inputs { + arg0 "f64" + arg1 "u8" + arg2 "f32" + arg3 "f64" + } + outputs { + } +} +fn "f64_val_in_2_perturbed_small" { + inputs { + arg0 "f64" + arg1 "f32" + arg2 "u8" + arg3 "f64" + } + outputs { + } +} +fn "f64_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "f64" + arg2 "f64" + arg3 "u8" + } + outputs { + } +} +fn "f64_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f32" + } + outputs { + } +} +fn "f64_val_in_1_perturbed_big" { + inputs { + arg0 "f64" + arg1 "u8" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f32" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_2_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "u8" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f32" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_3_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "u8" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f32" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_4_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "u8" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f32" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_5_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "u8" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f32" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_6_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "u8" + arg7 "f64" + arg8 "f64" + arg9 "f32" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_7_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "u8" + arg8 "f32" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_8_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f32" + arg8 "u8" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_9_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f32" + arg7 "f64" + arg8 "f64" + arg9 "u8" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_10_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f32" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "u8" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_11_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f32" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "u8" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_12_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f64" + arg3 "f32" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "u8" + arg13 "f64" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_13_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f64" + arg2 "f32" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "u8" + arg14 "f64" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_14_perturbed_big" { + inputs { + arg0 "f64" + arg1 "f32" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "u8" + arg15 "f64" + } + outputs { + } +} +fn "f64_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "f64" + arg2 "f64" + arg3 "f64" + arg4 "f64" + arg5 "f64" + arg6 "f64" + arg7 "f64" + arg8 "f64" + arg9 "f64" + arg10 "f64" + arg11 "f64" + arg12 "f64" + arg13 "f64" + arg14 "f64" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "f64" + f2 "f64" + f3 "f32" +} +fn "f64_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "f64" + f1 "u8" + f2 "f32" + f3 "f64" +} +fn "f64_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "f64" + f1 "f32" + f2 "u8" + f3 "f64" +} +fn "f64_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "f64" + f2 "f64" + f3 "u8" +} +fn "f64_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f32" +} +fn "f64_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "f64" + f1 "u8" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f32" + f15 "f64" +} +fn "f64_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "f64" + f1 "f64" + f2 "u8" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f32" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "u8" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f32" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "u8" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f32" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "u8" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f32" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "u8" + f7 "f64" + f8 "f64" + f9 "f32" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "u8" + f8 "f32" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f32" + f8 "u8" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f32" + f7 "f64" + f8 "f64" + f9 "u8" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f32" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "u8" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f32" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "u8" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "f64" + f1 "f64" + f2 "f64" + f3 "f32" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "u8" + f13 "f64" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "f64" + f1 "f64" + f2 "f32" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "u8" + f14 "f64" + f15 "f64" +} +fn "f64_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "f64" + f1 "f32" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "u8" + f15 "f64" +} +fn "f64_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "f64" + f2 "f64" + f3 "f64" + f4 "f64" + f5 "f64" + f6 "f64" + f7 "f64" + f8 "f64" + f9 "f64" + f10 "f64" + f11 "f64" + f12 "f64" + f13 "f64" + f14 "f64" + f15 "u8" +} +fn "f64_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/f64.ron b/tests/procgen/f64.ron deleted file mode 100644 index a05595c..0000000 --- a/tests/procgen/f64.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"f64",funcs:[(name:"f64_val_in",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363))],output:None),(name:"f64_val_out",conventions:[All],inputs:[],output:Some(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)))),(name:"f64_val_in_out",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363))],output:Some(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)))),(name:"f64_ref_in",conventions:[All],inputs:[Ref(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)))],output:None),(name:"f64_ref_out",conventions:[All],inputs:[],output:Some(Ref(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363))))),(name:"f64_ref_in_out",conventions:[All],inputs:[Ref(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)))],output:Some(Ref(Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849))))),(name:"f64_val_in_2",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849))],output:None),(name:"f64_val_in_3",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047))],output:None),(name:"f64_val_in_4",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))],output:None),(name:"f64_val_in_5",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000))],output:None),(name:"f64_val_in_6",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_7",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_8",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_9",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694))],output:None),(name:"f64_val_in_10",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847))],output:None),(name:"f64_val_in_11",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768))],output:None),(name:"f64_val_in_12",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698))],output:None),(name:"f64_val_in_13",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000))],output:None),(name:"f64_val_in_14",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_15",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_16",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_struct_in_1",conventions:[All],inputs:[Struct("f64_1",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363))])],output:None),(name:"f64_struct_in_2",conventions:[All],inputs:[Struct("f64_2",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849))])],output:None),(name:"f64_struct_in_3",conventions:[All],inputs:[Struct("f64_3",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047))])],output:None),(name:"f64_struct_in_4",conventions:[All],inputs:[Struct("f64_4",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))])],output:None),(name:"f64_struct_in_5",conventions:[All],inputs:[Struct("f64_5",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000))])],output:None),(name:"f64_struct_in_6",conventions:[All],inputs:[Struct("f64_6",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_7",conventions:[All],inputs:[Struct("f64_7",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_8",conventions:[All],inputs:[Struct("f64_8",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_9",conventions:[All],inputs:[Struct("f64_9",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694))])],output:None),(name:"f64_struct_in_10",conventions:[All],inputs:[Struct("f64_10",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847))])],output:None),(name:"f64_struct_in_11",conventions:[All],inputs:[Struct("f64_11",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768))])],output:None),(name:"f64_struct_in_12",conventions:[All],inputs:[Struct("f64_12",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698))])],output:None),(name:"f64_struct_in_13",conventions:[All],inputs:[Struct("f64_13",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000))])],output:None),(name:"f64_struct_in_14",conventions:[All],inputs:[Struct("f64_14",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_15",conventions:[All],inputs:[Struct("f64_15",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_16",conventions:[All],inputs:[Struct("f64_16",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("f64_1",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363))]))],output:None),(name:"f64_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("f64_2",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849))]))],output:None),(name:"f64_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("f64_3",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047))]))],output:None),(name:"f64_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("f64_4",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))]))],output:None),(name:"f64_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("f64_5",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000))]))],output:None),(name:"f64_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("f64_6",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("f64_7",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("f64_8",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("f64_9",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694))]))],output:None),(name:"f64_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("f64_10",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847))]))],output:None),(name:"f64_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("f64_11",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768))]))],output:None),(name:"f64_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("f64_12",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698))]))],output:None),(name:"f64_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("f64_13",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("f64_14",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("f64_15",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("f64_16",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859))],output:None),(name:"f64_val_in_1_perturbed_small",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))],output:None),(name:"f64_val_in_2_perturbed_small",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))],output:None),(name:"f64_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48))],output:None),(name:"f64_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"f64_val_in_1_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-8370480300000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_2_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_float(-1810926400000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_3_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_float(-389.51367)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_4_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Int(c_uint8_t(64)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_float(-0.00000008321092)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_5_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Int(c_uint8_t(80)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_float(-0.000000000000000017632526)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_6_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(96)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_7_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_8_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_9_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(4175980800000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Int(c_uint8_t(144)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_10_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_float(903307300000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Int(c_uint8_t(160)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_11_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_float(194.25488)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Int(c_uint8_t(176)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_12_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Int(c_uint8_t(192)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_13_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Int(c_uint8_t(208)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_14_perturbed_big",conventions:[All],inputs:[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(224)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))],output:None),(name:"f64_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(240))],output:None),(name:"f64_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("f64_0_perturbed_small",[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859))])],output:None),(name:"f64_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("f64_1_perturbed_small",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))])],output:None),(name:"f64_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("f64_2_perturbed_small",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))])],output:None),(name:"f64_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("f64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48))])],output:None),(name:"f64_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("f64_0_perturbed_big",[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"f64_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("f64_1_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-8370480300000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("f64_2_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_float(-1810926400000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("f64_3_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_float(-389.51367)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("f64_4_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Int(c_uint8_t(64)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_float(-0.00000008321092)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("f64_5_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Int(c_uint8_t(80)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_float(-0.000000000000000017632526)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("f64_6_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(96)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("f64_7_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("f64_8_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("f64_9_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(4175980800000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Int(c_uint8_t(144)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("f64_10_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_float(903307300000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Int(c_uint8_t(160)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("f64_11_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_float(194.25488)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Int(c_uint8_t(176)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("f64_12_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Int(c_uint8_t(192)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("f64_13_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Int(c_uint8_t(208)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("f64_14_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(224)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))])],output:None),(name:"f64_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("f64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(240))])],output:None),(name:"f64_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("f64_0_perturbed_small",[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859))]))],output:None),(name:"f64_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("f64_1_perturbed_small",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))]))],output:None),(name:"f64_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("f64_2_perturbed_small",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745))]))],output:None),(name:"f64_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("f64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48))]))],output:None),(name:"f64_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_0_perturbed_big",[Int(c_uint8_t(0)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_1_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Int(c_uint8_t(16)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(-8370480300000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_2_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Int(c_uint8_t(32)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_float(-1810926400000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_3_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Int(c_uint8_t(48)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_float(-389.51367)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_4_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Int(c_uint8_t(64)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_float(-0.00000008321092)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_5_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Int(c_uint8_t(80)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_float(-0.000000000000000017632526)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_6_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(96)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_float(-0.0000000000000000000000000036999117)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_7_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_8_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_9_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_float(4175980800000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Int(c_uint8_t(144)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_10_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_float(903307300000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Int(c_uint8_t(160)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_11_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_float(194.25488)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Int(c_uint8_t(176)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_12_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_float(0.00000004148859)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Int(c_uint8_t(192)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_13_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_float(0.000000000000000008789052)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Int(c_uint8_t(208)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_14_perturbed_big",[Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007949928895127363)),Float(c_float(0.0000000000000000000000000018436203)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(224)),Float(c_double(-758128041190210800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))]))],output:None),(name:"f64_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("f64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Float(c_double(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001846323925681849)),Float(c_double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004287943403239047)),Float(c_double(0.0000000000000000000000000000000000000000009958334378896745)),Float(c_double(231270850962124080000000000000000000)),Float(c_double(53709566188628600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(12473230926066734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(2896695684044400400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002081576000531694)),Float(c_double(-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004834030884500847)),Float(c_double(-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011225952939479768)),Float(c_double(-0.0000000000000000000000000000000000000002606955873096698)),Float(c_double(-60539778500895675000000000000000000000)),Float(c_double(-14058684287005740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Float(c_double(-3264714813035785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/i128.kdl b/tests/procgen/i128.kdl new file mode 100644 index 0000000..6b44616 --- /dev/null +++ b/tests/procgen/i128.kdl @@ -0,0 +1,1490 @@ +fn "i128_val_in" { + inputs { + arg0 "i128" + } + outputs { + } +} +fn "i128_val_out" { + inputs { + } + outputs { + arg0 "i128" + } +} +fn "i128_val_in_out" { + inputs { + arg0 "i128" + } + outputs { + arg0 "i128" + } +} +fn "i128_ref_in" { + inputs { + arg0 "&i128" + } + outputs { + } +} +fn "i128_val_in_2" { + inputs { + arg0 "i128" + arg1 "i128" + } + outputs { + } +} +fn "i128_val_in_3" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + } + outputs { + } +} +fn "i128_val_in_4" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + } + outputs { + } +} +fn "i128_val_in_5" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + } + outputs { + } +} +fn "i128_val_in_6" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + } + outputs { + } +} +fn "i128_val_in_7" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + } + outputs { + } +} +fn "i128_val_in_8" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + } + outputs { + } +} +fn "i128_val_in_9" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + } + outputs { + } +} +fn "i128_val_in_10" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + } + outputs { + } +} +fn "i128_val_in_11" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + } + outputs { + } +} +fn "i128_val_in_12" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + } + outputs { + } +} +fn "i128_val_in_13" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + } + outputs { + } +} +fn "i128_val_in_14" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + } + outputs { + } +} +fn "i128_val_in_15" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + } + outputs { + } +} +fn "i128_val_in_16" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +struct "Many1" { + f0 "i128" +} +fn "i128_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "i128_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "i128" + f1 "i128" +} +fn "i128_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "i128_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "i128" + f1 "i128" + f2 "i128" +} +fn "i128_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "i128_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" +} +fn "i128_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "i128_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" +} +fn "i128_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "i128_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" +} +fn "i128_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "i128_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" +} +fn "i128_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "i128_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" +} +fn "i128_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "i128_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" +} +fn "i128_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "i128_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" +} +fn "i128_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "i128_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" +} +fn "i128_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "i128_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" +} +fn "i128_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "i128_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" +} +fn "i128_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "i128_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" +} +fn "i128_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "i128_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" +} +fn "i128_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "i128_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "i128_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "i128_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "i128" + arg2 "i128" + arg3 "f32" + } + outputs { + } +} +fn "i128_val_in_1_perturbed_small" { + inputs { + arg0 "i128" + arg1 "u8" + arg2 "f32" + arg3 "i128" + } + outputs { + } +} +fn "i128_val_in_2_perturbed_small" { + inputs { + arg0 "i128" + arg1 "f32" + arg2 "u8" + arg3 "i128" + } + outputs { + } +} +fn "i128_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "i128" + arg2 "i128" + arg3 "u8" + } + outputs { + } +} +fn "i128_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "f32" + } + outputs { + } +} +fn "i128_val_in_1_perturbed_big" { + inputs { + arg0 "i128" + arg1 "u8" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "f32" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_2_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "u8" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "f32" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_3_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "u8" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "f32" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_4_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "u8" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "f32" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_5_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "u8" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "f32" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_6_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "u8" + arg7 "i128" + arg8 "i128" + arg9 "f32" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_7_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "u8" + arg8 "f32" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_8_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "f32" + arg8 "u8" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_9_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "f32" + arg7 "i128" + arg8 "i128" + arg9 "u8" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_10_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "f32" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "u8" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_11_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "f32" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "u8" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_12_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "i128" + arg3 "f32" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "u8" + arg13 "i128" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_13_perturbed_big" { + inputs { + arg0 "i128" + arg1 "i128" + arg2 "f32" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "u8" + arg14 "i128" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_14_perturbed_big" { + inputs { + arg0 "i128" + arg1 "f32" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "u8" + arg15 "i128" + } + outputs { + } +} +fn "i128_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "i128" + arg2 "i128" + arg3 "i128" + arg4 "i128" + arg5 "i128" + arg6 "i128" + arg7 "i128" + arg8 "i128" + arg9 "i128" + arg10 "i128" + arg11 "i128" + arg12 "i128" + arg13 "i128" + arg14 "i128" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "i128" + f2 "i128" + f3 "f32" +} +fn "i128_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "i128" + f1 "u8" + f2 "f32" + f3 "i128" +} +fn "i128_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "i128" + f1 "f32" + f2 "u8" + f3 "i128" +} +fn "i128_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "i128" + f2 "i128" + f3 "u8" +} +fn "i128_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "f32" +} +fn "i128_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "i128" + f1 "u8" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "f32" + f15 "i128" +} +fn "i128_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "i128" + f1 "i128" + f2 "u8" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "f32" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "u8" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "f32" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "u8" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "f32" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "u8" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "f32" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "u8" + f7 "i128" + f8 "i128" + f9 "f32" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "u8" + f8 "f32" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "f32" + f8 "u8" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "f32" + f7 "i128" + f8 "i128" + f9 "u8" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "f32" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "u8" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "f32" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "u8" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "i128" + f1 "i128" + f2 "i128" + f3 "f32" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "u8" + f13 "i128" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "i128" + f1 "i128" + f2 "f32" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "u8" + f14 "i128" + f15 "i128" +} +fn "i128_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "i128" + f1 "f32" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "u8" + f15 "i128" +} +fn "i128_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "i128" + f2 "i128" + f3 "i128" + f4 "i128" + f5 "i128" + f6 "i128" + f7 "i128" + f8 "i128" + f9 "i128" + f10 "i128" + f11 "i128" + f12 "i128" + f13 "i128" + f14 "i128" + f15 "u8" +} +fn "i128_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/i16.kdl b/tests/procgen/i16.kdl new file mode 100644 index 0000000..e6f0d5c --- /dev/null +++ b/tests/procgen/i16.kdl @@ -0,0 +1,1490 @@ +fn "i16_val_in" { + inputs { + arg0 "i16" + } + outputs { + } +} +fn "i16_val_out" { + inputs { + } + outputs { + arg0 "i16" + } +} +fn "i16_val_in_out" { + inputs { + arg0 "i16" + } + outputs { + arg0 "i16" + } +} +fn "i16_ref_in" { + inputs { + arg0 "&i16" + } + outputs { + } +} +fn "i16_val_in_2" { + inputs { + arg0 "i16" + arg1 "i16" + } + outputs { + } +} +fn "i16_val_in_3" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + } + outputs { + } +} +fn "i16_val_in_4" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + } + outputs { + } +} +fn "i16_val_in_5" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + } + outputs { + } +} +fn "i16_val_in_6" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + } + outputs { + } +} +fn "i16_val_in_7" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + } + outputs { + } +} +fn "i16_val_in_8" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + } + outputs { + } +} +fn "i16_val_in_9" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + } + outputs { + } +} +fn "i16_val_in_10" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + } + outputs { + } +} +fn "i16_val_in_11" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + } + outputs { + } +} +fn "i16_val_in_12" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + } + outputs { + } +} +fn "i16_val_in_13" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + } + outputs { + } +} +fn "i16_val_in_14" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + } + outputs { + } +} +fn "i16_val_in_15" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + } + outputs { + } +} +fn "i16_val_in_16" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +struct "Many1" { + f0 "i16" +} +fn "i16_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "i16_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "i16" + f1 "i16" +} +fn "i16_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "i16_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "i16" + f1 "i16" + f2 "i16" +} +fn "i16_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "i16_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" +} +fn "i16_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "i16_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" +} +fn "i16_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "i16_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" +} +fn "i16_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "i16_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" +} +fn "i16_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "i16_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" +} +fn "i16_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "i16_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" +} +fn "i16_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "i16_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" +} +fn "i16_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "i16_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" +} +fn "i16_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "i16_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" +} +fn "i16_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "i16_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" +} +fn "i16_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "i16_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" +} +fn "i16_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "i16_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" +} +fn "i16_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "i16_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "i16_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "i16_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "i16" + arg2 "i16" + arg3 "f32" + } + outputs { + } +} +fn "i16_val_in_1_perturbed_small" { + inputs { + arg0 "i16" + arg1 "u8" + arg2 "f32" + arg3 "i16" + } + outputs { + } +} +fn "i16_val_in_2_perturbed_small" { + inputs { + arg0 "i16" + arg1 "f32" + arg2 "u8" + arg3 "i16" + } + outputs { + } +} +fn "i16_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "i16" + arg2 "i16" + arg3 "u8" + } + outputs { + } +} +fn "i16_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "f32" + } + outputs { + } +} +fn "i16_val_in_1_perturbed_big" { + inputs { + arg0 "i16" + arg1 "u8" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "f32" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_2_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "u8" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "f32" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_3_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "u8" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "f32" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_4_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "u8" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "f32" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_5_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "u8" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "f32" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_6_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "u8" + arg7 "i16" + arg8 "i16" + arg9 "f32" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_7_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "u8" + arg8 "f32" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_8_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "f32" + arg8 "u8" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_9_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "f32" + arg7 "i16" + arg8 "i16" + arg9 "u8" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_10_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "f32" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "u8" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_11_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "f32" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "u8" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_12_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "i16" + arg3 "f32" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "u8" + arg13 "i16" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_13_perturbed_big" { + inputs { + arg0 "i16" + arg1 "i16" + arg2 "f32" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "u8" + arg14 "i16" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_14_perturbed_big" { + inputs { + arg0 "i16" + arg1 "f32" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "u8" + arg15 "i16" + } + outputs { + } +} +fn "i16_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "i16" + arg2 "i16" + arg3 "i16" + arg4 "i16" + arg5 "i16" + arg6 "i16" + arg7 "i16" + arg8 "i16" + arg9 "i16" + arg10 "i16" + arg11 "i16" + arg12 "i16" + arg13 "i16" + arg14 "i16" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "i16" + f2 "i16" + f3 "f32" +} +fn "i16_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "i16" + f1 "u8" + f2 "f32" + f3 "i16" +} +fn "i16_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "i16" + f1 "f32" + f2 "u8" + f3 "i16" +} +fn "i16_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "i16" + f2 "i16" + f3 "u8" +} +fn "i16_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "f32" +} +fn "i16_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "i16" + f1 "u8" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "f32" + f15 "i16" +} +fn "i16_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "i16" + f1 "i16" + f2 "u8" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "f32" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "u8" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "f32" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "u8" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "f32" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "u8" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "f32" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "u8" + f7 "i16" + f8 "i16" + f9 "f32" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "u8" + f8 "f32" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "f32" + f8 "u8" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "f32" + f7 "i16" + f8 "i16" + f9 "u8" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "f32" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "u8" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "f32" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "u8" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "i16" + f1 "i16" + f2 "i16" + f3 "f32" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "u8" + f13 "i16" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "i16" + f1 "i16" + f2 "f32" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "u8" + f14 "i16" + f15 "i16" +} +fn "i16_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "i16" + f1 "f32" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "u8" + f15 "i16" +} +fn "i16_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "i16" + f2 "i16" + f3 "i16" + f4 "i16" + f5 "i16" + f6 "i16" + f7 "i16" + f8 "i16" + f9 "i16" + f10 "i16" + f11 "i16" + f12 "i16" + f13 "i16" + f14 "i16" + f15 "u8" +} +fn "i16_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/i16.ron b/tests/procgen/i16.ron deleted file mode 100644 index 4a45745..0000000 --- a/tests/procgen/i16.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"i16",funcs:[(name:"i16_val_in",conventions:[All],inputs:[Int(c_int16_t(256))],output:None),(name:"i16_val_out",conventions:[All],inputs:[],output:Some(Int(c_int16_t(256)))),(name:"i16_val_in_out",conventions:[All],inputs:[Int(c_int16_t(256))],output:Some(Int(c_int16_t(4368)))),(name:"i16_ref_in",conventions:[All],inputs:[Ref(Int(c_int16_t(256)))],output:None),(name:"i16_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_int16_t(256))))),(name:"i16_ref_in_out",conventions:[All],inputs:[Ref(Int(c_int16_t(256)))],output:Some(Ref(Int(c_int16_t(4368))))),(name:"i16_val_in_2",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368))],output:None),(name:"i16_val_in_3",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480))],output:None),(name:"i16_val_in_4",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592))],output:None),(name:"i16_val_in_5",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704))],output:None),(name:"i16_val_in_6",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816))],output:None),(name:"i16_val_in_7",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928))],output:None),(name:"i16_val_in_8",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040))],output:None),(name:"i16_val_in_9",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384))],output:None),(name:"i16_val_in_10",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272))],output:None),(name:"i16_val_in_11",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160))],output:None),(name:"i16_val_in_12",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048))],output:None),(name:"i16_val_in_13",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936))],output:None),(name:"i16_val_in_14",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824))],output:None),(name:"i16_val_in_15",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712))],output:None),(name:"i16_val_in_16",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_struct_in_1",conventions:[All],inputs:[Struct("i16_1",[Int(c_int16_t(256))])],output:None),(name:"i16_struct_in_2",conventions:[All],inputs:[Struct("i16_2",[Int(c_int16_t(256)),Int(c_int16_t(4368))])],output:None),(name:"i16_struct_in_3",conventions:[All],inputs:[Struct("i16_3",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480))])],output:None),(name:"i16_struct_in_4",conventions:[All],inputs:[Struct("i16_4",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592))])],output:None),(name:"i16_struct_in_5",conventions:[All],inputs:[Struct("i16_5",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704))])],output:None),(name:"i16_struct_in_6",conventions:[All],inputs:[Struct("i16_6",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816))])],output:None),(name:"i16_struct_in_7",conventions:[All],inputs:[Struct("i16_7",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928))])],output:None),(name:"i16_struct_in_8",conventions:[All],inputs:[Struct("i16_8",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040))])],output:None),(name:"i16_struct_in_9",conventions:[All],inputs:[Struct("i16_9",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384))])],output:None),(name:"i16_struct_in_10",conventions:[All],inputs:[Struct("i16_10",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272))])],output:None),(name:"i16_struct_in_11",conventions:[All],inputs:[Struct("i16_11",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160))])],output:None),(name:"i16_struct_in_12",conventions:[All],inputs:[Struct("i16_12",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048))])],output:None),(name:"i16_struct_in_13",conventions:[All],inputs:[Struct("i16_13",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936))])],output:None),(name:"i16_struct_in_14",conventions:[All],inputs:[Struct("i16_14",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824))])],output:None),(name:"i16_struct_in_15",conventions:[All],inputs:[Struct("i16_15",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712))])],output:None),(name:"i16_struct_in_16",conventions:[All],inputs:[Struct("i16_16",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("i16_1",[Int(c_int16_t(256))]))],output:None),(name:"i16_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("i16_2",[Int(c_int16_t(256)),Int(c_int16_t(4368))]))],output:None),(name:"i16_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("i16_3",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480))]))],output:None),(name:"i16_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("i16_4",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592))]))],output:None),(name:"i16_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("i16_5",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704))]))],output:None),(name:"i16_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("i16_6",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816))]))],output:None),(name:"i16_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("i16_7",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928))]))],output:None),(name:"i16_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("i16_8",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040))]))],output:None),(name:"i16_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("i16_9",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384))]))],output:None),(name:"i16_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("i16_10",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272))]))],output:None),(name:"i16_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("i16_11",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160))]))],output:None),(name:"i16_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("i16_12",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048))]))],output:None),(name:"i16_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("i16_13",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936))]))],output:None),(name:"i16_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("i16_14",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824))]))],output:None),(name:"i16_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("i16_15",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712))]))],output:None),(name:"i16_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("i16_16",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859))],output:None),(name:"i16_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592))],output:None),(name:"i16_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int16_t(12592))],output:None),(name:"i16_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48))],output:None),(name:"i16_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"i16_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_uint8_t(16)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Float(c_float(-8370480300000000000000)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_uint8_t(32)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Float(c_float(-1810926400000)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Float(c_float(-389.51367)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_uint8_t(64)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Float(c_float(-0.00000008321092)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_uint8_t(80)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Float(c_float(-0.000000000000000017632526)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_uint8_t(96)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_uint8_t(144)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Float(c_float(903307300000)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_uint8_t(160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Float(c_float(194.25488)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_uint8_t(176)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_uint8_t(192)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Int(c_int16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_uint8_t(208)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_uint8_t(224)),Int(c_int16_t(-3600))],output:None),(name:"i16_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_uint8_t(240))],output:None),(name:"i16_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("i16_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859))])],output:None),(name:"i16_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("i16_1_perturbed_small",[Int(c_int16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592))])],output:None),(name:"i16_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("i16_2_perturbed_small",[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int16_t(12592))])],output:None),(name:"i16_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("i16_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48))])],output:None),(name:"i16_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("i16_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"i16_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("i16_1_perturbed_big",[Int(c_int16_t(256)),Int(c_uint8_t(16)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Float(c_float(-8370480300000000000000)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("i16_2_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_uint8_t(32)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Float(c_float(-1810926400000)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("i16_3_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Float(c_float(-389.51367)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("i16_4_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_uint8_t(64)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Float(c_float(-0.00000008321092)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("i16_5_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_uint8_t(80)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Float(c_float(-0.000000000000000017632526)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("i16_6_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_uint8_t(96)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("i16_7_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("i16_8_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("i16_9_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_uint8_t(144)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("i16_10_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Float(c_float(903307300000)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_uint8_t(160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("i16_11_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Float(c_float(194.25488)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_uint8_t(176)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("i16_12_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_uint8_t(192)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("i16_13_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_uint8_t(208)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("i16_14_perturbed_big",[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_uint8_t(224)),Int(c_int16_t(-3600))])],output:None),(name:"i16_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("i16_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_uint8_t(240))])],output:None),(name:"i16_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("i16_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859))]))],output:None),(name:"i16_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("i16_1_perturbed_small",[Int(c_int16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592))]))],output:None),(name:"i16_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("i16_2_perturbed_small",[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int16_t(12592))]))],output:None),(name:"i16_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("i16_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48))]))],output:None),(name:"i16_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"i16_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_1_perturbed_big",[Int(c_int16_t(256)),Int(c_uint8_t(16)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Float(c_float(-8370480300000000000000)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_2_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_uint8_t(32)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Float(c_float(-1810926400000)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_3_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_uint8_t(48)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Float(c_float(-389.51367)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_4_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_uint8_t(64)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Float(c_float(-0.00000008321092)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_5_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_uint8_t(80)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Float(c_float(-0.000000000000000017632526)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_6_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_uint8_t(96)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_7_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_8_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_9_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_uint8_t(144)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_10_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Float(c_float(903307300000)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_uint8_t(160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_11_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Float(c_float(194.25488)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_uint8_t(176)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_12_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Float(c_float(0.00000004148859)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_uint8_t(192)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_13_perturbed_big",[Int(c_int16_t(256)),Int(c_int16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_uint8_t(208)),Int(c_int16_t(-7712)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_14_perturbed_big",[Int(c_int16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_uint8_t(224)),Int(c_int16_t(-3600))]))],output:None),(name:"i16_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("i16_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int16_t(4368)),Int(c_int16_t(8480)),Int(c_int16_t(12592)),Int(c_int16_t(16704)),Int(c_int16_t(20816)),Int(c_int16_t(24928)),Int(c_int16_t(29040)),Int(c_int16_t(-32384)),Int(c_int16_t(-28272)),Int(c_int16_t(-24160)),Int(c_int16_t(-20048)),Int(c_int16_t(-15936)),Int(c_int16_t(-11824)),Int(c_int16_t(-7712)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/i32.kdl b/tests/procgen/i32.kdl new file mode 100644 index 0000000..bbd46fc --- /dev/null +++ b/tests/procgen/i32.kdl @@ -0,0 +1,1490 @@ +fn "i32_val_in" { + inputs { + arg0 "i32" + } + outputs { + } +} +fn "i32_val_out" { + inputs { + } + outputs { + arg0 "i32" + } +} +fn "i32_val_in_out" { + inputs { + arg0 "i32" + } + outputs { + arg0 "i32" + } +} +fn "i32_ref_in" { + inputs { + arg0 "&i32" + } + outputs { + } +} +fn "i32_val_in_2" { + inputs { + arg0 "i32" + arg1 "i32" + } + outputs { + } +} +fn "i32_val_in_3" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + } + outputs { + } +} +fn "i32_val_in_4" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + } + outputs { + } +} +fn "i32_val_in_5" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + } + outputs { + } +} +fn "i32_val_in_6" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + } + outputs { + } +} +fn "i32_val_in_7" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + } + outputs { + } +} +fn "i32_val_in_8" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + } + outputs { + } +} +fn "i32_val_in_9" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + } + outputs { + } +} +fn "i32_val_in_10" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + } + outputs { + } +} +fn "i32_val_in_11" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + } + outputs { + } +} +fn "i32_val_in_12" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + } + outputs { + } +} +fn "i32_val_in_13" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + } + outputs { + } +} +fn "i32_val_in_14" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + } + outputs { + } +} +fn "i32_val_in_15" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + } + outputs { + } +} +fn "i32_val_in_16" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +struct "Many1" { + f0 "i32" +} +fn "i32_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "i32_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "i32" + f1 "i32" +} +fn "i32_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "i32_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "i32" + f1 "i32" + f2 "i32" +} +fn "i32_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "i32_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" +} +fn "i32_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "i32_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" +} +fn "i32_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "i32_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" +} +fn "i32_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "i32_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" +} +fn "i32_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "i32_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" +} +fn "i32_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "i32_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" +} +fn "i32_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "i32_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" +} +fn "i32_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "i32_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" +} +fn "i32_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "i32_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" +} +fn "i32_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "i32_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" +} +fn "i32_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "i32_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" +} +fn "i32_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "i32_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" +} +fn "i32_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "i32_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "i32_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "i32_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "i32" + arg2 "i32" + arg3 "f32" + } + outputs { + } +} +fn "i32_val_in_1_perturbed_small" { + inputs { + arg0 "i32" + arg1 "u8" + arg2 "f32" + arg3 "i32" + } + outputs { + } +} +fn "i32_val_in_2_perturbed_small" { + inputs { + arg0 "i32" + arg1 "f32" + arg2 "u8" + arg3 "i32" + } + outputs { + } +} +fn "i32_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "i32" + arg2 "i32" + arg3 "u8" + } + outputs { + } +} +fn "i32_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "f32" + } + outputs { + } +} +fn "i32_val_in_1_perturbed_big" { + inputs { + arg0 "i32" + arg1 "u8" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "f32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_2_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "u8" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "f32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_3_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "u8" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "f32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_4_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "u8" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "f32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_5_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "u8" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "f32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_6_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "u8" + arg7 "i32" + arg8 "i32" + arg9 "f32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_7_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "u8" + arg8 "f32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_8_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "f32" + arg8 "u8" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_9_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "f32" + arg7 "i32" + arg8 "i32" + arg9 "u8" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_10_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "f32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "u8" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_11_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "f32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "u8" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_12_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "i32" + arg3 "f32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "u8" + arg13 "i32" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_13_perturbed_big" { + inputs { + arg0 "i32" + arg1 "i32" + arg2 "f32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "u8" + arg14 "i32" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_14_perturbed_big" { + inputs { + arg0 "i32" + arg1 "f32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "u8" + arg15 "i32" + } + outputs { + } +} +fn "i32_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "i32" + arg2 "i32" + arg3 "i32" + arg4 "i32" + arg5 "i32" + arg6 "i32" + arg7 "i32" + arg8 "i32" + arg9 "i32" + arg10 "i32" + arg11 "i32" + arg12 "i32" + arg13 "i32" + arg14 "i32" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "i32" + f2 "i32" + f3 "f32" +} +fn "i32_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "i32" + f1 "u8" + f2 "f32" + f3 "i32" +} +fn "i32_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "i32" + f1 "f32" + f2 "u8" + f3 "i32" +} +fn "i32_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "i32" + f2 "i32" + f3 "u8" +} +fn "i32_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "f32" +} +fn "i32_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "i32" + f1 "u8" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "f32" + f15 "i32" +} +fn "i32_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "i32" + f1 "i32" + f2 "u8" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "f32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "u8" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "f32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "u8" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "f32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "u8" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "f32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "u8" + f7 "i32" + f8 "i32" + f9 "f32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "u8" + f8 "f32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "f32" + f8 "u8" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "f32" + f7 "i32" + f8 "i32" + f9 "u8" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "f32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "u8" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "f32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "u8" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "i32" + f1 "i32" + f2 "i32" + f3 "f32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "u8" + f13 "i32" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "i32" + f1 "i32" + f2 "f32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "u8" + f14 "i32" + f15 "i32" +} +fn "i32_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "i32" + f1 "f32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "u8" + f15 "i32" +} +fn "i32_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "i32" + f2 "i32" + f3 "i32" + f4 "i32" + f5 "i32" + f6 "i32" + f7 "i32" + f8 "i32" + f9 "i32" + f10 "i32" + f11 "i32" + f12 "i32" + f13 "i32" + f14 "i32" + f15 "u8" +} +fn "i32_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/i32.ron b/tests/procgen/i32.ron deleted file mode 100644 index 81cb38a..0000000 --- a/tests/procgen/i32.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"i32",funcs:[(name:"i32_val_in",conventions:[All],inputs:[Int(c_int32_t(50462976))],output:None),(name:"i32_val_out",conventions:[All],inputs:[],output:Some(Int(c_int32_t(50462976)))),(name:"i32_val_in_out",conventions:[All],inputs:[Int(c_int32_t(50462976))],output:Some(Int(c_int32_t(319951120)))),(name:"i32_ref_in",conventions:[All],inputs:[Ref(Int(c_int32_t(50462976)))],output:None),(name:"i32_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_int32_t(50462976))))),(name:"i32_ref_in_out",conventions:[All],inputs:[Ref(Int(c_int32_t(50462976)))],output:Some(Ref(Int(c_int32_t(319951120))))),(name:"i32_val_in_2",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120))],output:None),(name:"i32_val_in_3",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264))],output:None),(name:"i32_val_in_4",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408))],output:None),(name:"i32_val_in_5",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552))],output:None),(name:"i32_val_in_6",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696))],output:None),(name:"i32_val_in_7",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840))],output:None),(name:"i32_val_in_8",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984))],output:None),(name:"i32_val_in_9",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168))],output:None),(name:"i32_val_in_10",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024))],output:None),(name:"i32_val_in_11",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880))],output:None),(name:"i32_val_in_12",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736))],output:None),(name:"i32_val_in_13",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592))],output:None),(name:"i32_val_in_14",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448))],output:None),(name:"i32_val_in_15",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304))],output:None),(name:"i32_val_in_16",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_struct_in_1",conventions:[All],inputs:[Struct("i32_1",[Int(c_int32_t(50462976))])],output:None),(name:"i32_struct_in_2",conventions:[All],inputs:[Struct("i32_2",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120))])],output:None),(name:"i32_struct_in_3",conventions:[All],inputs:[Struct("i32_3",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264))])],output:None),(name:"i32_struct_in_4",conventions:[All],inputs:[Struct("i32_4",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408))])],output:None),(name:"i32_struct_in_5",conventions:[All],inputs:[Struct("i32_5",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552))])],output:None),(name:"i32_struct_in_6",conventions:[All],inputs:[Struct("i32_6",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696))])],output:None),(name:"i32_struct_in_7",conventions:[All],inputs:[Struct("i32_7",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840))])],output:None),(name:"i32_struct_in_8",conventions:[All],inputs:[Struct("i32_8",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984))])],output:None),(name:"i32_struct_in_9",conventions:[All],inputs:[Struct("i32_9",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168))])],output:None),(name:"i32_struct_in_10",conventions:[All],inputs:[Struct("i32_10",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024))])],output:None),(name:"i32_struct_in_11",conventions:[All],inputs:[Struct("i32_11",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880))])],output:None),(name:"i32_struct_in_12",conventions:[All],inputs:[Struct("i32_12",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736))])],output:None),(name:"i32_struct_in_13",conventions:[All],inputs:[Struct("i32_13",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592))])],output:None),(name:"i32_struct_in_14",conventions:[All],inputs:[Struct("i32_14",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448))])],output:None),(name:"i32_struct_in_15",conventions:[All],inputs:[Struct("i32_15",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304))])],output:None),(name:"i32_struct_in_16",conventions:[All],inputs:[Struct("i32_16",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("i32_1",[Int(c_int32_t(50462976))]))],output:None),(name:"i32_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("i32_2",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120))]))],output:None),(name:"i32_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("i32_3",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264))]))],output:None),(name:"i32_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("i32_4",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408))]))],output:None),(name:"i32_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("i32_5",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552))]))],output:None),(name:"i32_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("i32_6",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696))]))],output:None),(name:"i32_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("i32_7",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840))]))],output:None),(name:"i32_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("i32_8",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984))]))],output:None),(name:"i32_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("i32_9",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168))]))],output:None),(name:"i32_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("i32_10",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024))]))],output:None),(name:"i32_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("i32_11",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880))]))],output:None),(name:"i32_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("i32_12",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736))]))],output:None),(name:"i32_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("i32_13",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592))]))],output:None),(name:"i32_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("i32_14",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448))]))],output:None),(name:"i32_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("i32_15",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304))]))],output:None),(name:"i32_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("i32_16",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859))],output:None),(name:"i32_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408))],output:None),(name:"i32_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int32_t(858927408))],output:None),(name:"i32_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48))],output:None),(name:"i32_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"i32_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Float(c_float(-8370480300000000000000)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_uint8_t(32)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Float(c_float(-1810926400000)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Float(c_float(-389.51367)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_uint8_t(64)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Float(c_float(-0.00000008321092)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_uint8_t(80)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Float(c_float(-0.000000000000000017632526)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_uint8_t(96)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_uint8_t(144)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Float(c_float(903307300000)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_uint8_t(160)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Float(c_float(194.25488)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_uint8_t(176)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_uint8_t(192)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_uint8_t(208)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_uint8_t(224)),Int(c_int32_t(-202182160))],output:None),(name:"i32_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_uint8_t(240))],output:None),(name:"i32_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("i32_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859))])],output:None),(name:"i32_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("i32_1_perturbed_small",[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408))])],output:None),(name:"i32_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("i32_2_perturbed_small",[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int32_t(858927408))])],output:None),(name:"i32_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("i32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48))])],output:None),(name:"i32_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("i32_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"i32_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("i32_1_perturbed_big",[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Float(c_float(-8370480300000000000000)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("i32_2_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_uint8_t(32)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Float(c_float(-1810926400000)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("i32_3_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Float(c_float(-389.51367)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("i32_4_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_uint8_t(64)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Float(c_float(-0.00000008321092)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("i32_5_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_uint8_t(80)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Float(c_float(-0.000000000000000017632526)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("i32_6_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_uint8_t(96)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("i32_7_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("i32_8_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("i32_9_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_uint8_t(144)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("i32_10_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Float(c_float(903307300000)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_uint8_t(160)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("i32_11_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Float(c_float(194.25488)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_uint8_t(176)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("i32_12_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_uint8_t(192)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("i32_13_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_uint8_t(208)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("i32_14_perturbed_big",[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_uint8_t(224)),Int(c_int32_t(-202182160))])],output:None),(name:"i32_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("i32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_uint8_t(240))])],output:None),(name:"i32_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("i32_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859))]))],output:None),(name:"i32_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("i32_1_perturbed_small",[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408))]))],output:None),(name:"i32_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("i32_2_perturbed_small",[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int32_t(858927408))]))],output:None),(name:"i32_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("i32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48))]))],output:None),(name:"i32_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"i32_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_1_perturbed_big",[Int(c_int32_t(50462976)),Int(c_uint8_t(16)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Float(c_float(-8370480300000000000000)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_2_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_uint8_t(32)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Float(c_float(-1810926400000)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_3_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_uint8_t(48)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Float(c_float(-389.51367)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_4_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_uint8_t(64)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Float(c_float(-0.00000008321092)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_5_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_uint8_t(80)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Float(c_float(-0.000000000000000017632526)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_6_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_uint8_t(96)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_7_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_8_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_9_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_uint8_t(144)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_10_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Float(c_float(903307300000)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_uint8_t(160)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_11_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Float(c_float(194.25488)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_uint8_t(176)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_12_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_uint8_t(192)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_13_perturbed_big",[Int(c_int32_t(50462976)),Int(c_int32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_uint8_t(208)),Int(c_int32_t(-471670304)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_14_perturbed_big",[Int(c_int32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_uint8_t(224)),Int(c_int32_t(-202182160))]))],output:None),(name:"i32_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("i32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int32_t(319951120)),Int(c_int32_t(589439264)),Int(c_int32_t(858927408)),Int(c_int32_t(1128415552)),Int(c_int32_t(1397903696)),Int(c_int32_t(1667391840)),Int(c_int32_t(1936879984)),Int(c_int32_t(-2088599168)),Int(c_int32_t(-1819111024)),Int(c_int32_t(-1549622880)),Int(c_int32_t(-1280134736)),Int(c_int32_t(-1010646592)),Int(c_int32_t(-741158448)),Int(c_int32_t(-471670304)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/i64.kdl b/tests/procgen/i64.kdl new file mode 100644 index 0000000..d0c907f --- /dev/null +++ b/tests/procgen/i64.kdl @@ -0,0 +1,1490 @@ +fn "i64_val_in" { + inputs { + arg0 "i64" + } + outputs { + } +} +fn "i64_val_out" { + inputs { + } + outputs { + arg0 "i64" + } +} +fn "i64_val_in_out" { + inputs { + arg0 "i64" + } + outputs { + arg0 "i64" + } +} +fn "i64_ref_in" { + inputs { + arg0 "&i64" + } + outputs { + } +} +fn "i64_val_in_2" { + inputs { + arg0 "i64" + arg1 "i64" + } + outputs { + } +} +fn "i64_val_in_3" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + } + outputs { + } +} +fn "i64_val_in_4" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + } + outputs { + } +} +fn "i64_val_in_5" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + } + outputs { + } +} +fn "i64_val_in_6" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + } + outputs { + } +} +fn "i64_val_in_7" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + } + outputs { + } +} +fn "i64_val_in_8" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + } + outputs { + } +} +fn "i64_val_in_9" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + } + outputs { + } +} +fn "i64_val_in_10" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + } + outputs { + } +} +fn "i64_val_in_11" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + } + outputs { + } +} +fn "i64_val_in_12" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + } + outputs { + } +} +fn "i64_val_in_13" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + } + outputs { + } +} +fn "i64_val_in_14" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + } + outputs { + } +} +fn "i64_val_in_15" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + } + outputs { + } +} +fn "i64_val_in_16" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +struct "Many1" { + f0 "i64" +} +fn "i64_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "i64_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "i64" + f1 "i64" +} +fn "i64_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "i64_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "i64" + f1 "i64" + f2 "i64" +} +fn "i64_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "i64_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" +} +fn "i64_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "i64_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" +} +fn "i64_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "i64_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" +} +fn "i64_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "i64_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" +} +fn "i64_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "i64_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" +} +fn "i64_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "i64_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" +} +fn "i64_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "i64_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" +} +fn "i64_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "i64_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" +} +fn "i64_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "i64_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" +} +fn "i64_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "i64_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" +} +fn "i64_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "i64_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" +} +fn "i64_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "i64_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" +} +fn "i64_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "i64_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "i64_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "i64_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "i64" + arg2 "i64" + arg3 "f32" + } + outputs { + } +} +fn "i64_val_in_1_perturbed_small" { + inputs { + arg0 "i64" + arg1 "u8" + arg2 "f32" + arg3 "i64" + } + outputs { + } +} +fn "i64_val_in_2_perturbed_small" { + inputs { + arg0 "i64" + arg1 "f32" + arg2 "u8" + arg3 "i64" + } + outputs { + } +} +fn "i64_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "i64" + arg2 "i64" + arg3 "u8" + } + outputs { + } +} +fn "i64_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "f32" + } + outputs { + } +} +fn "i64_val_in_1_perturbed_big" { + inputs { + arg0 "i64" + arg1 "u8" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "f32" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_2_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "u8" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "f32" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_3_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "u8" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "f32" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_4_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "u8" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "f32" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_5_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "u8" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "f32" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_6_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "u8" + arg7 "i64" + arg8 "i64" + arg9 "f32" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_7_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "u8" + arg8 "f32" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_8_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "f32" + arg8 "u8" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_9_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "f32" + arg7 "i64" + arg8 "i64" + arg9 "u8" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_10_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "f32" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "u8" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_11_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "f32" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "u8" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_12_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "i64" + arg3 "f32" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "u8" + arg13 "i64" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_13_perturbed_big" { + inputs { + arg0 "i64" + arg1 "i64" + arg2 "f32" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "u8" + arg14 "i64" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_14_perturbed_big" { + inputs { + arg0 "i64" + arg1 "f32" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "u8" + arg15 "i64" + } + outputs { + } +} +fn "i64_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "i64" + arg2 "i64" + arg3 "i64" + arg4 "i64" + arg5 "i64" + arg6 "i64" + arg7 "i64" + arg8 "i64" + arg9 "i64" + arg10 "i64" + arg11 "i64" + arg12 "i64" + arg13 "i64" + arg14 "i64" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "i64" + f2 "i64" + f3 "f32" +} +fn "i64_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "i64" + f1 "u8" + f2 "f32" + f3 "i64" +} +fn "i64_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "i64" + f1 "f32" + f2 "u8" + f3 "i64" +} +fn "i64_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "i64" + f2 "i64" + f3 "u8" +} +fn "i64_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "f32" +} +fn "i64_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "i64" + f1 "u8" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "f32" + f15 "i64" +} +fn "i64_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "i64" + f1 "i64" + f2 "u8" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "f32" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "u8" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "f32" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "u8" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "f32" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "u8" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "f32" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "u8" + f7 "i64" + f8 "i64" + f9 "f32" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "u8" + f8 "f32" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "f32" + f8 "u8" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "f32" + f7 "i64" + f8 "i64" + f9 "u8" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "f32" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "u8" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "f32" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "u8" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "i64" + f1 "i64" + f2 "i64" + f3 "f32" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "u8" + f13 "i64" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "i64" + f1 "i64" + f2 "f32" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "u8" + f14 "i64" + f15 "i64" +} +fn "i64_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "i64" + f1 "f32" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "u8" + f15 "i64" +} +fn "i64_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "i64" + f2 "i64" + f3 "i64" + f4 "i64" + f5 "i64" + f6 "i64" + f7 "i64" + f8 "i64" + f9 "i64" + f10 "i64" + f11 "i64" + f12 "i64" + f13 "i64" + f14 "i64" + f15 "u8" +} +fn "i64_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/i64.ron b/tests/procgen/i64.ron deleted file mode 100644 index 59eb89c..0000000 --- a/tests/procgen/i64.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"i64",funcs:[(name:"i64_val_in",conventions:[All],inputs:[Int(c_int64_t(506097522914230528))],output:None),(name:"i64_val_out",conventions:[All],inputs:[],output:Some(Int(c_int64_t(506097522914230528)))),(name:"i64_val_in_out",conventions:[All],inputs:[Int(c_int64_t(506097522914230528))],output:Some(Int(c_int64_t(1663540288323457296)))),(name:"i64_ref_in",conventions:[All],inputs:[Ref(Int(c_int64_t(506097522914230528)))],output:None),(name:"i64_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_int64_t(506097522914230528))))),(name:"i64_ref_in_out",conventions:[All],inputs:[Ref(Int(c_int64_t(506097522914230528)))],output:Some(Ref(Int(c_int64_t(1663540288323457296))))),(name:"i64_val_in_2",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296))],output:None),(name:"i64_val_in_3",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064))],output:None),(name:"i64_val_in_4",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832))],output:None),(name:"i64_val_in_5",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600))],output:None),(name:"i64_val_in_6",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368))],output:None),(name:"i64_val_in_7",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136))],output:None),(name:"i64_val_in_8",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904))],output:None),(name:"i64_val_in_9",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944))],output:None),(name:"i64_val_in_10",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176))],output:None),(name:"i64_val_in_11",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408))],output:None),(name:"i64_val_in_12",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640))],output:None),(name:"i64_val_in_13",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872))],output:None),(name:"i64_val_in_14",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104))],output:None),(name:"i64_val_in_15",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336))],output:None),(name:"i64_val_in_16",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_struct_in_1",conventions:[All],inputs:[Struct("i64_1",[Int(c_int64_t(506097522914230528))])],output:None),(name:"i64_struct_in_2",conventions:[All],inputs:[Struct("i64_2",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296))])],output:None),(name:"i64_struct_in_3",conventions:[All],inputs:[Struct("i64_3",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064))])],output:None),(name:"i64_struct_in_4",conventions:[All],inputs:[Struct("i64_4",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832))])],output:None),(name:"i64_struct_in_5",conventions:[All],inputs:[Struct("i64_5",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600))])],output:None),(name:"i64_struct_in_6",conventions:[All],inputs:[Struct("i64_6",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368))])],output:None),(name:"i64_struct_in_7",conventions:[All],inputs:[Struct("i64_7",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136))])],output:None),(name:"i64_struct_in_8",conventions:[All],inputs:[Struct("i64_8",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904))])],output:None),(name:"i64_struct_in_9",conventions:[All],inputs:[Struct("i64_9",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944))])],output:None),(name:"i64_struct_in_10",conventions:[All],inputs:[Struct("i64_10",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176))])],output:None),(name:"i64_struct_in_11",conventions:[All],inputs:[Struct("i64_11",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408))])],output:None),(name:"i64_struct_in_12",conventions:[All],inputs:[Struct("i64_12",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640))])],output:None),(name:"i64_struct_in_13",conventions:[All],inputs:[Struct("i64_13",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872))])],output:None),(name:"i64_struct_in_14",conventions:[All],inputs:[Struct("i64_14",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104))])],output:None),(name:"i64_struct_in_15",conventions:[All],inputs:[Struct("i64_15",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336))])],output:None),(name:"i64_struct_in_16",conventions:[All],inputs:[Struct("i64_16",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("i64_1",[Int(c_int64_t(506097522914230528))]))],output:None),(name:"i64_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("i64_2",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296))]))],output:None),(name:"i64_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("i64_3",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064))]))],output:None),(name:"i64_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("i64_4",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832))]))],output:None),(name:"i64_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("i64_5",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600))]))],output:None),(name:"i64_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("i64_6",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368))]))],output:None),(name:"i64_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("i64_7",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136))]))],output:None),(name:"i64_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("i64_8",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904))]))],output:None),(name:"i64_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("i64_9",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944))]))],output:None),(name:"i64_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("i64_10",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176))]))],output:None),(name:"i64_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("i64_11",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408))]))],output:None),(name:"i64_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("i64_12",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640))]))],output:None),(name:"i64_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("i64_13",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872))]))],output:None),(name:"i64_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("i64_14",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104))]))],output:None),(name:"i64_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("i64_15",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336))]))],output:None),(name:"i64_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("i64_16",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859))],output:None),(name:"i64_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832))],output:None),(name:"i64_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832))],output:None),(name:"i64_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48))],output:None),(name:"i64_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"i64_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Float(c_float(-8370480300000000000000)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Float(c_float(-1810926400000)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Float(c_float(-389.51367)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Float(c_float(-0.00000008321092)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Float(c_float(-0.000000000000000017632526)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_uint8_t(144)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_uint8_t(160)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_uint8_t(176)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_uint8_t(192)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_uint8_t(208)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_uint8_t(224)),Int(c_int64_t(-579005069656919568))],output:None),(name:"i64_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_uint8_t(240))],output:None),(name:"i64_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("i64_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859))])],output:None),(name:"i64_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("i64_1_perturbed_small",[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832))])],output:None),(name:"i64_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("i64_2_perturbed_small",[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832))])],output:None),(name:"i64_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("i64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48))])],output:None),(name:"i64_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("i64_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"i64_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("i64_1_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Float(c_float(-8370480300000000000000)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("i64_2_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Float(c_float(-1810926400000)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("i64_3_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Float(c_float(-389.51367)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("i64_4_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Float(c_float(-0.00000008321092)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("i64_5_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Float(c_float(-0.000000000000000017632526)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("i64_6_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("i64_7_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("i64_8_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("i64_9_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_uint8_t(144)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("i64_10_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_uint8_t(160)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("i64_11_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_uint8_t(176)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("i64_12_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_uint8_t(192)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("i64_13_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_uint8_t(208)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("i64_14_perturbed_big",[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_uint8_t(224)),Int(c_int64_t(-579005069656919568))])],output:None),(name:"i64_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("i64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_uint8_t(240))])],output:None),(name:"i64_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("i64_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859))]))],output:None),(name:"i64_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("i64_1_perturbed_small",[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832))]))],output:None),(name:"i64_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("i64_2_perturbed_small",[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832))]))],output:None),(name:"i64_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("i64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48))]))],output:None),(name:"i64_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"i64_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_1_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Float(c_float(-8370480300000000000000)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_2_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Float(c_float(-1810926400000)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_3_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Float(c_float(-389.51367)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_4_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Float(c_float(-0.00000008321092)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_5_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Float(c_float(-0.000000000000000017632526)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_6_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_7_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_8_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_9_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_uint8_t(144)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_10_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_uint8_t(160)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_11_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_uint8_t(176)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_12_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_uint8_t(192)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_13_perturbed_big",[Int(c_int64_t(506097522914230528)),Int(c_int64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_uint8_t(208)),Int(c_int64_t(-1736447835066146336)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_14_perturbed_big",[Int(c_int64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_uint8_t(224)),Int(c_int64_t(-579005069656919568))]))],output:None),(name:"i64_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("i64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int64_t(1663540288323457296)),Int(c_int64_t(2820983053732684064)),Int(c_int64_t(3978425819141910832)),Int(c_int64_t(5135868584551137600)),Int(c_int64_t(6293311349960364368)),Int(c_int64_t(7450754115369591136)),Int(c_int64_t(8608196880778817904)),Int(c_int64_t(-8681104427521506944)),Int(c_int64_t(-7523661662112280176)),Int(c_int64_t(-6366218896703053408)),Int(c_int64_t(-5208776131293826640)),Int(c_int64_t(-4051333365884599872)),Int(c_int64_t(-2893890600475373104)),Int(c_int64_t(-1736447835066146336)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/i8.kdl b/tests/procgen/i8.kdl new file mode 100644 index 0000000..d5961bf --- /dev/null +++ b/tests/procgen/i8.kdl @@ -0,0 +1,1490 @@ +fn "i8_val_in" { + inputs { + arg0 "i8" + } + outputs { + } +} +fn "i8_val_out" { + inputs { + } + outputs { + arg0 "i8" + } +} +fn "i8_val_in_out" { + inputs { + arg0 "i8" + } + outputs { + arg0 "i8" + } +} +fn "i8_ref_in" { + inputs { + arg0 "&i8" + } + outputs { + } +} +fn "i8_val_in_2" { + inputs { + arg0 "i8" + arg1 "i8" + } + outputs { + } +} +fn "i8_val_in_3" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + } + outputs { + } +} +fn "i8_val_in_4" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + } + outputs { + } +} +fn "i8_val_in_5" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + } + outputs { + } +} +fn "i8_val_in_6" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + } + outputs { + } +} +fn "i8_val_in_7" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + } + outputs { + } +} +fn "i8_val_in_8" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + } + outputs { + } +} +fn "i8_val_in_9" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + } + outputs { + } +} +fn "i8_val_in_10" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + } + outputs { + } +} +fn "i8_val_in_11" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + } + outputs { + } +} +fn "i8_val_in_12" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + } + outputs { + } +} +fn "i8_val_in_13" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + } + outputs { + } +} +fn "i8_val_in_14" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + } + outputs { + } +} +fn "i8_val_in_15" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + } + outputs { + } +} +fn "i8_val_in_16" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +struct "Many1" { + f0 "i8" +} +fn "i8_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "i8_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "i8" + f1 "i8" +} +fn "i8_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "i8_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "i8" + f1 "i8" + f2 "i8" +} +fn "i8_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "i8_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" +} +fn "i8_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "i8_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" +} +fn "i8_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "i8_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" +} +fn "i8_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "i8_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" +} +fn "i8_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "i8_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" +} +fn "i8_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "i8_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" +} +fn "i8_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "i8_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" +} +fn "i8_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "i8_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" +} +fn "i8_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "i8_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" +} +fn "i8_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "i8_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" +} +fn "i8_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "i8_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" +} +fn "i8_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "i8_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" +} +fn "i8_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "i8_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "i8_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "i8_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "i8" + arg2 "i8" + arg3 "f32" + } + outputs { + } +} +fn "i8_val_in_1_perturbed_small" { + inputs { + arg0 "i8" + arg1 "u8" + arg2 "f32" + arg3 "i8" + } + outputs { + } +} +fn "i8_val_in_2_perturbed_small" { + inputs { + arg0 "i8" + arg1 "f32" + arg2 "u8" + arg3 "i8" + } + outputs { + } +} +fn "i8_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "i8" + arg2 "i8" + arg3 "u8" + } + outputs { + } +} +fn "i8_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "f32" + } + outputs { + } +} +fn "i8_val_in_1_perturbed_big" { + inputs { + arg0 "i8" + arg1 "u8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "f32" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_2_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "u8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "f32" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_3_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "u8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "f32" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_4_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "u8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "f32" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_5_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "u8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "f32" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_6_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "u8" + arg7 "i8" + arg8 "i8" + arg9 "f32" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_7_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "u8" + arg8 "f32" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_8_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "f32" + arg8 "u8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_9_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "f32" + arg7 "i8" + arg8 "i8" + arg9 "u8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_10_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "f32" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "u8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_11_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "f32" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "u8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_12_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "i8" + arg3 "f32" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "u8" + arg13 "i8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_13_perturbed_big" { + inputs { + arg0 "i8" + arg1 "i8" + arg2 "f32" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "u8" + arg14 "i8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_14_perturbed_big" { + inputs { + arg0 "i8" + arg1 "f32" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "u8" + arg15 "i8" + } + outputs { + } +} +fn "i8_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "i8" + arg2 "i8" + arg3 "i8" + arg4 "i8" + arg5 "i8" + arg6 "i8" + arg7 "i8" + arg8 "i8" + arg9 "i8" + arg10 "i8" + arg11 "i8" + arg12 "i8" + arg13 "i8" + arg14 "i8" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "i8" + f2 "i8" + f3 "f32" +} +fn "i8_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "i8" + f1 "u8" + f2 "f32" + f3 "i8" +} +fn "i8_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "i8" + f1 "f32" + f2 "u8" + f3 "i8" +} +fn "i8_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "i8" + f2 "i8" + f3 "u8" +} +fn "i8_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "f32" +} +fn "i8_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "i8" + f1 "u8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "f32" + f15 "i8" +} +fn "i8_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "i8" + f1 "i8" + f2 "u8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "f32" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "u8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "f32" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "u8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "f32" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "u8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "f32" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "u8" + f7 "i8" + f8 "i8" + f9 "f32" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "u8" + f8 "f32" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "f32" + f8 "u8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "f32" + f7 "i8" + f8 "i8" + f9 "u8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "f32" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "u8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "f32" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "u8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "i8" + f1 "i8" + f2 "i8" + f3 "f32" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "u8" + f13 "i8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "i8" + f1 "i8" + f2 "f32" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "u8" + f14 "i8" + f15 "i8" +} +fn "i8_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "i8" + f1 "f32" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "u8" + f15 "i8" +} +fn "i8_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "i8" + f2 "i8" + f3 "i8" + f4 "i8" + f5 "i8" + f6 "i8" + f7 "i8" + f8 "i8" + f9 "i8" + f10 "i8" + f11 "i8" + f12 "i8" + f13 "i8" + f14 "i8" + f15 "u8" +} +fn "i8_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/i8.ron b/tests/procgen/i8.ron deleted file mode 100644 index b53a6a8..0000000 --- a/tests/procgen/i8.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"i8",funcs:[(name:"i8_val_in",conventions:[All],inputs:[Int(c_int8_t(0))],output:None),(name:"i8_val_out",conventions:[All],inputs:[],output:Some(Int(c_int8_t(0)))),(name:"i8_val_in_out",conventions:[All],inputs:[Int(c_int8_t(0))],output:Some(Int(c_int8_t(16)))),(name:"i8_ref_in",conventions:[All],inputs:[Ref(Int(c_int8_t(0)))],output:None),(name:"i8_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_int8_t(0))))),(name:"i8_ref_in_out",conventions:[All],inputs:[Ref(Int(c_int8_t(0)))],output:Some(Ref(Int(c_int8_t(16))))),(name:"i8_val_in_2",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16))],output:None),(name:"i8_val_in_3",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32))],output:None),(name:"i8_val_in_4",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48))],output:None),(name:"i8_val_in_5",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64))],output:None),(name:"i8_val_in_6",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80))],output:None),(name:"i8_val_in_7",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96))],output:None),(name:"i8_val_in_8",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112))],output:None),(name:"i8_val_in_9",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128))],output:None),(name:"i8_val_in_10",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112))],output:None),(name:"i8_val_in_11",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96))],output:None),(name:"i8_val_in_12",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80))],output:None),(name:"i8_val_in_13",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64))],output:None),(name:"i8_val_in_14",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48))],output:None),(name:"i8_val_in_15",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32))],output:None),(name:"i8_val_in_16",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_struct_in_1",conventions:[All],inputs:[Struct("i8_1",[Int(c_int8_t(0))])],output:None),(name:"i8_struct_in_2",conventions:[All],inputs:[Struct("i8_2",[Int(c_int8_t(0)),Int(c_int8_t(16))])],output:None),(name:"i8_struct_in_3",conventions:[All],inputs:[Struct("i8_3",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32))])],output:None),(name:"i8_struct_in_4",conventions:[All],inputs:[Struct("i8_4",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48))])],output:None),(name:"i8_struct_in_5",conventions:[All],inputs:[Struct("i8_5",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64))])],output:None),(name:"i8_struct_in_6",conventions:[All],inputs:[Struct("i8_6",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80))])],output:None),(name:"i8_struct_in_7",conventions:[All],inputs:[Struct("i8_7",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96))])],output:None),(name:"i8_struct_in_8",conventions:[All],inputs:[Struct("i8_8",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112))])],output:None),(name:"i8_struct_in_9",conventions:[All],inputs:[Struct("i8_9",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128))])],output:None),(name:"i8_struct_in_10",conventions:[All],inputs:[Struct("i8_10",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112))])],output:None),(name:"i8_struct_in_11",conventions:[All],inputs:[Struct("i8_11",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96))])],output:None),(name:"i8_struct_in_12",conventions:[All],inputs:[Struct("i8_12",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80))])],output:None),(name:"i8_struct_in_13",conventions:[All],inputs:[Struct("i8_13",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64))])],output:None),(name:"i8_struct_in_14",conventions:[All],inputs:[Struct("i8_14",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48))])],output:None),(name:"i8_struct_in_15",conventions:[All],inputs:[Struct("i8_15",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32))])],output:None),(name:"i8_struct_in_16",conventions:[All],inputs:[Struct("i8_16",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("i8_1",[Int(c_int8_t(0))]))],output:None),(name:"i8_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("i8_2",[Int(c_int8_t(0)),Int(c_int8_t(16))]))],output:None),(name:"i8_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("i8_3",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32))]))],output:None),(name:"i8_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("i8_4",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48))]))],output:None),(name:"i8_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("i8_5",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64))]))],output:None),(name:"i8_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("i8_6",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80))]))],output:None),(name:"i8_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("i8_7",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96))]))],output:None),(name:"i8_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("i8_8",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112))]))],output:None),(name:"i8_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("i8_9",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128))]))],output:None),(name:"i8_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("i8_10",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112))]))],output:None),(name:"i8_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("i8_11",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96))]))],output:None),(name:"i8_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("i8_12",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80))]))],output:None),(name:"i8_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("i8_13",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64))]))],output:None),(name:"i8_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("i8_14",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48))]))],output:None),(name:"i8_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("i8_15",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32))]))],output:None),(name:"i8_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("i8_16",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859))],output:None),(name:"i8_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48))],output:None),(name:"i8_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int8_t(48))],output:None),(name:"i8_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48))],output:None),(name:"i8_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"i8_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_uint8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Float(c_float(-8370480300000000000000)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_uint8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Float(c_float(-1810926400000)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Float(c_float(-389.51367)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_uint8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Float(c_float(-0.00000008321092)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_uint8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Float(c_float(-0.000000000000000017632526)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_uint8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Float(c_float(4175980800000000000000)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_uint8_t(144)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Float(c_float(903307300000)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_uint8_t(160)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Float(c_float(194.25488)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_uint8_t(176)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_uint8_t(192)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Int(c_int8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_uint8_t(208)),Int(c_int8_t(-32)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_uint8_t(224)),Int(c_int8_t(-16))],output:None),(name:"i8_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_uint8_t(240))],output:None),(name:"i8_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("i8_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859))])],output:None),(name:"i8_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("i8_1_perturbed_small",[Int(c_int8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48))])],output:None),(name:"i8_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("i8_2_perturbed_small",[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int8_t(48))])],output:None),(name:"i8_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("i8_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48))])],output:None),(name:"i8_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("i8_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"i8_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("i8_1_perturbed_big",[Int(c_int8_t(0)),Int(c_uint8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Float(c_float(-8370480300000000000000)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("i8_2_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_uint8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Float(c_float(-1810926400000)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("i8_3_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Float(c_float(-389.51367)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("i8_4_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_uint8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Float(c_float(-0.00000008321092)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("i8_5_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_uint8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Float(c_float(-0.000000000000000017632526)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("i8_6_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_uint8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("i8_7_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("i8_8_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("i8_9_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Float(c_float(4175980800000000000000)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_uint8_t(144)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("i8_10_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Float(c_float(903307300000)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_uint8_t(160)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("i8_11_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Float(c_float(194.25488)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_uint8_t(176)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("i8_12_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_uint8_t(192)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("i8_13_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_uint8_t(208)),Int(c_int8_t(-32)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("i8_14_perturbed_big",[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_uint8_t(224)),Int(c_int8_t(-16))])],output:None),(name:"i8_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("i8_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_uint8_t(240))])],output:None),(name:"i8_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("i8_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859))]))],output:None),(name:"i8_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("i8_1_perturbed_small",[Int(c_int8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48))]))],output:None),(name:"i8_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("i8_2_perturbed_small",[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_int8_t(48))]))],output:None),(name:"i8_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("i8_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48))]))],output:None),(name:"i8_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"i8_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_1_perturbed_big",[Int(c_int8_t(0)),Int(c_uint8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Float(c_float(-8370480300000000000000)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_2_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_uint8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Float(c_float(-1810926400000)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_3_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_uint8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Float(c_float(-389.51367)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_4_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_uint8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Float(c_float(-0.00000008321092)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_5_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_uint8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Float(c_float(-0.000000000000000017632526)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_6_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_uint8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_7_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_8_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_9_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Float(c_float(4175980800000000000000)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_uint8_t(144)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_10_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Float(c_float(903307300000)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_uint8_t(160)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_11_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Float(c_float(194.25488)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_uint8_t(176)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_12_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Int(c_int8_t(32)),Float(c_float(0.00000004148859)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_uint8_t(192)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_13_perturbed_big",[Int(c_int8_t(0)),Int(c_int8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_uint8_t(208)),Int(c_int8_t(-32)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_14_perturbed_big",[Int(c_int8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_uint8_t(224)),Int(c_int8_t(-16))]))],output:None),(name:"i8_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("i8_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_int8_t(16)),Int(c_int8_t(32)),Int(c_int8_t(48)),Int(c_int8_t(64)),Int(c_int8_t(80)),Int(c_int8_t(96)),Int(c_int8_t(112)),Int(c_int8_t(-128)),Int(c_int8_t(-112)),Int(c_int8_t(-96)),Int(c_int8_t(-80)),Int(c_int8_t(-64)),Int(c_int8_t(-48)),Int(c_int8_t(-32)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/ptr.kdl b/tests/procgen/ptr.kdl new file mode 100644 index 0000000..fa7bbd8 --- /dev/null +++ b/tests/procgen/ptr.kdl @@ -0,0 +1,1490 @@ +fn "ptr_val_in" { + inputs { + arg0 "ptr" + } + outputs { + } +} +fn "ptr_val_out" { + inputs { + } + outputs { + arg0 "ptr" + } +} +fn "ptr_val_in_out" { + inputs { + arg0 "ptr" + } + outputs { + arg0 "ptr" + } +} +fn "ptr_ref_in" { + inputs { + arg0 "&ptr" + } + outputs { + } +} +fn "ptr_val_in_2" { + inputs { + arg0 "ptr" + arg1 "ptr" + } + outputs { + } +} +fn "ptr_val_in_3" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + } + outputs { + } +} +fn "ptr_val_in_4" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + } + outputs { + } +} +fn "ptr_val_in_5" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + } + outputs { + } +} +fn "ptr_val_in_6" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + } + outputs { + } +} +fn "ptr_val_in_7" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + } + outputs { + } +} +fn "ptr_val_in_8" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + } + outputs { + } +} +fn "ptr_val_in_9" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + } + outputs { + } +} +fn "ptr_val_in_10" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + } + outputs { + } +} +fn "ptr_val_in_11" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + } + outputs { + } +} +fn "ptr_val_in_12" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + } + outputs { + } +} +fn "ptr_val_in_13" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + } + outputs { + } +} +fn "ptr_val_in_14" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + } + outputs { + } +} +fn "ptr_val_in_15" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + } + outputs { + } +} +fn "ptr_val_in_16" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +struct "Many1" { + f0 "ptr" +} +fn "ptr_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "ptr_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "ptr" + f1 "ptr" +} +fn "ptr_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "ptr_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "ptr" + f1 "ptr" + f2 "ptr" +} +fn "ptr_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "ptr_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" +} +fn "ptr_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "ptr_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" +} +fn "ptr_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "ptr_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" +} +fn "ptr_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "ptr_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" +} +fn "ptr_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "ptr_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" +} +fn "ptr_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "ptr_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" +} +fn "ptr_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "ptr_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" +} +fn "ptr_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "ptr_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" +} +fn "ptr_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "ptr_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" +} +fn "ptr_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "ptr_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" +} +fn "ptr_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "ptr_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" +} +fn "ptr_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "ptr_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" +} +fn "ptr_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "ptr_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "ptr_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "ptr_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "ptr" + arg2 "ptr" + arg3 "f32" + } + outputs { + } +} +fn "ptr_val_in_1_perturbed_small" { + inputs { + arg0 "ptr" + arg1 "u8" + arg2 "f32" + arg3 "ptr" + } + outputs { + } +} +fn "ptr_val_in_2_perturbed_small" { + inputs { + arg0 "ptr" + arg1 "f32" + arg2 "u8" + arg3 "ptr" + } + outputs { + } +} +fn "ptr_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "ptr" + arg2 "ptr" + arg3 "u8" + } + outputs { + } +} +fn "ptr_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "f32" + } + outputs { + } +} +fn "ptr_val_in_1_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "u8" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "f32" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_2_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "u8" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "f32" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_3_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "u8" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "f32" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_4_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "u8" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "f32" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_5_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "u8" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "f32" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_6_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "u8" + arg7 "ptr" + arg8 "ptr" + arg9 "f32" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_7_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "u8" + arg8 "f32" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_8_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "f32" + arg8 "u8" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_9_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "f32" + arg7 "ptr" + arg8 "ptr" + arg9 "u8" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_10_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "f32" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "u8" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_11_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "f32" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "u8" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_12_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "ptr" + arg3 "f32" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "u8" + arg13 "ptr" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_13_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "ptr" + arg2 "f32" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "u8" + arg14 "ptr" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_14_perturbed_big" { + inputs { + arg0 "ptr" + arg1 "f32" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "u8" + arg15 "ptr" + } + outputs { + } +} +fn "ptr_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "ptr" + arg2 "ptr" + arg3 "ptr" + arg4 "ptr" + arg5 "ptr" + arg6 "ptr" + arg7 "ptr" + arg8 "ptr" + arg9 "ptr" + arg10 "ptr" + arg11 "ptr" + arg12 "ptr" + arg13 "ptr" + arg14 "ptr" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "ptr" + f2 "ptr" + f3 "f32" +} +fn "ptr_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "ptr" + f1 "u8" + f2 "f32" + f3 "ptr" +} +fn "ptr_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "ptr" + f1 "f32" + f2 "u8" + f3 "ptr" +} +fn "ptr_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "ptr" + f2 "ptr" + f3 "u8" +} +fn "ptr_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "f32" +} +fn "ptr_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "ptr" + f1 "u8" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "f32" + f15 "ptr" +} +fn "ptr_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "ptr" + f1 "ptr" + f2 "u8" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "f32" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "u8" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "f32" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "u8" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "f32" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "u8" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "f32" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "u8" + f7 "ptr" + f8 "ptr" + f9 "f32" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "u8" + f8 "f32" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "f32" + f8 "u8" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "f32" + f7 "ptr" + f8 "ptr" + f9 "u8" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "f32" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "u8" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "f32" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "u8" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "ptr" + f1 "ptr" + f2 "ptr" + f3 "f32" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "u8" + f13 "ptr" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "ptr" + f1 "ptr" + f2 "f32" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "u8" + f14 "ptr" + f15 "ptr" +} +fn "ptr_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "ptr" + f1 "f32" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "u8" + f15 "ptr" +} +fn "ptr_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "ptr" + f2 "ptr" + f3 "ptr" + f4 "ptr" + f5 "ptr" + f6 "ptr" + f7 "ptr" + f8 "ptr" + f9 "ptr" + f10 "ptr" + f11 "ptr" + f12 "ptr" + f13 "ptr" + f14 "ptr" + f15 "u8" +} +fn "ptr_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/ptr.ron b/tests/procgen/ptr.ron deleted file mode 100644 index 08301b2..0000000 --- a/tests/procgen/ptr.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"ptr",funcs:[(name:"ptr_val_in",conventions:[All],inputs:[Ptr(506097522914230528)],output:None),(name:"ptr_val_out",conventions:[All],inputs:[],output:Some(Ptr(506097522914230528))),(name:"ptr_val_in_out",conventions:[All],inputs:[Ptr(506097522914230528)],output:Some(Ptr(1663540288323457296))),(name:"ptr_ref_in",conventions:[All],inputs:[Ref(Ptr(506097522914230528))],output:None),(name:"ptr_ref_out",conventions:[All],inputs:[],output:Some(Ref(Ptr(506097522914230528)))),(name:"ptr_ref_in_out",conventions:[All],inputs:[Ref(Ptr(506097522914230528))],output:Some(Ref(Ptr(1663540288323457296)))),(name:"ptr_val_in_2",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296)],output:None),(name:"ptr_val_in_3",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064)],output:None),(name:"ptr_val_in_4",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832)],output:None),(name:"ptr_val_in_5",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600)],output:None),(name:"ptr_val_in_6",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368)],output:None),(name:"ptr_val_in_7",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136)],output:None),(name:"ptr_val_in_8",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904)],output:None),(name:"ptr_val_in_9",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672)],output:None),(name:"ptr_val_in_10",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440)],output:None),(name:"ptr_val_in_11",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208)],output:None),(name:"ptr_val_in_12",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976)],output:None),(name:"ptr_val_in_13",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744)],output:None),(name:"ptr_val_in_14",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512)],output:None),(name:"ptr_val_in_15",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280)],output:None),(name:"ptr_val_in_16",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_struct_in_1",conventions:[All],inputs:[Struct("ptr_1",[Ptr(506097522914230528)])],output:None),(name:"ptr_struct_in_2",conventions:[All],inputs:[Struct("ptr_2",[Ptr(506097522914230528),Ptr(1663540288323457296)])],output:None),(name:"ptr_struct_in_3",conventions:[All],inputs:[Struct("ptr_3",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064)])],output:None),(name:"ptr_struct_in_4",conventions:[All],inputs:[Struct("ptr_4",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832)])],output:None),(name:"ptr_struct_in_5",conventions:[All],inputs:[Struct("ptr_5",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600)])],output:None),(name:"ptr_struct_in_6",conventions:[All],inputs:[Struct("ptr_6",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368)])],output:None),(name:"ptr_struct_in_7",conventions:[All],inputs:[Struct("ptr_7",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136)])],output:None),(name:"ptr_struct_in_8",conventions:[All],inputs:[Struct("ptr_8",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904)])],output:None),(name:"ptr_struct_in_9",conventions:[All],inputs:[Struct("ptr_9",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672)])],output:None),(name:"ptr_struct_in_10",conventions:[All],inputs:[Struct("ptr_10",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440)])],output:None),(name:"ptr_struct_in_11",conventions:[All],inputs:[Struct("ptr_11",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208)])],output:None),(name:"ptr_struct_in_12",conventions:[All],inputs:[Struct("ptr_12",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976)])],output:None),(name:"ptr_struct_in_13",conventions:[All],inputs:[Struct("ptr_13",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744)])],output:None),(name:"ptr_struct_in_14",conventions:[All],inputs:[Struct("ptr_14",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512)])],output:None),(name:"ptr_struct_in_15",conventions:[All],inputs:[Struct("ptr_15",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280)])],output:None),(name:"ptr_struct_in_16",conventions:[All],inputs:[Struct("ptr_16",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("ptr_1",[Ptr(506097522914230528)]))],output:None),(name:"ptr_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("ptr_2",[Ptr(506097522914230528),Ptr(1663540288323457296)]))],output:None),(name:"ptr_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("ptr_3",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064)]))],output:None),(name:"ptr_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("ptr_4",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832)]))],output:None),(name:"ptr_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("ptr_5",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600)]))],output:None),(name:"ptr_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("ptr_6",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368)]))],output:None),(name:"ptr_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("ptr_7",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136)]))],output:None),(name:"ptr_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("ptr_8",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904)]))],output:None),(name:"ptr_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("ptr_9",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672)]))],output:None),(name:"ptr_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("ptr_10",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440)]))],output:None),(name:"ptr_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("ptr_11",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208)]))],output:None),(name:"ptr_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("ptr_12",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976)]))],output:None),(name:"ptr_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("ptr_13",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744)]))],output:None),(name:"ptr_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("ptr_14",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512)]))],output:None),(name:"ptr_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("ptr_15",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280)]))],output:None),(name:"ptr_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("ptr_16",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859))],output:None),(name:"ptr_val_in_1_perturbed_small",conventions:[All],inputs:[Ptr(506097522914230528),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832)],output:None),(name:"ptr_val_in_2_perturbed_small",conventions:[All],inputs:[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Ptr(3978425819141910832)],output:None),(name:"ptr_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48))],output:None),(name:"ptr_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"ptr_val_in_1_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Int(c_uint8_t(16)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Float(c_float(-8370480300000000000000)),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_2_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Int(c_uint8_t(32)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Float(c_float(-1810926400000)),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_3_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Float(c_float(-389.51367)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_4_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Int(c_uint8_t(64)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Float(c_float(-0.00000008321092)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_5_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Int(c_uint8_t(80)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Float(c_float(-0.000000000000000017632526)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_6_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Int(c_uint8_t(96)),Ptr(8608196880778817904),Ptr(9765639646188044672),Float(c_float(-0.0000000000000000000000000036999117)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_7_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_8_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_9_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Float(c_float(4175980800000000000000)),Ptr(8608196880778817904),Ptr(9765639646188044672),Int(c_uint8_t(144)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_10_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Float(c_float(903307300000)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Int(c_uint8_t(160)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_11_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Float(c_float(194.25488)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Int(c_uint8_t(176)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_12_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Int(c_uint8_t(192)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_13_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Ptr(1663540288323457296),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Int(c_uint8_t(208)),Ptr(16710296238643405280),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_14_perturbed_big",conventions:[All],inputs:[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Int(c_uint8_t(224)),Ptr(17867739004052632048)],output:None),(name:"ptr_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Int(c_uint8_t(240))],output:None),(name:"ptr_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("ptr_0_perturbed_small",[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859))])],output:None),(name:"ptr_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("ptr_1_perturbed_small",[Ptr(506097522914230528),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832)])],output:None),(name:"ptr_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("ptr_2_perturbed_small",[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Ptr(3978425819141910832)])],output:None),(name:"ptr_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("ptr_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48))])],output:None),(name:"ptr_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("ptr_0_perturbed_big",[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"ptr_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("ptr_1_perturbed_big",[Ptr(506097522914230528),Int(c_uint8_t(16)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Float(c_float(-8370480300000000000000)),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("ptr_2_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Int(c_uint8_t(32)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Float(c_float(-1810926400000)),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("ptr_3_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Float(c_float(-389.51367)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("ptr_4_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Int(c_uint8_t(64)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Float(c_float(-0.00000008321092)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("ptr_5_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Int(c_uint8_t(80)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Float(c_float(-0.000000000000000017632526)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("ptr_6_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Int(c_uint8_t(96)),Ptr(8608196880778817904),Ptr(9765639646188044672),Float(c_float(-0.0000000000000000000000000036999117)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("ptr_7_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("ptr_8_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("ptr_9_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Float(c_float(4175980800000000000000)),Ptr(8608196880778817904),Ptr(9765639646188044672),Int(c_uint8_t(144)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("ptr_10_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Float(c_float(903307300000)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Int(c_uint8_t(160)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("ptr_11_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Float(c_float(194.25488)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Int(c_uint8_t(176)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("ptr_12_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Int(c_uint8_t(192)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("ptr_13_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Int(c_uint8_t(208)),Ptr(16710296238643405280),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("ptr_14_perturbed_big",[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Int(c_uint8_t(224)),Ptr(17867739004052632048)])],output:None),(name:"ptr_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("ptr_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Int(c_uint8_t(240))])],output:None),(name:"ptr_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("ptr_0_perturbed_small",[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859))]))],output:None),(name:"ptr_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("ptr_1_perturbed_small",[Ptr(506097522914230528),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832)]))],output:None),(name:"ptr_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("ptr_2_perturbed_small",[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Ptr(3978425819141910832)]))],output:None),(name:"ptr_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("ptr_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48))]))],output:None),(name:"ptr_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_0_perturbed_big",[Int(c_uint8_t(0)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"ptr_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_1_perturbed_big",[Ptr(506097522914230528),Int(c_uint8_t(16)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Float(c_float(-8370480300000000000000)),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_2_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Int(c_uint8_t(32)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Float(c_float(-1810926400000)),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_3_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Int(c_uint8_t(48)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Float(c_float(-389.51367)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_4_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Int(c_uint8_t(64)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Float(c_float(-0.00000008321092)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_5_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Int(c_uint8_t(80)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Float(c_float(-0.000000000000000017632526)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_6_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Int(c_uint8_t(96)),Ptr(8608196880778817904),Ptr(9765639646188044672),Float(c_float(-0.0000000000000000000000000036999117)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_7_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_8_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_9_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Float(c_float(4175980800000000000000)),Ptr(8608196880778817904),Ptr(9765639646188044672),Int(c_uint8_t(144)),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_10_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Float(c_float(903307300000)),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Int(c_uint8_t(160)),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_11_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Float(c_float(194.25488)),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Int(c_uint8_t(176)),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_12_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Ptr(2820983053732684064),Float(c_float(0.00000004148859)),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Int(c_uint8_t(192)),Ptr(15552853473234178512),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_13_perturbed_big",[Ptr(506097522914230528),Ptr(1663540288323457296),Float(c_float(0.000000000000000008789052)),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Int(c_uint8_t(208)),Ptr(16710296238643405280),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_14_perturbed_big",[Ptr(506097522914230528),Float(c_float(0.0000000000000000000000000018436203)),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Int(c_uint8_t(224)),Ptr(17867739004052632048)]))],output:None),(name:"ptr_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("ptr_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Ptr(1663540288323457296),Ptr(2820983053732684064),Ptr(3978425819141910832),Ptr(5135868584551137600),Ptr(6293311349960364368),Ptr(7450754115369591136),Ptr(8608196880778817904),Ptr(9765639646188044672),Ptr(10923082411597271440),Ptr(12080525177006498208),Ptr(13237967942415724976),Ptr(14395410707824951744),Ptr(15552853473234178512),Ptr(16710296238643405280),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/u128.kdl b/tests/procgen/u128.kdl new file mode 100644 index 0000000..78c65c1 --- /dev/null +++ b/tests/procgen/u128.kdl @@ -0,0 +1,1490 @@ +fn "u128_val_in" { + inputs { + arg0 "u128" + } + outputs { + } +} +fn "u128_val_out" { + inputs { + } + outputs { + arg0 "u128" + } +} +fn "u128_val_in_out" { + inputs { + arg0 "u128" + } + outputs { + arg0 "u128" + } +} +fn "u128_ref_in" { + inputs { + arg0 "&u128" + } + outputs { + } +} +fn "u128_val_in_2" { + inputs { + arg0 "u128" + arg1 "u128" + } + outputs { + } +} +fn "u128_val_in_3" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + } + outputs { + } +} +fn "u128_val_in_4" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + } + outputs { + } +} +fn "u128_val_in_5" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + } + outputs { + } +} +fn "u128_val_in_6" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + } + outputs { + } +} +fn "u128_val_in_7" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + } + outputs { + } +} +fn "u128_val_in_8" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + } + outputs { + } +} +fn "u128_val_in_9" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + } + outputs { + } +} +fn "u128_val_in_10" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + } + outputs { + } +} +fn "u128_val_in_11" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + } + outputs { + } +} +fn "u128_val_in_12" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + } + outputs { + } +} +fn "u128_val_in_13" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + } + outputs { + } +} +fn "u128_val_in_14" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + } + outputs { + } +} +fn "u128_val_in_15" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + } + outputs { + } +} +fn "u128_val_in_16" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +struct "Many1" { + f0 "u128" +} +fn "u128_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "u128_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "u128" + f1 "u128" +} +fn "u128_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "u128_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "u128" + f1 "u128" + f2 "u128" +} +fn "u128_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "u128_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" +} +fn "u128_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "u128_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" +} +fn "u128_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "u128_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" +} +fn "u128_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "u128_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" +} +fn "u128_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "u128_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" +} +fn "u128_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "u128_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" +} +fn "u128_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "u128_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" +} +fn "u128_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "u128_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" +} +fn "u128_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "u128_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" +} +fn "u128_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "u128_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" +} +fn "u128_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "u128_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" +} +fn "u128_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "u128_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" +} +fn "u128_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "u128_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "u128_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "u128_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u128" + arg2 "u128" + arg3 "f32" + } + outputs { + } +} +fn "u128_val_in_1_perturbed_small" { + inputs { + arg0 "u128" + arg1 "u8" + arg2 "f32" + arg3 "u128" + } + outputs { + } +} +fn "u128_val_in_2_perturbed_small" { + inputs { + arg0 "u128" + arg1 "f32" + arg2 "u8" + arg3 "u128" + } + outputs { + } +} +fn "u128_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u128" + arg2 "u128" + arg3 "u8" + } + outputs { + } +} +fn "u128_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "f32" + } + outputs { + } +} +fn "u128_val_in_1_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u8" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "f32" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_2_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u8" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "f32" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_3_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u8" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "f32" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_4_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u8" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "f32" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_5_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u8" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "f32" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_6_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u8" + arg7 "u128" + arg8 "u128" + arg9 "f32" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_7_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u8" + arg8 "f32" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_8_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "f32" + arg8 "u8" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_9_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "f32" + arg7 "u128" + arg8 "u128" + arg9 "u8" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_10_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "f32" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u8" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_11_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "f32" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u8" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_12_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "u128" + arg3 "f32" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u8" + arg13 "u128" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_13_perturbed_big" { + inputs { + arg0 "u128" + arg1 "u128" + arg2 "f32" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u8" + arg14 "u128" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_14_perturbed_big" { + inputs { + arg0 "u128" + arg1 "f32" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u8" + arg15 "u128" + } + outputs { + } +} +fn "u128_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u128" + arg2 "u128" + arg3 "u128" + arg4 "u128" + arg5 "u128" + arg6 "u128" + arg7 "u128" + arg8 "u128" + arg9 "u128" + arg10 "u128" + arg11 "u128" + arg12 "u128" + arg13 "u128" + arg14 "u128" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "u128" + f2 "u128" + f3 "f32" +} +fn "u128_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "u128" + f1 "u8" + f2 "f32" + f3 "u128" +} +fn "u128_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "u128" + f1 "f32" + f2 "u8" + f3 "u128" +} +fn "u128_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "u128" + f2 "u128" + f3 "u8" +} +fn "u128_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "f32" +} +fn "u128_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "u128" + f1 "u8" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "f32" + f15 "u128" +} +fn "u128_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "u128" + f1 "u128" + f2 "u8" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "f32" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u8" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "f32" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u8" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "f32" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u8" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "f32" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u8" + f7 "u128" + f8 "u128" + f9 "f32" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u8" + f8 "f32" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "f32" + f8 "u8" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "f32" + f7 "u128" + f8 "u128" + f9 "u8" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "f32" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u8" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "f32" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u8" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "u128" + f1 "u128" + f2 "u128" + f3 "f32" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u8" + f13 "u128" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "u128" + f1 "u128" + f2 "f32" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u8" + f14 "u128" + f15 "u128" +} +fn "u128_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "u128" + f1 "f32" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u8" + f15 "u128" +} +fn "u128_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "u128" + f2 "u128" + f3 "u128" + f4 "u128" + f5 "u128" + f6 "u128" + f7 "u128" + f8 "u128" + f9 "u128" + f10 "u128" + f11 "u128" + f12 "u128" + f13 "u128" + f14 "u128" + f15 "u8" +} +fn "u128_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/u16.kdl b/tests/procgen/u16.kdl new file mode 100644 index 0000000..32d0aa5 --- /dev/null +++ b/tests/procgen/u16.kdl @@ -0,0 +1,1490 @@ +fn "u16_val_in" { + inputs { + arg0 "u16" + } + outputs { + } +} +fn "u16_val_out" { + inputs { + } + outputs { + arg0 "u16" + } +} +fn "u16_val_in_out" { + inputs { + arg0 "u16" + } + outputs { + arg0 "u16" + } +} +fn "u16_ref_in" { + inputs { + arg0 "&u16" + } + outputs { + } +} +fn "u16_val_in_2" { + inputs { + arg0 "u16" + arg1 "u16" + } + outputs { + } +} +fn "u16_val_in_3" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + } + outputs { + } +} +fn "u16_val_in_4" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + } + outputs { + } +} +fn "u16_val_in_5" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + } + outputs { + } +} +fn "u16_val_in_6" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + } + outputs { + } +} +fn "u16_val_in_7" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + } + outputs { + } +} +fn "u16_val_in_8" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + } + outputs { + } +} +fn "u16_val_in_9" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + } + outputs { + } +} +fn "u16_val_in_10" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + } + outputs { + } +} +fn "u16_val_in_11" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + } + outputs { + } +} +fn "u16_val_in_12" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + } + outputs { + } +} +fn "u16_val_in_13" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + } + outputs { + } +} +fn "u16_val_in_14" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + } + outputs { + } +} +fn "u16_val_in_15" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + } + outputs { + } +} +fn "u16_val_in_16" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +struct "Many1" { + f0 "u16" +} +fn "u16_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "u16_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "u16" + f1 "u16" +} +fn "u16_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "u16_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "u16" + f1 "u16" + f2 "u16" +} +fn "u16_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "u16_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" +} +fn "u16_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "u16_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" +} +fn "u16_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "u16_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" +} +fn "u16_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "u16_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" +} +fn "u16_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "u16_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" +} +fn "u16_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "u16_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" +} +fn "u16_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "u16_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" +} +fn "u16_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "u16_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" +} +fn "u16_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "u16_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" +} +fn "u16_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "u16_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" +} +fn "u16_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "u16_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" +} +fn "u16_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "u16_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" +} +fn "u16_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "u16_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "u16_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "u16_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u16" + arg2 "u16" + arg3 "f32" + } + outputs { + } +} +fn "u16_val_in_1_perturbed_small" { + inputs { + arg0 "u16" + arg1 "u8" + arg2 "f32" + arg3 "u16" + } + outputs { + } +} +fn "u16_val_in_2_perturbed_small" { + inputs { + arg0 "u16" + arg1 "f32" + arg2 "u8" + arg3 "u16" + } + outputs { + } +} +fn "u16_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u16" + arg2 "u16" + arg3 "u8" + } + outputs { + } +} +fn "u16_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "f32" + } + outputs { + } +} +fn "u16_val_in_1_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u8" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "f32" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_2_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u8" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "f32" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_3_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u8" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "f32" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_4_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u8" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "f32" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_5_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u8" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "f32" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_6_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u8" + arg7 "u16" + arg8 "u16" + arg9 "f32" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_7_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u8" + arg8 "f32" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_8_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "f32" + arg8 "u8" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_9_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "f32" + arg7 "u16" + arg8 "u16" + arg9 "u8" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_10_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "f32" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u8" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_11_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "f32" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u8" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_12_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "u16" + arg3 "f32" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u8" + arg13 "u16" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_13_perturbed_big" { + inputs { + arg0 "u16" + arg1 "u16" + arg2 "f32" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u8" + arg14 "u16" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_14_perturbed_big" { + inputs { + arg0 "u16" + arg1 "f32" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u8" + arg15 "u16" + } + outputs { + } +} +fn "u16_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u16" + arg2 "u16" + arg3 "u16" + arg4 "u16" + arg5 "u16" + arg6 "u16" + arg7 "u16" + arg8 "u16" + arg9 "u16" + arg10 "u16" + arg11 "u16" + arg12 "u16" + arg13 "u16" + arg14 "u16" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "u16" + f2 "u16" + f3 "f32" +} +fn "u16_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "u16" + f1 "u8" + f2 "f32" + f3 "u16" +} +fn "u16_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "u16" + f1 "f32" + f2 "u8" + f3 "u16" +} +fn "u16_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "u16" + f2 "u16" + f3 "u8" +} +fn "u16_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "f32" +} +fn "u16_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "u16" + f1 "u8" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "f32" + f15 "u16" +} +fn "u16_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "u16" + f1 "u16" + f2 "u8" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "f32" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u8" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "f32" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u8" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "f32" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u8" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "f32" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u8" + f7 "u16" + f8 "u16" + f9 "f32" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u8" + f8 "f32" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "f32" + f8 "u8" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "f32" + f7 "u16" + f8 "u16" + f9 "u8" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "f32" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u8" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "f32" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u8" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "u16" + f1 "u16" + f2 "u16" + f3 "f32" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u8" + f13 "u16" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "u16" + f1 "u16" + f2 "f32" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u8" + f14 "u16" + f15 "u16" +} +fn "u16_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "u16" + f1 "f32" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u8" + f15 "u16" +} +fn "u16_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "u16" + f2 "u16" + f3 "u16" + f4 "u16" + f5 "u16" + f6 "u16" + f7 "u16" + f8 "u16" + f9 "u16" + f10 "u16" + f11 "u16" + f12 "u16" + f13 "u16" + f14 "u16" + f15 "u8" +} +fn "u16_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/u16.ron b/tests/procgen/u16.ron deleted file mode 100644 index a3b0637..0000000 --- a/tests/procgen/u16.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"u16",funcs:[(name:"u16_val_in",conventions:[All],inputs:[Int(c_uint16_t(256))],output:None),(name:"u16_val_out",conventions:[All],inputs:[],output:Some(Int(c_uint16_t(256)))),(name:"u16_val_in_out",conventions:[All],inputs:[Int(c_uint16_t(256))],output:Some(Int(c_uint16_t(4368)))),(name:"u16_ref_in",conventions:[All],inputs:[Ref(Int(c_uint16_t(256)))],output:None),(name:"u16_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_uint16_t(256))))),(name:"u16_ref_in_out",conventions:[All],inputs:[Ref(Int(c_uint16_t(256)))],output:Some(Ref(Int(c_uint16_t(4368))))),(name:"u16_val_in_2",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368))],output:None),(name:"u16_val_in_3",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480))],output:None),(name:"u16_val_in_4",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592))],output:None),(name:"u16_val_in_5",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704))],output:None),(name:"u16_val_in_6",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816))],output:None),(name:"u16_val_in_7",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928))],output:None),(name:"u16_val_in_8",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040))],output:None),(name:"u16_val_in_9",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152))],output:None),(name:"u16_val_in_10",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264))],output:None),(name:"u16_val_in_11",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376))],output:None),(name:"u16_val_in_12",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488))],output:None),(name:"u16_val_in_13",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600))],output:None),(name:"u16_val_in_14",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712))],output:None),(name:"u16_val_in_15",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824))],output:None),(name:"u16_val_in_16",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_struct_in_1",conventions:[All],inputs:[Struct("u16_1",[Int(c_uint16_t(256))])],output:None),(name:"u16_struct_in_2",conventions:[All],inputs:[Struct("u16_2",[Int(c_uint16_t(256)),Int(c_uint16_t(4368))])],output:None),(name:"u16_struct_in_3",conventions:[All],inputs:[Struct("u16_3",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480))])],output:None),(name:"u16_struct_in_4",conventions:[All],inputs:[Struct("u16_4",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592))])],output:None),(name:"u16_struct_in_5",conventions:[All],inputs:[Struct("u16_5",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704))])],output:None),(name:"u16_struct_in_6",conventions:[All],inputs:[Struct("u16_6",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816))])],output:None),(name:"u16_struct_in_7",conventions:[All],inputs:[Struct("u16_7",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928))])],output:None),(name:"u16_struct_in_8",conventions:[All],inputs:[Struct("u16_8",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040))])],output:None),(name:"u16_struct_in_9",conventions:[All],inputs:[Struct("u16_9",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152))])],output:None),(name:"u16_struct_in_10",conventions:[All],inputs:[Struct("u16_10",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264))])],output:None),(name:"u16_struct_in_11",conventions:[All],inputs:[Struct("u16_11",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376))])],output:None),(name:"u16_struct_in_12",conventions:[All],inputs:[Struct("u16_12",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488))])],output:None),(name:"u16_struct_in_13",conventions:[All],inputs:[Struct("u16_13",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600))])],output:None),(name:"u16_struct_in_14",conventions:[All],inputs:[Struct("u16_14",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712))])],output:None),(name:"u16_struct_in_15",conventions:[All],inputs:[Struct("u16_15",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824))])],output:None),(name:"u16_struct_in_16",conventions:[All],inputs:[Struct("u16_16",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("u16_1",[Int(c_uint16_t(256))]))],output:None),(name:"u16_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("u16_2",[Int(c_uint16_t(256)),Int(c_uint16_t(4368))]))],output:None),(name:"u16_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("u16_3",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480))]))],output:None),(name:"u16_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("u16_4",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592))]))],output:None),(name:"u16_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("u16_5",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704))]))],output:None),(name:"u16_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("u16_6",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816))]))],output:None),(name:"u16_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("u16_7",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928))]))],output:None),(name:"u16_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("u16_8",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040))]))],output:None),(name:"u16_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("u16_9",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152))]))],output:None),(name:"u16_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("u16_10",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264))]))],output:None),(name:"u16_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("u16_11",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376))]))],output:None),(name:"u16_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("u16_12",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488))]))],output:None),(name:"u16_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("u16_13",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600))]))],output:None),(name:"u16_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("u16_14",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712))]))],output:None),(name:"u16_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("u16_15",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824))]))],output:None),(name:"u16_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("u16_16",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859))],output:None),(name:"u16_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592))],output:None),(name:"u16_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint16_t(12592))],output:None),(name:"u16_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48))],output:None),(name:"u16_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"u16_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Float(c_float(-8370480300000000000000)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint8_t(32)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Float(c_float(-1810926400000)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Float(c_float(-389.51367)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint8_t(64)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Float(c_float(-0.00000008321092)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint8_t(80)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Float(c_float(-0.000000000000000017632526)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint8_t(96)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint8_t(144)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Float(c_float(903307300000)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint8_t(160)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Float(c_float(194.25488)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint8_t(176)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint8_t(192)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint8_t(208)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint8_t(224)),Int(c_uint16_t(61936))],output:None),(name:"u16_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint8_t(240))],output:None),(name:"u16_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("u16_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859))])],output:None),(name:"u16_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("u16_1_perturbed_small",[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592))])],output:None),(name:"u16_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("u16_2_perturbed_small",[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint16_t(12592))])],output:None),(name:"u16_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("u16_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48))])],output:None),(name:"u16_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("u16_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"u16_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("u16_1_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Float(c_float(-8370480300000000000000)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("u16_2_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint8_t(32)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Float(c_float(-1810926400000)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("u16_3_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Float(c_float(-389.51367)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("u16_4_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint8_t(64)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Float(c_float(-0.00000008321092)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("u16_5_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint8_t(80)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Float(c_float(-0.000000000000000017632526)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("u16_6_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint8_t(96)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("u16_7_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("u16_8_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("u16_9_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint8_t(144)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("u16_10_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Float(c_float(903307300000)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint8_t(160)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("u16_11_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Float(c_float(194.25488)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint8_t(176)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("u16_12_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint8_t(192)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("u16_13_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint8_t(208)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("u16_14_perturbed_big",[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint8_t(224)),Int(c_uint16_t(61936))])],output:None),(name:"u16_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("u16_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint8_t(240))])],output:None),(name:"u16_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("u16_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859))]))],output:None),(name:"u16_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("u16_1_perturbed_small",[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592))]))],output:None),(name:"u16_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("u16_2_perturbed_small",[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint16_t(12592))]))],output:None),(name:"u16_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("u16_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48))]))],output:None),(name:"u16_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"u16_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_1_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint8_t(16)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Float(c_float(-8370480300000000000000)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_2_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint8_t(32)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Float(c_float(-1810926400000)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_3_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint8_t(48)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Float(c_float(-389.51367)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_4_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint8_t(64)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Float(c_float(-0.00000008321092)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_5_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint8_t(80)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Float(c_float(-0.000000000000000017632526)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_6_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint8_t(96)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_7_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_8_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_9_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Float(c_float(4175980800000000000000)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint8_t(144)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_10_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Float(c_float(903307300000)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint8_t(160)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_11_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Float(c_float(194.25488)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint8_t(176)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_12_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Float(c_float(0.00000004148859)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint8_t(192)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_13_perturbed_big",[Int(c_uint16_t(256)),Int(c_uint16_t(4368)),Float(c_float(0.000000000000000008789052)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint8_t(208)),Int(c_uint16_t(57824)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_14_perturbed_big",[Int(c_uint16_t(256)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint8_t(224)),Int(c_uint16_t(61936))]))],output:None),(name:"u16_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("u16_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint16_t(4368)),Int(c_uint16_t(8480)),Int(c_uint16_t(12592)),Int(c_uint16_t(16704)),Int(c_uint16_t(20816)),Int(c_uint16_t(24928)),Int(c_uint16_t(29040)),Int(c_uint16_t(33152)),Int(c_uint16_t(37264)),Int(c_uint16_t(41376)),Int(c_uint16_t(45488)),Int(c_uint16_t(49600)),Int(c_uint16_t(53712)),Int(c_uint16_t(57824)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/u32.kdl b/tests/procgen/u32.kdl new file mode 100644 index 0000000..42797e8 --- /dev/null +++ b/tests/procgen/u32.kdl @@ -0,0 +1,1490 @@ +fn "u32_val_in" { + inputs { + arg0 "u32" + } + outputs { + } +} +fn "u32_val_out" { + inputs { + } + outputs { + arg0 "u32" + } +} +fn "u32_val_in_out" { + inputs { + arg0 "u32" + } + outputs { + arg0 "u32" + } +} +fn "u32_ref_in" { + inputs { + arg0 "&u32" + } + outputs { + } +} +fn "u32_val_in_2" { + inputs { + arg0 "u32" + arg1 "u32" + } + outputs { + } +} +fn "u32_val_in_3" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + } + outputs { + } +} +fn "u32_val_in_4" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + } + outputs { + } +} +fn "u32_val_in_5" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + } + outputs { + } +} +fn "u32_val_in_6" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + } + outputs { + } +} +fn "u32_val_in_7" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + } + outputs { + } +} +fn "u32_val_in_8" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + } + outputs { + } +} +fn "u32_val_in_9" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + } + outputs { + } +} +fn "u32_val_in_10" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + } + outputs { + } +} +fn "u32_val_in_11" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + } + outputs { + } +} +fn "u32_val_in_12" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + } + outputs { + } +} +fn "u32_val_in_13" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + } + outputs { + } +} +fn "u32_val_in_14" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + } + outputs { + } +} +fn "u32_val_in_15" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + } + outputs { + } +} +fn "u32_val_in_16" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +struct "Many1" { + f0 "u32" +} +fn "u32_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "u32_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "u32" + f1 "u32" +} +fn "u32_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "u32_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "u32" + f1 "u32" + f2 "u32" +} +fn "u32_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "u32_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" +} +fn "u32_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "u32_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" +} +fn "u32_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "u32_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" +} +fn "u32_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "u32_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" +} +fn "u32_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "u32_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" +} +fn "u32_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "u32_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" +} +fn "u32_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "u32_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" +} +fn "u32_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "u32_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" +} +fn "u32_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "u32_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" +} +fn "u32_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "u32_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" +} +fn "u32_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "u32_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" +} +fn "u32_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "u32_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" +} +fn "u32_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "u32_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "u32_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "u32_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u32" + arg2 "u32" + arg3 "f32" + } + outputs { + } +} +fn "u32_val_in_1_perturbed_small" { + inputs { + arg0 "u32" + arg1 "u8" + arg2 "f32" + arg3 "u32" + } + outputs { + } +} +fn "u32_val_in_2_perturbed_small" { + inputs { + arg0 "u32" + arg1 "f32" + arg2 "u8" + arg3 "u32" + } + outputs { + } +} +fn "u32_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u32" + arg2 "u32" + arg3 "u8" + } + outputs { + } +} +fn "u32_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "f32" + } + outputs { + } +} +fn "u32_val_in_1_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u8" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "f32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_2_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u8" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "f32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_3_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u8" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "f32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_4_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u8" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "f32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_5_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u8" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "f32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_6_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u8" + arg7 "u32" + arg8 "u32" + arg9 "f32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_7_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u8" + arg8 "f32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_8_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "f32" + arg8 "u8" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_9_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "f32" + arg7 "u32" + arg8 "u32" + arg9 "u8" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_10_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "f32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u8" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_11_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "f32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u8" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_12_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "u32" + arg3 "f32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u8" + arg13 "u32" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_13_perturbed_big" { + inputs { + arg0 "u32" + arg1 "u32" + arg2 "f32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u8" + arg14 "u32" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_14_perturbed_big" { + inputs { + arg0 "u32" + arg1 "f32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u8" + arg15 "u32" + } + outputs { + } +} +fn "u32_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u32" + arg2 "u32" + arg3 "u32" + arg4 "u32" + arg5 "u32" + arg6 "u32" + arg7 "u32" + arg8 "u32" + arg9 "u32" + arg10 "u32" + arg11 "u32" + arg12 "u32" + arg13 "u32" + arg14 "u32" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "u32" + f2 "u32" + f3 "f32" +} +fn "u32_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "u32" + f1 "u8" + f2 "f32" + f3 "u32" +} +fn "u32_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "u32" + f1 "f32" + f2 "u8" + f3 "u32" +} +fn "u32_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "u32" + f2 "u32" + f3 "u8" +} +fn "u32_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "f32" +} +fn "u32_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "u32" + f1 "u8" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "f32" + f15 "u32" +} +fn "u32_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "u32" + f1 "u32" + f2 "u8" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "f32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u8" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "f32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u8" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "f32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u8" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "f32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u8" + f7 "u32" + f8 "u32" + f9 "f32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u8" + f8 "f32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "f32" + f8 "u8" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "f32" + f7 "u32" + f8 "u32" + f9 "u8" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "f32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u8" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "f32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u8" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "u32" + f1 "u32" + f2 "u32" + f3 "f32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u8" + f13 "u32" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "u32" + f1 "u32" + f2 "f32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u8" + f14 "u32" + f15 "u32" +} +fn "u32_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "u32" + f1 "f32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u8" + f15 "u32" +} +fn "u32_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "u32" + f2 "u32" + f3 "u32" + f4 "u32" + f5 "u32" + f6 "u32" + f7 "u32" + f8 "u32" + f9 "u32" + f10 "u32" + f11 "u32" + f12 "u32" + f13 "u32" + f14 "u32" + f15 "u8" +} +fn "u32_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/u32.ron b/tests/procgen/u32.ron deleted file mode 100644 index 1cd4ca0..0000000 --- a/tests/procgen/u32.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"u32",funcs:[(name:"u32_val_in",conventions:[All],inputs:[Int(c_uint32_t(50462976))],output:None),(name:"u32_val_out",conventions:[All],inputs:[],output:Some(Int(c_uint32_t(50462976)))),(name:"u32_val_in_out",conventions:[All],inputs:[Int(c_uint32_t(50462976))],output:Some(Int(c_uint32_t(319951120)))),(name:"u32_ref_in",conventions:[All],inputs:[Ref(Int(c_uint32_t(50462976)))],output:None),(name:"u32_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_uint32_t(50462976))))),(name:"u32_ref_in_out",conventions:[All],inputs:[Ref(Int(c_uint32_t(50462976)))],output:Some(Ref(Int(c_uint32_t(319951120))))),(name:"u32_val_in_2",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120))],output:None),(name:"u32_val_in_3",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264))],output:None),(name:"u32_val_in_4",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408))],output:None),(name:"u32_val_in_5",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552))],output:None),(name:"u32_val_in_6",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696))],output:None),(name:"u32_val_in_7",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840))],output:None),(name:"u32_val_in_8",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984))],output:None),(name:"u32_val_in_9",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128))],output:None),(name:"u32_val_in_10",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272))],output:None),(name:"u32_val_in_11",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416))],output:None),(name:"u32_val_in_12",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560))],output:None),(name:"u32_val_in_13",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704))],output:None),(name:"u32_val_in_14",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848))],output:None),(name:"u32_val_in_15",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992))],output:None),(name:"u32_val_in_16",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_struct_in_1",conventions:[All],inputs:[Struct("u32_1",[Int(c_uint32_t(50462976))])],output:None),(name:"u32_struct_in_2",conventions:[All],inputs:[Struct("u32_2",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120))])],output:None),(name:"u32_struct_in_3",conventions:[All],inputs:[Struct("u32_3",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264))])],output:None),(name:"u32_struct_in_4",conventions:[All],inputs:[Struct("u32_4",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408))])],output:None),(name:"u32_struct_in_5",conventions:[All],inputs:[Struct("u32_5",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552))])],output:None),(name:"u32_struct_in_6",conventions:[All],inputs:[Struct("u32_6",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696))])],output:None),(name:"u32_struct_in_7",conventions:[All],inputs:[Struct("u32_7",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840))])],output:None),(name:"u32_struct_in_8",conventions:[All],inputs:[Struct("u32_8",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984))])],output:None),(name:"u32_struct_in_9",conventions:[All],inputs:[Struct("u32_9",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128))])],output:None),(name:"u32_struct_in_10",conventions:[All],inputs:[Struct("u32_10",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272))])],output:None),(name:"u32_struct_in_11",conventions:[All],inputs:[Struct("u32_11",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416))])],output:None),(name:"u32_struct_in_12",conventions:[All],inputs:[Struct("u32_12",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560))])],output:None),(name:"u32_struct_in_13",conventions:[All],inputs:[Struct("u32_13",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704))])],output:None),(name:"u32_struct_in_14",conventions:[All],inputs:[Struct("u32_14",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848))])],output:None),(name:"u32_struct_in_15",conventions:[All],inputs:[Struct("u32_15",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992))])],output:None),(name:"u32_struct_in_16",conventions:[All],inputs:[Struct("u32_16",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("u32_1",[Int(c_uint32_t(50462976))]))],output:None),(name:"u32_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("u32_2",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120))]))],output:None),(name:"u32_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("u32_3",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264))]))],output:None),(name:"u32_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("u32_4",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408))]))],output:None),(name:"u32_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("u32_5",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552))]))],output:None),(name:"u32_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("u32_6",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696))]))],output:None),(name:"u32_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("u32_7",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840))]))],output:None),(name:"u32_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("u32_8",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984))]))],output:None),(name:"u32_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("u32_9",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128))]))],output:None),(name:"u32_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("u32_10",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272))]))],output:None),(name:"u32_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("u32_11",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416))]))],output:None),(name:"u32_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("u32_12",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560))]))],output:None),(name:"u32_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("u32_13",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704))]))],output:None),(name:"u32_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("u32_14",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848))]))],output:None),(name:"u32_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("u32_15",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992))]))],output:None),(name:"u32_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("u32_16",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859))],output:None),(name:"u32_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408))],output:None),(name:"u32_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408))],output:None),(name:"u32_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48))],output:None),(name:"u32_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"u32_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Float(c_float(-8370480300000000000000)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Float(c_float(-1810926400000)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Float(c_float(-389.51367)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint8_t(64)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Float(c_float(-0.00000008321092)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint8_t(80)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Float(c_float(-0.000000000000000017632526)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint8_t(96)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint8_t(144)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Float(c_float(903307300000)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint8_t(160)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Float(c_float(194.25488)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint8_t(176)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint8_t(192)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint8_t(208)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint8_t(224)),Int(c_uint32_t(4092785136))],output:None),(name:"u32_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint8_t(240))],output:None),(name:"u32_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("u32_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859))])],output:None),(name:"u32_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("u32_1_perturbed_small",[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408))])],output:None),(name:"u32_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("u32_2_perturbed_small",[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408))])],output:None),(name:"u32_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("u32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48))])],output:None),(name:"u32_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("u32_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"u32_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("u32_1_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Float(c_float(-8370480300000000000000)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("u32_2_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Float(c_float(-1810926400000)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("u32_3_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Float(c_float(-389.51367)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("u32_4_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint8_t(64)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Float(c_float(-0.00000008321092)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("u32_5_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint8_t(80)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Float(c_float(-0.000000000000000017632526)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("u32_6_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint8_t(96)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("u32_7_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("u32_8_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("u32_9_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint8_t(144)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("u32_10_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Float(c_float(903307300000)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint8_t(160)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("u32_11_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Float(c_float(194.25488)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint8_t(176)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("u32_12_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint8_t(192)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("u32_13_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint8_t(208)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("u32_14_perturbed_big",[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint8_t(224)),Int(c_uint32_t(4092785136))])],output:None),(name:"u32_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("u32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint8_t(240))])],output:None),(name:"u32_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("u32_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859))]))],output:None),(name:"u32_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("u32_1_perturbed_small",[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408))]))],output:None),(name:"u32_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("u32_2_perturbed_small",[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408))]))],output:None),(name:"u32_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("u32_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48))]))],output:None),(name:"u32_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"u32_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_1_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint8_t(16)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Float(c_float(-8370480300000000000000)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_2_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint8_t(32)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Float(c_float(-1810926400000)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_3_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint8_t(48)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Float(c_float(-389.51367)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_4_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint8_t(64)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Float(c_float(-0.00000008321092)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_5_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint8_t(80)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Float(c_float(-0.000000000000000017632526)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_6_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint8_t(96)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_7_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_8_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_9_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Float(c_float(4175980800000000000000)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint8_t(144)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_10_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Float(c_float(903307300000)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint8_t(160)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_11_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Float(c_float(194.25488)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint8_t(176)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_12_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Float(c_float(0.00000004148859)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint8_t(192)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_13_perturbed_big",[Int(c_uint32_t(50462976)),Int(c_uint32_t(319951120)),Float(c_float(0.000000000000000008789052)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint8_t(208)),Int(c_uint32_t(3823296992)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_14_perturbed_big",[Int(c_uint32_t(50462976)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint8_t(224)),Int(c_uint32_t(4092785136))]))],output:None),(name:"u32_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("u32_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint32_t(319951120)),Int(c_uint32_t(589439264)),Int(c_uint32_t(858927408)),Int(c_uint32_t(1128415552)),Int(c_uint32_t(1397903696)),Int(c_uint32_t(1667391840)),Int(c_uint32_t(1936879984)),Int(c_uint32_t(2206368128)),Int(c_uint32_t(2475856272)),Int(c_uint32_t(2745344416)),Int(c_uint32_t(3014832560)),Int(c_uint32_t(3284320704)),Int(c_uint32_t(3553808848)),Int(c_uint32_t(3823296992)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/u64.kdl b/tests/procgen/u64.kdl new file mode 100644 index 0000000..3d9a53b --- /dev/null +++ b/tests/procgen/u64.kdl @@ -0,0 +1,1490 @@ +fn "u64_val_in" { + inputs { + arg0 "u64" + } + outputs { + } +} +fn "u64_val_out" { + inputs { + } + outputs { + arg0 "u64" + } +} +fn "u64_val_in_out" { + inputs { + arg0 "u64" + } + outputs { + arg0 "u64" + } +} +fn "u64_ref_in" { + inputs { + arg0 "&u64" + } + outputs { + } +} +fn "u64_val_in_2" { + inputs { + arg0 "u64" + arg1 "u64" + } + outputs { + } +} +fn "u64_val_in_3" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + } + outputs { + } +} +fn "u64_val_in_4" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + } + outputs { + } +} +fn "u64_val_in_5" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + } + outputs { + } +} +fn "u64_val_in_6" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + } + outputs { + } +} +fn "u64_val_in_7" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + } + outputs { + } +} +fn "u64_val_in_8" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + } + outputs { + } +} +fn "u64_val_in_9" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + } + outputs { + } +} +fn "u64_val_in_10" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + } + outputs { + } +} +fn "u64_val_in_11" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + } + outputs { + } +} +fn "u64_val_in_12" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + } + outputs { + } +} +fn "u64_val_in_13" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + } + outputs { + } +} +fn "u64_val_in_14" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + } + outputs { + } +} +fn "u64_val_in_15" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + } + outputs { + } +} +fn "u64_val_in_16" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +struct "Many1" { + f0 "u64" +} +fn "u64_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "u64_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "u64" + f1 "u64" +} +fn "u64_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "u64_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "u64" + f1 "u64" + f2 "u64" +} +fn "u64_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "u64_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" +} +fn "u64_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "u64_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" +} +fn "u64_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "u64_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" +} +fn "u64_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "u64_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" +} +fn "u64_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "u64_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" +} +fn "u64_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "u64_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" +} +fn "u64_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "u64_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" +} +fn "u64_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "u64_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" +} +fn "u64_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "u64_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" +} +fn "u64_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "u64_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" +} +fn "u64_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "u64_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" +} +fn "u64_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "u64_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" +} +fn "u64_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "u64_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "u64_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "u64_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u64" + arg2 "u64" + arg3 "f32" + } + outputs { + } +} +fn "u64_val_in_1_perturbed_small" { + inputs { + arg0 "u64" + arg1 "u8" + arg2 "f32" + arg3 "u64" + } + outputs { + } +} +fn "u64_val_in_2_perturbed_small" { + inputs { + arg0 "u64" + arg1 "f32" + arg2 "u8" + arg3 "u64" + } + outputs { + } +} +fn "u64_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u64" + arg2 "u64" + arg3 "u8" + } + outputs { + } +} +fn "u64_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "f32" + } + outputs { + } +} +fn "u64_val_in_1_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u8" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "f32" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_2_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u8" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "f32" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_3_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u8" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "f32" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_4_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u8" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "f32" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_5_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u8" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "f32" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_6_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u8" + arg7 "u64" + arg8 "u64" + arg9 "f32" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_7_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u8" + arg8 "f32" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_8_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "f32" + arg8 "u8" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_9_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "f32" + arg7 "u64" + arg8 "u64" + arg9 "u8" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_10_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "f32" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u8" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_11_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "f32" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u8" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_12_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "u64" + arg3 "f32" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u8" + arg13 "u64" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_13_perturbed_big" { + inputs { + arg0 "u64" + arg1 "u64" + arg2 "f32" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u8" + arg14 "u64" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_14_perturbed_big" { + inputs { + arg0 "u64" + arg1 "f32" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u8" + arg15 "u64" + } + outputs { + } +} +fn "u64_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u64" + arg2 "u64" + arg3 "u64" + arg4 "u64" + arg5 "u64" + arg6 "u64" + arg7 "u64" + arg8 "u64" + arg9 "u64" + arg10 "u64" + arg11 "u64" + arg12 "u64" + arg13 "u64" + arg14 "u64" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "u64" + f2 "u64" + f3 "f32" +} +fn "u64_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "u64" + f1 "u8" + f2 "f32" + f3 "u64" +} +fn "u64_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "u64" + f1 "f32" + f2 "u8" + f3 "u64" +} +fn "u64_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "u64" + f2 "u64" + f3 "u8" +} +fn "u64_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "f32" +} +fn "u64_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "u64" + f1 "u8" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "f32" + f15 "u64" +} +fn "u64_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "u64" + f1 "u64" + f2 "u8" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "f32" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u8" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "f32" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u8" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "f32" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u8" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "f32" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u8" + f7 "u64" + f8 "u64" + f9 "f32" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u8" + f8 "f32" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "f32" + f8 "u8" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "f32" + f7 "u64" + f8 "u64" + f9 "u8" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "f32" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u8" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "f32" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u8" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "u64" + f1 "u64" + f2 "u64" + f3 "f32" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u8" + f13 "u64" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "u64" + f1 "u64" + f2 "f32" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u8" + f14 "u64" + f15 "u64" +} +fn "u64_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "u64" + f1 "f32" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u8" + f15 "u64" +} +fn "u64_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "u64" + f2 "u64" + f3 "u64" + f4 "u64" + f5 "u64" + f6 "u64" + f7 "u64" + f8 "u64" + f9 "u64" + f10 "u64" + f11 "u64" + f12 "u64" + f13 "u64" + f14 "u64" + f15 "u8" +} +fn "u64_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/u64.ron b/tests/procgen/u64.ron deleted file mode 100644 index de73840..0000000 --- a/tests/procgen/u64.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"u64",funcs:[(name:"u64_val_in",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528))],output:None),(name:"u64_val_out",conventions:[All],inputs:[],output:Some(Int(c_uint64_t(506097522914230528)))),(name:"u64_val_in_out",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528))],output:Some(Int(c_uint64_t(1663540288323457296)))),(name:"u64_ref_in",conventions:[All],inputs:[Ref(Int(c_uint64_t(506097522914230528)))],output:None),(name:"u64_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_uint64_t(506097522914230528))))),(name:"u64_ref_in_out",conventions:[All],inputs:[Ref(Int(c_uint64_t(506097522914230528)))],output:Some(Ref(Int(c_uint64_t(1663540288323457296))))),(name:"u64_val_in_2",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296))],output:None),(name:"u64_val_in_3",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064))],output:None),(name:"u64_val_in_4",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832))],output:None),(name:"u64_val_in_5",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600))],output:None),(name:"u64_val_in_6",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368))],output:None),(name:"u64_val_in_7",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136))],output:None),(name:"u64_val_in_8",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904))],output:None),(name:"u64_val_in_9",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672))],output:None),(name:"u64_val_in_10",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440))],output:None),(name:"u64_val_in_11",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208))],output:None),(name:"u64_val_in_12",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976))],output:None),(name:"u64_val_in_13",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744))],output:None),(name:"u64_val_in_14",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512))],output:None),(name:"u64_val_in_15",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280))],output:None),(name:"u64_val_in_16",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_struct_in_1",conventions:[All],inputs:[Struct("u64_1",[Int(c_uint64_t(506097522914230528))])],output:None),(name:"u64_struct_in_2",conventions:[All],inputs:[Struct("u64_2",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296))])],output:None),(name:"u64_struct_in_3",conventions:[All],inputs:[Struct("u64_3",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064))])],output:None),(name:"u64_struct_in_4",conventions:[All],inputs:[Struct("u64_4",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832))])],output:None),(name:"u64_struct_in_5",conventions:[All],inputs:[Struct("u64_5",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600))])],output:None),(name:"u64_struct_in_6",conventions:[All],inputs:[Struct("u64_6",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368))])],output:None),(name:"u64_struct_in_7",conventions:[All],inputs:[Struct("u64_7",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136))])],output:None),(name:"u64_struct_in_8",conventions:[All],inputs:[Struct("u64_8",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904))])],output:None),(name:"u64_struct_in_9",conventions:[All],inputs:[Struct("u64_9",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672))])],output:None),(name:"u64_struct_in_10",conventions:[All],inputs:[Struct("u64_10",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440))])],output:None),(name:"u64_struct_in_11",conventions:[All],inputs:[Struct("u64_11",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208))])],output:None),(name:"u64_struct_in_12",conventions:[All],inputs:[Struct("u64_12",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976))])],output:None),(name:"u64_struct_in_13",conventions:[All],inputs:[Struct("u64_13",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744))])],output:None),(name:"u64_struct_in_14",conventions:[All],inputs:[Struct("u64_14",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512))])],output:None),(name:"u64_struct_in_15",conventions:[All],inputs:[Struct("u64_15",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280))])],output:None),(name:"u64_struct_in_16",conventions:[All],inputs:[Struct("u64_16",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("u64_1",[Int(c_uint64_t(506097522914230528))]))],output:None),(name:"u64_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("u64_2",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296))]))],output:None),(name:"u64_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("u64_3",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064))]))],output:None),(name:"u64_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("u64_4",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832))]))],output:None),(name:"u64_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("u64_5",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600))]))],output:None),(name:"u64_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("u64_6",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368))]))],output:None),(name:"u64_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("u64_7",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136))]))],output:None),(name:"u64_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("u64_8",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904))]))],output:None),(name:"u64_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("u64_9",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672))]))],output:None),(name:"u64_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("u64_10",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440))]))],output:None),(name:"u64_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("u64_11",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208))]))],output:None),(name:"u64_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("u64_12",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976))]))],output:None),(name:"u64_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("u64_13",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744))]))],output:None),(name:"u64_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("u64_14",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512))]))],output:None),(name:"u64_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("u64_15",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280))]))],output:None),(name:"u64_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("u64_16",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859))],output:None),(name:"u64_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832))],output:None),(name:"u64_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832))],output:None),(name:"u64_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48))],output:None),(name:"u64_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"u64_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Float(c_float(-8370480300000000000000)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Float(c_float(-1810926400000)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Float(c_float(-389.51367)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Float(c_float(-0.00000008321092)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Float(c_float(-0.000000000000000017632526)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint8_t(144)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint8_t(160)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint8_t(176)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint8_t(192)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint8_t(208)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint8_t(224)),Int(c_uint64_t(17867739004052632048))],output:None),(name:"u64_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint8_t(240))],output:None),(name:"u64_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("u64_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859))])],output:None),(name:"u64_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("u64_1_perturbed_small",[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832))])],output:None),(name:"u64_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("u64_2_perturbed_small",[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832))])],output:None),(name:"u64_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("u64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48))])],output:None),(name:"u64_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("u64_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"u64_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("u64_1_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Float(c_float(-8370480300000000000000)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("u64_2_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Float(c_float(-1810926400000)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("u64_3_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Float(c_float(-389.51367)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("u64_4_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Float(c_float(-0.00000008321092)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("u64_5_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Float(c_float(-0.000000000000000017632526)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("u64_6_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("u64_7_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("u64_8_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("u64_9_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint8_t(144)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("u64_10_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint8_t(160)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("u64_11_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint8_t(176)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("u64_12_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint8_t(192)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("u64_13_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint8_t(208)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("u64_14_perturbed_big",[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint8_t(224)),Int(c_uint64_t(17867739004052632048))])],output:None),(name:"u64_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("u64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint8_t(240))])],output:None),(name:"u64_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("u64_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859))]))],output:None),(name:"u64_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("u64_1_perturbed_small",[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832))]))],output:None),(name:"u64_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("u64_2_perturbed_small",[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832))]))],output:None),(name:"u64_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("u64_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48))]))],output:None),(name:"u64_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"u64_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_1_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint8_t(16)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Float(c_float(-8370480300000000000000)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_2_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint8_t(32)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Float(c_float(-1810926400000)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_3_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint8_t(48)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Float(c_float(-389.51367)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_4_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint8_t(64)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Float(c_float(-0.00000008321092)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_5_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint8_t(80)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Float(c_float(-0.000000000000000017632526)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_6_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint8_t(96)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_7_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_8_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_9_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Float(c_float(4175980800000000000000)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint8_t(144)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_10_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Float(c_float(903307300000)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint8_t(160)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_11_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Float(c_float(194.25488)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint8_t(176)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_12_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Float(c_float(0.00000004148859)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint8_t(192)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_13_perturbed_big",[Int(c_uint64_t(506097522914230528)),Int(c_uint64_t(1663540288323457296)),Float(c_float(0.000000000000000008789052)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint8_t(208)),Int(c_uint64_t(16710296238643405280)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_14_perturbed_big",[Int(c_uint64_t(506097522914230528)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint8_t(224)),Int(c_uint64_t(17867739004052632048))]))],output:None),(name:"u64_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("u64_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint64_t(1663540288323457296)),Int(c_uint64_t(2820983053732684064)),Int(c_uint64_t(3978425819141910832)),Int(c_uint64_t(5135868584551137600)),Int(c_uint64_t(6293311349960364368)),Int(c_uint64_t(7450754115369591136)),Int(c_uint64_t(8608196880778817904)),Int(c_uint64_t(9765639646188044672)),Int(c_uint64_t(10923082411597271440)),Int(c_uint64_t(12080525177006498208)),Int(c_uint64_t(13237967942415724976)),Int(c_uint64_t(14395410707824951744)),Int(c_uint64_t(15552853473234178512)),Int(c_uint64_t(16710296238643405280)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/u8.kdl b/tests/procgen/u8.kdl new file mode 100644 index 0000000..dbcbf98 --- /dev/null +++ b/tests/procgen/u8.kdl @@ -0,0 +1,1490 @@ +fn "u8_val_in" { + inputs { + arg0 "u8" + } + outputs { + } +} +fn "u8_val_out" { + inputs { + } + outputs { + arg0 "u8" + } +} +fn "u8_val_in_out" { + inputs { + arg0 "u8" + } + outputs { + arg0 "u8" + } +} +fn "u8_ref_in" { + inputs { + arg0 "&u8" + } + outputs { + } +} +fn "u8_val_in_2" { + inputs { + arg0 "u8" + arg1 "u8" + } + outputs { + } +} +fn "u8_val_in_3" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + } + outputs { + } +} +fn "u8_val_in_4" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + } + outputs { + } +} +fn "u8_val_in_5" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + } + outputs { + } +} +fn "u8_val_in_6" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + } + outputs { + } +} +fn "u8_val_in_7" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + } + outputs { + } +} +fn "u8_val_in_8" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + } + outputs { + } +} +fn "u8_val_in_9" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + } + outputs { + } +} +fn "u8_val_in_10" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + } + outputs { + } +} +fn "u8_val_in_11" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + } + outputs { + } +} +fn "u8_val_in_12" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + } + outputs { + } +} +fn "u8_val_in_13" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + } + outputs { + } +} +fn "u8_val_in_14" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + } + outputs { + } +} +fn "u8_val_in_15" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + } + outputs { + } +} +fn "u8_val_in_16" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +struct "Many1" { + f0 "u8" +} +fn "u8_struct_in_1" { + inputs { + arg0 "Many1" + } + outputs { + } +} +fn "u8_ref_struct_in_1" { + inputs { + arg0 "&Many1" + } + outputs { + } +} +struct "Many2" { + f0 "u8" + f1 "u8" +} +fn "u8_struct_in_2" { + inputs { + arg0 "Many2" + } + outputs { + } +} +fn "u8_ref_struct_in_2" { + inputs { + arg0 "&Many2" + } + outputs { + } +} +struct "Many3" { + f0 "u8" + f1 "u8" + f2 "u8" +} +fn "u8_struct_in_3" { + inputs { + arg0 "Many3" + } + outputs { + } +} +fn "u8_ref_struct_in_3" { + inputs { + arg0 "&Many3" + } + outputs { + } +} +struct "Many4" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" +} +fn "u8_struct_in_4" { + inputs { + arg0 "Many4" + } + outputs { + } +} +fn "u8_ref_struct_in_4" { + inputs { + arg0 "&Many4" + } + outputs { + } +} +struct "Many5" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" +} +fn "u8_struct_in_5" { + inputs { + arg0 "Many5" + } + outputs { + } +} +fn "u8_ref_struct_in_5" { + inputs { + arg0 "&Many5" + } + outputs { + } +} +struct "Many6" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" +} +fn "u8_struct_in_6" { + inputs { + arg0 "Many6" + } + outputs { + } +} +fn "u8_ref_struct_in_6" { + inputs { + arg0 "&Many6" + } + outputs { + } +} +struct "Many7" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" +} +fn "u8_struct_in_7" { + inputs { + arg0 "Many7" + } + outputs { + } +} +fn "u8_ref_struct_in_7" { + inputs { + arg0 "&Many7" + } + outputs { + } +} +struct "Many8" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" +} +fn "u8_struct_in_8" { + inputs { + arg0 "Many8" + } + outputs { + } +} +fn "u8_ref_struct_in_8" { + inputs { + arg0 "&Many8" + } + outputs { + } +} +struct "Many9" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" +} +fn "u8_struct_in_9" { + inputs { + arg0 "Many9" + } + outputs { + } +} +fn "u8_ref_struct_in_9" { + inputs { + arg0 "&Many9" + } + outputs { + } +} +struct "Many10" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" +} +fn "u8_struct_in_10" { + inputs { + arg0 "Many10" + } + outputs { + } +} +fn "u8_ref_struct_in_10" { + inputs { + arg0 "&Many10" + } + outputs { + } +} +struct "Many11" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" +} +fn "u8_struct_in_11" { + inputs { + arg0 "Many11" + } + outputs { + } +} +fn "u8_ref_struct_in_11" { + inputs { + arg0 "&Many11" + } + outputs { + } +} +struct "Many12" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" +} +fn "u8_struct_in_12" { + inputs { + arg0 "Many12" + } + outputs { + } +} +fn "u8_ref_struct_in_12" { + inputs { + arg0 "&Many12" + } + outputs { + } +} +struct "Many13" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" +} +fn "u8_struct_in_13" { + inputs { + arg0 "Many13" + } + outputs { + } +} +fn "u8_ref_struct_in_13" { + inputs { + arg0 "&Many13" + } + outputs { + } +} +struct "Many14" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" +} +fn "u8_struct_in_14" { + inputs { + arg0 "Many14" + } + outputs { + } +} +fn "u8_ref_struct_in_14" { + inputs { + arg0 "&Many14" + } + outputs { + } +} +struct "Many15" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" +} +fn "u8_struct_in_15" { + inputs { + arg0 "Many15" + } + outputs { + } +} +fn "u8_ref_struct_in_15" { + inputs { + arg0 "&Many15" + } + outputs { + } +} +struct "Many16" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_struct_in_16" { + inputs { + arg0 "Many16" + } + outputs { + } +} +fn "u8_ref_struct_in_16" { + inputs { + arg0 "&Many16" + } + outputs { + } +} +fn "u8_val_in_0_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "f32" + } + outputs { + } +} +fn "u8_val_in_1_perturbed_small" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "f32" + arg3 "u8" + } + outputs { + } +} +fn "u8_val_in_2_perturbed_small" { + inputs { + arg0 "u8" + arg1 "f32" + arg2 "u8" + arg3 "u8" + } + outputs { + } +} +fn "u8_val_in_3_perturbed_small" { + inputs { + arg0 "f32" + arg1 "u8" + arg2 "u8" + arg3 "u8" + } + outputs { + } +} +fn "u8_val_in_0_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "f32" + } + outputs { + } +} +fn "u8_val_in_1_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "f32" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_2_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "f32" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_3_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "f32" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_4_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "f32" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_5_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "f32" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_6_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "f32" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_7_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "f32" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_8_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "f32" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_9_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "f32" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_10_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "f32" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_11_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "f32" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_12_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "u8" + arg3 "f32" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_13_perturbed_big" { + inputs { + arg0 "u8" + arg1 "u8" + arg2 "f32" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_14_perturbed_big" { + inputs { + arg0 "u8" + arg1 "f32" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +fn "u8_val_in_15_perturbed_big" { + inputs { + arg0 "f32" + arg1 "u8" + arg2 "u8" + arg3 "u8" + arg4 "u8" + arg5 "u8" + arg6 "u8" + arg7 "u8" + arg8 "u8" + arg9 "u8" + arg10 "u8" + arg11 "u8" + arg12 "u8" + arg13 "u8" + arg14 "u8" + arg15 "u8" + } + outputs { + } +} +struct "Perturbedsmall0" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "f32" +} +fn "u8_val_in_0_perturbed_small" { + inputs { + arg0 "Perturbedsmall0" + } + outputs { + } +} +struct "Perturbedsmall1" { + f0 "u8" + f1 "u8" + f2 "f32" + f3 "u8" +} +fn "u8_val_in_1_perturbed_small" { + inputs { + arg0 "Perturbedsmall1" + } + outputs { + } +} +struct "Perturbedsmall2" { + f0 "u8" + f1 "f32" + f2 "u8" + f3 "u8" +} +fn "u8_val_in_2_perturbed_small" { + inputs { + arg0 "Perturbedsmall2" + } + outputs { + } +} +struct "Perturbedsmall3" { + f0 "f32" + f1 "u8" + f2 "u8" + f3 "u8" +} +fn "u8_val_in_3_perturbed_small" { + inputs { + arg0 "Perturbedsmall3" + } + outputs { + } +} +struct "Perturbedbig0" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "f32" +} +fn "u8_val_in_0_perturbed_big" { + inputs { + arg0 "Perturbedbig0" + } + outputs { + } +} +struct "Perturbedbig1" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "f32" + f15 "u8" +} +fn "u8_val_in_1_perturbed_big" { + inputs { + arg0 "Perturbedbig1" + } + outputs { + } +} +struct "Perturbedbig2" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "f32" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_2_perturbed_big" { + inputs { + arg0 "Perturbedbig2" + } + outputs { + } +} +struct "Perturbedbig3" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "f32" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_3_perturbed_big" { + inputs { + arg0 "Perturbedbig3" + } + outputs { + } +} +struct "Perturbedbig4" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "f32" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_4_perturbed_big" { + inputs { + arg0 "Perturbedbig4" + } + outputs { + } +} +struct "Perturbedbig5" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "f32" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_5_perturbed_big" { + inputs { + arg0 "Perturbedbig5" + } + outputs { + } +} +struct "Perturbedbig6" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "f32" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_6_perturbed_big" { + inputs { + arg0 "Perturbedbig6" + } + outputs { + } +} +struct "Perturbedbig7" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "f32" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_7_perturbed_big" { + inputs { + arg0 "Perturbedbig7" + } + outputs { + } +} +struct "Perturbedbig8" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "f32" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_8_perturbed_big" { + inputs { + arg0 "Perturbedbig8" + } + outputs { + } +} +struct "Perturbedbig9" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "f32" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_9_perturbed_big" { + inputs { + arg0 "Perturbedbig9" + } + outputs { + } +} +struct "Perturbedbig10" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "f32" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_10_perturbed_big" { + inputs { + arg0 "Perturbedbig10" + } + outputs { + } +} +struct "Perturbedbig11" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "f32" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_11_perturbed_big" { + inputs { + arg0 "Perturbedbig11" + } + outputs { + } +} +struct "Perturbedbig12" { + f0 "u8" + f1 "u8" + f2 "u8" + f3 "f32" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_12_perturbed_big" { + inputs { + arg0 "Perturbedbig12" + } + outputs { + } +} +struct "Perturbedbig13" { + f0 "u8" + f1 "u8" + f2 "f32" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_13_perturbed_big" { + inputs { + arg0 "Perturbedbig13" + } + outputs { + } +} +struct "Perturbedbig14" { + f0 "u8" + f1 "f32" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_14_perturbed_big" { + inputs { + arg0 "Perturbedbig14" + } + outputs { + } +} +struct "Perturbedbig15" { + f0 "f32" + f1 "u8" + f2 "u8" + f3 "u8" + f4 "u8" + f5 "u8" + f6 "u8" + f7 "u8" + f8 "u8" + f9 "u8" + f10 "u8" + f11 "u8" + f12 "u8" + f13 "u8" + f14 "u8" + f15 "u8" +} +fn "u8_val_in_15_perturbed_big" { + inputs { + arg0 "Perturbedbig15" + } + outputs { + } +} diff --git a/tests/procgen/u8.ron b/tests/procgen/u8.ron deleted file mode 100644 index 4f5df34..0000000 --- a/tests/procgen/u8.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"u8",funcs:[(name:"u8_val_in",conventions:[All],inputs:[Int(c_uint8_t(0))],output:None),(name:"u8_val_out",conventions:[All],inputs:[],output:Some(Int(c_uint8_t(0)))),(name:"u8_val_in_out",conventions:[All],inputs:[Int(c_uint8_t(0))],output:Some(Int(c_uint8_t(16)))),(name:"u8_ref_in",conventions:[All],inputs:[Ref(Int(c_uint8_t(0)))],output:None),(name:"u8_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c_uint8_t(0))))),(name:"u8_ref_in_out",conventions:[All],inputs:[Ref(Int(c_uint8_t(0)))],output:Some(Ref(Int(c_uint8_t(16))))),(name:"u8_val_in_2",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16))],output:None),(name:"u8_val_in_3",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32))],output:None),(name:"u8_val_in_4",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))],output:None),(name:"u8_val_in_5",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64))],output:None),(name:"u8_val_in_6",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80))],output:None),(name:"u8_val_in_7",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96))],output:None),(name:"u8_val_in_8",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112))],output:None),(name:"u8_val_in_9",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128))],output:None),(name:"u8_val_in_10",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144))],output:None),(name:"u8_val_in_11",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160))],output:None),(name:"u8_val_in_12",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176))],output:None),(name:"u8_val_in_13",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192))],output:None),(name:"u8_val_in_14",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208))],output:None),(name:"u8_val_in_15",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224))],output:None),(name:"u8_val_in_16",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_struct_in_1",conventions:[All],inputs:[Struct("u8_1",[Int(c_uint8_t(0))])],output:None),(name:"u8_struct_in_2",conventions:[All],inputs:[Struct("u8_2",[Int(c_uint8_t(0)),Int(c_uint8_t(16))])],output:None),(name:"u8_struct_in_3",conventions:[All],inputs:[Struct("u8_3",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32))])],output:None),(name:"u8_struct_in_4",conventions:[All],inputs:[Struct("u8_4",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))])],output:None),(name:"u8_struct_in_5",conventions:[All],inputs:[Struct("u8_5",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64))])],output:None),(name:"u8_struct_in_6",conventions:[All],inputs:[Struct("u8_6",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80))])],output:None),(name:"u8_struct_in_7",conventions:[All],inputs:[Struct("u8_7",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96))])],output:None),(name:"u8_struct_in_8",conventions:[All],inputs:[Struct("u8_8",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112))])],output:None),(name:"u8_struct_in_9",conventions:[All],inputs:[Struct("u8_9",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128))])],output:None),(name:"u8_struct_in_10",conventions:[All],inputs:[Struct("u8_10",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144))])],output:None),(name:"u8_struct_in_11",conventions:[All],inputs:[Struct("u8_11",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160))])],output:None),(name:"u8_struct_in_12",conventions:[All],inputs:[Struct("u8_12",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176))])],output:None),(name:"u8_struct_in_13",conventions:[All],inputs:[Struct("u8_13",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192))])],output:None),(name:"u8_struct_in_14",conventions:[All],inputs:[Struct("u8_14",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208))])],output:None),(name:"u8_struct_in_15",conventions:[All],inputs:[Struct("u8_15",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224))])],output:None),(name:"u8_struct_in_16",conventions:[All],inputs:[Struct("u8_16",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("u8_1",[Int(c_uint8_t(0))]))],output:None),(name:"u8_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("u8_2",[Int(c_uint8_t(0)),Int(c_uint8_t(16))]))],output:None),(name:"u8_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("u8_3",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32))]))],output:None),(name:"u8_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("u8_4",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))]))],output:None),(name:"u8_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("u8_5",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64))]))],output:None),(name:"u8_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("u8_6",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80))]))],output:None),(name:"u8_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("u8_7",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96))]))],output:None),(name:"u8_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("u8_8",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112))]))],output:None),(name:"u8_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("u8_9",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128))]))],output:None),(name:"u8_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("u8_10",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144))]))],output:None),(name:"u8_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("u8_11",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160))]))],output:None),(name:"u8_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("u8_12",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176))]))],output:None),(name:"u8_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("u8_13",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192))]))],output:None),(name:"u8_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("u8_14",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208))]))],output:None),(name:"u8_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("u8_15",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224))]))],output:None),(name:"u8_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("u8_16",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))],output:None),(name:"u8_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))],output:None),(name:"u8_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48))],output:None),(name:"u8_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))],output:None),(name:"u8_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"u8_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))],output:None),(name:"u8_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("u8_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))])],output:None),(name:"u8_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("u8_1_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))])],output:None),(name:"u8_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("u8_2_perturbed_small",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48))])],output:None),(name:"u8_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("u8_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))])],output:None),(name:"u8_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("u8_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"u8_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("u8_1_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("u8_2_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("u8_3_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("u8_4_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("u8_5_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("u8_6_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("u8_7_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("u8_8_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("u8_9_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("u8_10_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("u8_11_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("u8_12_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("u8_13_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("u8_14_perturbed_big",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("u8_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))])],output:None),(name:"u8_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("u8_0_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859))]))],output:None),(name:"u8_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("u8_1_perturbed_small",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48))]))],output:None),(name:"u8_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("u8_2_perturbed_small",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48))]))],output:None),(name:"u8_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("u8_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48))]))],output:None),(name:"u8_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_0_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"u8_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_1_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Float(c_float(-8370480300000000000000)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_2_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Float(c_float(-1810926400000)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_3_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Float(c_float(-389.51367)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_4_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Float(c_float(-0.00000008321092)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_5_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Float(c_float(-0.000000000000000017632526)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_6_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_7_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_8_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_9_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Float(c_float(4175980800000000000000)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_10_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Float(c_float(903307300000)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_11_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Float(c_float(194.25488)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_12_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Float(c_float(0.00000004148859)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_13_perturbed_big",[Int(c_uint8_t(0)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_14_perturbed_big",[Int(c_uint8_t(0)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None),(name:"u8_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("u8_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c_uint8_t(16)),Int(c_uint8_t(32)),Int(c_uint8_t(48)),Int(c_uint8_t(64)),Int(c_uint8_t(80)),Int(c_uint8_t(96)),Int(c_uint8_t(112)),Int(c_uint8_t(128)),Int(c_uint8_t(144)),Int(c_uint8_t(160)),Int(c_uint8_t(176)),Int(c_uint8_t(192)),Int(c_uint8_t(208)),Int(c_uint8_t(224)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file diff --git a/tests/procgen/ui128.ron b/tests/procgen/ui128.ron deleted file mode 100644 index 114838b..0000000 --- a/tests/procgen/ui128.ron +++ /dev/null @@ -1 +0,0 @@ -(name:"ui128",funcs:[(name:"i128_val_in",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320))],output:None),(name:"i128_val_out",conventions:[All],inputs:[],output:Some(Int(c__int128(20011376718272490338853433276725592320)))),(name:"i128_val_in_out",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320))],output:Some(Int(c__int128(41362427191743139026751447860679676176)))),(name:"i128_ref_in",conventions:[All],inputs:[Ref(Int(c__int128(20011376718272490338853433276725592320)))],output:None),(name:"i128_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c__int128(20011376718272490338853433276725592320))))),(name:"i128_ref_in_out",conventions:[All],inputs:[Ref(Int(c__int128(20011376718272490338853433276725592320)))],output:Some(Ref(Int(c__int128(41362427191743139026751447860679676176))))),(name:"i128_val_in_2",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176))],output:None),(name:"i128_val_in_3",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032))],output:None),(name:"i128_val_in_4",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888))],output:None),(name:"i128_val_in_5",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744))],output:None),(name:"i128_val_in_6",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600))],output:None),(name:"i128_val_in_7",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456))],output:None),(name:"i128_val_in_8",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312))],output:None),(name:"i128_val_in_9",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288))],output:None),(name:"i128_val_in_10",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432))],output:None),(name:"i128_val_in_11",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576))],output:None),(name:"i128_val_in_12",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720))],output:None),(name:"i128_val_in_13",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864))],output:None),(name:"i128_val_in_14",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008))],output:None),(name:"i128_val_in_15",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152))],output:None),(name:"i128_val_in_16",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_struct_in_1",conventions:[All],inputs:[Struct("i128_1",[Int(c__int128(20011376718272490338853433276725592320))])],output:None),(name:"i128_struct_in_2",conventions:[All],inputs:[Struct("i128_2",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176))])],output:None),(name:"i128_struct_in_3",conventions:[All],inputs:[Struct("i128_3",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032))])],output:None),(name:"i128_struct_in_4",conventions:[All],inputs:[Struct("i128_4",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888))])],output:None),(name:"i128_struct_in_5",conventions:[All],inputs:[Struct("i128_5",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744))])],output:None),(name:"i128_struct_in_6",conventions:[All],inputs:[Struct("i128_6",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600))])],output:None),(name:"i128_struct_in_7",conventions:[All],inputs:[Struct("i128_7",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456))])],output:None),(name:"i128_struct_in_8",conventions:[All],inputs:[Struct("i128_8",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312))])],output:None),(name:"i128_struct_in_9",conventions:[All],inputs:[Struct("i128_9",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288))])],output:None),(name:"i128_struct_in_10",conventions:[All],inputs:[Struct("i128_10",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432))])],output:None),(name:"i128_struct_in_11",conventions:[All],inputs:[Struct("i128_11",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576))])],output:None),(name:"i128_struct_in_12",conventions:[All],inputs:[Struct("i128_12",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720))])],output:None),(name:"i128_struct_in_13",conventions:[All],inputs:[Struct("i128_13",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864))])],output:None),(name:"i128_struct_in_14",conventions:[All],inputs:[Struct("i128_14",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008))])],output:None),(name:"i128_struct_in_15",conventions:[All],inputs:[Struct("i128_15",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152))])],output:None),(name:"i128_struct_in_16",conventions:[All],inputs:[Struct("i128_16",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("i128_1",[Int(c__int128(20011376718272490338853433276725592320))]))],output:None),(name:"i128_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("i128_2",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176))]))],output:None),(name:"i128_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("i128_3",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032))]))],output:None),(name:"i128_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("i128_4",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888))]))],output:None),(name:"i128_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("i128_5",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744))]))],output:None),(name:"i128_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("i128_6",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600))]))],output:None),(name:"i128_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("i128_7",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456))]))],output:None),(name:"i128_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("i128_8",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312))]))],output:None),(name:"i128_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("i128_9",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288))]))],output:None),(name:"i128_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("i128_10",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432))]))],output:None),(name:"i128_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("i128_11",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576))]))],output:None),(name:"i128_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("i128_12",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720))]))],output:None),(name:"i128_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("i128_13",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864))]))],output:None),(name:"i128_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("i128_14",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008))]))],output:None),(name:"i128_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("i128_15",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152))]))],output:None),(name:"i128_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("i128_16",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))],output:None),(name:"i128_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888))],output:None),(name:"i128_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888))],output:None),(name:"i128_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))],output:None),(name:"i128_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"i128_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Float(c_float(-8370480300000000000000)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Float(c_float(-1810926400000)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Float(c_float(-389.51367)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Float(c_float(-0.00000008321092)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Float(c_float(-0.000000000000000017632526)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c_uint8_t(144)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c_uint8_t(160)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c_uint8_t(176)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c_uint8_t(192)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c_uint8_t(208)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c_uint8_t(224)),Int(c__int128(-5233100606242806050955395731361296))],output:None),(name:"i128_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c_uint8_t(240))],output:None),(name:"i128_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("i128_0_perturbed_small",[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))])],output:None),(name:"i128_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("i128_1_perturbed_small",[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888))])],output:None),(name:"i128_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("i128_2_perturbed_small",[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888))])],output:None),(name:"i128_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("i128_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))])],output:None),(name:"i128_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("i128_0_perturbed_big",[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"i128_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("i128_1_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Float(c_float(-8370480300000000000000)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("i128_2_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Float(c_float(-1810926400000)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("i128_3_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Float(c_float(-389.51367)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("i128_4_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Float(c_float(-0.00000008321092)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("i128_5_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Float(c_float(-0.000000000000000017632526)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("i128_6_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("i128_7_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("i128_8_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("i128_9_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c_uint8_t(144)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("i128_10_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c_uint8_t(160)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("i128_11_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c_uint8_t(176)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("i128_12_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c_uint8_t(192)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("i128_13_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c_uint8_t(208)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("i128_14_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c_uint8_t(224)),Int(c__int128(-5233100606242806050955395731361296))])],output:None),(name:"i128_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("i128_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c_uint8_t(240))])],output:None),(name:"i128_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("i128_0_perturbed_small",[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))]))],output:None),(name:"i128_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("i128_1_perturbed_small",[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888))]))],output:None),(name:"i128_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("i128_2_perturbed_small",[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888))]))],output:None),(name:"i128_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("i128_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))]))],output:None),(name:"i128_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_0_perturbed_big",[Int(c_uint8_t(0)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"i128_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_1_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Float(c_float(-8370480300000000000000)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_2_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Float(c_float(-1810926400000)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_3_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Float(c_float(-389.51367)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_4_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Float(c_float(-0.00000008321092)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_5_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Float(c_float(-0.000000000000000017632526)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_6_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_7_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_8_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_9_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c_uint8_t(144)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_10_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c_uint8_t(160)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_11_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c_uint8_t(176)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_12_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c_uint8_t(192)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_13_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Int(c__int128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c_uint8_t(208)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_14_perturbed_big",[Int(c__int128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c_uint8_t(224)),Int(c__int128(-5233100606242806050955395731361296))]))],output:None),(name:"i128_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("i128_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__int128(41362427191743139026751447860679676176)),Int(c__int128(62713477665213787714649462444633760032)),Int(c__int128(84064528138684436402547477028587843888)),Int(c__int128(105415578612155085090445491612541927744)),Int(c__int128(126766629085625733778343506196496011600)),Int(c__int128(148117679559096382466241520780450095456)),Int(c__int128(169468730032567031154139535364404179312)),Int(c__int128(-149462586414900783621337057483409948288)),Int(c__int128(-128111535941430134933439042899455864432)),Int(c__int128(-106760485467959486245541028315501780576)),Int(c__int128(-85409434994488837557643013731547696720)),Int(c__int128(-64058384521018188869744999147593612864)),Int(c__int128(-42707334047547540181846984563639529008)),Int(c__int128(-21356283574076891493948969979685445152)),Int(c_uint8_t(240))]))],output:None),(name:"u128_val_in",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320))],output:None),(name:"u128_val_out",conventions:[All],inputs:[],output:Some(Int(c__uint128(20011376718272490338853433276725592320)))),(name:"u128_val_in_out",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320))],output:Some(Int(c__uint128(41362427191743139026751447860679676176)))),(name:"u128_ref_in",conventions:[All],inputs:[Ref(Int(c__uint128(20011376718272490338853433276725592320)))],output:None),(name:"u128_ref_out",conventions:[All],inputs:[],output:Some(Ref(Int(c__uint128(20011376718272490338853433276725592320))))),(name:"u128_ref_in_out",conventions:[All],inputs:[Ref(Int(c__uint128(20011376718272490338853433276725592320)))],output:Some(Ref(Int(c__uint128(41362427191743139026751447860679676176))))),(name:"u128_val_in_2",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176))],output:None),(name:"u128_val_in_3",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032))],output:None),(name:"u128_val_in_4",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888))],output:None),(name:"u128_val_in_5",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744))],output:None),(name:"u128_val_in_6",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600))],output:None),(name:"u128_val_in_7",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456))],output:None),(name:"u128_val_in_8",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312))],output:None),(name:"u128_val_in_9",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168))],output:None),(name:"u128_val_in_10",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024))],output:None),(name:"u128_val_in_11",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880))],output:None),(name:"u128_val_in_12",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736))],output:None),(name:"u128_val_in_13",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592))],output:None),(name:"u128_val_in_14",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448))],output:None),(name:"u128_val_in_15",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304))],output:None),(name:"u128_val_in_16",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_struct_in_1",conventions:[All],inputs:[Struct("u128_1",[Int(c__uint128(20011376718272490338853433276725592320))])],output:None),(name:"u128_struct_in_2",conventions:[All],inputs:[Struct("u128_2",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176))])],output:None),(name:"u128_struct_in_3",conventions:[All],inputs:[Struct("u128_3",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032))])],output:None),(name:"u128_struct_in_4",conventions:[All],inputs:[Struct("u128_4",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888))])],output:None),(name:"u128_struct_in_5",conventions:[All],inputs:[Struct("u128_5",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744))])],output:None),(name:"u128_struct_in_6",conventions:[All],inputs:[Struct("u128_6",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600))])],output:None),(name:"u128_struct_in_7",conventions:[All],inputs:[Struct("u128_7",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456))])],output:None),(name:"u128_struct_in_8",conventions:[All],inputs:[Struct("u128_8",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312))])],output:None),(name:"u128_struct_in_9",conventions:[All],inputs:[Struct("u128_9",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168))])],output:None),(name:"u128_struct_in_10",conventions:[All],inputs:[Struct("u128_10",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024))])],output:None),(name:"u128_struct_in_11",conventions:[All],inputs:[Struct("u128_11",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880))])],output:None),(name:"u128_struct_in_12",conventions:[All],inputs:[Struct("u128_12",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736))])],output:None),(name:"u128_struct_in_13",conventions:[All],inputs:[Struct("u128_13",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592))])],output:None),(name:"u128_struct_in_14",conventions:[All],inputs:[Struct("u128_14",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448))])],output:None),(name:"u128_struct_in_15",conventions:[All],inputs:[Struct("u128_15",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304))])],output:None),(name:"u128_struct_in_16",conventions:[All],inputs:[Struct("u128_16",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_ref_struct_in_1",conventions:[All],inputs:[Ref(Struct("u128_1",[Int(c__uint128(20011376718272490338853433276725592320))]))],output:None),(name:"u128_ref_struct_in_2",conventions:[All],inputs:[Ref(Struct("u128_2",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176))]))],output:None),(name:"u128_ref_struct_in_3",conventions:[All],inputs:[Ref(Struct("u128_3",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032))]))],output:None),(name:"u128_ref_struct_in_4",conventions:[All],inputs:[Ref(Struct("u128_4",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888))]))],output:None),(name:"u128_ref_struct_in_5",conventions:[All],inputs:[Ref(Struct("u128_5",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744))]))],output:None),(name:"u128_ref_struct_in_6",conventions:[All],inputs:[Ref(Struct("u128_6",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600))]))],output:None),(name:"u128_ref_struct_in_7",conventions:[All],inputs:[Ref(Struct("u128_7",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456))]))],output:None),(name:"u128_ref_struct_in_8",conventions:[All],inputs:[Ref(Struct("u128_8",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312))]))],output:None),(name:"u128_ref_struct_in_9",conventions:[All],inputs:[Ref(Struct("u128_9",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168))]))],output:None),(name:"u128_ref_struct_in_10",conventions:[All],inputs:[Ref(Struct("u128_10",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024))]))],output:None),(name:"u128_ref_struct_in_11",conventions:[All],inputs:[Ref(Struct("u128_11",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880))]))],output:None),(name:"u128_ref_struct_in_12",conventions:[All],inputs:[Ref(Struct("u128_12",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736))]))],output:None),(name:"u128_ref_struct_in_13",conventions:[All],inputs:[Ref(Struct("u128_13",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592))]))],output:None),(name:"u128_ref_struct_in_14",conventions:[All],inputs:[Ref(Struct("u128_14",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448))]))],output:None),(name:"u128_ref_struct_in_15",conventions:[All],inputs:[Ref(Struct("u128_15",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304))]))],output:None),(name:"u128_ref_struct_in_16",conventions:[All],inputs:[Ref(Struct("u128_16",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_val_in_0_perturbed_small",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))],output:None),(name:"u128_val_in_1_perturbed_small",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888))],output:None),(name:"u128_val_in_2_perturbed_small",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888))],output:None),(name:"u128_val_in_3_perturbed_small",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))],output:None),(name:"u128_val_in_0_perturbed_big",conventions:[All],inputs:[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Float(c_float(-38496183000000000000000000000000))],output:None),(name:"u128_val_in_1_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Float(c_float(-8370480300000000000000)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_2_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Float(c_float(-1810926400000)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_3_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Float(c_float(-389.51367)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_4_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Float(c_float(-0.00000008321092)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_5_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Float(c_float(-0.000000000000000017632526)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_6_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_7_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_8_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_9_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c_uint8_t(144)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_10_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c_uint8_t(160)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_11_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c_uint8_t(176)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_12_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c_uint8_t(192)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_13_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c_uint8_t(208)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_14_perturbed_big",conventions:[All],inputs:[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c_uint8_t(224)),Int(c__uint128(340277133820332220657323652036036850160))],output:None),(name:"u128_val_in_15_perturbed_big",conventions:[All],inputs:[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c_uint8_t(240))],output:None),(name:"u128_struct_in_0_perturbed_small",conventions:[All],inputs:[Struct("u128_0_perturbed_small",[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))])],output:None),(name:"u128_struct_in_1_perturbed_small",conventions:[All],inputs:[Struct("u128_1_perturbed_small",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888))])],output:None),(name:"u128_struct_in_2_perturbed_small",conventions:[All],inputs:[Struct("u128_2_perturbed_small",[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888))])],output:None),(name:"u128_struct_in_3_perturbed_small",conventions:[All],inputs:[Struct("u128_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))])],output:None),(name:"u128_struct_in_0_perturbed_big",conventions:[All],inputs:[Struct("u128_0_perturbed_big",[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Float(c_float(-38496183000000000000000000000000))])],output:None),(name:"u128_struct_in_1_perturbed_big",conventions:[All],inputs:[Struct("u128_1_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Float(c_float(-8370480300000000000000)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_2_perturbed_big",conventions:[All],inputs:[Struct("u128_2_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Float(c_float(-1810926400000)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_3_perturbed_big",conventions:[All],inputs:[Struct("u128_3_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Float(c_float(-389.51367)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_4_perturbed_big",conventions:[All],inputs:[Struct("u128_4_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Float(c_float(-0.00000008321092)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_5_perturbed_big",conventions:[All],inputs:[Struct("u128_5_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Float(c_float(-0.000000000000000017632526)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_6_perturbed_big",conventions:[All],inputs:[Struct("u128_6_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_7_perturbed_big",conventions:[All],inputs:[Struct("u128_7_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_8_perturbed_big",conventions:[All],inputs:[Struct("u128_8_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_9_perturbed_big",conventions:[All],inputs:[Struct("u128_9_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c_uint8_t(144)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_10_perturbed_big",conventions:[All],inputs:[Struct("u128_10_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c_uint8_t(160)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_11_perturbed_big",conventions:[All],inputs:[Struct("u128_11_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c_uint8_t(176)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_12_perturbed_big",conventions:[All],inputs:[Struct("u128_12_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c_uint8_t(192)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_13_perturbed_big",conventions:[All],inputs:[Struct("u128_13_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c_uint8_t(208)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_14_perturbed_big",conventions:[All],inputs:[Struct("u128_14_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c_uint8_t(224)),Int(c__uint128(340277133820332220657323652036036850160))])],output:None),(name:"u128_struct_in_15_perturbed_big",conventions:[All],inputs:[Struct("u128_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c_uint8_t(240))])],output:None),(name:"u128_ref_struct_in_0_perturbed_small",conventions:[All],inputs:[Ref(Struct("u128_0_perturbed_small",[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859))]))],output:None),(name:"u128_ref_struct_in_1_perturbed_small",conventions:[All],inputs:[Ref(Struct("u128_1_perturbed_small",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888))]))],output:None),(name:"u128_ref_struct_in_2_perturbed_small",conventions:[All],inputs:[Ref(Struct("u128_2_perturbed_small",[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888))]))],output:None),(name:"u128_ref_struct_in_3_perturbed_small",conventions:[All],inputs:[Ref(Struct("u128_3_perturbed_small",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48))]))],output:None),(name:"u128_ref_struct_in_0_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_0_perturbed_big",[Int(c_uint8_t(0)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Float(c_float(-38496183000000000000000000000000))]))],output:None),(name:"u128_ref_struct_in_1_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_1_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c_uint8_t(16)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Float(c_float(-8370480300000000000000)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_2_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_2_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c_uint8_t(32)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Float(c_float(-1810926400000)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_3_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_3_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c_uint8_t(48)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Float(c_float(-389.51367)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_4_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_4_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c_uint8_t(64)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Float(c_float(-0.00000008321092)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_5_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_5_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c_uint8_t(80)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Float(c_float(-0.000000000000000017632526)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_6_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_6_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c_uint8_t(96)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Float(c_float(-0.0000000000000000000000000036999117)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_7_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_7_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c_uint8_t(112)),Float(c_float(-0.0000000000000000000000000000000000007670445)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_8_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_8_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Float(c_float(19208323000000000000000000000000)),Int(c_uint8_t(128)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_9_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_9_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Float(c_float(4175980800000000000000)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c_uint8_t(144)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_10_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_10_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Float(c_float(903307300000)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c_uint8_t(160)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_11_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_11_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Float(c_float(194.25488)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c_uint8_t(176)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_12_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_12_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Float(c_float(0.00000004148859)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c_uint8_t(192)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_13_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_13_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Int(c__uint128(41362427191743139026751447860679676176)),Float(c_float(0.000000000000000008789052)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c_uint8_t(208)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_14_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_14_perturbed_big",[Int(c__uint128(20011376718272490338853433276725592320)),Float(c_float(0.0000000000000000000000000018436203)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c_uint8_t(224)),Int(c__uint128(340277133820332220657323652036036850160))]))],output:None),(name:"u128_ref_struct_in_15_perturbed_big",conventions:[All],inputs:[Ref(Struct("u128_15_perturbed_big",[Float(c_float(0.00000000000000000000000000000000000038204714)),Int(c__uint128(41362427191743139026751447860679676176)),Int(c__uint128(62713477665213787714649462444633760032)),Int(c__uint128(84064528138684436402547477028587843888)),Int(c__uint128(105415578612155085090445491612541927744)),Int(c__uint128(126766629085625733778343506196496011600)),Int(c__uint128(148117679559096382466241520780450095456)),Int(c__uint128(169468730032567031154139535364404179312)),Int(c__uint128(190819780506037679842037549948358263168)),Int(c__uint128(212170830979508328529935564532312347024)),Int(c__uint128(233521881452978977217833579116266430880)),Int(c__uint128(254872931926449625905731593700220514736)),Int(c__uint128(276223982399920274593629608284174598592)),Int(c__uint128(297575032873390923281527622868128682448)),Int(c__uint128(318926083346861571969425637452082766304)),Int(c_uint8_t(240))]))],output:None)]) \ No newline at end of file From 56be9a4696688d42b44674a86ccadcab3015a7a4 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sat, 22 Jun 2024 14:22:29 -0400 Subject: [PATCH 23/44] chore: cleanup val api --- src/abis/mod.rs | 38 +++++++++-- src/abis/rust.rs | 166 ++++++++++++++++++++++++--------------------- src/abis/vals.rs | 104 +++++++++++++++++++++++++++- src/harness/mod.rs | 8 ++- 4 files changed, 232 insertions(+), 84 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 7f3bdd1..93dda8a 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -129,9 +129,9 @@ pub struct TestOptions { pub val_writer: WriteImpl, pub val_generator: ValueGeneratorKind, } -impl TestOptions { - fn should_write_arg(&self, func_idx: usize, arg_idx: usize) -> bool { - match &self.functions { +impl FunctionSelector { + pub fn should_write_arg(&self, func_idx: usize, arg_idx: usize) -> bool { + match &self { FunctionSelector::All => true, FunctionSelector::One { idx, args } => { if func_idx != *idx { @@ -139,7 +139,31 @@ impl TestOptions { } else { match args { ArgSelector::All => true, - ArgSelector::One { idx } => arg_idx == *idx, + ArgSelector::One { idx, vals: _ } => arg_idx == *idx, + } + } + } + } + } + pub fn should_write_val(&self, func_idx: usize, arg_idx: usize, val_idx: usize) -> bool { + match &self { + FunctionSelector::All => true, + FunctionSelector::One { idx, args } => { + if func_idx != *idx { + false + } else { + match args { + ArgSelector::All => true, + ArgSelector::One { idx, vals } => { + if arg_idx != *idx { + false + } else { + match vals { + ValSelector::All => true, + ValSelector::One { idx } => val_idx == *idx, + } + } + } } } } @@ -155,6 +179,12 @@ pub enum FunctionSelector { #[derive(Clone, Debug, Serialize)] pub enum ArgSelector { + All, + One { idx: usize, vals: ValSelector }, +} + +#[derive(Clone, Debug, Serialize)] +pub enum ValSelector { All, One { idx: usize }, } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 5871cae..6b5f897 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use camino::Utf8Path; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::PunEnv; -use vals::{ValIter, ValueGenerator}; +use vals::{ArgValuesIter, Value}; use self::error::GenerateError; @@ -82,7 +82,10 @@ impl AbiImpl for RustcAbiImpl { FunctionSelector::All => true, FunctionSelector::One { idx: _, args } => match args { ArgSelector::All => true, - ArgSelector::One { idx: _ } => true, + ArgSelector::One { idx: _, vals } => match vals { + ValSelector::All => true, + ValSelector::One { idx: _ } => true, + }, }, }; @@ -189,22 +192,12 @@ impl RustcAbiImpl { let function = state.types.realize_func(func); // Create vars for all the inputs - let mut arg_idx = 0; + let mut func_vals = state.vals.at_func(func); for arg in &function.inputs { - let vals = &state.vals.funcs[func].args[arg_idx].vals; + let arg_vals: ArgValuesIter = func_vals.next_arg(); // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, vals)?; - self.write_var( - f, - state, - func, - arg_idx, - &arg.name, - arg.ty, - vals, - VAR_CALLER_INPUTS, - )?; - arg_idx += 1; + self.create_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLER_INPUTS)?; } // Call the function @@ -212,18 +205,9 @@ impl RustcAbiImpl { // Report all the outputs for arg in &function.outputs { - let vals = &state.vals.funcs[func].args[arg_idx].vals; - self.write_var( - f, - state, - func, - arg_idx, - &arg.name, - arg.ty, - vals, - VAR_CALLER_OUTPUTS, - )?; - arg_idx += 1; + let arg_vals: ArgValuesIter = func_vals.next_arg(); + + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLER_OUTPUTS)?; } // Report the function is complete @@ -309,38 +293,18 @@ impl RustcAbiImpl { writeln!(f, "unsafe {{")?; f.add_indent(1); // Report the inputs - let mut arg_idx = 0; + let mut func_vals = state.vals.at_func(func); for arg in &function.inputs { - let vals = &state.vals.funcs[func].args[arg_idx].vals; + let arg_vals = func_vals.next_arg(); let arg_name = &arg.name; - self.write_var( - f, - state, - func, - arg_idx, - arg_name, - arg.ty, - vals, - VAR_CALLEE_INPUTS, - )?; - arg_idx += 1; + self.write_var(f, state, arg_name, arg.ty, arg_vals, VAR_CALLEE_INPUTS)?; } // Create outputs and report them for arg in &function.outputs { - let vals = &state.vals.funcs[func].args[arg_idx].vals; - self.create_var(f, state, &arg.name, arg.ty, vals)?; - self.write_var( - f, - state, - func, - arg_idx, - &arg.name, - arg.ty, - vals, - VAR_CALLEE_OUTPUTS, - )?; - arg_idx += 1; + let arg_vals = func_vals.next_arg(); + self.create_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLEE_OUTPUTS)?; } // Report the function is complete @@ -710,7 +674,7 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &TestImpl, ty: TyIdx, - vals: &mut ValIter, + vals: &mut ArgValuesIter, alias: Option<&str>, ref_temp_name: &str, extra_decls: &mut Vec, @@ -718,7 +682,7 @@ impl RustcAbiImpl { match state.types.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx Ty::Primitive(prim) => { - let val = vals.next().expect("internal error: ran out of values!?"); + let val = vals.next_val(); match prim { PrimitiveTy::I8 => write!(f, "{:#X}u8 as i8", val.generate_u8())?, PrimitiveTy::I16 => write!(f, "{:#X}u16 as i16", val.generate_u16())?, @@ -826,7 +790,7 @@ impl RustcAbiImpl { Ty::Union(union_ty) => { let name = alias.unwrap_or(&union_ty.name); write!(f, "{name} {{ ")?; - let tag_val = vals.next().expect("internal error: ran out of values!?"); + let tag_val = vals.next_val(); if let Some(field) = tag_val.select_val(&union_ty.fields) { let field_name = &field.ident; write!(f, "{field_name}: ")?; @@ -845,7 +809,7 @@ impl RustcAbiImpl { } Ty::Enum(enum_ty) => { let name = alias.unwrap_or(&enum_ty.name); - let tag_val = vals.next().expect("internal error: ran out of values!?"); + let tag_val = vals.next_val(); if let Some(variant) = tag_val.select_val(&enum_ty.variants) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; @@ -853,7 +817,7 @@ impl RustcAbiImpl { } Ty::Tagged(tagged_ty) => { let name = alias.unwrap_or(&tagged_ty.name); - let tag_val = vals.next().expect("internal error: ran out of values!?"); + let tag_val = vals.next_val(); if let Some(variant) = tag_val.select_val(&tagged_ty.variants) { let variant_name = &variant.name; write!(f, "{name}::{variant_name}")?; @@ -1002,7 +966,7 @@ impl RustcAbiImpl { state: &TestImpl, var_name: &str, var_ty: TyIdx, - vals: &[ValueGenerator], + mut vals: ArgValuesIter, ) -> Result<(), GenerateError> { // Generate the input let ty_name = &state.tynames[&var_ty]; @@ -1017,7 +981,7 @@ impl RustcAbiImpl { &mut real_var_decl_f, state, var_ty, - &mut vals.iter(), + &mut vals, None, &ref_temp_name, &mut extra_decls, @@ -1038,22 +1002,20 @@ impl RustcAbiImpl { &self, f: &mut Fivemat, state: &TestImpl, - func_idx: usize, - arg_idx: usize, var_name: &str, var_ty: TyIdx, - vals: &[ValueGenerator], + mut vals: ArgValuesIter, to: &str, ) -> Result<(), GenerateError> { // If we're generating a minimized test, skip this - if !state.options.should_write_arg(func_idx, arg_idx) { + if !vals.should_write_arg(&state.options) { return Ok(()); } // If noop, don't bother doing anything (avoids tagged union matches being generated) if let WriteImpl::Noop = state.options.val_writer { return Ok(()); }; - self.write_fields(f, state, to, var_name, var_ty, &mut vals.iter())?; + self.write_fields(f, state, to, var_name, var_ty, &mut vals)?; // If doing full harness callbacks, signal we wrote all the fields of a variable if let WriteImpl::HarnessCallback = state.options.val_writer { @@ -1072,13 +1034,15 @@ impl RustcAbiImpl { to: &str, from: &str, var_ty: TyIdx, - vals: &mut ValIter, + vals: &mut ArgValuesIter, ) -> Result<(), GenerateError> { match state.types.realize_ty(var_ty) { Ty::Primitive(_) | Ty::Enum(_) => { // Hey an actual leaf, report it (and burn a value) - vals.next().expect("internal error: ran out of values!?"); - self.write_leaf_field(f, state, to, from)?; + let val = vals.next_val(); + if val.should_write_val(&state.options) { + self.write_leaf_field(f, state, to, from)?; + } } Ty::Empty => { // nothing worth producing @@ -1109,7 +1073,7 @@ impl RustcAbiImpl { } Ty::Tagged(tagged_ty) => { // Process the implicit "tag" value - let tag_generator = vals.next().expect("internal error: ran out of values!?"); + let tag_generator = vals.next_val(); if let Some(variant) = tag_generator.select_val(&tagged_ty.variants) { let tagged_name = &tagged_ty.name; let variant_name = &variant.name; @@ -1130,22 +1094,24 @@ impl RustcAbiImpl { }; // Generate an if-let writeln!(f, "if let {pat} = &{from} {{")?; + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, &tag_generator)?; + } if let Some(fields) = &variant.fields { - f.add_indent(1); for field in fields { // Do the ugly deref thing to deal with pattern autoref let base = format!("(*{})", field.ident); self.write_fields(f, state, to, &base, field.ty, vals)?; } - f.sub_indent(1); } + f.sub_indent(1); // Add an else case to complain that the variant is wrong writeln!(f, "}} else {{")?; f.add_indent(1); - writeln!( - f, - r#"unreachable!("expected {tagged_name}::{variant_name} for {from}")"# - )?; + if tag_generator.should_write_val(&state.options) { + self.error_tag_field(f, state, to, &tag_generator)?; + } f.sub_indent(1); writeln!(f, "}}")?; } @@ -1157,7 +1123,7 @@ impl RustcAbiImpl { } Ty::Union(union_ty) => { // Process the implicit "tag" value - let tag_generator = vals.next().expect("internal error: ran out of values!?"); + let tag_generator = vals.next_val(); if let Some(field) = tag_generator.select_val(&union_ty.fields) { let field_name = &field.ident; let base = format!("{from}.{field_name}"); @@ -1190,6 +1156,52 @@ impl RustcAbiImpl { Ok(()) } + fn write_tag_field( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + val: &Value, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, &{}u32);", val.generate_u32())?; + } + WriteImpl::Print => { + // Noop, do nothing + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + fn error_tag_field( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + val: &Value, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!( + f, + "write_field({to}, &{}u32);", + val.generate_u32().wrapping_add(1) + )?; + } + WriteImpl::Print => { + unreachable!("enum had unexpected variant!?"); + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + fn end_function( &self, f: &mut dyn Write, diff --git a/src/abis/vals.rs b/src/abis/vals.rs index 7539783..ffae48c 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -3,7 +3,8 @@ use rand::Rng; use rand_core::{RngCore, SeedableRng}; use serde::Serialize; -pub type ValIter<'a> = std::slice::Iter<'a, ValueGenerator>; +use crate::TestOptions; + type RngImpl = rand_pcg::Pcg64; #[derive(Debug, Clone)] @@ -22,6 +23,29 @@ pub struct ArgValues { pub vals: Vec, } +#[derive(Debug, Clone)] +pub struct FuncValuesIter<'a> { + tree: &'a ValueTree, + func_idx: usize, + arg_idx: usize, +} + +#[derive(Debug, Clone)] +pub struct ArgValuesIter<'a> { + tree: &'a ValueTree, + func_idx: usize, + arg_idx: usize, + val_idx: usize, +} + +#[derive(Debug, Clone)] +pub struct Value<'a> { + tree: &'a ValueTree, + func_idx: usize, + arg_idx: usize, + val_idx: usize, +} + #[derive(Debug, Clone)] pub enum ValueGenerator { Graffiti { idx: u64 }, @@ -68,6 +92,84 @@ impl ValueTree { funcs, } } + + #[track_caller] + pub fn at_func(&self, func_idx: usize) -> FuncValuesIter { + assert!( + func_idx < self.funcs.len(), + "internal error: ValueTree func_idx exceeded" + ); + FuncValuesIter { + tree: self, + func_idx, + arg_idx: 0, + } + } +} + +impl<'a> FuncValuesIter<'a> { + #[track_caller] + pub fn next_arg(&mut self) -> ArgValuesIter<'a> { + let Self { + tree, + func_idx, + arg_idx, + } = *self; + assert!( + arg_idx < tree.funcs[func_idx].args.len(), + "internal error: ValueTree arg_idx exceeded" + ); + self.arg_idx += 1; + ArgValuesIter { + tree, + func_idx, + arg_idx, + val_idx: 0, + } + } +} + +impl<'a> ArgValuesIter<'a> { + #[track_caller] + pub fn next_val(&mut self) -> Value<'a> { + let Self { + tree, + func_idx, + arg_idx, + val_idx, + } = *self; + assert!( + val_idx < tree.funcs[func_idx].args[arg_idx].vals.len(), + "internal error: ValueTree val_idx exceeded" + ); + self.val_idx += 1; + Value { + tree, + func_idx, + arg_idx, + val_idx, + } + } + + pub fn should_write_arg(&self, options: &TestOptions) -> bool { + options + .functions + .should_write_arg(self.func_idx, self.arg_idx) + } +} + +impl<'a> Value<'a> { + pub fn should_write_val(&self, options: &TestOptions) -> bool { + options + .functions + .should_write_val(self.func_idx, self.arg_idx, self.val_idx) + } +} +impl<'a> std::ops::Deref for Value<'a> { + type Target = ValueGenerator; + fn deref(&self) -> &Self::Target { + &self.tree.funcs[self.func_idx].args[self.arg_idx].vals[self.val_idx] + } } impl ValueGeneratorKind { diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 2f220d8..94a54d3 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -10,7 +10,7 @@ use std::error::Error; use crate::{ vals::ValueGeneratorKind, ArgSelector, CallSide, FunctionSelector, TestHarness, TestKey, - TestOptions, WriteImpl, + TestOptions, ValSelector, WriteImpl, }; mod build; @@ -55,7 +55,7 @@ impl TestHarness { let func = test.types.realize_func(*idx); output.push_str(separator); output.push_str(&func.name); - if let ArgSelector::One { idx } = args { + if let ArgSelector::One { idx, vals } = args { let arg = func .inputs .iter() @@ -64,6 +64,10 @@ impl TestHarness { .expect("argument index out of bounds"); output.push_str(separator); output.push_str(&arg.name); + if let ValSelector::One { idx } = vals { + output.push_str(separator); + output.push_str(&format!("val{idx}")); + } } } output.push_str(separator); From 6a72c60213fa2df0961520dc349d25010aeebd90 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 23 Jun 2024 17:02:51 -0400 Subject: [PATCH 24/44] chore: rework result checking --- src/abis/mod.rs | 64 ++-------- src/abis/rust.rs | 26 ++-- src/abis/vals.rs | 102 +++++++++++----- src/cli.rs | 4 + src/error.rs | 80 +++++++++--- src/harness/check.rs | 284 ++++++++++++++++++++++++++++++------------- src/harness/read.rs | 18 ++- src/harness/run.rs | 240 +----------------------------------- src/main.rs | 5 +- src/report.rs | 7 -- 10 files changed, 382 insertions(+), 448 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 93dda8a..5314bb9 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -71,53 +71,8 @@ pub struct Test { pub name: String, /// Parsed and Typechecked kdl-script program pub types: Arc, - // TODO: add some kind of ValueSelector type here, so that when faced with the - // question of "what value is this function argument SUPPOSED to have?", - // all implementations of the test (and the checker) can consistently agree. - // - // This is important for 5 reasons: - // - // * most fundamentally: AbiImpls are tasked with essentially implementing - // `#[derive(Display)]` for every type we hand it, but we support handing it - // c-like unions, which require you to "just know" which variant is active. - // - // * still quite importantly: even for tagged unions where we *can* generate - // match statements for them, we need to make some arbitrary decision on which - // variant we should initialize values to. If we need a way to "just know" - // for untagged unions, then we should reuse it for tagged unions. - // (Right now we just always pick the first variant, which is bad for coverage.) - // - // * usefully: this unlocks the test/harness selecting from a suite of value-selection - // strategies, including the ability for the test to require "specific values", - // the "grafitti values" system we default to, and a (seeded) "random fuzzing" mode. - // - // * nice to have: this almost certainly unlocks better error reporting - // - // * nice to have: this theoretically unlocks more extreme test minimization mode, - // where instead of generating full matches when trying to access a value, - // we can generate the equivalent of .unwrap() using if-lets, as the reader - // of a value will "just know" which variant to expect. - // - // Note however that the concept has a fundamental problem around PunTypes: - // if two implementations of the same test can fundamentally disagree on the - // "shape" of a type, it becomes extremely difficult to keep them in sync - // on what the value should be. - // - // As in, I imagine the ValueSelector's job is to basically go - // "on variable 3, field 1, subfield 8: select variant 5". These kinds of - // directions only make sense if every implementation agrees that there's a union - // at that rvalue path. If one implementation has `NewtypeTransparentU32(u32)` and - // the other has u32, such a path would desync, as there's an extra "layer" for - // the NewtypeTransparentU32 user. - // - // I can imagine solutions for that case, but something like `Option<&T>` vs `*T` - // where one has an enum and the other doesn't (and one sometimes doesn't even - // have a FIELD) are... Problematic. - // - // The "good news" is that the increasingly problematic cases are *also* a huge - // fucking problem for even validating that the two tests agreed on the value, - // so I think a ValueSelector API can pretend this isn't a thing and solve the - // easy cases. + /// Values that the test should have + pub vals: Arc, } /// Options for a test @@ -169,6 +124,13 @@ impl FunctionSelector { } } } + + pub fn active_funcs(&self, types: &TypedProgram) -> Vec { + match self { + FunctionSelector::All => types.all_funcs().collect(), + FunctionSelector::One { idx, args: _ } => vec![*idx], + } + } } #[derive(Clone, Debug, Serialize)] @@ -256,7 +218,6 @@ pub struct TestImpl { pub desired_funcs: Vec, pub tynames: HashMap, pub borrowed_tynames: HashMap, - pub vals: ValueTree, } impl std::ops::Deref for TestImpl { type Target = TestForAbi; @@ -317,18 +278,13 @@ impl Test { impl TestForAbi { pub fn with_options(&self, options: TestOptions) -> Result { - let desired_funcs = match &options.functions { - FunctionSelector::All => self.types.all_funcs().collect(), - FunctionSelector::One { idx, args: _ } => vec![*idx], - }; - let vals = ValueTree::new(&self.types, options.val_generator.clone()); + let desired_funcs = options.functions.active_funcs(&self.types); Ok(TestImpl { inner: self.clone(), options, desired_funcs, tynames: Default::default(), borrowed_tynames: Default::default(), - vals, }) } } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 6b5f897..908bc47 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use camino::Utf8Path; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::PunEnv; -use vals::{ArgValuesIter, Value}; +use vals::ArgValuesIter; use self::error::GenerateError; @@ -1074,7 +1074,8 @@ impl RustcAbiImpl { Ty::Tagged(tagged_ty) => { // Process the implicit "tag" value let tag_generator = vals.next_val(); - if let Some(variant) = tag_generator.select_val(&tagged_ty.variants) { + let tag_idx = tag_generator.generate_idx(tagged_ty.variants.len()); + if let Some(variant) = tagged_ty.variants.get(tag_idx) { let tagged_name = &tagged_ty.name; let variant_name = &variant.name; let pat = match &variant.fields { @@ -1096,7 +1097,7 @@ impl RustcAbiImpl { writeln!(f, "if let {pat} = &{from} {{")?; f.add_indent(1); if tag_generator.should_write_val(&state.options) { - self.write_tag_field(f, state, to, &tag_generator)?; + self.write_tag_field(f, state, to, tag_idx)?; } if let Some(fields) = &variant.fields { for field in fields { @@ -1110,7 +1111,7 @@ impl RustcAbiImpl { writeln!(f, "}} else {{")?; f.add_indent(1); if tag_generator.should_write_val(&state.options) { - self.error_tag_field(f, state, to, &tag_generator)?; + self.error_tag_field(f, state, to)?; } f.sub_indent(1); writeln!(f, "}}")?; @@ -1124,7 +1125,11 @@ impl RustcAbiImpl { Ty::Union(union_ty) => { // Process the implicit "tag" value let tag_generator = vals.next_val(); - if let Some(field) = tag_generator.select_val(&union_ty.fields) { + let tag_idx = tag_generator.generate_idx(union_ty.fields.len()); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; + } + if let Some(field) = union_ty.fields.get(tag_idx) { let field_name = &field.ident; let base = format!("{from}.{field_name}"); self.write_fields(f, state, to, &base, field.ty, vals)?; @@ -1161,11 +1166,11 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &TestImpl, to: &str, - val: &Value, + variant_idx: usize, ) -> Result<(), GenerateError> { match state.options.val_writer { WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, &{}u32);", val.generate_u32())?; + writeln!(f, "write_field({to}, &{}u32);", variant_idx)?; } WriteImpl::Print => { // Noop, do nothing @@ -1182,15 +1187,10 @@ impl RustcAbiImpl { f: &mut Fivemat, state: &TestImpl, to: &str, - val: &Value, ) -> Result<(), GenerateError> { match state.options.val_writer { WriteImpl::HarnessCallback => { - writeln!( - f, - "write_field({to}, &{}u32);", - val.generate_u32().wrapping_add(1) - )?; + writeln!(f, "write_field({to}, &{}u32);", u32::MAX)?; } WriteImpl::Print => { unreachable!("enum had unexpected variant!?"); diff --git a/src/abis/vals.rs b/src/abis/vals.rs index ffae48c..3e654cb 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -15,12 +15,16 @@ pub struct ValueTree { #[derive(Debug, Clone)] pub struct FuncValues { + pub func_name: String, pub args: Vec, } #[derive(Debug, Clone)] pub struct ArgValues { - pub vals: Vec, + pub arg_name: String, + pub ty: TyIdx, + pub is_input: bool, + pub vals: Vec, } #[derive(Debug, Clone)] @@ -34,18 +38,25 @@ pub struct FuncValuesIter<'a> { pub struct ArgValuesIter<'a> { tree: &'a ValueTree, func_idx: usize, - arg_idx: usize, + pub arg_idx: usize, val_idx: usize, } #[derive(Debug, Clone)] -pub struct Value<'a> { +pub struct ValueRef<'a> { tree: &'a ValueTree, func_idx: usize, arg_idx: usize, val_idx: usize, } +#[derive(Debug, Clone)] +pub struct Value { + pub val: ValueGenerator, + pub ty: TyIdx, + pub path: String, +} + #[derive(Debug, Clone)] pub enum ValueGenerator { Graffiti { idx: u64 }, @@ -58,7 +69,7 @@ enum ValueGeneratorBuilder { Random { rng: RngImpl }, } -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Copy, Clone, Serialize)] pub enum ValueGeneratorKind { Graffiti, Random { seed: u64 }, @@ -73,17 +84,25 @@ impl ValueTree { .all_funcs() .map(|func_idx| { let func = types.realize_func(func_idx); + let func_name = func.name.to_string(); let args = func .inputs .iter() - .chain(&func.outputs) - .map(|arg| { + .map(|arg| (true, arg)) + .chain(func.outputs.iter().map(|arg| (false, arg))) + .map(|(is_input, arg)| { let mut vals = vec![]; - generators.build_values(types, arg.ty, &mut vals); - ArgValues { vals } + let arg_name = arg.name.to_string(); + generators.build_values(types, arg.ty, &mut vals, arg_name.clone()); + ArgValues { + ty: arg.ty, + arg_name, + is_input, + vals, + } }) .collect(); - FuncValues { args } + FuncValues { func_name, args } }) .collect(); @@ -131,7 +150,7 @@ impl<'a> FuncValuesIter<'a> { impl<'a> ArgValuesIter<'a> { #[track_caller] - pub fn next_val(&mut self) -> Value<'a> { + pub fn next_val(&mut self) -> ValueRef<'a> { let Self { tree, func_idx, @@ -143,7 +162,7 @@ impl<'a> ArgValuesIter<'a> { "internal error: ValueTree val_idx exceeded" ); self.val_idx += 1; - Value { + ValueRef { tree, func_idx, arg_idx, @@ -156,21 +175,31 @@ impl<'a> ArgValuesIter<'a> { .functions .should_write_arg(self.func_idx, self.arg_idx) } + + pub fn arg(&self) -> &'a ArgValues { + &self.tree.funcs[self.func_idx].args[self.arg_idx] + } } -impl<'a> Value<'a> { +impl<'a> ValueRef<'a> { pub fn should_write_val(&self, options: &TestOptions) -> bool { options .functions .should_write_val(self.func_idx, self.arg_idx, self.val_idx) } } -impl<'a> std::ops::Deref for Value<'a> { - type Target = ValueGenerator; +impl<'a> std::ops::Deref for ValueRef<'a> { + type Target = Value; fn deref(&self) -> &Self::Target { &self.tree.funcs[self.func_idx].args[self.arg_idx].vals[self.val_idx] } } +impl<'a> std::ops::Deref for Value { + type Target = ValueGenerator; + fn deref(&self) -> &Self::Target { + &self.val + } +} impl ValueGeneratorKind { fn builder(&self) -> ValueGeneratorBuilder { @@ -188,8 +217,8 @@ impl ValueGeneratorKind { } impl ValueGeneratorBuilder { - fn next(&mut self) -> ValueGenerator { - match self { + fn next(&mut self, ty: TyIdx, path: String) -> Value { + let val = match self { ValueGeneratorBuilder::Graffiti { idx } => { let res = ValueGenerator::Graffiti { idx: *idx }; *idx += 1; @@ -198,55 +227,65 @@ impl ValueGeneratorBuilder { ValueGeneratorBuilder::Random { rng } => ValueGenerator::Random { seed: rng.next_u64(), }, - } + }; + Value { val, ty, path } } fn build_values( &mut self, types: &TypedProgram, ty_idx: TyIdx, - vals: &mut Vec, + vals: &mut Vec, + path: String, ) { let ty = types.realize_ty(ty_idx); match ty { // Primitives and enums just have the one value - Ty::Primitive(_) => vals.push(self.next()), - Ty::Enum(_) => vals.push(self.next()), + Ty::Primitive(_) => vals.push(self.next(ty_idx, path)), + Ty::Enum(_) => vals.push(self.next(ty_idx, path)), // Empty has no values Ty::Empty => {} // Alias and ref are just wrappers - Ty::Alias(ty) => self.build_values(types, ty.real, vals), - Ty::Ref(ty) => self.build_values(types, ty.pointee_ty, vals), + Ty::Alias(ty) => self.build_values(types, ty.real, vals, path), + Ty::Ref(ty) => { + let new_path = format!("{path}.*"); + self.build_values(types, ty.pointee_ty, vals, new_path) + } // Struct and array are just all of their fields combined Ty::Struct(ty) => { for field in &ty.fields { - self.build_values(types, field.ty, vals); + let field_name = &field.ident; + let new_path = format!("{path}.{field_name}"); + self.build_values(types, field.ty, vals, new_path); } } Ty::Array(ty) => { - for _ in 0..ty.len { - self.build_values(types, ty.elem_ty, vals); + for idx in 0..ty.len { + let new_path = format!("{path}[{idx}]"); + self.build_values(types, ty.elem_ty, vals, new_path); } } // Union and Tagged need an implicit "tag" field for selecting the active variant Ty::Union(ty) => { // generate the tag value - let tag_generator = self.next(); + let tag_generator = self.next(ty_idx, path.clone()); let active_variant_idx = tag_generator.generate_idx(ty.fields.len()); vals.push(tag_generator); // now visit the active variant if let Some(field) = ty.fields.get(active_variant_idx) { - self.build_values(types, field.ty, vals); + let field_name = &field.ident; + let new_path = format!("{path}.{field_name}"); + self.build_values(types, field.ty, vals, new_path); } } Ty::Tagged(ty) => { // generate the tag value - let tag_generator = self.next(); + let tag_generator = self.next(ty_idx, path.clone()); let active_variant_idx = tag_generator.generate_idx(ty.variants.len()); vals.push(tag_generator); @@ -255,7 +294,10 @@ impl ValueGeneratorBuilder { if let Some(fields) = &variant.fields { // And all of its fields for field in fields { - self.build_values(types, field.ty, vals); + let variant_name = &variant.name; + let field_name = &field.ident; + let new_path = format!("{path}.{variant_name}.{field_name}"); + self.build_values(types, field.ty, vals, new_path); } } } @@ -274,7 +316,7 @@ impl ValueGeneratorBuilder { // Shove values into a temp buffer instead of the main one let mut new_vals = vec![]; - self.build_values(types, block.real, &mut new_vals); + self.build_values(types, block.real, &mut new_vals, path.clone()); // If there are multiple blocks, check that this new one matches // all the other ones in length (making the pun semantically comprehensible) diff --git a/src/cli.rs b/src/cli.rs index f9a0239..4c9eb3f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,6 +2,7 @@ use crate::{abis::*, Config, OutputFormat}; use clap::Parser; use log::LevelFilter; use simplelog::{ColorChoice, TermLogger, TerminalMode}; +use vals::ValueGeneratorKind; #[derive(Parser)] struct Cli { @@ -83,6 +84,8 @@ pub fn make_app() -> Config { } } + let value_generator = ValueGeneratorKind::Graffiti; + let output_format = config.output_format; TermLogger::init( LevelFilter::Info, @@ -100,5 +103,6 @@ pub fn make_app() -> Config { run_tests, run_pairs, rustc_codegen_backends, + val_generator: value_generator, } } diff --git a/src/error.rs b/src/error.rs index 84977ab..142e072 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,3 @@ -use crate::OUTPUT_NAME; - #[derive(Debug, thiserror::Error)] #[allow(dead_code)] pub enum GenerateError { @@ -53,24 +51,74 @@ pub enum BuildError { #[allow(clippy::enum_variant_names)] #[derive(Debug, thiserror::Error)] pub enum CheckFailure { - #[error("test {0} {5} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}")] - InputFieldMismatch(usize, usize, usize, Vec, Vec, String), + #[error(" {func_name} {arg_kind} count mismatch (expected: {expected_len}, caller: {}, callee: {}) + caller: {caller:#02X?} + callee: {callee:#02X?}", caller.len(), callee.len())] + ArgCountMismatch { + func_idx: usize, + arg_kind: String, + func_name: String, + expected_len: usize, + caller: Vec>>, + callee: Vec>>, + }, + #[error(" {func_name} {arg_kind} {arg_name} value count mismatch (expected: {expected_len}, caller: {}, callee: {}) + caller: {caller:#02X?} + callee: {callee:#02X?}", caller.len(), callee.len())] + ValCountMismatch { + func_idx: usize, + arg_idx: usize, + arg_kind: String, + func_name: String, + arg_name: String, + expected_len: usize, + caller: Vec>, + callee: Vec>, + }, #[error( - "test {0} {} field {2} mismatch \ncaller: {3:02X?} \ncallee: {4:02X?}", - OUTPUT_NAME + " {func_name} {arg_kind} differed: + {arg_kind:<6}: {arg_name}: {arg_ty_name} + field : {val_path}: {val_ty_name} + expect: {expected:02X?} + caller: {caller:02X?} + callee: {callee:02X?}" )] - OutputFieldMismatch(usize, usize, usize, Vec, Vec), - #[error("test {0} {4} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}")] - InputFieldCountMismatch(usize, usize, Vec>, Vec>, String), + ValMismatch { + func_idx: usize, + arg_idx: usize, + val_idx: usize, + func_name: String, + arg_name: String, + arg_kind: String, + arg_ty_name: String, + val_path: String, + val_ty_name: String, + expected: Vec, + caller: Vec, + callee: Vec, + }, #[error( - "test {0} {} field count mismatch \ncaller: {2:#02X?} \ncallee: {3:#02X?}", - OUTPUT_NAME + " {func_name} {arg_kind} had unexpected tagged variant: + {arg_kind:<6}: {arg_name}: {arg_ty_name} + field : {val_path}: {val_ty_name} + expect: {expected} + caller: {caller} + callee: {callee}" )] - OutputFieldCountMismatch(usize, usize, Vec>, Vec>), - #[error("test {0} input count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] - InputCountMismatch(usize, Vec>>, Vec>>), - #[error("test {0} output count mismatch \ncaller: {1:#02X?} \ncallee: {2:#02X?}")] - OutputCountMismatch(usize, Vec>>, Vec>>), + TagMismatch { + func_idx: usize, + arg_idx: usize, + val_idx: usize, + func_name: String, + arg_name: String, + arg_kind: String, + arg_ty_name: String, + val_path: String, + val_ty_name: String, + expected: String, + caller: String, + callee: String, + }, } #[derive(Debug, thiserror::Error)] diff --git a/src/harness/check.rs b/src/harness/check.rs index 60e428a..870e489 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -1,3 +1,6 @@ +use kdl_script::types::Ty; +use vals::ArgValuesIter; + use crate::error::*; use crate::report::*; use crate::*; @@ -7,8 +10,6 @@ impl TestHarness { &self, key: &TestKey, RunOutput { - caller: _, - callee: _, caller_inputs, caller_outputs, callee_inputs, @@ -16,11 +17,7 @@ impl TestHarness { }: &RunOutput, ) -> CheckOutput { let test = self.tests[&key.test].clone(); - let caller_impl = self - .test_with_abi_impl(&test, key.caller.clone()) - .await - .unwrap(); - + let options = &key.options; // Now check the results // Start peeling back the layers of the buffers. @@ -28,37 +25,84 @@ impl TestHarness { let mut results: Vec> = Vec::new(); + // As a basic sanity-check, make sure everything agrees on how + // many tests actually executed. If this fails, then something + // is very fundamentally broken and needs to be fixed. + let expected_funcs = key.options.functions.active_funcs(&test.types); + let expected_test_count = expected_funcs.len(); + if caller_inputs.funcs.len() != expected_test_count + || caller_outputs.funcs.len() != expected_test_count + || callee_inputs.funcs.len() != expected_test_count + || callee_outputs.funcs.len() != expected_test_count + { + Err::<(), _>(RunError::TestCountMismatch( + expected_test_count, + caller_inputs.funcs.len(), + caller_outputs.funcs.len(), + callee_inputs.funcs.len(), + callee_outputs.funcs.len(), + )) + .expect("TODO"); + } + // Layer 1 is the funcs/subtests. Because we have already checked // that they agree on their lengths, we can zip them together // to walk through their views of each subtest's execution. 'funcs: for ( - func_idx, - (((caller_inputs, caller_outputs), callee_inputs), callee_outputs), - ) in caller_inputs - .funcs + (((&func_idx, caller_inputs), caller_outputs), callee_inputs), + callee_outputs, + ) in expected_funcs .iter() + .zip(&caller_inputs.funcs) .zip(&caller_outputs.funcs) .zip(&callee_inputs.funcs) .zip(&callee_outputs.funcs) - .enumerate() { + let func = test.types.realize_func(func_idx); + let func_name = &func.name; + let mut expected_args = test.vals.at_func(func_idx); + let mut expected_inputs = vec![]; + let mut expected_outputs = vec![]; + for _ in &func.inputs { + let arg = expected_args.next_arg(); + if arg.should_write_arg(options) { + expected_inputs.push((arg.arg_idx, arg)); + } + } + for _ in &func.outputs { + let arg = expected_args.next_arg(); + if arg.should_write_arg(options) { + expected_outputs.push((arg.arg_idx, arg)); + } + } + // Now we must enforce that the caller and callee agree on how // many inputs and outputs there were. If this fails that's a // very fundamental issue, and indicative of a bad test generator. - if caller_inputs.len() != callee_inputs.len() { - results.push(Err(CheckFailure::InputCountMismatch( + if caller_inputs.len() != expected_inputs.len() + || callee_inputs.len() != expected_inputs.len() + { + results.push(Err(CheckFailure::ArgCountMismatch { func_idx, - caller_inputs.clone(), - callee_inputs.clone(), - ))); + func_name: func_name.to_string(), + arg_kind: "input".to_string(), + expected_len: expected_inputs.len(), + caller: caller_inputs.clone(), + callee: callee_inputs.clone(), + })); continue 'funcs; } - if caller_outputs.len() != callee_outputs.len() { - results.push(Err(CheckFailure::OutputCountMismatch( + if caller_outputs.len() != expected_outputs.len() + || callee_outputs.len() != expected_outputs.len() + { + results.push(Err(CheckFailure::ArgCountMismatch { func_idx, - caller_outputs.clone(), - callee_outputs.clone(), - ))); + func_name: func_name.to_string(), + arg_kind: "output".to_string(), + expected_len: expected_inputs.len(), + caller: caller_outputs.clone(), + callee: callee_outputs.clone(), + })); continue 'funcs; } @@ -67,73 +111,43 @@ impl TestHarness { // but are separate for the sake of error-reporting quality. // Process Inputs - for (input_idx, (caller_val, callee_val)) in - caller_inputs.iter().zip(callee_inputs).enumerate() + for (((arg_idx, expected_arg), caller_vals), callee_vals) in expected_inputs + .into_iter() + .zip(caller_inputs) + .zip(callee_inputs) { - // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::InputFieldCountMismatch( - func_idx, - input_idx, - caller_val.clone(), - callee_val.clone(), - String::from("todo"), - ))); + if let Err(e) = self.check_vals( + key, + "input", + func_idx, + arg_idx, + expected_arg, + caller_vals, + callee_vals, + ) { + results.push(Err(e)); continue 'funcs; } - - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() - { - if caller_field != callee_field { - results.push(Err(CheckFailure::InputFieldMismatch( - func_idx, - input_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), - String::from("todo"), - ))); - continue 'funcs; - } - } } // Process Outputs - for (output_idx, (caller_val, callee_val)) in - caller_outputs.iter().zip(callee_outputs).enumerate() + for (((arg_idx, expected_arg), caller_vals), callee_vals) in expected_outputs + .into_iter() + .zip(caller_outputs) + .zip(callee_outputs) { - // Now we must enforce that the caller and callee agree on how - // many fields each value had. - if caller_val.len() != callee_val.len() { - results.push(Err(CheckFailure::OutputFieldCountMismatch( - func_idx, - output_idx, - caller_val.clone(), - callee_val.clone(), - ))); + if let Err(e) = self.check_vals( + key, + "output", + func_idx, + arg_idx, + expected_arg, + caller_vals, + callee_vals, + ) { + results.push(Err(e)); continue 'funcs; } - - // Layer 3 is the leaf subfields of the values. - // At this point we just need to assert that they agree on the bytes. - for (field_idx, (caller_field, callee_field)) in - caller_val.iter().zip(callee_val).enumerate() - { - if caller_field != callee_field { - results.push(Err(CheckFailure::OutputFieldMismatch( - func_idx, - output_idx, - field_idx, - caller_field.clone(), - callee_field.clone(), - ))); - continue 'funcs; - } - } } // If we got this far then the test passes @@ -145,12 +159,10 @@ impl TestHarness { // This will be done again after all tests have been run, but it's // useful to keep a version of this near the actual compilation/execution // in case the compilers spit anything interesting to stdout/stderr. - let names = caller_impl + let names = test .types .all_funcs() - .map(|func_id| { - self.full_subtest_name(key, &caller_impl.types.realize_func(func_id).name) - }) + .map(|func_id| self.full_subtest_name(key, &test.types.realize_func(func_id).name)) .collect::>(); let max_name_len = names.iter().fold(0, |max, name| max.max(name.len())); let num_passed = results.iter().filter(|r| r.is_ok()).count(); @@ -181,4 +193,108 @@ impl TestHarness { subtest_checks: results, } } + + fn check_vals( + &self, + key: &TestKey, + arg_kind: &str, + func_idx: usize, + arg_idx: usize, + mut expected_arg: ArgValuesIter, + caller_vals: &Vec>, + callee_vals: &Vec>, + ) -> Result<(), CheckFailure> { + let test = &self.tests[&key.test]; + let types = &test.types; + let options = &key.options; + let func = types.realize_func(func_idx); + + let mut expected_vals = vec![]; + let arg_name = &expected_arg.arg().arg_name; + let arg_ty = expected_arg.arg().ty; + for val_idx in 0..expected_arg.arg().vals.len() { + let val = expected_arg.next_val(); + if val.should_write_val(options) { + expected_vals.push((val_idx, val)) + } + } + // Now we must enforce that the caller and callee agree on how + // many fields each value had. + if caller_vals.len() != expected_vals.len() || callee_vals.len() != expected_vals.len() { + return Err(CheckFailure::ValCountMismatch { + func_idx, + arg_idx, + arg_kind: arg_kind.to_string(), + func_name: func.name.to_string(), + arg_name: arg_name.to_string(), + expected_len: expected_vals.len(), + caller: caller_vals.clone(), + callee: callee_vals.clone(), + }); + } + + // Layer 3 is the leaf subfields of the values. + // At this point we just need to assert that they agree on the bytes. + for (((val_idx, expected_val), caller_val), callee_val) in + expected_vals.into_iter().zip(caller_vals).zip(callee_vals) + { + if let Ty::Tagged(tagged_ty) = types.realize_ty(expected_val.ty) { + let expected_tag = expected_val.generate_idx(tagged_ty.variants.len()); + let caller_tag = + u32::from_ne_bytes(<[u8; 4]>::try_from(&caller_val[..4]).unwrap()) as usize; + let callee_tag = + u32::from_ne_bytes(<[u8; 4]>::try_from(&callee_val[..4]).unwrap()) as usize; + + if caller_tag != expected_tag || callee_tag != expected_tag { + let expected = tagged_ty.variants[expected_tag].name.to_string(); + let caller = tagged_ty + .variants + .get(caller_tag) + .map(|v| v.name.as_str()) + .unwrap_or("") + .to_owned(); + let callee = tagged_ty + .variants + .get(callee_tag) + .map(|v| v.name.as_str()) + .unwrap_or("") + .to_owned(); + return Err(CheckFailure::TagMismatch { + func_idx, + arg_idx, + val_idx, + arg_kind: arg_kind.to_string(), + func_name: func.name.to_string(), + arg_name: arg_name.to_string(), + arg_ty_name: types.format_ty(arg_ty), + val_path: expected_val.path.to_string(), + val_ty_name: types.format_ty(expected_val.ty), + expected, + caller, + callee, + }); + } + } else if caller_val != callee_val { + // Make a buffer with the expected value + let mut expected = vec![0; caller_val.len().max(callee_val.len())]; + expected_val.fill_bytes(&mut expected); + return Err(CheckFailure::ValMismatch { + func_idx, + arg_idx, + val_idx, + arg_kind: arg_kind.to_string(), + func_name: func.name.to_string(), + arg_name: arg_name.to_string(), + arg_ty_name: types.format_ty(arg_ty), + val_path: expected_val.path.to_string(), + val_ty_name: types.format_ty(expected_val.ty), + expected, + caller: caller_val.clone(), + callee: callee_val.clone(), + }); + } + } + + Ok(()) + } } diff --git a/src/harness/read.rs b/src/harness/read.rs index b8bc5dc..ad37f10 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -2,11 +2,16 @@ use std::{ fs::File, io::{BufReader, Read}, path::{Path, PathBuf}, + sync::Arc, }; -use crate::{error::*, Test}; +use crate::{ + error::*, + vals::{ValueGeneratorKind, ValueTree}, + Test, +}; -pub fn read_tests() -> Result, GenerateError> { +pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, GenerateError> { let mut tests = vec![]; let mut dirs = vec![PathBuf::from("tests")]; while let Some(dir) = dirs.pop() { @@ -20,7 +25,7 @@ pub fn read_tests() -> Result, GenerateError> { } // Otherwise, assume it's a test and parse it - let test = match read_test_manifest(&entry.path()) { + let test = match read_test_manifest(&entry.path(), value_generator) { Ok(test) => test, Err(e) => { eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); @@ -37,7 +42,10 @@ pub fn read_tests() -> Result, GenerateError> { } /// Read a test .kdl file -fn read_test_manifest(test_file: &Path) -> Result { +fn read_test_manifest( + test_file: &Path, + value_generator: ValueGeneratorKind, +) -> Result { let file = File::open(test_file)?; let mut reader = BufReader::new(file); let mut input = String::new(); @@ -48,6 +56,7 @@ fn read_test_manifest(test_file: &Path) -> Result { if ext == "kdl" { let mut compiler = kdl_script::Compiler::new(); let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; + let vals = Arc::new(ValueTree::new(&types, value_generator)); Ok(Test { name: test_file .file_stem() @@ -56,6 +65,7 @@ fn read_test_manifest(test_file: &Path) -> Result { .expect("test filename wasn't utf8") .to_owned(), types, + vals, }) } else { Err(GenerateError::Skipped) diff --git a/src/harness/run.rs b/src/harness/run.rs index 63d576a..306b49c 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -1,10 +1,6 @@ //! The runtime actual types and functions that are injected into //! compiled tests. -use std::sync::Arc; - -use kdl_script::types::{Ty, TyIdx}; -use linked_hash_map::LinkedHashMap; use serde::Serialize; use crate::error::*; @@ -17,17 +13,8 @@ impl TestHarness { key: &TestKey, test_dylib: &LinkOutput, ) -> Result { - let test = self.tests[&key.test].clone(); let full_test_name = self.full_test_name(key); - let caller_impl = self - .test_with_abi_impl(&test, key.caller.clone()) - .await - .unwrap(); - let callee_impl = self - .test_with_abi_impl(&test, key.callee.clone()) - .await - .unwrap(); - run_dynamic_test(caller_impl, callee_impl, test_dylib, &full_test_name) + run_dynamic_test(test_dylib, &full_test_name) } } @@ -117,12 +104,7 @@ pub unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut /// Run the test! /// /// See the README for a high-level description of this design. -fn run_dynamic_test( - caller_impl: Arc, - callee_impl: Arc, - test_dylib: &LinkOutput, - full_test_name: &str, -) -> Result { +fn run_dynamic_test(test_dylib: &LinkOutput, full_test_name: &str) -> Result { // Initialize all the buffers the tests will write to let mut caller_inputs = WriteBuffer::new(); let mut caller_outputs = WriteBuffer::new(); @@ -154,228 +136,10 @@ fn run_dynamic_test( callee_outputs.finish_tests(); } - digest_test_run( - caller_impl, - callee_impl, - caller_inputs, - caller_outputs, - callee_inputs, - callee_outputs, - ) -} - -fn digest_test_run( - caller_impl: Arc, - callee_impl: Arc, - caller_inputs: WriteBuffer, - caller_outputs: WriteBuffer, - callee_inputs: WriteBuffer, - callee_outputs: WriteBuffer, -) -> Result { - let mut callee = Functions::new(); - let mut caller = Functions::new(); - - // As a basic sanity-check, make sure everything agrees on how - // many tests actually executed. If this fails, then something - // is very fundamentally broken and needs to be fixed. - let all_func_ids = caller_impl.types.all_funcs().collect::>(); - let expected_test_count = all_func_ids.len(); - if caller_inputs.funcs.len() != expected_test_count - || caller_outputs.funcs.len() != expected_test_count - || callee_inputs.funcs.len() != expected_test_count - || callee_outputs.funcs.len() != expected_test_count - { - return Err(RunError::TestCountMismatch( - expected_test_count, - caller_inputs.funcs.len(), - caller_outputs.funcs.len(), - callee_inputs.funcs.len(), - callee_outputs.funcs.len(), - )); - } - - let empty_func = Vec::new(); - let empty_arg = Vec::new(); - for (func_idx, func_id) in all_func_ids.into_iter().enumerate() { - let func = caller_impl.types.realize_func(func_id); - let caller_func = caller.entry(func.name.clone()).or_default(); - let callee_func = callee.entry(func.name.clone()).or_default(); - for (arg_idx, arg) in func.inputs.iter().enumerate() { - let caller_arg = caller_func.entry(arg.name.clone()).or_default(); - let callee_arg = callee_func.entry(arg.name.clone()).or_default(); - - let caller_arg_bytes = caller_inputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - let callee_arg_bytes = callee_inputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - - add_field( - &callee_impl, - caller_arg_bytes, - caller_arg, - &mut 0, - String::new(), - arg.ty, - ); - add_field( - &callee_impl, - callee_arg_bytes, - callee_arg, - &mut 0, - String::new(), - arg.ty, - ); - } - - for (arg_idx, arg) in func.outputs.iter().enumerate() { - let caller_arg = caller_func.entry(arg.name.clone()).or_default(); - let callee_arg = callee_func.entry(arg.name.clone()).or_default(); - - let caller_output_bytes = caller_outputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - let callee_output_bytes = callee_outputs - .funcs - .get(func_idx) - .unwrap_or(&empty_func) - .get(arg_idx) - .unwrap_or(&empty_arg); - - add_field( - &caller_impl, - caller_output_bytes, - caller_arg, - &mut 0, - String::new(), - arg.ty, - ); - add_field( - &callee_impl, - callee_output_bytes, - callee_arg, - &mut 0, - String::new(), - arg.ty, - ); - } - } - Ok(RunOutput { - callee, - caller, caller_inputs, caller_outputs, callee_inputs, callee_outputs, }) } - -fn format_bytes(input: &[Vec], cur_idx: &mut usize) -> String { - use std::fmt::Write; - - let bytes = input.get(*cur_idx).map(|v| &v[..]).unwrap_or(&[]); - let mut output = String::new(); - let mut looped = false; - for byte in bytes { - if looped { - write!(&mut output, " ").unwrap(); - } - write!(&mut output, "{:02x}", byte).unwrap(); - looped = true; - } - *cur_idx += 1; - output -} - -/// Recursive subroutine of write_var, which builds up rvalue paths and generates -/// appropriate match statements. Actual WRITE calls are done by write_leaf_field. -fn add_field( - test_impl @ TestForAbi { - inner: Test { types: program, .. }, - env, - .. - }: &TestForAbi, - input: &[Vec], - output: &mut LinkedHashMap, - cur_idx: &mut usize, - cur_path: String, - var_ty: TyIdx, -) { - match program.realize_ty(var_ty) { - Ty::Primitive(_) | Ty::Enum(_) => { - // Hey an actual leaf, report it - output.insert(cur_path, format_bytes(input, cur_idx)); - *cur_idx += 1; - } - Ty::Empty => { - // nothing worth producing - } - Ty::Alias(alias_ty) => { - // keep going but with the type changed - add_field(test_impl, input, output, cur_idx, cur_path, alias_ty.real); - } - Ty::Pun(pun) => { - // keep going but with the type changed - let real_ty = program.resolve_pun(pun, env).unwrap(); - add_field(test_impl, input, output, cur_idx, cur_path, real_ty); - } - Ty::Array(array_ty) => { - // recurse into each array index - for i in 0..array_ty.len { - let base = format!("{cur_path}[{i}]"); - add_field(test_impl, input, output, cur_idx, base, array_ty.elem_ty); - } - } - Ty::Struct(struct_ty) => { - // recurse into each field - for field in &struct_ty.fields { - let field_name = &field.ident; - let base = format!("{cur_path}.{field_name}"); - add_field(test_impl, input, output, cur_idx, base, field.ty); - } - } - Ty::Tagged(tagged_ty) => { - // FIXME(variant_select): hardcoded to access variant 0 for now - let idx = 0; - if let Some(variant) = tagged_ty.variants.get(idx) { - if let Some(fields) = &variant.fields { - for field in fields { - add_field( - test_impl, - input, - output, - cur_idx, - field.ident.to_string(), - field.ty, - ); - } - } - } - } - Ty::Ref(ref_ty) => { - // Add a deref, and recurse into the pointee - let base = format!("(*{cur_path})"); - add_field(test_impl, input, output, cur_idx, base, ref_ty.pointee_ty); - } - Ty::Union(union_ty) => { - // FIXME(variant_select): hardcoded to access field 0 for now - let idx = 0; - if let Some(field) = union_ty.fields.get(idx) { - let field_name = &field.ident; - let base = format!("{cur_path}.{field_name}"); - add_field(test_impl, input, output, cur_idx, base, field.ty); - } - } - } -} diff --git a/src/main.rs b/src/main.rs index ce411e5..b227396 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,6 +66,7 @@ pub struct Config { pub run_pairs: Vec<(String, String)>, pub run_tests: Vec, pub rustc_codegen_backends: Vec<(String, String)>, + pub val_generator: ValueGeneratorKind, } #[derive(Debug, thiserror::Error)] @@ -248,7 +249,7 @@ fn main() -> Result<(), Box> { eprintln!("configured ABIs!"); // Grab all the tests - let tests = read_tests()?; + let tests = read_tests(cfg.val_generator)?; harness.set_tests(tests); eprintln!("got tests!"); let harness = Arc::new(harness); @@ -294,7 +295,7 @@ fn main() -> Result<(), Box> { convention: *convention, functions: FunctionSelector::All, val_writer: WriteImpl::HarnessCallback, - val_generator: ValueGeneratorKind::Graffiti, + val_generator: cfg.val_generator, }, }; let rules = harness.get_test_rules(&test_key); diff --git a/src/report.rs b/src/report.rs index f331d18..06e2184 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,6 +1,4 @@ use camino::Utf8PathBuf; -use kdl_script::spanned::Spanned; -use linked_hash_map::LinkedHashMap; use serde::Serialize; use serde_json::json; @@ -115,8 +113,6 @@ impl Serialize for GenerateError { #[derive(Debug, Serialize)] pub struct RunOutput { - pub caller: Functions, - pub callee: Functions, #[serde(skip)] pub caller_inputs: WriteBuffer, #[serde(skip)] @@ -313,9 +309,6 @@ pub struct LinkOutput { pub test_bin: Utf8PathBuf, } -pub type Functions = - LinkedHashMap, LinkedHashMap, LinkedHashMap>>; - #[derive(Debug, Serialize)] pub struct CheckOutput { pub all_passed: bool, From 558edd0e5cb3ef8ab65cd1f3a939c06d9a5b1ab4 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 23 Jun 2024 21:17:08 -0400 Subject: [PATCH 25/44] feat: minimizing outputs --- src/abis/mod.rs | 6 +- src/abis/rust.rs | 207 ++++++++++++++++++++++++++++--------------- src/abis/vals.rs | 2 +- src/harness/check.rs | 28 +++--- src/harness/mod.rs | 6 +- src/harness/run.rs | 36 +++++++- src/main.rs | 95 +++++++++++++++++--- 7 files changed, 272 insertions(+), 108 deletions(-) diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 5314bb9..5ba919b 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -39,8 +39,6 @@ pub static ALL_CONVENTIONS: &[CallingConvention] = &[ // CallingConvention::Aapcs, ]; -pub static OUTPUT_NAME: &str = "output"; - /// A test case, fully abstract. /// /// An abi-cafe Test is essentially a series of function signatures @@ -229,6 +227,7 @@ impl std::ops::Deref for TestImpl { #[derive(Debug, Clone, Serialize, PartialEq, Eq)] pub enum WriteImpl { HarnessCallback, + Assert, Print, Noop, } @@ -258,8 +257,7 @@ pub trait AbiImpl { } impl Test { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - // TODO + pub fn has_convention(&self, _convention: CallingConvention) -> bool { true } pub async fn for_abi( diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 908bc47..50212fd 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use camino::Utf8Path; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::PunEnv; -use vals::ArgValuesIter; +use vals::{ArgValuesIter, Value}; use self::error::GenerateError; @@ -76,6 +76,7 @@ impl AbiImpl for RustcAbiImpl { let supports_writer = match val_writer { WriteImpl::HarnessCallback => true, WriteImpl::Print => true, + WriteImpl::Assert => true, WriteImpl::Noop => true, }; let supports_query = match functions { @@ -451,6 +452,10 @@ impl RustcAbiImpl { ((*tagged_ty.name).clone(), borrowed_tyname) } Ty::Alias(AliasTy { name, real, attrs }) => { + assert!( + attrs.is_empty(), + "don't yet know how to apply attrs to structs" + ); let borrowed_tyname = state .borrowed_tynames .get(real) @@ -557,7 +562,7 @@ impl RustcAbiImpl { // Emit an actual enum decl writeln!(f, "#[repr(C)]")?; - writeln!(f, "#[derive(Copy, Clone)]")?; + writeln!(f, "#[derive(Debug, Copy, Clone, PartialEq)]")?; writeln!(f, "enum {} {{", enum_ty.name)?; f.add_indent(1); for variant in &enum_ty.variants { @@ -669,6 +674,64 @@ impl RustcAbiImpl { Ok(()) } + pub fn generate_leaf_value( + &self, + f: &mut Fivemat, + state: &TestImpl, + ty: TyIdx, + val: &Value, + alias: Option<&str>, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(ty) { + // Primitives are the only "real" values with actual bytes that advance val_idx + Ty::Primitive(prim) => match prim { + PrimitiveTy::I8 => write!(f, "{}i8", val.generate_u8() as i8)?, + PrimitiveTy::I16 => write!(f, "{}i16", val.generate_u16() as i16)?, + PrimitiveTy::I32 => write!(f, "{}i32", val.generate_u32() as i32)?, + PrimitiveTy::I64 => write!(f, "{}i64", val.generate_u64() as i64)?, + PrimitiveTy::I128 => write!(f, "{}i128", val.generate_u128() as i128)?, + PrimitiveTy::U8 => write!(f, "{}u8", val.generate_u8())?, + PrimitiveTy::U16 => write!(f, "{}u16", val.generate_u16())?, + PrimitiveTy::U32 => write!(f, "{}u32", val.generate_u32())?, + PrimitiveTy::U64 => write!(f, "{}u64", val.generate_u64())?, + PrimitiveTy::U128 => write!(f, "{}u128", val.generate_u128())?, + + PrimitiveTy::F32 => write!(f, "f32::from_bits({})", val.generate_u32())?, + PrimitiveTy::F64 => write!(f, "f64::from_bits({})", val.generate_u64())?, + PrimitiveTy::Bool => write!(f, "true")?, + PrimitiveTy::Ptr => { + if true { + write!(f, "{:#X}u64 as *mut ()", val.generate_u64())? + } else { + write!(f, "{:#X}u32 as *mut ()", val.generate_u32())? + } + } + PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( + "rust doesn't have i256".to_owned(), + ))?, + PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( + "rust doesn't have u256".to_owned(), + ))?, + PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( + "rust doesn't have f16".to_owned(), + ))?, + PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( + "rust doesn't have f128".to_owned(), + ))?, + }, + Ty::Enum(enum_ty) => { + let name = alias.unwrap_or(&enum_ty.name); + if let Some(variant) = val.select_val(&enum_ty.variants) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + } + } + _ => unreachable!("only primitives and enums should be passed to generate_leaf_value"), + } + Ok(()) + } + + #[allow(clippy::too_many_arguments)] pub fn generate_value( &self, f: &mut Fivemat, @@ -680,44 +743,10 @@ impl RustcAbiImpl { extra_decls: &mut Vec, ) -> Result<(), GenerateError> { match state.types.realize_ty(ty) { - // Primitives are the only "real" values with actual bytes that advance val_idx - Ty::Primitive(prim) => { + // Primitives and Enums are the only "real" values with actual bytes + Ty::Primitive(_) | Ty::Enum(_) => { let val = vals.next_val(); - match prim { - PrimitiveTy::I8 => write!(f, "{:#X}u8 as i8", val.generate_u8())?, - PrimitiveTy::I16 => write!(f, "{:#X}u16 as i16", val.generate_u16())?, - PrimitiveTy::I32 => write!(f, "{:#X}u32 as i32", val.generate_u32())?, - PrimitiveTy::I64 => write!(f, "{:#X}u64 as i64", val.generate_u64())?, - PrimitiveTy::I128 => write!(f, "{:#X}u128 as i128", val.generate_u128())?, - PrimitiveTy::U8 => write!(f, "{:#X}", val.generate_u8())?, - PrimitiveTy::U16 => write!(f, "{:#X}", val.generate_u16())?, - PrimitiveTy::U32 => write!(f, "{:#X}", val.generate_u32())?, - PrimitiveTy::U64 => write!(f, "{:#X}", val.generate_u64())?, - PrimitiveTy::U128 => write!(f, "{:#X}", val.generate_u128())?, - - PrimitiveTy::F32 => write!(f, "f32::from_bits({:#X})", val.generate_u32())?, - PrimitiveTy::F64 => write!(f, "f64::from_bits({:#X})", val.generate_u64())?, - PrimitiveTy::Bool => write!(f, "true")?, - PrimitiveTy::Ptr => { - if true { - write!(f, "{:#X} as *mut ()", val.generate_u64())? - } else { - write!(f, "{:#X} as *mut ()", val.generate_u32())? - } - } - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( - "rust doesn't have i256".to_owned(), - ))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( - "rust doesn't have u256".to_owned(), - ))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( - "rust doesn't have f16".to_owned(), - ))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( - "rust doesn't have f128".to_owned(), - ))?, - }; + self.generate_leaf_value(f, state, ty, &val, alias)?; } Ty::Empty => { write!(f, "()")?; @@ -730,8 +759,7 @@ impl RustcAbiImpl { // Now do the rest of the recursion on constructing the temporary let mut ref_temp = String::new(); let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); - let ty_name = &state.tynames[pointee_ty]; - write!(&mut ref_temp_f, "let mut {ref_temp_name}: {ty_name} = ")?; + write!(&mut ref_temp_f, "let mut {ref_temp_name} = ")?; let ref_temp_name = format!("{ref_temp_name}_"); self.generate_value( &mut ref_temp_f, @@ -807,14 +835,7 @@ impl RustcAbiImpl { } write!(f, " }}")?; } - Ty::Enum(enum_ty) => { - let name = alias.unwrap_or(&enum_ty.name); - let tag_val = vals.next_val(); - if let Some(variant) = tag_val.select_val(&enum_ty.variants) { - let variant_name = &variant.name; - write!(f, "{name}::{variant_name}")?; - } - } + Ty::Tagged(tagged_ty) => { let name = alias.unwrap_or(&tagged_ty.name); let tag_val = vals.next_val(); @@ -969,13 +990,12 @@ impl RustcAbiImpl { mut vals: ArgValuesIter, ) -> Result<(), GenerateError> { // Generate the input - let ty_name = &state.tynames[&var_ty]; let needs_mut = false; let let_mut = if needs_mut { "let mut" } else { "let" }; let mut real_var_decl = String::new(); let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); let mut extra_decls = Vec::new(); - write!(&mut real_var_decl_f, "{let_mut} {var_name}: {ty_name} = ")?; + write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; let ref_temp_name = format!("{var_name}_"); self.generate_value( &mut real_var_decl_f, @@ -1041,7 +1061,7 @@ impl RustcAbiImpl { // Hey an actual leaf, report it (and burn a value) let val = vals.next_val(); if val.should_write_val(&state.options) { - self.write_leaf_field(f, state, to, from)?; + self.write_leaf_field(f, state, to, from, &val)?; } } Ty::Empty => { @@ -1093,28 +1113,52 @@ impl RustcAbiImpl { format!("{tagged_name}::{variant_name}") } }; - // Generate an if-let - writeln!(f, "if let {pat} = &{from} {{")?; - f.add_indent(1); - if tag_generator.should_write_val(&state.options) { - self.write_tag_field(f, state, to, tag_idx)?; - } - if let Some(fields) = &variant.fields { - for field in fields { - // Do the ugly deref thing to deal with pattern autoref - let base = format!("(*{})", field.ident); - self.write_fields(f, state, to, &base, field.ty, vals)?; + + // We're going to make an if-let for the case we expect, but there might not + // be anything we care about in here (especially with should_write_val) so we + // buffer up if and else branches and then only emit the if-let if one of them + // is non-empty + let if_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; } - } - f.sub_indent(1); + if let Some(fields) = &variant.fields { + for field in fields { + // Do the ugly deref thing to deal with pattern autoref + let base = format!("(*{})", field.ident); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + f.sub_indent(1); + temp_out + }; // Add an else case to complain that the variant is wrong - writeln!(f, "}} else {{")?; - f.add_indent(1); - if tag_generator.should_write_val(&state.options) { - self.error_tag_field(f, state, to)?; + let else_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.error_tag_field(f, state, to)?; + } + f.sub_indent(1); + temp_out + }; + + let if_has_content = !if_branch.trim().is_empty(); + let else_has_content = !else_branch.trim().is_empty(); + if if_has_content || else_has_content { + writeln!(f, "if let {pat} = &{from} {{")?; + write!(f, "{}", if_branch)?; + write!(f, "}}")?; + } + if else_has_content { + writeln!(f, " else {{")?; + write!(f, "{}", else_branch)?; + writeln!(f, "}}")?; } - f.sub_indent(1); - writeln!(f, "}}")?; } } Ty::Ref(ref_ty) => { @@ -1146,10 +1190,21 @@ impl RustcAbiImpl { state: &TestImpl, to: &str, path: &str, + val: &Value, ) -> Result<(), GenerateError> { match state.options.val_writer { WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, &{path});")?; + // Convenience for triggering test failures + if path.contains("abicafepoison") && to.contains(VAR_CALLEE_INPUTS) { + writeln!(f, "write_field({to}, &0x12345678u32);")?; + } else { + writeln!(f, "write_field({to}, &{path});")?; + } + } + WriteImpl::Assert => { + write!(f, "assert_eq!({path}, ")?; + self.generate_leaf_value(f, state, val.ty, val, None)?; + writeln!(f, ");")?; } WriteImpl::Print => { writeln!(f, "println!(\"{{:?}}\", {path});")?; @@ -1172,6 +1227,9 @@ impl RustcAbiImpl { WriteImpl::HarnessCallback => { writeln!(f, "write_field({to}, &{}u32);", variant_idx)?; } + WriteImpl::Assert => { + // Noop, do nothing + } WriteImpl::Print => { // Noop, do nothing } @@ -1192,6 +1250,9 @@ impl RustcAbiImpl { WriteImpl::HarnessCallback => { writeln!(f, "write_field({to}, &{}u32);", u32::MAX)?; } + WriteImpl::Assert => { + unreachable!("enum had unexpected variant!?"); + } WriteImpl::Print => { unreachable!("enum had unexpected variant!?"); } @@ -1213,7 +1274,7 @@ impl RustcAbiImpl { WriteImpl::HarnessCallback => { writeln!(f, "finished_func({inputs}, {outputs});")?; } - WriteImpl::Print | WriteImpl::Noop => { + WriteImpl::Print | WriteImpl::Noop | WriteImpl::Assert => { // Noop } } diff --git a/src/abis/vals.rs b/src/abis/vals.rs index 3e654cb..f761e56 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -194,7 +194,7 @@ impl<'a> std::ops::Deref for ValueRef<'a> { &self.tree.funcs[self.func_idx].args[self.arg_idx].vals[self.val_idx] } } -impl<'a> std::ops::Deref for Value { +impl std::ops::Deref for Value { type Target = ValueGenerator; fn deref(&self) -> &Self::Target { &self.val diff --git a/src/harness/check.rs b/src/harness/check.rs index 870e489..461d1f7 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -25,25 +25,8 @@ impl TestHarness { let mut results: Vec> = Vec::new(); - // As a basic sanity-check, make sure everything agrees on how - // many tests actually executed. If this fails, then something - // is very fundamentally broken and needs to be fixed. + // `Run` already checks that this length is congruent with all the inputs/outputs Vecs let expected_funcs = key.options.functions.active_funcs(&test.types); - let expected_test_count = expected_funcs.len(); - if caller_inputs.funcs.len() != expected_test_count - || caller_outputs.funcs.len() != expected_test_count - || callee_inputs.funcs.len() != expected_test_count - || callee_outputs.funcs.len() != expected_test_count - { - Err::<(), _>(RunError::TestCountMismatch( - expected_test_count, - caller_inputs.funcs.len(), - caller_outputs.funcs.len(), - callee_inputs.funcs.len(), - callee_outputs.funcs.len(), - )) - .expect("TODO"); - } // Layer 1 is the funcs/subtests. Because we have already checked // that they agree on their lengths, we can zip them together @@ -194,6 +177,7 @@ impl TestHarness { } } + #[allow(clippy::too_many_arguments)] fn check_vals( &self, key: &TestKey, @@ -239,6 +223,14 @@ impl TestHarness { expected_vals.into_iter().zip(caller_vals).zip(callee_vals) { if let Ty::Tagged(tagged_ty) = types.realize_ty(expected_val.ty) { + // This value is "fake" and is actually the semantic tag of tagged union. + // In this case showing the bytes doesn't make sense, so show the Variant name + // (although we get bytes here they're the array index into the variant, + // a purely magical value that only makes sense to the harness itself!). + // + // Also we use u32::MAX to represent a poison "i dunno what it is, but it's + // definitely not the One variant we statically expected!", so most of the + // time we're here to print and shrug. let expected_tag = expected_val.generate_idx(tagged_ty.variants.len()); let caller_tag = u32::from_ne_bytes(<[u8; 4]>::try_from(&caller_val[..4]).unwrap()) as usize; diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 94a54d3..91f565b 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -32,7 +32,7 @@ pub fn init_dirs() -> Result> { } impl TestHarness { - fn base_id( + pub fn base_id( &self, TestKey { test, @@ -94,6 +94,10 @@ impl TestHarness { output.push_str(separator); output.push_str("print"); } + WriteImpl::Assert => { + output.push_str(separator); + output.push_str("assert"); + } WriteImpl::Noop => { output.push_str(separator); output.push_str("noop"); diff --git a/src/harness/run.rs b/src/harness/run.rs index 306b49c..db87b83 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -14,7 +14,41 @@ impl TestHarness { test_dylib: &LinkOutput, ) -> Result { let full_test_name = self.full_test_name(key); - run_dynamic_test(test_dylib, &full_test_name) + let output = run_dynamic_test(test_dylib, &full_test_name)?; + self.check_ran_all(key, &output)?; + Ok(output) + } + + fn check_ran_all( + &self, + key: &TestKey, + RunOutput { + caller_inputs, + caller_outputs, + callee_inputs, + callee_outputs, + }: &RunOutput, + ) -> Result<(), RunError> { + let test = &self.tests[&key.test]; + // As a basic sanity-check, make sure everything agrees on how + // many tests actually executed. If this fails, then something + // is very fundamentally broken and needs to be fixed. + let expected_funcs = key.options.functions.active_funcs(&test.types); + let expected_test_count = expected_funcs.len(); + if caller_inputs.funcs.len() != expected_test_count + || caller_outputs.funcs.len() != expected_test_count + || callee_inputs.funcs.len() != expected_test_count + || callee_outputs.funcs.len() != expected_test_count + { + return Err(RunError::TestCountMismatch( + expected_test_count, + caller_inputs.funcs.len(), + caller_outputs.funcs.len(), + callee_inputs.funcs.len(), + callee_outputs.funcs.len(), + )); + } + Ok(()) } } diff --git a/src/main.rs b/src/main.rs index b227396..50be1a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ mod procgen; mod report; use abis::*; -use camino::Utf8PathBuf; +use camino::{Utf8Path, Utf8PathBuf}; use error::*; use harness::*; use report::*; @@ -134,6 +134,18 @@ impl TestHarness { get_test_rules(test_key, &*caller, &*callee) } + + pub fn spawn_test( + self: Arc, + rt: &tokio::runtime::Runtime, + rules: TestRules, + test_key: TestKey, + out_dir: Utf8PathBuf, + ) -> tokio::task::JoinHandle { + let harness = self.clone(); + rt.spawn(async move { harness.do_test(test_key, rules, out_dir).await }) + } + /// Generate, Compile, Link, Load, and Run this test. pub async fn do_test( &self, @@ -299,16 +311,13 @@ fn main() -> Result<(), Box> { }, }; let rules = harness.get_test_rules(&test_key); + let task = harness.clone().spawn_test( + &rt, + rules.clone(), + test_key.clone(), + out_dir.clone(), + ); - let task = { - let runner = harness.clone(); - let rules = rules.clone(); - let test_key = test_key.clone(); - let out_dir = out_dir.clone(); - rt.spawn( - async move { runner.do_test(test_key, rules, out_dir).await }, - ) - }; // FIXME: we can make everything parallel by immediately returning // and making the following code happen in subsequent pass. For now // let's stay single-threaded to do things one step at a time. @@ -363,7 +372,73 @@ fn main() -> Result<(), Box> { } if full_report.failed() { + do_thing(&harness, &rt, &out_dir, &full_report); Err(TestsFailed {})?; } Ok(()) } + +fn do_thing( + harness: &Arc, + rt: &tokio::runtime::Runtime, + out_dir: &Utf8Path, + reports: &FullReport, +) { + eprintln!("rerunning failures"); + for report in &reports.tests { + let Some(check) = report.results.check.as_ref() else { + continue; + }; + for func_result in &check.subtest_checks { + let Err(failure) = func_result else { + continue; + }; + let functions = match *failure { + CheckFailure::ArgCountMismatch { func_idx, .. } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::All, + }, + CheckFailure::ValCountMismatch { + func_idx, arg_idx, .. + } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::One { + idx: arg_idx, + vals: ValSelector::All, + }, + }, + CheckFailure::ValMismatch { + func_idx, + arg_idx, + val_idx, + .. + } + | CheckFailure::TagMismatch { + func_idx, + arg_idx, + val_idx, + .. + } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::One { + idx: arg_idx, + vals: ValSelector::One { idx: val_idx }, + }, + }, + }; + + let mut test_key = report.key.clone(); + test_key.options.functions = functions; + test_key.options.val_writer = WriteImpl::Print; + let rules = report.rules.clone(); + eprintln!("rerunning {}", harness.base_id(&test_key, None, "::")); + let task = harness + .clone() + .spawn_test(rt, rules, test_key, out_dir.to_owned()); + let results = rt.block_on(task).expect("failed to join task"); + let source = results.source.unwrap().unwrap(); + eprintln!(" caller: {}", source.caller_src); + eprintln!(" callee: {}", source.callee_src); + } + } +} From 878101c1a4fc907797d677629a1b0e1a83b5f04d Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 23 Jun 2024 21:23:05 -0400 Subject: [PATCH 26/44] chore: conveniences --- src/abis/rust.rs | 48 +++++------------------------------------------- src/abis/vals.rs | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 50212fd..4344c12 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -685,11 +685,11 @@ impl RustcAbiImpl { match state.types.realize_ty(ty) { // Primitives are the only "real" values with actual bytes that advance val_idx Ty::Primitive(prim) => match prim { - PrimitiveTy::I8 => write!(f, "{}i8", val.generate_u8() as i8)?, - PrimitiveTy::I16 => write!(f, "{}i16", val.generate_u16() as i16)?, - PrimitiveTy::I32 => write!(f, "{}i32", val.generate_u32() as i32)?, - PrimitiveTy::I64 => write!(f, "{}i64", val.generate_u64() as i64)?, - PrimitiveTy::I128 => write!(f, "{}i128", val.generate_u128() as i128)?, + PrimitiveTy::I8 => write!(f, "{}i8", val.generate_i8())?, + PrimitiveTy::I16 => write!(f, "{}i16", val.generate_i16())?, + PrimitiveTy::I32 => write!(f, "{}i32", val.generate_i32())?, + PrimitiveTy::I64 => write!(f, "{}i64", val.generate_i64())?, + PrimitiveTy::I128 => write!(f, "{}i128", val.generate_i128())?, PrimitiveTy::U8 => write!(f, "{}u8", val.generate_u8())?, PrimitiveTy::U16 => write!(f, "{}u16", val.generate_u16())?, PrimitiveTy::U32 => write!(f, "{}u32", val.generate_u32())?, @@ -1304,41 +1304,3 @@ impl RustcAbiImpl { Ok(()) } } - -/* -old impl for emitting a full match, which is now replaced with if-let. -Maybe we'll want this again? - -// generate a wrapper match, then recurse into each field of each variant -writeln!(f, "match &{from} {{")?; -f.add_indent(1); -let tagged_name = &tagged_ty.name; -// Process the implicit "tag" value -let tag_val = vals.next().expect("internal error: ran out of values!?"); -for variant in &tagged_ty.variants { - let variant_name = &variant.name; - match &variant.fields { - Some(fields) => { - // Variant with fields, recurse into them - let field_list = fields - .iter() - .map(|f| f.ident.to_string()) - .collect::>() - .join(", "); - writeln!(f, "{tagged_name}::{variant_name} {{ {field_list} }} => {{")?; - f.add_indent(1); - for field in fields { - self.write_fields(f, state, to, &field.ident, field.ty, vals)?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - } - None => { - // Variant without fields, need to include branch for exhaustiveness - writeln!(f, "{tagged_name}::{variant_name} => {{ }}")?; - } - } -} -f.sub_indent(1); -writeln!(f, "}}")?; -*/ diff --git a/src/abis/vals.rs b/src/abis/vals.rs index f761e56..ca7c71a 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -404,4 +404,19 @@ impl ValueGenerator { self.fill_bytes(&mut buf); u128::from_le_bytes(buf) } + pub fn generate_i8(&self) -> i8 { + self.generate_u8() as i8 + } + pub fn generate_i16(&self) -> i16 { + self.generate_u16() as i16 + } + pub fn generate_i32(&self) -> i32 { + self.generate_u32() as i32 + } + pub fn generate_i64(&self) -> i64 { + self.generate_u64() as i64 + } + pub fn generate_i128(&self) -> i128 { + self.generate_u128() as i128 + } } From 99eb60c22be7c31e25140a7c6e6a9fd9598b5b5d Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 24 Jun 2024 00:02:06 -0400 Subject: [PATCH 27/44] feat: reorg procgen --- src/harness/mod.rs | 8 +- src/harness/read.rs | 54 +- src/main.rs | 2 +- src/procgen.rs | 57 +- tests/kdl/test.kdl.tmp | 211 --- tests/{kdl => normal}/types.kdl | 0 tests/{normal => old}/by_ref.ron | 0 tests/{normal => old}/opaque_example.ron | 30 +- tests/{normal => old}/structs.ron | 276 +-- tests/{normal => old}/sysv_i128_emulation.ron | 166 +- tests/procgen/bool.kdl | 1490 ----------------- tests/procgen/f32.kdl | 1490 ----------------- tests/procgen/f64.kdl | 1490 ----------------- tests/procgen/i128.kdl | 1490 ----------------- tests/procgen/i16.kdl | 1490 ----------------- tests/procgen/i32.kdl | 1490 ----------------- tests/procgen/i64.kdl | 1490 ----------------- tests/procgen/i8.kdl | 1490 ----------------- tests/procgen/ptr.kdl | 1490 ----------------- tests/procgen/u128.kdl | 1490 ----------------- tests/procgen/u16.kdl | 1490 ----------------- tests/procgen/u32.kdl | 1490 ----------------- tests/procgen/u64.kdl | 1490 ----------------- tests/procgen/u8.kdl | 1490 ----------------- tests/procgen_in/bool.procgen.kdl | 0 tests/procgen_in/f32.procgen.kdl | 0 tests/procgen_in/f64.procgen.kdl | 0 tests/procgen_in/i128.procgen.kdl | 0 tests/procgen_in/i16.procgen.kdl | 0 tests/procgen_in/i32.procgen.kdl | 0 tests/procgen_in/i64.procgen.kdl | 0 tests/procgen_in/i8.procgen.kdl | 0 tests/procgen_in/ptr.procgen.kdl | 0 tests/procgen_in/u128.procgen.kdl | 0 tests/procgen_in/u16.procgen.kdl | 0 tests/procgen_in/u32.procgen.kdl | 0 tests/procgen_in/u64.procgen.kdl | 0 tests/procgen_in/u8.procgen.kdl | 0 38 files changed, 306 insertions(+), 21358 deletions(-) delete mode 100644 tests/kdl/test.kdl.tmp rename tests/{kdl => normal}/types.kdl (100%) rename tests/{normal => old}/by_ref.ron (100%) rename tests/{normal => old}/opaque_example.ron (96%) rename tests/{normal => old}/structs.ron (97%) rename tests/{normal => old}/sysv_i128_emulation.ron (95%) delete mode 100644 tests/procgen/bool.kdl delete mode 100644 tests/procgen/f32.kdl delete mode 100644 tests/procgen/f64.kdl delete mode 100644 tests/procgen/i128.kdl delete mode 100644 tests/procgen/i16.kdl delete mode 100644 tests/procgen/i32.kdl delete mode 100644 tests/procgen/i64.kdl delete mode 100644 tests/procgen/i8.kdl delete mode 100644 tests/procgen/ptr.kdl delete mode 100644 tests/procgen/u128.kdl delete mode 100644 tests/procgen/u16.kdl delete mode 100644 tests/procgen/u32.kdl delete mode 100644 tests/procgen/u64.kdl delete mode 100644 tests/procgen/u8.kdl create mode 100644 tests/procgen_in/bool.procgen.kdl create mode 100644 tests/procgen_in/f32.procgen.kdl create mode 100644 tests/procgen_in/f64.procgen.kdl create mode 100644 tests/procgen_in/i128.procgen.kdl create mode 100644 tests/procgen_in/i16.procgen.kdl create mode 100644 tests/procgen_in/i32.procgen.kdl create mode 100644 tests/procgen_in/i64.procgen.kdl create mode 100644 tests/procgen_in/i8.procgen.kdl create mode 100644 tests/procgen_in/ptr.procgen.kdl create mode 100644 tests/procgen_in/u128.procgen.kdl create mode 100644 tests/procgen_in/u16.procgen.kdl create mode 100644 tests/procgen_in/u32.procgen.kdl create mode 100644 tests/procgen_in/u64.procgen.kdl create mode 100644 tests/procgen_in/u8.procgen.kdl diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 91f565b..ba9663b 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -56,14 +56,8 @@ impl TestHarness { output.push_str(separator); output.push_str(&func.name); if let ArgSelector::One { idx, vals } = args { - let arg = func - .inputs - .iter() - .chain(&func.outputs) - .nth(*idx) - .expect("argument index out of bounds"); output.push_str(separator); - output.push_str(&arg.name); + output.push_str(&format!("arg{idx}")); if let ValSelector::One { idx } = vals { output.push_str(separator); output.push_str(&format!("val{idx}")); diff --git a/src/harness/read.rs b/src/harness/read.rs index ad37f10..60b1a98 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -25,7 +25,7 @@ pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, Gene } // Otherwise, assume it's a test and parse it - let test = match read_test_manifest(&entry.path(), value_generator) { + let test = match read_test_manifest(entry.path().to_owned(), value_generator) { Ok(test) => test, Err(e) => { eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); @@ -43,31 +43,37 @@ pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, Gene /// Read a test .kdl file fn read_test_manifest( - test_file: &Path, + test_file: PathBuf, value_generator: ValueGeneratorKind, ) -> Result { - let file = File::open(test_file)?; + let (input, test_name) = if let Some(test_name) = filename(&test_file).strip_suffix(".procgen.kdl") { + let ty_def = read_file_to_string(&test_file)?; + let input = crate::procgen::procgen_test_for_ty_string(test_name, Some(&ty_def)); + (input, test_name) + } else if let Some(test_name) = filename(&test_file).strip_suffix(".kdl") { + let input = read_file_to_string(&test_file)?; + (input, test_name) + } else { + return Err(GenerateError::Skipped); + }; + let mut compiler = kdl_script::Compiler::new(); + let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; + let vals = Arc::new(ValueTree::new(&types, value_generator)); + Ok(Test { + name: test_name.to_owned(), + types, + vals, + }) +} + +fn filename(file: &Path) -> &str { + file.file_name().and_then(|s| s.to_str()).unwrap_or("") +} + +fn read_file_to_string(file: &Path) -> std::io::Result { + let file = File::open(file)?; let mut reader = BufReader::new(file); let mut input = String::new(); reader.read_to_string(&mut input)?; - - let ext = test_file.extension().and_then(|s| s.to_str()).unwrap_or(""); - - if ext == "kdl" { - let mut compiler = kdl_script::Compiler::new(); - let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; - let vals = Arc::new(ValueTree::new(&types, value_generator)); - Ok(Test { - name: test_file - .file_stem() - .expect("test had no filename") - .to_str() - .expect("test filename wasn't utf8") - .to_owned(), - types, - vals, - }) - } else { - Err(GenerateError::Skipped) - } -} + Ok(input) +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 50be1a0..1083b8a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -224,7 +224,7 @@ fn main() -> Result<(), Box> { let cfg = cli::make_app(); eprintln!("parsed cli!"); // Before doing anything, regenerate the procgen tests, if needed. - procgen::procgen_tests(cfg.procgen_tests); + // procgen::procgen_tests(cfg.procgen_tests); eprintln!("generated tests!"); let out_dir = init_dirs()?; diff --git a/src/procgen.rs b/src/procgen.rs index 363fef9..fa8e572 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -1,5 +1,7 @@ use std::io::Write; use std::path::PathBuf; +/* +const PROCGEN_ROOT: &str = "tests/procgen"; /// For tests that are too tedious to even hand-write the .ron file, /// this code generates it programmatically. @@ -12,7 +14,7 @@ pub fn procgen_tests(regenerate: bool) { return; } - let proc_gen_root = PathBuf::from("tests/procgen"); + let proc_gen_root = PathBuf::from(PROCGEN_ROOT); // Make sure the path exists, then delete its contents, then recreate the empty dir. std::fs::create_dir_all(&proc_gen_root).unwrap(); @@ -25,17 +27,34 @@ pub fn procgen_tests(regenerate: bool) { ]; for test_name in tests { - let mut test_body = String::new(); + procgen_test_for_ty_file(test_name, test_name, None); + } +} - procgen_test_for_ty(&mut test_body, test_name, None).unwrap(); +pub fn procgen_test_for_ty_file( + test_name: &str, + ty_name: &str, + ty_def: Option<&str>, +) -> PathBuf { + let test_body = procgen_test_for_ty_string(ty_name, ty_def); + let proc_gen_root = PathBuf::from(PROCGEN_ROOT); + let filepath = proc_gen_root.join(format!("{test_name}.kdl")); + let mut file = std::fs::File::create(&filepath).unwrap(); + file.write_all(test_body.as_bytes()).unwrap(); + filepath +} +*/ - let mut file = - std::fs::File::create(proc_gen_root.join(format!("{test_name}.kdl"))).unwrap(); - file.write_all(test_body.as_bytes()).unwrap(); - } +pub fn procgen_test_for_ty_string( + ty_name: &str, + ty_def: Option<&str>, +) -> String { + let mut test_body = String::new(); + procgen_test_for_ty_impl(&mut test_body, ty_name, ty_def).unwrap(); + test_body } -fn procgen_test_for_ty( +fn procgen_test_for_ty_impl( out: &mut dyn std::fmt::Write, ty_name: &str, ty_def: Option<&str>, @@ -47,18 +66,18 @@ fn procgen_test_for_ty( } // Start gentle with basic one value in/out tests - add_func(out, &format!("{ty_name}_val_in"), &[ty], &[])?; - add_func(out, &format!("{ty_name}_val_out"), &[], &[ty])?; - add_func(out, &format!("{ty_name}_val_in_out"), &[ty], &[ty])?; - add_func(out, &format!("{ty_name}_ref_in"), &[&ty_ref], &[])?; - // add_func(out, &format!("{ty_name}_ref_out"), &[], &[&ty_ref])?; - // add_func(out, &format!("{ty_name}_ref_in_out"), &[&ty_ref], &[&ty_ref])?; + add_func(out, "val_in", &[ty], &[])?; + add_func(out, "val_out", &[], &[ty])?; + add_func(out, "val_in_out", &[ty], &[ty])?; + add_func(out, "ref_in", &[&ty_ref], &[])?; + // add_func(out, "ref_out", &[], &[&ty_ref])?; + // add_func(out, "ref_in_out", &[&ty_ref], &[&ty_ref])?; // Stress out the calling convention and try lots of different // input counts. For many types this will result in register // exhaustion and get some things passed on the stack. for len in 2..=16 { - add_func(out, &format!("{ty_name}_val_in_{len}"), &vec![ty; len], &[])?; + add_func(out, &format!("val_in_{len}"), &vec![ty; len], &[])?; } // Stress out the calling convention with a struct full of values. @@ -98,11 +117,11 @@ fn add_structs(out: &mut dyn std::fmt::Write, ty: &str) -> std::fmt::Result { writeln!(out, r#"}}"#)?; // Check that by-val works - add_func(out, &format!("{ty}_struct_in_{len}"), &[&struct_ty], &[])?; + add_func(out, &format!("struct_in_{len}"), &[&struct_ty], &[])?; // Check that by-ref works, for good measure add_func( out, - &format!("{ty}_ref_struct_in_{len}"), + &format!("ref_struct_in_{len}"), &[&struct_ty_ref], &[], )?; @@ -120,7 +139,7 @@ fn add_perturbs( let inputs = perturb_list(ty, count, idx); add_func( out, - &format!("{ty}_val_in_{idx}_perturbed_{label}"), + &format!("val_in_{idx}_perturbed_{label}"), &inputs, &[], )?; @@ -150,7 +169,7 @@ fn add_perturbs_struct( // Add the function add_func( out, - &format!("{ty}_val_in_{idx}_perturbed_{label}"), + &format!("val_in_{idx}_perturbed_{label}"), &[&struct_ty], &[], )?; diff --git a/tests/kdl/test.kdl.tmp b/tests/kdl/test.kdl.tmp deleted file mode 100644 index 38c6d70..0000000 --- a/tests/kdl/test.kdl.tmp +++ /dev/null @@ -1,211 +0,0 @@ -// Experimental sketches of specifying abi-checker tests with kdl. -// See: https://github.com/Gankra/abi-checker -// -// Basically we generate source code for different languages (c, rust, ...) -// from these abstract type/function definitions and then have them call eachother -// and check that the values didn't get corrupted along the way. - - -// Custom type definitions we want to pass across the ABI/convention of interest. -// -// By default type definitions/attributes are intended to be language agnostic. -// AbiImpl Backends (rustc, cc, cxx, swiftc, ...) is responsible for lowering the -// agnostic definition to its own concepts (or say "I don't support this"). -// -// e.g. u32 => uint32_t for the cc/cxx backends, Uint32 in swiftc -// -// The agnostic form is often psuedo-rust because it has good type names/syntax. -// Because we're interested in FFI, type definitions default to #[repr(C)]. -// Backends may support an opt-out for this like `attr lang="rust" #[repr(rust)]` -types { - MyStruct { - // Backends should emit a packed attribute for this struct - @packed - /-garbage "wow" - struct { - x "u32" - y "u8" - z "i16" - } - /-more-garbage x="y" { - "garbage!!" - bad - } - } - - MyGenericStruct "" { - @packed - struct { - x "T" - y "U" - z "OtherGeneric" - } - } - - // typedef my_u32 = u32 - MyU32 { - alias "u32" - } - - // Here we demonstrate ability to specify different lowerings for different - // languages. In this case a transparent newtype in rust, a simple typedef in C. - // - // Both "attr" and "decl" can be prefixed with either lang="$LANG" or "impl=$COMPILER" - // to specify that they only apply in certain cases. The exact merging/fallback behaviour - // is tbd. - // - // Example langs: "rust", "c", "c++" - // Example impls: "rustc", "cc", "gcc", "g++", .. - // - // 💭 Possible lang families?: "~c" (c, c++, obj-c, ...) - U64Meters { - @ lang="rust" "#[repr(transparent)]" - struct lang="rust" { - // Fields can be named `_`, implying they should be position or autonamed - // In the case of rust, this could lower to a tuple struct. - _ "u64" - } - - alias lang="c" "u64" - } - - // Typical union - MyUnion { - union { - x "u32" - y "u8" - } - } - - // C-style enum - MyEnum { - // You can specify that the tag should have a specific backing type - // which lowers to things like `#[repr(u8)]` or `enum class my_enum: uint8_t` - @tag "u8" - enum { - x - y - z - } - } - - // Rust-style tagged union - // - // As previously stated, this will default to `#[repr(C)]` in rust, which is the - // "obvious" externally-tagged layout with a c-enum-sized tag as defined in - // https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md - // - // This is the worst layout, the better one is `#[repr(rust)]` + `#[repr(u8)]` - // (also spec'd in RFC, internally tagged). - MyTaggedUnion { - tagged { - x - y "bool" - } - } - - // A struct with a trailing empty array - MyTrailingStruct { - struct { - // decls can reference other decls (backend's problem to handle ordering) - header "Header" - // Rust array syntax, can nest, can reference types - buf "[u64; 0]" - } - } - - Header { - struct { - len "usize" - cap "usize" - is_magic "bool" - } - } - -} - - - - -// Function decls, which are the actual tests that will run. -// -// We will, for each AbiImpl x AbiImpl x CallingConvention: -// -// * generate the callee and caller with the two AbiImpls and spec'd CallingConvention (fastcall::rustc_calls_cc) -// * compile them to static libs -// * link them into a harness dll/exe that calls each of the callers, which calls its paired callee -// * have each side report the bytes of each arg/subfield -// * compare the two reports for equality -funcs { - // A function that passes a u32 and my_struct (defined in `types`) by-value. - // - // By default functions are assumed valid for all conventions/impls/langs. - // - // By default values will be "byte grafitti", containing the logical field and byte index. - // The high nibble contains the field index, the low nibble the byte index. For instance, - // In the following decl we will have: - // - // ``` - // a = 0x00_01_02_03 - // b = MyStruct { - // x = 0x10_11_12_13 - // y = 0x20 - // z = 0x30_31 - // } - // ``` - // - // When ABI mismatches do happen, we will dump the offending bytes, and this tagging - // scheme makes it easier to identify where different bytes came from in the caller. - // (What this looks like for things with forbidden values is TBD but presumably we'll - // do some kind of modulo cycling through the vals.) - // - // outs are return values, passed back by the callee. - simple { - args { - a "u32" - b "MyStruct" - } - outs { - _ "bool" - } - } - - // Varargs can be declared by having an arg with the name "..." - // Arguments that follow "..." are not part of the declared interface, - // but will be passed by the caller and expected by the callee. - varargs { - args { - _ "u8" - _ "bool" - "..." - _ "u32" - } - } - - // Explicit values can be provided if desired - explicit_vals { - conventions "c" "fastcall" - args { - _ "u8" 0x69 - b "MyUnion" { - x 12 - } - } - } - - // Args and outputs can be made "by reference", which means they will be - // passed as a pointer, but the pointee is the logical value that will be - // checked. This is in contrast to the builtin "ptr" value which is treated like spicy usize. - // - // Return values that are by-ref will be lowered to out-params. - by_ref { - args { - _ "&MyEnum" - _ "&MyEnum" - } - outs { - _ "&bool" - _ "u32" - } - } -} \ No newline at end of file diff --git a/tests/kdl/types.kdl b/tests/normal/types.kdl similarity index 100% rename from tests/kdl/types.kdl rename to tests/normal/types.kdl diff --git a/tests/normal/by_ref.ron b/tests/old/by_ref.ron similarity index 100% rename from tests/normal/by_ref.ron rename to tests/old/by_ref.ron diff --git a/tests/normal/opaque_example.ron b/tests/old/opaque_example.ron similarity index 96% rename from tests/normal/opaque_example.ron rename to tests/old/opaque_example.ron index d0b2364..d1f24a1 100644 --- a/tests/normal/opaque_example.ron +++ b/tests/old/opaque_example.ron @@ -1,15 +1,15 @@ -Test( - name: "opaque_example", - funcs: [ - ( - name: "i_am_opaque_to_the_test_harness", - conventions: [Handwritten], - // NOTE: inputs + outputs totally ignored with Handwritten, - // test can do whatever the fuck it wants as long as it - // consistently uses FINISH_VAL to dynamically - // report the inputs/outputs to the harness. - inputs: [], - output: None, - ) - ] -) +Test( + name: "opaque_example", + funcs: [ + ( + name: "i_am_opaque_to_the_test_harness", + conventions: [Handwritten], + // NOTE: inputs + outputs totally ignored with Handwritten, + // test can do whatever the fuck it wants as long as it + // consistently uses FINISH_VAL to dynamically + // report the inputs/outputs to the harness. + inputs: [], + output: None, + ) + ] +) diff --git a/tests/normal/structs.ron b/tests/old/structs.ron similarity index 97% rename from tests/normal/structs.ron rename to tests/old/structs.ron index 8272a74..e21d51a 100644 --- a/tests/normal/structs.ron +++ b/tests/old/structs.ron @@ -1,139 +1,139 @@ -Test( - name: "structs", - funcs: [ - ( - name: "pass_one", - conventions: [All], - inputs: [Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])], - output: None, - ), - ( - name: "return_one", - conventions: [All], - inputs: [], - output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), - ), - ( - name: "both_one", - conventions: [All], - inputs: [Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))])], - output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), - ), - ( - name: "same_def", - conventions: [All], - inputs: [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))]), - ], - output: None, - ), - ( - name: "diff_def", - conventions: [All], - inputs: [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(123.43)), Int(c_uint16_t(0x5678))]), - ], - output: None, - ), - ( - name: "nested", - conventions: [All], - inputs: [ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(2312.123)), Int(c_uint16_t(0x5678))]), - ]) - ], - output: Some( - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xe3)), Float(c_double(5789.16))]), - Struct("MyStruct2", [Float(c_float(12.01)), Int(c_uint16_t(0x3e2f))]), - ]) - ), - ), - ( - name: "arrayed", - conventions: [All], - inputs: [Struct("MyArray", [Array([ - Int(c_uint32_t(0xe13e_362f)), - Int(c_uint32_t(0xaf34_5e1a)), - Int(c_uint32_t(0xb230_e178)), - Int(c_uint32_t(0xa2e4_16ef)), - Int(c_uint32_t(0x1401_540e)), - Int(c_uint32_t(0x3912_7423)), - Int(c_uint32_t(0xf131_3972)), - ])])], - output: Some( - Struct("MyArray2", [Array([ - Int(c_uint8_t(0xae)), - Int(c_uint8_t(0xbc)), - Int(c_uint8_t(0x21)), - Int(c_uint8_t(0x3f)), - Int(c_uint8_t(0x00)), - Int(c_uint8_t(0x12)), - Int(c_uint8_t(0xfe)), - ])]) - ), - ), - ( - name: "multi_dimensional_arrayed", - conventions: [All], - inputs: [Struct("MyArray3", [Array([ - Array([Int(c_uint32_t(0xe13e_362f)), Int(c_uint32_t(0xaf34_5e1a))]), - Array([Int(c_uint32_t(0xb230_e178)), Int(c_uint32_t(0xa2e4_16ef))]), - Array([Int(c_uint32_t(0x1401_540e)), Int(c_uint32_t(0x3912_7423))]), - ])])], - output: Some( - Struct("MyArray4", [Array([ - Array([Int(c_uint8_t(0xae)), Int(c_uint8_t(0xbc))]), - Array([Int(c_uint8_t(0x21)), Int(c_uint8_t(0x3f))]), - Array([Int(c_uint8_t(0x00)), Int(c_uint8_t(0x12))]), - ])]) - ), - ), - ( - name: "complex_arrayed", - conventions: [All], - inputs: [Struct("MyComplexArrayed", [ - Int(c_uint8_t(0xaf)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x5678))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(91.00001))]), - Struct("MyStruct2", [Float(c_float(3.245)), Int(c_uint16_t(0x1234))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(23.459))]), - Struct("MyStruct2", [Float(c_float(0.1234)), Int(c_uint16_t(0xaef3))]), - ]), - ]), - Int(c_uint64_t(0x3ae1_2345_2a01_318b)), - ])], - output: Some( - Struct("MyComplexArrayed", [ - Int(c_uint8_t(0x13)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xa2)), Float(c_double(12.83123432))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x8672))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x1f)), Float(c_double(1234589))]), - Struct("MyStruct2", [Float(c_float(133.346)), Int(c_uint16_t(0x9224))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x49)), Float(c_double(123823.4597))]), - Struct("MyStruct2", [Float(c_float(0.01338)), Int(c_uint16_t(0x12f4))]), - ]), - ]), - Int(c_uint64_t(0x12e1_4395_7a08_a131)), - ]) - ) - ), - ] +Test( + name: "structs", + funcs: [ + ( + name: "pass_one", + conventions: [All], + inputs: [Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])], + output: None, + ), + ( + name: "return_one", + conventions: [All], + inputs: [], + output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), + ), + ( + name: "both_one", + conventions: [All], + inputs: [Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))])], + output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), + ), + ( + name: "same_def", + conventions: [All], + inputs: [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), + Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))]), + ], + output: None, + ), + ( + name: "diff_def", + conventions: [All], + inputs: [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), + Struct("MyStruct2", [Float(c_float(123.43)), Int(c_uint16_t(0x5678))]), + ], + output: None, + ), + ( + name: "nested", + conventions: [All], + inputs: [ + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), + Struct("MyStruct2", [Float(c_float(2312.123)), Int(c_uint16_t(0x5678))]), + ]) + ], + output: Some( + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xe3)), Float(c_double(5789.16))]), + Struct("MyStruct2", [Float(c_float(12.01)), Int(c_uint16_t(0x3e2f))]), + ]) + ), + ), + ( + name: "arrayed", + conventions: [All], + inputs: [Struct("MyArray", [Array([ + Int(c_uint32_t(0xe13e_362f)), + Int(c_uint32_t(0xaf34_5e1a)), + Int(c_uint32_t(0xb230_e178)), + Int(c_uint32_t(0xa2e4_16ef)), + Int(c_uint32_t(0x1401_540e)), + Int(c_uint32_t(0x3912_7423)), + Int(c_uint32_t(0xf131_3972)), + ])])], + output: Some( + Struct("MyArray2", [Array([ + Int(c_uint8_t(0xae)), + Int(c_uint8_t(0xbc)), + Int(c_uint8_t(0x21)), + Int(c_uint8_t(0x3f)), + Int(c_uint8_t(0x00)), + Int(c_uint8_t(0x12)), + Int(c_uint8_t(0xfe)), + ])]) + ), + ), + ( + name: "multi_dimensional_arrayed", + conventions: [All], + inputs: [Struct("MyArray3", [Array([ + Array([Int(c_uint32_t(0xe13e_362f)), Int(c_uint32_t(0xaf34_5e1a))]), + Array([Int(c_uint32_t(0xb230_e178)), Int(c_uint32_t(0xa2e4_16ef))]), + Array([Int(c_uint32_t(0x1401_540e)), Int(c_uint32_t(0x3912_7423))]), + ])])], + output: Some( + Struct("MyArray4", [Array([ + Array([Int(c_uint8_t(0xae)), Int(c_uint8_t(0xbc))]), + Array([Int(c_uint8_t(0x21)), Int(c_uint8_t(0x3f))]), + Array([Int(c_uint8_t(0x00)), Int(c_uint8_t(0x12))]), + ])]) + ), + ), + ( + name: "complex_arrayed", + conventions: [All], + inputs: [Struct("MyComplexArrayed", [ + Int(c_uint8_t(0xaf)), + Array([ + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), + Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x5678))]), + ]), + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(91.00001))]), + Struct("MyStruct2", [Float(c_float(3.245)), Int(c_uint16_t(0x1234))]), + ]), + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(23.459))]), + Struct("MyStruct2", [Float(c_float(0.1234)), Int(c_uint16_t(0xaef3))]), + ]), + ]), + Int(c_uint64_t(0x3ae1_2345_2a01_318b)), + ])], + output: Some( + Struct("MyComplexArrayed", [ + Int(c_uint8_t(0x13)), + Array([ + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0xa2)), Float(c_double(12.83123432))]), + Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x8672))]), + ]), + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0x1f)), Float(c_double(1234589))]), + Struct("MyStruct2", [Float(c_float(133.346)), Int(c_uint16_t(0x9224))]), + ]), + Struct("MyComplex", [ + Struct("MyStruct", [Int(c_uint8_t(0x49)), Float(c_double(123823.4597))]), + Struct("MyStruct2", [Float(c_float(0.01338)), Int(c_uint16_t(0x12f4))]), + ]), + ]), + Int(c_uint64_t(0x12e1_4395_7a08_a131)), + ]) + ) + ), + ] ) \ No newline at end of file diff --git a/tests/normal/sysv_i128_emulation.ron b/tests/old/sysv_i128_emulation.ron similarity index 95% rename from tests/normal/sysv_i128_emulation.ron rename to tests/old/sysv_i128_emulation.ron index 2e15b83..a413ccf 100644 --- a/tests/normal/sysv_i128_emulation.ron +++ b/tests/old/sysv_i128_emulation.ron @@ -1,83 +1,83 @@ -Test( - name: "sysv_i128_emulation", - funcs: [ - ( - name: "callee_native_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "callee_emulated_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "callee_unaligned_emulated_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "native_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "native_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "native_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "emulated_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "emulated_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "emulated_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "unaligned_emulated_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "unaligned_emulated_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "unaligned_emulated_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ] -) +Test( + name: "sysv_i128_emulation", + funcs: [ + ( + name: "callee_native_layout", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "callee_emulated_layout", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "callee_unaligned_emulated_layout", + conventions: [Handwritten], + inputs: [], + output: None, + ), + + + ( + name: "native_to_native", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "native_to_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "native_to_unaligned_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + + + ( + name: "emulated_to_native", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "emulated_to_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "emulated_to_unaligned_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + + + ( + name: "unaligned_emulated_to_native", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "unaligned_emulated_to_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ( + name: "unaligned_emulated_to_unaligned_emulated", + conventions: [Handwritten], + inputs: [], + output: None, + ), + ] +) diff --git a/tests/procgen/bool.kdl b/tests/procgen/bool.kdl deleted file mode 100644 index 688a2f2..0000000 --- a/tests/procgen/bool.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "bool_val_in" { - inputs { - arg0 "bool" - } - outputs { - } -} -fn "bool_val_out" { - inputs { - } - outputs { - arg0 "bool" - } -} -fn "bool_val_in_out" { - inputs { - arg0 "bool" - } - outputs { - arg0 "bool" - } -} -fn "bool_ref_in" { - inputs { - arg0 "&bool" - } - outputs { - } -} -fn "bool_val_in_2" { - inputs { - arg0 "bool" - arg1 "bool" - } - outputs { - } -} -fn "bool_val_in_3" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - } - outputs { - } -} -fn "bool_val_in_4" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - } - outputs { - } -} -fn "bool_val_in_5" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - } - outputs { - } -} -fn "bool_val_in_6" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - } - outputs { - } -} -fn "bool_val_in_7" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - } - outputs { - } -} -fn "bool_val_in_8" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - } - outputs { - } -} -fn "bool_val_in_9" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - } - outputs { - } -} -fn "bool_val_in_10" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - } - outputs { - } -} -fn "bool_val_in_11" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - } - outputs { - } -} -fn "bool_val_in_12" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - } - outputs { - } -} -fn "bool_val_in_13" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - } - outputs { - } -} -fn "bool_val_in_14" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - } - outputs { - } -} -fn "bool_val_in_15" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - } - outputs { - } -} -fn "bool_val_in_16" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -struct "Many1" { - f0 "bool" -} -fn "bool_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "bool_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "bool" - f1 "bool" -} -fn "bool_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "bool_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "bool" - f1 "bool" - f2 "bool" -} -fn "bool_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "bool_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" -} -fn "bool_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "bool_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" -} -fn "bool_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "bool_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" -} -fn "bool_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "bool_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" -} -fn "bool_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "bool_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" -} -fn "bool_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "bool_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" -} -fn "bool_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "bool_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" -} -fn "bool_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "bool_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" -} -fn "bool_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "bool_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" -} -fn "bool_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "bool_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" -} -fn "bool_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "bool_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" -} -fn "bool_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "bool_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" -} -fn "bool_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "bool_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "bool_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "bool_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "bool" - arg2 "bool" - arg3 "f32" - } - outputs { - } -} -fn "bool_val_in_1_perturbed_small" { - inputs { - arg0 "bool" - arg1 "u8" - arg2 "f32" - arg3 "bool" - } - outputs { - } -} -fn "bool_val_in_2_perturbed_small" { - inputs { - arg0 "bool" - arg1 "f32" - arg2 "u8" - arg3 "bool" - } - outputs { - } -} -fn "bool_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "bool" - arg2 "bool" - arg3 "u8" - } - outputs { - } -} -fn "bool_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "f32" - } - outputs { - } -} -fn "bool_val_in_1_perturbed_big" { - inputs { - arg0 "bool" - arg1 "u8" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "f32" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_2_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "u8" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "f32" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_3_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "u8" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "f32" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_4_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "u8" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "f32" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_5_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "u8" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "f32" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_6_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "u8" - arg7 "bool" - arg8 "bool" - arg9 "f32" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_7_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "u8" - arg8 "f32" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_8_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "f32" - arg8 "u8" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_9_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "f32" - arg7 "bool" - arg8 "bool" - arg9 "u8" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_10_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "f32" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "u8" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_11_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "f32" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "u8" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_12_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "bool" - arg3 "f32" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "u8" - arg13 "bool" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_13_perturbed_big" { - inputs { - arg0 "bool" - arg1 "bool" - arg2 "f32" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "u8" - arg14 "bool" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_14_perturbed_big" { - inputs { - arg0 "bool" - arg1 "f32" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "u8" - arg15 "bool" - } - outputs { - } -} -fn "bool_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "bool" - arg2 "bool" - arg3 "bool" - arg4 "bool" - arg5 "bool" - arg6 "bool" - arg7 "bool" - arg8 "bool" - arg9 "bool" - arg10 "bool" - arg11 "bool" - arg12 "bool" - arg13 "bool" - arg14 "bool" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "bool" - f2 "bool" - f3 "f32" -} -fn "bool_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "bool" - f1 "u8" - f2 "f32" - f3 "bool" -} -fn "bool_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "bool" - f1 "f32" - f2 "u8" - f3 "bool" -} -fn "bool_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "bool" - f2 "bool" - f3 "u8" -} -fn "bool_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "f32" -} -fn "bool_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "bool" - f1 "u8" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "f32" - f15 "bool" -} -fn "bool_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "bool" - f1 "bool" - f2 "u8" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "f32" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "u8" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "f32" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "u8" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "f32" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "u8" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "f32" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "u8" - f7 "bool" - f8 "bool" - f9 "f32" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "u8" - f8 "f32" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "f32" - f8 "u8" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "f32" - f7 "bool" - f8 "bool" - f9 "u8" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "f32" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "u8" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "f32" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "u8" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "bool" - f1 "bool" - f2 "bool" - f3 "f32" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "u8" - f13 "bool" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "bool" - f1 "bool" - f2 "f32" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "u8" - f14 "bool" - f15 "bool" -} -fn "bool_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "bool" - f1 "f32" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "u8" - f15 "bool" -} -fn "bool_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "bool" - f2 "bool" - f3 "bool" - f4 "bool" - f5 "bool" - f6 "bool" - f7 "bool" - f8 "bool" - f9 "bool" - f10 "bool" - f11 "bool" - f12 "bool" - f13 "bool" - f14 "bool" - f15 "u8" -} -fn "bool_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/f32.kdl b/tests/procgen/f32.kdl deleted file mode 100644 index ed62058..0000000 --- a/tests/procgen/f32.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "f32_val_in" { - inputs { - arg0 "f32" - } - outputs { - } -} -fn "f32_val_out" { - inputs { - } - outputs { - arg0 "f32" - } -} -fn "f32_val_in_out" { - inputs { - arg0 "f32" - } - outputs { - arg0 "f32" - } -} -fn "f32_ref_in" { - inputs { - arg0 "&f32" - } - outputs { - } -} -fn "f32_val_in_2" { - inputs { - arg0 "f32" - arg1 "f32" - } - outputs { - } -} -fn "f32_val_in_3" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - } - outputs { - } -} -fn "f32_val_in_4" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - } - outputs { - } -} -fn "f32_val_in_5" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - } - outputs { - } -} -fn "f32_val_in_6" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - } - outputs { - } -} -fn "f32_val_in_7" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - } - outputs { - } -} -fn "f32_val_in_8" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - } - outputs { - } -} -fn "f32_val_in_9" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - } - outputs { - } -} -fn "f32_val_in_10" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - } - outputs { - } -} -fn "f32_val_in_11" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - } - outputs { - } -} -fn "f32_val_in_12" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - } - outputs { - } -} -fn "f32_val_in_13" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - } - outputs { - } -} -fn "f32_val_in_14" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - } - outputs { - } -} -fn "f32_val_in_15" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - } - outputs { - } -} -fn "f32_val_in_16" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -struct "Many1" { - f0 "f32" -} -fn "f32_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "f32_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "f32" - f1 "f32" -} -fn "f32_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "f32_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "f32" - f1 "f32" - f2 "f32" -} -fn "f32_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "f32_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" -} -fn "f32_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "f32_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" -} -fn "f32_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "f32_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" -} -fn "f32_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "f32_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" -} -fn "f32_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "f32_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" -} -fn "f32_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "f32_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" -} -fn "f32_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "f32_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" -} -fn "f32_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "f32_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" -} -fn "f32_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "f32_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" -} -fn "f32_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "f32_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" -} -fn "f32_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "f32_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" -} -fn "f32_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "f32_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" -} -fn "f32_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "f32_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "f32_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "f32_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "f32" - arg2 "f32" - arg3 "f32" - } - outputs { - } -} -fn "f32_val_in_1_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u8" - arg2 "f32" - arg3 "f32" - } - outputs { - } -} -fn "f32_val_in_2_perturbed_small" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "u8" - arg3 "f32" - } - outputs { - } -} -fn "f32_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "u8" - } - outputs { - } -} -fn "f32_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_1_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u8" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_2_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "u8" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_3_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "u8" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_4_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "u8" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_5_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "u8" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_6_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "u8" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_7_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "u8" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_8_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "u8" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_9_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "u8" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_10_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "u8" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_11_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "u8" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_12_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "u8" - arg13 "f32" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_13_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "u8" - arg14 "f32" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_14_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "u8" - arg15 "f32" - } - outputs { - } -} -fn "f32_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f32" - arg2 "f32" - arg3 "f32" - arg4 "f32" - arg5 "f32" - arg6 "f32" - arg7 "f32" - arg8 "f32" - arg9 "f32" - arg10 "f32" - arg11 "f32" - arg12 "f32" - arg13 "f32" - arg14 "f32" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "f32" - f2 "f32" - f3 "f32" -} -fn "f32_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "f32" - f1 "u8" - f2 "f32" - f3 "f32" -} -fn "f32_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "f32" - f1 "f32" - f2 "u8" - f3 "f32" -} -fn "f32_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "u8" -} -fn "f32_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "f32" - f1 "u8" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "f32" - f1 "f32" - f2 "u8" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "u8" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "u8" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "u8" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "u8" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "u8" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "u8" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "u8" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "u8" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "u8" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "u8" - f13 "f32" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "u8" - f14 "f32" - f15 "f32" -} -fn "f32_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "u8" - f15 "f32" -} -fn "f32_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "f32" - f2 "f32" - f3 "f32" - f4 "f32" - f5 "f32" - f6 "f32" - f7 "f32" - f8 "f32" - f9 "f32" - f10 "f32" - f11 "f32" - f12 "f32" - f13 "f32" - f14 "f32" - f15 "u8" -} -fn "f32_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/f64.kdl b/tests/procgen/f64.kdl deleted file mode 100644 index a5a243e..0000000 --- a/tests/procgen/f64.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "f64_val_in" { - inputs { - arg0 "f64" - } - outputs { - } -} -fn "f64_val_out" { - inputs { - } - outputs { - arg0 "f64" - } -} -fn "f64_val_in_out" { - inputs { - arg0 "f64" - } - outputs { - arg0 "f64" - } -} -fn "f64_ref_in" { - inputs { - arg0 "&f64" - } - outputs { - } -} -fn "f64_val_in_2" { - inputs { - arg0 "f64" - arg1 "f64" - } - outputs { - } -} -fn "f64_val_in_3" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - } - outputs { - } -} -fn "f64_val_in_4" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - } - outputs { - } -} -fn "f64_val_in_5" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - } - outputs { - } -} -fn "f64_val_in_6" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - } - outputs { - } -} -fn "f64_val_in_7" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - } - outputs { - } -} -fn "f64_val_in_8" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - } - outputs { - } -} -fn "f64_val_in_9" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - } - outputs { - } -} -fn "f64_val_in_10" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - } - outputs { - } -} -fn "f64_val_in_11" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - } - outputs { - } -} -fn "f64_val_in_12" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - } - outputs { - } -} -fn "f64_val_in_13" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - } - outputs { - } -} -fn "f64_val_in_14" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - } - outputs { - } -} -fn "f64_val_in_15" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - } - outputs { - } -} -fn "f64_val_in_16" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -struct "Many1" { - f0 "f64" -} -fn "f64_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "f64_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "f64" - f1 "f64" -} -fn "f64_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "f64_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "f64" - f1 "f64" - f2 "f64" -} -fn "f64_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "f64_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" -} -fn "f64_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "f64_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" -} -fn "f64_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "f64_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" -} -fn "f64_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "f64_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" -} -fn "f64_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "f64_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" -} -fn "f64_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "f64_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" -} -fn "f64_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "f64_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" -} -fn "f64_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "f64_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" -} -fn "f64_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "f64_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" -} -fn "f64_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "f64_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" -} -fn "f64_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "f64_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" -} -fn "f64_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "f64_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" -} -fn "f64_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "f64_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "f64_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "f64_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "f64" - arg2 "f64" - arg3 "f32" - } - outputs { - } -} -fn "f64_val_in_1_perturbed_small" { - inputs { - arg0 "f64" - arg1 "u8" - arg2 "f32" - arg3 "f64" - } - outputs { - } -} -fn "f64_val_in_2_perturbed_small" { - inputs { - arg0 "f64" - arg1 "f32" - arg2 "u8" - arg3 "f64" - } - outputs { - } -} -fn "f64_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "f64" - arg2 "f64" - arg3 "u8" - } - outputs { - } -} -fn "f64_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f32" - } - outputs { - } -} -fn "f64_val_in_1_perturbed_big" { - inputs { - arg0 "f64" - arg1 "u8" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f32" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_2_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "u8" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f32" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_3_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "u8" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f32" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_4_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "u8" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f32" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_5_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "u8" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f32" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_6_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "u8" - arg7 "f64" - arg8 "f64" - arg9 "f32" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_7_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "u8" - arg8 "f32" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_8_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f32" - arg8 "u8" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_9_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f32" - arg7 "f64" - arg8 "f64" - arg9 "u8" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_10_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f32" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "u8" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_11_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f32" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "u8" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_12_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f64" - arg3 "f32" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "u8" - arg13 "f64" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_13_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f64" - arg2 "f32" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "u8" - arg14 "f64" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_14_perturbed_big" { - inputs { - arg0 "f64" - arg1 "f32" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "u8" - arg15 "f64" - } - outputs { - } -} -fn "f64_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "f64" - arg2 "f64" - arg3 "f64" - arg4 "f64" - arg5 "f64" - arg6 "f64" - arg7 "f64" - arg8 "f64" - arg9 "f64" - arg10 "f64" - arg11 "f64" - arg12 "f64" - arg13 "f64" - arg14 "f64" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "f64" - f2 "f64" - f3 "f32" -} -fn "f64_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "f64" - f1 "u8" - f2 "f32" - f3 "f64" -} -fn "f64_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "f64" - f1 "f32" - f2 "u8" - f3 "f64" -} -fn "f64_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "f64" - f2 "f64" - f3 "u8" -} -fn "f64_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f32" -} -fn "f64_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "f64" - f1 "u8" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f32" - f15 "f64" -} -fn "f64_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "f64" - f1 "f64" - f2 "u8" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f32" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "u8" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f32" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "u8" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f32" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "u8" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f32" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "u8" - f7 "f64" - f8 "f64" - f9 "f32" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "u8" - f8 "f32" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f32" - f8 "u8" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f32" - f7 "f64" - f8 "f64" - f9 "u8" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f32" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "u8" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f32" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "u8" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "f64" - f1 "f64" - f2 "f64" - f3 "f32" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "u8" - f13 "f64" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "f64" - f1 "f64" - f2 "f32" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "u8" - f14 "f64" - f15 "f64" -} -fn "f64_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "f64" - f1 "f32" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "u8" - f15 "f64" -} -fn "f64_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "f64" - f2 "f64" - f3 "f64" - f4 "f64" - f5 "f64" - f6 "f64" - f7 "f64" - f8 "f64" - f9 "f64" - f10 "f64" - f11 "f64" - f12 "f64" - f13 "f64" - f14 "f64" - f15 "u8" -} -fn "f64_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/i128.kdl b/tests/procgen/i128.kdl deleted file mode 100644 index 6b44616..0000000 --- a/tests/procgen/i128.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "i128_val_in" { - inputs { - arg0 "i128" - } - outputs { - } -} -fn "i128_val_out" { - inputs { - } - outputs { - arg0 "i128" - } -} -fn "i128_val_in_out" { - inputs { - arg0 "i128" - } - outputs { - arg0 "i128" - } -} -fn "i128_ref_in" { - inputs { - arg0 "&i128" - } - outputs { - } -} -fn "i128_val_in_2" { - inputs { - arg0 "i128" - arg1 "i128" - } - outputs { - } -} -fn "i128_val_in_3" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - } - outputs { - } -} -fn "i128_val_in_4" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - } - outputs { - } -} -fn "i128_val_in_5" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - } - outputs { - } -} -fn "i128_val_in_6" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - } - outputs { - } -} -fn "i128_val_in_7" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - } - outputs { - } -} -fn "i128_val_in_8" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - } - outputs { - } -} -fn "i128_val_in_9" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - } - outputs { - } -} -fn "i128_val_in_10" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - } - outputs { - } -} -fn "i128_val_in_11" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - } - outputs { - } -} -fn "i128_val_in_12" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - } - outputs { - } -} -fn "i128_val_in_13" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - } - outputs { - } -} -fn "i128_val_in_14" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - } - outputs { - } -} -fn "i128_val_in_15" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - } - outputs { - } -} -fn "i128_val_in_16" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -struct "Many1" { - f0 "i128" -} -fn "i128_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "i128_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "i128" - f1 "i128" -} -fn "i128_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "i128_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "i128" - f1 "i128" - f2 "i128" -} -fn "i128_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "i128_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" -} -fn "i128_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "i128_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" -} -fn "i128_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "i128_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" -} -fn "i128_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "i128_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" -} -fn "i128_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "i128_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" -} -fn "i128_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "i128_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" -} -fn "i128_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "i128_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" -} -fn "i128_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "i128_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" -} -fn "i128_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "i128_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" -} -fn "i128_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "i128_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" -} -fn "i128_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "i128_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" -} -fn "i128_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "i128_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" -} -fn "i128_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "i128_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "i128_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "i128_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "i128" - arg2 "i128" - arg3 "f32" - } - outputs { - } -} -fn "i128_val_in_1_perturbed_small" { - inputs { - arg0 "i128" - arg1 "u8" - arg2 "f32" - arg3 "i128" - } - outputs { - } -} -fn "i128_val_in_2_perturbed_small" { - inputs { - arg0 "i128" - arg1 "f32" - arg2 "u8" - arg3 "i128" - } - outputs { - } -} -fn "i128_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "i128" - arg2 "i128" - arg3 "u8" - } - outputs { - } -} -fn "i128_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "f32" - } - outputs { - } -} -fn "i128_val_in_1_perturbed_big" { - inputs { - arg0 "i128" - arg1 "u8" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "f32" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_2_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "u8" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "f32" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_3_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "u8" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "f32" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_4_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "u8" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "f32" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_5_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "u8" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "f32" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_6_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "u8" - arg7 "i128" - arg8 "i128" - arg9 "f32" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_7_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "u8" - arg8 "f32" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_8_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "f32" - arg8 "u8" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_9_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "f32" - arg7 "i128" - arg8 "i128" - arg9 "u8" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_10_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "f32" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "u8" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_11_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "f32" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "u8" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_12_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "i128" - arg3 "f32" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "u8" - arg13 "i128" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_13_perturbed_big" { - inputs { - arg0 "i128" - arg1 "i128" - arg2 "f32" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "u8" - arg14 "i128" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_14_perturbed_big" { - inputs { - arg0 "i128" - arg1 "f32" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "u8" - arg15 "i128" - } - outputs { - } -} -fn "i128_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "i128" - arg2 "i128" - arg3 "i128" - arg4 "i128" - arg5 "i128" - arg6 "i128" - arg7 "i128" - arg8 "i128" - arg9 "i128" - arg10 "i128" - arg11 "i128" - arg12 "i128" - arg13 "i128" - arg14 "i128" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "i128" - f2 "i128" - f3 "f32" -} -fn "i128_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "i128" - f1 "u8" - f2 "f32" - f3 "i128" -} -fn "i128_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "i128" - f1 "f32" - f2 "u8" - f3 "i128" -} -fn "i128_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "i128" - f2 "i128" - f3 "u8" -} -fn "i128_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "f32" -} -fn "i128_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "i128" - f1 "u8" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "f32" - f15 "i128" -} -fn "i128_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "i128" - f1 "i128" - f2 "u8" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "f32" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "u8" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "f32" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "u8" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "f32" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "u8" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "f32" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "u8" - f7 "i128" - f8 "i128" - f9 "f32" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "u8" - f8 "f32" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "f32" - f8 "u8" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "f32" - f7 "i128" - f8 "i128" - f9 "u8" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "f32" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "u8" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "f32" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "u8" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "i128" - f1 "i128" - f2 "i128" - f3 "f32" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "u8" - f13 "i128" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "i128" - f1 "i128" - f2 "f32" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "u8" - f14 "i128" - f15 "i128" -} -fn "i128_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "i128" - f1 "f32" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "u8" - f15 "i128" -} -fn "i128_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "i128" - f2 "i128" - f3 "i128" - f4 "i128" - f5 "i128" - f6 "i128" - f7 "i128" - f8 "i128" - f9 "i128" - f10 "i128" - f11 "i128" - f12 "i128" - f13 "i128" - f14 "i128" - f15 "u8" -} -fn "i128_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/i16.kdl b/tests/procgen/i16.kdl deleted file mode 100644 index e6f0d5c..0000000 --- a/tests/procgen/i16.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "i16_val_in" { - inputs { - arg0 "i16" - } - outputs { - } -} -fn "i16_val_out" { - inputs { - } - outputs { - arg0 "i16" - } -} -fn "i16_val_in_out" { - inputs { - arg0 "i16" - } - outputs { - arg0 "i16" - } -} -fn "i16_ref_in" { - inputs { - arg0 "&i16" - } - outputs { - } -} -fn "i16_val_in_2" { - inputs { - arg0 "i16" - arg1 "i16" - } - outputs { - } -} -fn "i16_val_in_3" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - } - outputs { - } -} -fn "i16_val_in_4" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - } - outputs { - } -} -fn "i16_val_in_5" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - } - outputs { - } -} -fn "i16_val_in_6" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - } - outputs { - } -} -fn "i16_val_in_7" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - } - outputs { - } -} -fn "i16_val_in_8" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - } - outputs { - } -} -fn "i16_val_in_9" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - } - outputs { - } -} -fn "i16_val_in_10" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - } - outputs { - } -} -fn "i16_val_in_11" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - } - outputs { - } -} -fn "i16_val_in_12" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - } - outputs { - } -} -fn "i16_val_in_13" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - } - outputs { - } -} -fn "i16_val_in_14" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - } - outputs { - } -} -fn "i16_val_in_15" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - } - outputs { - } -} -fn "i16_val_in_16" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -struct "Many1" { - f0 "i16" -} -fn "i16_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "i16_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "i16" - f1 "i16" -} -fn "i16_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "i16_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "i16" - f1 "i16" - f2 "i16" -} -fn "i16_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "i16_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" -} -fn "i16_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "i16_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" -} -fn "i16_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "i16_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" -} -fn "i16_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "i16_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" -} -fn "i16_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "i16_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" -} -fn "i16_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "i16_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" -} -fn "i16_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "i16_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" -} -fn "i16_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "i16_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" -} -fn "i16_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "i16_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" -} -fn "i16_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "i16_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" -} -fn "i16_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "i16_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" -} -fn "i16_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "i16_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" -} -fn "i16_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "i16_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "i16_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "i16_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "i16" - arg2 "i16" - arg3 "f32" - } - outputs { - } -} -fn "i16_val_in_1_perturbed_small" { - inputs { - arg0 "i16" - arg1 "u8" - arg2 "f32" - arg3 "i16" - } - outputs { - } -} -fn "i16_val_in_2_perturbed_small" { - inputs { - arg0 "i16" - arg1 "f32" - arg2 "u8" - arg3 "i16" - } - outputs { - } -} -fn "i16_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "i16" - arg2 "i16" - arg3 "u8" - } - outputs { - } -} -fn "i16_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "f32" - } - outputs { - } -} -fn "i16_val_in_1_perturbed_big" { - inputs { - arg0 "i16" - arg1 "u8" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "f32" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_2_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "u8" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "f32" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_3_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "u8" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "f32" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_4_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "u8" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "f32" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_5_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "u8" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "f32" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_6_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "u8" - arg7 "i16" - arg8 "i16" - arg9 "f32" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_7_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "u8" - arg8 "f32" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_8_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "f32" - arg8 "u8" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_9_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "f32" - arg7 "i16" - arg8 "i16" - arg9 "u8" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_10_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "f32" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "u8" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_11_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "f32" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "u8" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_12_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "i16" - arg3 "f32" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "u8" - arg13 "i16" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_13_perturbed_big" { - inputs { - arg0 "i16" - arg1 "i16" - arg2 "f32" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "u8" - arg14 "i16" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_14_perturbed_big" { - inputs { - arg0 "i16" - arg1 "f32" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "u8" - arg15 "i16" - } - outputs { - } -} -fn "i16_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "i16" - arg2 "i16" - arg3 "i16" - arg4 "i16" - arg5 "i16" - arg6 "i16" - arg7 "i16" - arg8 "i16" - arg9 "i16" - arg10 "i16" - arg11 "i16" - arg12 "i16" - arg13 "i16" - arg14 "i16" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "i16" - f2 "i16" - f3 "f32" -} -fn "i16_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "i16" - f1 "u8" - f2 "f32" - f3 "i16" -} -fn "i16_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "i16" - f1 "f32" - f2 "u8" - f3 "i16" -} -fn "i16_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "i16" - f2 "i16" - f3 "u8" -} -fn "i16_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "f32" -} -fn "i16_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "i16" - f1 "u8" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "f32" - f15 "i16" -} -fn "i16_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "i16" - f1 "i16" - f2 "u8" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "f32" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "u8" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "f32" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "u8" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "f32" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "u8" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "f32" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "u8" - f7 "i16" - f8 "i16" - f9 "f32" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "u8" - f8 "f32" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "f32" - f8 "u8" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "f32" - f7 "i16" - f8 "i16" - f9 "u8" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "f32" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "u8" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "f32" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "u8" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "i16" - f1 "i16" - f2 "i16" - f3 "f32" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "u8" - f13 "i16" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "i16" - f1 "i16" - f2 "f32" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "u8" - f14 "i16" - f15 "i16" -} -fn "i16_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "i16" - f1 "f32" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "u8" - f15 "i16" -} -fn "i16_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "i16" - f2 "i16" - f3 "i16" - f4 "i16" - f5 "i16" - f6 "i16" - f7 "i16" - f8 "i16" - f9 "i16" - f10 "i16" - f11 "i16" - f12 "i16" - f13 "i16" - f14 "i16" - f15 "u8" -} -fn "i16_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/i32.kdl b/tests/procgen/i32.kdl deleted file mode 100644 index bbd46fc..0000000 --- a/tests/procgen/i32.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "i32_val_in" { - inputs { - arg0 "i32" - } - outputs { - } -} -fn "i32_val_out" { - inputs { - } - outputs { - arg0 "i32" - } -} -fn "i32_val_in_out" { - inputs { - arg0 "i32" - } - outputs { - arg0 "i32" - } -} -fn "i32_ref_in" { - inputs { - arg0 "&i32" - } - outputs { - } -} -fn "i32_val_in_2" { - inputs { - arg0 "i32" - arg1 "i32" - } - outputs { - } -} -fn "i32_val_in_3" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - } - outputs { - } -} -fn "i32_val_in_4" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - } - outputs { - } -} -fn "i32_val_in_5" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - } - outputs { - } -} -fn "i32_val_in_6" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - } - outputs { - } -} -fn "i32_val_in_7" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - } - outputs { - } -} -fn "i32_val_in_8" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - } - outputs { - } -} -fn "i32_val_in_9" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - } - outputs { - } -} -fn "i32_val_in_10" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - } - outputs { - } -} -fn "i32_val_in_11" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - } - outputs { - } -} -fn "i32_val_in_12" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - } - outputs { - } -} -fn "i32_val_in_13" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - } - outputs { - } -} -fn "i32_val_in_14" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - } - outputs { - } -} -fn "i32_val_in_15" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - } - outputs { - } -} -fn "i32_val_in_16" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -struct "Many1" { - f0 "i32" -} -fn "i32_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "i32_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "i32" - f1 "i32" -} -fn "i32_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "i32_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "i32" - f1 "i32" - f2 "i32" -} -fn "i32_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "i32_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" -} -fn "i32_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "i32_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" -} -fn "i32_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "i32_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" -} -fn "i32_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "i32_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" -} -fn "i32_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "i32_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" -} -fn "i32_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "i32_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" -} -fn "i32_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "i32_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" -} -fn "i32_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "i32_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" -} -fn "i32_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "i32_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" -} -fn "i32_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "i32_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" -} -fn "i32_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "i32_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" -} -fn "i32_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "i32_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" -} -fn "i32_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "i32_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "i32_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "i32_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "i32" - arg2 "i32" - arg3 "f32" - } - outputs { - } -} -fn "i32_val_in_1_perturbed_small" { - inputs { - arg0 "i32" - arg1 "u8" - arg2 "f32" - arg3 "i32" - } - outputs { - } -} -fn "i32_val_in_2_perturbed_small" { - inputs { - arg0 "i32" - arg1 "f32" - arg2 "u8" - arg3 "i32" - } - outputs { - } -} -fn "i32_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "i32" - arg2 "i32" - arg3 "u8" - } - outputs { - } -} -fn "i32_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "f32" - } - outputs { - } -} -fn "i32_val_in_1_perturbed_big" { - inputs { - arg0 "i32" - arg1 "u8" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "f32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_2_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "u8" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "f32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_3_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "u8" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "f32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_4_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "u8" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "f32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_5_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "u8" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "f32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_6_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "u8" - arg7 "i32" - arg8 "i32" - arg9 "f32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_7_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "u8" - arg8 "f32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_8_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "f32" - arg8 "u8" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_9_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "f32" - arg7 "i32" - arg8 "i32" - arg9 "u8" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_10_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "f32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "u8" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_11_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "f32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "u8" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_12_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "i32" - arg3 "f32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "u8" - arg13 "i32" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_13_perturbed_big" { - inputs { - arg0 "i32" - arg1 "i32" - arg2 "f32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "u8" - arg14 "i32" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_14_perturbed_big" { - inputs { - arg0 "i32" - arg1 "f32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "u8" - arg15 "i32" - } - outputs { - } -} -fn "i32_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "i32" - arg2 "i32" - arg3 "i32" - arg4 "i32" - arg5 "i32" - arg6 "i32" - arg7 "i32" - arg8 "i32" - arg9 "i32" - arg10 "i32" - arg11 "i32" - arg12 "i32" - arg13 "i32" - arg14 "i32" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "i32" - f2 "i32" - f3 "f32" -} -fn "i32_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "i32" - f1 "u8" - f2 "f32" - f3 "i32" -} -fn "i32_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "i32" - f1 "f32" - f2 "u8" - f3 "i32" -} -fn "i32_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "i32" - f2 "i32" - f3 "u8" -} -fn "i32_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "f32" -} -fn "i32_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "i32" - f1 "u8" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "f32" - f15 "i32" -} -fn "i32_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "i32" - f1 "i32" - f2 "u8" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "f32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "u8" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "f32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "u8" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "f32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "u8" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "f32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "u8" - f7 "i32" - f8 "i32" - f9 "f32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "u8" - f8 "f32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "f32" - f8 "u8" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "f32" - f7 "i32" - f8 "i32" - f9 "u8" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "f32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "u8" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "f32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "u8" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "i32" - f1 "i32" - f2 "i32" - f3 "f32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "u8" - f13 "i32" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "i32" - f1 "i32" - f2 "f32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "u8" - f14 "i32" - f15 "i32" -} -fn "i32_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "i32" - f1 "f32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "u8" - f15 "i32" -} -fn "i32_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "i32" - f2 "i32" - f3 "i32" - f4 "i32" - f5 "i32" - f6 "i32" - f7 "i32" - f8 "i32" - f9 "i32" - f10 "i32" - f11 "i32" - f12 "i32" - f13 "i32" - f14 "i32" - f15 "u8" -} -fn "i32_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/i64.kdl b/tests/procgen/i64.kdl deleted file mode 100644 index d0c907f..0000000 --- a/tests/procgen/i64.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "i64_val_in" { - inputs { - arg0 "i64" - } - outputs { - } -} -fn "i64_val_out" { - inputs { - } - outputs { - arg0 "i64" - } -} -fn "i64_val_in_out" { - inputs { - arg0 "i64" - } - outputs { - arg0 "i64" - } -} -fn "i64_ref_in" { - inputs { - arg0 "&i64" - } - outputs { - } -} -fn "i64_val_in_2" { - inputs { - arg0 "i64" - arg1 "i64" - } - outputs { - } -} -fn "i64_val_in_3" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - } - outputs { - } -} -fn "i64_val_in_4" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - } - outputs { - } -} -fn "i64_val_in_5" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - } - outputs { - } -} -fn "i64_val_in_6" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - } - outputs { - } -} -fn "i64_val_in_7" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - } - outputs { - } -} -fn "i64_val_in_8" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - } - outputs { - } -} -fn "i64_val_in_9" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - } - outputs { - } -} -fn "i64_val_in_10" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - } - outputs { - } -} -fn "i64_val_in_11" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - } - outputs { - } -} -fn "i64_val_in_12" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - } - outputs { - } -} -fn "i64_val_in_13" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - } - outputs { - } -} -fn "i64_val_in_14" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - } - outputs { - } -} -fn "i64_val_in_15" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - } - outputs { - } -} -fn "i64_val_in_16" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -struct "Many1" { - f0 "i64" -} -fn "i64_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "i64_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "i64" - f1 "i64" -} -fn "i64_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "i64_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "i64" - f1 "i64" - f2 "i64" -} -fn "i64_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "i64_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" -} -fn "i64_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "i64_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" -} -fn "i64_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "i64_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" -} -fn "i64_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "i64_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" -} -fn "i64_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "i64_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" -} -fn "i64_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "i64_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" -} -fn "i64_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "i64_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" -} -fn "i64_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "i64_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" -} -fn "i64_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "i64_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" -} -fn "i64_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "i64_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" -} -fn "i64_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "i64_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" -} -fn "i64_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "i64_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" -} -fn "i64_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "i64_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "i64_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "i64_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "i64" - arg2 "i64" - arg3 "f32" - } - outputs { - } -} -fn "i64_val_in_1_perturbed_small" { - inputs { - arg0 "i64" - arg1 "u8" - arg2 "f32" - arg3 "i64" - } - outputs { - } -} -fn "i64_val_in_2_perturbed_small" { - inputs { - arg0 "i64" - arg1 "f32" - arg2 "u8" - arg3 "i64" - } - outputs { - } -} -fn "i64_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "i64" - arg2 "i64" - arg3 "u8" - } - outputs { - } -} -fn "i64_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "f32" - } - outputs { - } -} -fn "i64_val_in_1_perturbed_big" { - inputs { - arg0 "i64" - arg1 "u8" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "f32" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_2_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "u8" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "f32" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_3_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "u8" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "f32" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_4_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "u8" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "f32" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_5_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "u8" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "f32" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_6_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "u8" - arg7 "i64" - arg8 "i64" - arg9 "f32" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_7_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "u8" - arg8 "f32" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_8_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "f32" - arg8 "u8" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_9_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "f32" - arg7 "i64" - arg8 "i64" - arg9 "u8" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_10_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "f32" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "u8" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_11_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "f32" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "u8" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_12_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "i64" - arg3 "f32" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "u8" - arg13 "i64" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_13_perturbed_big" { - inputs { - arg0 "i64" - arg1 "i64" - arg2 "f32" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "u8" - arg14 "i64" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_14_perturbed_big" { - inputs { - arg0 "i64" - arg1 "f32" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "u8" - arg15 "i64" - } - outputs { - } -} -fn "i64_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "i64" - arg2 "i64" - arg3 "i64" - arg4 "i64" - arg5 "i64" - arg6 "i64" - arg7 "i64" - arg8 "i64" - arg9 "i64" - arg10 "i64" - arg11 "i64" - arg12 "i64" - arg13 "i64" - arg14 "i64" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "i64" - f2 "i64" - f3 "f32" -} -fn "i64_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "i64" - f1 "u8" - f2 "f32" - f3 "i64" -} -fn "i64_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "i64" - f1 "f32" - f2 "u8" - f3 "i64" -} -fn "i64_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "i64" - f2 "i64" - f3 "u8" -} -fn "i64_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "f32" -} -fn "i64_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "i64" - f1 "u8" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "f32" - f15 "i64" -} -fn "i64_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "i64" - f1 "i64" - f2 "u8" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "f32" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "u8" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "f32" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "u8" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "f32" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "u8" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "f32" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "u8" - f7 "i64" - f8 "i64" - f9 "f32" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "u8" - f8 "f32" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "f32" - f8 "u8" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "f32" - f7 "i64" - f8 "i64" - f9 "u8" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "f32" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "u8" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "f32" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "u8" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "i64" - f1 "i64" - f2 "i64" - f3 "f32" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "u8" - f13 "i64" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "i64" - f1 "i64" - f2 "f32" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "u8" - f14 "i64" - f15 "i64" -} -fn "i64_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "i64" - f1 "f32" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "u8" - f15 "i64" -} -fn "i64_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "i64" - f2 "i64" - f3 "i64" - f4 "i64" - f5 "i64" - f6 "i64" - f7 "i64" - f8 "i64" - f9 "i64" - f10 "i64" - f11 "i64" - f12 "i64" - f13 "i64" - f14 "i64" - f15 "u8" -} -fn "i64_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/i8.kdl b/tests/procgen/i8.kdl deleted file mode 100644 index d5961bf..0000000 --- a/tests/procgen/i8.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "i8_val_in" { - inputs { - arg0 "i8" - } - outputs { - } -} -fn "i8_val_out" { - inputs { - } - outputs { - arg0 "i8" - } -} -fn "i8_val_in_out" { - inputs { - arg0 "i8" - } - outputs { - arg0 "i8" - } -} -fn "i8_ref_in" { - inputs { - arg0 "&i8" - } - outputs { - } -} -fn "i8_val_in_2" { - inputs { - arg0 "i8" - arg1 "i8" - } - outputs { - } -} -fn "i8_val_in_3" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - } - outputs { - } -} -fn "i8_val_in_4" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - } - outputs { - } -} -fn "i8_val_in_5" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - } - outputs { - } -} -fn "i8_val_in_6" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - } - outputs { - } -} -fn "i8_val_in_7" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - } - outputs { - } -} -fn "i8_val_in_8" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - } - outputs { - } -} -fn "i8_val_in_9" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - } - outputs { - } -} -fn "i8_val_in_10" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - } - outputs { - } -} -fn "i8_val_in_11" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - } - outputs { - } -} -fn "i8_val_in_12" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - } - outputs { - } -} -fn "i8_val_in_13" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - } - outputs { - } -} -fn "i8_val_in_14" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - } - outputs { - } -} -fn "i8_val_in_15" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - } - outputs { - } -} -fn "i8_val_in_16" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -struct "Many1" { - f0 "i8" -} -fn "i8_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "i8_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "i8" - f1 "i8" -} -fn "i8_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "i8_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "i8" - f1 "i8" - f2 "i8" -} -fn "i8_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "i8_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" -} -fn "i8_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "i8_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" -} -fn "i8_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "i8_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" -} -fn "i8_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "i8_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" -} -fn "i8_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "i8_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" -} -fn "i8_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "i8_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" -} -fn "i8_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "i8_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" -} -fn "i8_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "i8_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" -} -fn "i8_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "i8_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" -} -fn "i8_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "i8_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" -} -fn "i8_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "i8_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" -} -fn "i8_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "i8_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" -} -fn "i8_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "i8_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "i8_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "i8_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "i8" - arg2 "i8" - arg3 "f32" - } - outputs { - } -} -fn "i8_val_in_1_perturbed_small" { - inputs { - arg0 "i8" - arg1 "u8" - arg2 "f32" - arg3 "i8" - } - outputs { - } -} -fn "i8_val_in_2_perturbed_small" { - inputs { - arg0 "i8" - arg1 "f32" - arg2 "u8" - arg3 "i8" - } - outputs { - } -} -fn "i8_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "i8" - arg2 "i8" - arg3 "u8" - } - outputs { - } -} -fn "i8_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "f32" - } - outputs { - } -} -fn "i8_val_in_1_perturbed_big" { - inputs { - arg0 "i8" - arg1 "u8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "f32" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_2_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "u8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "f32" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_3_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "u8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "f32" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_4_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "u8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "f32" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_5_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "u8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "f32" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_6_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "u8" - arg7 "i8" - arg8 "i8" - arg9 "f32" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_7_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "u8" - arg8 "f32" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_8_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "f32" - arg8 "u8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_9_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "f32" - arg7 "i8" - arg8 "i8" - arg9 "u8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_10_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "f32" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "u8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_11_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "f32" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "u8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_12_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "i8" - arg3 "f32" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "u8" - arg13 "i8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_13_perturbed_big" { - inputs { - arg0 "i8" - arg1 "i8" - arg2 "f32" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "u8" - arg14 "i8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_14_perturbed_big" { - inputs { - arg0 "i8" - arg1 "f32" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "u8" - arg15 "i8" - } - outputs { - } -} -fn "i8_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "i8" - arg2 "i8" - arg3 "i8" - arg4 "i8" - arg5 "i8" - arg6 "i8" - arg7 "i8" - arg8 "i8" - arg9 "i8" - arg10 "i8" - arg11 "i8" - arg12 "i8" - arg13 "i8" - arg14 "i8" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "i8" - f2 "i8" - f3 "f32" -} -fn "i8_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "i8" - f1 "u8" - f2 "f32" - f3 "i8" -} -fn "i8_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "i8" - f1 "f32" - f2 "u8" - f3 "i8" -} -fn "i8_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "i8" - f2 "i8" - f3 "u8" -} -fn "i8_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "f32" -} -fn "i8_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "i8" - f1 "u8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "f32" - f15 "i8" -} -fn "i8_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "i8" - f1 "i8" - f2 "u8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "f32" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "u8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "f32" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "u8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "f32" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "u8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "f32" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "u8" - f7 "i8" - f8 "i8" - f9 "f32" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "u8" - f8 "f32" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "f32" - f8 "u8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "f32" - f7 "i8" - f8 "i8" - f9 "u8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "f32" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "u8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "f32" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "u8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "i8" - f1 "i8" - f2 "i8" - f3 "f32" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "u8" - f13 "i8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "i8" - f1 "i8" - f2 "f32" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "u8" - f14 "i8" - f15 "i8" -} -fn "i8_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "i8" - f1 "f32" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "u8" - f15 "i8" -} -fn "i8_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "i8" - f2 "i8" - f3 "i8" - f4 "i8" - f5 "i8" - f6 "i8" - f7 "i8" - f8 "i8" - f9 "i8" - f10 "i8" - f11 "i8" - f12 "i8" - f13 "i8" - f14 "i8" - f15 "u8" -} -fn "i8_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/ptr.kdl b/tests/procgen/ptr.kdl deleted file mode 100644 index fa7bbd8..0000000 --- a/tests/procgen/ptr.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "ptr_val_in" { - inputs { - arg0 "ptr" - } - outputs { - } -} -fn "ptr_val_out" { - inputs { - } - outputs { - arg0 "ptr" - } -} -fn "ptr_val_in_out" { - inputs { - arg0 "ptr" - } - outputs { - arg0 "ptr" - } -} -fn "ptr_ref_in" { - inputs { - arg0 "&ptr" - } - outputs { - } -} -fn "ptr_val_in_2" { - inputs { - arg0 "ptr" - arg1 "ptr" - } - outputs { - } -} -fn "ptr_val_in_3" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - } - outputs { - } -} -fn "ptr_val_in_4" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - } - outputs { - } -} -fn "ptr_val_in_5" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - } - outputs { - } -} -fn "ptr_val_in_6" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - } - outputs { - } -} -fn "ptr_val_in_7" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - } - outputs { - } -} -fn "ptr_val_in_8" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - } - outputs { - } -} -fn "ptr_val_in_9" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - } - outputs { - } -} -fn "ptr_val_in_10" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - } - outputs { - } -} -fn "ptr_val_in_11" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - } - outputs { - } -} -fn "ptr_val_in_12" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - } - outputs { - } -} -fn "ptr_val_in_13" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - } - outputs { - } -} -fn "ptr_val_in_14" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - } - outputs { - } -} -fn "ptr_val_in_15" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - } - outputs { - } -} -fn "ptr_val_in_16" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -struct "Many1" { - f0 "ptr" -} -fn "ptr_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "ptr_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "ptr" - f1 "ptr" -} -fn "ptr_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "ptr_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "ptr" - f1 "ptr" - f2 "ptr" -} -fn "ptr_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "ptr_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" -} -fn "ptr_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "ptr_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" -} -fn "ptr_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "ptr_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" -} -fn "ptr_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "ptr_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" -} -fn "ptr_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "ptr_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" -} -fn "ptr_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "ptr_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" -} -fn "ptr_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "ptr_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" -} -fn "ptr_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "ptr_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" -} -fn "ptr_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "ptr_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" -} -fn "ptr_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "ptr_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" -} -fn "ptr_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "ptr_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" -} -fn "ptr_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "ptr_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" -} -fn "ptr_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "ptr_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "ptr_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "ptr_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "ptr" - arg2 "ptr" - arg3 "f32" - } - outputs { - } -} -fn "ptr_val_in_1_perturbed_small" { - inputs { - arg0 "ptr" - arg1 "u8" - arg2 "f32" - arg3 "ptr" - } - outputs { - } -} -fn "ptr_val_in_2_perturbed_small" { - inputs { - arg0 "ptr" - arg1 "f32" - arg2 "u8" - arg3 "ptr" - } - outputs { - } -} -fn "ptr_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "ptr" - arg2 "ptr" - arg3 "u8" - } - outputs { - } -} -fn "ptr_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "f32" - } - outputs { - } -} -fn "ptr_val_in_1_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "u8" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "f32" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_2_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "u8" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "f32" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_3_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "u8" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "f32" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_4_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "u8" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "f32" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_5_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "u8" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "f32" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_6_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "u8" - arg7 "ptr" - arg8 "ptr" - arg9 "f32" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_7_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "u8" - arg8 "f32" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_8_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "f32" - arg8 "u8" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_9_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "f32" - arg7 "ptr" - arg8 "ptr" - arg9 "u8" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_10_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "f32" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "u8" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_11_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "f32" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "u8" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_12_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "ptr" - arg3 "f32" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "u8" - arg13 "ptr" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_13_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "ptr" - arg2 "f32" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "u8" - arg14 "ptr" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_14_perturbed_big" { - inputs { - arg0 "ptr" - arg1 "f32" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "u8" - arg15 "ptr" - } - outputs { - } -} -fn "ptr_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "ptr" - arg2 "ptr" - arg3 "ptr" - arg4 "ptr" - arg5 "ptr" - arg6 "ptr" - arg7 "ptr" - arg8 "ptr" - arg9 "ptr" - arg10 "ptr" - arg11 "ptr" - arg12 "ptr" - arg13 "ptr" - arg14 "ptr" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "ptr" - f2 "ptr" - f3 "f32" -} -fn "ptr_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "ptr" - f1 "u8" - f2 "f32" - f3 "ptr" -} -fn "ptr_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "ptr" - f1 "f32" - f2 "u8" - f3 "ptr" -} -fn "ptr_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "ptr" - f2 "ptr" - f3 "u8" -} -fn "ptr_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "f32" -} -fn "ptr_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "ptr" - f1 "u8" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "f32" - f15 "ptr" -} -fn "ptr_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "ptr" - f1 "ptr" - f2 "u8" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "f32" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "u8" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "f32" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "u8" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "f32" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "u8" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "f32" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "u8" - f7 "ptr" - f8 "ptr" - f9 "f32" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "u8" - f8 "f32" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "f32" - f8 "u8" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "f32" - f7 "ptr" - f8 "ptr" - f9 "u8" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "f32" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "u8" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "f32" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "u8" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "ptr" - f1 "ptr" - f2 "ptr" - f3 "f32" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "u8" - f13 "ptr" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "ptr" - f1 "ptr" - f2 "f32" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "u8" - f14 "ptr" - f15 "ptr" -} -fn "ptr_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "ptr" - f1 "f32" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "u8" - f15 "ptr" -} -fn "ptr_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "ptr" - f2 "ptr" - f3 "ptr" - f4 "ptr" - f5 "ptr" - f6 "ptr" - f7 "ptr" - f8 "ptr" - f9 "ptr" - f10 "ptr" - f11 "ptr" - f12 "ptr" - f13 "ptr" - f14 "ptr" - f15 "u8" -} -fn "ptr_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/u128.kdl b/tests/procgen/u128.kdl deleted file mode 100644 index 78c65c1..0000000 --- a/tests/procgen/u128.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "u128_val_in" { - inputs { - arg0 "u128" - } - outputs { - } -} -fn "u128_val_out" { - inputs { - } - outputs { - arg0 "u128" - } -} -fn "u128_val_in_out" { - inputs { - arg0 "u128" - } - outputs { - arg0 "u128" - } -} -fn "u128_ref_in" { - inputs { - arg0 "&u128" - } - outputs { - } -} -fn "u128_val_in_2" { - inputs { - arg0 "u128" - arg1 "u128" - } - outputs { - } -} -fn "u128_val_in_3" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - } - outputs { - } -} -fn "u128_val_in_4" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - } - outputs { - } -} -fn "u128_val_in_5" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - } - outputs { - } -} -fn "u128_val_in_6" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - } - outputs { - } -} -fn "u128_val_in_7" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - } - outputs { - } -} -fn "u128_val_in_8" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - } - outputs { - } -} -fn "u128_val_in_9" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - } - outputs { - } -} -fn "u128_val_in_10" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - } - outputs { - } -} -fn "u128_val_in_11" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - } - outputs { - } -} -fn "u128_val_in_12" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - } - outputs { - } -} -fn "u128_val_in_13" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - } - outputs { - } -} -fn "u128_val_in_14" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - } - outputs { - } -} -fn "u128_val_in_15" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - } - outputs { - } -} -fn "u128_val_in_16" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -struct "Many1" { - f0 "u128" -} -fn "u128_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "u128_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "u128" - f1 "u128" -} -fn "u128_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "u128_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "u128" - f1 "u128" - f2 "u128" -} -fn "u128_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "u128_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" -} -fn "u128_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "u128_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" -} -fn "u128_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "u128_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" -} -fn "u128_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "u128_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" -} -fn "u128_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "u128_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" -} -fn "u128_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "u128_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" -} -fn "u128_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "u128_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" -} -fn "u128_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "u128_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" -} -fn "u128_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "u128_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" -} -fn "u128_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "u128_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" -} -fn "u128_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "u128_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" -} -fn "u128_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "u128_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" -} -fn "u128_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "u128_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "u128_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "u128_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u128" - arg2 "u128" - arg3 "f32" - } - outputs { - } -} -fn "u128_val_in_1_perturbed_small" { - inputs { - arg0 "u128" - arg1 "u8" - arg2 "f32" - arg3 "u128" - } - outputs { - } -} -fn "u128_val_in_2_perturbed_small" { - inputs { - arg0 "u128" - arg1 "f32" - arg2 "u8" - arg3 "u128" - } - outputs { - } -} -fn "u128_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u128" - arg2 "u128" - arg3 "u8" - } - outputs { - } -} -fn "u128_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "f32" - } - outputs { - } -} -fn "u128_val_in_1_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u8" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "f32" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_2_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u8" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "f32" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_3_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u8" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "f32" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_4_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u8" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "f32" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_5_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u8" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "f32" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_6_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u8" - arg7 "u128" - arg8 "u128" - arg9 "f32" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_7_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u8" - arg8 "f32" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_8_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "f32" - arg8 "u8" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_9_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "f32" - arg7 "u128" - arg8 "u128" - arg9 "u8" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_10_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "f32" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u8" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_11_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "f32" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u8" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_12_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "u128" - arg3 "f32" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u8" - arg13 "u128" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_13_perturbed_big" { - inputs { - arg0 "u128" - arg1 "u128" - arg2 "f32" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u8" - arg14 "u128" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_14_perturbed_big" { - inputs { - arg0 "u128" - arg1 "f32" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u8" - arg15 "u128" - } - outputs { - } -} -fn "u128_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u128" - arg2 "u128" - arg3 "u128" - arg4 "u128" - arg5 "u128" - arg6 "u128" - arg7 "u128" - arg8 "u128" - arg9 "u128" - arg10 "u128" - arg11 "u128" - arg12 "u128" - arg13 "u128" - arg14 "u128" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "u128" - f2 "u128" - f3 "f32" -} -fn "u128_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "u128" - f1 "u8" - f2 "f32" - f3 "u128" -} -fn "u128_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "u128" - f1 "f32" - f2 "u8" - f3 "u128" -} -fn "u128_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "u128" - f2 "u128" - f3 "u8" -} -fn "u128_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "f32" -} -fn "u128_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "u128" - f1 "u8" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "f32" - f15 "u128" -} -fn "u128_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "u128" - f1 "u128" - f2 "u8" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "f32" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u8" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "f32" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u8" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "f32" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u8" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "f32" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u8" - f7 "u128" - f8 "u128" - f9 "f32" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u8" - f8 "f32" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "f32" - f8 "u8" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "f32" - f7 "u128" - f8 "u128" - f9 "u8" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "f32" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u8" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "f32" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u8" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "u128" - f1 "u128" - f2 "u128" - f3 "f32" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u8" - f13 "u128" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "u128" - f1 "u128" - f2 "f32" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u8" - f14 "u128" - f15 "u128" -} -fn "u128_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "u128" - f1 "f32" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u8" - f15 "u128" -} -fn "u128_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "u128" - f2 "u128" - f3 "u128" - f4 "u128" - f5 "u128" - f6 "u128" - f7 "u128" - f8 "u128" - f9 "u128" - f10 "u128" - f11 "u128" - f12 "u128" - f13 "u128" - f14 "u128" - f15 "u8" -} -fn "u128_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/u16.kdl b/tests/procgen/u16.kdl deleted file mode 100644 index 32d0aa5..0000000 --- a/tests/procgen/u16.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "u16_val_in" { - inputs { - arg0 "u16" - } - outputs { - } -} -fn "u16_val_out" { - inputs { - } - outputs { - arg0 "u16" - } -} -fn "u16_val_in_out" { - inputs { - arg0 "u16" - } - outputs { - arg0 "u16" - } -} -fn "u16_ref_in" { - inputs { - arg0 "&u16" - } - outputs { - } -} -fn "u16_val_in_2" { - inputs { - arg0 "u16" - arg1 "u16" - } - outputs { - } -} -fn "u16_val_in_3" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - } - outputs { - } -} -fn "u16_val_in_4" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - } - outputs { - } -} -fn "u16_val_in_5" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - } - outputs { - } -} -fn "u16_val_in_6" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - } - outputs { - } -} -fn "u16_val_in_7" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - } - outputs { - } -} -fn "u16_val_in_8" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - } - outputs { - } -} -fn "u16_val_in_9" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - } - outputs { - } -} -fn "u16_val_in_10" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - } - outputs { - } -} -fn "u16_val_in_11" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - } - outputs { - } -} -fn "u16_val_in_12" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - } - outputs { - } -} -fn "u16_val_in_13" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - } - outputs { - } -} -fn "u16_val_in_14" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - } - outputs { - } -} -fn "u16_val_in_15" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - } - outputs { - } -} -fn "u16_val_in_16" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -struct "Many1" { - f0 "u16" -} -fn "u16_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "u16_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "u16" - f1 "u16" -} -fn "u16_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "u16_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "u16" - f1 "u16" - f2 "u16" -} -fn "u16_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "u16_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" -} -fn "u16_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "u16_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" -} -fn "u16_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "u16_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" -} -fn "u16_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "u16_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" -} -fn "u16_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "u16_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" -} -fn "u16_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "u16_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" -} -fn "u16_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "u16_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" -} -fn "u16_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "u16_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" -} -fn "u16_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "u16_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" -} -fn "u16_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "u16_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" -} -fn "u16_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "u16_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" -} -fn "u16_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "u16_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" -} -fn "u16_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "u16_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "u16_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "u16_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u16" - arg2 "u16" - arg3 "f32" - } - outputs { - } -} -fn "u16_val_in_1_perturbed_small" { - inputs { - arg0 "u16" - arg1 "u8" - arg2 "f32" - arg3 "u16" - } - outputs { - } -} -fn "u16_val_in_2_perturbed_small" { - inputs { - arg0 "u16" - arg1 "f32" - arg2 "u8" - arg3 "u16" - } - outputs { - } -} -fn "u16_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u16" - arg2 "u16" - arg3 "u8" - } - outputs { - } -} -fn "u16_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "f32" - } - outputs { - } -} -fn "u16_val_in_1_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u8" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "f32" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_2_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u8" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "f32" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_3_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u8" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "f32" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_4_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u8" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "f32" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_5_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u8" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "f32" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_6_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u8" - arg7 "u16" - arg8 "u16" - arg9 "f32" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_7_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u8" - arg8 "f32" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_8_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "f32" - arg8 "u8" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_9_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "f32" - arg7 "u16" - arg8 "u16" - arg9 "u8" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_10_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "f32" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u8" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_11_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "f32" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u8" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_12_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "u16" - arg3 "f32" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u8" - arg13 "u16" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_13_perturbed_big" { - inputs { - arg0 "u16" - arg1 "u16" - arg2 "f32" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u8" - arg14 "u16" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_14_perturbed_big" { - inputs { - arg0 "u16" - arg1 "f32" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u8" - arg15 "u16" - } - outputs { - } -} -fn "u16_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u16" - arg2 "u16" - arg3 "u16" - arg4 "u16" - arg5 "u16" - arg6 "u16" - arg7 "u16" - arg8 "u16" - arg9 "u16" - arg10 "u16" - arg11 "u16" - arg12 "u16" - arg13 "u16" - arg14 "u16" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "u16" - f2 "u16" - f3 "f32" -} -fn "u16_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "u16" - f1 "u8" - f2 "f32" - f3 "u16" -} -fn "u16_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "u16" - f1 "f32" - f2 "u8" - f3 "u16" -} -fn "u16_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "u16" - f2 "u16" - f3 "u8" -} -fn "u16_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "f32" -} -fn "u16_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "u16" - f1 "u8" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "f32" - f15 "u16" -} -fn "u16_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "u16" - f1 "u16" - f2 "u8" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "f32" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u8" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "f32" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u8" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "f32" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u8" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "f32" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u8" - f7 "u16" - f8 "u16" - f9 "f32" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u8" - f8 "f32" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "f32" - f8 "u8" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "f32" - f7 "u16" - f8 "u16" - f9 "u8" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "f32" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u8" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "f32" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u8" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "u16" - f1 "u16" - f2 "u16" - f3 "f32" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u8" - f13 "u16" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "u16" - f1 "u16" - f2 "f32" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u8" - f14 "u16" - f15 "u16" -} -fn "u16_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "u16" - f1 "f32" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u8" - f15 "u16" -} -fn "u16_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "u16" - f2 "u16" - f3 "u16" - f4 "u16" - f5 "u16" - f6 "u16" - f7 "u16" - f8 "u16" - f9 "u16" - f10 "u16" - f11 "u16" - f12 "u16" - f13 "u16" - f14 "u16" - f15 "u8" -} -fn "u16_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/u32.kdl b/tests/procgen/u32.kdl deleted file mode 100644 index 42797e8..0000000 --- a/tests/procgen/u32.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "u32_val_in" { - inputs { - arg0 "u32" - } - outputs { - } -} -fn "u32_val_out" { - inputs { - } - outputs { - arg0 "u32" - } -} -fn "u32_val_in_out" { - inputs { - arg0 "u32" - } - outputs { - arg0 "u32" - } -} -fn "u32_ref_in" { - inputs { - arg0 "&u32" - } - outputs { - } -} -fn "u32_val_in_2" { - inputs { - arg0 "u32" - arg1 "u32" - } - outputs { - } -} -fn "u32_val_in_3" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - } - outputs { - } -} -fn "u32_val_in_4" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - } - outputs { - } -} -fn "u32_val_in_5" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - } - outputs { - } -} -fn "u32_val_in_6" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - } - outputs { - } -} -fn "u32_val_in_7" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - } - outputs { - } -} -fn "u32_val_in_8" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - } - outputs { - } -} -fn "u32_val_in_9" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - } - outputs { - } -} -fn "u32_val_in_10" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - } - outputs { - } -} -fn "u32_val_in_11" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - } - outputs { - } -} -fn "u32_val_in_12" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - } - outputs { - } -} -fn "u32_val_in_13" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - } - outputs { - } -} -fn "u32_val_in_14" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - } - outputs { - } -} -fn "u32_val_in_15" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - } - outputs { - } -} -fn "u32_val_in_16" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -struct "Many1" { - f0 "u32" -} -fn "u32_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "u32_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "u32" - f1 "u32" -} -fn "u32_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "u32_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "u32" - f1 "u32" - f2 "u32" -} -fn "u32_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "u32_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" -} -fn "u32_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "u32_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" -} -fn "u32_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "u32_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" -} -fn "u32_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "u32_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" -} -fn "u32_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "u32_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" -} -fn "u32_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "u32_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" -} -fn "u32_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "u32_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" -} -fn "u32_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "u32_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" -} -fn "u32_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "u32_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" -} -fn "u32_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "u32_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" -} -fn "u32_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "u32_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" -} -fn "u32_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "u32_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" -} -fn "u32_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "u32_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "u32_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "u32_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u32" - arg2 "u32" - arg3 "f32" - } - outputs { - } -} -fn "u32_val_in_1_perturbed_small" { - inputs { - arg0 "u32" - arg1 "u8" - arg2 "f32" - arg3 "u32" - } - outputs { - } -} -fn "u32_val_in_2_perturbed_small" { - inputs { - arg0 "u32" - arg1 "f32" - arg2 "u8" - arg3 "u32" - } - outputs { - } -} -fn "u32_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u32" - arg2 "u32" - arg3 "u8" - } - outputs { - } -} -fn "u32_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "f32" - } - outputs { - } -} -fn "u32_val_in_1_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u8" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "f32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_2_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u8" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "f32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_3_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u8" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "f32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_4_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u8" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "f32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_5_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u8" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "f32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_6_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u8" - arg7 "u32" - arg8 "u32" - arg9 "f32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_7_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u8" - arg8 "f32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_8_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "f32" - arg8 "u8" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_9_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "f32" - arg7 "u32" - arg8 "u32" - arg9 "u8" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_10_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "f32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u8" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_11_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "f32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u8" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_12_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "u32" - arg3 "f32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u8" - arg13 "u32" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_13_perturbed_big" { - inputs { - arg0 "u32" - arg1 "u32" - arg2 "f32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u8" - arg14 "u32" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_14_perturbed_big" { - inputs { - arg0 "u32" - arg1 "f32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u8" - arg15 "u32" - } - outputs { - } -} -fn "u32_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u32" - arg2 "u32" - arg3 "u32" - arg4 "u32" - arg5 "u32" - arg6 "u32" - arg7 "u32" - arg8 "u32" - arg9 "u32" - arg10 "u32" - arg11 "u32" - arg12 "u32" - arg13 "u32" - arg14 "u32" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "u32" - f2 "u32" - f3 "f32" -} -fn "u32_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "u32" - f1 "u8" - f2 "f32" - f3 "u32" -} -fn "u32_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "u32" - f1 "f32" - f2 "u8" - f3 "u32" -} -fn "u32_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "u32" - f2 "u32" - f3 "u8" -} -fn "u32_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "f32" -} -fn "u32_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "u32" - f1 "u8" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "f32" - f15 "u32" -} -fn "u32_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "u32" - f1 "u32" - f2 "u8" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "f32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u8" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "f32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u8" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "f32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u8" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "f32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u8" - f7 "u32" - f8 "u32" - f9 "f32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u8" - f8 "f32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "f32" - f8 "u8" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "f32" - f7 "u32" - f8 "u32" - f9 "u8" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "f32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u8" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "f32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u8" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "u32" - f1 "u32" - f2 "u32" - f3 "f32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u8" - f13 "u32" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "u32" - f1 "u32" - f2 "f32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u8" - f14 "u32" - f15 "u32" -} -fn "u32_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "u32" - f1 "f32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u8" - f15 "u32" -} -fn "u32_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "u32" - f2 "u32" - f3 "u32" - f4 "u32" - f5 "u32" - f6 "u32" - f7 "u32" - f8 "u32" - f9 "u32" - f10 "u32" - f11 "u32" - f12 "u32" - f13 "u32" - f14 "u32" - f15 "u8" -} -fn "u32_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/u64.kdl b/tests/procgen/u64.kdl deleted file mode 100644 index 3d9a53b..0000000 --- a/tests/procgen/u64.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "u64_val_in" { - inputs { - arg0 "u64" - } - outputs { - } -} -fn "u64_val_out" { - inputs { - } - outputs { - arg0 "u64" - } -} -fn "u64_val_in_out" { - inputs { - arg0 "u64" - } - outputs { - arg0 "u64" - } -} -fn "u64_ref_in" { - inputs { - arg0 "&u64" - } - outputs { - } -} -fn "u64_val_in_2" { - inputs { - arg0 "u64" - arg1 "u64" - } - outputs { - } -} -fn "u64_val_in_3" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - } - outputs { - } -} -fn "u64_val_in_4" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - } - outputs { - } -} -fn "u64_val_in_5" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - } - outputs { - } -} -fn "u64_val_in_6" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - } - outputs { - } -} -fn "u64_val_in_7" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - } - outputs { - } -} -fn "u64_val_in_8" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - } - outputs { - } -} -fn "u64_val_in_9" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - } - outputs { - } -} -fn "u64_val_in_10" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - } - outputs { - } -} -fn "u64_val_in_11" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - } - outputs { - } -} -fn "u64_val_in_12" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - } - outputs { - } -} -fn "u64_val_in_13" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - } - outputs { - } -} -fn "u64_val_in_14" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - } - outputs { - } -} -fn "u64_val_in_15" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - } - outputs { - } -} -fn "u64_val_in_16" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -struct "Many1" { - f0 "u64" -} -fn "u64_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "u64_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "u64" - f1 "u64" -} -fn "u64_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "u64_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "u64" - f1 "u64" - f2 "u64" -} -fn "u64_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "u64_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" -} -fn "u64_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "u64_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" -} -fn "u64_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "u64_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" -} -fn "u64_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "u64_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" -} -fn "u64_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "u64_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" -} -fn "u64_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "u64_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" -} -fn "u64_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "u64_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" -} -fn "u64_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "u64_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" -} -fn "u64_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "u64_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" -} -fn "u64_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "u64_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" -} -fn "u64_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "u64_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" -} -fn "u64_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "u64_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" -} -fn "u64_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "u64_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "u64_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "u64_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u64" - arg2 "u64" - arg3 "f32" - } - outputs { - } -} -fn "u64_val_in_1_perturbed_small" { - inputs { - arg0 "u64" - arg1 "u8" - arg2 "f32" - arg3 "u64" - } - outputs { - } -} -fn "u64_val_in_2_perturbed_small" { - inputs { - arg0 "u64" - arg1 "f32" - arg2 "u8" - arg3 "u64" - } - outputs { - } -} -fn "u64_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u64" - arg2 "u64" - arg3 "u8" - } - outputs { - } -} -fn "u64_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "f32" - } - outputs { - } -} -fn "u64_val_in_1_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u8" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "f32" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_2_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u8" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "f32" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_3_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u8" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "f32" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_4_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u8" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "f32" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_5_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u8" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "f32" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_6_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u8" - arg7 "u64" - arg8 "u64" - arg9 "f32" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_7_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u8" - arg8 "f32" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_8_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "f32" - arg8 "u8" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_9_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "f32" - arg7 "u64" - arg8 "u64" - arg9 "u8" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_10_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "f32" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u8" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_11_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "f32" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u8" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_12_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "u64" - arg3 "f32" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u8" - arg13 "u64" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_13_perturbed_big" { - inputs { - arg0 "u64" - arg1 "u64" - arg2 "f32" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u8" - arg14 "u64" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_14_perturbed_big" { - inputs { - arg0 "u64" - arg1 "f32" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u8" - arg15 "u64" - } - outputs { - } -} -fn "u64_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u64" - arg2 "u64" - arg3 "u64" - arg4 "u64" - arg5 "u64" - arg6 "u64" - arg7 "u64" - arg8 "u64" - arg9 "u64" - arg10 "u64" - arg11 "u64" - arg12 "u64" - arg13 "u64" - arg14 "u64" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "u64" - f2 "u64" - f3 "f32" -} -fn "u64_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "u64" - f1 "u8" - f2 "f32" - f3 "u64" -} -fn "u64_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "u64" - f1 "f32" - f2 "u8" - f3 "u64" -} -fn "u64_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "u64" - f2 "u64" - f3 "u8" -} -fn "u64_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "f32" -} -fn "u64_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "u64" - f1 "u8" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "f32" - f15 "u64" -} -fn "u64_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "u64" - f1 "u64" - f2 "u8" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "f32" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u8" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "f32" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u8" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "f32" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u8" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "f32" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u8" - f7 "u64" - f8 "u64" - f9 "f32" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u8" - f8 "f32" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "f32" - f8 "u8" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "f32" - f7 "u64" - f8 "u64" - f9 "u8" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "f32" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u8" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "f32" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u8" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "u64" - f1 "u64" - f2 "u64" - f3 "f32" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u8" - f13 "u64" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "u64" - f1 "u64" - f2 "f32" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u8" - f14 "u64" - f15 "u64" -} -fn "u64_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "u64" - f1 "f32" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u8" - f15 "u64" -} -fn "u64_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "u64" - f2 "u64" - f3 "u64" - f4 "u64" - f5 "u64" - f6 "u64" - f7 "u64" - f8 "u64" - f9 "u64" - f10 "u64" - f11 "u64" - f12 "u64" - f13 "u64" - f14 "u64" - f15 "u8" -} -fn "u64_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen/u8.kdl b/tests/procgen/u8.kdl deleted file mode 100644 index dbcbf98..0000000 --- a/tests/procgen/u8.kdl +++ /dev/null @@ -1,1490 +0,0 @@ -fn "u8_val_in" { - inputs { - arg0 "u8" - } - outputs { - } -} -fn "u8_val_out" { - inputs { - } - outputs { - arg0 "u8" - } -} -fn "u8_val_in_out" { - inputs { - arg0 "u8" - } - outputs { - arg0 "u8" - } -} -fn "u8_ref_in" { - inputs { - arg0 "&u8" - } - outputs { - } -} -fn "u8_val_in_2" { - inputs { - arg0 "u8" - arg1 "u8" - } - outputs { - } -} -fn "u8_val_in_3" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - } - outputs { - } -} -fn "u8_val_in_4" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - } - outputs { - } -} -fn "u8_val_in_5" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - } - outputs { - } -} -fn "u8_val_in_6" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - } - outputs { - } -} -fn "u8_val_in_7" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - } - outputs { - } -} -fn "u8_val_in_8" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - } - outputs { - } -} -fn "u8_val_in_9" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - } - outputs { - } -} -fn "u8_val_in_10" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - } - outputs { - } -} -fn "u8_val_in_11" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - } - outputs { - } -} -fn "u8_val_in_12" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - } - outputs { - } -} -fn "u8_val_in_13" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - } - outputs { - } -} -fn "u8_val_in_14" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - } - outputs { - } -} -fn "u8_val_in_15" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - } - outputs { - } -} -fn "u8_val_in_16" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -struct "Many1" { - f0 "u8" -} -fn "u8_struct_in_1" { - inputs { - arg0 "Many1" - } - outputs { - } -} -fn "u8_ref_struct_in_1" { - inputs { - arg0 "&Many1" - } - outputs { - } -} -struct "Many2" { - f0 "u8" - f1 "u8" -} -fn "u8_struct_in_2" { - inputs { - arg0 "Many2" - } - outputs { - } -} -fn "u8_ref_struct_in_2" { - inputs { - arg0 "&Many2" - } - outputs { - } -} -struct "Many3" { - f0 "u8" - f1 "u8" - f2 "u8" -} -fn "u8_struct_in_3" { - inputs { - arg0 "Many3" - } - outputs { - } -} -fn "u8_ref_struct_in_3" { - inputs { - arg0 "&Many3" - } - outputs { - } -} -struct "Many4" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" -} -fn "u8_struct_in_4" { - inputs { - arg0 "Many4" - } - outputs { - } -} -fn "u8_ref_struct_in_4" { - inputs { - arg0 "&Many4" - } - outputs { - } -} -struct "Many5" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" -} -fn "u8_struct_in_5" { - inputs { - arg0 "Many5" - } - outputs { - } -} -fn "u8_ref_struct_in_5" { - inputs { - arg0 "&Many5" - } - outputs { - } -} -struct "Many6" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" -} -fn "u8_struct_in_6" { - inputs { - arg0 "Many6" - } - outputs { - } -} -fn "u8_ref_struct_in_6" { - inputs { - arg0 "&Many6" - } - outputs { - } -} -struct "Many7" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" -} -fn "u8_struct_in_7" { - inputs { - arg0 "Many7" - } - outputs { - } -} -fn "u8_ref_struct_in_7" { - inputs { - arg0 "&Many7" - } - outputs { - } -} -struct "Many8" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" -} -fn "u8_struct_in_8" { - inputs { - arg0 "Many8" - } - outputs { - } -} -fn "u8_ref_struct_in_8" { - inputs { - arg0 "&Many8" - } - outputs { - } -} -struct "Many9" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" -} -fn "u8_struct_in_9" { - inputs { - arg0 "Many9" - } - outputs { - } -} -fn "u8_ref_struct_in_9" { - inputs { - arg0 "&Many9" - } - outputs { - } -} -struct "Many10" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" -} -fn "u8_struct_in_10" { - inputs { - arg0 "Many10" - } - outputs { - } -} -fn "u8_ref_struct_in_10" { - inputs { - arg0 "&Many10" - } - outputs { - } -} -struct "Many11" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" -} -fn "u8_struct_in_11" { - inputs { - arg0 "Many11" - } - outputs { - } -} -fn "u8_ref_struct_in_11" { - inputs { - arg0 "&Many11" - } - outputs { - } -} -struct "Many12" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" -} -fn "u8_struct_in_12" { - inputs { - arg0 "Many12" - } - outputs { - } -} -fn "u8_ref_struct_in_12" { - inputs { - arg0 "&Many12" - } - outputs { - } -} -struct "Many13" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" -} -fn "u8_struct_in_13" { - inputs { - arg0 "Many13" - } - outputs { - } -} -fn "u8_ref_struct_in_13" { - inputs { - arg0 "&Many13" - } - outputs { - } -} -struct "Many14" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" -} -fn "u8_struct_in_14" { - inputs { - arg0 "Many14" - } - outputs { - } -} -fn "u8_ref_struct_in_14" { - inputs { - arg0 "&Many14" - } - outputs { - } -} -struct "Many15" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" -} -fn "u8_struct_in_15" { - inputs { - arg0 "Many15" - } - outputs { - } -} -fn "u8_ref_struct_in_15" { - inputs { - arg0 "&Many15" - } - outputs { - } -} -struct "Many16" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_struct_in_16" { - inputs { - arg0 "Many16" - } - outputs { - } -} -fn "u8_ref_struct_in_16" { - inputs { - arg0 "&Many16" - } - outputs { - } -} -fn "u8_val_in_0_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "f32" - } - outputs { - } -} -fn "u8_val_in_1_perturbed_small" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "f32" - arg3 "u8" - } - outputs { - } -} -fn "u8_val_in_2_perturbed_small" { - inputs { - arg0 "u8" - arg1 "f32" - arg2 "u8" - arg3 "u8" - } - outputs { - } -} -fn "u8_val_in_3_perturbed_small" { - inputs { - arg0 "f32" - arg1 "u8" - arg2 "u8" - arg3 "u8" - } - outputs { - } -} -fn "u8_val_in_0_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "f32" - } - outputs { - } -} -fn "u8_val_in_1_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "f32" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_2_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "f32" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_3_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "f32" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_4_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "f32" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_5_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "f32" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_6_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "f32" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_7_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "f32" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_8_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "f32" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_9_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "f32" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_10_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "f32" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_11_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "f32" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_12_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "u8" - arg3 "f32" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_13_perturbed_big" { - inputs { - arg0 "u8" - arg1 "u8" - arg2 "f32" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_14_perturbed_big" { - inputs { - arg0 "u8" - arg1 "f32" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -fn "u8_val_in_15_perturbed_big" { - inputs { - arg0 "f32" - arg1 "u8" - arg2 "u8" - arg3 "u8" - arg4 "u8" - arg5 "u8" - arg6 "u8" - arg7 "u8" - arg8 "u8" - arg9 "u8" - arg10 "u8" - arg11 "u8" - arg12 "u8" - arg13 "u8" - arg14 "u8" - arg15 "u8" - } - outputs { - } -} -struct "Perturbedsmall0" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "f32" -} -fn "u8_val_in_0_perturbed_small" { - inputs { - arg0 "Perturbedsmall0" - } - outputs { - } -} -struct "Perturbedsmall1" { - f0 "u8" - f1 "u8" - f2 "f32" - f3 "u8" -} -fn "u8_val_in_1_perturbed_small" { - inputs { - arg0 "Perturbedsmall1" - } - outputs { - } -} -struct "Perturbedsmall2" { - f0 "u8" - f1 "f32" - f2 "u8" - f3 "u8" -} -fn "u8_val_in_2_perturbed_small" { - inputs { - arg0 "Perturbedsmall2" - } - outputs { - } -} -struct "Perturbedsmall3" { - f0 "f32" - f1 "u8" - f2 "u8" - f3 "u8" -} -fn "u8_val_in_3_perturbed_small" { - inputs { - arg0 "Perturbedsmall3" - } - outputs { - } -} -struct "Perturbedbig0" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "f32" -} -fn "u8_val_in_0_perturbed_big" { - inputs { - arg0 "Perturbedbig0" - } - outputs { - } -} -struct "Perturbedbig1" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "f32" - f15 "u8" -} -fn "u8_val_in_1_perturbed_big" { - inputs { - arg0 "Perturbedbig1" - } - outputs { - } -} -struct "Perturbedbig2" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "f32" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_2_perturbed_big" { - inputs { - arg0 "Perturbedbig2" - } - outputs { - } -} -struct "Perturbedbig3" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "f32" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_3_perturbed_big" { - inputs { - arg0 "Perturbedbig3" - } - outputs { - } -} -struct "Perturbedbig4" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "f32" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_4_perturbed_big" { - inputs { - arg0 "Perturbedbig4" - } - outputs { - } -} -struct "Perturbedbig5" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "f32" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_5_perturbed_big" { - inputs { - arg0 "Perturbedbig5" - } - outputs { - } -} -struct "Perturbedbig6" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "f32" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_6_perturbed_big" { - inputs { - arg0 "Perturbedbig6" - } - outputs { - } -} -struct "Perturbedbig7" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "f32" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_7_perturbed_big" { - inputs { - arg0 "Perturbedbig7" - } - outputs { - } -} -struct "Perturbedbig8" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "f32" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_8_perturbed_big" { - inputs { - arg0 "Perturbedbig8" - } - outputs { - } -} -struct "Perturbedbig9" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "f32" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_9_perturbed_big" { - inputs { - arg0 "Perturbedbig9" - } - outputs { - } -} -struct "Perturbedbig10" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "f32" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_10_perturbed_big" { - inputs { - arg0 "Perturbedbig10" - } - outputs { - } -} -struct "Perturbedbig11" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "f32" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_11_perturbed_big" { - inputs { - arg0 "Perturbedbig11" - } - outputs { - } -} -struct "Perturbedbig12" { - f0 "u8" - f1 "u8" - f2 "u8" - f3 "f32" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_12_perturbed_big" { - inputs { - arg0 "Perturbedbig12" - } - outputs { - } -} -struct "Perturbedbig13" { - f0 "u8" - f1 "u8" - f2 "f32" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_13_perturbed_big" { - inputs { - arg0 "Perturbedbig13" - } - outputs { - } -} -struct "Perturbedbig14" { - f0 "u8" - f1 "f32" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_14_perturbed_big" { - inputs { - arg0 "Perturbedbig14" - } - outputs { - } -} -struct "Perturbedbig15" { - f0 "f32" - f1 "u8" - f2 "u8" - f3 "u8" - f4 "u8" - f5 "u8" - f6 "u8" - f7 "u8" - f8 "u8" - f9 "u8" - f10 "u8" - f11 "u8" - f12 "u8" - f13 "u8" - f14 "u8" - f15 "u8" -} -fn "u8_val_in_15_perturbed_big" { - inputs { - arg0 "Perturbedbig15" - } - outputs { - } -} diff --git a/tests/procgen_in/bool.procgen.kdl b/tests/procgen_in/bool.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/f32.procgen.kdl b/tests/procgen_in/f32.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/f64.procgen.kdl b/tests/procgen_in/f64.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/i128.procgen.kdl b/tests/procgen_in/i128.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/i16.procgen.kdl b/tests/procgen_in/i16.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/i32.procgen.kdl b/tests/procgen_in/i32.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/i64.procgen.kdl b/tests/procgen_in/i64.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/i8.procgen.kdl b/tests/procgen_in/i8.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/ptr.procgen.kdl b/tests/procgen_in/ptr.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/u128.procgen.kdl b/tests/procgen_in/u128.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/u16.procgen.kdl b/tests/procgen_in/u16.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/u32.procgen.kdl b/tests/procgen_in/u32.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/u64.procgen.kdl b/tests/procgen_in/u64.procgen.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/procgen_in/u8.procgen.kdl b/tests/procgen_in/u8.procgen.kdl new file mode 100644 index 0000000..e69de29 From 0dc8b4e05406a8a9ddf717a8bd4322eeba001a8e Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 24 Jun 2024 20:45:57 -0400 Subject: [PATCH 28/44] feat: add async logging and enable async exec --- Cargo.lock | 141 +++++-------- Cargo.toml | 5 +- src/abis/rust.rs | 2 +- src/abis_old/rust.rs | 2 +- src/cli.rs | 39 ++-- src/harness/build.rs | 8 +- src/harness/check.rs | 25 ++- src/harness/generate.rs | 3 +- src/harness/read.rs | 27 +-- src/harness/run.rs | 9 +- src/log.rs | 443 ++++++++++++++++++++++++++++++++++++++++ src/main.rs | 45 ++-- src/procgen.rs | 15 +- 13 files changed, 591 insertions(+), 173 deletions(-) create mode 100644 src/log.rs diff --git a/Cargo.lock b/Cargo.lock index 686df51..f8691cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,11 +10,11 @@ dependencies = [ "camino", "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", "clap", + "console", "kdl 4.4.1-alpha.0", "kdl-script", "libloading", "linked-hash-map", - "log", "miette", "rand", "rand_core", @@ -23,9 +23,10 @@ dependencies = [ "ron", "serde", "serde_json", - "simplelog", "thiserror", "tokio", + "tracing", + "tracing-subscriber", ] [[package]] @@ -201,19 +202,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - [[package]] name = "clap" version = "4.5.4" @@ -261,6 +249,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -312,6 +313,12 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "equivalent" version = "1.0.1" @@ -373,7 +380,7 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -560,11 +567,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.14" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "cfg-if", + "regex-automata", ] [[package]] @@ -642,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -666,25 +679,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.13.1" @@ -874,6 +868,15 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + [[package]] name = "regex-syntax" version = "0.6.27" @@ -994,17 +997,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simplelog" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1348164456f72ca0116e4538bdaabb0ddb622c7d9f16387c725af3e96d6001c" -dependencies = [ - "chrono", - "log", - "termcolor", -] - [[package]] name = "smallvec" version = "1.10.0" @@ -1072,15 +1064,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.1.17" @@ -1141,17 +1124,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "tinyvec" version = "1.5.1" @@ -1241,25 +1213,29 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ + "matchers", "nu-ansi-term", + "once_cell", + "regex", "sharded-slab", "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", ] @@ -1324,12 +1300,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1352,15 +1322,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index 992ff6a..e4c0a2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,11 @@ parallel = ["rayon"] camino = { version = "1.1.7", features = ["serde1"] } cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } clap = { version = "4.5.4", features = ["cargo", "wrap_help"] } +console = "0.15.8" kdl = { git = "https://github.com/Gankra/kdl-rs", branch = "spanned" } kdl-script = { path = "../kdl-script" } libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } -log = "0.4.14" miette = { version = "5.3.0", features = ["fancy"] } rand = "0.8.5" rand_core = "0.6.4" @@ -30,9 +30,10 @@ rayon = { version = "1.5.3", optional = true } ron = "0.7.0" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.83" -simplelog = "0.11.2" thiserror = "1.0.30" tokio = { version = "1.37.0", features = ["full", "tracing"] } +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } [lints.clippy] result_large_err = "allow" diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 4344c12..36cbbf0 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -111,7 +111,7 @@ impl AbiImpl for RustcAbiImpl { if let Some(codegen_backend) = &self.codegen_backend { cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); } - eprintln!("running: {:?}", cmd); + debug!("running: {:?}", cmd); let out = cmd.output()?; if !out.status.success() { diff --git a/src/abis_old/rust.rs b/src/abis_old/rust.rs index ab31bfc..5757020 100644 --- a/src/abis_old/rust.rs +++ b/src/abis_old/rust.rs @@ -212,7 +212,7 @@ impl AbiImpl for RustcAbiImpl { if let Some(codegen_backend) = &self.codegen_backend { cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); } - eprintln!("running: {:?}", cmd); + debug!("running: {:?}", cmd); let out = cmd.output()?; if !out.status.success() { diff --git a/src/cli.rs b/src/cli.rs index 4c9eb3f..c0cb309 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ use crate::{abis::*, Config, OutputFormat}; use clap::Parser; -use log::LevelFilter; -use simplelog::{ColorChoice, TermLogger, TerminalMode}; +use tracing::warn; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; use vals::ValueGeneratorKind; #[derive(Parser)] @@ -76,25 +76,38 @@ pub fn make_app() -> Config { for (name, _path) in &rustc_codegen_backends { if !run_pairs.iter().any(|(a, b)| a == name || b == name) { - eprintln!("Warning: Rustc codegen backend `{name}` is not tested."); - eprintln!( - "Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`." + warn!( + "Rustc codegen backend `{name}` is not tested. +Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. +" ); - eprintln!(); } } let value_generator = ValueGeneratorKind::Graffiti; let output_format = config.output_format; - TermLogger::init( - LevelFilter::Info, - simplelog::Config::default(), - TerminalMode::Mixed, - ColorChoice::Auto, - ) - .expect("failed to initialize logger"); + /* + let fmt_layer = tracing_subscriber::fmt::layer() + .without_time() + .with_target(false) + .with_writer(std::io::stderr); + tracing_subscriber::registry() + .with(filter_layer) + // .with(forest_layer) + .with(fmt_layer) + .init(); + */ + let filter_layer = EnvFilter::try_from_default_env() + .or_else(|_| EnvFilter::try_new("info")) + .unwrap(); + + let logger = crate::log::MapLogger::new(); + tracing_subscriber::registry() + .with(filter_layer) + .with(logger.clone()) + .init(); Config { output_format, procgen_tests, diff --git a/src/harness/build.rs b/src/harness/build.rs index dcaef44..a163639 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -4,6 +4,7 @@ use std::process::Command; use std::sync::Arc; use camino::{Utf8Path, Utf8PathBuf}; +use tracing::info; use crate::error::*; use crate::report::*; @@ -51,7 +52,7 @@ impl TestHarness { // Either acquire the cached result, or make it let real_lib_name = once .get_or_try_init(|| { - eprintln!("compiling {lib_name}"); + info!("compiling {lib_name}"); build_static_lib(src_path, abi_impl, call_side, out_dir, &lib_name) }) .await? @@ -65,9 +66,8 @@ impl TestHarness { build: &BuildOutput, out_dir: &Utf8Path, ) -> Result { - let full_test_name = self.full_test_name(key); let dynamic_lib_name = self.dynamic_lib_name(key); - eprintln!("linking {full_test_name}"); + info!("linking {dynamic_lib_name}"); link_dynamic_lib(build, out_dir, &dynamic_lib_name) } @@ -140,7 +140,7 @@ fn link_dynamic_lib( .arg(&output) .arg(&src); - eprintln!("running: {:?}", cmd); + debug!("running: {:?}", cmd); let out = cmd.output()?; if !out.status.success() { diff --git a/src/harness/check.rs b/src/harness/check.rs index 461d1f7..8112efa 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -1,4 +1,6 @@ +use console::Style; use kdl_script::types::Ty; +use tracing::{error, info}; use vals::ArgValuesIter; use crate::error::*; @@ -151,24 +153,25 @@ impl TestHarness { let num_passed = results.iter().filter(|r| r.is_ok()).count(); let all_passed = num_passed == results.len(); - for (subtest_name, result) in names.iter().zip(&results) { - match result { - Ok(()) => { - eprintln!("Test {subtest_name:width$} passed", width = max_name_len); - } - Err(e) => { - eprintln!("Test {subtest_name:width$} failed!", width = max_name_len); - eprintln!("{}", e); + if !all_passed { + for (subtest_name, result) in names.iter().zip(&results) { + match result { + Ok(()) => { + info!("Test {subtest_name:width$} passed", width = max_name_len); + } + Err(e) => { + info!("Test {subtest_name:width$} failed!", width = max_name_len); + info!("{}", e); + } } } } if all_passed { - eprintln!("all tests passed"); + info!("{}", Style::new().green().apply_to("all tests passed")); } else { - eprintln!("only {}/{} tests passed!", num_passed, results.len()); + error!("only {}/{} tests passed!", num_passed, results.len()); } - eprintln!(); CheckOutput { all_passed, diff --git a/src/harness/generate.rs b/src/harness/generate.rs index dd5d52c..6391a1e 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -4,6 +4,7 @@ use std::fs::File; use std::io::Write; use std::sync::Arc; use tokio::sync::OnceCell; +use tracing::info; use crate::abis::*; use crate::error::*; @@ -47,7 +48,7 @@ impl TestHarness { .get_or_try_init(|| { let abi_impl = self.abi_by_test_key(key, call_side); let options = key.options.clone(); - eprintln!("generating {}", &src_path); + info!("generating {}", &src_path); generate_src(&src_path, abi_impl, test_with_abi, call_side, options) }) .await?; diff --git a/src/harness/read.rs b/src/harness/read.rs index 60b1a98..3f5584d 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -5,6 +5,8 @@ use std::{ sync::Arc, }; +use tracing::warn; + use crate::{ error::*, vals::{ValueGeneratorKind, ValueTree}, @@ -28,7 +30,7 @@ pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, Gene let test = match read_test_manifest(entry.path().to_owned(), value_generator) { Ok(test) => test, Err(e) => { - eprintln!("test {:?}'s file couldn't be parsed {}", entry, e); + warn!("test {:?}'s file couldn't be parsed {}", entry, e); continue; } }; @@ -46,16 +48,17 @@ fn read_test_manifest( test_file: PathBuf, value_generator: ValueGeneratorKind, ) -> Result { - let (input, test_name) = if let Some(test_name) = filename(&test_file).strip_suffix(".procgen.kdl") { - let ty_def = read_file_to_string(&test_file)?; - let input = crate::procgen::procgen_test_for_ty_string(test_name, Some(&ty_def)); - (input, test_name) - } else if let Some(test_name) = filename(&test_file).strip_suffix(".kdl") { - let input = read_file_to_string(&test_file)?; - (input, test_name) - } else { - return Err(GenerateError::Skipped); - }; + let (input, test_name) = + if let Some(test_name) = filename(&test_file).strip_suffix(".procgen.kdl") { + let ty_def = read_file_to_string(&test_file)?; + let input = crate::procgen::procgen_test_for_ty_string(test_name, Some(&ty_def)); + (input, test_name) + } else if let Some(test_name) = filename(&test_file).strip_suffix(".kdl") { + let input = read_file_to_string(&test_file)?; + (input, test_name) + } else { + return Err(GenerateError::Skipped); + }; let mut compiler = kdl_script::Compiler::new(); let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; let vals = Arc::new(ValueTree::new(&types, value_generator)); @@ -76,4 +79,4 @@ fn read_file_to_string(file: &Path) -> std::io::Result { let mut input = String::new(); reader.read_to_string(&mut input)?; Ok(input) -} \ No newline at end of file +} diff --git a/src/harness/run.rs b/src/harness/run.rs index db87b83..df41c47 100644 --- a/src/harness/run.rs +++ b/src/harness/run.rs @@ -2,6 +2,7 @@ //! compiled tests. use serde::Serialize; +use tracing::info; use crate::error::*; use crate::report::*; @@ -138,7 +139,7 @@ pub unsafe extern "C" fn finished_func(output1: &mut WriteBuffer, output2: &mut /// Run the test! /// /// See the README for a high-level description of this design. -fn run_dynamic_test(test_dylib: &LinkOutput, full_test_name: &str) -> Result { +fn run_dynamic_test(test_dylib: &LinkOutput, _full_test_name: &str) -> Result { // Initialize all the buffers the tests will write to let mut caller_inputs = WriteBuffer::new(); let mut caller_outputs = WriteBuffer::new(); @@ -146,12 +147,12 @@ fn run_dynamic_test(test_dylib: &LinkOutput, full_test_name: &str) -> Result = lib.get(b"test_start")?; - eprintln!("running {full_test_name}"); - + debug!("calling harness dynamic function"); // Actually run the test! do_test( write_field, diff --git a/src/log.rs b/src/log.rs new file mode 100644 index 0000000..5de98f6 --- /dev/null +++ b/src/log.rs @@ -0,0 +1,443 @@ +#![allow(dead_code)] + +use console::Style; +use linked_hash_map::LinkedHashMap; +use std::{ + collections::{BTreeMap, HashMap, HashSet}, + ops::Range, +}; +use tracing::{Id, Level}; +use tracing_subscriber::Layer; + +use std::sync::{Arc, Mutex}; + +const TRACE_TEST_SPAN: &str = "test"; +const IGNORE_LIST: &[&str] = &[]; + +/// An in-memory logger that lets us view particular +/// spans of the logs, and understands minidump-stackwalk's +/// span format for threads/frames during stackwalking. +#[derive(Default, Debug, Clone)] +pub struct MapLogger { + state: Arc>, +} + +type SpanId = u64; + +#[derive(Default, Debug, Clone)] +struct MapLoggerInner { + root_span: SpanEntry, + sub_spans: LinkedHashMap, + + last_query: Option, + cur_string: Option>, + + test_spans: HashSet, + live_spans: HashMap, + next_span_id: SpanId, +} + +#[derive(Default, Debug, Clone)] +struct SpanEntry { + destroyed: bool, + name: String, + fields: BTreeMap, + events: Vec, +} + +#[derive(Debug, Clone)] +enum EventEntry { + Span(SpanId), + Message(MessageEntry), +} + +#[allow(dead_code)] +#[derive(Debug, Clone)] +struct MessageEntry { + level: Level, + fields: BTreeMap, + target: String, +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +enum Query { + All, + Span(SpanId), +} + +impl MapLogger { + pub fn new() -> Self { + Self::default() + } + pub fn clear(&self) { + let mut log = self.state.lock().unwrap(); + let ids = log.sub_spans.keys().cloned().collect::>(); + for id in ids { + let span = log.sub_spans.get_mut(&id).unwrap(); + if !span.destroyed { + span.events.clear(); + continue; + } + log.sub_spans.remove(&id); + } + log.root_span.events.clear(); + log.cur_string = None; + } + + fn print_span_if_test(&self, span_id: &Id) { + let span = { + let log = self.state.lock().unwrap(); + let Some(span) = log.live_spans.get(span_id) else { + return; + }; + if !log.test_spans.contains(span) { + return; + } + *span + }; + eprintln!("{}", self.string_for_span(span)); + } + + pub fn string_for_span(&self, span: SpanId) -> Arc { + self.string_query(Query::Span(span)) + } + /* + pub fn string_for_all(&self) -> Arc { + self.string_query(Query::All) + } + + pub fn string_for_thread(&self, thread_idx: usize) -> Arc { + let thread = self + .state + .lock() + .unwrap() + .thread_spans + .get(&thread_idx) + .cloned(); + + if let Some(thread) = thread { + self.string_query(Query::Thread(thread)) + } else { + Arc::new(String::from("thread whoops!")) + // self.string_query(Query::All) + } + } + + pub fn string_for_frame(&self, thread_idx: usize, frame_idx: usize) -> Arc { + let thread = self + .state + .lock() + .unwrap() + .thread_spans + .get(&thread_idx) + .cloned(); + + let frame = self + .state + .lock() + .unwrap() + .frame_spans + .get(&(thread_idx, frame_idx)) + .cloned(); + + if let (Some(thread), Some(frame)) = (thread, frame) { + self.string_query(Query::Frame(thread, frame)) + } else { + Arc::new(String::from("frame whoops!")) + // self.string_query(Query::All) + } + } + */ + fn string_query(&self, query: Query) -> Arc { + use std::fmt::Write; + + fn print_indent(output: &mut String, depth: usize) { + write!(output, "{:indent$}", "", indent = depth * 4).unwrap(); + } + fn print_span_recursive( + output: &mut String, + sub_spans: &LinkedHashMap, + depth: usize, + span: &SpanEntry, + range: Option>, + ) { + if !span.name.is_empty() { + print_indent(output, depth); + let style = Style::new().blue(); + write!(output, "{}", style.apply_to(&span.name)).unwrap(); + for (key, val) in &span.fields { + if key == "id" { + write!(output, " {}", style.apply_to(val)).unwrap(); + } else { + write!(output, "{key}: {val}").unwrap(); + } + } + writeln!(output).unwrap(); + } + + let event_range = if let Some(range) = range { + &span.events[range] + } else { + &span.events[..] + }; + for event in event_range { + match event { + EventEntry::Message(event) => { + if event.fields.contains_key("message") { + print_indent(output, depth + 1); + print_event(output, event); + } + } + EventEntry::Span(sub_span) => { + print_span_recursive( + output, + sub_spans, + depth + 1, + &sub_spans[sub_span], + None, + ); + } + } + } + } + + let mut log = self.state.lock().unwrap(); + if Some(query) == log.last_query { + if let Some(string) = &log.cur_string { + return string.clone(); + } + } + log.last_query = Some(query); + + let mut output = String::new(); + + let (span_to_print, range) = match query { + Query::All => (&log.root_span, None), + Query::Span(span_id) => (&log.sub_spans[&span_id], None), + }; + + print_span_recursive(&mut output, &log.sub_spans, 0, span_to_print, range); + + let result = Arc::new(output); + log.cur_string = Some(result.clone()); + result + } +} + +fn immediate_event(event: &MessageEntry) { + let mut output = String::new(); + print_event(&mut output, event); + eprintln!("{}", output); +} + +fn print_event(output: &mut String, event: &MessageEntry) { + use std::fmt::Write; + if let Some(message) = event.fields.get("message") { + let style = match event.level { + Level::ERROR => Style::new().red(), + Level::WARN => Style::new().yellow(), + Level::INFO => Style::new(), + Level::DEBUG => Style::new().blue(), + Level::TRACE => Style::new().green(), + }; + // writeln!(output, "[{:5}] {}", event.level, message).unwrap(); + writeln!(output, "{}", style.apply_to(message)).unwrap(); + } +} + +impl Layer for MapLogger +where + S: tracing::Subscriber, + S: for<'lookup> tracing_subscriber::registry::LookupSpan<'lookup>, +{ + fn on_event(&self, event: &tracing::Event<'_>, ctx: tracing_subscriber::layer::Context<'_, S>) { + let target = event.metadata().target(); + if IGNORE_LIST.iter().any(|module| target.starts_with(module)) { + return; + } + let mut log = self.state.lock().unwrap(); + // Invalidate any cached log printout + log.cur_string = None; + + // Grab the parent span (or the dummy root span) + let (cur_span, is_root) = if let Some(span) = ctx.event_span(event) { + let span_id = log.live_spans[&span.id()]; + (log.sub_spans.get_mut(&span_id).unwrap(), false) + } else { + (&mut log.root_span, true) + }; + + // Grab the fields + let mut fields = BTreeMap::new(); + let mut visitor = MapVisitor(&mut fields); + event.record(&mut visitor); + + // Store the message in the span + let event = MessageEntry { + level: *event.metadata().level(), + fields, + target: target.to_owned(), + }; + if is_root { + immediate_event(&event); + } + cur_span.events.push(EventEntry::Message(event)); + } + + fn on_new_span( + &self, + attrs: &tracing::span::Attributes<'_>, + id: &tracing::span::Id, + ctx: tracing_subscriber::layer::Context<'_, S>, + ) { + // let target = attrs.metadata().target(); + let mut log = self.state.lock().unwrap(); + // Create a new persistent id for this span, `tracing` may recycle its ids + let new_span_id = log.next_span_id; + log.next_span_id += 1; + log.live_spans.insert(id.clone(), new_span_id); + + // Get the parent span (or dummy root span) + let span = ctx.span(id).unwrap(); + let parent_span = if let Some(parent) = span.parent() { + let parent_span_id = log.live_spans[&parent.id()]; + log.sub_spans.get_mut(&parent_span_id).unwrap() + } else { + &mut log.root_span + }; + + // Store the span at this point in the parent spans' messages, + // so when we print out the parent span, this whole span will + // print out "atomically" at this precise point in the log stream + // which basically reconstitutes the logs of a sequential execution! + parent_span.events.push(EventEntry::Span(new_span_id)); + + // The actual span, with some info TBD + let mut new_entry = SpanEntry { + destroyed: false, + name: span.name().to_owned(), + fields: BTreeMap::new(), + events: Vec::new(), + }; + + // Collect up fields for the span, and detect if it's a thread/frame span + let mut visitor = SpanVisitor(&mut new_entry); + attrs.record(&mut visitor); + + if span.name() == TRACE_TEST_SPAN { + log.test_spans.insert(new_span_id); + } + + log.sub_spans.insert(new_span_id, new_entry); + } + + fn on_close(&self, id: Id, _ctx: tracing_subscriber::layer::Context<'_, S>) { + // Mark the span as GC-able and remove it from the live mappings, + // as tracing may now recycle the id for future spans! + self.print_span_if_test(&id); + let mut log = self.state.lock().unwrap(); + let Some(&span_id) = log.live_spans.get(&id) else { + // Skipped span, ignore + return; + }; + log.sub_spans.get_mut(&span_id).unwrap().destroyed = true; + log.live_spans.remove(&id); + } + + fn on_record( + &self, + id: &tracing::span::Id, + values: &tracing::span::Record<'_>, + _ctx: tracing_subscriber::layer::Context<'_, S>, + ) { + let mut log = self.state.lock().unwrap(); + + // Update fields... idk we don't really need/use this but sure whatever + let mut new_fields = BTreeMap::new(); + let mut visitor = MapVisitor(&mut new_fields); + values.record(&mut visitor); + + let span_id = log.live_spans[id]; + log.sub_spans + .get_mut(&span_id) + .unwrap() + .fields + .append(&mut new_fields); + } +} + +/// Same as MapVisitor but grabs the special `idx: u64` field +struct SpanVisitor<'a>(&'a mut SpanEntry); + +impl<'a> tracing::field::Visit for SpanVisitor<'a> { + fn record_f64(&mut self, field: &tracing::field::Field, value: f64) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_i64(&mut self, field: &tracing::field::Field, value: i64) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_u64(&mut self, field: &tracing::field::Field, value: u64) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_bool(&mut self, field: &tracing::field::Field, value: bool) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_str(&mut self, field: &tracing::field::Field, value: &str) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_error( + &mut self, + field: &tracing::field::Field, + value: &(dyn std::error::Error + 'static), + ) { + self.0.fields.insert(field.to_string(), value.to_string()); + } + + fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) { + self.0 + .fields + .insert(field.to_string(), format!("{value:?}")); + } +} + +/// Super boring generic field slurping +struct MapVisitor<'a>(&'a mut BTreeMap); + +impl<'a> tracing::field::Visit for MapVisitor<'a> { + fn record_f64(&mut self, field: &tracing::field::Field, value: f64) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_i64(&mut self, field: &tracing::field::Field, value: i64) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_u64(&mut self, field: &tracing::field::Field, value: u64) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_bool(&mut self, field: &tracing::field::Field, value: bool) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_str(&mut self, field: &tracing::field::Field, value: &str) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_error( + &mut self, + field: &tracing::field::Field, + value: &(dyn std::error::Error + 'static), + ) { + self.0.insert(field.to_string(), value.to_string()); + } + + fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) { + self.0.insert(field.to_string(), format!("{value:?}")); + } +} diff --git a/src/main.rs b/src/main.rs index 1083b8a..7e5cb20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ mod cli; mod error; mod fivemat; mod harness; +mod log; mod procgen; mod report; @@ -16,6 +17,7 @@ use std::error::Error; use std::process::Command; use std::sync::{Arc, Mutex}; use tokio::sync::OnceCell; +use tracing::{debug, info, warn}; use vals::ValueGeneratorKind; pub type SortedMap = std::collections::BTreeMap; @@ -147,6 +149,7 @@ impl TestHarness { } /// Generate, Compile, Link, Load, and Run this test. + #[tracing::instrument(name = "test", skip_all, fields(id = self.base_id(&test_key, None, "::")))] pub async fn do_test( &self, test_key: TestKey, @@ -165,7 +168,7 @@ impl TestHarness { let source = match run_results.source.as_ref().unwrap() { Ok(v) => v, Err(e) => { - eprintln!("Failed to generate source: {}", e); + warn!("Failed to generate source: {}", e); return run_results; } }; @@ -178,7 +181,7 @@ impl TestHarness { let build = match run_results.build.as_ref().unwrap() { Ok(v) => v, Err(e) => { - eprintln!("Failed to build test: {}", e); + warn!("Failed to build test: {}", e); return run_results; } }; @@ -191,7 +194,7 @@ impl TestHarness { let link = match run_results.link.as_ref().unwrap() { Ok(v) => v, Err(e) => { - eprintln!("Failed to link test: {}", e); + warn!("Failed to link test: {}", e); return run_results; } }; @@ -204,7 +207,7 @@ impl TestHarness { let run = match run_results.run.as_ref().unwrap() { Ok(v) => v, Err(e) => { - eprintln!("Failed to run test: {}", e); + warn!("Failed to run test: {}", e); return run_results; } }; @@ -220,12 +223,8 @@ impl TestHarness { } fn main() -> Result<(), Box> { - eprintln!("starting!"); let cfg = cli::make_app(); - eprintln!("parsed cli!"); - // Before doing anything, regenerate the procgen tests, if needed. - // procgen::procgen_tests(cfg.procgen_tests); - eprintln!("generated tests!"); + debug!("parsed cli!"); let out_dir = init_dirs()?; let mut harness = TestHarness::new(); @@ -258,12 +257,12 @@ fn main() -> Result<(), Box> { abis::RustcAbiImpl::new(&cfg, Some(path.to_owned())), ); } - eprintln!("configured ABIs!"); + debug!("configured ABIs!"); // Grab all the tests let tests = read_tests(cfg.val_generator)?; harness.set_tests(tests); - eprintln!("got tests!"); + debug!("loaded tests!"); let harness = Arc::new(harness); // Run the tests use TestConclusion::*; @@ -318,13 +317,7 @@ fn main() -> Result<(), Box> { out_dir.clone(), ); - // FIXME: we can make everything parallel by immediately returning - // and making the following code happen in subsequent pass. For now - // let's stay single-threaded to do things one step at a time. - // Some((test_key, rules, task)) - - let results = rt.block_on(task).expect("failed to join task"); - Some(report_test(test_key, rules, results)) + Some((test_key, rules, task)) }) .collect() }) @@ -333,7 +326,13 @@ fn main() -> Result<(), Box> { .collect::>(); // Join on all the tasks, and compute their results - let reports = tasks.into_iter().map(|report| report).collect::>(); + let reports = tasks + .into_iter() + .map(|(test_key, rules, task)| { + let results = rt.block_on(task).expect("failed to join task"); + report_test(test_key, rules, results) + }) + .collect::>(); // Compute the final report let mut num_tests = 0; @@ -384,7 +383,7 @@ fn do_thing( out_dir: &Utf8Path, reports: &FullReport, ) { - eprintln!("rerunning failures"); + info!("rerunning failures"); for report in &reports.tests { let Some(check) = report.results.check.as_ref() else { continue; @@ -431,14 +430,14 @@ fn do_thing( test_key.options.functions = functions; test_key.options.val_writer = WriteImpl::Print; let rules = report.rules.clone(); - eprintln!("rerunning {}", harness.base_id(&test_key, None, "::")); + debug!("rerunning {}", harness.base_id(&test_key, None, "::")); let task = harness .clone() .spawn_test(rt, rules, test_key, out_dir.to_owned()); let results = rt.block_on(task).expect("failed to join task"); let source = results.source.unwrap().unwrap(); - eprintln!(" caller: {}", source.caller_src); - eprintln!(" callee: {}", source.callee_src); + debug!(" caller: {}", source.caller_src); + debug!(" callee: {}", source.callee_src); } } } diff --git a/src/procgen.rs b/src/procgen.rs index fa8e572..8ba67c4 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -1,6 +1,7 @@ +/* use std::io::Write; use std::path::PathBuf; -/* + const PROCGEN_ROOT: &str = "tests/procgen"; /// For tests that are too tedious to even hand-write the .ron file, @@ -45,10 +46,7 @@ pub fn procgen_test_for_ty_file( } */ -pub fn procgen_test_for_ty_string( - ty_name: &str, - ty_def: Option<&str>, -) -> String { +pub fn procgen_test_for_ty_string(ty_name: &str, ty_def: Option<&str>) -> String { let mut test_body = String::new(); procgen_test_for_ty_impl(&mut test_body, ty_name, ty_def).unwrap(); test_body @@ -119,12 +117,7 @@ fn add_structs(out: &mut dyn std::fmt::Write, ty: &str) -> std::fmt::Result { // Check that by-val works add_func(out, &format!("struct_in_{len}"), &[&struct_ty], &[])?; // Check that by-ref works, for good measure - add_func( - out, - &format!("ref_struct_in_{len}"), - &[&struct_ty_ref], - &[], - )?; + add_func(out, &format!("ref_struct_in_{len}"), &[&struct_ty_ref], &[])?; } Ok(()) } From 11c2ad30e08432edc06e68f8783f5f794a5dd2f1 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 26 Jun 2024 22:37:04 -0400 Subject: [PATCH 29/44] cleanup and asyncify --- Cargo.lock | 103 +------------- Cargo.toml | 7 +- src/abis/mod.rs | 53 +++++-- src/abis/rust.rs | 10 +- src/abis/vals.rs | 2 +- src/error.rs | 17 +-- src/harness/build.rs | 2 +- src/harness/check.rs | 56 +++++--- src/harness/generate.rs | 10 +- src/harness/mod.rs | 187 ++++++++++++++++++++++++- src/harness/read.rs | 105 ++++++++------ src/main.rs | 300 +++++++++++----------------------------- tests/normal/anons.kdl | 35 +++++ 13 files changed, 463 insertions(+), 424 deletions(-) create mode 100644 tests/normal/anons.kdl diff --git a/Cargo.lock b/Cargo.lock index f8691cd..ff7e952 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ dependencies = [ "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", "clap", "console", - "kdl 4.4.1-alpha.0", + "kdl", "kdl-script", "libloading", "linked-hash-map", @@ -19,7 +19,6 @@ dependencies = [ "rand", "rand_core", "rand_pcg", - "rayon", "ron", "serde", "serde_json", @@ -262,57 +261,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "once_cell", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -474,16 +422,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" -[[package]] -name = "kdl" -version = "4.4.1-alpha.0" -source = "git+https://github.com/Gankra/kdl-rs?branch=spanned#7554c035c89dc57e2857b036a2d35c6a0ee3d993" -dependencies = [ - "miette", - "nom", - "thiserror", -] - [[package]] name = "kdl" version = "4.6.0" @@ -497,10 +435,12 @@ dependencies = [ [[package]] name = "kdl-script" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4011d2a2b034ad725d379cd9c4892db44f4283890fd1d8b1051df0ca879890f" dependencies = [ "clap", - "kdl 4.6.0", + "kdl", "linked-hash-map", "miette", "nom", @@ -592,15 +532,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "miette" version = "5.10.0" @@ -824,30 +755,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "rayon" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index e4c0a2b..5fce522 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,6 @@ exclude = ["generated_impls/", "handwritten_impls/", "tests/"] [features] default = [] -# Doesn't actually work yet... -parallel = ["rayon"] [dependencies] @@ -18,15 +16,14 @@ camino = { version = "1.1.7", features = ["serde1"] } cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } clap = { version = "4.5.4", features = ["cargo", "wrap_help"] } console = "0.15.8" -kdl = { git = "https://github.com/Gankra/kdl-rs", branch = "spanned" } -kdl-script = { path = "../kdl-script" } +kdl = "4.6.0" +kdl-script = "0.3.0" libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } miette = { version = "5.3.0", features = ["fancy"] } rand = "0.8.5" rand_core = "0.6.4" rand_pcg = "0.3.1" -rayon = { version = "1.5.3", optional = true } ron = "0.7.0" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.83" diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 5ba919b..1a66d63 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -69,9 +69,20 @@ pub struct Test { pub name: String, /// Parsed and Typechecked kdl-script program pub types: Arc, +} + +#[derive(Debug, Clone)] +pub struct TestWithVals { + pub inner: Arc, /// Values that the test should have pub vals: Arc, } +impl std::ops::Deref for TestWithVals { + type Target = Test; + fn deref(&self) -> &Self::Target { + &self.inner + } +} /// Options for a test #[derive(Clone, Debug, Serialize)] @@ -186,13 +197,13 @@ impl std::fmt::Display for CallSide { /// However if a test fails we can requery with "just this one failing function" /// to generate a minimized test-case for debugging/reporting. #[derive(Debug, Clone)] -pub struct TestForAbi { - pub inner: Test, +pub struct TestWithAbi { + pub inner: Arc, pub env: Arc, pub defs: Arc, } -impl std::ops::Deref for TestForAbi { - type Target = Test; +impl std::ops::Deref for TestWithAbi { + type Target = TestWithVals; fn deref(&self) -> &Self::Target { &self.inner } @@ -209,7 +220,7 @@ impl std::ops::Deref for TestForAbi { /// This also contains some utilities for interning compute type names/expressions. #[derive(Debug, Clone)] pub struct TestImpl { - pub inner: TestForAbi, + pub inner: Arc, pub options: TestOptions, // interning state @@ -218,7 +229,7 @@ pub struct TestImpl { pub borrowed_tynames: HashMap, } impl std::ops::Deref for TestImpl { - type Target = TestForAbi; + type Target = TestWithAbi; fn deref(&self) -> &Self::Target { &self.inner } @@ -257,16 +268,30 @@ pub trait AbiImpl { } impl Test { - pub fn has_convention(&self, _convention: CallingConvention) -> bool { - true + pub fn has_convention(&self, convention: CallingConvention) -> bool { + convention != CallingConvention::Handwritten } - pub async fn for_abi( - &self, + + pub async fn with_vals( + self: &Arc, + vals: ValueGeneratorKind, + ) -> Result, GenerateError> { + let vals = Arc::new(ValueTree::new(&self.types, vals)); + Ok(Arc::new(TestWithVals { + inner: self.clone(), + vals, + })) + } +} + +impl TestWithVals { + pub async fn with_abi( + self: &Arc, abi: &(dyn AbiImpl + Send + Sync), - ) -> Result, GenerateError> { + ) -> Result, GenerateError> { let env = abi.pun_env(); let defs = Arc::new(self.types.definition_graph(&env)?); - Ok(Arc::new(TestForAbi { + Ok(Arc::new(TestWithAbi { inner: self.clone(), env, defs, @@ -274,8 +299,8 @@ impl Test { } } -impl TestForAbi { - pub fn with_options(&self, options: TestOptions) -> Result { +impl TestWithAbi { + pub fn with_options(self: &Arc, options: TestOptions) -> Result { let desired_funcs = options.functions.active_funcs(&self.types); Ok(TestImpl { inner: self.clone(), diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 36cbbf0..a241005 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -426,7 +426,7 @@ impl RustcAbiImpl { .iter() .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); - ((*struct_ty.name).clone(), borrowed_tyname) + (struct_ty.name.to_string(), borrowed_tyname) } Ty::Union(union_ty) => { let has_borrows = union_ty @@ -434,9 +434,9 @@ impl RustcAbiImpl { .iter() .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); - ((*union_ty.name).clone(), borrowed_tyname) + (union_ty.name.to_string(), borrowed_tyname) } - Ty::Enum(enum_ty) => ((*enum_ty.name).clone(), None), + Ty::Enum(enum_ty) => ((**enum_ty.name).clone(), None), Ty::Tagged(tagged_ty) => { let has_borrows = tagged_ty.variants.iter().any(|v| { v.fields @@ -449,7 +449,7 @@ impl RustcAbiImpl { .unwrap_or(false) }); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); - ((*tagged_ty.name).clone(), borrowed_tyname) + (tagged_ty.name.to_string(), borrowed_tyname) } Ty::Alias(AliasTy { name, real, attrs }) => { assert!( @@ -460,7 +460,7 @@ impl RustcAbiImpl { .borrowed_tynames .get(real) .map(|name| format!("{name}<'a>")); - ((**name).clone(), borrowed_tyname) + (name.to_string(), borrowed_tyname) } // Puns should be evaporated diff --git a/src/abis/vals.rs b/src/abis/vals.rs index ca7c71a..3131c61 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -69,7 +69,7 @@ enum ValueGeneratorBuilder { Random { rng: RngImpl }, } -#[derive(Debug, Copy, Clone, Serialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub enum ValueGeneratorKind { Graffiti, Random { seed: u64 }, diff --git a/src/error.rs b/src/error.rs index 142e072..a9c7cb2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,19 +1,16 @@ -#[derive(Debug, thiserror::Error)] +use miette::Diagnostic; + +#[derive(Debug, thiserror::Error, Diagnostic)] #[allow(dead_code)] pub enum GenerateError { #[error("io error\n{0}")] Fmt(#[from] std::fmt::Error), #[error("io error\n{0}")] Io(#[from] std::io::Error), - #[error("parse error {0}\n{2}\n{}\n{:width$}^", - .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), - "", - width=.2.position.col.saturating_sub(1), - )] - ParseError(String, String, ron::error::Error), - #[error("kdl parse error {}", .2)] - KdlParseError(String, String, kdl::KdlError), - #[error("kdl-script error {0}")] + #[error("kdl parse error")] + KdlParseError(String, String, #[source] kdl::KdlError), + #[error(transparent)] + #[diagnostic(transparent)] KdlScriptError(#[from] kdl_script::KdlScriptError), #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] InconsistentStructDefinition { diff --git a/src/harness/build.rs b/src/harness/build.rs index a163639..05809a8 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -43,7 +43,7 @@ impl TestHarness { let lib_name = self.static_lib_name(key, call_side); // Briefly lock this map to insert/acquire a OnceCell and then release the lock let once = self - .static_libs + .built_static_libs .lock() .unwrap() .entry(lib_name.clone()) diff --git a/src/harness/check.rs b/src/harness/check.rs index 8112efa..8341d8d 100644 --- a/src/harness/check.rs +++ b/src/harness/check.rs @@ -18,7 +18,10 @@ impl TestHarness { callee_outputs, }: &RunOutput, ) -> CheckOutput { - let test = self.tests[&key.test].clone(); + let test = self + .test_with_vals(&key.test, key.options.val_generator) + .await + .expect("check-test called before test_with_vals!?"); let options = &key.options; // Now check the results @@ -101,15 +104,18 @@ impl TestHarness { .zip(caller_inputs) .zip(callee_inputs) { - if let Err(e) = self.check_vals( - key, - "input", - func_idx, - arg_idx, - expected_arg, - caller_vals, - callee_vals, - ) { + if let Err(e) = self + .check_vals( + key, + "input", + func_idx, + arg_idx, + expected_arg, + caller_vals, + callee_vals, + ) + .await + { results.push(Err(e)); continue 'funcs; } @@ -121,15 +127,18 @@ impl TestHarness { .zip(caller_outputs) .zip(callee_outputs) { - if let Err(e) = self.check_vals( - key, - "output", - func_idx, - arg_idx, - expected_arg, - caller_vals, - callee_vals, - ) { + if let Err(e) = self + .check_vals( + key, + "output", + func_idx, + arg_idx, + expected_arg, + caller_vals, + callee_vals, + ) + .await + { results.push(Err(e)); continue 'funcs; } @@ -181,17 +190,20 @@ impl TestHarness { } #[allow(clippy::too_many_arguments)] - fn check_vals( + async fn check_vals<'a>( &self, key: &TestKey, arg_kind: &str, func_idx: usize, arg_idx: usize, - mut expected_arg: ArgValuesIter, + mut expected_arg: ArgValuesIter<'a>, caller_vals: &Vec>, callee_vals: &Vec>, ) -> Result<(), CheckFailure> { - let test = &self.tests[&key.test]; + let test = self + .test_with_vals(&key.test, key.options.val_generator) + .await + .expect("check called before test_with_vals!?"); let types = &test.types; let options = &key.options; let func = types.realize_func(func_idx); diff --git a/src/harness/generate.rs b/src/harness/generate.rs index 6391a1e..da020b8 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -30,14 +30,16 @@ impl TestHarness { key: &TestKey, call_side: CallSide, ) -> Result { - let test = self.tests[&key.test].clone(); + let test = self + .test_with_vals(&key.test, key.options.val_generator) + .await?; let abi_id = key.abi_id(call_side).to_owned(); - let test_with_abi = self.test_with_abi_impl(&test, abi_id).await?; + let test_with_abi = self.test_with_abi_impl(test, abi_id).await?; let src_path = self.src_path(key, call_side); // Briefly lock this map to insert/acquire a OnceCell and then release the lock let once = self - .sources + .generated_sources .lock() .unwrap() .entry(src_path.clone()) @@ -82,7 +84,7 @@ pub fn init_generate_dir() -> Result<(), GenerateError> { async fn generate_src( src_path: &Utf8Path, abi: Arc, - test_with_abi: Arc, + test_with_abi: Arc, call_side: CallSide, options: TestOptions, ) -> Result<(), GenerateError> { diff --git a/src/harness/mod.rs b/src/harness/mod.rs index ba9663b..010c48e 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -6,12 +6,18 @@ //! 4. running the test impls //! 5. checking the test results -use std::error::Error; - use crate::{ - vals::ValueGeneratorKind, ArgSelector, CallSide, FunctionSelector, TestHarness, TestKey, - TestOptions, ValSelector, WriteImpl, + get_test_rules, vals::ValueGeneratorKind, AbiImpl, AbiImplId, ArgSelector, CallSide, + FunctionSelector, GenerateError, SortedMap, Test, TestId, TestKey, TestOptions, TestRules, + TestRunMode, TestRunResults, TestWithAbi, TestWithVals, ValSelector, WriteImpl, +}; +use camino::Utf8PathBuf; +use std::{ + error::Error, + sync::{Arc, Mutex}, }; +use tokio::sync::OnceCell; +use tracing::warn; mod build; mod check; @@ -20,11 +26,180 @@ mod read; mod run; use build::init_build_dir; -use camino::Utf8PathBuf; use generate::init_generate_dir; -pub use read::read_tests; +pub use read::{find_tests, spawn_read_test}; pub use run::WriteBuffer; +pub type Memoized = Mutex>>>; + +#[derive(Default)] +pub struct TestHarness { + abi_impls: SortedMap>, + tests: SortedMap>, + tests_with_vals: Memoized<(TestId, ValueGeneratorKind), Arc>, + tests_with_abi_impl: Memoized<(TestId, ValueGeneratorKind, AbiImplId), Arc>, + generated_sources: Memoized, + built_static_libs: Memoized, +} + +impl TestHarness { + pub fn new(tests: SortedMap>) -> Self { + Self { + tests, + ..Self::default() + } + } + pub fn add_abi_impl(&mut self, id: AbiImplId, abi_impl: A) { + let old = self.abi_impls.insert(id.clone(), Arc::new(abi_impl)); + assert!(old.is_none(), "duplicate abi impl id: {}", id); + } + pub fn abi_by_test_key( + &self, + key: &TestKey, + call_side: CallSide, + ) -> Arc { + let abi_id = key.abi_id(call_side); + self.abi_impls[abi_id].clone() + } + pub fn all_tests(&self) -> Vec> { + self.tests.values().cloned().collect() + } + pub fn test(&self, test: &TestId) -> Arc { + self.tests[test].clone() + } + pub async fn test_with_vals( + &self, + test_id: &TestId, + vals: ValueGeneratorKind, + ) -> Result, GenerateError> { + let test_id = test_id.clone(); + let test = self.test(&test_id); + let once = self + .tests_with_vals + .lock() + .unwrap() + .entry((test_id, vals)) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let output = once.get_or_try_init(|| test.with_vals(vals)).await?.clone(); + Ok(output) + } + pub async fn test_with_abi_impl( + &self, + test: Arc, + abi_id: AbiImplId, + ) -> Result, GenerateError> { + let test_id = test.name.clone(); + let vals = test.vals.generator_kind; + let abi_impl = self.abi_impls[&abi_id].clone(); + // Briefly lock this map to insert/acquire a OnceCell and then release the lock + let once = self + .tests_with_abi_impl + .lock() + .unwrap() + .entry((test_id, vals, abi_id.clone())) + .or_insert_with(|| Arc::new(OnceCell::new())) + .clone(); + // Either acquire the cached result, or make it + let output = once + .get_or_try_init(|| test.with_abi(&*abi_impl)) + .await? + .clone(); + Ok(output) + } + pub fn get_test_rules(&self, test_key: &TestKey) -> TestRules { + let caller = self.abi_impls[&test_key.caller].clone(); + let callee = self.abi_impls[&test_key.callee].clone(); + + get_test_rules(test_key, &*caller, &*callee) + } + + pub fn spawn_test( + self: Arc, + rt: &tokio::runtime::Runtime, + rules: TestRules, + test_key: TestKey, + out_dir: Utf8PathBuf, + ) -> tokio::task::JoinHandle { + let harness = self.clone(); + rt.spawn(async move { harness.do_test(test_key, rules, out_dir).await }) + } + + /// Generate, Compile, Link, Load, and Run this test. + #[tracing::instrument(name = "test", skip_all, fields(id = self.base_id(&test_key, None, "::")))] + pub async fn do_test( + &self, + test_key: TestKey, + test_rules: TestRules, + out_dir: Utf8PathBuf, + ) -> TestRunResults { + use TestRunMode::*; + + let mut run_results = TestRunResults::default(); + if test_rules.run <= Skip { + return run_results; + } + + run_results.ran_to = Generate; + run_results.source = Some(self.generate_test(&test_key).await); + let source = match run_results.source.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + warn!("Failed to generate source: {}", e); + return run_results; + } + }; + if test_rules.run <= Generate { + return run_results; + } + + run_results.ran_to = Build; + run_results.build = Some(self.build_test(&test_key, source, &out_dir).await); + let build = match run_results.build.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + warn!("Failed to build test: {}", e); + return run_results; + } + }; + if test_rules.run <= Build { + return run_results; + } + + run_results.ran_to = Link; + run_results.link = Some(self.link_dynamic_lib(&test_key, build, &out_dir).await); + let link = match run_results.link.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + warn!("Failed to link test: {}", e); + return run_results; + } + }; + if test_rules.run <= Link { + return run_results; + } + + run_results.ran_to = Run; + run_results.run = Some(self.run_dynamic_test(&test_key, link).await); + let run = match run_results.run.as_ref().unwrap() { + Ok(v) => v, + Err(e) => { + warn!("Failed to run test: {}", e); + return run_results; + } + }; + if test_rules.run <= Run { + return run_results; + } + + run_results.ran_to = Check; + run_results.check = Some(self.check_test(&test_key, run).await); + + run_results + } +} + pub fn init_dirs() -> Result> { init_generate_dir()?; let build_dir = init_build_dir()?; diff --git a/src/harness/read.rs b/src/harness/read.rs index 3f5584d..c1ab675 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -1,21 +1,24 @@ use std::{ fs::File, io::{BufReader, Read}, - path::{Path, PathBuf}, + path::Path, sync::Arc, }; +use camino::{Utf8Path, Utf8PathBuf}; use tracing::warn; -use crate::{ - error::*, - vals::{ValueGeneratorKind, ValueTree}, - Test, -}; +use crate::{error::*, SortedMap, Test, TestId}; + +#[derive(Debug, Clone)] +pub enum TestFile { + Kdl(Utf8PathBuf), + KdlProcgen(Utf8PathBuf), +} -pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, GenerateError> { - let mut tests = vec![]; - let mut dirs = vec![PathBuf::from("tests")]; +pub fn find_tests(start_dir: &Path) -> Result, GenerateError> { + let mut tests = SortedMap::new(); + let mut dirs = vec![start_dir.to_owned()]; while let Some(dir) = dirs.pop() { for entry in std::fs::read_dir(dir)? { let entry = entry?; @@ -26,54 +29,72 @@ pub fn read_tests(value_generator: ValueGeneratorKind) -> Result, Gene continue; } - // Otherwise, assume it's a test and parse it - let test = match read_test_manifest(entry.path().to_owned(), value_generator) { - Ok(test) => test, - Err(e) => { - warn!("test {:?}'s file couldn't be parsed {}", entry, e); - continue; - } + let path = entry.path(); + let test_file = Utf8PathBuf::from_path_buf(path).expect("non-utf8 test path"); + let Some((name, test)) = classify_test(&test_file) else { + warn!("test isn't a known test format: {}", test_file); + continue; }; - tests.push(test); + tests.insert(name, test); } } - tests.sort_by(|t1, t2| t1.name.cmp(&t2.name)); - // FIXME: assert test names don't collide! - Ok(tests) } +pub fn spawn_read_test( + rt: &tokio::runtime::Runtime, + test: TestId, + test_file: TestFile, +) -> tokio::task::JoinHandle, GenerateError>> { + rt.spawn(async move { read_test(test, test_file).await }) +} + /// Read a test .kdl file -fn read_test_manifest( - test_file: PathBuf, - value_generator: ValueGeneratorKind, -) -> Result { - let (input, test_name) = - if let Some(test_name) = filename(&test_file).strip_suffix(".procgen.kdl") { +async fn read_test(test: TestId, test_file: TestFile) -> Result, GenerateError> { + read_test_inner(&test, test_file).await.map_err(|e| { + warn!( + "failed to read and parse test {test}, skipping\n{:?}", + miette::Report::new(e) + ); + GenerateError::Skipped + }) +} + +async fn read_test_inner(test: &TestId, test_file: TestFile) -> Result, GenerateError> { + let (test_file, input) = match test_file { + TestFile::KdlProcgen(test_file) => { let ty_def = read_file_to_string(&test_file)?; - let input = crate::procgen::procgen_test_for_ty_string(test_name, Some(&ty_def)); - (input, test_name) - } else if let Some(test_name) = filename(&test_file).strip_suffix(".kdl") { + let input = crate::procgen::procgen_test_for_ty_string(&test, Some(&ty_def)); + (test_file, input) + } + TestFile::Kdl(test_file) => { let input = read_file_to_string(&test_file)?; - (input, test_name) - } else { - return Err(GenerateError::Skipped); - }; + (test_file, input) + } + }; let mut compiler = kdl_script::Compiler::new(); - let types = compiler.compile_string(&test_file.to_string_lossy(), input)?; - let vals = Arc::new(ValueTree::new(&types, value_generator)); - Ok(Test { - name: test_name.to_owned(), + let types = compiler.compile_string(test_file.as_str(), input)?; + Ok(Arc::new(Test { + name: test.to_owned(), types, - vals, - }) + })) } -fn filename(file: &Path) -> &str { - file.file_name().and_then(|s| s.to_str()).unwrap_or("") +fn classify_test(test_file: &Utf8Path) -> Option<(String, TestFile)> { + let file_name = test_file.file_name().expect("test file had no name!?"); + if let Some(test_name) = file_name.strip_suffix(".procgen.kdl") { + Some(( + test_name.to_owned(), + TestFile::KdlProcgen(test_file.to_owned()), + )) + } else if let Some(test_name) = file_name.strip_suffix(".kdl") { + Some((test_name.to_owned(), TestFile::Kdl(test_file.to_owned()))) + } else { + None + } } -fn read_file_to_string(file: &Path) -> std::io::Result { +fn read_file_to_string(file: &Utf8Path) -> std::io::Result { let file = File::open(file)?; let mut reader = BufReader::new(file); let mut input = String::new(); diff --git a/src/main.rs b/src/main.rs index 7e5cb20..aa6d024 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,15 +9,15 @@ mod procgen; mod report; use abis::*; -use camino::{Utf8Path, Utf8PathBuf}; +use camino::Utf8Path; use error::*; use harness::*; use report::*; use std::error::Error; use std::process::Command; -use std::sync::{Arc, Mutex}; +use std::sync::Arc; use tokio::sync::OnceCell; -use tracing::{debug, info, warn}; +use tracing::{debug, info}; use vals::ValueGeneratorKind; pub type SortedMap = std::collections::BTreeMap; @@ -75,159 +75,26 @@ pub struct Config { #[error("some tests failed")] pub struct TestsFailed {} -#[derive(Default)] -pub struct TestHarness { - tests: SortedMap>, - abi_impls: SortedMap>, - test_with_abi_impls: Mutex>>>>, - sources: Mutex>>>, - static_libs: Mutex>>>, -} - -impl TestHarness { - pub fn new() -> Self { - Self::default() - } - pub fn add_abi_impl(&mut self, id: AbiImplId, abi_impl: A) { - let old = self.abi_impls.insert(id.clone(), Arc::new(abi_impl)); - assert!(old.is_none(), "duplicate abi impl id: {}", id); - } - pub fn abi_by_test_key( - &self, - key: &TestKey, - call_side: CallSide, - ) -> Arc { - let abi_id = key.abi_id(call_side); - self.abi_impls[abi_id].clone() - } - - pub fn set_tests(&mut self, tests: Vec) { - for test in tests { - let id = test.name.clone(); - let old = self.tests.insert(id.clone(), Arc::new(test)); - assert!(old.is_none(), "duplicate test id: {}", id); - } - } - pub async fn test_with_abi_impl( - &self, - test: &Test, - abi_id: AbiImplId, - ) -> Result, GenerateError> { - let test_id = test.name.clone(); - let abi_impl = self.abi_impls[&abi_id].clone(); - // Briefly lock this map to insert/acquire a OnceCell and then release the lock - let once = self - .test_with_abi_impls - .lock() - .unwrap() - .entry((test_id, abi_id.clone())) - .or_insert_with(|| Arc::new(OnceCell::new())) - .clone(); - // Either acquire the cached result, or make it - let output = once - .get_or_try_init(|| test.for_abi(&*abi_impl)) - .await? - .clone(); - Ok(output) - } - pub fn get_test_rules(&self, test_key: &TestKey) -> TestRules { - let caller = self.abi_impls[&test_key.caller].clone(); - let callee = self.abi_impls[&test_key.callee].clone(); - - get_test_rules(test_key, &*caller, &*callee) - } - - pub fn spawn_test( - self: Arc, - rt: &tokio::runtime::Runtime, - rules: TestRules, - test_key: TestKey, - out_dir: Utf8PathBuf, - ) -> tokio::task::JoinHandle { - let harness = self.clone(); - rt.spawn(async move { harness.do_test(test_key, rules, out_dir).await }) - } - - /// Generate, Compile, Link, Load, and Run this test. - #[tracing::instrument(name = "test", skip_all, fields(id = self.base_id(&test_key, None, "::")))] - pub async fn do_test( - &self, - test_key: TestKey, - test_rules: TestRules, - out_dir: Utf8PathBuf, - ) -> TestRunResults { - use TestRunMode::*; - - let mut run_results = TestRunResults::default(); - if test_rules.run <= Skip { - return run_results; - } - - run_results.ran_to = Generate; - run_results.source = Some(self.generate_test(&test_key).await); - let source = match run_results.source.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - warn!("Failed to generate source: {}", e); - return run_results; - } - }; - if test_rules.run <= Generate { - return run_results; - } - - run_results.ran_to = Build; - run_results.build = Some(self.build_test(&test_key, source, &out_dir).await); - let build = match run_results.build.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - warn!("Failed to build test: {}", e); - return run_results; - } - }; - if test_rules.run <= Build { - return run_results; - } - - run_results.ran_to = Link; - run_results.link = Some(self.link_dynamic_lib(&test_key, build, &out_dir).await); - let link = match run_results.link.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - warn!("Failed to link test: {}", e); - return run_results; - } - }; - if test_rules.run <= Link { - return run_results; - } - - run_results.ran_to = Run; - run_results.run = Some(self.run_dynamic_test(&test_key, link).await); - let run = match run_results.run.as_ref().unwrap() { - Ok(v) => v, - Err(e) => { - warn!("Failed to run test: {}", e); - return run_results; - } - }; - if test_rules.run <= Run { - return run_results; - } - - run_results.ran_to = Check; - run_results.check = Some(self.check_test(&test_key, run).await); - - run_results - } -} - fn main() -> Result<(), Box> { let cfg = cli::make_app(); debug!("parsed cli!"); let out_dir = init_dirs()?; - let mut harness = TestHarness::new(); + let rt = tokio::runtime::Runtime::new().expect("failed to init tokio runtime"); + let _handle = rt.enter(); + + // Grab all the tests + let test_sources = harness::find_tests(&std::path::PathBuf::from("tests"))?; + let read_tasks = test_sources + .into_iter() + .map(|(test, test_file)| harness::spawn_read_test(&rt, test, test_file)); + + // We could async pipeline this harder but it's nice to know all the tests upfront + let tests = read_tasks + .filter_map(|task| rt.block_on(task).expect("failed to join on task").ok()) + .map(|test| (test.name.clone(), test)) + .collect(); + let mut harness = TestHarness::new(tests); harness.add_abi_impl( ABI_IMPL_RUSTC.to_owned(), @@ -257,23 +124,17 @@ fn main() -> Result<(), Box> { abis::RustcAbiImpl::new(&cfg, Some(path.to_owned())), ); } + debug!("configured ABIs!"); + let harness = Arc::new(harness); - // Grab all the tests - let tests = read_tests(cfg.val_generator)?; - harness.set_tests(tests); debug!("loaded tests!"); - let harness = Arc::new(harness); // Run the tests use TestConclusion::*; - let rt = tokio::runtime::Runtime::new().expect("failed to init tokio runtime"); - let _handle = rt.enter(); - // This is written as nested iterator adaptors so that it can maybe be changed to use - // rayon's par_iter, but currently the code isn't properly threadsafe due to races on - // the filesystem when setting up the various output dirs :( + let tasks = harness - .tests - .values() + .all_tests() + .into_iter() .flat_map(|test| { // If the cli has test filters, apply those if !cfg.run_tests.is_empty() && !cfg.run_tests.contains(&test.name) { @@ -371,73 +232,80 @@ fn main() -> Result<(), Box> { } if full_report.failed() { - do_thing(&harness, &rt, &out_dir, &full_report); + generate_minimized_failures(&harness, &rt, &out_dir, &full_report); Err(TestsFailed {})?; } Ok(()) } -fn do_thing( +fn generate_minimized_failures( harness: &Arc, rt: &tokio::runtime::Runtime, out_dir: &Utf8Path, reports: &FullReport, ) { info!("rerunning failures"); - for report in &reports.tests { + let tasks = reports.tests.iter().flat_map(|report| { let Some(check) = report.results.check.as_ref() else { - continue; + return vec![]; }; - for func_result in &check.subtest_checks { - let Err(failure) = func_result else { - continue; - }; - let functions = match *failure { - CheckFailure::ArgCountMismatch { func_idx, .. } => FunctionSelector::One { - idx: func_idx, - args: ArgSelector::All, - }, - CheckFailure::ValCountMismatch { - func_idx, arg_idx, .. - } => FunctionSelector::One { - idx: func_idx, - args: ArgSelector::One { - idx: arg_idx, - vals: ValSelector::All, + check + .subtest_checks + .iter() + .filter_map(|func_result| { + let Err(failure) = func_result else { + return None; + }; + let functions = match *failure { + CheckFailure::ArgCountMismatch { func_idx, .. } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::All, }, - }, - CheckFailure::ValMismatch { - func_idx, - arg_idx, - val_idx, - .. - } - | CheckFailure::TagMismatch { - func_idx, - arg_idx, - val_idx, - .. - } => FunctionSelector::One { - idx: func_idx, - args: ArgSelector::One { - idx: arg_idx, - vals: ValSelector::One { idx: val_idx }, + CheckFailure::ValCountMismatch { + func_idx, arg_idx, .. + } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::One { + idx: arg_idx, + vals: ValSelector::All, + }, }, - }, - }; - - let mut test_key = report.key.clone(); - test_key.options.functions = functions; - test_key.options.val_writer = WriteImpl::Print; - let rules = report.rules.clone(); - debug!("rerunning {}", harness.base_id(&test_key, None, "::")); - let task = harness - .clone() - .spawn_test(rt, rules, test_key, out_dir.to_owned()); - let results = rt.block_on(task).expect("failed to join task"); - let source = results.source.unwrap().unwrap(); - debug!(" caller: {}", source.caller_src); - debug!(" callee: {}", source.callee_src); - } - } + CheckFailure::ValMismatch { + func_idx, + arg_idx, + val_idx, + .. + } + | CheckFailure::TagMismatch { + func_idx, + arg_idx, + val_idx, + .. + } => FunctionSelector::One { + idx: func_idx, + args: ArgSelector::One { + idx: arg_idx, + vals: ValSelector::One { idx: val_idx }, + }, + }, + }; + + let mut test_key = report.key.clone(); + test_key.options.functions = functions; + test_key.options.val_writer = WriteImpl::Print; + let mut rules = report.rules.clone(); + rules.run = TestRunMode::Generate; + + let task = harness + .clone() + .spawn_test(rt, rules, test_key, out_dir.to_owned()); + Some(task) + }) + .collect() + }); + + let _results = tasks + .into_iter() + .map(|task| rt.block_on(task).expect("failed to join task")) + .collect::>(); } diff --git a/tests/normal/anons.kdl b/tests/normal/anons.kdl new file mode 100644 index 0000000..0848ced --- /dev/null +++ b/tests/normal/anons.kdl @@ -0,0 +1,35 @@ +// Cases that allow a backend to encounter tuple-structs/tuple-variants + +struct "MyTupleStruct" { + _ "bool" + _ "i32" + _ "u64" +} +tagged "MyTagged" { + TupleVariant { + _ "bool" + _ "i32" + _ "u64" + } + HybridVariant { + x "bool" + _ "u32" + } + StructVariant { + x "u8" + z "i64" + } + EmptyVariant { + } + NoneLike +} +fn "anons" { + inputs { + _ "u32" + _ "MyTupleStruct" + z "i8" + } + outputs { + _ "MyTagged" + } +} \ No newline at end of file From daf84ff28f4b60399204f85e09bcd761e2327c6f Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 26 Jun 2024 23:01:53 -0400 Subject: [PATCH 30/44] add cli flags --- src/abis/c.rs | 822 +++++++++++++++++++++++++++++- src/abis/mod.rs | 34 +- src/abis/vals.rs | 30 +- src/abis_old/c.rs | 822 ------------------------------ src/abis_old/mod.rs | 288 ----------- src/abis_old/rust.rs | 661 ------------------------ src/cli.rs | 28 +- src/error.rs | 14 +- src/main.rs | 9 +- tests/old/by_ref.ron | 159 ------ tests/old/opaque_example.ron | 15 - tests/old/structs.ron | 139 ----- tests/old/sysv_i128_emulation.ron | 83 --- 13 files changed, 910 insertions(+), 2194 deletions(-) delete mode 100644 src/abis_old/c.rs delete mode 100644 src/abis_old/mod.rs delete mode 100644 src/abis_old/rust.rs delete mode 100644 tests/old/by_ref.ron delete mode 100644 tests/old/opaque_example.ron delete mode 100644 tests/old/structs.ron delete mode 100644 tests/old/sysv_i128_emulation.ron diff --git a/src/abis/c.rs b/src/abis/c.rs index e9afb9c..2bb0901 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -1,6 +1,822 @@ -//! TODO (but tidy up / factor the rust impl first) +use crate::Config; + +use super::super::*; +use super::*; + +pub static C_TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); -#[allow(dead_code)] pub struct CcAbiImpl { - codegen_backend: Option, + cc_flavor: CCFlavor, + platform: Platform, + mode: &'static str, +} + +#[derive(PartialEq)] +enum CCFlavor { + Clang, + Gcc, + Msvc, +} + +#[derive(PartialEq)] +enum Platform { + Windows, + Unixy, +} + +impl AbiImpl for CcAbiImpl { + fn name(&self) -> &'static str { + self.mode + } + fn lang(&self) -> &'static str { + "c" + } + fn src_ext(&self) -> &'static str { + "c" + } + + fn supports_convention(&self, convention: CallingConvention) -> bool { + self.c_convention_decl(convention).is_ok() + } + + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + self.write_c_signature(f, function, convention)?; + writeln!(f, " {{")?; + + writeln!(f)?; + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? + )?; + } + writeln!(f)?; + if let Some(output) = &function.output { + writeln!( + f, + " {} = {};", + self.c_var_decl(output, OUTPUT_NAME)?, + self.c_val(output)? + )?; + writeln!( + f, + "{}", + self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? + )?; + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + writeln!( + f, + " {}", + self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? + )?; + } else { + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + } + writeln!(f, "}}")?; + writeln!(f)?; + } + + Ok(()) + } + + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the extern block + for function in &test.funcs { + self.write_c_signature(f, function, convention)?; + writeln!(f, ";")?; + } + + writeln!(f)?; + writeln!(f, "void do_test(void) {{")?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + // Add an extra scope to avoid clashes between subtests + writeln!(f, "{{")?; + // Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + " {} = {};", + self.c_var_decl(input, ARG_NAMES[idx])?, + self.c_val(input)? + )?; + writeln!( + f, + "{}", + self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? + )?; + } + writeln!(f)?; + + // Output + let pass_out = if let Some(output) = &function.output { + if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { + writeln!(f, " {};", out_param_var)?; + write!(f, " ")?; + true + } else { + write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; + false + } + } else { + write!(f, " ")?; + false + }; + + // Do the actual call + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; + } + if pass_out { + let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; + if function.inputs.is_empty() { + write!(f, "{}", pass)?; + } else { + write!(f, ", {}", pass)?; + } + } + writeln!(f, ");")?; + + if let Some(output) = &function.output { + writeln!( + f, + "{}", + self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? + )?; + } + writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; + writeln!(f, "}}")?; + writeln!(f)?; + } + writeln!(f, "}}")?; + Ok(()) + } + + fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, lib_name), + "gcc" => self.compile_gcc(src_path, lib_name), + "clang" => self.compile_clang(src_path, lib_name), + "msvc" => self.compile_msvc(src_path, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } + + fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, lib_name), + "gcc" => self.compile_gcc(src_path, lib_name), + "clang" => self.compile_clang(src_path, lib_name), + "msvc" => self.compile_msvc(src_path, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } +} + +impl CcAbiImpl { + pub fn new(_system_info: &Config, mode: &'static str) -> Self { + let compiler = cc::Build::new().get_compiler(); + let cc_flavor = if compiler.is_like_msvc() { + CCFlavor::Msvc + } else if compiler.is_like_gnu() { + CCFlavor::Gcc + } else if compiler.is_like_clang() { + CCFlavor::Clang + } else { + panic!("Unknown compiler flavour for CC"); + }; + + let platform = if cfg!(target_os = "windows") { + Platform::Windows + } else { + Platform::Unixy + }; + + Self { + cc_flavor, + platform, + mode, + } + } + + fn compile_cc(&self, src_path: &Path, lib_name: &str) -> Result { + cc::Build::new() + .file(src_path) + .opt_level(0) + .cargo_metadata(false) + .target(built_info::TARGET) + // .warnings_into_errors(true) + .try_compile(lib_name)?; + Ok(String::from(lib_name)) + } + + fn compile_clang(&self, src_path: &Path, lib_name: &str) -> Result { + let base_path = PathBuf::from("target/temp/"); + let obj_path = base_path.join(format!("{lib_name}.o")); + let lib_path = base_path.join(format!("lib{lib_name}.a")); + Command::new("clang") + .arg("-ffunction-sections") + .arg("-fdata-sections") + .arg("-fPIC") + .arg("-o") + .arg(&obj_path) + .arg("-c") + .arg(&src_path) + .status() + .unwrap(); + Command::new("ar") + .arg("cq") + .arg(&lib_path) + .arg(&obj_path) + .status() + .unwrap(); + Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); + Ok(String::from(lib_name)) + } + + fn compile_gcc(&self, src_path: &Path, lib_name: &str) -> Result { + let base_path = PathBuf::from("target/temp/"); + let obj_path = base_path.join(format!("{lib_name}.o")); + let lib_path = base_path.join(format!("lib{lib_name}.a")); + Command::new("gcc") + .arg("-ffunction-sections") + .arg("-fdata-sections") + .arg("-fPIC") + .arg("-o") + .arg(&obj_path) + .arg("-c") + .arg(&src_path) + .status() + .unwrap(); + Command::new("ar") + .arg("cq") + .arg(&lib_path) + .arg(&obj_path) + .status() + .unwrap(); + Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); + Ok(String::from(lib_name)) + } + + fn compile_msvc(&self, _src_path: &Path, _lib_name: &str) -> Result { + unimplemented!() + } + + fn c_convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { + use CCFlavor::*; + use CallingConvention::*; + use Platform::*; + // GCC (as __attribute__'s) + // + // * x86: cdecl, fastcall, thiscall, stdcall, + // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), + // naked, interrupt, sseregparm + // * ARM: pcs="aapcs", pcs="aapcs-vfp", + // long_call, short_call, naked, + // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), + // + // MSVC (as ~keywords) + // + // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall + + let val = match convention { + Handwritten => "handwritten", + All => { + // All is sugar, we shouldn't get here! + return Err(GenerateError::UnsupportedConvention); + } + System | Win64 | Sysv64 | Aapcs => { + // Don't want to think about these yet, I think they're + // all properly convered by other ABIs + return Err(GenerateError::UnsupportedConvention); + } + C => "", + Cdecl => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__cdecl ", + Gcc | Clang => "__attribute__((cdecl)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Stdcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__stdcall ", + Gcc | Clang => "__attribute__((stdcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Fastcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__fastcall ", + Gcc | Clang => "__attribute__((fastcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + Vectorcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__vectorcall ", + Gcc | Clang => "__attribute__((vectorcall)) ", + } + } else { + return Err(GenerateError::UnsupportedConvention); + } + } + }; + + Ok(val) + } + + // Emit a function signature + fn write_c_signature( + &self, + f: &mut dyn Write, + function: &Func, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + let convention_decl = self.c_convention_decl(convention)?; + + // First figure out the return (by-ref requires an out-param) + let out_param = if let Some(output) = &function.output { + let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; + if out_param.is_none() { + write!(f, "{} ", self.c_arg_type(output)?)?; + } else { + write!(f, "void ")?; + } + out_param + } else { + write!(f, "void ")?; + None + }; + + write!(f, "{}", convention_decl)?; + + // Now write out the args + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; + } + + // Add extra implicit args + if let Some(out_param) = out_param { + if !function.inputs.is_empty() { + write!(f, ", ")?; + } + write!(f, "{out_param}")?; + } else if function.inputs.is_empty() { + write!(f, "void")?; + } + write!(f, ")")?; + + Ok(()) + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { + // Load test harness "headers" + write!(f, "{}", C_TEST_PREFIX)?; + + // Forward-decl struct types + let mut forward_decls = std::collections::HashMap::::new(); + for function in &test.funcs { + for val in function.inputs.iter().chain(function.output.as_ref()) { + for (name, decl) in self.c_forward_decl(val)? { + match forward_decls.entry(name) { + std::collections::hash_map::Entry::Occupied(entry) => { + if entry.get() != &decl { + return Err(GenerateError::InconsistentStructDefinition { + name: entry.key().clone(), + old_decl: entry.remove(), + new_decl: decl, + }); + } + } + std::collections::hash_map::Entry::Vacant(entry) => { + writeln!(f, "{decl}")?; + entry.insert(decl); + } + } + } + } + } + + Ok(()) + } + + fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { + use Val::*; + match val { + Struct(name, fields) => { + let mut results = vec![]; + for field in fields.iter() { + results.extend(self.c_forward_decl(field)?); + } + let mut output = String::new(); + let ref_name = format!("struct {name}"); + output.push_str(&format!("struct {name} {{\n")); + for (idx, field) in fields.iter().enumerate() { + let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); + output.push_str(&line); + } + output.push_str("};\n"); + results.push((ref_name, output)); + Ok(results) + } + Array(vals) => self.c_forward_decl(&vals[0]), + Ref(pointee) => self.c_forward_decl(pointee), + _ => Ok(vec![]), + } + } + + /// The decl to use for a local var (reference-ness stripped) + fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { + use Val::*; + let val = match val { + Ref(pointee) => self.c_var_decl(pointee, var_name)?, + Array(_) => { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) + } + normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), + }; + Ok(val) + } + + /// The decl to use for a function arg (apply referenceness) + fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + format!("{}* {arg_name}", self.c_arg_type(cur_val)?) + } else { + format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) + } + } else { + format!("{} {arg_name}", self.c_arg_type(val)?) + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param( + &self, + val: &Val, + out_param_name: &str, + ) -> Result, GenerateError> { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) + } else { + Some(format!( + "{} {out_param_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + } else { + None + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param_var( + &self, + val: &Val, + output_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(self.c_var_decl(pointee, output_name)?)) + } else { + Ok(None) + } + } + + /// How to pass an argument + fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(pointee) = val { + if let Val::Array(_) = &**pointee { + Ok(arg_name.to_string()) + } else { + Ok(format!("&{arg_name}")) + } + } else { + Ok(arg_name.to_string()) + } + } + + /// How to return a value + fn c_var_return( + &self, + val: &Val, + var_name: &str, + out_param_name: &str, + ) -> Result { + if let Val::Ref(_) = val { + Ok(format!( + "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" + )) + } else { + Ok(format!("return {var_name};")) + } + } + + /// The type name to use for this value when it is stored in args/vars. + fn c_arg_type(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => { + let mut cur_val = &**pointee; + while let Val::Array(vals) = cur_val { + cur_val = &vals[0]; + } + format!("{}*", self.c_arg_type(cur_val)?) + } + Ptr(_) => "void*".to_string(), + Bool(_) => "bool".to_string(), + Array(_vals) => { + // C arrays are kinda fake due to how they decay in function arg + // position, so a ton of code needs to very delicately detect arrays + // and desugar them properly. Since most things eventually sink into + // c_arg_type, this is a good guard against something forgetting to + // specially handle arrays! + // + // But also it just isn't legal to pass an array by-value in C + // (it decays to a pointer, so you need to wrap it in Ref for + // other ABIs to understand that's what we're doing. + return Err(GenerateError::CUnsupported( + "C Arrays can't be passed directly, wrap this in Ref".to_string(), + )); + } + Struct(name, _) => format!("struct {name}"), + Float(FloatVal::c_double(_)) => "double".to_string(), + Float(FloatVal::c_float(_)) => "float".to_string(), + Int(int_val) => match int_val { + c__int128(_) => "__int128_t".to_string(), + c_int64_t(_) => "int64_t".to_string(), + c_int32_t(_) => "int32_t".to_string(), + c_int16_t(_) => "int16_t".to_string(), + c_int8_t(_) => "int8_t".to_string(), + c__uint128(_) => "__uint128_t".to_string(), + c_uint64_t(_) => "uint64_t".to_string(), + c_uint32_t(_) => "uint32_t".to_string(), + c_uint16_t(_) => "uint16_t".to_string(), + c_uint8_t(_) => "uint8_t".to_string(), + }, + }; + Ok(val) + } + + /// The type name to use for this value when it is stored in composite. + /// + /// This is separated out in case there's a type that needs different + /// handling in this context to conform to a layout (i.e. how C arrays + /// decay into pointers when used in function args). + fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + Ok(format!( + "{} {field_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + + /// An expression that generates this value. + pub fn c_val(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => self.c_val(pointee)?, + Ptr(addr) => format!("(void*){addr:#X}ull"), + Bool(val) => format!("{val}"), + Array(vals) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, elem) in vals.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = (self.c_val(elem)?).to_string(); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Struct(_name, fields) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, field) in fields.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(FloatVal::c_double(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Float(FloatVal::c_float(val)) => { + if val.fract() == 0.0 { + format!("{val}.0f") + } else { + format!("{val}f") + } + } + Int(int_val) => match *int_val { + c__int128(val) => { + let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") + } + c__uint128(val) => { + let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") + } + c_int64_t(val) => format!("{val}"), + c_int32_t(val) => format!("{val}"), + c_int16_t(val) => format!("{val}"), + c_int8_t(val) => format!("{val}"), + c_uint64_t(val) => format!("{val}ull"), + c_uint32_t(val) => format!("{val:#X}"), + c_uint16_t(val) => format!("{val:#X}"), + c_uint8_t(val) => format!("{val:#X}"), + }, + }; + Ok(val) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn c_write_val( + &self, + val: &Val, + to: &str, + from: &str, + is_var_root: bool, + ) -> Result { + use std::fmt::Write; + let mut output = String::new(); + for path in self.c_var_paths(val, from, is_var_root)? { + writeln!( + output, + " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" + ) + .unwrap(); + } + write!(output, " FINISHED_VAL({to});").unwrap(); + + Ok(output) + } + + /// Compute the paths to every subfield of this value, with `from` + /// as the base path to that value, for c_write_val's use. + fn c_var_paths( + &self, + val: &Val, + from: &str, + is_var_root: bool, + ) -> Result, GenerateError> { + let paths = match val { + Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + vec![format!("{from}")] + } + Val::Struct(_name, fields) => { + let mut paths = vec![]; + for (idx, field) in fields.iter().enumerate() { + let base = format!("{from}.{}", FIELD_NAMES[idx]); + paths.extend(self.c_var_paths(field, &base, false)?); + } + paths + } + Val::Ref(pointee) => { + if is_var_root { + self.c_var_paths(pointee, from, false)? + } else if let Val::Array(_) = &**pointee { + self.c_var_paths(pointee, from, false)? + } else { + let base = format!("(*{from})"); + self.c_var_paths(pointee, &base, false)? + } + } + Val::Array(vals) => { + let mut paths = vec![]; + for (i, elem) in vals.iter().enumerate() { + let base = format!("{from}[{i}]"); + paths.extend(self.c_var_paths(elem, &base, false)?); + } + paths + } + }; + + Ok(paths) + } + + /* + /// Format specifiers for C types, for print debugging. + /// This is no longer used but it's a shame to throw out. + pub fn cfmt(&self, val: &Val) -> &'static str { + use Val::*; + use IntVal::*; + match val { + Ref(x) => self.cfmt(x), + Ptr(_) => "\"p\"", + Bool(_) => "\"d\"", + Array(_) => { + todo!() + } + Struct(_name, _fields) => { + todo!() + } + Float(FloatVal::c_double(_val)) => "\"f\"", + Float(FloatVal::c_float(_val)) => "\"f\"", + Int(int_val) => match int_val { + c_uint8_t(..) => "PRIu8", + c_uint16_t(..) => "PRIu16", + c_uint32_t(..) => "PRIu32", + c_uint64_t(..) => "PRIu64", + c_uint128_t(..) => "PRIu128", + + c_int8_t(..) => "PRId8", + c_int16_t(..) => "PRId16", + c_int32_t(..) => "PRId32", + c_int64_t(..) => "PRId64", + c_int128_t(..) => "PRId128", + } + } + } + */ } diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 1a66d63..8b244d8 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -1,10 +1,9 @@ -pub mod c; +// pub mod c; pub mod rust; pub mod vals; use std::{collections::HashMap, fmt::Write, sync::Arc}; -pub use c::CcAbiImpl; use camino::Utf8Path; use kdl_script::{ types::{FuncIdx, TyIdx}, @@ -14,7 +13,10 @@ pub use rust::RustcAbiImpl; use serde::Serialize; use vals::{ValueGeneratorKind, ValueTree}; -use crate::error::{BuildError, GenerateError}; +use crate::{ + error::{BuildError, GenerateError}, + CliParseError, +}; pub type AbiImplId = String; pub type TestId = String; @@ -235,13 +237,37 @@ impl std::ops::Deref for TestImpl { } } -#[derive(Debug, Clone, Serialize, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, Serialize, PartialEq, Eq)] pub enum WriteImpl { HarnessCallback, Assert, Print, Noop, } +impl std::str::FromStr for WriteImpl { + type Err = CliParseError; + + fn from_str(s: &str) -> Result { + match s { + "harness" => Ok(Self::HarnessCallback), + "assert" => Ok(Self::Assert), + "print" => Ok(Self::Print), + "noop" => Ok(Self::Noop), + _ => Err(CliParseError::Other(format!("{s} is not a write impl"))), + } + } +} +impl std::fmt::Display for WriteImpl { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let s = match self { + Self::HarnessCallback => "harness", + Self::Assert => "assert", + Self::Print => "print", + Self::Noop => "noop", + }; + s.fmt(f) + } +} /// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. pub trait AbiImpl { diff --git a/src/abis/vals.rs b/src/abis/vals.rs index 3131c61..3aa4fbb 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -3,7 +3,7 @@ use rand::Rng; use rand_core::{RngCore, SeedableRng}; use serde::Serialize; -use crate::TestOptions; +use crate::{CliParseError, TestOptions}; type RngImpl = rand_pcg::Pcg64; @@ -74,6 +74,34 @@ pub enum ValueGeneratorKind { Graffiti, Random { seed: u64 }, } +impl std::str::FromStr for ValueGeneratorKind { + type Err = CliParseError; + + fn from_str(s: &str) -> Result { + if let Some(seed) = s.strip_prefix("random") { + let seed: u64 = seed.parse().map_err(|_| { + CliParseError::Other(format!( + "{seed} isn't a u64 (parsing random value generator)" + )) + })?; + Ok(ValueGeneratorKind::Random { seed }) + } else if s == "graffiti" { + Ok(ValueGeneratorKind::Graffiti) + } else { + Err(CliParseError::Other(format!( + "{s} is not a value generator" + ))) + } + } +} +impl std::fmt::Display for ValueGeneratorKind { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Random { seed } => write!(f, "random{seed}"), + Self::Graffiti => write!(f, "graffiti"), + } + } +} impl ValueTree { /// Create the ValueTree for an entire program diff --git a/src/abis_old/c.rs b/src/abis_old/c.rs deleted file mode 100644 index 2bb0901..0000000 --- a/src/abis_old/c.rs +++ /dev/null @@ -1,822 +0,0 @@ -use crate::Config; - -use super::super::*; -use super::*; - -pub static C_TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); - -pub struct CcAbiImpl { - cc_flavor: CCFlavor, - platform: Platform, - mode: &'static str, -} - -#[derive(PartialEq)] -enum CCFlavor { - Clang, - Gcc, - Msvc, -} - -#[derive(PartialEq)] -enum Platform { - Windows, - Unixy, -} - -impl AbiImpl for CcAbiImpl { - fn name(&self) -> &'static str { - self.mode - } - fn lang(&self) -> &'static str { - "c" - } - fn src_ext(&self) -> &'static str { - "c" - } - - fn supports_convention(&self, convention: CallingConvention) -> bool { - self.c_convention_decl(convention).is_ok() - } - - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - self.write_c_signature(f, function, convention)?; - writeln!(f, " {{")?; - - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - if let Some(output) = &function.output { - writeln!( - f, - " {} = {};", - self.c_var_decl(output, OUTPUT_NAME)?, - self.c_val(output)? - )?; - writeln!( - f, - "{}", - self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - writeln!( - f, - " {}", - self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - } - writeln!(f, "}}")?; - writeln!(f)?; - } - - Ok(()) - } - - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the extern block - for function in &test.funcs { - self.write_c_signature(f, function, convention)?; - writeln!(f, ";")?; - } - - writeln!(f)?; - writeln!(f, "void do_test(void) {{")?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Add an extra scope to avoid clashes between subtests - writeln!(f, "{{")?; - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.c_var_decl(input, ARG_NAMES[idx])?, - self.c_val(input)? - )?; - writeln!( - f, - "{}", - self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Output - let pass_out = if let Some(output) = &function.output { - if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {};", out_param_var)?; - write!(f, " ")?; - true - } else { - write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - write!(f, " ")?; - false - }; - - // Do the actual call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; - if function.inputs.is_empty() { - write!(f, "{}", pass)?; - } else { - write!(f, ", {}", pass)?; - } - } - writeln!(f, ");")?; - - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; - } - writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; - writeln!(f, "}}")?; - writeln!(f)?; - } - writeln!(f, "}}")?; - Ok(()) - } - - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), - } - } - - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), - } - } -} - -impl CcAbiImpl { - pub fn new(_system_info: &Config, mode: &'static str) -> Self { - let compiler = cc::Build::new().get_compiler(); - let cc_flavor = if compiler.is_like_msvc() { - CCFlavor::Msvc - } else if compiler.is_like_gnu() { - CCFlavor::Gcc - } else if compiler.is_like_clang() { - CCFlavor::Clang - } else { - panic!("Unknown compiler flavour for CC"); - }; - - let platform = if cfg!(target_os = "windows") { - Platform::Windows - } else { - Platform::Unixy - }; - - Self { - cc_flavor, - platform, - mode, - } - } - - fn compile_cc(&self, src_path: &Path, lib_name: &str) -> Result { - cc::Build::new() - .file(src_path) - .opt_level(0) - .cargo_metadata(false) - .target(built_info::TARGET) - // .warnings_into_errors(true) - .try_compile(lib_name)?; - Ok(String::from(lib_name)) - } - - fn compile_clang(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); - Command::new("clang") - .arg("-ffunction-sections") - .arg("-fdata-sections") - .arg("-fPIC") - .arg("-o") - .arg(&obj_path) - .arg("-c") - .arg(&src_path) - .status() - .unwrap(); - Command::new("ar") - .arg("cq") - .arg(&lib_path) - .arg(&obj_path) - .status() - .unwrap(); - Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); - Ok(String::from(lib_name)) - } - - fn compile_gcc(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); - Command::new("gcc") - .arg("-ffunction-sections") - .arg("-fdata-sections") - .arg("-fPIC") - .arg("-o") - .arg(&obj_path) - .arg("-c") - .arg(&src_path) - .status() - .unwrap(); - Command::new("ar") - .arg("cq") - .arg(&lib_path) - .arg(&obj_path) - .status() - .unwrap(); - Command::new("ar").arg("s").arg(&lib_path).status().unwrap(); - Ok(String::from(lib_name)) - } - - fn compile_msvc(&self, _src_path: &Path, _lib_name: &str) -> Result { - unimplemented!() - } - - fn c_convention_decl( - &self, - convention: CallingConvention, - ) -> Result<&'static str, GenerateError> { - use CCFlavor::*; - use CallingConvention::*; - use Platform::*; - // GCC (as __attribute__'s) - // - // * x86: cdecl, fastcall, thiscall, stdcall, - // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), - // naked, interrupt, sseregparm - // * ARM: pcs="aapcs", pcs="aapcs-vfp", - // long_call, short_call, naked, - // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), - // - // MSVC (as ~keywords) - // - // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall - - let val = match convention { - Handwritten => "handwritten", - All => { - // All is sugar, we shouldn't get here! - return Err(GenerateError::UnsupportedConvention); - } - System | Win64 | Sysv64 | Aapcs => { - // Don't want to think about these yet, I think they're - // all properly convered by other ABIs - return Err(GenerateError::UnsupportedConvention); - } - C => "", - Cdecl => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__cdecl ", - Gcc | Clang => "__attribute__((cdecl)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Stdcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__stdcall ", - Gcc | Clang => "__attribute__((stdcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Fastcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__fastcall ", - Gcc | Clang => "__attribute__((fastcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Vectorcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__vectorcall ", - Gcc | Clang => "__attribute__((vectorcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - }; - - Ok(val) - } - - // Emit a function signature - fn write_c_signature( - &self, - f: &mut dyn Write, - function: &Func, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let convention_decl = self.c_convention_decl(convention)?; - - // First figure out the return (by-ref requires an out-param) - let out_param = if let Some(output) = &function.output { - let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; - if out_param.is_none() { - write!(f, "{} ", self.c_arg_type(output)?)?; - } else { - write!(f, "void ")?; - } - out_param - } else { - write!(f, "void ")?; - None - }; - - write!(f, "{}", convention_decl)?; - - // Now write out the args - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; - } - - // Add extra implicit args - if let Some(out_param) = out_param { - if !function.inputs.is_empty() { - write!(f, ", ")?; - } - write!(f, "{out_param}")?; - } else if function.inputs.is_empty() { - write!(f, "void")?; - } - write!(f, ")")?; - - Ok(()) - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { - // Load test harness "headers" - write!(f, "{}", C_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.c_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } - } - - Ok(()) - } - - fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.c_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = format!("struct {name}"); - output.push_str(&format!("struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); - output.push_str(&line); - } - output.push_str("};\n"); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.c_forward_decl(&vals[0]), - Ref(pointee) => self.c_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { - use Val::*; - let val = match val { - Ref(pointee) => self.c_var_decl(pointee, var_name)?, - Array(_) => { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) - } - normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), - }; - Ok(val) - } - - /// The decl to use for a function arg (apply referenceness) - fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - format!("{}* {arg_name}", self.c_arg_type(cur_val)?) - } else { - format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) - } - } else { - format!("{} {arg_name}", self.c_arg_type(val)?) - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param( - &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) - } else { - Some(format!( - "{} {out_param_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - } else { - None - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(self.c_var_decl(pointee, output_name)?)) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - if let Val::Array(_) = &**pointee { - Ok(arg_name.to_string()) - } else { - Ok(format!("&{arg_name}")) - } - } else { - Ok(arg_name.to_string()) - } - } - - /// How to return a value - fn c_var_return( - &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!( - "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" - )) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn c_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => { - let mut cur_val = &**pointee; - while let Val::Array(vals) = cur_val { - cur_val = &vals[0]; - } - format!("{}*", self.c_arg_type(cur_val)?) - } - Ptr(_) => "void*".to_string(), - Bool(_) => "bool".to_string(), - Array(_vals) => { - // C arrays are kinda fake due to how they decay in function arg - // position, so a ton of code needs to very delicately detect arrays - // and desugar them properly. Since most things eventually sink into - // c_arg_type, this is a good guard against something forgetting to - // specially handle arrays! - // - // But also it just isn't legal to pass an array by-value in C - // (it decays to a pointer, so you need to wrap it in Ref for - // other ABIs to understand that's what we're doing. - return Err(GenerateError::CUnsupported( - "C Arrays can't be passed directly, wrap this in Ref".to_string(), - )); - } - Struct(name, _) => format!("struct {name}"), - Float(FloatVal::c_double(_)) => "double".to_string(), - Float(FloatVal::c_float(_)) => "float".to_string(), - Int(int_val) => match int_val { - c__int128(_) => "__int128_t".to_string(), - c_int64_t(_) => "int64_t".to_string(), - c_int32_t(_) => "int32_t".to_string(), - c_int16_t(_) => "int16_t".to_string(), - c_int8_t(_) => "int8_t".to_string(), - c__uint128(_) => "__uint128_t".to_string(), - c_uint64_t(_) => "uint64_t".to_string(), - c_uint32_t(_) => "uint32_t".to_string(), - c_uint16_t(_) => "uint16_t".to_string(), - c_uint8_t(_) => "uint8_t".to_string(), - }, - }; - Ok(val) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - Ok(format!( - "{} {field_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - - /// An expression that generates this value. - pub fn c_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => self.c_val(pointee)?, - Ptr(addr) => format!("(void*){addr:#X}ull"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, elem) in vals.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = (self.c_val(elem)?).to_string(); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Struct(_name, fields) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, field) in fields.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0f") - } else { - format!("{val}f") - } - } - Int(int_val) => match *int_val { - c__int128(val) => { - let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") - } - c__uint128(val) => { - let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c_uint64_t(val) => format!("{val}ull"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(val) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn c_write_val( - &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.c_var_paths(val, from, is_var_root)? { - writeln!( - output, - " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" - ) - .unwrap(); - } - write!(output, " FINISHED_VAL({to});").unwrap(); - - Ok(output) - } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for c_write_val's use. - fn c_var_paths( - &self, - val: &Val, - from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.c_var_paths(field, &base, false)?); - } - paths - } - Val::Ref(pointee) => { - if is_var_root { - self.c_var_paths(pointee, from, false)? - } else if let Val::Array(_) = &**pointee { - self.c_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.c_var_paths(pointee, &base, false)? - } - } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.c_var_paths(elem, &base, false)?); - } - paths - } - }; - - Ok(paths) - } - - /* - /// Format specifiers for C types, for print debugging. - /// This is no longer used but it's a shame to throw out. - pub fn cfmt(&self, val: &Val) -> &'static str { - use Val::*; - use IntVal::*; - match val { - Ref(x) => self.cfmt(x), - Ptr(_) => "\"p\"", - Bool(_) => "\"d\"", - Array(_) => { - todo!() - } - Struct(_name, _fields) => { - todo!() - } - Float(FloatVal::c_double(_val)) => "\"f\"", - Float(FloatVal::c_float(_val)) => "\"f\"", - Int(int_val) => match int_val { - c_uint8_t(..) => "PRIu8", - c_uint16_t(..) => "PRIu16", - c_uint32_t(..) => "PRIu32", - c_uint64_t(..) => "PRIu64", - c_uint128_t(..) => "PRIu128", - - c_int8_t(..) => "PRId8", - c_int16_t(..) => "PRId16", - c_int32_t(..) => "PRId32", - c_int64_t(..) => "PRId64", - c_int128_t(..) => "PRId128", - } - } - } - */ -} diff --git a/src/abis_old/mod.rs b/src/abis_old/mod.rs deleted file mode 100644 index ef82dde..0000000 --- a/src/abis_old/mod.rs +++ /dev/null @@ -1,288 +0,0 @@ -#![allow(non_camel_case_types)] - -// Backends that can generate + compile an implementation's code into a staticlib. -pub mod c; -pub mod rust; - -use super::report::BuildError; -use std::io::Write; -use std::path::Path; - -pub use c::CcAbiImpl; -pub use rust::RustcAbiImpl; - -pub static ABI_IMPL_RUSTC: &str = "rustc"; -pub static ABI_IMPL_CC: &str = "cc"; -pub static ABI_IMPL_GCC: &str = "gcc"; -pub static ABI_IMPL_CLANG: &str = "clang"; -pub static ABI_IMPL_MSVC: &str = "msvc"; - -// pub static ALL_ABIS: &[AbiRef] = &[RUST_ABI, C_ABI]; -pub static ALL_CONVENTIONS: &[CallingConvention] = &[ - CallingConvention::Handwritten, - CallingConvention::C, - CallingConvention::Cdecl, - CallingConvention::Stdcall, - CallingConvention::Fastcall, - CallingConvention::Vectorcall, - // Note sure if these have a purpose, so omitting them for now - // CallingConvention::System, - // CallingConvention::Win64, - // CallingConvention::Sysv64, - // CallingConvention::Aapcs, -]; - -// pre-computed arg/field names to avoid a bunch of tedious formatting, and to make -// it easy to refactor this detail if we decide we don't like this naming scheme. -pub static ARG_NAMES: &[&str] = &[ - "arg0", "arg1", "arg2", "arg3", "arg4", "arg5", "arg6", "arg7", "arg8", "arg9", "arg10", - "arg11", "arg12", "arg13", "arg14", "arg15", "arg16", "arg17", "arg18", "arg19", "arg20", - "arg21", "arg22", "arg23", "arg24", "arg25", "arg26", "arg27", "arg28", "arg29", "arg30", - "arg31", "arg32", -]; -pub static FIELD_NAMES: &[&str] = &[ - "field0", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", - "field9", "field10", "field11", "field12", "field13", "field14", "field15", "field16", - "field17", "field18", "field19", "field20", "field21", "field22", "field23", "field24", - "field25", "field26", "field27", "field28", "field29", "field30", "field31", "field32", -]; -pub static OUTPUT_NAME: &str = "output"; -pub static OUT_PARAM_NAME: &str = "out"; - -/// ABI is probably a bad name for this... it's like, a language/compiler impl. idk. -pub trait AbiImpl { - fn name(&self) -> &'static str; - fn lang(&self) -> &'static str; - fn src_ext(&self) -> &'static str; - fn supports_convention(&self, _convention: CallingConvention) -> bool; - - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError>; - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError>; - - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result; - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result; -} - -#[derive(Debug, thiserror::Error)] -#[allow(dead_code)] -pub enum GenerateError { - #[error("io error\n{0}")] - Fmt(#[from] std::fmt::Error), - #[error("io error\n{0}")] - Io(#[from] std::io::Error), - #[error("parse error {0}\n{2}\n{}\n{:width$}^", - .1.lines().nth(.2.position.line.saturating_sub(1)).unwrap(), - "", - width=.2.position.col.saturating_sub(1), - )] - ParseError(String, String, ron::error::Error), - #[error("kdl parse error {}", .2)] - KdlParseError(String, String, kdl::KdlError), - #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] - InconsistentStructDefinition { - name: String, - old_decl: String, - new_decl: String, - }, - #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] - HandwrittenMixing, - #[error("No handwritten source for this pairing (skipping)")] - NoHandwrittenSource, - #[error("Unsupported Signature For Rust: {0}")] - RustUnsupported(String), - #[error("Unsupported Signature For C: {0}")] - CUnsupported(String), - #[error("ABI impl doesn't support this calling convention.")] - UnsupportedConvention, - /// Used to signal we just skipped it - #[error("")] - Skipped, -} - -/// A test, containing several subtests, each its own function -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct Test { - pub name: String, - pub funcs: Vec, -} - -/// A function's calling convention + signature which will -/// be used to generate the caller+callee automatically. -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct Func { - pub name: String, - pub conventions: Vec, - pub inputs: Vec, - pub output: Option, -} - -#[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] -pub enum CallingConvention { - // These conventions are special ones that "desugar" to others - /// Sugar for "every possible convention" - All, - /// A complete opaque convention, the implementation must be manually - /// written in the handwritten_impls directory. - Handwritten, - /// The platform's default C convention (cdecl?) - C, - /// ??? - Cdecl, - /// The platorm's default OS convention (usually C, but Windows is Weird). - System, - - // These conventions are specific ones - /// x64 windows C convention - Win64, - /// x64 non-windows C convention - Sysv64, - /// ARM C convention - Aapcs, - /// Win32 x86 system APIs - Stdcall, - /// Microsoft fastcall - /// MSVC` __fastcall` - /// GCC/Clang `__attribute__((fastcall))` - Fastcall, - /// Microsoft vectorcall - /// MSCV `__vectorcall` - /// GCC/Clang `__attribute__((vectorcall))` - Vectorcall, -} - -/// A typed value. -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum Val { - /// A Ref is passed-by-reference (is a pointer) but the - /// pointee will be regarded as the real value that we check. - /// - /// If a Ref val is used as the return value for a function, it will - /// implicitly introduce an outparam that the callee memcpy's to. - Ref(Box), - /// Some integer - Int(IntVal), - /// Some float - Float(FloatVal), - /// A bool - Bool(bool), - /// An array (homogeneous types, checked on construction) - /// - /// Arrays must be wrapped in a Ref to directly use them as args/returns - /// when compiling to C. Rust is fine with passing them by-value, but of - /// course this is pointless when the other half of the equation pukes. - /// - /// FIXME: it isn't currently enforced that this is homogeneous, anything that needs - /// the type of the elements just grabs the type of element 0 - /// - /// FIXME: it's illegal to have an array of length 0, because it's impossible to - /// attach a type to it - Array(Vec), - /// A named struct (heterogeneous type) - /// - /// Struct decls are implicitly derived from their usage as a value. - /// If any two structs claim the same name but have different layouts, - /// the ABI backends should notice this and return an error. - Struct(String, Vec), - /// An opaque pointer - /// - /// FIXME?: it's gross to just pick "u64" as the type here when ostensibly it would - /// be nice for this to be able to taget 32-bit platforms. But using usize doesn't really - /// make sense either because we're slurping these values out of a static config file! - /// I guess just truncating the pointer is "fine". - Ptr(u64), - // FIXME: unions. This is hard to do with the current design where - // types are implicit in their values. You could maybe hack it in - // by having dummy vals for all the different cases and then a - // "real" value for the variant that's actually used, but, kinda gross. - // - // FIXME: simd vectors (they have special passing rules!) - // - // FIXME: enums (enum classes?) -} - -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum IntVal { - c__int128(i128), - c_int64_t(i64), - c_int32_t(i32), - c_int16_t(i16), - c_int8_t(i8), - - c__uint128(u128), - c_uint64_t(u64), - c_uint32_t(u32), - c_uint16_t(u16), - c_uint8_t(u8), - // TODO: nastier platform-specific-layout c-types? - // i.e. c_int(i64), c_long(i32), char(i8), ... -} - -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub enum FloatVal { - c_double(f64), - c_float(f32), - // Is there a reason to mess with `long double`? Surely not. -} - -impl CallingConvention { - pub fn name(&self) -> &'static str { - match self { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar and shouldn't reach here!") - } - CallingConvention::Handwritten => "handwritten", - CallingConvention::C => "c", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", - } - } - pub fn from_str(input: &str) -> Option { - Some(match input { - "all" => CallingConvention::All, - "handwritten" => CallingConvention::Handwritten, - "c" => CallingConvention::C, - "cdecl" => CallingConvention::Cdecl, - "system" => CallingConvention::System, - "win64" => CallingConvention::Win64, - "sysv64" => CallingConvention::Sysv64, - "aapcs" => CallingConvention::Aapcs, - "stdcall" => CallingConvention::Stdcall, - "fastcall" => CallingConvention::Fastcall, - "vectorcall" => CallingConvention::Vectorcall, - _ => return None, - }) - } -} - -impl Func { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - self.conventions.iter().any(|&func_cc| { - (func_cc == CallingConvention::All && convention != CallingConvention::Handwritten) - || func_cc == convention - }) - } -} - -impl Test { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - self.funcs - .iter() - .any(|func| func.has_convention(convention)) - } -} diff --git a/src/abis_old/rust.rs b/src/abis_old/rust.rs deleted file mode 100644 index 5757020..0000000 --- a/src/abis_old/rust.rs +++ /dev/null @@ -1,661 +0,0 @@ -use super::super::*; -use super::*; - -pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); - -static STRUCT_128: bool = false; // cfg!(target_arch="x86_64"); - -#[allow(dead_code)] -pub struct RustcAbiImpl { - is_nightly: bool, - codegen_backend: Option, -} - -impl AbiImpl for RustcAbiImpl { - fn name(&self) -> &'static str { - "rustc" - } - fn lang(&self) -> &'static str { - "rust" - } - fn src_ext(&self) -> &'static str { - "rs" - } - fn supports_convention(&self, convention: CallingConvention) -> bool { - // NOTE: Rustc spits out: - // - // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, - // vectorcall, thiscall, thiscall-unwind, aapcs, win64, sysv64, - // ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, - // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, - // wasm, system, system-unwind, rust-intrinsic, rust-call, - // platform-intrinsic, unadjusted - match convention { - CallingConvention::All => unreachable!(), - CallingConvention::Handwritten => true, - CallingConvention::C => true, - CallingConvention::Cdecl => true, - CallingConvention::System => true, - CallingConvention::Win64 => true, - CallingConvention::Sysv64 => true, - CallingConvention::Aapcs => true, - CallingConvention::Stdcall => true, - CallingConvention::Fastcall => true, - CallingConvention::Vectorcall => false, // too experimental even for nightly use? - } - } - - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_rust_prefix(f, test, convention)?; - let convention_decl = self.rust_convention_decl(convention); - - // Generate the extern block - writeln!(f, "extern \"{convention_decl}\" {{",)?; - for function in &test.funcs { - write!(f, " ")?; - self.write_rust_signature(f, function)?; - writeln!(f, ";")?; - } - writeln!(f, "}}")?; - writeln!(f)?; - - // Now generate the body - writeln!(f, "#[no_mangle] pub extern \"C\" fn do_test() {{")?; - - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - writeln!(f, " unsafe {{")?; - - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.rust_var_decl(input, ARG_NAMES[idx])?, - self.rust_val(input)? - )?; - } - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.rust_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Outputs - write!(f, " ")?; - let pass_out = if let Some(output) = &function.output { - if let Some(decl) = self.rust_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {}", decl)?; - true - } else { - write!(f, " {} = ", self.rust_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - false - }; - - // Do the call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - write!(f, "{}, ", self.rust_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - writeln!(f, "&mut {OUTPUT_NAME}")?; - } - writeln!(f, ");")?; - writeln!(f)?; - - // Report the output - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.rust_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; - } - - // Finished - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS);" - )?; - writeln!(f, " }}")?; - } - - writeln!(f, "}}")?; - - Ok(()) - } - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_rust_prefix(f, test, convention)?; - let convention_decl = self.rust_convention_decl(convention); - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Write the signature - writeln!(f, "#[no_mangle]")?; - write!(f, "pub unsafe extern \"{convention_decl}\" ")?; - self.write_rust_signature(f, function)?; - writeln!(f, " {{")?; - - // Now the body - - // Report Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.rust_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - - // Report outputs and return - if let Some(output) = &function.output { - let decl = self.rust_var_decl(output, OUTPUT_NAME)?; - let val = self.rust_val(output)?; - writeln!(f, " {decl} = {val};")?; - writeln!( - f, - "{}", - self.rust_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - writeln!( - f, - " {}", - self.rust_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!( - f, - " FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS);" - )?; - } - writeln!(f, "}}")?; - } - - Ok(()) - } - - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - let mut cmd = Command::new("rustc"); - cmd.arg("--crate-type") - .arg("staticlib") - .arg("--out-dir") - .arg("target/temp/") - .arg("--target") - .arg(built_info::TARGET) - .arg(format!("-Cmetadata={lib_name}")) - .arg(src_path); - if let Some(codegen_backend) = &self.codegen_backend { - cmd.arg(format!("-Zcodegen-backend={codegen_backend}")); - } - debug!("running: {:?}", cmd); - let out = cmd.output()?; - - if !out.status.success() { - Err(BuildError::RustCompile(out)) - } else { - Ok(String::from(lib_name)) - } - } - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - // Currently no need to be different - self.compile_callee(src_path, lib_name) - } -} - -impl RustcAbiImpl { - pub fn new(_system_info: &Config, codegen_backend: Option) -> Self { - Self { - is_nightly: built_info::RUSTC_VERSION.contains("nightly"), - codegen_backend, - } - } - - fn rust_convention_decl(&self, convention: CallingConvention) -> &'static str { - match convention { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar that shouldn't reach here") - } - CallingConvention::Handwritten => { - unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") - } - CallingConvention::C => "C", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", - } - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_rust_prefix( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - if convention == CallingConvention::Vectorcall { - writeln!(f, "#![feature(abi_vectorcall)]")?; - } - // Load test harness "headers" - write!(f, "{}", RUST_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.rust_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } - } - - Ok(()) - } - - fn write_rust_signature( - &self, - f: &mut dyn Write, - function: &Func, - ) -> Result<(), GenerateError> { - write!(f, "fn {}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - write!(f, "{}, ", self.rust_arg_decl(input, ARG_NAMES[idx])?)?; - } - if let Some(output) = &function.output { - if let Some(out_param) = self.rust_out_param(output, OUT_PARAM_NAME)? { - write!(f, "{}", out_param)?; - write!(f, ")")?; - } else { - write!(f, ")")?; - let ty = self.rust_arg_type(output)?; - write!(f, " -> {ty}")?; - } - } else { - write!(f, ")")?; - } - Ok(()) - } - - /// If this value defines a nominal type, this will spit out: - /// - /// * The type name - /// * The forward-declaration of that type - /// - /// To catch buggy test definitions, you should validate that all - /// structs that claim a particular name have the same declaration. - /// This is done in write_rust_prefix. - fn rust_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.rust_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = name.to_string(); - output.push_str("\n#[repr(C)]\n"); - output.push_str(&format!("pub struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!( - " {}: {},\n", - FIELD_NAMES[idx], - self.rust_nested_type(field)? - ); - output.push_str(&line); - } - output.push('}'); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.rust_forward_decl(&vals[0]), - Ref(pointee) => self.rust_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn rust_var_decl(&self, val: &Val, var_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(self.rust_var_decl(pointee, var_name)?) - } else { - Ok(format!("let {var_name}: {}", self.rust_arg_type(val)?)) - } - } - - /// The decl to use for a function arg (apply referenceness) - fn rust_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - Ok(format!("{arg_name}: &{}", self.rust_arg_type(pointee)?)) - } else { - Ok(format!("{arg_name}: {}", self.rust_arg_type(val)?)) - } - } - - /// If the return type needs to be an out_param, this returns it - fn rust_out_param( - &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "{out_param_name}: &mut {}", - self.rust_arg_type(pointee)? - ))) - } else { - Ok(None) - } - } - - /// If the return type needs to be an out_param, this returns it - fn rust_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(format!( - "let mut {output_name}: {} = {};", - self.rust_arg_type(pointee)?, - self.rust_default_val(pointee)? - ))) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn rust_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(_) = val { - Ok(format!("&{arg_name}")) - } else { - Ok(arg_name.to_string()) - } - } - - /// How to return a value - fn rust_var_return( - &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!("*{out_param_name} = {var_name};")) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn rust_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => format!("*mut {}", self.rust_arg_type(pointee)?), - Ptr(_) => "*mut ()".to_string(), - Bool(_) => "bool".to_string(), - Array(vals) => format!("[{}; {}]", self.rust_arg_type(&vals[0])?, vals.len()), - Struct(name, _) => name.to_string(), - Float(FloatVal::c_double(_)) => "f64".to_string(), - Float(FloatVal::c_float(_)) => "f32".to_string(), - Int(int_val) => match int_val { - c__int128(_) => { - if STRUCT_128 { - "FfiI128".to_string() - } else { - "i128".to_string() - } - } - c_int64_t(_) => "i64".to_string(), - c_int32_t(_) => "i32".to_string(), - c_int16_t(_) => "i16".to_string(), - c_int8_t(_) => "i8".to_string(), - c__uint128(_) => { - if STRUCT_128 { - "FfiU128".to_string() - } else { - "u128".to_string() - } - } - c_uint64_t(_) => "u64".to_string(), - c_uint32_t(_) => "u32".to_string(), - c_uint16_t(_) => "u16".to_string(), - c_uint8_t(_) => "u8".to_string(), - }, - }; - Ok(out) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn rust_nested_type(&self, val: &Val) -> Result { - self.rust_arg_type(val) - } - - /// An expression that generates this value. - fn rust_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let out = match val { - Ref(pointee) => self.rust_val(pointee)?, - Ptr(addr) => format!("{addr:#X} as *mut ()"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_val(elem)?); - output.push_str(&part); - } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Int(int_val) => match int_val { - c__int128(val) => { - if STRUCT_128 { - format!("FfiI128::new({val})") - } else { - format!("{val}") - } - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c__uint128(val) => { - if STRUCT_128 { - format!("FfiU128::new({val:#X})") - } else { - format!("{val:#X}") - } - } - c_uint64_t(val) => format!("{val:#X}"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(out) - } - - /// A suitable default value for this type - fn rust_default_val(&self, val: &Val) -> Result { - use Val::*; - let out = match val { - Ref(pointee) => self.rust_default_val(pointee)?, - Ptr(_) => "0 as *mut ()".to_string(), - Bool(_) => "false".to_string(), - Array(vals) => { - let mut output = String::new(); - output.push('['); - for elem in vals { - let part = format!("{}, ", self.rust_default_val(elem)?); - output.push_str(&part); - } - output.push(']'); - output - } - Struct(name, fields) => { - let mut output = String::new(); - output.push_str(&format!("{name} {{ ")); - for (idx, field) in fields.iter().enumerate() { - let part = format!("{}: {},", FIELD_NAMES[idx], self.rust_default_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(..) => "0.0".to_string(), - Int(IntVal::c__int128(..)) => { - if STRUCT_128 { - "FfiI128::new(0)".to_string() - } else { - "0".to_string() - } - } - Int(IntVal::c__uint128(..)) => { - if STRUCT_128 { - "FfiU128::new(0)".to_string() - } else { - "0".to_string() - } - } - Int(..) => "0".to_string(), - }; - Ok(out) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn rust_write_val( - &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.rust_var_paths(val, from, is_var_root)? { - writeln!(output, " WRITE_FIELD.unwrap()({to}, &{path} as *const _ as *const _, core::mem::size_of_val(&{path}) as u32);").unwrap(); - } - write!(output, " FINISHED_VAL.unwrap()({to});").unwrap(); - - Ok(output) - } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for rust_write_val's use. - fn rust_var_paths( - &self, - val: &Val, - from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.rust_var_paths(field, &base, false)?); - } - paths - } - Val::Ref(pointee) => { - if is_var_root { - self.rust_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.rust_var_paths(pointee, &base, false)? - } - } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.rust_var_paths(elem, &base, false)?); - } - paths - } - }; - - Ok(paths) - } -} diff --git a/src/cli.rs b/src/cli.rs index c0cb309..d3b1ab1 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -20,21 +20,21 @@ struct Cli { add_rustc_codegen_backend: Vec, #[clap(long, default_value_t = OutputFormat::Human)] output_format: OutputFormat, + #[clap(long)] + gen_vals: Option, + #[clap(long)] + write_vals: Option, + #[clap(long)] + minimize_vals: Option, } pub fn make_app() -> Config { - static ABI_IMPLS: &[&str] = &[ - ABI_IMPL_RUSTC, - ABI_IMPL_CC, - ABI_IMPL_GCC, - ABI_IMPL_CLANG, - ABI_IMPL_MSVC, - ]; /// The pairings of impls to run. LHS calls RHS. static DEFAULT_TEST_PAIRS: &[(&str, &str)] = &[ - (ABI_IMPL_RUSTC, ABI_IMPL_RUSTC), // (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C - // (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust - // (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C + (ABI_IMPL_RUSTC, ABI_IMPL_RUSTC), + // (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C + // (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust + // (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C ]; let config = Cli::parse(); @@ -84,7 +84,9 @@ Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. } } - let value_generator = ValueGeneratorKind::Graffiti; + let val_generator = config.gen_vals.unwrap_or(ValueGeneratorKind::Graffiti); + let minimizing_write_impl = config.minimize_vals.unwrap_or(WriteImpl::Print); + let write_impl = config.write_vals.unwrap_or(WriteImpl::HarnessCallback); let output_format = config.output_format; @@ -116,6 +118,8 @@ Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. run_tests, run_pairs, rustc_codegen_backends, - val_generator: value_generator, + val_generator, + write_impl, + minimizing_write_impl, } } diff --git a/src/error.rs b/src/error.rs index a9c7cb2..86fe7c6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,11 @@ use miette::Diagnostic; +#[derive(Debug, thiserror::Error, Diagnostic)] +pub enum CliParseError { + #[error("{0}")] + Other(String), +} + #[derive(Debug, thiserror::Error, Diagnostic)] #[allow(dead_code)] pub enum GenerateError { @@ -33,7 +39,7 @@ pub enum GenerateError { Skipped, } -#[derive(Debug, thiserror::Error)] +#[derive(Debug, thiserror::Error, Diagnostic)] pub enum BuildError { #[error("io error\n{0}")] Io(#[from] std::io::Error), @@ -46,7 +52,7 @@ pub enum BuildError { } #[allow(clippy::enum_variant_names)] -#[derive(Debug, thiserror::Error)] +#[derive(Debug, thiserror::Error, Diagnostic)] pub enum CheckFailure { #[error(" {func_name} {arg_kind} count mismatch (expected: {expected_len}, caller: {}, callee: {}) caller: {caller:#02X?} @@ -118,7 +124,7 @@ pub enum CheckFailure { }, } -#[derive(Debug, thiserror::Error)] +#[derive(Debug, thiserror::Error, Diagnostic)] pub enum LinkError { #[error("io error\n{0}")] Io(#[from] std::io::Error), @@ -128,7 +134,7 @@ pub enum LinkError { RustLink(std::process::Output), } -#[derive(Debug, thiserror::Error)] +#[derive(Debug, thiserror::Error, Diagnostic)] pub enum RunError { #[error("test loading error (dynamic linking failed)\n{0}")] LoadError(#[from] libloading::Error), diff --git a/src/main.rs b/src/main.rs index aa6d024..15929c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,6 +69,8 @@ pub struct Config { pub run_tests: Vec, pub rustc_codegen_backends: Vec<(String, String)>, pub val_generator: ValueGeneratorKind, + pub write_impl: WriteImpl, + pub minimizing_write_impl: WriteImpl, } #[derive(Debug, thiserror::Error)] @@ -166,7 +168,7 @@ fn main() -> Result<(), Box> { options: TestOptions { convention: *convention, functions: FunctionSelector::All, - val_writer: WriteImpl::HarnessCallback, + val_writer: cfg.write_impl, val_generator: cfg.val_generator, }, }; @@ -232,13 +234,14 @@ fn main() -> Result<(), Box> { } if full_report.failed() { - generate_minimized_failures(&harness, &rt, &out_dir, &full_report); + generate_minimized_failures(&cfg, &harness, &rt, &out_dir, &full_report); Err(TestsFailed {})?; } Ok(()) } fn generate_minimized_failures( + cfg: &Config, harness: &Arc, rt: &tokio::runtime::Runtime, out_dir: &Utf8Path, @@ -292,7 +295,7 @@ fn generate_minimized_failures( let mut test_key = report.key.clone(); test_key.options.functions = functions; - test_key.options.val_writer = WriteImpl::Print; + test_key.options.val_writer = cfg.minimizing_write_impl; let mut rules = report.rules.clone(); rules.run = TestRunMode::Generate; diff --git a/tests/old/by_ref.ron b/tests/old/by_ref.ron deleted file mode 100644 index 127f672..0000000 --- a/tests/old/by_ref.ron +++ /dev/null @@ -1,159 +0,0 @@ -Test( - name: "by_ref", - funcs: [ - ( - name: "pass_ref", - conventions: [All], - inputs: [Ref(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]))], - output: None, - ), - ( - name: "return_ref", - conventions: [All], - inputs: [], - output: Some(Ref(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]))), - ), - ( - name: "both_ref", - conventions: [All], - inputs: [Ref(Struct("MyStruct", [Int(c_uint8_t(0x12)), Float(c_double(0.5891))]))], - output: Some(Ref(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]))), - ), - ( - name: "pass_array_ref", - conventions: [All], - inputs: [Ref(Array([ - Int(c_uint32_t(0x1234_567f)), - Int(c_uint32_t(0xae34_5e7a)), - Int(c_uint32_t(0xb234_e678)), - Int(c_uint32_t(0xa2e4_462f)), - Int(c_uint32_t(0x1204_5608)), - Int(c_uint32_t(0x09b2_7421)), - Int(c_uint32_t(0xf5e1_e972)), - ]))], - output: None, - ), - ( - name: "return_array_ref", - conventions: [All], - inputs: [], - output: Some(Ref(Array([ - Int(c_uint32_t(0x1234_567f)), - Int(c_uint32_t(0xae34_5e7a)), - Int(c_uint32_t(0xb234_e678)), - Int(c_uint32_t(0xa2e4_462f)), - Int(c_uint32_t(0x1204_5608)), - Int(c_uint32_t(0x09b2_7421)), - Int(c_uint32_t(0xf5e1_e972)), - ]))), - ), - ( - name: "both_array_ref", - conventions: [All], - inputs: [Ref(Array([ - Int(c_uint32_t(0xe13e_362f)), - Int(c_uint32_t(0xaf34_5e1a)), - Int(c_uint32_t(0xb230_e178)), - Int(c_uint32_t(0xa2e4_16ef)), - Int(c_uint32_t(0x1401_540e)), - Int(c_uint32_t(0x3912_7423)), - Int(c_uint32_t(0xf131_3972)), - ]))], - output: Some(Ref(Array([ - Int(c_uint32_t(0x1234_567f)), - Int(c_uint32_t(0xae34_5e7a)), - Int(c_uint32_t(0xb234_e678)), - Int(c_uint32_t(0xa2e4_462f)), - Int(c_uint32_t(0x1204_5608)), - Int(c_uint32_t(0x09b2_7421)), - Int(c_uint32_t(0xf5e1_e972)), - ]))), - ), - ( - name: "multi_dimensional_arrayed", - conventions: [All], - inputs: [Ref(Array([ - Array([Int(c_uint32_t(0xe13e_362f)), Int(c_uint32_t(0xaf34_5e1a))]), - Array([Int(c_uint32_t(0xb230_e178)), Int(c_uint32_t(0xa2e4_16ef))]), - Array([Int(c_uint32_t(0x1401_540e)), Int(c_uint32_t(0x3912_7423))]), - ]))], - output: Some( - Ref(Array([ - Array([Int(c_uint8_t(0xae)), Int(c_uint8_t(0xbc))]), - Array([Int(c_uint8_t(0x21)), Int(c_uint8_t(0x3f))]), - Array([Int(c_uint8_t(0x00)), Int(c_uint8_t(0x12))]), - ])) - ), - ), - ( - name: "array_of_struct_ref", - conventions: [All], - inputs: [Ref(Array([ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))]), - ]))], - output: Some( - Ref(Array([ - Struct("MyStruct", [Int(c_uint8_t(0xae)), Float(c_double(0.0002343))]), - Struct("MyStruct", [Int(c_uint8_t(0x23)), Float(c_double(134123123.232))]), - ])) - ), - ), - ( - name: "array_of_struct_padded_ref", - conventions: [All], - inputs: [Ref(Array([ - Struct("MyStruct3", [Float(c_double(1234.23)), Int(c_uint8_t(0xf1))]), - Struct("MyStruct3", [Float(c_double(3.14569)), Int(c_uint8_t(0xa2))]), - ]))], - output: Some( - Ref(Array([ - Struct("MyStruct3", [Float(c_double(4.123124)), Int(c_uint8_t(0x34))]), - Struct("MyStruct3", [Float(c_double(0.0023)), Int(c_uint8_t(0xeb))]), - ])) - ), - ), - ( - name: "complex_arrayed_ref", - conventions: [All], - inputs: [Ref(Struct("MyComplexArrayed", [ - Int(c_uint8_t(0xaf)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x5678))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(91.00001))]), - Struct("MyStruct2", [Float(c_float(3.245)), Int(c_uint16_t(0x1234))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(23.459))]), - Struct("MyStruct2", [Float(c_float(0.1234)), Int(c_uint16_t(0xaef3))]), - ]), - ]), - Int(c_uint64_t(0x3ae1_2345_2a01_318b)), - ]))], - output: Some( - Ref(Struct("MyComplexArrayed", [ - Int(c_uint8_t(0x12)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xa2)), Float(c_double(12.83123432))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x8672))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x1f)), Float(c_double(1234589))]), - Struct("MyStruct2", [Float(c_float(133.346)), Int(c_uint16_t(0x9224))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x49)), Float(c_double(123823.4597))]), - Struct("MyStruct2", [Float(c_float(0.01338)), Int(c_uint16_t(0x12f4))]), - ]), - ]), - Int(c_uint64_t(0x12e1_4395_7a08_a131)), - ])) - ) - ), - ] -) \ No newline at end of file diff --git a/tests/old/opaque_example.ron b/tests/old/opaque_example.ron deleted file mode 100644 index d1f24a1..0000000 --- a/tests/old/opaque_example.ron +++ /dev/null @@ -1,15 +0,0 @@ -Test( - name: "opaque_example", - funcs: [ - ( - name: "i_am_opaque_to_the_test_harness", - conventions: [Handwritten], - // NOTE: inputs + outputs totally ignored with Handwritten, - // test can do whatever the fuck it wants as long as it - // consistently uses FINISH_VAL to dynamically - // report the inputs/outputs to the harness. - inputs: [], - output: None, - ) - ] -) diff --git a/tests/old/structs.ron b/tests/old/structs.ron deleted file mode 100644 index e21d51a..0000000 --- a/tests/old/structs.ron +++ /dev/null @@ -1,139 +0,0 @@ -Test( - name: "structs", - funcs: [ - ( - name: "pass_one", - conventions: [All], - inputs: [Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])], - output: None, - ), - ( - name: "return_one", - conventions: [All], - inputs: [], - output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), - ), - ( - name: "both_one", - conventions: [All], - inputs: [Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))])], - output: Some(Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))])), - ), - ( - name: "same_def", - conventions: [All], - inputs: [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct", [Int(c_uint8_t(0x1)), Float(c_double(0.23))]), - ], - output: None, - ), - ( - name: "diff_def", - conventions: [All], - inputs: [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(123.43)), Int(c_uint16_t(0x5678))]), - ], - output: None, - ), - ( - name: "nested", - conventions: [All], - inputs: [ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(2312.123)), Int(c_uint16_t(0x5678))]), - ]) - ], - output: Some( - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xe3)), Float(c_double(5789.16))]), - Struct("MyStruct2", [Float(c_float(12.01)), Int(c_uint16_t(0x3e2f))]), - ]) - ), - ), - ( - name: "arrayed", - conventions: [All], - inputs: [Struct("MyArray", [Array([ - Int(c_uint32_t(0xe13e_362f)), - Int(c_uint32_t(0xaf34_5e1a)), - Int(c_uint32_t(0xb230_e178)), - Int(c_uint32_t(0xa2e4_16ef)), - Int(c_uint32_t(0x1401_540e)), - Int(c_uint32_t(0x3912_7423)), - Int(c_uint32_t(0xf131_3972)), - ])])], - output: Some( - Struct("MyArray2", [Array([ - Int(c_uint8_t(0xae)), - Int(c_uint8_t(0xbc)), - Int(c_uint8_t(0x21)), - Int(c_uint8_t(0x3f)), - Int(c_uint8_t(0x00)), - Int(c_uint8_t(0x12)), - Int(c_uint8_t(0xfe)), - ])]) - ), - ), - ( - name: "multi_dimensional_arrayed", - conventions: [All], - inputs: [Struct("MyArray3", [Array([ - Array([Int(c_uint32_t(0xe13e_362f)), Int(c_uint32_t(0xaf34_5e1a))]), - Array([Int(c_uint32_t(0xb230_e178)), Int(c_uint32_t(0xa2e4_16ef))]), - Array([Int(c_uint32_t(0x1401_540e)), Int(c_uint32_t(0x3912_7423))]), - ])])], - output: Some( - Struct("MyArray4", [Array([ - Array([Int(c_uint8_t(0xae)), Int(c_uint8_t(0xbc))]), - Array([Int(c_uint8_t(0x21)), Int(c_uint8_t(0x3f))]), - Array([Int(c_uint8_t(0x00)), Int(c_uint8_t(0x12))]), - ])]) - ), - ), - ( - name: "complex_arrayed", - conventions: [All], - inputs: [Struct("MyComplexArrayed", [ - Int(c_uint8_t(0xaf)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(1234.23))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x5678))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(91.00001))]), - Struct("MyStruct2", [Float(c_float(3.245)), Int(c_uint16_t(0x1234))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xf1)), Float(c_double(23.459))]), - Struct("MyStruct2", [Float(c_float(0.1234)), Int(c_uint16_t(0xaef3))]), - ]), - ]), - Int(c_uint64_t(0x3ae1_2345_2a01_318b)), - ])], - output: Some( - Struct("MyComplexArrayed", [ - Int(c_uint8_t(0x13)), - Array([ - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0xa2)), Float(c_double(12.83123432))]), - Struct("MyStruct2", [Float(c_float(81344789.12)), Int(c_uint16_t(0x8672))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x1f)), Float(c_double(1234589))]), - Struct("MyStruct2", [Float(c_float(133.346)), Int(c_uint16_t(0x9224))]), - ]), - Struct("MyComplex", [ - Struct("MyStruct", [Int(c_uint8_t(0x49)), Float(c_double(123823.4597))]), - Struct("MyStruct2", [Float(c_float(0.01338)), Int(c_uint16_t(0x12f4))]), - ]), - ]), - Int(c_uint64_t(0x12e1_4395_7a08_a131)), - ]) - ) - ), - ] -) \ No newline at end of file diff --git a/tests/old/sysv_i128_emulation.ron b/tests/old/sysv_i128_emulation.ron deleted file mode 100644 index a413ccf..0000000 --- a/tests/old/sysv_i128_emulation.ron +++ /dev/null @@ -1,83 +0,0 @@ -Test( - name: "sysv_i128_emulation", - funcs: [ - ( - name: "callee_native_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "callee_emulated_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "callee_unaligned_emulated_layout", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "native_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "native_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "native_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "emulated_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "emulated_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "emulated_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - - - ( - name: "unaligned_emulated_to_native", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "unaligned_emulated_to_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ( - name: "unaligned_emulated_to_unaligned_emulated", - conventions: [Handwritten], - inputs: [], - output: None, - ), - ] -) From dd5ab88f1dd459f37cadb3db9d65eb023ef8a148 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 26 Jun 2024 23:03:35 -0400 Subject: [PATCH 31/44] cleanup --- src/cli.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index d3b1ab1..48b6b09 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -90,17 +90,6 @@ Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. let output_format = config.output_format; - /* - let fmt_layer = tracing_subscriber::fmt::layer() - .without_time() - .with_target(false) - .with_writer(std::io::stderr); - tracing_subscriber::registry() - .with(filter_layer) - // .with(forest_layer) - .with(fmt_layer) - .init(); - */ let filter_layer = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new("info")) .unwrap(); From 4e70db59e93052079a51063e40bb5920eabef14b Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 11:45:01 -0400 Subject: [PATCH 32/44] remove legacy handwritten stuff, allow backends to explicitly signal non-support inline --- Cargo.lock | 518 +++++++----------- .../cc/opaque_example_handwritten_cc_callee.c | 27 - .../cc/opaque_example_handwritten_cc_caller.c | 32 -- ...ysv_i128_emulation_handwritten_cc_callee.c | 231 -------- ...opaque_example_handwritten_rustc_callee.rs | 32 -- ...opaque_example_handwritten_rustc_caller.rs | 38 -- ...i128_emulation_handwritten_rustc_caller.rs | 333 ----------- src/abis/mod.rs | 20 +- src/abis/rust.rs | 212 ++++--- src/abis/vals.rs | 52 +- src/error.rs | 40 +- src/harness/generate.rs | 15 +- src/harness/mod.rs | 70 +-- src/main.rs | 6 +- src/report.rs | 25 +- tests/procgen_in/MetersU32.procgen.kdl | 12 + 16 files changed, 427 insertions(+), 1236 deletions(-) delete mode 100644 handwritten_impls/cc/opaque_example_handwritten_cc_callee.c delete mode 100644 handwritten_impls/cc/opaque_example_handwritten_cc_caller.c delete mode 100644 handwritten_impls/cc/sysv_i128_emulation_handwritten_cc_callee.c delete mode 100644 handwritten_impls/rustc/opaque_example_handwritten_rustc_callee.rs delete mode 100644 handwritten_impls/rustc/opaque_example_handwritten_rustc_caller.rs delete mode 100644 handwritten_impls/rustc/sysv_i128_emulation_handwritten_rustc_caller.rs create mode 100644 tests/procgen_in/MetersU32.procgen.kdl diff --git a/Cargo.lock b/Cargo.lock index ff7e952..26a5566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ version = "0.1.0" dependencies = [ "built", "camino", - "cc 1.0.73 (git+https://github.com/Gankra/cc-rs)", + "cc 1.0.73", "clap", "console", "kdl", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -45,56 +45,57 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -102,18 +103,18 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", - "cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.101", "cfg-if", "libc", "miniz_oxide", @@ -132,9 +133,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" @@ -144,15 +145,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "built" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f346b6890a0dfa7266974910e7df2d5088120dd54721b9b0e5aae1ae5e05715" +checksum = "5b9c056b9ed43aee5e064b683aa1ec783e19c6acec7559e3ae931b7490472fbe" dependencies = [ "cargo-lock", ] @@ -174,9 +175,9 @@ dependencies = [ [[package]] name = "cargo-lock" -version = "7.0.1" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb04b88bd5b2036e30704f95c6ee16f3b5ca3b4ca307da2889d9006648e5c88" +checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" dependencies = [ "semver", "serde", @@ -187,13 +188,13 @@ dependencies = [ [[package]] name = "cc" version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +source = "git+https://github.com/Gankra/cc-rs#0f6c1fdae918171fe1174272ad637d8929527863" [[package]] name = "cc" -version = "1.0.73" -source = "git+https://github.com/Gankra/cc-rs#0f6c1fdae918171fe1174272ad637d8929527863" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" [[package]] name = "cfg-if" @@ -203,9 +204,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -213,9 +214,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -226,9 +227,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck", "proc-macro2", @@ -238,15 +239,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "console" @@ -273,17 +274,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.9" @@ -294,16 +284,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)", - "libc", -] - [[package]] name = "fixedbitset" version = "0.4.2" @@ -312,11 +292,10 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "matches", "percent-encoding", ] @@ -333,15 +312,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -351,76 +330,58 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "idna" -version = "0.2.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", ] [[package]] -name = "io-lifetimes" -version = "1.0.3" +name = "is-terminal" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ + "hermit-abi", "libc", - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] -name = "is-terminal" -version = "0.4.2" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" -dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes", - "rustix 0.36.6", - "windows-sys 0.42.0", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "is_ci" -version = "1.1.1" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "kdl" @@ -454,9 +415,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -466,9 +427,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", "winapi", @@ -483,12 +444,6 @@ dependencies = [ "serde", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -517,20 +472,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" -version = "2.4.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" @@ -572,9 +521,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -612,28 +561,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.13.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -667,20 +616,20 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -700,18 +649,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -757,22 +706,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -781,20 +731,37 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ron" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" +checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" dependencies = [ "base64", "bitflags 1.3.2", @@ -803,23 +770,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustix" -version = "0.36.6" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" -dependencies = [ - "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" @@ -827,48 +780,48 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", - "errno 0.3.9", + "bitflags 2.6.0", + "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.6" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -877,9 +830,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -888,9 +841,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -906,15 +859,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smawk" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" @@ -962,9 +915,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -987,15 +940,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.34", + "rustix", "windows-sys 0.48.0", ] [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" dependencies = [ "smawk", "unicode-linebreak", @@ -1004,18 +957,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", @@ -1024,33 +977,34 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -1068,9 +1022,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -1079,9 +1033,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -1149,57 +1103,53 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" -dependencies = [ - "regex", -] +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "url" -version = "2.2.2" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -1235,21 +1185,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.0", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm 0.42.0", - "windows_x86_64_msvc 0.42.0", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -1265,7 +1200,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -1285,25 +1220,20 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -1312,15 +1242,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1330,15 +1254,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1348,15 +1266,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] -name = "windows_i686_msvc" -version = "0.42.0" +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1366,15 +1284,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1384,15 +1296,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1402,15 +1308,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1420,6 +1320,6 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/handwritten_impls/cc/opaque_example_handwritten_cc_callee.c b/handwritten_impls/cc/opaque_example_handwritten_cc_callee.c deleted file mode 100644 index d487e8b..0000000 --- a/handwritten_impls/cc/opaque_example_handwritten_cc_callee.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "../../harness/c_test_prefix.h" - -typedef struct MyStruct { - uint64_t field0; - uint32_t* field1; -} MyStruct; - -bool i_am_opaque_to_the_test_harness(uint64_t arg0, MyStruct* arg1, MyStruct arg2) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1->field0, (uint32_t)sizeof(arg1->field0)); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1->field1, (uint32_t)sizeof(arg1->field1)); - FINISHED_VAL(CALLEE_INPUTS); - - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2.field0, (uint32_t)sizeof(arg2.field0)); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2.field1, (uint32_t)sizeof(arg2.field1)); - FINISHED_VAL(CALLEE_INPUTS); - - bool output = true; - - WRITE_FIELD(CALLEE_OUTPUTS, (char*)&output, (uint32_t)sizeof(output)); - FINISHED_VAL(CALLEE_OUTPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); - return output; -} \ No newline at end of file diff --git a/handwritten_impls/cc/opaque_example_handwritten_cc_caller.c b/handwritten_impls/cc/opaque_example_handwritten_cc_caller.c deleted file mode 100644 index 8fe0275..0000000 --- a/handwritten_impls/cc/opaque_example_handwritten_cc_caller.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../../harness/c_test_prefix.h" - -typedef struct MyStruct { - uint64_t field0; - uint32_t* field1; -} MyStruct; - -bool i_am_opaque_to_the_test_harness(uint64_t arg0, MyStruct* arg1, MyStruct arg2); - -void do_test(void) { - uint64_t arg0 = 0x1234567898765432; - WRITE_FIELD(CALLER_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLER_INPUTS); - - uint32_t temp1 = 0xa8f0ed12; - MyStruct arg1 = { 0xaf3e3628b800cd32, &temp1 }; - WRITE_FIELD(CALLER_INPUTS, (char*)&arg1.field0, (uint32_t)sizeof(arg1.field0)); - WRITE_FIELD(CALLER_INPUTS, (char*)&arg1.field1, (uint32_t)sizeof(arg1.field1)); - FINISHED_VAL(CALLER_INPUTS); - - MyStruct arg2 = { 0xbe102623e810ad39, 0 }; - WRITE_FIELD(CALLER_INPUTS, (char*)&arg2.field0, (uint32_t)sizeof(arg2.field0)); - WRITE_FIELD(CALLER_INPUTS, (char*)&arg2.field1, (uint32_t)sizeof(arg2.field1)); - FINISHED_VAL(CALLER_INPUTS); - - bool output = i_am_opaque_to_the_test_harness(arg0, &arg1, arg2); - - WRITE_FIELD(CALLER_OUTPUTS, (char*)&output, (uint32_t)sizeof(output)); - FINISHED_VAL(CALLER_OUTPUTS); - - FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS); -} \ No newline at end of file diff --git a/handwritten_impls/cc/sysv_i128_emulation_handwritten_cc_callee.c b/handwritten_impls/cc/sysv_i128_emulation_handwritten_cc_callee.c deleted file mode 100644 index f4067e8..0000000 --- a/handwritten_impls/cc/sysv_i128_emulation_handwritten_cc_callee.c +++ /dev/null @@ -1,231 +0,0 @@ -#include "../../harness/c_test_prefix.h" - -/* -According to the popularly shared x64 SysV ABI document -https://www.uclibc.org/docs/psABI-x86_64.pdf -3.2.3 Parameter Passing (page 18) - ---------------------------------------------------------- - -Arguments of type __int128 offer the same operations as INTEGERs, -yet they do not fit into one general purpose register but require two registers. -For classification purposes __int128 is treated as if it were implemented -as: - -typedef struct { - long low, high; -} __int128; - -with the exception that arguments of type __int128 that are stored in -memory must be aligned on a 16-byte boundary. - --------------------------------------------------------- - -So at least in theory, this type should be ABI-compatible with -__int128 on x64 sysv platforms (like x64 linux). Let's try: -*/ - -typedef struct { - long low, high; -} my_int128 __attribute__ ((aligned (16))); - -typedef struct { - long low, high; -} my_unaligned_int128; - -typedef void (*functy1)(__int128, __int128, float, __int128, uint8_t, __int128); -typedef void (*functy2)(my_int128, my_int128, float, my_int128, uint8_t, my_int128); - -void callee_native_layout(__int128* arg0, __int128* arg1, __int128* arg2) { - WRITE_FIELD(CALLEE_INPUTS, (char*)arg0, (uint32_t)sizeof(*arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg1, (uint32_t)sizeof(*arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg2, (uint32_t)sizeof(*arg2)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} -void callee_emulated_layout(my_int128* arg0, my_int128* arg1, my_int128* arg2) { - WRITE_FIELD(CALLEE_INPUTS, (char*)arg0, (uint32_t)sizeof(*arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg1, (uint32_t)sizeof(*arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg2, (uint32_t)sizeof(*arg2)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} -void callee_unaligned_emulated_layout(my_unaligned_int128* arg0, my_unaligned_int128* arg1, my_unaligned_int128* arg2) { - WRITE_FIELD(CALLEE_INPUTS, (char*)arg0, (uint32_t)sizeof(*arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg1, (uint32_t)sizeof(*arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)arg2, (uint32_t)sizeof(*arg2)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Native Version -void native_to_native(__int128 arg0, __int128 arg1, float arg2, __int128 arg3, uint8_t arg4, __int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Emulated Version -void native_to_emulated(my_int128 arg0, my_int128 arg1, float arg2, my_int128 arg3, uint8_t arg4, my_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Unaligned Emulated Version -void native_to_unaligned_emulated(my_unaligned_int128 arg0, my_unaligned_int128 arg1, float arg2, my_unaligned_int128 arg3, uint8_t arg4, my_unaligned_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - - -// Native Version -void emulated_to_native(__int128 arg0, __int128 arg1, float arg2, __int128 arg3, uint8_t arg4, __int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Emulated Version -void emulated_to_emulated(my_int128 arg0, my_int128 arg1, float arg2, my_int128 arg3, uint8_t arg4, my_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Unaligned Emulated Version -void emulated_to_unaligned_emulated(my_unaligned_int128 arg0, my_unaligned_int128 arg1, float arg2, my_unaligned_int128 arg3, uint8_t arg4, my_unaligned_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Native Version -void unaligned_emulated_to_native(__int128 arg0, __int128 arg1, float arg2, __int128 arg3, uint8_t arg4, __int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Emulated Version -void unaligned_emulated_to_emulated(my_int128 arg0, my_int128 arg1, float arg2, my_int128 arg3, uint8_t arg4, my_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} - -// Unaligned Emulated Version -void unaligned_emulated_to_unaligned_emulated(my_unaligned_int128 arg0, my_unaligned_int128 arg1, float arg2, my_unaligned_int128 arg3, uint8_t arg4, my_unaligned_int128 arg5) { - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg0, (uint32_t)sizeof(arg0)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg2, (uint32_t)sizeof(arg2)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg3, (uint32_t)sizeof(arg3)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg4, (uint32_t)sizeof(arg4)); - FINISHED_VAL(CALLEE_INPUTS); - WRITE_FIELD(CALLEE_INPUTS, (char*)&arg5, (uint32_t)sizeof(arg5)); - FINISHED_VAL(CALLEE_INPUTS); - - FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS); -} \ No newline at end of file diff --git a/handwritten_impls/rustc/opaque_example_handwritten_rustc_callee.rs b/handwritten_impls/rustc/opaque_example_handwritten_rustc_callee.rs deleted file mode 100644 index 5985794..0000000 --- a/handwritten_impls/rustc/opaque_example_handwritten_rustc_callee.rs +++ /dev/null @@ -1,32 +0,0 @@ -include!("../../harness/rust_test_prefix.rs"); - -#[repr(C)] -pub struct MyStruct<'a> { - field0: u64, - field1: Option<&'a u32>, -} - -#[no_mangle] -pub unsafe extern fn i_am_opaque_to_the_test_harness(arg0: u64, arg1: &MyStruct, arg2: MyStruct) -> bool { - unsafe { - WRITE_FIELD.unwrap()(CALLEE_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLEE_INPUTS); - - WRITE_FIELD.unwrap()(CALLEE_INPUTS, &arg1.field0 as *const _ as *const _, core::mem::size_of_val(&arg1.field0) as u32); - WRITE_FIELD.unwrap()(CALLEE_INPUTS, &arg1.field1 as *const _ as *const _, core::mem::size_of_val(&arg1.field1) as u32); - FINISHED_VAL.unwrap()(CALLEE_INPUTS); - - WRITE_FIELD.unwrap()(CALLEE_INPUTS, &arg2.field0 as *const _ as *const _, core::mem::size_of_val(&arg2.field0) as u32); - WRITE_FIELD.unwrap()(CALLEE_INPUTS, &arg2.field1 as *const _ as *const _, core::mem::size_of_val(&arg2.field1) as u32); - FINISHED_VAL.unwrap()(CALLEE_INPUTS); - - let output = true; - - WRITE_FIELD.unwrap()(CALLEE_OUTPUTS, &output as *const _ as *const _, core::mem::size_of_val(&output) as u32); - FINISHED_VAL.unwrap()(CALLEE_OUTPUTS); - - FINISHED_FUNC.unwrap()(CALLEE_INPUTS, CALLEE_OUTPUTS); - - return output; - } -} \ No newline at end of file diff --git a/handwritten_impls/rustc/opaque_example_handwritten_rustc_caller.rs b/handwritten_impls/rustc/opaque_example_handwritten_rustc_caller.rs deleted file mode 100644 index 02f0c34..0000000 --- a/handwritten_impls/rustc/opaque_example_handwritten_rustc_caller.rs +++ /dev/null @@ -1,38 +0,0 @@ -include!("../../harness/rust_test_prefix.rs"); - -#[repr(C)] -pub struct MyStruct<'a> { - field0: u64, - field1: Option<&'a u32>, -} - -extern "C" { - fn i_am_opaque_to_the_test_harness(arg0: u64, arg1: &MyStruct, arg2: MyStruct) -> bool; -} - -#[no_mangle] -pub extern fn do_test() { - unsafe { - let arg0 = 0x1234_5678_9876_5432u64; - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - let temp1 = 0xa8f0_ed12u32; - let arg1 = MyStruct { field0: 0xaf3e_3628_b800_cd32, field1: Some(&temp1) }; - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1.field0 as *const _ as *const _, core::mem::size_of_val(&arg1.field0) as u32); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1.field1 as *const _ as *const _, core::mem::size_of_val(&arg1.field1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - let arg2 = MyStruct { field0: 0xbe10_2623_e810_ad39, field1: None }; - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2.field0 as *const _ as *const _, core::mem::size_of_val(&arg2.field0) as u32); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2.field1 as *const _ as *const _, core::mem::size_of_val(&arg2.field1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - let output = i_am_opaque_to_the_test_harness(arg0, &arg1, arg2); - - WRITE_FIELD.unwrap()(CALLER_OUTPUTS, &output as *const _ as *const _, core::mem::size_of_val(&output) as u32); - FINISHED_VAL.unwrap()(CALLER_OUTPUTS); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } -} \ No newline at end of file diff --git a/handwritten_impls/rustc/sysv_i128_emulation_handwritten_rustc_caller.rs b/handwritten_impls/rustc/sysv_i128_emulation_handwritten_rustc_caller.rs deleted file mode 100644 index 16d6203..0000000 --- a/handwritten_impls/rustc/sysv_i128_emulation_handwritten_rustc_caller.rs +++ /dev/null @@ -1,333 +0,0 @@ -include!("../../harness/rust_test_prefix.rs"); - -#[repr(C, align(16))] -pub struct my_i128 { - low: i64, - high: i64, -} -#[repr(C)] -pub struct my_unaligned_i128 { - low: i64, - high: i64, -} - -impl my_i128 { - fn new(val: i128) -> Self { - Self { - low: val as u64 as i64, - high: (val as u128 >> 64) as u64 as i64, - } - } -} -impl my_unaligned_i128 { - fn new(val: i128) -> Self { - Self { - low: val as u64 as i64, - high: (val as u128 >> 64) as u64 as i64, - } - } -} - - -extern { - fn callee_native_layout(arg0: &i128, arg1: &my_i128, arg2: &my_unaligned_i128); - fn callee_emulated_layout(arg0: &i128, arg1: &my_i128, arg2: &my_unaligned_i128); - fn callee_unaligned_emulated_layout(arg0: &i128, arg1: &my_i128, arg2: &my_unaligned_i128); - - fn native_to_native(arg0: i128, arg1: i128, arg2: f32, arg3: i128, arg4: u8, arg5: i128); - fn native_to_emulated(arg0: i128, arg1: i128, arg2: f32, arg3: i128, arg4: u8, arg5: i128); - fn native_to_unaligned_emulated(arg0: i128, arg1: i128, arg2: f32, arg3: i128, arg4: u8, arg5: i128); - - fn emulated_to_native(arg0: my_i128, arg1: my_i128, arg2: f32, arg3: my_i128, arg4: u8, arg5: my_i128); - fn emulated_to_emulated(arg0: my_i128, arg1: my_i128, arg2: f32, arg3: my_i128, arg4: u8, arg5: my_i128); - fn emulated_to_unaligned_emulated(arg0: my_i128, arg1: my_i128, arg2: f32, arg3: my_i128, arg4: u8, arg5: my_i128); - - fn unaligned_emulated_to_native(arg0: my_unaligned_i128, arg1: my_unaligned_i128, arg2: f32, arg3: my_unaligned_i128, arg4: u8, arg5: my_unaligned_i128); - fn unaligned_emulated_to_emulated(arg0: my_unaligned_i128, arg1: my_unaligned_i128, arg2: f32, arg3: my_unaligned_i128, arg4: u8, arg5: my_unaligned_i128); - fn unaligned_emulated_to_unaligned_emulated(arg0: my_unaligned_i128, arg1: my_unaligned_i128, arg2: f32, arg3: my_unaligned_i128, arg4: u8, arg5: my_unaligned_i128); -} - -#[no_mangle] pub extern "C" fn do_test() { - unsafe { - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - callee_native_layout(&arg0, &arg1, &arg2); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - callee_emulated_layout(&arg0, &arg1, &arg2); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - callee_unaligned_emulated_layout(&arg0, &arg1, &arg2); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // native -> native (expected fail) - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1: i128 = 34784419711585546284254720952638769794; - let arg2: f32 = 1234.456; - let arg3: i128 = 34784419711585546284254720952638769794; - let arg4: u8 = 235; - let arg5: i128 = 34784419711585546284254720952638769794; - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - native_to_native(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // native -> emulated (expected fail) - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1: i128 = 34784419711585546284254720952638769794; - let arg2: f32 = 1234.456; - let arg3: i128 = 34784419711585546284254720952638769794; - let arg4: u8 = 235; - let arg5: i128 = 34784419711585546284254720952638769794; - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - native_to_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // native -> unaligned_emulated (expected pass?) - let arg0: i128 = 34784419711585546284254720952638769794; - let arg1: i128 = 34784419711585546284254720952638769794; - let arg2: f32 = 1234.456; - let arg3: i128 = 34784419711585546284254720952638769794; - let arg4: u8 = 235; - let arg5: i128 = 34784419711585546284254720952638769794; - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - native_to_unaligned_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // emulated -> native (expected fail?) - let arg0 = my_i128::new(34784419711585546284254720952638769794); - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - emulated_to_native(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // emulated -> emulated (expected pass?) - let arg0 = my_i128::new(34784419711585546284254720952638769794); - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - emulated_to_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // emulated -> unaligned_emulated (expected fail?) - let arg0 = my_i128::new(34784419711585546284254720952638769794); - let arg1 = my_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - emulated_to_unaligned_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // unaligned_emulated -> native (expected fail?) - let arg0 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg1 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - unaligned_emulated_to_native(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // unaligned_emulated -> emulated (expected fail?) - let arg0 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg1 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - unaligned_emulated_to_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } - unsafe { - // unaligned_emulated -> unaligned_emulated (expected fail?) - let arg0 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg1 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg2: f32 = 1234.456; - let arg3 = my_unaligned_i128::new(34784419711585546284254720952638769794); - let arg4: u8 = 235; - let arg5 = my_unaligned_i128::new(34784419711585546284254720952638769794); - - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg0 as *const _ as *const _, core::mem::size_of_val(&arg0) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg1 as *const _ as *const _, core::mem::size_of_val(&arg1) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg2 as *const _ as *const _, core::mem::size_of_val(&arg2) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg3 as *const _ as *const _, core::mem::size_of_val(&arg3) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg4 as *const _ as *const _, core::mem::size_of_val(&arg4) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - WRITE_FIELD.unwrap()(CALLER_INPUTS, &arg5 as *const _ as *const _, core::mem::size_of_val(&arg5) as u32); - FINISHED_VAL.unwrap()(CALLER_INPUTS); - - unaligned_emulated_to_unaligned_emulated(arg0, arg1, arg2, arg3, arg4, arg5, ); - - FINISHED_FUNC.unwrap()(CALLER_INPUTS, CALLER_OUTPUTS); - } -} \ No newline at end of file diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 8b244d8..1661e0b 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -28,7 +28,6 @@ pub static ABI_IMPL_CLANG: &str = "clang"; pub static ABI_IMPL_MSVC: &str = "msvc"; pub static ALL_CONVENTIONS: &[CallingConvention] = &[ - CallingConvention::Handwritten, CallingConvention::C, CallingConvention::Cdecl, CallingConvention::Stdcall, @@ -274,7 +273,6 @@ pub trait AbiImpl { fn name(&self) -> &'static str; fn lang(&self) -> &'static str; fn src_ext(&self) -> &'static str; - fn supports_options(&self, options: &TestOptions) -> bool; fn pun_env(&self) -> Arc; fn generate_callee(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; fn generate_caller(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError>; @@ -294,15 +292,15 @@ pub trait AbiImpl { } impl Test { - pub fn has_convention(&self, convention: CallingConvention) -> bool { - convention != CallingConvention::Handwritten + pub fn has_convention(&self, _convention: CallingConvention) -> bool { + true } pub async fn with_vals( self: &Arc, vals: ValueGeneratorKind, ) -> Result, GenerateError> { - let vals = Arc::new(ValueTree::new(&self.types, vals)); + let vals = Arc::new(ValueTree::new(&self.types, vals)?); Ok(Arc::new(TestWithVals { inner: self.clone(), vals, @@ -341,12 +339,6 @@ impl TestWithAbi { #[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)] #[serde(rename = "lowercase")] pub enum CallingConvention { - // These conventions are special ones that "desugar" to others - /// Sugar for "every possible convention" - All, - /// A complete opaque convention, the implementation must be manually - /// written in the handwritten_impls directory. - Handwritten, /// The platform's default C convention (cdecl?) C, /// ??? @@ -376,10 +368,6 @@ pub enum CallingConvention { impl CallingConvention { pub fn name(&self) -> &'static str { match self { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar and shouldn't reach here!") - } - CallingConvention::Handwritten => "handwritten", CallingConvention::C => "c", CallingConvention::Cdecl => "cdecl", CallingConvention::System => "system", @@ -404,8 +392,6 @@ impl std::str::FromStr for CallingConvention { fn from_str(s: &str) -> Result { let val = match s { - "all" => CallingConvention::All, - "handwritten" => CallingConvention::Handwritten, "c" => CallingConvention::C, "cdecl" => CallingConvention::Cdecl, "system" => CallingConvention::System, diff --git a/src/abis/rust.rs b/src/abis/rust.rs index a241005..3ed75a4 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -3,8 +3,10 @@ use std::sync::Arc; use camino::Utf8Path; +use kdl_script::parse::Attr; use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use kdl_script::PunEnv; +use tracing::warn; use vals::{ArgValuesIter, Value}; use self::error::GenerateError; @@ -43,56 +45,6 @@ impl AbiImpl for RustcAbiImpl { lang: "rust".to_string(), }) } - fn supports_options( - &self, - TestOptions { - convention, - functions, - val_writer, - val_generator: _, - }: &TestOptions, - ) -> bool { - // NOTE: Rustc spits out: - // - // Rust, C, C-unwind, cdecl, stdcall, stdcall-unwind, fastcall, - // vectorcall, thiscall, thiscall-unwind, aapcs, win64, sysv64, - // ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, - // efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, - // wasm, system, system-unwind, rust-intrinsic, rust-call, - // platform-intrinsic, unadjusted - let supports_convention = match convention { - CallingConvention::All => unreachable!(), - CallingConvention::Handwritten => true, - CallingConvention::C => true, - CallingConvention::Cdecl => true, - CallingConvention::System => true, - CallingConvention::Win64 => true, - CallingConvention::Sysv64 => true, - CallingConvention::Aapcs => true, - CallingConvention::Stdcall => true, - CallingConvention::Fastcall => true, - CallingConvention::Vectorcall => false, // too experimental even for nightly use? - }; - let supports_writer = match val_writer { - WriteImpl::HarnessCallback => true, - WriteImpl::Print => true, - WriteImpl::Assert => true, - WriteImpl::Noop => true, - }; - let supports_query = match functions { - FunctionSelector::All => true, - FunctionSelector::One { idx: _, args } => match args { - ArgSelector::All => true, - ArgSelector::One { idx: _, vals } => match vals { - ValSelector::All => true, - ValSelector::One { idx: _ } => true, - }, - }, - }; - - supports_convention && supports_writer && supports_query - } - fn compile_callee( &self, src_path: &Utf8Path, @@ -234,9 +186,9 @@ impl RustcAbiImpl { let output = proper_outputs.next(); let too_many_outputs = proper_outputs.next(); if too_many_outputs.is_some() { - return Err(GenerateError::RustUnsupported( + return Err(UnsupportedError::Other( "multiple normal returns (should this be a tuple?)".to_owned(), - )); + ))?; } if let Some(output) = output { write!(f, "let {} = ", output.name)?; @@ -384,18 +336,18 @@ impl RustcAbiImpl { PrimitiveTy::F64 => "f64", PrimitiveTy::Bool => "bool", PrimitiveTy::Ptr => "*mut ()", - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( - "rust doesn't have i256".to_owned(), - ))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( - "rust doesn't have u256".to_owned(), - ))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( - "rust doesn't have f16".to_owned(), - ))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( - "rust doesn't have f128".to_owned(), - ))?, + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? + } + PrimitiveTy::F16 => { + Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? + } + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? + } }; (name.to_owned(), None) } @@ -451,11 +403,11 @@ impl RustcAbiImpl { let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); (tagged_ty.name.to_string(), borrowed_tyname) } - Ty::Alias(AliasTy { name, real, attrs }) => { - assert!( - attrs.is_empty(), - "don't yet know how to apply attrs to structs" - ); + Ty::Alias(AliasTy { + name, + real, + attrs: _, + }) => { let borrowed_tyname = state .borrowed_tynames .get(real) @@ -493,18 +445,13 @@ impl RustcAbiImpl { match state.types.realize_ty(ty) { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - assert!( - struct_ty.attrs.is_empty(), - "don't yet know how to apply attrs to structs" - ); - let has_borrows = struct_ty .fields .iter() .any(|field| state.borrowed_tynames.contains_key(&field.ty)); // Emit an actual struct decl - writeln!(f, "#[repr(C)]")?; + self.repr_attr(f, &struct_ty.attrs, "struct")?; if has_borrows { writeln!(f, "struct {}<'a> {{", struct_ty.name)?; } else { @@ -524,18 +471,13 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Union(union_ty) => { - assert!( - union_ty.attrs.is_empty(), - "don't yet know how to apply attrs to unions" - ); - let has_borrows = union_ty .fields .iter() .any(|field| state.borrowed_tynames.contains_key(&field.ty)); // Emit an actual union decl - writeln!(f, "#[repr(C)]")?; + self.repr_attr(f, &union_ty.attrs, "union")?; if has_borrows { writeln!(f, "union {}<'a> {{", union_ty.name)?; } else { @@ -555,13 +497,8 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Enum(enum_ty) => { - assert!( - enum_ty.attrs.is_empty(), - "don't yet know how to apply attrs to enums" - ); - // Emit an actual enum decl - writeln!(f, "#[repr(C)]")?; + self.repr_attr(f, &enum_ty.attrs, "enum")?; writeln!(f, "#[derive(Debug, Copy, Clone, PartialEq)]")?; writeln!(f, "enum {} {{", enum_ty.name)?; f.add_indent(1); @@ -573,11 +510,6 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Tagged(tagged_ty) => { - assert!( - tagged_ty.attrs.is_empty(), - "don't yet know how to apply attrs to tagged unions" - ); - let has_borrows = tagged_ty.variants.iter().any(|v| { v.fields .as_ref() @@ -590,7 +522,7 @@ impl RustcAbiImpl { }); // Emit an actual enum decl - writeln!(f, "#[repr(C)]")?; + self.repr_attr(f, &tagged_ty.attrs, "tagged")?; if has_borrows { writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; } else { @@ -621,10 +553,11 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Alias(AliasTy { name, real, attrs }) => { - assert!( - attrs.is_empty(), - "don't yet know how to apply attrs to type aliases" - ); + if !attrs.is_empty() { + return Err(UnsupportedError::Other( + "don't yet know how to apply attrs to aliases".to_string(), + ))?; + } // Emit an actual type alias decl if let Some(real_tyname) = state.borrowed_tynames.get(real) { @@ -674,6 +607,51 @@ impl RustcAbiImpl { Ok(()) } + fn repr_attr( + &self, + f: &mut Fivemat, + attrs: &[Attr], + ty_style: &str, + ) -> Result<(), GenerateError> { + let mut repr_attrs = vec![]; + let mut packed = false; + for attr in attrs { + match attr { + Attr::Derive(attr) => { + return Err(UnsupportedError::Other(format!( + "derive attr not supported {attr:?}" + )))?; + } + Attr::Packed(_) => { + packed = true; + } + Attr::Passthrough(attr) => { + warn!("found passthrough attr on {ty_style}, assuming repr(transparent)"); + repr_attrs.push("transparent"); + } + } + } + if repr_attrs.is_empty() { + repr_attrs.push("C"); + } + if packed { + repr_attrs.push("packed"); + } + if !repr_attrs.is_empty() { + write!(f, "#[repr(")?; + let mut multi = false; + for repr in repr_attrs { + if multi { + write!(f, ", ")?; + } + multi = true; + write!(f, "{repr}")?; + } + writeln!(f, ")]")?; + } + Ok(()) + } + pub fn generate_leaf_value( &self, f: &mut Fivemat, @@ -706,18 +684,18 @@ impl RustcAbiImpl { write!(f, "{:#X}u32 as *mut ()", val.generate_u32())? } } - PrimitiveTy::I256 => Err(GenerateError::RustUnsupported( - "rust doesn't have i256".to_owned(), - ))?, - PrimitiveTy::U256 => Err(GenerateError::RustUnsupported( - "rust doesn't have u256".to_owned(), - ))?, - PrimitiveTy::F16 => Err(GenerateError::RustUnsupported( - "rust doesn't have f16".to_owned(), - ))?, - PrimitiveTy::F128 => Err(GenerateError::RustUnsupported( - "rust doesn't have f128".to_owned(), - ))?, + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? + } + PrimitiveTy::F16 => { + Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? + } + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? + } }, Ty::Enum(enum_ty) => { let name = alias.unwrap_or(&enum_ty.name); @@ -885,12 +863,6 @@ impl RustcAbiImpl { convention: CallingConvention, ) -> Result<&'static str, GenerateError> { let conv = match convention { - CallingConvention::All => { - unreachable!("CallingConvention::All is sugar that shouldn't reach here") - } - CallingConvention::Handwritten => { - unreachable!("CallingConvention::Handwritten shouldn't reach codegen backends!") - } CallingConvention::C => "C", CallingConvention::Cdecl => "cdecl", CallingConvention::System => "system", @@ -899,7 +871,11 @@ impl RustcAbiImpl { CallingConvention::Aapcs => "aapcs", CallingConvention::Stdcall => "stdcall", CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => "vectorcall", + CallingConvention::Vectorcall => { + return Err(UnsupportedError::Other( + "vectorcall is an unstable rust feature".to_owned(), + ))? + } }; Ok(conv) } @@ -967,9 +943,9 @@ impl RustcAbiImpl { continue; } if has_normal_return { - return Err(GenerateError::RustUnsupported( + return Err(UnsupportedError::Other( "multiple normal returns (should this be a tuple?)".to_owned(), - )); + ))?; } has_normal_return = true; let arg_ty = &state.tynames[&arg.ty]; diff --git a/src/abis/vals.rs b/src/abis/vals.rs index 3aa4fbb..36d51d4 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -3,7 +3,7 @@ use rand::Rng; use rand_core::{RngCore, SeedableRng}; use serde::Serialize; -use crate::{CliParseError, TestOptions}; +use crate::{CliParseError, GenerateError, TestOptions}; type RngImpl = rand_pcg::Pcg64; @@ -105,7 +105,10 @@ impl std::fmt::Display for ValueGeneratorKind { impl ValueTree { /// Create the ValueTree for an entire program - pub fn new(types: &TypedProgram, generator_kind: ValueGeneratorKind) -> Self { + pub fn new( + types: &TypedProgram, + generator_kind: ValueGeneratorKind, + ) -> Result { let mut generators = generator_kind.builder(); // Construct value generators for every function let funcs = types @@ -121,23 +124,23 @@ impl ValueTree { .map(|(is_input, arg)| { let mut vals = vec![]; let arg_name = arg.name.to_string(); - generators.build_values(types, arg.ty, &mut vals, arg_name.clone()); - ArgValues { + generators.build_values(types, arg.ty, &mut vals, arg_name.clone())?; + Ok(ArgValues { ty: arg.ty, arg_name, is_input, vals, - } + }) }) - .collect(); - FuncValues { func_name, args } + .collect::, GenerateError>>()?; + Ok(FuncValues { func_name, args }) }) - .collect(); + .collect::, GenerateError>>()?; - ValueTree { + Ok(ValueTree { generator_kind, funcs, - } + }) } #[track_caller] @@ -265,7 +268,7 @@ impl ValueGeneratorBuilder { ty_idx: TyIdx, vals: &mut Vec, path: String, - ) { + ) -> Result<(), GenerateError> { let ty = types.realize_ty(ty_idx); match ty { // Primitives and enums just have the one value @@ -276,10 +279,10 @@ impl ValueGeneratorBuilder { Ty::Empty => {} // Alias and ref are just wrappers - Ty::Alias(ty) => self.build_values(types, ty.real, vals, path), + Ty::Alias(ty) => self.build_values(types, ty.real, vals, path)?, Ty::Ref(ty) => { let new_path = format!("{path}.*"); - self.build_values(types, ty.pointee_ty, vals, new_path) + self.build_values(types, ty.pointee_ty, vals, new_path)?; } // Struct and array are just all of their fields combined @@ -287,13 +290,13 @@ impl ValueGeneratorBuilder { for field in &ty.fields { let field_name = &field.ident; let new_path = format!("{path}.{field_name}"); - self.build_values(types, field.ty, vals, new_path); + self.build_values(types, field.ty, vals, new_path)?; } } Ty::Array(ty) => { for idx in 0..ty.len { let new_path = format!("{path}[{idx}]"); - self.build_values(types, ty.elem_ty, vals, new_path); + self.build_values(types, ty.elem_ty, vals, new_path)?; } } @@ -308,7 +311,7 @@ impl ValueGeneratorBuilder { if let Some(field) = ty.fields.get(active_variant_idx) { let field_name = &field.ident; let new_path = format!("{path}.{field_name}"); - self.build_values(types, field.ty, vals, new_path); + self.build_values(types, field.ty, vals, new_path)?; } } Ty::Tagged(ty) => { @@ -325,7 +328,7 @@ impl ValueGeneratorBuilder { let variant_name = &variant.name; let field_name = &field.ident; let new_path = format!("{path}.{variant_name}.{field_name}"); - self.build_values(types, field.ty, vals, new_path); + self.build_values(types, field.ty, vals, new_path)?; } } } @@ -335,6 +338,7 @@ impl ValueGeneratorBuilder { // produce the same number of values Ty::Pun(ty) => { let mut out_vals = None::>; + let mut out_block = None::<&PunBlockTy>; let saved_self = self.clone(); for block in &ty.blocks { // Every time we re-enter here, restore our state to before we started. @@ -344,16 +348,25 @@ impl ValueGeneratorBuilder { // Shove values into a temp buffer instead of the main one let mut new_vals = vec![]; - self.build_values(types, block.real, &mut new_vals, path.clone()); + self.build_values(types, block.real, &mut new_vals, path.clone())?; // If there are multiple blocks, check that this new one matches // all the other ones in length (making the pun semantically comprehensible) if let Some(old_vals) = out_vals { - assert!(old_vals.len() != new_vals.len(), "pun {} had cases with different numbers of values (~leaf fields), this is unsupported", ty.name); + if old_vals.len() != new_vals.len() { + return Err(GenerateError::MismatchedPunVals { + pun: ty.name.to_string(), + block1: block.real.to_string(), + block1_val_count: old_vals.len(), + block2: out_block.unwrap().real.to_string(), + block2_val_count: old_vals.len(), + }); + } } // Finally store the result out_vals = Some(new_vals); + out_block = Some(block); } // If we visited any blocks, properly add the values to the output @@ -362,6 +375,7 @@ impl ValueGeneratorBuilder { } } } + Ok(()) } } diff --git a/src/error.rs b/src/error.rs index 86fe7c6..483f40f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,36 +7,38 @@ pub enum CliParseError { } #[derive(Debug, thiserror::Error, Diagnostic)] -#[allow(dead_code)] +pub enum UnsupportedError { + #[error("unsupported: {0}")] + Other(String), +} + +#[derive(Debug, thiserror::Error, Diagnostic)] pub enum GenerateError { + #[error(transparent)] + #[diagnostic(transparent)] + Unsupported(#[from] UnsupportedError), #[error("io error\n{0}")] Fmt(#[from] std::fmt::Error), #[error("io error\n{0}")] Io(#[from] std::io::Error), - #[error("kdl parse error")] - KdlParseError(String, String, #[source] kdl::KdlError), #[error(transparent)] #[diagnostic(transparent)] KdlScriptError(#[from] kdl_script::KdlScriptError), - #[error("Two structs had the name {name}, but different layout! \nExpected {old_decl} \nGot {new_decl}")] - InconsistentStructDefinition { - name: String, - old_decl: String, - new_decl: String, - }, - #[error("If you use the Handwritten calling convention, all functions in the test must use only that.")] - HandwrittenMixing, - #[error("No handwritten source for this pairing (skipping)")] - NoHandwrittenSource, - #[error("Unsupported Signature For Rust: {0}")] - RustUnsupported(String), - #[error("Unsupported Signature For C: {0}")] - CUnsupported(String), - #[error("ABI impl doesn't support this calling convention.")] - UnsupportedConvention, /// Used to signal we just skipped it #[error("")] Skipped, + #[error( + "pun {pun} had blocks with different numbers of values + block1 had {block1_val_count}: {block1} + block2 had {block2_val_count}: {block2}" + )] + MismatchedPunVals { + pun: String, + block1: String, + block1_val_count: usize, + block2: String, + block2_val_count: usize, + }, } #[derive(Debug, thiserror::Error, Diagnostic)] diff --git a/src/harness/generate.rs b/src/harness/generate.rs index da020b8..70dcee4 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -11,7 +11,6 @@ use crate::error::*; use crate::*; const GENERATED_SRC_DIR: &str = "generated_impls"; -const HANDWRITTEN_SRC_DIR: &str = "handwritten_impls"; impl TestHarness { pub async fn generate_test(&self, key: &TestKey) -> Result { @@ -58,12 +57,7 @@ impl TestHarness { } fn src_path(&self, key: &TestKey, call_side: CallSide) -> Utf8PathBuf { - let src_dir = if key.options.convention == CallingConvention::Handwritten { - Utf8PathBuf::from(HANDWRITTEN_SRC_DIR) - } else { - Utf8PathBuf::from(GENERATED_SRC_DIR) - }; - + let src_dir = Utf8PathBuf::from(GENERATED_SRC_DIR); let abi_id = key.abi_id(call_side); let abi = self.abi_by_test_key(key, call_side); let mut output = self.base_id(key, Some(call_side), "_"); @@ -88,13 +82,6 @@ async fn generate_src( call_side: CallSide, options: TestOptions, ) -> Result<(), GenerateError> { - if let CallingConvention::Handwritten = options.convention { - if src_path.exists() { - return Ok(()); - } else { - return Err(GenerateError::Skipped); - } - } let mut output_string = String::new(); let test = test_with_abi.with_options(options)?; match call_side { diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 010c48e..1e4188c 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -136,67 +136,75 @@ impl TestHarness { ) -> TestRunResults { use TestRunMode::*; - let mut run_results = TestRunResults::default(); - if test_rules.run <= Skip { - return run_results; + let mut res = TestRunResults::new(test_key, test_rules); + if res.rules.run <= Skip { + return res; } - run_results.ran_to = Generate; - run_results.source = Some(self.generate_test(&test_key).await); - let source = match run_results.source.as_ref().unwrap() { + res.ran_to = Generate; + res.source = Some(self.generate_test(&res.key).await); + let source = match res.source.as_ref().unwrap() { Ok(v) => v, Err(e) => { - warn!("Failed to generate source: {}", e); - return run_results; + // If the codegen says "hey i don't support this", respect + // that as an opt-out. (Doing it in this late-bound way + // reduces the maintenance burden on backend authors.) + if let GenerateError::Unsupported(e) = e { + res.rules.run = Skip; + warn!("skipping {}", e); + } else { + warn!("failed to generate source: {}", e); + } + return res; } }; - if test_rules.run <= Generate { - return run_results; + if res.rules.run <= Generate { + return res; } - run_results.ran_to = Build; - run_results.build = Some(self.build_test(&test_key, source, &out_dir).await); - let build = match run_results.build.as_ref().unwrap() { + res.ran_to = Build; + res.build = Some(self.build_test(&res.key, source, &out_dir).await); + let build = match res.build.as_ref().unwrap() { Ok(v) => v, Err(e) => { warn!("Failed to build test: {}", e); - return run_results; + return res; } }; - if test_rules.run <= Build { - return run_results; + if res.rules.run <= Build { + return res; } - run_results.ran_to = Link; - run_results.link = Some(self.link_dynamic_lib(&test_key, build, &out_dir).await); - let link = match run_results.link.as_ref().unwrap() { + res.ran_to = Link; + res.link = Some(self.link_dynamic_lib(&res.key, build, &out_dir).await); + let link = match res.link.as_ref().unwrap() { Ok(v) => v, Err(e) => { warn!("Failed to link test: {}", e); - return run_results; + return res; } }; - if test_rules.run <= Link { - return run_results; + if res.rules.run <= Link { + return res; } - run_results.ran_to = Run; - run_results.run = Some(self.run_dynamic_test(&test_key, link).await); - let run = match run_results.run.as_ref().unwrap() { + res.ran_to = Run; + res.run = Some(self.run_dynamic_test(&res.key, link).await); + let run = match res.run.as_ref().unwrap() { Ok(v) => v, Err(e) => { warn!("Failed to run test: {}", e); - return run_results; + return res; } }; - if test_rules.run <= Run { - return run_results; + if res.rules.run <= Run { + return res; } - run_results.ran_to = Check; - run_results.check = Some(self.check_test(&test_key, run).await); + res.ran_to = Check; + res.check = Some(self.check_test(&res.key, run).await); - run_results + res } } diff --git a/src/main.rs b/src/main.rs index 15929c7..07bfaf4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -180,7 +180,7 @@ fn main() -> Result<(), Box> { out_dir.clone(), ); - Some((test_key, rules, task)) + Some(task) }) .collect() }) @@ -191,9 +191,9 @@ fn main() -> Result<(), Box> { // Join on all the tasks, and compute their results let reports = tasks .into_iter() - .map(|(test_key, rules, task)| { + .map(|task| { let results = rt.block_on(task).expect("failed to join task"); - report_test(test_key, rules, results) + report_test(results) }) .collect::>(); diff --git a/src/report.rs b/src/report.rs index 06e2184..a9e705c 100644 --- a/src/report.rs +++ b/src/report.rs @@ -20,11 +20,6 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl check: Pass(Check), }; - // If the caller/callee don't support these options, skip them - if !caller.supports_options(&test.options) || !callee.supports_options(&test.options) { - result.run = Skip; - } - // Now apply specific custom expectations for platforms/suites let is_c = caller.lang() == "c" || callee.lang() == "c"; let is_rust = caller.lang() == "rust" || callee.lang() == "rust"; @@ -123,11 +118,11 @@ pub struct RunOutput { pub callee_outputs: WriteBuffer, } -pub fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> TestReport { +pub fn report_test(results: TestRunResults) -> TestReport { use TestConclusion::*; use TestRunMode::*; // Ok now check if it matched our expectation - let conclusion = if rules.run == Skip { + let conclusion = if results.rules.run == Skip { // If we were told to skip, we skipped Skipped } else if let Some(Err(GenerateError::Skipped)) = results.source { @@ -136,7 +131,7 @@ pub fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> T // a million unsupported combinations Skipped } else { - let passed = match &rules.check { + let passed = match &results.rules.check { TestCheckMode::Pass(must_pass) => match must_pass { Skip => true, Generate => results.source.as_ref().map(|r| r.is_ok()).unwrap_or(false), @@ -164,7 +159,7 @@ pub fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> T TestCheckMode::Random => true, }; if passed { - if matches!(rules.check, TestCheckMode::Busted(_)) { + if matches!(results.rules.check, TestCheckMode::Busted(_)) { TestConclusion::Busted } else { TestConclusion::Passed @@ -174,8 +169,8 @@ pub fn report_test(key: TestKey, rules: TestRules, results: TestRunResults) -> T } }; TestReport { - key, - rules, + key: results.key.clone(), + rules: results.rules.clone(), conclusion, results, } @@ -271,6 +266,8 @@ pub enum TestCheckMode { #[derive(Debug, Serialize)] pub struct TestRunResults { + pub key: TestKey, + pub rules: TestRules, pub ran_to: TestRunMode, pub source: Option>, pub build: Option>, @@ -279,9 +276,11 @@ pub struct TestRunResults { pub check: Option, } -impl Default for TestRunResults { - fn default() -> Self { +impl TestRunResults { + pub fn new(key: TestKey, rules: TestRules) -> Self { Self { + key, + rules, ran_to: TestRunMode::Skip, source: None, build: None, diff --git a/tests/procgen_in/MetersU32.procgen.kdl b/tests/procgen_in/MetersU32.procgen.kdl new file mode 100644 index 0000000..f4c4429 --- /dev/null +++ b/tests/procgen_in/MetersU32.procgen.kdl @@ -0,0 +1,12 @@ +pun "MetersU32" { + lang "rust" { + @ "#[repr(transparent)]" + struct "MetersU32" { + a "u32" + } + } + + lang "c" "cpp" { + alias "MetersU32" "u32" + } +} From 8cf80a998d682efb80511965ac7394dacd432509 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 11:56:57 -0400 Subject: [PATCH 33/44] chore: move kdl-script in-tree --- .github/workflows/cafe.yml | 29 + .github/workflows/rust.yml | 143 ++- .gitignore | 4 +- Cargo.lock | 21 +- Cargo.toml | 5 +- kdl-script/Cargo.lock | 789 +++++++++++++++ kdl-script/Cargo.toml | 43 + kdl-script/README.md | 507 ++++++++++ kdl-script/RELEASES.md | 40 + kdl-script/examples/circular.kdl | 25 + kdl-script/examples/puns.kdl | 17 + kdl-script/examples/simple.kdl | 33 + kdl-script/examples/types.kdl | 61 ++ kdl-script/oranda.json | 19 + kdl-script/src/eval.rs | 154 +++ kdl-script/src/lib.rs | 140 +++ kdl-script/src/main.rs | 66 ++ kdl-script/src/parse.rs | 1431 ++++++++++++++++++++++++++++ kdl-script/src/spanned.rs | 195 ++++ kdl-script/src/tests/mod.rs | 3 + kdl-script/src/tests/parse_fail.rs | 1129 ++++++++++++++++++++++ kdl-script/src/tests/type_fail.rs | 25 + kdl-script/src/tests/type_pass.rs | 281 ++++++ kdl-script/src/types.rs | 1060 +++++++++++++++++++++ 24 files changed, 6204 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/cafe.yml create mode 100644 kdl-script/Cargo.lock create mode 100644 kdl-script/Cargo.toml create mode 100644 kdl-script/README.md create mode 100644 kdl-script/RELEASES.md create mode 100644 kdl-script/examples/circular.kdl create mode 100644 kdl-script/examples/puns.kdl create mode 100644 kdl-script/examples/simple.kdl create mode 100644 kdl-script/examples/types.kdl create mode 100644 kdl-script/oranda.json create mode 100644 kdl-script/src/eval.rs create mode 100644 kdl-script/src/lib.rs create mode 100644 kdl-script/src/main.rs create mode 100644 kdl-script/src/parse.rs create mode 100644 kdl-script/src/spanned.rs create mode 100644 kdl-script/src/tests/mod.rs create mode 100644 kdl-script/src/tests/parse_fail.rs create mode 100644 kdl-script/src/tests/type_fail.rs create mode 100644 kdl-script/src/tests/type_pass.rs create mode 100644 kdl-script/src/types.rs diff --git a/.github/workflows/cafe.yml b/.github/workflows/cafe.yml new file mode 100644 index 0000000..4a142ca --- /dev/null +++ b/.github/workflows/cafe.yml @@ -0,0 +1,29 @@ +name: run abi-cafe + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + rust: [nightly, stable] + steps: + - uses: actions/checkout@v2 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo run diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4e8a1c7..bd5b3eb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,29 +1,148 @@ -name: Rust +# The "Normal" CI for tests and linters and whatnot +name: Rust CI +# Ci should be run on... on: - push: - branches: [ main ] + # Every pull request (will need approval for new contributors) pull_request: - branches: [ main ] + # Every push to... + push: + branches: + # The main branch + - main + # Not a thing I use personally but some people like having a release branch + - "release/**" + # And once a week? + # This can catch things like "rust updated and actually regressed something" + schedule: + - cron: "11 7 * * 1,4" +# We want all these checks to fail if they spit out warnings env: - CARGO_TERM_COLOR: always + RUSTFLAGS: -Dwarnings jobs: - build: + # Check that rustfmt is a no-op + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt + override: true + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + # Check that clippy is appeased + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: clippy + override: true + - uses: actions-rs/clippy-check@v1 + env: + PWD: ${{ env.GITHUB_WORKSPACE }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --workspace --tests --examples + + # Make sure the docs build without warnings + docs: + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -Dwarnings + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rust-docs + override: true + - uses: swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: doc + args: --workspace --no-deps + +# cargo-fuzz support, if needed/desired +# +# build-fuzz: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: nightly +# profile: minimal +# override: true +# - uses: actions-rs/cargo@v1 +# env: +# PWD: ${{ env.GITHUB_WORKSPACE }} +# with: +# command: install +# args: cargo-fuzz +# - uses: actions-rs/cargo@v1 +# env: +# PWD: ${{ env.GITHUB_WORKSPACE }} +# with: +# command: fuzz +# args: build --fuzz-dir fuzz + # Build and run tests/doctests/examples on all platforms + # FIXME: look into `cargo-hack` which lets you more aggressively + # probe all your features and rust versions (see tracing's ci) + test: runs-on: ${{ matrix.os }} strategy: + # Test the cross-product of these platforms+toolchains matrix: os: [ubuntu-latest, windows-latest, macOS-latest] rust: [nightly, stable] steps: - - uses: actions/checkout@v2 - with: + # Setup tools + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: toolchain: ${{ matrix.rust }} profile: minimal override: true - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo run + - uses: swatinem/rust-cache@v1 + # Run the tests/doctests (default features) + - uses: actions-rs/cargo@v1 + env: + PWD: ${{ env.GITHUB_WORKSPACE }} + with: + command: test + args: --workspace + # Run the tests/doctests (all features) + - uses: actions-rs/cargo@v1 + env: + PWD: ${{ env.GITHUB_WORKSPACE }} + with: + command: test + args: --workspace --all-features + # Test the examples (default features) + - uses: actions-rs/cargo@v1 + env: + PWD: ${{ env.GITHUB_WORKSPACE }} + with: + command: test + args: --workspace --examples --bins + # Test the examples (all features) + - uses: actions-rs/cargo@v1 + env: + PWD: ${{ env.GITHUB_WORKSPACE }} + with: + command: test + args: --workspace --all-features --examples --bins \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3c52e30..f82c1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target -/generated_impls \ No newline at end of file +/generated_impls +/public/ +/kdl-script/public/ diff --git a/Cargo.lock b/Cargo.lock index 26a5566..8e562a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,6 +354,18 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "insta" +version = "1.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", +] + [[package]] name = "is-terminal" version = "0.4.12" @@ -397,10 +409,9 @@ dependencies = [ [[package]] name = "kdl-script" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4011d2a2b034ad725d379cd9c4892db44f4283890fd1d8b1051df0ca879890f" dependencies = [ "clap", + "insta", "kdl", "linked-hash-map", "miette", @@ -857,6 +868,12 @@ dependencies = [ "libc", ] +[[package]] +name = "similar" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" + [[package]] name = "smallvec" version = "1.13.2" diff --git a/Cargo.toml b/Cargo.toml index 5fce522..c048afb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +members = ["kdl-script"] + [package] name = "abi-cafe" description = "Pair your compilers up at The ABI café!" @@ -17,7 +20,7 @@ cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } clap = { version = "4.5.4", features = ["cargo", "wrap_help"] } console = "0.15.8" kdl = "4.6.0" -kdl-script = "0.3.0" +kdl-script = { version = "0.3.0", path = "kdl-script" } libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } miette = { version = "5.3.0", features = ["fancy"] } diff --git a/kdl-script/Cargo.lock b/kdl-script/Cargo.lock new file mode 100644 index 0000000..18501c9 --- /dev/null +++ b/kdl-script/Cargo.lock @@ -0,0 +1,789 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + +[[package]] +name = "cc" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "insta" +version = "1.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", +] + +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "kdl" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062c875482ccb676fd40c804a40e3824d4464c18c364547456d1c8e8e951ae47" +dependencies = [ + "miette", + "nom", + "thiserror", +] + +[[package]] +name = "kdl-script" +version = "0.3.0" +dependencies = [ + "clap", + "insta", + "kdl", + "linked-hash-map", + "miette", + "nom", + "petgraph", + "serde", + "serde_json", + "thiserror", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "backtrace", + "backtrace-ext", + "is-terminal", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "similar" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "supports-unicode" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "syn" +version = "2.0.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/kdl-script/Cargo.toml b/kdl-script/Cargo.toml new file mode 100644 index 0000000..e5cb447 --- /dev/null +++ b/kdl-script/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "kdl-script" +version = "0.3.0" +edition = "2021" +license = "MIT OR Apache-2.0" +description = "execute kdl documents!" +repository = "https://github.com/Gankra/kdl-script" +exclude = [ + "book/*", + "src/snapshots/*", + "src/tests/", + "tests/", + "examples/", +] + +[[bin]] +name = "kdl-script" +required-features = ["cli"] + +[features] +default = ["cli"] +# CLI interface for the binary +cli = ["eval", "clap", "tracing-subscriber", "miette/fancy", "serde_json"] +# The code for evaluating a compiled program (not needed for abi-cafe) +eval = [] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4.1.8", features = ["derive"], optional = true } +kdl = "4.5.0" +linked-hash-map = "0.5.6" +miette = { version = "5.10.0" } +nom = "7.1.3" +petgraph = "0.6.4" +serde = { version = "1.0.154", features = ["derive"] } +serde_json = { version = "1.0.108", optional = true } +thiserror = "1.0.39" +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.16", optional = true } + +[dev-dependencies] +insta = "1.34.0" diff --git a/kdl-script/README.md b/kdl-script/README.md new file mode 100644 index 0000000..f5b4444 --- /dev/null +++ b/kdl-script/README.md @@ -0,0 +1,507 @@ +# kdl-script + +[![crates.io](https://img.shields.io/crates/v/kdl-script.svg)](https://crates.io/crates/kdl-script) [![docs](https://docs.rs/kdl-script/badge.svg)](https://docs.rs/kdl-script) ![Rust CI](https://github.com/Gankra/kdl-script/workflows/Rust%20CI/badge.svg?branch=main) + + +A Compiler for KDLScript, the [KDL][]-based programming language! + +KDLScript is a "fake" scripting language that actually just exists to declare +type/function definitions in a language-agnostic way to avoid getting muddled +in the details of each language when trying to talk about All Languages In Reality. +It exists to be used by [abi-cafe][]. + +Ultimately the syntax and concepts are heavily borrowed from Rust, for a few reasons: + +* The author is very comfortable with Rust +* This (and [abi-cafe][]) were originally created to find bugs in rustc +* Rust is genuinely just a solid language for expressing ABIs! (Better than C/C++) + +The ultimate goal of this is to test that languages can properly communicate over +FFI by declaring the types/interface once and generating the Rust/C/C++/... versions +of the program (both caller and callee) and then linking them into various combinations +like "Rust Calls C++" to check that the values are passed correctly. + +Since C is the lingua-franca of FFI, it's assumed that when lowering definitions +to the target language that they should be the "C Compatible" equivalent. For instance, +"u32" is intended to be your language's equivalent of "uint32_t". + +In Rust this means all type definitions are implicitly `#[repr(C)]` (ideally should be +opt-outable). Most details about the function are left abstract so that [abi-cafe][] +can choose how to fill those in. + +"C Compatible" gets fuzzier for some things like tagged unions. +Just uh... don't worry about it (see "Concepts" below for details). + + + + +# Usage + +kdl-script is both a library and a CLI application. + +The main entry point to the library is [`Compiler::compile_path`][] or [`Compiler::compile_string`][], +which will produce a [`TypedProgram`][]. See the [`types`][] module docs for how to use that. + +The CLI application can be invoked as `kdl-script path/to/program.kdl` to run a KDLScript program. + +TODO: Write some examples! (See the `examples` dir for some.) + + + +# Concepts + +A KdlScript program is a single file that has types, functions, and attributes (`@`) on those functions. + + +## Types + +The following kinds of types exist in KDLScript. + +### Nominal Types + +A KDLScript user is allowed to declare the following kinds of nominal types + +* `struct` - a plain ol' struct +* `enum` - a c-style enum +* `union` - an untagged union +* `tagged` - a tagged union (rust-style enum) +* `alias` - a transparent type alias +* `pun` - a pun across the FFI boundary, "CSS for ifdefs" + +`struct`, `enum`, `union`, and `alias` are hopefully pretty self-explanatory and uncontroversial as they have immediate C/C++ equivalents, so we'll speed through them quickly. `tagged` and `pun` merit deeper discussion. + + + + + +#### Struct Types + +Just what you expect! + +```kdl +struct "Point" { + x "f32" + y "f32" +} +``` + +Field names may be marked "positional" by giving them the name `_`. If all fields are positional then languages like Rust should emit a "tuple struct". So this: + +```kdl +struct "Point" { + _ "f64" + _ "f64" +} +``` + +would be emitted as this Rust: + +```rust +#[repr(C)] +struct Point(f64, f64); +``` + +Otherwise positional names will get autonamed something like `field0`, `field1`, etc. + + + + + +#### Enum Types + +Just what you expect! + +```kdl +enum "IOError" { + FileNotFound 2 + FileClosed + FightMe 4 +} +``` + +The optional integer values specify what value that variant should "have" in its underlying integer repr. Otherwise variants start at 0(?) and auto-increment. + +Just like struct fields, enum variants can have "positional" naming with `_` which will get autonaming like `Case0`, `Case1`, etc. + +TODO: is it ok to have multiple variants with the same value? Whose responsibility is it to bounds check them to the underlying type, especially in the default case where it's "probably" a fuzzy `c_int`? + +TODO: add an attribute for specifying the underlying integer type. (`@tag`?) + + + +#### Union Types + +Just what you expect! + +```kdl +union "FloatOrInt" { + Float "f32" + Int "u32" +} +``` + +Just like struct fields, union variants can have "positional" naming with `_` which will get autonaming like `Case0`, `Case1`, etc. + +TODO: should we allow inline struct decls like C/C++ does, or require the user to define the structs separately? + + + + +#### Alias Types + +Just what you expect! + +```kdl +alias "MetersU32" "u32" +``` + +Note that the ordering matches Rust `type Alias = RealType;` syntax and not C/C++'s backwards-ass typedef syntax. + +See Pun Types for additional notes on how aliases interact with typeids! + + + +#### Tagged Types + +Tagged is the equivalent of Rust's `enum`, a tagged union where variants have fields, which has no "obvious" C/C++ analog. +Variant bodies may either be missing (indicating no payload) or have the syntax of a `struct` body. + +```kdl +tagged "MyOptionU32" { + None + Some { _ "u32"; } + FileNotFound { + path "[u8; 100]" + error_code "i64" + } +} +``` + +However, [Rust RFC 2195 - "Really Tagged Unions"](https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md) specifies the C/C++ equivalent layout/ABI for these types when `repr(C)` and/or `repr(u8)` is applied to one. [cbindgen](https://github.com/eqrion/cbindgen) implements this conversion. By default the `repr(C)` layout is to be used (how to select others is TBD). + +A quick TL;DR of the RFC: + +The `repr(C)` layout is the *most* obvious lowering to a `struct` containing a c-style `enum` and a `union`. The `enum` says which case of the union is currently valid. + +The `repr(u8)` layout (also `repr(u32)`, etc.) is similar but the `enum` specifically has that integer type, and instead of being stored in a wrapper struct it's stored as the first field of every variant of the `union`. This is a more compact layout because space doesn't need to be wasted for padding between the `enum` and the `union`. Also it's more reliable because C refuses to specify what the backing integer of a normal enum *is* so rustc just guesses based on the platform. + +TODO: should payload-less variants allow for integer values like `enum` variants do? + +TODO: figure out how exactly to specify you really want `repr(rust)` or `repr(u8)` or `repr(C, u8)` layouts. + +TODO: if we ever add support for Swift or whatever there will need to be A Reckoning because it has its own ABI/layouts for enums that are way more complex and guaranteed for more complicated cases! For now, we punt! + + + +#### Pun Types + +A pun is the equivalent of an ifdef'd type, allowing us to declare that two wildly different declarations in different languages should in fact have the same layout and/or ABI. A pun type contains "selector blocks" which are sequentially matched on much like CSS. The first one to match wins. When lowering to a specific backend/config if no selector matches, then compilation fails. + +Here is an example that claims that a Rust `repr(transparent)` newtype of a `u32` should match the ABI of a `uint32_t` in C/C++: + +```kdl +pun "MetersU32" { + lang "rust" { + @ "#[repr(transparent)]" + struct "MetersU32" { + a "u32" + } + } + + lang "c" "cpp" { + alias "MetersU32" "u32" + } +} +``` + +Because of this design, the typechecker does not "desugar" `pun` types to their underlying type when computing type ids. This means `[MetersU32; 4]` will not be considered the same type as `[u32; 4]`... because it's not! This is fine because type equality is just an optimization for our transpiler usecase. Typeids mostly exist to deal with type name resolution. + +Pun resolving is done as a second step when lowering the abstract `TypedProgram` to a more backend-concrete `DefinitionGraph`. + +(`alias` also isn't desugarred and has the same "problem" but this is less "fundamental" and more "I want the backend to actually emit +a type alias and use the alias", just like the source KDLScript program says!) + + +The currently supported selector blocks are: + +* `lang "lang1" "lang2" ...` - matches *any* of the languages +* `default` - always matches + +Potentially Supported In The Future: + +* `compiler "compiler1" "compiler2" ...` +* `cpu` ... +* `os` ... +* `triple` ... +* `any { selector1; selector2; }` +* `all { selector1; selector2; }` +* `not { selector; }` + +TODO: should we allow pun blocks to have other types defined in the block that are "private" from the rest of the program but used in the final type? + +TODO: figure out how to talk about "language-native types" in much the same way the above example uses "language-native annotations". + + + +### Structural Types + +A KDLScript user is allowed to use the following kinds of structural types + +* `&T` - a transparent reference to T +* `[T; N]` - a fixed-length array of T (length N) +* `()` - the empty tuple (I just like adding this cuz it's cute!!!) + +TODO: figure out if we want to bake in Rust's `Option` type here, if only for `Option<&T>`. + +TODO: figure out if there's any point in non-empty tuples + + + +#### Reference Types + +The "value" of a reference type `&T` is its pointee for the purposes of [abi-cafe][]. In this regard it's similar to C++ references or Rust references, where most operations automagically talk about the pointee and not the pointer. Using a reference type lets you test that something can properly be passed-by-reference, as opposed to passed-by-value. + +Reference types may appear in other composite types, indicating that the caller is responsible for allocating variables for each one and then storing pointers to them in the composite type. + +When used in the outputs of a function, a reference type is sugar for an out-param that the caller is responsible for allocating +and the callee is responsible for initializing. Out-params should appear after all normal inputs but before varargs. + +TODO: think through if the caller has any need to initialize an out-param (Currently irrelevant as we only suppport POD) + +TODO: think through what it means to have an out-param of `[&u32; 4]`! (We should conservatively reject it for now.) + + + + +#### Array Types + +Array types like `[u32; 4]` have the layout/repr you would expect from languages like C and Rust, but there's a problem with passing them by-value: C is supremely fucking weird about passing arrays by value if they're not wrapped in a struct. + +This is actually sugar for pass-by-reference (and largely decays into `u32*`): + +```C +void blah(u32[4] array); +``` + +And this doesn't even compile: + +```C +u32[4] blah(); +``` + +To avoid trying to squish weird square pegs in round holes, passing an array by-value like this in KDLScript should indeed mean passing it by-value! C/C++ backends should *simply refuse to lower such a KDLScript program and produce an error*. Rust backends are free to lower it in the obvious way. If you want to test the C way, use this: + +```kdl +fn "blah" { + inputs { _ "&[u32; 4]"; } +} +``` + +**NOT THIS**: + +```kdl +fn "blah" { + inputs { _ "[u32; 4]"; } +} +``` + +TODO: does anything special need to be said about empty arrays? Or do backends just YOLO the obvious lowering? (yes?) + + + + +### Primitives + +There are various builtin primitives, such as: + +* integers (i8, u128, ...) +* floats (f16, f32, f64, f128, ...) +* `bool`- your old pal the boolean (TriBool support TBD) +* `ptr` - an opaque pointer (`void*`), used when you're interested in the value of the pointer and not its pointee (unlike `&T`) + +In the future there will probably be language-specific primitives like `c_long`. + +TODO: figure out if `ptr` should be nullable or not by default. Relevant to whether we want to have Option and if Rust code should lower it to `*mut ()`. + + + +## Functions + +Functions are where the Actually Useful *library* version of KDLScript and the Just A Meme *application* version of KDLScript diverge. This difference is configured by the `eval` feature. + +In library form KDLScript only has function *signature declarations*, and it's the responsibility of the [abi-cafe][] backend using KDLScript to figure out what the body should be. In binary form you can actually fill in the body with some hot garbage I hacked up. + +For now we'll only document declaration. + +Here is a fairly complicated/contrived example function: + +```kdl +fn "my_func" { + inputs { + x "u32" + y "[&MyType; 3]" + _ "&bool" + } + outputs { + _ "bool" + _ "&ErrorCode" + } +} +``` + +Functions can have arbitrarily many inputs and outputs with either named or "positional" names (which will get autonaming like `arg0`, `arg1` and `out0`, `out1`, etc.). + +As discussed in the section on "Reference Types", references in outputs are sugar for out-params, which should appear after the inputs and before outputs. So the above would lower to something like the following in Rust (values chosen arbitrarily here, and we wouldn't use asserts in practice, but instead record the values for comparison): + +```rust ,ignore +fn my_func( + x: u32, + y: [&MyType; 3], + arg2: &bool, + out1: &mut ErrorCode, +) -> bool { + // Check the inputs are what we expect... + assert_eq!(x, 5); + assert_eq!(y[0].val, 8); + assert_eq!(y[1].val, 9); + assert_eq!(y[2].val, 10); + assert_eq!(*arg2, true); + + // Return outputs + *out1 = ErrorCode::Bad; + return true; +} + + +fn my_func_caller() { + // Setup the inputs + let x = 5; + let y_0 = MyType { val: 8 }; + let y_1 = MyType { val: 9 }; + let y_2 = MyType { val: 10 }; + let y = [&y_0, &y_1, &y_1]; + let arg2 = false; + + // Setup outparams + let mut out1 = ErrorCode::default(); + + // Do the call + let out0 = my_func(x, y, &arg2, &mut out1); + + // Checkout outputs + assert_eq!(out0, true); + assert_eq!(*out1, ErrorCode::Bad); +} +``` + +> God writing that sucked ass, and it wasn't even the "proper" value checking! This is why I built all this complicated crap to automate it! + +TODO: what does it mean if you have multiple non-out-param outputs? Return a tuple? Error out on all known backends? + +TODO: contemplate if named args should be the equivalent of Swift named args, where the inner and outer name can vary, but the outer name is like, part of the function name itself (and/or ABI)? + +TODO: contemplate varargs support + +Strawman varargs syntax for saying there's varargs but that you want to test this particular set of values passed in them: + +```kdl +func "blah" { + inputs { + x "u32" + "..." { + _ "f32" + _ "f32" + } + } +} +``` + +SUB TODO: figure out if varargs should allow for specifying what the callee and caller think is happening as different + +SUB TODO: figure out if we should try to support that fucked up thing where Swift supports multiple named varargs lists + + + +## Attributes + +Attributes start with `@` and apply to the next item (function or type) that follows them. This is only kinda stubbed out and not really impl'd. + +TODO: add attributes: + +* `@ "whatever you want here"` - passthrough attrs to underlying language +* `@tag "u32"` - setting the backing type on an `enum`'s tag +* `@packed N?` - making a type packed +* `@align N` - making a type aligned + +TODO: should fields/args be able to have attributes? + +TODO: at what level should attributes be validated/processed? The parser? Type checker? Backends? + + + +# Demo + +The evaluator has not at all kept up with the type system, so it can only handle some really simply stuff. +You can run the `examples/simple.kdl`. All the other examples will just dump type information and decl order +as they don't define `main`. + +```text +> cargo run examples/simple.kdl + +{ + y: 22 + x: 11 +} +33 +``` + +Is executing the following kdl document: + + +```kdl +@derive "Display" +struct "Point" { + x "f64" + y "f64" +} + +fn "main" { + outputs { _ "f64"; } + + let "pt1" "Point" { + x 1.0 + y 2.0 + } + let "pt2" "Point" { + x 10.0 + y 20.0 + } + + let "sum" "add:" "pt1" "pt2" + print "sum" + + return "+:" "sum.x" "sum.y" +} + +fn "add" { + inputs { a "Point"; b "Point"; } + outputs { _ "Point"; } + + return "Point" { + x "+:" "a.x" "b.x" + y "+:" "a.y" "b.y" + } +} +``` + + +# Why Did You Make KDL Documents Executable??? + +To spite parsers. + +Ok more seriously because I needed something like this for [abi-cafe][] but it's a ton of work so I'm self-motivating by wrapping it in the guise of a scripting language because it's funny and I can make more incremental progress, as I have a lot to implement before it's usable in the thing it's built for. + + + +[abi-cafe]: https://github.com/Gankra/abi-cafe +[KDL]: https://kdl.dev/ \ No newline at end of file diff --git a/kdl-script/RELEASES.md b/kdl-script/RELEASES.md new file mode 100644 index 0000000..8ca9d51 --- /dev/null +++ b/kdl-script/RELEASES.md @@ -0,0 +1,40 @@ +# 0.3.0 + +This release changes Ident to support blank ("_") names in some places: + +* function arguments (inputs and outputs) +* struct field names +* union field names +* tagged variant field names + +If any of those has such a field, the compiler will rewrite them +to have autogenerated names like field0 or arg2 (exact format not guaranteed), +and the Ident will be marked with `was_blank: true` + +It also adds fields_were_all_blank to `StructTy` and `TaggedVariantTy` which +can be used to determine they should be generated as tuple-structs/tuple-variants. +This allows e.g. abi-cafe's Rust backend to generate these. + + +# 0.2.1 + +Minor release to update dependencies and docs. + + +# 0.2.0 + +Got a lot of the parser and type system implemented, can now do all the kinds of type +I want and do name resolution and compute the order of declarations and stuff. Lots +of random parts still stubbed out. + +Error handling still a big ??? as I punted on multiple error handling. + +Some spans for types are garbage. + +Hopefully usable for abi-cafe in 0.3.0! + + + +# 0.1.0 + +Initial Fucked Up Hack! \ No newline at end of file diff --git a/kdl-script/examples/circular.kdl b/kdl-script/examples/circular.kdl new file mode 100644 index 0000000..993decf --- /dev/null +++ b/kdl-script/examples/circular.kdl @@ -0,0 +1,25 @@ +tagged "OptionRefA" { + None + Some { _0 "&A"; } +} + +struct "B" { + val "OptionRefA" +} + +struct "A" { + val "B" +} + +struct "Point" { + x "f32" + y "f32" +} + +fn "pointy" { + inputs { pt "Point"; } +} + +fn "usesA" { + inputs { a "A"; } +} \ No newline at end of file diff --git a/kdl-script/examples/puns.kdl b/kdl-script/examples/puns.kdl new file mode 100644 index 0000000..f3f8f3d --- /dev/null +++ b/kdl-script/examples/puns.kdl @@ -0,0 +1,17 @@ +pun "MetersU32" { + lang "rust" { + @ "#[repr(transparent)]" + struct "MetersU32" { + a "u32" + } + } + + lang "c" "c++" { + alias "MetersU32" "u32" + } +} + +fn "test_pun" { + inputs { a "MetersU32"; } + outputs { a "MetersU32"; } +} diff --git a/kdl-script/examples/simple.kdl b/kdl-script/examples/simple.kdl new file mode 100644 index 0000000..09c3c8b --- /dev/null +++ b/kdl-script/examples/simple.kdl @@ -0,0 +1,33 @@ +@derive "Display" +struct "Point" { + x "f64" + y "f64" +} + +fn "main" { + outputs { a "f64"; } + + let "pt1" "Point" { + x 1.0 + y 2.0 + } + let "pt2" "Point" { + x 10.0 + y 20.0 + } + + let "sum" "add:" "pt1" "pt2" + print "sum" + + return "+:" "sum.x" "sum.y" +} + +fn "add" { + inputs { a "Point"; b "Point"; } + outputs { a "Point"; } + + return "Point" { + x "+:" "a.x" "b.x" + y "+:" "a.y" "b.y" + } +} diff --git a/kdl-script/examples/types.kdl b/kdl-script/examples/types.kdl new file mode 100644 index 0000000..e86286f --- /dev/null +++ b/kdl-script/examples/types.kdl @@ -0,0 +1,61 @@ +struct "Simple" { + a "i32" +} + +alias "Simple2" "Simple" + +struct "Complex" { + elems1 "[Simple;10]" + elems2 "[Simple;9]" + val "Simple" + reffed "&Simple" + array_ref "&[&Simple;2]" + opaque "ptr" + flag "bool" +} + +enum "ErrorCode" { + Ok 0 + FileNotFound 1 + Bad -3 +} + +tagged "OptionI32" { + None + Some { _0 "i32"; } +} + +tagged "MyResult" { + Ok { _0 "[&f128;3]"; } + Some { _0 "ErrorCode"; } +} + +union "Life" { + simple "Simple2" + complex "Complex" +} + +fn "func1" { + inputs { a "Complex"; b "Simple"; } + outputs { out "()"; } +} + +fn "func2" { + inputs { + a "[Complex;2]" + b "[Simple;10]" + c "()" + d "f128" + } + outputs { + out "Complex" + } +} + +fn "arraytime" { + inputs { + a "[i32;4]" + b "[[i32;4];5]" + c "[[[&Simple;1];2];3]" + } +} \ No newline at end of file diff --git a/kdl-script/oranda.json b/kdl-script/oranda.json new file mode 100644 index 0000000..470b7e6 --- /dev/null +++ b/kdl-script/oranda.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://github.com/axodotdev/oranda/releases/latest/download/oranda-config-schema.json", + "styles": { + "theme": "axolight" + }, + "build": { + "path_prefix": "kdl-script" + }, + "components": { + "source": "axodotdev", + "artifacts": { + "package_managers": { + "preferred": { + "cargo": "cargo install kdl-script" + } + } + } + } +} \ No newline at end of file diff --git a/kdl-script/src/eval.rs b/kdl-script/src/eval.rs new file mode 100644 index 0000000..3f7c18b --- /dev/null +++ b/kdl-script/src/eval.rs @@ -0,0 +1,154 @@ +use std::{collections::HashMap, sync::Arc}; + +use miette::NamedSource; + +use crate::{ + parse::{Expr, FuncDecl, Literal, ParsedProgram, Stmt}, + spanned::Spanned, + Result, +}; + +#[derive(Debug, Clone)] +enum Val { + Struct(HashMap), + Int(i64), + Float(f64), + Bool(bool), +} + +pub fn eval_kdl_script(_src: &Arc, program: &ParsedProgram) -> Result { + let main = lookup_func(program, "main"); + + let val = eval_call(program, main, HashMap::default()); + + match val { + Val::Int(val) => Ok(val), + Val::Float(val) => Ok(val as i64), + Val::Bool(val) => Ok(val as i64), + Val::Struct(_) => { + unreachable!("main returned struct!") + } + } +} + +fn eval_call(program: &ParsedProgram, func: &FuncDecl, mut vars: HashMap) -> Val { + for stmt in &func.body { + match stmt { + Stmt::Let(stmt) => { + let temp = eval_expr(program, &stmt.expr, &vars); + if let Some(var) = &stmt.var { + vars.insert(var.to_string(), temp); + } + } + Stmt::Return(stmt) => { + let temp = eval_expr(program, &stmt.expr, &vars); + return temp; + } + Stmt::Print(stmt) => { + let temp = eval_expr(program, &stmt.expr, &vars); + print_val(&temp); + } + } + } + unreachable!("function didn't return!"); +} + +fn eval_expr(program: &ParsedProgram, expr: &Spanned, vars: &HashMap) -> Val { + match &**expr { + Expr::Call(expr) => { + let func = lookup_func(program, &expr.func); + assert_eq!( + func.inputs.len(), + expr.args.len(), + "function {} had wrong number of args", + &**expr.func + ); + let input = func + .inputs + .iter() + .zip(expr.args.iter()) + .map(|(var, expr)| { + let val = eval_expr(program, expr, vars); + let var = var.name.as_ref().unwrap().to_string(); + (var, val) + }) + .collect(); + + match func.name.as_str() { + "+" => eval_add(input), + _ => eval_call(program, func, input), + } + } + Expr::Path(expr) => { + let mut sub_val = vars + .get(&**expr.var) + .unwrap_or_else(|| panic!("couldn't find var {}", &**expr.var)); + for field in &expr.path { + if let Val::Struct(val) = sub_val { + sub_val = val + .get(field.as_str()) + .unwrap_or_else(|| panic!("couldn't find field {}", &**field)); + } else { + panic!("tried to get .{} on primitive", &**field); + } + } + sub_val.clone() + } + Expr::Ctor(expr) => { + let fields = expr + .vals + .iter() + .map(|stmt| { + let val = eval_expr(program, &stmt.expr, vars); + let var = stmt.var.as_ref().unwrap().to_string(); + (var, val) + }) + .collect(); + Val::Struct(fields) + } + Expr::Literal(expr) => match expr.val { + Literal::Float(val) => Val::Float(val), + Literal::Int(val) => Val::Int(val), + Literal::Bool(val) => Val::Bool(val), + }, + } +} + +fn print_val(val: &Val) { + match val { + Val::Struct(vals) => { + println!("{{"); + for (k, v) in vals { + print!(" {k}: "); + print_val(v); + } + println!("}}"); + } + Val::Int(val) => println!("{val}"), + Val::Float(val) => println!("{val}"), + Val::Bool(val) => println!("{val}"), + } +} + +fn eval_add(input: HashMap) -> Val { + let lhs = input.get("lhs").unwrap(); + let rhs = input.get("rhs").unwrap(); + match (lhs, rhs) { + (Val::Int(lhs), Val::Int(rhs)) => Val::Int(lhs + rhs), + (Val::Float(lhs), Val::Float(rhs)) => Val::Float(lhs + rhs), + _ => { + panic!("unsupported addition pair"); + } + } +} + +fn lookup_func<'a>(program: &'a ParsedProgram, func_name: &str) -> &'a FuncDecl { + let func = program + .funcs + .iter() + .find(|(name, _f)| name.as_str() == func_name); + if func.is_none() { + panic!("couldn't find {func_name} function"); + } + func.unwrap().1 +} diff --git a/kdl-script/src/lib.rs b/kdl-script/src/lib.rs new file mode 100644 index 0000000..89a61f0 --- /dev/null +++ b/kdl-script/src/lib.rs @@ -0,0 +1,140 @@ +#![doc = include_str!("../README.md")] + +use std::{fs::File, io::Read, path::Path, sync::Arc}; + +use kdl::KdlDocument; +use miette::{Diagnostic, NamedSource}; +use thiserror::Error; + +pub use parse::{KdlScriptParseError, ParsedProgram, PunEnv}; +pub use types::{Definition, DefinitionGraph, KdlScriptTypeError, TypedProgram}; + +#[cfg(feature = "eval")] +pub mod eval; +pub mod parse; +pub mod spanned; +#[cfg(test)] +mod tests; +pub mod types; + +#[derive(Debug, Error, Diagnostic)] +pub enum KdlScriptError { + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error(transparent)] + #[diagnostic(transparent)] + Kdl(#[from] kdl::KdlError), + + #[error(transparent)] + #[diagnostic(transparent)] + Parse(#[from] KdlScriptParseError), + + #[error(transparent)] + #[diagnostic(transparent)] + Type(#[from] KdlScriptTypeError), +} + +pub struct ErrorHandler { + pub error_style: ErrorStyle, + pub error_mode: ErrorMode, +} + +pub enum ErrorMode { + Gather(Vec), + Scream, +} + +pub enum ErrorStyle { + Human, + Json, +} + +pub struct Compiler { + // error_handler: ErrorHandler, + pub source: Option>, + pub parsed: Option>, + pub typed: Option>, +} + +pub type Result = std::result::Result; + +impl Compiler { + pub fn new() -> Self { + Self { + /* + error_handler: ErrorHandler { + error_mode: ErrorMode::Scream, + error_style: ErrorStyle::Human, + }, + */ + source: None, + parsed: None, + typed: None, + } + } + + pub fn compile_path( + &mut self, + src_path: impl AsRef, + ) -> std::result::Result, KdlScriptError> { + let src_path = src_path.as_ref(); + let input_name = src_path.display().to_string(); + let mut input_file = File::open(src_path)?; + let mut input_string = String::new(); + input_file.read_to_string(&mut input_string)?; + + self.compile_string(&input_name, input_string) + } + + pub fn compile_string( + &mut self, + input_name: &str, + input_string: String, + ) -> std::result::Result, KdlScriptError> { + let input_string = Arc::new(input_string); + + let src = Arc::new(miette::NamedSource::new(input_name, input_string.clone())); + self.source = Some(src.clone()); + + let kdl_doc: KdlDocument = input_string.parse::()?; + let parsed = Arc::new(parse::parse_kdl_script(self, src, &kdl_doc)?); + self.parsed = Some(parsed.clone()); + let typed = Arc::new(types::typeck(self, &parsed)?); + self.typed = Some(typed.clone()); + + Ok(typed) + } + + pub fn eval(&mut self) -> std::result::Result, KdlScriptError> { + if let (Some(src), Some(parsed)) = (&self.source, &self.parsed) { + if parsed.funcs.contains_key("main") { + let val = eval::eval_kdl_script(src, parsed)?; + return Ok(Some(val)); + } + } + Ok(None) + } + + /* + fn diagnose(&mut self, err: KdlScriptError) { + use ErrorMode::*; + use ErrorStyle::*; + match &mut self.error_handler { + ErrorHandler { + error_mode: Scream, + error_style: Human, + } => { + eprintln!("{:?}", miette::Report::new(err)); + } + _ => todo!(), + } + } + */ +} + +impl Default for Compiler { + fn default() -> Self { + Self::new() + } +} diff --git a/kdl-script/src/main.rs b/kdl-script/src/main.rs new file mode 100644 index 0000000..66b53ea --- /dev/null +++ b/kdl-script/src/main.rs @@ -0,0 +1,66 @@ +use std::path::PathBuf; + +use clap::Parser; +use kdl_script::Compiler; + +#[derive(Parser, Debug)] +pub struct Cli { + pub src: PathBuf, +} + +fn main() -> std::result::Result<(), miette::Report> { + real_main()?; + Ok(()) +} + +fn real_main() -> std::result::Result<(), miette::Report> { + let cli = Cli::parse(); + + tracing_subscriber::fmt() + .with_max_level(tracing::level_filters::LevelFilter::WARN) + .init(); + + let mut compiler = Compiler::new(); + let typed = compiler.compile_path(&cli.src)?; + + // Try to eval, otherwise dump the type info / decls + let result = compiler.eval()?; + if let Some(result) = result { + println!("{}", result); + } else { + println!("typed program:"); + println!("{:?}", typed); + + println!(); + println!("decls:"); + let env = kdl_script::PunEnv { + lang: "rust".to_string(), + }; + let graph = typed.definition_graph(&env)?; + for def in graph.definitions(typed.all_funcs()) { + match def { + kdl_script::Definition::DeclareTy(ty_idx) => { + println!("forward-decl type: {}", typed.format_ty(ty_idx)); + } + kdl_script::Definition::DefineTy(ty_idx) => { + println!("define type: {}", typed.format_ty(ty_idx)); + } + kdl_script::Definition::DeclareFunc(func_idx) => { + println!("forward-decl func: {}", typed.realize_func(func_idx).name); + } + kdl_script::Definition::DefineFunc(func_idx) => { + println!("define func: {}", typed.realize_func(func_idx).name); + } + } + } + } + Ok(()) +} + +/* +fn backend_to_the_future(program: &Arc) { + +} + +fn emit_types_for_funcs +*/ diff --git a/kdl-script/src/parse.rs b/kdl-script/src/parse.rs new file mode 100644 index 0000000..2d60eac --- /dev/null +++ b/kdl-script/src/parse.rs @@ -0,0 +1,1431 @@ +//! Parsing and AST types. +//! +//! The entrypoint is to invoke [`parse_kdl_script`][] which is implicitly +//! handled by [`Compiler::compile_path`][] or [`Compiler::compile_string`][] +//! and will produce a [`ParsedProgram`][]. +//! +//! Things like name resolution are handled by the [type checker](`crate::types`). + +use std::sync::Arc; + +use kdl::{KdlDocument, KdlEntry, KdlNode}; +use miette::{Diagnostic, NamedSource, SourceSpan}; +use nom::branch::alt; +use nom::bytes::complete::tag; +use nom::character::complete::{alpha1, alphanumeric1}; +use nom::combinator::{all_consuming, cut, opt, recognize}; +use nom::error::{context, VerboseError}; +use nom::multi::{many0, many0_count, separated_list1}; +use nom::sequence::{delimited, pair, preceded, separated_pair}; +use nom::{Finish, IResult}; +use thiserror::Error; +use tracing::trace; + +use crate::spanned::Spanned; +use crate::{Compiler, Result}; + +pub type StableMap = linked_hash_map::LinkedHashMap; + +/// A string that may refer to another item like a type of function +#[derive(Debug, Clone)] +pub struct Ident { + /// true if the ident was actually "_" and we made up a name. + /// + /// Languages which have anonymous/positional fields may choose + /// to emit this field as such, instead of using `val`. + pub was_blank: bool, + /// the string to use for the ident + pub val: Spanned, +} + +impl std::cmp::PartialEq for Ident { + fn eq(&self, other: &Self) -> bool { + self.val == other.val + } +} +impl std::cmp::PartialEq for Ident { + fn eq(&self, other: &String) -> bool { + self.val.as_str() == other + } +} +impl std::cmp::PartialEq for Ident { + fn eq(&self, other: &str) -> bool { + self.val.as_str() == other + } +} +impl std::cmp::Eq for Ident {} +impl std::cmp::PartialOrd for Ident { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} +impl std::cmp::Ord for Ident { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.val.cmp(&other.val) + } +} +impl std::hash::Hash for Ident { + fn hash(&self, state: &mut H) { + self.val.hash(state); + } +} +impl std::borrow::Borrow for Ident { + fn borrow(&self) -> &str { + &self.val + } +} + +impl std::ops::Deref for Ident { + type Target = Spanned; + fn deref(&self) -> &Self::Target { + &self.val + } +} +impl From for Ident { + fn from(val: String) -> Self { + Self::new(Spanned::from(val)) + } +} + +impl Ident { + fn new(val: Spanned) -> Self { + Self { + val, + was_blank: false, + } + } + fn with_span(val: String, span: SourceSpan) -> Self { + Self { + val: Spanned::new(val, span), + was_blank: false, + } + } +} + +impl std::fmt::Display for Ident { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.val.fmt(f) + } +} + +/// An error that occured during parsing +#[derive(Debug, Error, Diagnostic)] +#[error("{message}")] +pub struct KdlScriptParseError { + pub message: String, + #[source_code] + pub src: Arc, + #[label] + pub span: SourceSpan, + #[help] + pub help: Option, +} + +/// A Parsed KDLScript program +#[derive(Debug, Clone)] +pub struct ParsedProgram { + /// The type definitions + pub tys: StableMap, + /// The function definitions + pub funcs: StableMap, + /// Where in funcs builtins like `+` start (if at all). + pub builtin_funcs_start: usize, +} + +/// A Type declaration +#[derive(Debug, Clone)] +pub enum TyDecl { + /// A Struct + Struct(StructDecl), + /// An untagged union + Union(UnionDecl), + /// A c-style enum + Enum(EnumDecl), + /// A tagged union (rust-style enum) + Tagged(TaggedDecl), + /// A transparent type alias + Alias(AliasDecl), + /// A type pun + Pun(PunDecl), +} + +/// A type "name" (which may be structural like `[u32; 4]`). +/// +/// It's like an ident but, for types -- a tydent! +#[derive(Debug, Clone)] +pub enum Tydent { + /// A named type (the type checker will resolve this) + Name(Ident), + /// A fixed length array + Array(Box>, u64), + /// A by-reference type + Ref(Box>), + /// The empty tuple -- `()` + Empty, +} + +/// An attribute that can be hung off a function or type. +/// +/// Currently stubbed out, not really used. Potential uses: +/// +/// * setting the backing type on an Enum's tag +/// * packed(N) +/// * align(N) +/// * passthrough attrs to underlying language +/// +/// Probably this should be broken up so that you can't "pack" +/// a function or other such nonsense... +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Attr { + /// rust-style derive (unused, just for testing) + Derive(AttrDerive), + /// The type should be packed + Packed(AttrPacked), + /// Pass this attribute through to the target language + Passthrough(AttrPassthrough), +} + +/// An attribute declaring this type should be packed (remove padding/align). +/// +/// TODO: add support for an integer argument for the max align of a +/// field? Without one the default is 1. I never see packed(2) or whatever +/// so I've never seriously thought through the implications... +/// +/// @packed (N?) +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AttrPacked {} + +/// An attribute declaring a rust-style derive (unused, just for testing). +/// +/// @derive "Trait1" "Trait2" ... +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AttrDerive(Vec>); + +/// An attribute to passthrough to the target language. +/// +/// @ "whatever you want buddy" +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AttrPassthrough(Spanned); + +/// A struct decl. +/// +/// Field names may be positional by naming them underscore (`_`). +/// For languages like Rust, if all fields are declared like this +/// it should be lowered to a tuple-struct. Otherwise positional +/// fields will be autonamed something like field0, field1, ... +#[derive(Debug, Clone)] +pub struct StructDecl { + /// Name of the struct + pub name: Ident, + /// Fields + pub fields: Vec, + /// Attributes + pub attrs: Vec, +} + +/// An untagged union decl. +/// +/// Variant names may be positional by naming them underscore (`_`). +/// Positional variants will be autonamed something like Case0, Case1, ... +#[derive(Debug, Clone)] +pub struct UnionDecl { + /// Name of the union + pub name: Ident, + /// Fields (variants) + pub fields: Vec, + pub attrs: Vec, +} + +/// A c-like enum decl. +/// +/// Variant names may be positional by naming them underscore (`_`). +/// Positional variants will be autonamed something like Case0, Case1, ... +#[derive(Debug, Clone)] +pub struct EnumDecl { + pub name: Ident, + pub variants: Vec, + pub attrs: Vec, +} + +/// A variant of an [`EnumDecl`]. +#[derive(Debug, Clone)] +pub struct EnumVariant { + pub name: Ident, + /// Optional value this case is required to have + /// in its underlying integer representation. + pub val: Option, +} + +/// A tagged union (rust-like enum). +/// +/// Variant names may be positional by naming them underscore (`_`). +/// Positional variants will be autonamed something like Case0, Case1, ... +#[derive(Debug, Clone)] +pub struct TaggedDecl { + pub name: Ident, + pub variants: Vec, + pub attrs: Vec, +} + +/// A variant of a [`TaggedDecl`][]. +#[derive(Debug, Clone)] +pub struct TaggedVariant { + pub name: Ident, + pub fields: Option>, +} + +/// A type pun between different languages. +#[derive(Debug, Clone)] +pub struct PunDecl { + pub name: Ident, + pub blocks: Vec, + pub attrs: Vec, +} + +/// A block for a [`PunDecl`][]. +#[derive(Debug, Clone)] +pub struct PunBlock { + pub selector: PunSelector, + pub decl: TyDecl, +} + +/// A selector for a [`PunBlock`][] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum PunSelector { + /// Selector applies if any of the following apply. + Any(Vec), + /// Selector applies if all of the following apply. + All(Vec), + /// Selector applies if the [`PunEnv::lang`] is the following. + Lang(Spanned), + /// Selector always applies (default fallback). + Default, +} + +/// The environment required to resolve a [`PunSelector`][]. +#[derive(Debug, Clone)] +pub struct PunEnv { + /// The target language + /// + /// TODO: make this an enum? + pub lang: String, + // compiler: String, + // os: String, + // cpu: String, +} + +impl PunSelector { + /// Check if this [`PunSelector`][] matches the given [`PunEnv`][]. + pub fn matches(&self, env: &PunEnv) -> bool { + use PunSelector::*; + match self { + Any(args) => args.iter().any(|s| s.matches(env)), + All(args) => args.iter().all(|s| s.matches(env)), + Lang(lang) => env.lang == **lang, + Default => true, + } + } +} + +/// A transparent type alias. +#[derive(Debug, Clone)] +pub struct AliasDecl { + pub name: Ident, + pub alias: Spanned, + pub attrs: Vec, +} + +/// A (name, type) pair that occurs in many places like field/arg decls. +#[derive(Debug, Clone)] +pub struct TypedVar { + pub name: Option, + pub ty: Spanned, +} + +/// A function declaration +#[derive(Debug, Clone)] +pub struct FuncDecl { + pub name: Ident, + pub inputs: Vec, + pub outputs: Vec, + pub attrs: Vec, + #[cfg(feature = "eval")] + pub body: Vec, +} + +/// The parser, used to hold onto some global state for things like diagnostic. +struct Parser<'a> { + // comp: &'a mut Compiler, + src: Arc, + ast: &'a KdlDocument, +} + +/// Parse a KdlScript program! +pub fn parse_kdl_script( + _comp: &mut Compiler, + src: Arc, + ast: &KdlDocument, +) -> Result { + let mut parser = Parser { src, ast }; + parser.parse() +} + +impl Parser<'_> { + /// Parse a KdlScript program! + fn parse(&mut self) -> Result { + trace!("parsing"); + + let mut program = self.parse_module(self.ast)?; + #[cfg(feature = "eval")] + program.add_builtin_funcs()?; + + Ok(program) + } + + /// Parse a "module" which is either the entire program or the contents of a [`PunBlock`][]. + fn parse_module(&mut self, doc: &KdlDocument) -> Result { + let mut funcs = StableMap::new(); + let mut tys = StableMap::new(); + + let mut cur_attrs = vec![]; + for node in doc.nodes() { + let name = node.name().value(); + + // If it's an attribute, gather it up to be given to a "real" item + if name.starts_with('@') { + cur_attrs.push(self.attr(node)?); + continue; + } + + // Ok it's a real item, grab all the attributes, they belong to it + let attrs = std::mem::take(&mut cur_attrs); + + // Now parse the various kinds of top-level items + match name { + "fn" => { + let func = self.func_decl(node, attrs)?; + funcs.insert(func.name.clone(), func); + } + "struct" => { + let ty = self.struct_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Struct(ty)); + assert!(old.is_none(), "duplicate type def"); + } + "union" => { + let ty = self.union_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Union(ty)); + assert!(old.is_none(), "duplicate type def"); + } + "enum" => { + let ty = self.enum_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Enum(ty)); + assert!(old.is_none(), "duplicate type def"); + } + "tagged" => { + let ty = self.tagged_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Tagged(ty)); + assert!(old.is_none(), "duplicate type def"); + } + "alias" => { + let ty = self.alias_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Alias(ty)); + assert!(old.is_none(), "duplicate type def"); + } + "pun" => { + let ty = self.pun_decl(node, attrs)?; + let old = tys.insert(ty.name.clone(), TyDecl::Pun(ty)); + assert!(old.is_none(), "duplicate type def"); + } + x => { + return Err(KdlScriptParseError { + message: format!("I don't know what a '{x}' is"), + src: self.src.clone(), + span: *node.name().span(), + help: None, + })?; + } + } + } + + // Anything added after this point is a builtin! + let builtin_funcs_start = funcs.len(); + Ok(ParsedProgram { + tys, + funcs, + builtin_funcs_start, + }) + } + + /// Parse a `struct` node. + fn struct_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + trace!("struct decl"); + let name = self.one_string(node, "type name")?; + let name = self.ident(name)?; + let fields = self.typed_var_children(node)?; + + Ok(StructDecl { + name, + fields, + attrs, + }) + } + + /// Parse a `union` node. + fn union_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + trace!("union decl"); + let name = self.one_string(node, "type name")?; + let name = self.ident(name)?; + let fields = self.typed_var_children(node)?; + + Ok(UnionDecl { + name, + fields, + attrs, + }) + } + + /// Parse an `enum` node. + fn enum_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + trace!("enum decl"); + let name = self.one_string(node, "type name")?; + let name = self.ident(name)?; + let variants = self.enum_variant_children(node)?; + + Ok(EnumDecl { + name, + variants, + attrs, + }) + } + + /// Parse a `tagged` node. + fn tagged_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + trace!("enum decl"); + let name = self.one_string(node, "type name")?; + let name = self.ident(name)?; + let variants = self.tagged_variant_children(node)?; + + Ok(TaggedDecl { + name, + variants, + attrs, + }) + } + + /// Parse a `pun` node. + fn pun_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + let name = self.one_string(node, "type name")?; + let name = self.ident(name)?; + + // Parse the pun blocks + let mut blocks = vec![]; + for item in node.children().into_iter().flat_map(|d| d.nodes()) { + let item_name = item.name().value(); + match item_name { + "lang" => { + let langs = self.string_list(item.entries())?; + if langs.is_empty() { + let node_ident = item.name().span(); + let after_ident = node_ident.offset() + node_ident.len(); + return Err(KdlScriptParseError { + message: "Hey I need a lang name (string) here!".to_string(), + src: self.src.clone(), + span: (after_ident..after_ident).into(), + help: None, + })?; + } + let final_ty = self.pun_block(item, &name)?; + blocks.push(PunBlock { + selector: PunSelector::Any( + langs.into_iter().map(PunSelector::Lang).collect(), + ), + decl: final_ty, + }); + } + "default" => { + self.no_args(item)?; + let final_ty = self.pun_block(item, &name)?; + blocks.push(PunBlock { + selector: PunSelector::Default, + decl: final_ty, + }); + } + x => { + return Err(KdlScriptParseError { + message: format!("I don't know what a '{x}' is here"), + src: self.src.clone(), + span: *item.name().span(), + help: None, + })?; + } + } + } + + Ok(PunDecl { + name, + blocks, + attrs, + }) + } + + /// Parse a pun block, expecting only a single type with the pun's name. + /// + /// In the future we may allow [`PunBlock`][]s to declare other "private" types + /// that are only in scope for the block but required to define the final type. + /// For now we punt on this to avoid thinking through the name resolution implications + /// for things like name shadowing. + fn pun_block(&mut self, block: &KdlNode, final_ty_name: &Ident) -> Result { + if let Some(doc) = block.children() { + // Recursively parse this block as an entire KdlScript program + let defs = self.parse_module(doc)?; + + // Don't want any functions + if let Some((_name, func)) = defs.funcs.iter().next() { + return Err(KdlScriptParseError { + message: "puns can't contain function decls".to_string(), + src: self.src.clone(), + span: Spanned::span(&func.name), + help: None, + })?; + } + + let mut final_ty = None; + + // Only want one type declared (might loosen this later) + for (ty_name, ty) in defs.tys { + if &ty_name == final_ty_name { + // this is the type + final_ty = Some(ty); + } else { + return Err(KdlScriptParseError { + message: "pun declared a type other than what it should have".to_string(), + src: self.src.clone(), + span: Spanned::span(&ty_name), + help: None, + })?; + } + } + + // Check that we defined the type + if let Some(ty) = final_ty { + Ok(ty) + } else { + Err(KdlScriptParseError { + message: "pun block failed to define the type it puns!".to_string(), + src: self.src.clone(), + span: *block.span(), + help: None, + })? + } + } else { + Err(KdlScriptParseError { + message: "pun blocks need bodies".to_string(), + src: self.src.clone(), + span: *block.span(), + help: None, + })? + } + } + + /// Parse an `alias` node. + fn alias_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + let name = self.string_at(node, "type name", 0)?; + let name = self.ident(name)?; + let alias_str = self.string_at(node, "type name", 1)?; + let alias = self.tydent(&alias_str)?; + + Ok(AliasDecl { name, alias, attrs }) + } + + /// Parse a `fn` node. + fn func_decl(&mut self, node: &KdlNode, attrs: Vec) -> Result { + trace!("fn"); + let name = self.one_string(node, "function name")?; + let name = self.ident(name)?; + let mut inputs = vec![]; + let mut outputs = vec![]; + #[cfg(feature = "eval")] + let mut body = vec![]; + + let mut reached_body = false; + let mut input_span = None; + let mut output_span = None; + for stmt in node.children().into_iter().flat_map(|d| d.nodes()) { + match stmt.name().value() { + "inputs" => { + trace!("fn input"); + if reached_body { + return Err(KdlScriptParseError { + message: "input declaration must come before the body".to_string(), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + if let Some(_old_input) = input_span { + return Err(KdlScriptParseError { + message: "duplicate input block".to_string(), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + if let Some(_old_output) = output_span { + return Err(KdlScriptParseError { + message: "It's confusing to declare inputs after outputs".to_string(), + src: self.src.clone(), + span: *stmt.name().span(), + help: Some("Move this before the output block".to_string()), + })?; + } + self.no_args(stmt)?; + inputs = self.typed_var_children(stmt)?; + input_span = Some(*stmt.name().span()); + continue; + } + "outputs" => { + trace!("fn output"); + if reached_body { + return Err(KdlScriptParseError { + message: "output declaration must come before the body".to_string(), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + if let Some(_old_output) = output_span { + return Err(KdlScriptParseError { + message: "duplicate output block".to_string(), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + self.no_args(stmt)?; + outputs = self.typed_var_children(stmt)?; + output_span = Some(*stmt.name().span()); + continue; + } + x => { + #[cfg(feature = "eval")] + match x { + "let" => { + trace!("let stmt"); + let name = self.string_at(stmt, "variable name", 0)?; + let name = self.ident(name)?; + let name = if &*name == "_" { None } else { Some(name) }; + let expr = self.expr_rhs(stmt, 1)?; + body.push(Stmt::Let(LetStmt { var: name, expr })); + } + "return" => { + trace!("return stmt"); + let expr = self.expr_rhs(stmt, 0)?; + body.push(Stmt::Return(ReturnStmt { expr })); + } + "print" => { + trace!("print stmt"); + let expr = self.expr_rhs(stmt, 0)?; + body.push(Stmt::Print(PrintStmt { expr })); + } + x => { + return Err(KdlScriptParseError { + message: format!("I don't know what a '{x}' statement is"), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + } + #[cfg(not(feature = "eval"))] + return Err(KdlScriptParseError { + message: format!("I don't know what a '{x}' statement is"), + src: self.src.clone(), + span: *stmt.name().span(), + help: None, + })?; + } + } + + reached_body = true; + } + + Ok(FuncDecl { + name, + inputs, + outputs, + #[cfg(feature = "eval")] + body, + attrs, + }) + } + + /// Parse an `@attribute` node. + fn attr(&mut self, attr: &KdlNode) -> Result { + let entries = attr.entries(); + let attr = match attr.name().value() { + "@packed" => { + trace!("packed attr"); + self.no_children(attr)?; + Attr::Packed(AttrPacked {}) + } + "@derive" => { + trace!("derive attr"); + let traits = self.string_list(entries)?; + self.no_children(attr)?; + Attr::Derive(AttrDerive(traits)) + } + "@" => { + trace!("passthrough attr"); + let val = self.one_string(attr, "attribute to pass through to target language")?; + Attr::Passthrough(AttrPassthrough(val)) + } + x => { + return Err(KdlScriptParseError { + message: format!("I don't know what a '{x}' attribute is"), + src: self.src.clone(), + span: *attr.name().span(), + help: None, + })?; + } + }; + Ok(attr) + } + + /// This node's entries should only be a positional list of strings. + fn string_list(&mut self, entries: &[KdlEntry]) -> Result>> { + entries + .iter() + .map(|e| -> Result> { + if e.name().is_some() { + return Err(KdlScriptParseError { + message: "Named values don't belong here, only strings".to_string(), + src: self.src.clone(), + span: *e.span(), + help: Some("try removing the name".to_owned()), + })?; + } + match e.value() { + kdl::KdlValue::RawString(s) | kdl::KdlValue::String(s) => { + Ok(Spanned::new(s.clone(), *e.span())) + } + _ => Err(KdlScriptParseError { + message: "This should be a string".to_string(), + src: self.src.clone(), + span: *e.span(), + help: Some("try adding quotes?".to_owned()), + })?, + } + }) + .collect() + } + + /// This node's entries should be only one string. + fn one_string(&mut self, node: &KdlNode, desc: &str) -> Result> { + let res = self.string_at(node, desc, 0)?; + let entries = node.entries(); + if let Some(e) = entries.get(1) { + return Err(KdlScriptParseError { + message: format!("You have something extra after your {desc}"), + src: self.src.clone(), + span: *e.span(), + help: Some("remove this?".to_owned()), + })?; + } + Ok(res) + } + + /// This node should have a string at this entry offset. + fn string_at(&mut self, node: &KdlNode, desc: &str, offset: usize) -> Result> { + let entries = node.entries(); + if let Some(e) = entries.get(offset) { + if e.name().is_some() { + return Err(KdlScriptParseError { + message: "Named values don't belong here, only strings".to_string(), + src: self.src.clone(), + span: *e.span(), + help: Some("try removing the name".to_owned()), + })?; + } + + match e.value() { + kdl::KdlValue::RawString(s) | kdl::KdlValue::String(s) => { + Ok(Spanned::new(s.clone(), *e.span())) + } + _ => Err(KdlScriptParseError { + message: format!("This should be a {desc} (string)"), + src: self.src.clone(), + span: *e.span(), + help: Some("try adding quotes".to_owned()), + })?, + } + } else { + let node_ident = node.name().span(); + let after_ident = node_ident.offset() + node_ident.len(); + Err(KdlScriptParseError { + message: format!("Hey I need a {desc} (string) here!"), + src: self.src.clone(), + span: (after_ident..after_ident).into(), + help: None, + })? + } + } + + /// This node should have no entries. + fn no_args(&mut self, node: &KdlNode) -> Result<()> { + if let Some(entry) = node.entries().first() { + return Err(KdlScriptParseError { + message: "This shouldn't have arguments".to_string(), + src: self.src.clone(), + span: *entry.span(), + help: Some("delete them?".to_string()), + })?; + } + Ok(()) + } + + /// This node should have no children. + fn no_children(&mut self, node: &KdlNode) -> Result<()> { + if let Some(children) = node.children() { + return Err(KdlScriptParseError { + message: "These children should never have been born".to_string(), + src: self.src.clone(), + span: *children.span(), + help: Some("delete this block?".to_string()), + })?; + } + Ok(()) + } + + /// This node's children should be TypedVars + fn typed_var_children(&mut self, node: &KdlNode) -> Result> { + node.children() + .into_iter() + .flat_map(|d| d.nodes()) + .map(|var| { + let name = self.var_name_decl(var)?; + let ty_str = self.one_string(var, "type")?; + let ty = self.tydent(&ty_str)?; + self.no_children(var)?; + Ok(TypedVar { name, ty }) + }) + .collect() + } + + /// This node's children should be enum variants + fn enum_variant_children(&mut self, node: &KdlNode) -> Result> { + node.children() + .into_iter() + .flat_map(|d| d.nodes()) + .map(|var| { + let name = var.name(); + let name = Spanned::new(name.value().to_owned(), *name.span()); + let name = self.ident(name)?; + let entries = var.entries(); + let val = if let Some(e) = entries.first() { + Some(self.int_expr(e)?) + } else { + None + }; + if let Some(e) = entries.get(1) { + return Err(KdlScriptParseError { + message: "You have something extra after your enum case".to_string(), + src: self.src.clone(), + span: *e.span(), + help: Some("remove this?".to_owned()), + })?; + } + // TODO: deny any other members of `entries` + self.no_children(var)?; + Ok(EnumVariant { name, val }) + }) + .collect() + } + + /// This node's children should be tagged variants + fn tagged_variant_children(&mut self, node: &KdlNode) -> Result> { + node.children() + .into_iter() + .flat_map(|d| d.nodes()) + .map(|var| { + self.no_args(var)?; + let name = var.name(); + let name = Spanned::new(name.value().to_owned(), *name.span()); + let name = self.ident(name)?; + let fields = if var.children().is_some() { + Some(self.typed_var_children(var)?) + } else { + None + }; + Ok(TaggedVariant { name, fields }) + }) + .collect() + } + + /// Parse this node's name as a possibly-positional variable name + /// + /// TODO: probably want this `Option` to be its own special enum? + fn var_name_decl(&mut self, var: &KdlNode) -> Result> { + let name = var.name(); + let name = if name.value() == "_" { + None + } else { + let name = self.ident(Spanned::new(name.value().to_owned(), *name.span()))?; + Some(name) + }; + Ok(name) + } + + /// Parse a [`Tydent`][] from this String. + fn tydent(&mut self, input: &Spanned) -> Result> { + let (_, ty_ref) = all_consuming(context("a type", tydent))(input) + .finish() + .map_err(|_e| KdlScriptParseError { + message: String::from("couldn't parse type"), + src: self.src.clone(), + span: Spanned::span(input), + help: None, + })?; + Ok(ty_ref) + } + + /// Parse an [`Ident`][] from this String. + fn ident(&mut self, input: Spanned) -> Result { + let (_, _) = + all_consuming(context("a type", tydent))(&input).map_err(|_e| KdlScriptParseError { + message: String::from("invalid identifier"), + src: self.src.clone(), + span: Spanned::span(&input), + help: None, + })?; + Ok(Ident { + val: input, + was_blank: false, + }) + } + + /// Parse an [`IntExpr`][] (literal) from this entry. + fn int_expr(&mut self, entry: &KdlEntry) -> Result { + if entry.name().is_some() { + return Err(KdlScriptParseError { + message: "Named values don't belong here, only literals".to_string(), + src: self.src.clone(), + span: *entry.span(), + help: Some("try removing the name".to_owned()), + })?; + } + let val = match entry.value() { + kdl::KdlValue::Base2(int) + | kdl::KdlValue::Base8(int) + | kdl::KdlValue::Base10(int) + | kdl::KdlValue::Base16(int) => *int, + _ => { + return Err(KdlScriptParseError { + message: String::from("must be an integer"), + src: self.src.clone(), + span: *entry.span(), + help: None, + })?; + } + }; + Ok(IntExpr { + span: *entry.span(), + val, + }) + } +} + +// A fuckton of nom parsing for sub-syntax like Tydents. + +type NomResult = IResult>; + +/// Matches the syntax for tydent ("identifier, but for types") incl structural types like arrays/references. +fn tydent(input: &str) -> NomResult<&str, Spanned> { + alt((tydent_ref, tydent_array, tydent_empty_tuple, tydent_named))(input) +} + +/// Matches a reference type (&T) +fn tydent_ref(input: &str) -> NomResult<&str, Spanned> { + let (input, pointee_ty) = preceded( + tag("&"), + context("pointee type", cut(preceded(many0(unicode_space), tydent))), + )(input)?; + // TODO: properly setup this span! + Ok((input, Spanned::from(Tydent::Ref(Box::new(pointee_ty))))) +} + +/// Matches an array type ([T; N]) +fn tydent_array(input: &str) -> NomResult<&str, Spanned> { + let (input, (elem_ty, array_len)) = delimited( + tag("["), + cut(separated_pair( + context( + "an element type", + delimited(many0(unicode_space), tydent, many0(unicode_space)), + ), + tag(";"), + context( + "an array length (integer)", + delimited(many0(unicode_space), array_len, many0(unicode_space)), + ), + )), + tag("]"), + )(input)?; + + // TODO: properly setup these spans! + Ok(( + input, + Spanned::from(Tydent::Array(Box::new(elem_ty), array_len)), + )) +} + +/// Matches an array length (u64) +fn array_len(input: &str) -> NomResult<&str, u64> { + nom::character::complete::u64(input) +} + +/// Matches the empty tuple +fn tydent_empty_tuple(input: &str) -> NomResult<&str, Spanned> { + let (input, _tup) = tag("()")(input)?; + // TODO: properly setup this span! + Ok((input, Spanned::from(Tydent::Empty))) +} + +/// Matches a named type +fn tydent_named(input: &str) -> NomResult<&str, Spanned> { + let (input, (ty_name, generics)) = pair( + ident, + opt(delimited( + pair(unicode_space, tag("<")), + cut(separated_list1( + tag(","), + delimited(unicode_space, tydent_ref, unicode_space), + )), + tag(">"), + )), + )(input)?; + + if let Some(_generics) = generics { + panic!("generics aren't yet implemented!"); + } + // TODO: properly setup this span! + Ok(( + input, + Spanned::from(Tydent::Name(Ident { + val: Spanned::from(ty_name.to_owned()), + was_blank: false, + })), + )) +} + +/// Matches an identifier +fn ident(input: &str) -> NomResult<&str, &str> { + recognize(pair( + alt((alpha1, tag("_"))), + many0_count(alt((alphanumeric1, tag("_")))), + ))(input) +} + +/// Matches various kinds of whitespace we allow +fn unicode_space(input: &str) -> NomResult<&str, &str> { + alt(( + tag(" "), + tag("\t"), + tag("\u{FEFF}"), // BOM + tag("\u{00A0}"), + tag("\u{1680}"), + tag("\u{2000}"), + tag("\u{2001}"), + tag("\u{2002}"), + tag("\u{2003}"), + tag("\u{2004}"), + tag("\u{2005}"), + tag("\u{2006}"), + tag("\u{2007}"), + tag("\u{2008}"), + tag("\u{2009}"), + tag("\u{200A}"), + tag("\u{202F}"), + tag("\u{205F}"), + tag("\u{3000}"), + ))(input) +} + +/// An integer expression (literal) +/// +/// TODO: this should actually defer deserializing into an integer +/// so that it can be some huge type like `u256`. Not sure who/where +/// would be responsible for validating that the value fits in the +/// expected range for where it's placed! +/// +/// Possibly the type checker, but it also kinda needs to be deferred +/// to the target language backends as a language may not be able to +/// handle a `u256` or whatever. +#[derive(Debug, Clone)] +pub struct IntExpr { + pub span: SourceSpan, + pub val: i64, +} + +/// All of this gunk is only used for function bodies, which only +/// exist in the meme `feature=eval` mode. +#[cfg(feature = "eval")] +pub use runnable::*; +#[cfg(feature = "eval")] +mod runnable { + use super::*; + + #[derive(Debug, Clone)] + pub enum Stmt { + Let(LetStmt), + Return(ReturnStmt), + Print(PrintStmt), + } + + #[derive(Debug, Clone)] + pub struct LetStmt { + pub var: Option, + pub expr: Spanned, + } + + #[derive(Debug, Clone)] + pub struct ReturnStmt { + pub expr: Spanned, + } + + #[derive(Debug, Clone)] + pub struct PrintStmt { + pub expr: Spanned, + } + + #[derive(Debug, Clone)] + pub enum Expr { + Call(CallExpr), + Path(PathExpr), + Ctor(CtorExpr), + Literal(LiteralExpr), + } + + #[derive(Debug, Clone)] + pub struct CallExpr { + pub func: Ident, + pub args: Vec>, + } + + #[derive(Debug, Clone)] + pub struct PathExpr { + pub var: Ident, + pub path: Vec, + } + + #[derive(Debug, Clone)] + pub struct CtorExpr { + pub ty: Ident, + pub vals: Vec>, + } + + #[derive(Debug, Clone)] + pub struct LiteralExpr { + pub span: SourceSpan, + pub val: Literal, + } + + #[derive(Debug, Clone)] + pub enum Literal { + Float(f64), + Int(i64), + Bool(bool), + } + + impl Parser<'_> { + pub(crate) fn func_args( + &mut self, + node: &KdlNode, + expr_start: usize, + ) -> Result>> { + node.entries()[expr_start..] + .iter() + .enumerate() + .map(|(idx, _e)| self.smol_expr(node, expr_start + idx)) + .collect() + } + + pub(crate) fn literal_expr(&mut self, entry: &KdlEntry) -> Result { + if entry.name().is_some() { + return Err(KdlScriptParseError { + message: "Named values don't belong here, only literals".to_string(), + src: self.src.clone(), + span: *entry.span(), + help: Some("try removing the name".to_owned()), + })?; + } + + let val = match entry.value() { + kdl::KdlValue::RawString(_) | kdl::KdlValue::String(_) => { + return Err(KdlScriptParseError { + message: "strings aren't supported literals".to_string(), + src: self.src.clone(), + span: *entry.span(), + help: None, + })?; + } + kdl::KdlValue::Null => { + return Err(KdlScriptParseError { + message: "nulls aren't supported literals".to_string(), + src: self.src.clone(), + span: *entry.span(), + help: None, + })?; + } + kdl::KdlValue::Base2(int) + | kdl::KdlValue::Base8(int) + | kdl::KdlValue::Base10(int) + | kdl::KdlValue::Base16(int) => Literal::Int(*int), + kdl::KdlValue::Base10Float(val) => Literal::Float(*val), + kdl::KdlValue::Bool(val) => Literal::Bool(*val), + }; + + Ok(LiteralExpr { + span: *entry.span(), + val, + }) + } + + pub(crate) fn expr_rhs( + &mut self, + node: &KdlNode, + expr_start: usize, + ) -> Result> { + trace!("expr rhs"); + let expr = if let Ok(string) = self.string_at(node, "", expr_start) { + if let Some((func, "")) = string.rsplit_once(':') { + trace!(" call expr"); + let func = Ident::with_span(func.to_owned(), Spanned::span(&string)); + let args = self.func_args(node, expr_start + 1)?; + Expr::Call(CallExpr { func, args }) + } else if node.children().is_some() { + trace!(" ctor expr"); + let ty = Ident::new(string); + let vals = self.let_stmt_children(node)?; + Expr::Ctor(CtorExpr { ty, vals }) + } else { + trace!(" path expr"); + let mut parts = string.split('.'); + let var = + Ident::with_span(parts.next().unwrap().to_owned(), Spanned::span(&string)); + let path = parts + .map(|s| Ident::with_span(s.to_owned(), Spanned::span(&string))) + .collect(); + Expr::Path(PathExpr { var, path }) + } + } else if let Some(val) = node.entries().get(expr_start) { + trace!(" literal expr"); + Expr::Literal(self.literal_expr(val)?) + } else { + return Err(KdlScriptParseError { + message: "I thought there was supposed to be an expression after here?" + .to_string(), + src: self.src.clone(), + span: *node.span(), + help: None, + })?; + }; + + Ok(Spanned::new(expr, *node.span())) + } + + pub(crate) fn smol_expr( + &mut self, + node: &KdlNode, + expr_at: usize, + ) -> Result> { + trace!("smol expr"); + let expr = if let Ok(string) = self.string_at(node, "", expr_at) { + if let Some((_func, "")) = string.rsplit_once(':') { + return Err(KdlScriptParseError { + message: + "Nested function calls aren't supported because this is a shitpost" + .to_string(), + src: self.src.clone(), + span: *node.span(), + help: None, + })?; + } else if node.children().is_some() { + return Err(KdlScriptParseError { + message: "Ctors exprs can't be nested in function calls because this is a shitpost".to_string(), + src: self.src.clone(), + span: *node.span(), + help: None, + })?; + } else { + trace!(" path expr"); + let mut parts = string.split('.'); + let var = + Ident::with_span(parts.next().unwrap().to_owned(), Spanned::span(&string)); + let path = parts + .map(|s| Ident::with_span(s.to_owned(), Spanned::span(&string))) + .collect(); + Expr::Path(PathExpr { var, path }) + } + } else if let Some(val) = node.entries().get(expr_at) { + trace!(" literal expr"); + Expr::Literal(self.literal_expr(val)?) + } else { + return Err(KdlScriptParseError { + message: "I thought there was supposed to be an expression after here?" + .to_string(), + src: self.src.clone(), + span: *node.span(), + help: None, + })?; + }; + + Ok(Spanned::new(expr, *node.span())) + } + + pub(crate) fn let_stmt_children( + &mut self, + node: &KdlNode, + ) -> Result>> { + node.children() + .into_iter() + .flat_map(|d| d.nodes()) + .map(|var| { + let name = self.var_name_decl(var)?; + let expr = self.expr_rhs(var, 0)?; + Ok(Spanned::new(LetStmt { var: name, expr }, *var.span())) + }) + .collect() + } + } + + impl ParsedProgram { + pub(crate) fn add_builtin_funcs(&mut self) -> Result<()> { + // Add builtins jankily + self.funcs.insert( + Ident::from(String::from("+")), + FuncDecl { + name: Ident::from(String::from("+")), + inputs: vec![ + TypedVar { + name: Some(Ident::from(String::from("lhs"))), + ty: Spanned::from(Tydent::Name(Ident::from(String::from("i64")))), + }, + TypedVar { + name: Some(Ident::from(String::from("rhs"))), + ty: Spanned::from(Tydent::Name(Ident::from(String::from("i64")))), + }, + ], + outputs: vec![TypedVar { + name: Some(Ident::from(String::from("out"))), + ty: Spanned::from(Tydent::Name(Ident::from(String::from("i64")))), + }], + attrs: vec![], + + body: vec![], + }, + ); + + Ok(()) + } + } +} diff --git a/kdl-script/src/spanned.rs b/kdl-script/src/spanned.rs new file mode 100644 index 0000000..e60c96f --- /dev/null +++ b/kdl-script/src/spanned.rs @@ -0,0 +1,195 @@ +use std::{ + borrow::Borrow, + cmp::Ordering, + fmt::{self, Display}, + hash::{Hash, Hasher}, + ops::{Deref, DerefMut}, +}; + +use miette::SourceSpan; +use serde::{ser, Deserialize}; + +/// A spanned value, indicating the range at which it is defined in the source. +#[derive(Clone, Default, Deserialize)] +pub struct Spanned { + start: usize, + end: usize, + value: T, +} + +impl Spanned { + pub fn new(value: T, span: SourceSpan) -> Self { + Self { + value, + start: span.offset(), + end: span.offset() + span.len(), + } + } + /// Access the start of the span of the contained value. + pub fn start(this: &Self) -> usize { + this.start + } + + /// Access the end of the span of the contained value. + pub fn end(this: &Self) -> usize { + this.end + } + + /// Update the span + pub fn update_span(this: &mut Self, start: usize, end: usize) { + this.start = start; + this.end = end; + } + + /// Get the span of the contained value. + pub fn span(this: &Self) -> SourceSpan { + (Self::start(this)..Self::end(this)).into() + } + + /// Consumes the spanned value and returns the contained value. + pub fn into_inner(this: Self) -> T { + this.value + } +} + +impl IntoIterator for Spanned +where + T: IntoIterator, +{ + type IntoIter = T::IntoIter; + type Item = T::Item; + fn into_iter(self) -> Self::IntoIter { + self.value.into_iter() + } +} + +impl<'a, T> IntoIterator for &'a Spanned +where + &'a T: IntoIterator, +{ + type IntoIter = <&'a T as IntoIterator>::IntoIter; + type Item = <&'a T as IntoIterator>::Item; + fn into_iter(self) -> Self::IntoIter { + self.value.into_iter() + } +} + +impl<'a, T> IntoIterator for &'a mut Spanned +where + &'a mut T: IntoIterator, +{ + type IntoIter = <&'a mut T as IntoIterator>::IntoIter; + type Item = <&'a mut T as IntoIterator>::Item; + fn into_iter(self) -> Self::IntoIter { + self.value.into_iter() + } +} + +impl fmt::Debug for Spanned +where + T: fmt::Debug, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.value.fmt(f) + } +} + +impl Display for Spanned +where + T: Display, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.value.fmt(f) + } +} + +impl Deref for Spanned { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.value + } +} + +impl DerefMut for Spanned { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.value + } +} + +impl Borrow for Spanned { + fn borrow(&self) -> &str { + self + } +} + +impl AsRef for Spanned +where + T: AsRef, +{ + fn as_ref(&self) -> &U { + self.value.as_ref() + } +} + +impl PartialEq for Spanned { + fn eq(&self, other: &Self) -> bool { + self.value.eq(&other.value) + } +} + +impl> PartialEq for Spanned { + fn eq(&self, other: &T) -> bool { + self.value.eq(other) + } +} + +impl PartialEq for Spanned { + fn eq(&self, other: &str) -> bool { + self.value.eq(other) + } +} + +impl Eq for Spanned {} + +impl Hash for Spanned { + fn hash(&self, state: &mut H) { + self.value.hash(state); + } +} + +impl PartialOrd for Spanned { + fn partial_cmp(&self, other: &Self) -> Option { + self.value.partial_cmp(&other.value) + } +} + +impl> PartialOrd for Spanned { + fn partial_cmp(&self, other: &T) -> Option { + self.value.partial_cmp(other) + } +} + +impl Ord for Spanned { + fn cmp(&self, other: &Self) -> Ordering { + self.value.cmp(&other.value) + } +} + +impl From for Spanned { + fn from(value: T) -> Self { + Self { + start: 0, + end: 0, + value, + } + } +} + +impl ser::Serialize for Spanned { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + self.value.serialize(serializer) + } +} diff --git a/kdl-script/src/tests/mod.rs b/kdl-script/src/tests/mod.rs new file mode 100644 index 0000000..3cbe213 --- /dev/null +++ b/kdl-script/src/tests/mod.rs @@ -0,0 +1,3 @@ +mod parse_fail; +mod type_fail; +mod type_pass; diff --git a/kdl-script/src/tests/parse_fail.rs b/kdl-script/src/tests/parse_fail.rs new file mode 100644 index 0000000..83963d2 --- /dev/null +++ b/kdl-script/src/tests/parse_fail.rs @@ -0,0 +1,1129 @@ +#[test] +#[should_panic = "need a type name"] +fn struct_no_name() { + let program = r##" + struct { + + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type name"] +fn union_no_name() { + let program = r##" + union { + + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type name"] +fn enum_no_name() { + let program = r##" + enum { + + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type name"] +fn tagged_no_name() { + let program = r##" + tagged { + + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type name"] +fn pun_no_name() { + let program = r##" + pun { + default { } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type name"] +fn alias_no_name() { + let program = r##" + alias + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type"] +fn struct_int_as_type() { + let program = r##" + struct "bad" { + x 0 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type"] +fn struct_no_type() { + let program = r##" + struct "bad" { + x + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type"] +fn alias_int_as_alias() { + let program = r##" + alias "bad" 1 + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type"] +fn alias_no_alias() { + let program = r##" + alias "bad" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type"] +fn union_int_as_type() { + let program = r##" + union "bad" { + x 0 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type"] +fn union_no_type() { + let program = r##" + union "bad" { + x + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "children should never have been born"] +fn tagged_field_sub_block() { + let program = r##" + tagged "bad" { + x { + val "i32" { } + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type"] +fn tagged_int_as_type() { + let program = r##" + tagged "bad" { + x { + val 1 + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a type"] +fn tagged_no_type() { + let program = r##" + tagged "bad" { + x { + val + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn tagged_prop_field_after() { + let program = r##" + tagged "bad" { + x { + val "i32" x=1 + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn tagged_prop_field_before() { + let program = r##" + tagged "bad" { + x { + val x=1 "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "shouldn't have arguments"] +fn tagged_prop_case() { + let program = r##" + tagged "bad" { + x z=1 { + val "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn tagged_prop_name_before() { + let program = r##" + tagged z=1 "bad" { + x { + val "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn tagged_prop_name_after() { + let program = r##" + tagged "bad" z=1 { + x { + val "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "children should never have been born"] +fn struct_field_block() { + let program = r##" + struct "bad" { + val "i32" { } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn struct_prop_field_after() { + let program = r##" + struct "bad" { + val "i32" x=1 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn struct_prop_field_before() { + let program = r##" + struct "bad" { + val x=1 "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn struct_prop_name_before() { + let program = r##" + struct z=1 "bad" { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn struct_prop_name_after() { + let program = r##" + struct "bad" z=1 { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn struct_int_name_after() { + let program = r##" + struct "bad" 4 { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type name"] +fn struct_int_name_before() { + let program = r##" + struct 4 "bad" { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "children should never have been born"] +fn union_field_block() { + let program = r##" + union "bad" { + val "i32" { } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn union_prop_field_after() { + let program = r##" + union "bad" { + val "i32" x=1 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn union_prop_field_before() { + let program = r##" + union "bad" { + val x=1 "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn union_prop_name_before() { + let program = r##" + union z=1 "bad" { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn union_prop_name_after() { + let program = r##" + union "bad" z=1 { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn union_int_name_after() { + let program = r##" + union "bad" 4 { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type name"] +fn union_int_name_before() { + let program = r##" + union 4 "bad" { + val "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "children should never have been born"] +fn enum_field_block() { + let program = r##" + enum "bad" { + val { } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "children should never have been born"] +fn enum_field_val_block() { + let program = r##" + enum "bad" { + val 1 { } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn enum_prop_field_after() { + let program = r##" + enum "bad" { + val 1 x=1 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn enum_prop_field_before() { + let program = r##" + enum "bad" { + val x=1 2 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn enum_prop_name_before() { + let program = r##" + enum z=1 "bad" { + val + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn enum_prop_name_after() { + let program = r##" + enum "bad" z=1 { + val + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn enum_int_name_after() { + let program = r##" + enum "bad" 4 { + val + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type name"] +fn enum_int_name_before() { + let program = r##" + union 4 "bad" { + val + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "blocks need bodies"] +fn pun_lang_no_body() { + let program = r##" + pun "bad" { + lang "rust" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "need a lang name"] +fn pun_lang_no_lang() { + let program = r##" + pun "bad" { + lang { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "blocks need bodies"] +fn pun_default_no_body() { + let program = r##" + pun "bad" { + default + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "don't know what a 'x' is"] +fn pun_unknown_selector() { + let program = r##" + pun "bad" { + x + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "shouldn't have arguments"] +fn pun_default_lang() { + let program = r##" + pun "bad" { + default "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn pun_prop_lang_after() { + let program = r##" + pun "bad" { + lang "rust" x=1 { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn pub_prop_lang_before() { + let program = r##" + pun "bad" { + lang x=1 "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "Named values don't belong here"] +fn pun_prop_name_before() { + let program = r##" + pun x=1 "bad" { + lang "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn pun_prop_name_after() { + let program = r##" + pun "bad" x=1 { + lang "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn pun_int_name_after() { + let program = r##" + pun "bad" 1 { + lang "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "should be a type name"] +fn pun_int_name_before() { + let program = r##" + pun 2 "bad" { + lang "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "something extra"] +fn pun_two_names() { + let program = r##" + pun "bad" "verybad" { + lang "rust" { + alias "bad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn hanging_ref() { + let program = r##" + struct "bad" { + x "&" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn unclosed_array() { + let program = r##" + struct "bad" { + x "[i32; 0" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn undelimited_array() { + let program = r##" + struct "bad" { + x "[i32 0]" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn unopened_array() { + let program = r##" + struct "bad" { + x "i32; 0]" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn empty_tuple_space() { + let program = r##" + struct "bad" { + x "( )" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn tyname_space() { + let program = r##" + struct "bad" { + x "i 32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn generic() { + let program = r##" + struct "bad" { + x "Option" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn invalid_tyname_int() { + let program = r##" + struct "bad" { + x "12" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn invalid_tyname_at() { + let program = r##" + struct "bad" { + x "@i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn invalid_tyname_pound() { + let program = r##" + struct "bad" { + x "#i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn invalid_tyname_dash() { + let program = r##" + struct "bad" { + x "-i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "couldn't parse type"] +fn invalid_tyname_leading_int() { + let program = r##" + struct "bad" { + x "1i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn struct_invalid_name_ident() { + let program = r##" + struct "123" { + x "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn struct_invalid_field_ident() { + let program = r##" + struct "bad" { + #123 "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn union_invalid_name_ident() { + let program = r##" + union "123" { + x "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn union_invalid_field_ident() { + let program = r##" + union "bad" { + #123 "i32" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn enum_invalid_field_ident() { + let program = r##" + enum "bad" { + #123 + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn enum_invalid_name_ident() { + let program = r##" + struct "123" { + x + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn alias_invalid_field_ident() { + let program = r##" + alias "#123" "i32" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn pun_invalid_name_ident() { + let program = r##" + pun "#123" { + default { + alias "#123" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn tagged_invalid_name_ident() { + let program = r##" + tagged "#123" { + Some { + _0 "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn tagged_invalid_variant_ident() { + let program = r##" + tagged "bad" { + #123 { + _0 "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "invalid identifier"] +fn tagged_invalid_subfield_ident() { + let program = r##" + tagged "bad" { + Some { + #123 "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "declared a type other than what it should have"] +fn pun_unfulfilled() { + let program = r##" + pun "bad" { + default { + alias "reallybad" "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +/* +#[test] +#[should_panic] +fn bodyless_struct() { + let program = r##" + struct "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn bodyless_enum() { + let program = r##" + enum "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn bodyless_tagged() { + let program = r##" + tagged "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn bodyless_union() { + let program = r##" + union "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn bodyless_pun() { + let program = r##" + pun "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn caseless_pun() { + let program = r##" + pun "Empty" { } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + +#[test] +#[should_panic] +fn aliasless_alias() { + let program = r##" + alias "Empty" + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.unwrap(); +} + + */ diff --git a/kdl-script/src/tests/type_fail.rs b/kdl-script/src/tests/type_fail.rs new file mode 100644 index 0000000..e7e338b --- /dev/null +++ b/kdl-script/src/tests/type_fail.rs @@ -0,0 +1,25 @@ +#[test] +#[should_panic = "undefined type name"] +fn no_primitive() { + let program = r##" + struct "wrong" { + x "i1" + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} + +#[test] +#[should_panic = "undefined type name"] +fn no_arg_type() { + let program = r##" + fn "bad" { + inputs { x "bad"; } + } + "##; + let mut compiler = crate::Compiler::new(); + let res = compiler.compile_string("test.kdl", program.to_owned()); + res.map_err(miette::Report::new).unwrap(); +} diff --git a/kdl-script/src/tests/type_pass.rs b/kdl-script/src/tests/type_pass.rs new file mode 100644 index 0000000..fb79607 --- /dev/null +++ b/kdl-script/src/tests/type_pass.rs @@ -0,0 +1,281 @@ +#[test] +fn prim_struct() -> Result<(), miette::Report> { + let program = r##" + struct "Primitives" { + _0 "u8" + _1 "u16" + _2 "u32" + _3 "u64" + _4 "u128" + _5 "u256" + _6 "i8" + _7 "i16" + _8 "i32" + _9 "i64" + _10 "i128" + _11 "i256" + _12 "bool" + _13 "f16" + _14 "f32" + _15 "f64" + _16 "f128" + _17 "ptr" + _18 "()" + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn c_enum_simple() -> Result<(), miette::Report> { + let program = r##" + enum "Cases" { + A + B + C + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn c_enum_literals1() -> Result<(), miette::Report> { + let program = r##" + enum "Cases" { + A 8 + B + C + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn c_enum_literals2() -> Result<(), miette::Report> { + let program = r##" + enum "Cases" { + A 8 + B 10 + C 52 + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn c_enum_literals3() -> Result<(), miette::Report> { + // TODO: this one might be dubious? Check what C/C++ allow with puns here + let program = r##" + enum "Cases" { + A 8 + B 10 + C 10 + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn tagged_simple() -> Result<(), miette::Report> { + let program = r##" + tagged "MyOption" { + None + Some { + _0 "i32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn union_simple() -> Result<(), miette::Report> { + let program = r##" + union "IntFloat" { + A "i32" + B "f32" + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn alias_simple() -> Result<(), miette::Report> { + let program = r##" + alias "BigMeters" "u128" + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn pun_simple() -> Result<(), miette::Report> { + let program = r##" + pun "Blah" { + lang "rust" { + alias "Blah" "i32" + } + default { + alias "Blah" "u32" + } + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn empty_struct() -> Result<(), miette::Report> { + let program = r##" + struct "Empty" { } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn empty_enum() -> Result<(), miette::Report> { + let program = r##" + enum "Empty" { } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn empty_tagged() -> Result<(), miette::Report> { + let program = r##" + tagged "Empty" { } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn empty_union() -> Result<(), miette::Report> { + let program = r##" + union "Empty" { } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn array_basics() -> Result<(), miette::Report> { + let program = r##" + fn "arrays" { + inputs { + arr0 "[i32; 0]" + arr1 "[bool;1]" + arr2 "[ [ u128 ; 10 ] ; 100 ]" + } + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn ref_basics() -> Result<(), miette::Report> { + let program = r##" + fn "arrays" { + inputs { + ref0 "&bool" + ref1 "& i32" + ref2 "&()" + ref4 "&&&f64" + ref5 "[&u8; 100]" + ref6 "&[&[&&[&u32; 10]; 11]; 12]" + } + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn anon_vars() -> Result<(), miette::Report> { + let program = r##" + struct "MyTupleStruct" { + _ "bool" + _ "i32" + _ "u64" + } + tagged "MyTagged" { + TupleVariant { + _ "bool" + _ "i32" + _ "u64" + } + HybridVariant { + x "bool" + _ "u32" + } + StructVariant { + x "u8" + z "i64" + } + EmptyVariant { + } + NoneLike + } + fn "anons" { + inputs { + _ "u32" + _ "MyTupleStruct" + z "i8" + } + outputs { + _ "MyTagged" + _ "&i32" + w "&i64" + } + } + "##; + let mut compiler = crate::Compiler::new(); + compiler.compile_string("test.kdl", program.to_owned())?; + Ok(()) +} + +#[test] +fn example_types() -> Result<(), miette::Report> { + let mut compiler = crate::Compiler::new(); + compiler.compile_path("examples/types.kdl")?; + Ok(()) +} + +#[test] +fn example_simple() -> Result<(), miette::Report> { + let mut compiler = crate::Compiler::new(); + compiler.compile_path("examples/simple.kdl")?; + Ok(()) +} + +#[test] +fn example_puns() -> Result<(), miette::Report> { + let mut compiler = crate::Compiler::new(); + compiler.compile_path("examples/puns.kdl")?; + Ok(()) +} diff --git a/kdl-script/src/types.rs b/kdl-script/src/types.rs new file mode 100644 index 0000000..a63badd --- /dev/null +++ b/kdl-script/src/types.rs @@ -0,0 +1,1060 @@ +//! The type checker and types! +//! +//! The entry point is [`typeck`][] which is implicitly +//! handled by [`Compiler::compile_path`][] or [`Compiler::compile_string`][] +//! and will produce a [`TypedProgram`][]. +//! +//! You should then call [`TypedProgram::definition_graph`][] with your +//! target backend's [`PunEnv`][] to resolve all the [`PunTy`]s and get a +//! final [`DefinitionGraph`][]. +//! +//! You should then call [`DefinitionGraph::definitions`][] with the set +//! of functions you want to emit (usually [`TypedProgram::all_funcs`][]) +//! to get the final forward-decls and definitions your target should emit +//! to generate its program. +//! +//! If a test (function) fails, you can pass just that function to +//! [`DefinitionGraph::definitions`][] to get a minimized program for just +//! that one function. +//! +//! The type system is phased like this to allow work to be reused and shared +//! where possible. Each of the above "lowerings" represents increased levels +//! of specificity: +//! +//! * [`TypedProgram`][] is abstract over all possible backends and can be computed once. +//! * [`DefinitionGraph`][] is for a concrete backend but still abstract over what parts +//! of the program you might care about emitting. Computed once per backend config ([`PunEnv`]). +//! * [`DefinitionGraph::definitions`][] is the final concrete program we want to emit. +//! +//! In principle a backend emitting various configs for a single [`TypedProgram`][] can +//! share everything for a specific [`TyIdx`][] or [`FuncIdx`][], except they need to be +//! careful about [`PunTy`][]s which can have [`DefinitionGraph`][]-specific lowerings... +//! so really you should only recycle state created for a specific [`DefinitionGraph`]! +//! +//! FIXME: unlike [`AliasTy`][]s, [`PunTy`][]s really *should* completely evaporate in the +//! backend's lowering. Perhaps we should do something in [`TypedProgram`][] to actually +//! make them transparent? +//! +//! While performance isn't a huge concern for this project, combinatorics do get +//! kind of out of control so work sharing is kinda important, especially as the backends +//! get more complex! Also it's just nice to handle backend-agnostic issues once to keep +//! things simple and correct. + +use std::collections::HashMap; +use std::sync::Arc; + +use miette::{Diagnostic, NamedSource, SourceSpan}; +use petgraph::graph::DiGraph; +use petgraph::graph::NodeIndex; +use thiserror::Error; + +use crate::parse::*; +use crate::spanned::*; +use crate::Compiler; +use crate::Result; + +/// An error that occured while processing the types of a program. +#[derive(Debug, Error, Diagnostic)] +#[error("{message}")] +pub struct KdlScriptTypeError { + pub message: String, + #[source_code] + pub src: Arc, + #[label] + pub span: SourceSpan, + #[help] + pub help: Option, +} + +/// A program that has had its symbolic types resolved to actual type ids. +/// +/// Aliases and Puns are not fully resolved at this point. +/// +/// Aliases still exist so that you can emit the target language's form of +/// an alias if you want to most accurately express the input program. +/// +/// Puns still exist because a TypedProgram is abstract over every possible +/// output language to share the workload between each concrete backend. +/// The next step in lowering the program is to ask it to resolve +/// the puns for a specific [`crate::PunEnv`][] with [`TypedProgram::definition_graph`]. +/// Which will also handle computing the order of declarations for languages like C. +#[derive(Debug)] +pub struct TypedProgram { + tcx: TyCtx, + funcs: Vec, + builtin_funcs_start: usize, +} + +/// A type id +pub type TyIdx = usize; +/// A function id +pub type FuncIdx = usize; + +/// The actual structure of a type +/// +/// This may be either a nominal, structural, or primitive type. +/// +/// Any types that this type references will already have been normalized to a [`TyIdx`][] +/// so you don't have to worry about name resolution or interning/memoizing. Notably +/// all uses of `[u32; 5]` will have the same [`TyIdx`][], although `[MyU32Alias; 5]` will +/// be get a separate type id to allow a backend to more accurately reproduce the input program. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Ty { + /// A primitive (int, float, bool, ptr) + Primitive(PrimitiveTy), + /// A nominal struct + Struct(StructTy), + /// A nominal untagged union + Union(UnionTy), + /// A nominal C-style enum (see `Tagged` for a full rust-style enum) + Enum(EnumTy), + /// A nominal tagged union (rust-style enum, see `Enum` for a c-style enum) + Tagged(TaggedTy), + /// A transparent type alias (like typed) + Alias(AliasTy), + /// A type pun that can have different underlying types for different targets + Pun(PunTy), + /// A fixed-length array + Array(ArrayTy), + /// A reference to a type (behaves as if is the Pointee, but just passed by-ref) + Ref(RefTy), + /// Empty tuple -- `()` + Empty, +} + +/// A function +#[derive(Debug, Clone)] +pub struct Func { + /// The function's name + pub name: Ident, + /// The function's inputs + pub inputs: Vec, + /// The function's outputs (note that outparams will appear as Ty::Ref outputs!) + pub outputs: Vec, + /// Any attributes hanging off the function + pub attrs: Vec, + #[cfg(feature = "eval")] + /// The body of the function (TBD, not needed for abi-cafe) + pub body: (), +} + +/// A function argument (input or output). +#[derive(Debug, Clone)] +pub struct Arg { + /// The name of the argument + pub name: Ident, + /// The type of the arg + pub ty: TyIdx, +} + +/// A primitive +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum PrimitiveTy { + /// `i8` / `int8_t` + I8, + /// `i16` / `int16_t` + I16, + /// `i32` / `int32_t` + I32, + /// `i64` / `int64_t` + I64, + /// `i128` / `int128_t` + I128, + /// `i256` / `int256_t` + I256, + /// `u8` / `uint8_t` + U8, + /// `u16` / `uint16_t` + U16, + /// `u32` / `uint32_t` + U32, + /// `u64` / `uint64_t` + U64, + /// `u128` / `uint128_t` + U128, + /// `u256` / `uint256_t` + U256, + /// `f16` / `half` + F16, + /// `f32` / `float` + F32, + /// `f64` / `double` + F64, + /// `f128` / `quad` + F128, + /// `bool` + Bool, + /// An opaque pointer (like `void*`) + Ptr, +} + +/// The Ty of a nominal struct. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct StructTy { + pub name: Ident, + pub fields: Vec, + pub attrs: Vec, + /// True if all fields had was_blank set, indicating this could be emitted as a tuple-struct + pub all_fields_were_blank: bool, +} + +/// The Ty of an untagged union. +/// +/// See [`TaggedTy`][] for a tagged union. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct UnionTy { + pub name: Ident, + pub fields: Vec, + pub attrs: Vec, +} + +/// The Ty of an Enum. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct EnumTy { + pub name: Ident, + pub variants: Vec, + pub attrs: Vec, +} + +/// An enum variant +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct EnumVariantTy { + pub name: Ident, + // pub val: LiteralExpr, +} + +/// The Ty of a tagged union (rust-style enum). +/// +/// See [`UnionTy`][] for an untagged union. +/// +/// See [`EnumTy`][] for a c-style enum. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct TaggedTy { + pub name: Ident, + pub variants: Vec, + pub attrs: Vec, +} + +/// A variant for a tagged union. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct TaggedVariantTy { + pub name: Ident, + pub fields: Option>, + /// True if all fields have was_blank set, indicating this could be emitted as a tuple-variant + pub all_fields_were_blank: bool, +} + +/// The Ty of a transparent type alias. +/// +/// i.e. `type name = real` in rust +/// +/// i.e. `typedef real name` in C++ +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AliasTy { + pub name: Ident, + pub real: TyIdx, + pub attrs: Vec, +} + +/// A field of a [`StructTy`][] or [`UnionTy`][]. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct FieldTy { + pub idx: usize, + pub ident: Ident, + pub ty: TyIdx, +} + +/// The Ty of a fixed length array. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct ArrayTy { + pub elem_ty: TyIdx, + pub len: u64, +} + +/// The Ty of a reference (transparent pointer). +/// +/// This is used to represent passing a value by-reference, and so backends +/// should consider the "value" to be the pointee. If you want to test that +/// a pointer doesn't have its value corrupted but don't care about the pointee, +/// use `PrimitiveTy::Ptr`. +/// +/// When used in the `outputs` of a [`Func`], this expresses an out-param +/// that the caller is responsible for "allocating" (and initializing?) and +/// the callee is responsible for "writing" the value to it. The caller then +/// checks the value just like other outputs. +/// +/// Out-params should appear after "normal" inputs but before vararg inputs, +/// with the name specified. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct RefTy { + pub pointee_ty: TyIdx, +} + +/// The Ty of a Pun. +/// +/// Puns express the fact that different languages might express a type +/// in completely different ways but we expect the layout and/or ABI to +/// match. +/// +/// e.g. `Option<&T>` in Rust is equivalent to `T*` in C! +/// +/// Resolve this with [`TypedProgram::resolve_pun`][]. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct PunTy { + pub name: Ident, + pub blocks: Vec, + pub attrs: Vec, +} + +/// A block for a [`PunTy`][] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct PunBlockTy { + pub selector: PunSelector, + pub real: TyIdx, +} + +/// Information on all the types. +/// +/// The key function of TyCtx is to `memoize` all parsed types (TyName) into +/// type ids (TyIdx), to enable correct type comparison. Two types are equal +/// *if and only if* they have the same TyIdx. +/// +/// This is necessary because *nominal* types (TyName::Named, i.e. structs) can +/// be messy due to shenanigans like captures/scoping/shadowing/inference. Types +/// may refer to names that are out of scope, and two names that are equal +/// (as strings) may not actually refer to the same type declaration. +/// +/// To handle this, whenever a new named type is declared ([TyCtx::push_nominal_decl_incomplete][]), +/// we generate a unique type id ([`TyIdx`][]) for it. Then whenever we encounter +/// a reference to a Named type, we lookup the currently in scope TyIdx for that +/// name, and use that instead. Named type scoping is managed by `envs`. +/// +/// Replacing type names with type ids requires a change of representation, +/// which is why we have [`Ty`][]. A Ty is the *structure* of a type with all types +/// it refers to resolved to TyIdx's (e.g. a field of a tuple, the return type of a function). +/// For convenience, non-typing metadata may also be stored in a Ty. +/// +/// So a necessary intermediate step of converting an Ident to a TyIdx is to first +/// convert it to a Ty. This intermediate value is stored in `tys`. +/// If you have a TyIdx, you can get its Ty with [`realize_ty`][]. This lets you +/// e.g. check if a value being called is actually a Func, and if it is, +/// what the type ids of its arguments/return types are. +/// +/// `ty_map` stores all the *structural* Tys we've seen before (everything that +/// *isn't* TyName::Named), ensuring two structural types have the same TyIdx. +/// i.e. `[u32; 4]` will have the same TyIdx everywhere it occurs. +#[derive(Debug)] +pub(crate) struct TyCtx { + /// The source code this is from, for resolving spans/errors. + src: Arc, + + /// The list of every known type. + /// + /// These are the "canonical" copies of each type. Types are + /// registered here via `memoize`, which returns a TyIdx into + /// this array. + /// + /// Types should be compared by checking if they have the same + /// TyIdx. This allows you to properly compare nominal types + /// in the face of shadowing and similar situations. + tys: Vec, + + /// Mappings from structural types we've seen to type indices. + /// + /// This is used to get the canonical TyIdx of a structural type + /// (including builtin primitives). + /// + /// Nominal types (structs) are stored in `envs`, because they + /// go in and out of scope. + ty_map: HashMap, + + /// Scoped type info, reflecting the fact that struct definitions + /// and variables come in and out of scope. + /// + /// These values are "cumulative", so type names and variables + /// should be looked up by searching backwards in this array. + /// + /// If nothing is found, that type name / variable name is undefined + /// at this point in the program. + envs: Vec, +} + +/// Information about types for a specific scope. +#[derive(Debug)] +struct CheckEnv { + /// The struct definitions and TyIdx's + tys: HashMap, +} + +/// Take a ParsedProgram and produce a TypedProgram for it! +pub fn typeck(comp: &mut Compiler, parsed: &ParsedProgram) -> Result { + let mut tcx = TyCtx { + src: comp.source.clone().unwrap(), + tys: vec![], + ty_map: HashMap::new(), + envs: vec![], + }; + + // Add global builtins + tcx.envs.push(CheckEnv { + tys: HashMap::new(), + }); + tcx.add_builtins(); + + // Put user-defined types in a separate scope just to be safe + tcx.envs.push(CheckEnv { + tys: HashMap::new(), + }); + + // Add all the user defined types + for (ty_name, _ty_decl) in &parsed.tys { + let _ty_idx = tcx.push_nominal_decl_incomplete(ty_name.clone()); + } + for (ty_name, ty_decl) in &parsed.tys { + tcx.complete_nominal_decl(ty_name, ty_decl)?; + } + + let funcs = parsed + .funcs + .iter() + .map(|(_func_name, func_decl)| -> Result { + let inputs = func_decl + .inputs + .iter() + .enumerate() + .map(|(idx, var)| -> Result { + let name = ident_var(var.name.clone(), "arg", idx, &var.ty); + let ty = tcx.memoize_ty(&var.ty)?; + Ok(Arg { name, ty }) + }) + .collect::>>()?; + let outputs = func_decl + .outputs + .iter() + .enumerate() + .map(|(idx, var)| { + let name = ident_var(var.name.clone(), "out", idx, &var.ty); + let ty = tcx.memoize_ty(&var.ty)?; + Ok(Arg { name, ty }) + }) + .collect::>>()?; + + let name = func_decl.name.clone(); + let attrs = func_decl.attrs.clone(); + Ok(Func { + name, + inputs, + outputs, + attrs, + body: (), + }) + }) + .collect::>>()?; + + let builtin_funcs_start = parsed.builtin_funcs_start; + Ok(TypedProgram { + tcx, + funcs, + builtin_funcs_start, + }) +} + +impl TyCtx { + /// Add the builtin types to the TyCtx + fn add_builtins(&mut self) { + let builtins = [ + ("i8", Ty::Primitive(PrimitiveTy::I8)), + ("i16", Ty::Primitive(PrimitiveTy::I16)), + ("i32", Ty::Primitive(PrimitiveTy::I32)), + ("i64", Ty::Primitive(PrimitiveTy::I64)), + ("i128", Ty::Primitive(PrimitiveTy::I128)), + ("i256", Ty::Primitive(PrimitiveTy::I256)), + ("u8", Ty::Primitive(PrimitiveTy::U8)), + ("u16", Ty::Primitive(PrimitiveTy::U16)), + ("u32", Ty::Primitive(PrimitiveTy::U32)), + ("u64", Ty::Primitive(PrimitiveTy::U64)), + ("u128", Ty::Primitive(PrimitiveTy::U128)), + ("u256", Ty::Primitive(PrimitiveTy::U256)), + ("f16", Ty::Primitive(PrimitiveTy::F16)), + ("f32", Ty::Primitive(PrimitiveTy::F32)), + ("f64", Ty::Primitive(PrimitiveTy::F64)), + ("f128", Ty::Primitive(PrimitiveTy::F128)), + ("bool", Ty::Primitive(PrimitiveTy::Bool)), + ("ptr", Ty::Primitive(PrimitiveTy::Ptr)), + ("()", Ty::Empty), + ]; + + for (ty_name, ty) in builtins { + let ty_idx = self.tys.len(); + self.tys.push(ty); + self.envs + .last_mut() + .unwrap() + .tys + .insert(Ident::from(ty_name.to_owned()), ty_idx); + } + } + + /// Register a new nominal struct in this scope. + /// + /// This creates a valid TyIdx for the type, but the actual Ty + /// while be garbage (Ty::Empty arbitrarily) and needs to be + /// filled in properly with [`TyCtx::complete_nominal_decl`][]. + /// + /// This two-phase system is necessary to allow nominal types to + /// be unordered or self-referential. + fn push_nominal_decl_incomplete(&mut self, ty_name: Ident) -> TyIdx { + let ty_idx = self.tys.len(); + let dummy_ty = Ty::Empty; + self.tys.push(dummy_ty); + self.envs.last_mut().unwrap().tys.insert(ty_name, ty_idx); + ty_idx + } + + /// Complete a nominal decl created with [`TyCtx::push_nominal_decl_incomplete`][]. + fn complete_nominal_decl(&mut self, ty_name: &Ident, ty_decl: &TyDecl) -> Result<()> { + // This failing is an ICE and not a user issue! + let ty_idx = self + .resolve_nominal_ty(ty_name) + .expect("completing a nominal ty that hasn't been decl'd"); + let ty = self.memoize_nominal_parts(ty_decl)?; + self.tys[ty_idx] = ty; + Ok(()) + } + + /// Memoize the parts of a nominal ty. + fn memoize_nominal_parts(&mut self, ty_decl: &TyDecl) -> Result { + let ty = match ty_decl { + TyDecl::Struct(decl) => { + let fields = decl + .fields + .iter() + .enumerate() + .map(|(idx, f)| { + Ok(FieldTy { + idx, + ident: ident_var(f.name.clone(), "field", idx, &f.ty), + ty: self.memoize_ty(&f.ty)?, + }) + }) + .collect::>>()?; + let all_fields_were_blank = fields.iter().all(|f| f.ident.was_blank); + Ty::Struct(StructTy { + name: decl.name.clone(), + fields, + attrs: decl.attrs.clone(), + all_fields_were_blank, + }) + } + TyDecl::Union(decl) => { + let fields = decl + .fields + .iter() + .enumerate() + .map(|(idx, f)| { + Ok(FieldTy { + idx, + ident: ident_var(f.name.clone(), "field", idx, &f.ty), + ty: self.memoize_ty(&f.ty)?, + }) + }) + .collect::>>()?; + Ty::Union(UnionTy { + name: decl.name.clone(), + fields, + attrs: decl.attrs.clone(), + }) + } + TyDecl::Enum(decl) => { + let variants = decl + .variants + .iter() + .map(|v| EnumVariantTy { + name: v.name.clone(), + }) + .collect::>(); + Ty::Enum(EnumTy { + name: decl.name.clone(), + variants, + attrs: decl.attrs.clone(), + }) + } + TyDecl::Tagged(decl) => { + let variants = decl + .variants + .iter() + .map(|v| { + let fields = if let Some(fields) = &v.fields { + Some( + fields + .iter() + .enumerate() + .map(|(idx, f)| { + Ok(FieldTy { + idx, + ident: ident_var(f.name.clone(), "field", idx, &f.ty), + ty: self.memoize_ty(&f.ty)?, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let all_fields_were_blank = fields + .as_deref() + .unwrap_or_default() + .iter() + .all(|f| f.ident.was_blank); + Ok(TaggedVariantTy { + name: v.name.clone(), + fields, + all_fields_were_blank, + }) + }) + .collect::>>()?; + Ty::Tagged(TaggedTy { + name: decl.name.clone(), + variants, + attrs: decl.attrs.clone(), + }) + } + TyDecl::Alias(decl) => { + let real_ty = self.memoize_ty(&decl.alias)?; + Ty::Alias(AliasTy { + name: decl.name.clone(), + real: real_ty, + attrs: decl.attrs.clone(), + }) + } + TyDecl::Pun(decl) => { + let blocks = decl + .blocks + .iter() + .map(|block| { + // !!! If this ever becomes fallible we'll want a proper stack guard to pop! + self.envs.push(CheckEnv { + tys: HashMap::new(), + }); + let real_decl = &block.decl; + let real = self.push_nominal_decl_incomplete(decl.name.clone()); + self.complete_nominal_decl(&decl.name, real_decl)?; + self.envs.pop(); + + Ok(PunBlockTy { + selector: block.selector.clone(), + real, + }) + }) + .collect::>>()?; + + Ty::Pun(PunTy { + name: decl.name.clone(), + blocks, + attrs: decl.attrs.clone(), + }) + } + }; + Ok(ty) + } + + /// Resolve the type id (TyIdx) associated with a nominal type (struct name), + /// at this point in the program. + fn resolve_nominal_ty(&mut self, ty_name: &str) -> Option { + for env in self.envs.iter_mut().rev() { + if let Some(ty) = env.tys.get(ty_name) { + return Some(*ty); + } + } + None + } + + /// Converts a TyName (parsed type) into a TyIdx (type id). + /// + /// All TyNames in the program must be memoized, as this is the only reliable + /// way to do type comparisons. See the top level docs of TyIdx for details. + fn memoize_ty(&mut self, ty_ref: &Spanned) -> Result { + let ty_idx = match &**ty_ref { + Tydent::Empty => self.memoize_inner(Ty::Empty), + Tydent::Ref(pointee_ty_ref) => { + let pointee_ty = self.memoize_ty(pointee_ty_ref)?; + self.memoize_inner(Ty::Ref(RefTy { pointee_ty })) + } + Tydent::Array(elem_ty_ref, len) => { + let elem_ty = self.memoize_ty(elem_ty_ref)?; + self.memoize_inner(Ty::Array(ArrayTy { elem_ty, len: *len })) + } + Tydent::Name(name) => { + // Nominal types take a separate path because they're scoped + if let Some(ty_idx) = self.resolve_nominal_ty(name) { + ty_idx + } else { + return Err(KdlScriptTypeError { + message: "use of undefined type name".to_string(), + src: self.src.clone(), + span: Spanned::span(name), + help: None, + })?; + } + } + }; + + Ok(ty_idx) + } + + /// Converts a Ty (structural type with all subtypes resolved) into a TyIdx (type id). + fn memoize_inner(&mut self, ty: Ty) -> TyIdx { + if let Some(idx) = self.ty_map.get(&ty) { + *idx + } else { + let ty1 = ty.clone(); + let ty2 = ty; + let idx = self.tys.len(); + + self.ty_map.insert(ty1, idx); + self.tys.push(ty2); + idx + } + } + + /// Get the type-structure (Ty) associated with this type id (TyIdx). + pub fn realize_ty(&self, ty: TyIdx) -> &Ty { + self.tys + .get(ty) + .expect("Internal Compiler Error: invalid TyIdx") + } + + /// Resolve a [`PunTy`][] based on the current [`PunEnv`][]. + pub fn resolve_pun(&self, pun: &PunTy, env: &PunEnv) -> Result { + for block in &pun.blocks { + if block.selector.matches(env) { + return Ok(block.real); + } + } + + Err(KdlScriptTypeError { + message: "Failed to find applicable pun for this target environment".to_string(), + src: self.src.clone(), + span: Spanned::span(&pun.name), + help: Some(format!("Add another block that matches {:#?}", env)), + })? + } + + /* + pub fn pointee_ty(&self, ty: TyIdx) -> TyIdx { + if let Ty::TypedPtr(pointee) = self.realize_ty(ty) { + *pointee + } else { + unreachable!("expected typed to be pointer"); + } + } + */ + + /// Stringify a type. + pub fn format_ty(&self, ty: TyIdx) -> String { + match self.realize_ty(ty) { + Ty::Primitive(prim) => format!("{:?}", prim).to_lowercase(), + Ty::Empty => "()".to_string(), + Ty::Struct(decl) => format!("{}", decl.name), + Ty::Enum(decl) => format!("{}", decl.name), + Ty::Tagged(decl) => format!("{}", decl.name), + Ty::Union(decl) => format!("{}", decl.name), + Ty::Alias(decl) => format!("{}", decl.name), + Ty::Pun(decl) => format!("{}", decl.name), + Ty::Array(array_ty) => { + let inner = self.format_ty(array_ty.elem_ty); + format!("[{}; {}]", inner, array_ty.len) + } + Ty::Ref(ref_ty) => { + let inner = self.format_ty(ref_ty.pointee_ty); + format!("&{}", inner) + } + } + } +} + +/// A node in the DefinitionGraph +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +enum DefinitionGraphNode { + Func(FuncIdx), + Ty(TyIdx), +} + +/// A Dependency Graph of all the type/function definitions. +#[derive(Debug, Clone)] +pub struct DefinitionGraph { + /// The actual Graph + graph: DiGraph, + /// FuncIdx = NodeIdx + func_nodes: Vec, + /// The Strongly Connected Components in topological order + def_order: Vec>, +} + +impl TypedProgram { + /// Get the Ty for this TyIdx + pub fn realize_ty(&self, ty: TyIdx) -> &Ty { + self.tcx.realize_ty(ty) + } + + /// Get the Func for this FuncIdx + pub fn realize_func(&self, func: FuncIdx) -> &Func { + &self.funcs[func] + } + + pub fn all_funcs(&self) -> impl Iterator { + 0..self.builtin_funcs_start + } + + /// Resolve a [`PunTy`][] based on the current [`PunEnv`][]. + pub fn resolve_pun(&self, pun: &PunTy, env: &PunEnv) -> Result { + self.tcx.resolve_pun(pun, env) + } + + /// Stringify a type (for debugging). + pub fn format_ty(&self, ty: TyIdx) -> String { + self.tcx.format_ty(ty) + } + + /// Compute the dependency graph between types ([`DefinitionGraph`][]). + /// + /// This serves two purposes: + /// + /// * Figuring out the correct order of type/function declarations (and forward declarations) + /// for languages like C that need that kind of thing (and its prettier for other langs). + /// + /// * Producing minimized examples for subsets of the program (by only emitting the types + /// needed for a single function). + /// + /// The next step in lowering the program is to query [`DefinitionGraph::definitions`][] with the + /// functions you want to emit! + /// + /// This can fail if the given [`PunEnv`][] fails to resolve a [`PunTy`][]. + pub fn definition_graph(&self, env: &PunEnv) -> Result { + let mut graph = petgraph::graph::DiGraph::new(); + let mut nodes = vec![]; + + // First create all the nodes for all the types + for (ty_idx, _ty) in self.tcx.tys.iter().enumerate() { + let ty_node = graph.add_node(DefinitionGraphNode::Ty(ty_idx)); + nodes.push(ty_node); + } + + // Now create edges between them for deps + // + // NOTE: it's fine to make an edge from a node to itself, that doesn't + // change anything we do further down with SCCs! + for (ty_idx, ty) in self.tcx.tys.iter().enumerate() { + let ty_node = nodes[ty_idx]; + match ty { + Ty::Struct(ty) => { + for field in &ty.fields { + let field_ty_node = nodes[field.ty]; + graph.update_edge(ty_node, field_ty_node, ()); + } + } + Ty::Union(ty) => { + for field in &ty.fields { + let field_ty_node = nodes[field.ty]; + graph.update_edge(ty_node, field_ty_node, ()); + } + } + Ty::Tagged(ty) => { + for variant in &ty.variants { + if let Some(fields) = &variant.fields { + for field in fields { + let field_ty_node = nodes[field.ty]; + graph.update_edge(ty_node, field_ty_node, ()); + } + } + } + } + Ty::Alias(ty) => { + let real_ty_node = nodes[ty.real]; + graph.update_edge(ty_node, real_ty_node, ()); + } + Ty::Pun(ty) => { + let real_ty_node = nodes[self.tcx.resolve_pun(ty, env)?]; + graph.update_edge(ty_node, real_ty_node, ()); + } + Ty::Array(ty) => { + let elem_ty_node = nodes[ty.elem_ty]; + graph.update_edge(ty_node, elem_ty_node, ()); + } + Ty::Ref(ty) => { + let pointee_ty_node = nodes[ty.pointee_ty]; + graph.update_edge(ty_node, pointee_ty_node, ()); + } + Ty::Enum(_) => { + // Arguably this can't depend on any types... + // BUT we should consider whether `@tag i32` is a dependency on i32! + // These kinds of annotations aren't configured yet though! + } + Ty::Primitive(_) | Ty::Empty => { + // These types have no deps, no edges to add! + } + } + } + + // Add edges from functions to the things they reference + let mut func_nodes = vec![]; + for (func_idx, func) in self.funcs.iter().enumerate() { + let func_node = graph.add_node(DefinitionGraphNode::Func(func_idx)); + for arg in func.inputs.iter().chain(func.outputs.iter()) { + let arg_ty_node = nodes[arg.ty]; + graph.update_edge(func_node, arg_ty_node, ()); + } + func_nodes.push(func_node); + } + + // Now compute the Strongly Connected Components! + // See the comment in `DefinitionGraph::definitions` for details on what this is! + let def_order = petgraph::algo::kosaraju_scc(&graph); + + Ok(DefinitionGraph { + graph, + func_nodes, + def_order, + }) + } +} + +/// Kinds of definitions/declarations a backend should emit +pub enum Definition { + /// Forward-declare this type + DeclareTy(TyIdx), + /// Define this type fully + DefineTy(TyIdx), + /// Forward-declare the function (only ever necessary with `feature="eval"`) + /// otherwise functions are always roots and never need forward-declares. + DeclareFunc(FuncIdx), + /// Define this function fully + DefineFunc(FuncIdx), +} + +impl DefinitionGraph { + /// Get the exact list of forward-declares and definitions to emit the program! + /// + /// Note that the recommendations are *extremely* agnostic to the target language + /// and will generally recommend you forward-declare or define a lot of types + /// that need no such thing in basically every language. + /// + /// For instance with a definition like: + /// + /// ```kdl + /// struct "SelfReferential" { + /// me "Option<&SelfReferential>" + /// val "u32" + /// } + /// ``` + /// + /// (Generics aren't currently supported, this is just easier to express.) + /// + /// You will get recommended something like: + /// + /// 1. Define `u32` + /// 2. Forward-declare `SelfReferential` + /// 3. Forward-declare `&SelfReferential` + /// 4. Define `Option<&SelfReferential>` + /// 5. Define `SelfReferential` + /// 6. Define `&SelfReferential` + /// + /// Which contains a lot of things that are nonsensical in basically every language! + /// That's ok! Just ignore the nonsensical recommendations like "declare a primitive" + /// or "forward-declare a reference" if they aren't necessary in your language! + /// + /// A Rust backend would only need to emit 5 (and maybe 4 if it's not Real Option). + /// + /// A C backend would only need to emit 2 and 5 (and maybe 4 if it's not Real Option). + pub fn definitions(&self, funcs: impl IntoIterator) -> Vec { + // Take the requested functions and compute all their dependencies! + let mut reachable = std::collections::HashSet::new(); + petgraph::visit::depth_first_search( + &self.graph, + funcs.into_iter().map(|f| self.func_nodes[f]), + |event| { + if let petgraph::visit::DfsEvent::Discover(node, _) = event { + reachable.insert(node); + } + }, + ); + + // Languages like C and C++ require types to be defined before they're used, + // so we need to build a dependency graph between types and functions and + // compute the topological sort. Unfortunately, types don't necessarily + // form a DAG, so how do we do this!? + // + // An "SCC" algorithm gives us a topo-sort of our graph as a DAG, + // but if there are any cycles then they get grouped together into one Mega Node + // called a "Strongly Connected Component" (defined as "every node in an SCC can + // reach every other node in the SCC"). This is why our toposort has elements that + // are Vec instead of just Node. The order of elements within an SCC + // is arbitrary because they're basically a dependency soup. + // + // If the graph is a proper DAG then every inner Vec will have one element. Otherwise + // cycles will be "hidden" by cramming it into a Vec. In the limit everything will + // get crammed into one inner Vec and that basically tells you everything is super + // fucked. + // + // To unfuck an SCC, languages like C and C++ have "forward declarations" that let + // you reserve a type name before actually specifying its definition. This breaks + // the dependency cycle. Determining the optimal forward declarations is NP-Hard, + // so we opt for the conservative solution of "emit a forward decl for everything + // in the SCC except for 1 node", which is necessary and sufficient if the SCC + // is the complete graph on N nodes. + let mut output = vec![]; + for component in &self.def_order { + // Get all the nodes in this SCC, and filter out the ones not reachable from + // the functions we want to emit. (Filtering lets us emit minimal examples for + // test failures so it's easy to reproduce/report!) + let nodes = component.iter().filter(|n| reachable.contains(*n)); + + // Emit forward decls for everything but the first node + // Note that this cutely does The Right thing (no forward decl) + // for the "happy" case of an SCC of one node (proper DAG). + for &node_idx in nodes.clone().skip(1) { + let node = &self.graph[node_idx]; + match *node { + DefinitionGraphNode::Func(func_idx) => { + output.push(Definition::DeclareFunc(func_idx)); + } + DefinitionGraphNode::Ty(ty_idx) => { + output.push(Definition::DeclareTy(ty_idx)); + } + } + } + + // Now that cycles have been broken with forward declares, we can + // just emit everything in the SCC. Note that we emit the type we + // *didn't* forward-declare first. All of its dependencies have + // been resolved by the forward-declares, but it still needs to be + // defined before anyone else in case they refer to it! + for &node_idx in nodes { + let node = &self.graph[node_idx]; + match *node { + DefinitionGraphNode::Func(func_idx) => { + output.push(Definition::DefineFunc(func_idx)); + } + DefinitionGraphNode::Ty(ty_idx) => { + output.push(Definition::DefineTy(ty_idx)); + } + } + } + } + + output + } +} + +fn ident_var(val: Option, basename: &str, idx: usize, backup_span: &Spanned) -> Ident { + if let Some(val) = val { + val + } else { + let val = format!("{basename}{idx}"); + let val = Spanned::new(val, Spanned::span(backup_span)); + Ident { + was_blank: false, + val, + } + } +} From 53ea53024c1a15f1c5935a05ce90659760a86c09 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 12:19:20 -0400 Subject: [PATCH 34/44] chore: workspaceify tomls --- Cargo.lock | 30 ++----------------- Cargo.toml | 69 ++++++++++++++++++++++++++++++++----------- kdl-script/Cargo.toml | 37 ++++++++++++----------- 3 files changed, 75 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e562a5..07a2b68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "abi-cafe" -version = "0.1.0" +version = "0.3.0" dependencies = [ "built", "camino", @@ -19,7 +19,6 @@ dependencies = [ "rand", "rand_core", "rand_pcg", - "ron", "serde", "serde_json", "thiserror", @@ -131,18 +130,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[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" @@ -721,7 +708,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.6.0", + "bitflags", ] [[package]] @@ -768,17 +755,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" -[[package]] -name = "ron" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" -dependencies = [ - "base64", - "bitflags 1.3.2", - "serde", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -791,7 +767,7 @@ 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", diff --git a/Cargo.toml b/Cargo.toml index c048afb..a6ce940 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,42 +1,77 @@ -[workspace] -members = ["kdl-script"] - [package] name = "abi-cafe" description = "Pair your compilers up at The ABI café!" -repository = "https://github.com/Gankra/abi-cafe" -edition = "2021" -license = "MIT OR Apache-2.0" -version = "0.1.0" -exclude = ["generated_impls/", "handwritten_impls/", "tests/"] +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true + +exclude = ["generated_impls/", "tests/"] [features] default = [] - [dependencies] +kdl-script = { version = "0.3.0", path = "kdl-script" } + +camino.workspace = true +cc.workspace = true +clap.workspace = true +console.workspace = true +kdl.workspace = true +libloading.workspace = true +linked-hash-map.workspace = true +miette.workspace = true +rand.workspace = true +rand_core.workspace = true +rand_pcg.workspace = true +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true +tokio.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true + +[build-dependencies] +built.workspace = true + + + +[lints.clippy] +result_large_err = "allow" + + + +[workspace] +members = ["kdl-script"] + +[workspace.package] +repository = "https://github.com/Gankra/abi-cafe" +edition = "2021" +license = "MIT OR Apache-2.0" +version = "0.3.0" + +[workspace.dependencies] camino = { version = "1.1.7", features = ["serde1"] } cc = { version = "1.0.73", git = "https://github.com/Gankra/cc-rs" } -clap = { version = "4.5.4", features = ["cargo", "wrap_help"] } +clap = { version = "4.5.4", features = ["cargo", "wrap_help", "derive"] } console = "0.15.8" kdl = "4.6.0" -kdl-script = { version = "0.3.0", path = "kdl-script" } libloading = "0.7.3" linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } +nom = "7.1.3" miette = { version = "5.3.0", features = ["fancy"] } +petgraph = "0.6.4" rand = "0.8.5" rand_core = "0.6.4" rand_pcg = "0.3.1" -ron = "0.7.0" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.83" thiserror = "1.0.30" tokio = { version = "1.37.0", features = ["full", "tracing"] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } - -[lints.clippy] -result_large_err = "allow" - -[build-dependencies] +# build built = "0.5.1" +# dev +insta = "1.34.0" diff --git a/kdl-script/Cargo.toml b/kdl-script/Cargo.toml index e5cb447..b324dd5 100644 --- a/kdl-script/Cargo.toml +++ b/kdl-script/Cargo.toml @@ -1,10 +1,11 @@ [package] name = "kdl-script" -version = "0.3.0" -edition = "2021" -license = "MIT OR Apache-2.0" description = "execute kdl documents!" -repository = "https://github.com/Gankra/kdl-script" +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true + exclude = [ "book/*", "src/snapshots/*", @@ -20,24 +21,26 @@ required-features = ["cli"] [features] default = ["cli"] # CLI interface for the binary -cli = ["eval", "clap", "tracing-subscriber", "miette/fancy", "serde_json"] +cli = ["eval"] +# temporarily disabled because workspace-deps can't be optional..? +# cli = ["eval", "clap", "tracing-subscriber", "miette/fancy", "serde_json"] # The code for evaluating a compiled program (not needed for abi-cafe) eval = [] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.1.8", features = ["derive"], optional = true } -kdl = "4.5.0" -linked-hash-map = "0.5.6" -miette = { version = "5.10.0" } -nom = "7.1.3" -petgraph = "0.6.4" -serde = { version = "1.0.154", features = ["derive"] } -serde_json = { version = "1.0.108", optional = true } -thiserror = "1.0.39" -tracing = "0.1.40" -tracing-subscriber = { version = "0.3.16", optional = true } +clap.workspace = true +kdl.workspace = true +linked-hash-map.workspace = true +miette.workspace = true +nom.workspace = true +petgraph.workspace = true +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true [dev-dependencies] -insta = "1.34.0" +insta.workspace = true From 82ab200d49e937e22ba1ed15925c6ae66262f2b7 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 19:30:09 -0400 Subject: [PATCH 35/44] fix: properly handle recursive types --- Cargo.toml | 1 + README.md | 27 +++-- kdl-script/README.md | 53 +++++++--- kdl-script/src/types.rs | 212 +++++++++++++++++++++++++++++++++++++++- src/abis/rust.rs | 35 ++----- src/procgen.rs | 48 --------- 6 files changed, 271 insertions(+), 105 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a6ce940..b127e7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ result_large_err = "allow" [workspace] members = ["kdl-script"] +resolver = "2" [workspace.package] repository = "https://github.com/Gankra/abi-cafe" diff --git a/README.md b/README.md index 5ddf571..b63aa40 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,12 @@ This tool helps automate testing that two languages/compilers agree on ABIs for The principle of the tool is as follows: * Define a function signature that one impl should call the other with -* Generate (or handwrite) both impls' versions (of both sides) of the interface +* Generate both impls' versions (of both sides) of the interface * Have each side report what it thinks the values are with global callbacks * Compile both sides as static libs, and link into a dynamic lib harness * Load that dynamic lib in, pass in the callbacks, and run it * Check that both sides reported the same values +* Generate minimized/simplified versions of any found failures By running this natively on whatever platform you care about, this will tell you what FFI interfaces do and don't currently work. Ideally all you need to do is `cargo run`, but we're dealing with native toolchains so, expect toolchain bugs! @@ -60,7 +61,7 @@ In theory other implementations aren't *too bad* to add. You just need to: * Specify how to generate a callee from a signature * Specify how to compile a source file to a static lib * Register it in the `abi_impls` map in `fn main` -* (Optional) Register what you want it paired with by default in `DEFAULT_TEST_PAIRS` +* (Optional) Register what you want it paired with by default in `DEFAULT_TEST_PAIRS` * i.e. (ABI_IMPL_YOU, ABI_IMPL_CC) will have the harness test you calling into C See the Test Harness section below for details on how to use it. @@ -74,8 +75,7 @@ We try to generate and test all supported conventions. Universal Conventions: -* handwritten: run handwritten code (opaque to the framework, lets you do whatever) -* c: the platform's default C convention (extern "C") +* c: the platform's default C convention (`extern "C"`) Windows Conventions: @@ -96,6 +96,9 @@ The test format support for the following types/concepts: * float/double * bool * structs +* c-like enums +* c-like untagged unions +* rust-like tagged unions * opaque pointers (void\*) * pass-by-ref (still checks the pointee's layout, and not the address) * arrays (including multi-dimensional arrays, although C often requires arrays to be wrapped in pass-by-ref) @@ -103,6 +106,10 @@ The test format support for the following types/concepts: # Adding Tests +There are two kinds of tests: `.kdl` and `.procgen.kdl` + +The latter is sugar for the former, where you just define a type with the same name of the file (so `MetersU32.procgen.kdl` is expected to define a type named `MetersU32`), and we generate a battery of types/functions that stress it out. + Tests are specified as [ron](https://github.com/ron-rs/ron) files in the test/ directory, because it's more compact than JSON, has comments, and is more reliable with large integers. Because C is in some sense the "lingua franca" of FFI that everyone has to deal with, we prefer using C types in these definitions. You don't need to register the test anywhere, we will just try to parse every file in that directory. @@ -114,7 +121,7 @@ Example: ```rust Test( // name of this set of tests - name: "examples", + name: "examples", // generate tests for the following function signatures funcs: [ ( @@ -139,11 +146,11 @@ Test( // Struct decls are implicit in usage. // All structs with the same name must match! Struct("MyStruct", [ - Int(c_uint8_t(0xf1)), + Int(c_uint8_t(0xf1)), Float(c_double(1234.23)), - ]), + ]), Struct("MyStruct", [ - Int(c_uint8_t(0x1)), + Int(c_uint8_t(0x1)), Float(c_double(0.23)), ]), ], @@ -182,7 +189,7 @@ void do_test(void) { WRITE(CALLER_INPUTS, (char*)&arg0.field0, (uint32_t)sizeof(arg0.field0)); WRITE(CALLER_INPUTS, (char*)&arg0.field1, (uint32_t)sizeof(arg0.field1)); FINISHED_VAL(CALLER_INPUTS); - + int32_t arg1 = 5; WRITE(CALLER_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); FINISHED_VAL(CALLER_INPUTS); @@ -206,7 +213,7 @@ uint64_t basic_val(struct MyStruct arg0, int32_t arg1) { WRITE(CALLEE_INPUTS, (char*)&arg0.field0, (uint32_t)sizeof(arg0.field0)); WRITE(CALLEE_INPUTS, (char*)&arg0.field1, (uint32_t)sizeof(arg0.field1)); FINISHED_VAL(CALLEE_INPUTS); - + WRITE(CALLEE_INPUTS, (char*)&arg1, (uint32_t)sizeof(arg1)); FINISHED_VAL(CALLEE_INPUTS); diff --git a/kdl-script/README.md b/kdl-script/README.md index f5b4444..609afb0 100644 --- a/kdl-script/README.md +++ b/kdl-script/README.md @@ -1,6 +1,6 @@ # kdl-script -[![crates.io](https://img.shields.io/crates/v/kdl-script.svg)](https://crates.io/crates/kdl-script) [![docs](https://docs.rs/kdl-script/badge.svg)](https://docs.rs/kdl-script) ![Rust CI](https://github.com/Gankra/kdl-script/workflows/Rust%20CI/badge.svg?branch=main) +[![crates.io](https://img.shields.io/crates/v/kdl-script.svg)](https://crates.io/crates/kdl-script) [![docs](https://docs.rs/kdl-script/badge.svg)](https://docs.rs/kdl-script) ![Rust CI](https://github.com/Gankra/abi-cafe/workflows/Rust%20CI/badge.svg?branch=main) A Compiler for KDLScript, the [KDL][]-based programming language! @@ -10,16 +10,18 @@ type/function definitions in a language-agnostic way to avoid getting muddled in the details of each language when trying to talk about All Languages In Reality. It exists to be used by [abi-cafe][]. +Basically, KDLScript is a header format we can make as weird as we want for our own usecase. + Ultimately the syntax and concepts are heavily borrowed from Rust, for a few reasons: * The author is very comfortable with Rust -* This (and [abi-cafe][]) were originally created to find bugs in rustc +* This (and [abi-cafe][]) were originally created to find bugs in rustc * Rust is genuinely just a solid language for expressing ABIs! (Better than C/C++) The ultimate goal of this is to test that languages can properly communicate over FFI by declaring the types/interface once and generating the Rust/C/C++/... versions of the program (both caller and callee) and then linking them into various combinations -like "Rust Calls C++" to check that the values are passed correctly. +like "Rust Calls C++" to check that the values are passed correctly. Since C is the lingua-franca of FFI, it's assumed that when lowering definitions to the target language that they should be the "C Compatible" equivalent. For instance, @@ -29,22 +31,22 @@ In Rust this means all type definitions are implicitly `#[repr(C)]` (ideally sho opt-outable). Most details about the function are left abstract so that [abi-cafe][] can choose how to fill those in. -"C Compatible" gets fuzzier for some things like tagged unions. +"C Compatible" gets fuzzier for some things like tagged unions. Just uh... don't worry about it (see "Concepts" below for details). -# Usage +# CLI Usage -kdl-script is both a library and a CLI application. +kdl-script is both a library and a CLI application. The CLI is just for funsies. The main entry point to the library is [`Compiler::compile_path`][] or [`Compiler::compile_string`][], which will produce a [`TypedProgram`][]. See the [`types`][] module docs for how to use that. The CLI application can be invoked as `kdl-script path/to/program.kdl` to run a KDLScript program. -TODO: Write some examples! (See the `examples` dir for some.) +FIXME: Write some examples! (See the `examples` dir for some.) @@ -57,6 +59,28 @@ A KdlScript program is a single file that has types, functions, and attributes ( The following kinds of types exist in KDLScript. +* nominal types + * `struct` - a plain ol' struct + * `enum` - a c-style enum + * `union` - an untagged union + * `tagged` - a tagged union (rust-style enum) + * `alias` - a transparent type alias + * `pun` - a pun across the FFI boundary, "CSS for ifdefs" +* structural types + * `[T;N]` - an array of T, length N + * `&T` - a (mutable) reference to T (the pointee is regarded as the value) +* builtin primitives + * integers (`i8`, `u128`, ...) + * floats (`f16`, `f32`, `f64`, `f128`, ...) + * `bool`- your old pal the boolean (TriBool support TBD) + * `ptr` - an opaque pointer (`void*`), used when you're interested in the value of the pointer and not its pointee (unlike `&T`) + * `()` - empty tuple + +All of these types can be combined together as you expect, and self-referential +types + +Note that we do not currently support generics + ### Nominal Types A KDLScript user is allowed to declare the following kinds of nominal types @@ -164,13 +188,13 @@ See Pun Types for additional notes on how aliases interact with typeids! #### Tagged Types Tagged is the equivalent of Rust's `enum`, a tagged union where variants have fields, which has no "obvious" C/C++ analog. -Variant bodies may either be missing (indicating no payload) or have the syntax of a `struct` body. +Variant bodies may either be missing (indicating no payload) or have the syntax of a `struct` body. ```kdl tagged "MyOptionU32" { None Some { _ "u32"; } - FileNotFound { + FileNotFound { path "[u8; 100]" error_code "i64" } @@ -201,7 +225,7 @@ Here is an example that claims that a Rust `repr(transparent)` newtype of a `u32 ```kdl pun "MetersU32" { - lang "rust" { + lang "rust" { @ "#[repr(transparent)]" struct "MetersU32" { a "u32" @@ -247,8 +271,8 @@ TODO: figure out how to talk about "language-native types" in much the same way A KDLScript user is allowed to use the following kinds of structural types -* `&T` - a transparent reference to T -* `[T; N]` - a fixed-length array of T (length N) +* `&T` - a transparent reference to T +* `[T; N]` - a fixed-length array of T (length N) * `()` - the empty tuple (I just like adding this cuz it's cute!!!) TODO: figure out if we want to bake in Rust's `Option` type here, if only for `Option<&T>`. @@ -318,6 +342,7 @@ There are various builtin primitives, such as: * floats (f16, f32, f64, f128, ...) * `bool`- your old pal the boolean (TriBool support TBD) * `ptr` - an opaque pointer (`void*`), used when you're interested in the value of the pointer and not its pointee (unlike `&T`) +* `()` - empty tuple In the future there will probably be language-specific primitives like `c_long`. @@ -384,7 +409,7 @@ fn my_func_caller() { // Setup outparams let mut out1 = ErrorCode::default(); - + // Do the call let out0 = my_func(x, y, &arg2, &mut out1); @@ -476,7 +501,7 @@ fn "main" { x 10.0 y 20.0 } - + let "sum" "add:" "pt1" "pt2" print "sum" diff --git a/kdl-script/src/types.rs b/kdl-script/src/types.rs index a63badd..7fefca0 100644 --- a/kdl-script/src/types.rs +++ b/kdl-script/src/types.rs @@ -40,7 +40,9 @@ //! get more complex! Also it's just nice to handle backend-agnostic issues once to keep //! things simple and correct. +use std::cmp::Ordering; use std::collections::HashMap; +use std::collections::HashSet; use std::sync::Arc; use miette::{Diagnostic, NamedSource, SourceSpan}; @@ -122,6 +124,23 @@ pub enum Ty { Empty, } +impl Ty { + pub fn is_nominal(&self) -> bool { + match self { + Ty::Primitive(_) => false, + Ty::Struct(_) => true, + Ty::Union(_) => true, + Ty::Enum(_) => true, + Ty::Tagged(_) => true, + Ty::Alias(_) => true, + Ty::Pun(_) => true, + Ty::Array(_) => false, + Ty::Ref(_) => false, + Ty::Empty => false, + } + } +} + /// A function #[derive(Debug, Clone)] pub struct Func { @@ -368,6 +387,8 @@ pub(crate) struct TyCtx { /// go in and out of scope. ty_map: HashMap, + ty_facts: HashMap, + /// Scoped type info, reflecting the fact that struct definitions /// and variables come in and out of scope. /// @@ -379,6 +400,11 @@ pub(crate) struct TyCtx { envs: Vec, } +#[derive(Debug, Clone)] +struct TypeFact { + contains_ref: bool, +} + /// Information about types for a specific scope. #[derive(Debug)] struct CheckEnv { @@ -392,6 +418,7 @@ pub fn typeck(comp: &mut Compiler, parsed: &ParsedProgram) -> Result Result>>()?; + // Now that everything's added, compute some facts + tcx.compute_ty_facts()?; + let builtin_funcs_start = parsed.builtin_funcs_start; Ok(TypedProgram { tcx, @@ -740,6 +770,141 @@ impl TyCtx { })? } + fn compute_ty_facts(&mut self) -> Result<()> { + let mut to_compute = (0..self.tys.len()).collect::>(); + let mut already_visited = HashSet::new(); + + fn aggregate_facts( + this: &mut TyCtx, + to_compute: &mut Vec, + already_visited: &mut HashSet, + cur_ty: TyIdx, + child_tys: Vec, + ) -> Result> { + let mut facts = TypeFact { + contains_ref: false, + }; + let mut missing_info = vec![]; + for child_ty in child_tys { + let Some(child_fact) = this.ty_facts.get(&child_ty) else { + missing_info.push(child_ty); + continue; + }; + let TypeFact { contains_ref } = child_fact; + facts.contains_ref |= contains_ref; + } + + // If everything resolved, great, we're done + if missing_info.is_empty() { + return Ok(Some(facts)); + } + + // Otherwise, restack ourself and the missing children, hopefully by the time + // the children resolve we'll have a definite answer. + // + // However if we *already* restacked ourselves, at this point assume there's + // an infinite type without the proper indirection of a reference! + if already_visited.contains(&cur_ty) { + return Err(KdlScriptTypeError { + message: format!("This type is infinitely recursive without an indirection!"), + src: this.src.clone(), + span: this.span_for_ty_decl(cur_ty), + help: Some("Add a reference (&) somewhere".to_owned()), + })?; + } + already_visited.insert(cur_ty); + to_compute.push(cur_ty); + to_compute.extend(missing_info); + + Ok(None) + } + + while let Some(ty_idx) = to_compute.pop() { + let facts = match self.realize_ty(ty_idx) { + Ty::Primitive(_) => Some(TypeFact { + contains_ref: false, + }), + Ty::Empty => Some(TypeFact { + contains_ref: false, + }), + Ty::Enum(_) => Some(TypeFact { + contains_ref: false, + }), + Ty::Ref(_) => Some(TypeFact { contains_ref: true }), + + Ty::Alias(ty) => { + let child_tys = vec![ty.real]; + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + Ty::Array(ty) => { + let child_tys = vec![ty.elem_ty]; + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + Ty::Struct(ty) => { + let child_tys = ty.fields.iter().map(|f| f.ty).collect(); + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + Ty::Union(ty) => { + let child_tys = ty.fields.iter().map(|f| f.ty).collect(); + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + Ty::Tagged(ty) => { + let child_tys = ty + .variants + .iter() + .flat_map(|v| v.fields.as_deref().unwrap_or_default().iter().map(|f| f.ty)) + .collect(); + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + Ty::Pun(ty) => { + let child_tys = ty.blocks.iter().map(|f| f.real).collect(); + aggregate_facts( + self, + &mut to_compute, + &mut already_visited, + ty_idx, + child_tys, + )? + } + }; + + if let Some(facts) = facts { + self.ty_facts.insert(ty_idx, facts); + } + } + Ok(()) + } + /* pub fn pointee_ty(&self, ty: TyIdx) -> TyIdx { if let Ty::TypedPtr(pointee) = self.realize_ty(ty) { @@ -749,7 +914,20 @@ impl TyCtx { } } */ - + pub fn span_for_ty_decl(&self, ty: TyIdx) -> SourceSpan { + match self.realize_ty(ty) { + Ty::Primitive(_) => SourceSpan::from(1..1), + Ty::Empty => SourceSpan::from(1..1), + Ty::Struct(ty) => Spanned::span(&ty.name), + Ty::Union(ty) => Spanned::span(&ty.name), + Ty::Enum(ty) => Spanned::span(&ty.name), + Ty::Tagged(ty) => Spanned::span(&ty.name), + Ty::Alias(ty) => Spanned::span(&ty.name), + Ty::Pun(ty) => Spanned::span(&ty.name), + Ty::Array(ty) => self.span_for_ty_decl(ty.elem_ty), + Ty::Ref(ty) => self.span_for_ty_decl(ty.pointee_ty), + } + } /// Stringify a type. pub fn format_ty(&self, ty: TyIdx) -> String { match self.realize_ty(ty) { @@ -802,6 +980,10 @@ impl TypedProgram { &self.funcs[func] } + pub fn ty_contains_ref(&self, ty: TyIdx) -> bool { + self.tcx.ty_facts[&ty].contains_ref + } + pub fn all_funcs(&self) -> impl Iterator { 0..self.builtin_funcs_start } @@ -909,7 +1091,29 @@ impl TypedProgram { // Now compute the Strongly Connected Components! // See the comment in `DefinitionGraph::definitions` for details on what this is! - let def_order = petgraph::algo::kosaraju_scc(&graph); + let mut def_order = petgraph::algo::kosaraju_scc(&graph); + + // Further refine the SCC order! + // + // We need all the nominal types to come first. + // This is because the *name* `&MyType` still contains `MyType`, + // so starting the forward declares with it would still refer to an + // undeclared type. Thankfully no such issue exists for starting with + // `MyType`, and all cycles always involve a nominal type! + for component in &mut def_order { + let mut sorted_nodes = std::mem::take(component); + sorted_nodes.sort_by(|&lhs, &rhs| match (&graph[lhs], &graph[rhs]) { + (DefinitionGraphNode::Func(l), DefinitionGraphNode::Func(r)) => l.cmp(r), + (DefinitionGraphNode::Func(_), DefinitionGraphNode::Ty(_)) => Ordering::Less, + (DefinitionGraphNode::Ty(_), DefinitionGraphNode::Func(_)) => Ordering::Greater, + (DefinitionGraphNode::Ty(l), DefinitionGraphNode::Ty(r)) => { + let lty = self.realize_ty(*l); + let rty = self.realize_ty(*r); + rty.is_nominal().cmp(<y.is_nominal()).then(l.cmp(&r)) + } + }); + *component = sorted_nodes; + } Ok(DefinitionGraph { graph, @@ -1007,9 +1211,9 @@ impl DefinitionGraph { // Get all the nodes in this SCC, and filter out the ones not reachable from // the functions we want to emit. (Filtering lets us emit minimal examples for // test failures so it's easy to reproduce/report!) - let nodes = component.iter().filter(|n| reachable.contains(*n)); + let nodes = component.iter().rev().filter(|n| reachable.contains(*n)); - // Emit forward decls for everything but the first node + // Emit forward decls for everything but the first (last) node // Note that this cutely does The Right thing (no forward decl) // for the "happy" case of an SCC of one node (proper DAG). for &node_idx in nodes.clone().skip(1) { diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 3ed75a4..953ae29 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -293,9 +293,11 @@ impl RustcAbiImpl { for def in state.defs.definitions(state.desired_funcs.iter().copied()) { match def { kdl_script::Definition::DeclareTy(ty) => { + debug!("declare ty {}", state.types.format_ty(ty)); self.intern_tyname(state, ty)?; } kdl_script::Definition::DefineTy(ty) => { + debug!("generate ty {}", state.types.format_ty(ty)); self.generate_tydef(f, state, ty)?; } kdl_script::Definition::DefineFunc(_) => { @@ -317,6 +319,7 @@ impl RustcAbiImpl { return Ok(()); } + let has_borrows = state.types.ty_contains_ref(ty); let (tyname, borrowed_tyname) = match state.types.realize_ty(ty) { // Structural types that don't need definitions but we should // intern the name of @@ -373,48 +376,22 @@ impl RustcAbiImpl { Ty::Empty => ("()".to_owned(), None), // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - let has_borrows = struct_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); (struct_ty.name.to_string(), borrowed_tyname) } Ty::Union(union_ty) => { - let has_borrows = union_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); (union_ty.name.to_string(), borrowed_tyname) } Ty::Enum(enum_ty) => ((**enum_ty.name).clone(), None), Ty::Tagged(tagged_ty) => { - let has_borrows = tagged_ty.variants.iter().any(|v| { - v.fields - .as_ref() - .map(|fields| { - fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)) - }) - .unwrap_or(false) - }); let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); (tagged_ty.name.to_string(), borrowed_tyname) } - Ty::Alias(AliasTy { - name, - real, - attrs: _, - }) => { - let borrowed_tyname = state - .borrowed_tynames - .get(real) - .map(|name| format!("{name}<'a>")); - (name.to_string(), borrowed_tyname) + Ty::Alias(alias_ty) => { + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", alias_ty.name)); + (alias_ty.name.to_string(), borrowed_tyname) } - // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); diff --git a/src/procgen.rs b/src/procgen.rs index 8ba67c4..1104a6e 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -1,51 +1,3 @@ -/* -use std::io::Write; -use std::path::PathBuf; - -const PROCGEN_ROOT: &str = "tests/procgen"; - -/// For tests that are too tedious to even hand-write the .ron file, -/// this code generates it programmatically. -/// -/// **NOTE: this is disabled by default, the results are checked in. -/// If you want to regenerate these tests, just remove the early return.** -pub fn procgen_tests(regenerate: bool) { - // Regeneration disabled by default. - if !regenerate { - return; - } - - let proc_gen_root = PathBuf::from(PROCGEN_ROOT); - - // Make sure the path exists, then delete its contents, then recreate the empty dir. - std::fs::create_dir_all(&proc_gen_root).unwrap(); - std::fs::remove_dir_all(&proc_gen_root).unwrap(); - std::fs::create_dir_all(&proc_gen_root).unwrap(); - - let tests = &[ - "i128", "i64", "i32", "i16", "i8", "u128", "u64", "u32", "u16", "u8", "ptr", "bool", "f64", - "f32", - ]; - - for test_name in tests { - procgen_test_for_ty_file(test_name, test_name, None); - } -} - -pub fn procgen_test_for_ty_file( - test_name: &str, - ty_name: &str, - ty_def: Option<&str>, -) -> PathBuf { - let test_body = procgen_test_for_ty_string(ty_name, ty_def); - let proc_gen_root = PathBuf::from(PROCGEN_ROOT); - let filepath = proc_gen_root.join(format!("{test_name}.kdl")); - let mut file = std::fs::File::create(&filepath).unwrap(); - file.write_all(test_body.as_bytes()).unwrap(); - filepath -} -*/ - pub fn procgen_test_for_ty_string(ty_name: &str, ty_def: Option<&str>) -> String { let mut test_body = String::new(); procgen_test_for_ty_impl(&mut test_body, ty_name, ty_def).unwrap(); From bc54161e3b362e2392e0778666d8b63963ced150 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 20:25:18 -0400 Subject: [PATCH 36/44] cleanup --- src/abis/rust.rs | 39 ++++++++------------------------------- src/abis/vals.rs | 9 ++++----- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 953ae29..2cdba3f 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -182,7 +182,7 @@ impl RustcAbiImpl { let mut proper_outputs = function .outputs .iter() - .filter(|arg| !state.borrowed_tynames.contains_key(&arg.ty)); + .filter(|arg| !state.types.ty_contains_ref(arg.ty)); let output = proper_outputs.next(); let too_many_outputs = proper_outputs.next(); if too_many_outputs.is_some() { @@ -200,7 +200,7 @@ impl RustcAbiImpl { let out_params = function .outputs .iter() - .filter(|arg| state.borrowed_tynames.contains_key(&arg.ty)); + .filter(|arg| state.types.ty_contains_ref(arg.ty)); for (arg_idx, arg) in inputs.chain(out_params).enumerate() { if arg_idx > 0 { @@ -297,7 +297,7 @@ impl RustcAbiImpl { self.intern_tyname(state, ty)?; } kdl_script::Definition::DefineTy(ty) => { - debug!("generate ty {}", state.types.format_ty(ty)); + debug!("define ty {}", state.types.format_ty(ty)); self.generate_tydef(f, state, ty)?; } kdl_script::Definition::DefineFunc(_) => { @@ -419,14 +419,10 @@ impl RustcAbiImpl { // Make sure our own name is interned self.intern_tyname(state, ty)?; + let has_borrows = state.types.ty_contains_ref(ty); match state.types.realize_ty(ty) { // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - let has_borrows = struct_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - // Emit an actual struct decl self.repr_attr(f, &struct_ty.attrs, "struct")?; if has_borrows { @@ -448,11 +444,6 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Union(union_ty) => { - let has_borrows = union_ty - .fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)); - // Emit an actual union decl self.repr_attr(f, &union_ty.attrs, "union")?; if has_borrows { @@ -487,17 +478,6 @@ impl RustcAbiImpl { writeln!(f, "}}\n")?; } Ty::Tagged(tagged_ty) => { - let has_borrows = tagged_ty.variants.iter().any(|v| { - v.fields - .as_ref() - .map(|fields| { - fields - .iter() - .any(|field| state.borrowed_tynames.contains_key(&field.ty)) - }) - .unwrap_or(false) - }); - // Emit an actual enum decl self.repr_attr(f, &tagged_ty.attrs, "tagged")?; if has_borrows { @@ -896,7 +876,7 @@ impl RustcAbiImpl { } // Add outparams for arg in &function.outputs { - let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + let is_outparam = state.types.ty_contains_ref(arg.ty); if !is_outparam { // Handled in next loop continue; @@ -914,7 +894,7 @@ impl RustcAbiImpl { // Add normal returns let mut has_normal_return = false; for arg in &function.outputs { - let is_outparam = state.borrowed_tynames.contains_key(&arg.ty); + let is_outparam = state.types.ty_contains_ref(arg.ty); if is_outparam { // Already handled continue; @@ -1203,11 +1183,8 @@ impl RustcAbiImpl { WriteImpl::HarnessCallback => { writeln!(f, "write_field({to}, &{}u32);", u32::MAX)?; } - WriteImpl::Assert => { - unreachable!("enum had unexpected variant!?"); - } - WriteImpl::Print => { - unreachable!("enum had unexpected variant!?"); + WriteImpl::Assert | WriteImpl::Print => { + writeln!(f, r#"unreachable!("enum had unexpected variant!?")"#)?; } WriteImpl::Noop => { // Noop, do nothing diff --git a/src/abis/vals.rs b/src/abis/vals.rs index 36d51d4..0e4623c 100644 --- a/src/abis/vals.rs +++ b/src/abis/vals.rs @@ -410,12 +410,11 @@ impl ValueGenerator { return 0; } let mut rng = match self { - ValueGenerator::Graffiti { .. } => { + ValueGenerator::Graffiti { idx } => { // To turn our pattern value into a fairly evenly distributed selection - // of the possible values in the range, just generate a grafitti u64 and - // use it as the seed for an rng, then ask rand to figure it out! - let seed = self.generate_u64(); - RngImpl::seed_from_u64(seed) + // of the possible values in the range, use the index as a seed. + // This removes some aliasing from if we tried to use the graffiti pattern. + RngImpl::seed_from_u64(*idx) } ValueGenerator::Random { seed } => RngImpl::seed_from_u64(*seed), }; From c8e806bdf9612cb53ddc92a35afe7db864e08702 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 21:49:10 -0400 Subject: [PATCH 37/44] split up rust --- src/abis/rust.rs | 989 ++------------------------------- src/abis/rust/declare.rs | 436 +++++++++++++++ src/abis/rust/init.rs | 246 ++++++++ src/abis/rust/write.rs | 269 +++++++++ tests/normal/IntrusiveList.kdl | 36 ++ 5 files changed, 1020 insertions(+), 956 deletions(-) create mode 100644 src/abis/rust/declare.rs create mode 100644 src/abis/rust/init.rs create mode 100644 src/abis/rust/write.rs create mode 100644 tests/normal/IntrusiveList.kdl diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 2cdba3f..a7c9e08 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -1,20 +1,19 @@ //! Rust(c) codegen backend backend -use std::sync::Arc; +mod declare; +mod init; +mod write; use camino::Utf8Path; -use kdl_script::parse::Attr; -use kdl_script::types::{AliasTy, ArrayTy, Func, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; +use kdl_script::types::{Func, FuncIdx, TyIdx}; use kdl_script::PunEnv; -use tracing::warn; -use vals::{ArgValuesIter, Value}; - -use self::error::GenerateError; +use std::fmt::Write; +use std::sync::Arc; use super::super::*; use super::*; use crate::fivemat::Fivemat; -use std::fmt::Write; +use crate::vals::ArgValuesIter; pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); @@ -164,7 +163,7 @@ impl RustcAbiImpl { } // Report the function is complete - self.end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; + self.write_end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; f.sub_indent(1); writeln!(f, "}}")?; Ok(()) @@ -178,31 +177,17 @@ impl RustcAbiImpl { ) -> Result<(), GenerateError> { let func_name = &function.name; - // if there's an output, bind it - let mut proper_outputs = function - .outputs - .iter() - .filter(|arg| !state.types.ty_contains_ref(arg.ty)); - let output = proper_outputs.next(); - let too_many_outputs = proper_outputs.next(); - if too_many_outputs.is_some() { - return Err(UnsupportedError::Other( - "multiple normal returns (should this be a tuple?)".to_owned(), - ))?; - } - if let Some(output) = output { + // make sure the outputs aren't weird + self.check_returns(state, function)?; + if let Some(output) = function.outputs.first() { write!(f, "let {} = ", output.name)?; } // Call the function write!(f, "{func_name}(")?; let inputs = function.inputs.iter(); - let out_params = function - .outputs - .iter() - .filter(|arg| state.types.ty_contains_ref(arg.ty)); - for (arg_idx, arg) in inputs.chain(out_params).enumerate() { + for (arg_idx, arg) in inputs.enumerate() { if arg_idx > 0 { write!(f, ", ")?; } @@ -245,6 +230,7 @@ impl RustcAbiImpl { f.add_indent(1); writeln!(f, "unsafe {{")?; f.add_indent(1); + // Report the inputs let mut func_vals = state.vals.at_func(func); for arg in &function.inputs { @@ -261,9 +247,10 @@ impl RustcAbiImpl { } // Report the function is complete - self.end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; + self.write_end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; // Return the outputs + self.check_returns(state, function)?; for arg in function.outputs.iter() { self.return_var(f, state, &arg.name, arg.ty)?; } @@ -283,934 +270,6 @@ impl RustcAbiImpl { } } - pub fn generate_definitions( - &self, - f: &mut Fivemat, - state: &mut TestImpl, - ) -> Result<(), GenerateError> { - self.write_harness_prefix(f, state)?; - - for def in state.defs.definitions(state.desired_funcs.iter().copied()) { - match def { - kdl_script::Definition::DeclareTy(ty) => { - debug!("declare ty {}", state.types.format_ty(ty)); - self.intern_tyname(state, ty)?; - } - kdl_script::Definition::DefineTy(ty) => { - debug!("define ty {}", state.types.format_ty(ty)); - self.generate_tydef(f, state, ty)?; - } - kdl_script::Definition::DefineFunc(_) => { - // we'd buffer these up to generate them all at the end, - // but we've already got them buffered, so... do nothing. - } - kdl_script::Definition::DeclareFunc(_) => { - // nothing to do, executable kdl-script isn't real and can't hurt us - } - } - } - - Ok(()) - } - - pub fn intern_tyname(&self, state: &mut TestImpl, ty: TyIdx) -> Result<(), GenerateError> { - // Don't double-intern - if state.tynames.contains_key(&ty) { - return Ok(()); - } - - let has_borrows = state.types.ty_contains_ref(ty); - let (tyname, borrowed_tyname) = match state.types.realize_ty(ty) { - // Structural types that don't need definitions but we should - // intern the name of - Ty::Primitive(prim) => { - let name = match prim { - PrimitiveTy::I8 => "i8", - PrimitiveTy::I16 => "i16", - PrimitiveTy::I32 => "i32", - PrimitiveTy::I64 => "i64", - PrimitiveTy::I128 => "i128", - PrimitiveTy::U8 => "u8", - PrimitiveTy::U16 => "u16", - PrimitiveTy::U32 => "u32", - PrimitiveTy::U64 => "u64", - PrimitiveTy::U128 => "u128", - PrimitiveTy::F32 => "f32", - PrimitiveTy::F64 => "f64", - PrimitiveTy::Bool => "bool", - PrimitiveTy::Ptr => "*mut ()", - PrimitiveTy::I256 => { - Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? - } - PrimitiveTy::U256 => { - Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? - } - PrimitiveTy::F16 => { - Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? - } - PrimitiveTy::F128 => { - Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? - } - }; - (name.to_owned(), None) - } - Ty::Array(ArrayTy { elem_ty, len }) => { - let elem_tyname = &state.tynames[elem_ty]; - let borrowed_tyname = state - .borrowed_tynames - .get(elem_ty) - .map(|elem_tyname| format!("[{elem_tyname}; {len}]")); - (format!("[{elem_tyname}; {len}]"), borrowed_tyname) - } - Ty::Ref(RefTy { pointee_ty }) => { - let pointee_tyname = &state.tynames[pointee_ty]; - let borrowed_pointee_tyname = state - .borrowed_tynames - .get(pointee_ty) - .unwrap_or(pointee_tyname); - ( - format!("&mut {pointee_tyname}"), - Some(format!("&'a mut {borrowed_pointee_tyname}")), - ) - } - Ty::Empty => ("()".to_owned(), None), - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); - (struct_ty.name.to_string(), borrowed_tyname) - } - Ty::Union(union_ty) => { - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); - (union_ty.name.to_string(), borrowed_tyname) - } - Ty::Enum(enum_ty) => ((**enum_ty.name).clone(), None), - Ty::Tagged(tagged_ty) => { - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); - (tagged_ty.name.to_string(), borrowed_tyname) - } - Ty::Alias(alias_ty) => { - let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", alias_ty.name)); - (alias_ty.name.to_string(), borrowed_tyname) - } - // Puns should be evaporated - Ty::Pun(pun) => { - let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - ( - state.tynames[&real_ty].clone(), - state.borrowed_tynames.get(&real_ty).cloned(), - ) - } - }; - - state.tynames.insert(ty, tyname); - if let Some(borrowed) = borrowed_tyname { - state.borrowed_tynames.insert(ty, borrowed); - } - - Ok(()) - } - - pub fn generate_tydef( - &self, - f: &mut Fivemat, - state: &mut TestImpl, - ty: TyIdx, - ) -> Result<(), GenerateError> { - // Make sure our own name is interned - self.intern_tyname(state, ty)?; - - let has_borrows = state.types.ty_contains_ref(ty); - match state.types.realize_ty(ty) { - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - // Emit an actual struct decl - self.repr_attr(f, &struct_ty.attrs, "struct")?; - if has_borrows { - writeln!(f, "struct {}<'a> {{", struct_ty.name)?; - } else { - writeln!(f, "#[derive(Copy, Clone)]")?; - writeln!(f, "struct {} {{", struct_ty.name)?; - } - f.add_indent(1); - for field in &struct_ty.fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Union(union_ty) => { - // Emit an actual union decl - self.repr_attr(f, &union_ty.attrs, "union")?; - if has_borrows { - writeln!(f, "union {}<'a> {{", union_ty.name)?; - } else { - writeln!(f, "#[derive(Copy, Clone)]")?; - writeln!(f, "union {} {{", union_ty.name)?; - } - f.add_indent(1); - for field in &union_ty.fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Enum(enum_ty) => { - // Emit an actual enum decl - self.repr_attr(f, &enum_ty.attrs, "enum")?; - writeln!(f, "#[derive(Debug, Copy, Clone, PartialEq)]")?; - writeln!(f, "enum {} {{", enum_ty.name)?; - f.add_indent(1); - for variant in &enum_ty.variants { - let variant_name = &variant.name; - writeln!(f, "{variant_name},")?; - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Tagged(tagged_ty) => { - // Emit an actual enum decl - self.repr_attr(f, &tagged_ty.attrs, "tagged")?; - if has_borrows { - writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; - } else { - writeln!(f, "#[derive(Copy, Clone)]")?; - writeln!(f, "enum {} {{", tagged_ty.name)?; - } - f.add_indent(1); - for variant in &tagged_ty.variants { - let variant_name = &variant.name; - if let Some(fields) = &variant.fields { - writeln!(f, "{variant_name} {{")?; - f.add_indent(1); - for field in fields { - let field_name = &field.ident; - let field_tyname = state - .borrowed_tynames - .get(&field.ty) - .unwrap_or(&state.tynames[&field.ty]); - writeln!(f, "{field_name}: {field_tyname},")?; - } - f.sub_indent(1); - writeln!(f, "}},")?; - } else { - writeln!(f, "{variant_name},")?; - } - } - f.sub_indent(1); - writeln!(f, "}}\n")?; - } - Ty::Alias(AliasTy { name, real, attrs }) => { - if !attrs.is_empty() { - return Err(UnsupportedError::Other( - "don't yet know how to apply attrs to aliases".to_string(), - ))?; - } - - // Emit an actual type alias decl - if let Some(real_tyname) = state.borrowed_tynames.get(real) { - writeln!(f, "type {name}<'a> = {real_tyname};\n")?; - } else { - let real_tyname = &state.tynames[&real]; - writeln!(f, "type {name} = {real_tyname};\n")?; - } - } - Ty::Pun(..) => { - // Puns should be evaporated by the type name interner - } - Ty::Primitive(prim) => { - match prim { - PrimitiveTy::I8 - | PrimitiveTy::I16 - | PrimitiveTy::I32 - | PrimitiveTy::I64 - | PrimitiveTy::I128 - | PrimitiveTy::I256 - | PrimitiveTy::U8 - | PrimitiveTy::U16 - | PrimitiveTy::U32 - | PrimitiveTy::U64 - | PrimitiveTy::U128 - | PrimitiveTy::U256 - | PrimitiveTy::F16 - | PrimitiveTy::F32 - | PrimitiveTy::F64 - | PrimitiveTy::F128 - | PrimitiveTy::Bool - | PrimitiveTy::Ptr => { - // Builtin - } - }; - } - Ty::Array(ArrayTy { .. }) => { - // Builtin - } - Ty::Ref(RefTy { .. }) => { - // Builtin - } - Ty::Empty => { - // Builtin - } - } - Ok(()) - } - - fn repr_attr( - &self, - f: &mut Fivemat, - attrs: &[Attr], - ty_style: &str, - ) -> Result<(), GenerateError> { - let mut repr_attrs = vec![]; - let mut packed = false; - for attr in attrs { - match attr { - Attr::Derive(attr) => { - return Err(UnsupportedError::Other(format!( - "derive attr not supported {attr:?}" - )))?; - } - Attr::Packed(_) => { - packed = true; - } - Attr::Passthrough(attr) => { - warn!("found passthrough attr on {ty_style}, assuming repr(transparent)"); - repr_attrs.push("transparent"); - } - } - } - if repr_attrs.is_empty() { - repr_attrs.push("C"); - } - if packed { - repr_attrs.push("packed"); - } - if !repr_attrs.is_empty() { - write!(f, "#[repr(")?; - let mut multi = false; - for repr in repr_attrs { - if multi { - write!(f, ", ")?; - } - multi = true; - write!(f, "{repr}")?; - } - writeln!(f, ")]")?; - } - Ok(()) - } - - pub fn generate_leaf_value( - &self, - f: &mut Fivemat, - state: &TestImpl, - ty: TyIdx, - val: &Value, - alias: Option<&str>, - ) -> Result<(), GenerateError> { - match state.types.realize_ty(ty) { - // Primitives are the only "real" values with actual bytes that advance val_idx - Ty::Primitive(prim) => match prim { - PrimitiveTy::I8 => write!(f, "{}i8", val.generate_i8())?, - PrimitiveTy::I16 => write!(f, "{}i16", val.generate_i16())?, - PrimitiveTy::I32 => write!(f, "{}i32", val.generate_i32())?, - PrimitiveTy::I64 => write!(f, "{}i64", val.generate_i64())?, - PrimitiveTy::I128 => write!(f, "{}i128", val.generate_i128())?, - PrimitiveTy::U8 => write!(f, "{}u8", val.generate_u8())?, - PrimitiveTy::U16 => write!(f, "{}u16", val.generate_u16())?, - PrimitiveTy::U32 => write!(f, "{}u32", val.generate_u32())?, - PrimitiveTy::U64 => write!(f, "{}u64", val.generate_u64())?, - PrimitiveTy::U128 => write!(f, "{}u128", val.generate_u128())?, - - PrimitiveTy::F32 => write!(f, "f32::from_bits({})", val.generate_u32())?, - PrimitiveTy::F64 => write!(f, "f64::from_bits({})", val.generate_u64())?, - PrimitiveTy::Bool => write!(f, "true")?, - PrimitiveTy::Ptr => { - if true { - write!(f, "{:#X}u64 as *mut ()", val.generate_u64())? - } else { - write!(f, "{:#X}u32 as *mut ()", val.generate_u32())? - } - } - PrimitiveTy::I256 => { - Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? - } - PrimitiveTy::U256 => { - Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? - } - PrimitiveTy::F16 => { - Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? - } - PrimitiveTy::F128 => { - Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? - } - }, - Ty::Enum(enum_ty) => { - let name = alias.unwrap_or(&enum_ty.name); - if let Some(variant) = val.select_val(&enum_ty.variants) { - let variant_name = &variant.name; - write!(f, "{name}::{variant_name}")?; - } - } - _ => unreachable!("only primitives and enums should be passed to generate_leaf_value"), - } - Ok(()) - } - - #[allow(clippy::too_many_arguments)] - pub fn generate_value( - &self, - f: &mut Fivemat, - state: &TestImpl, - ty: TyIdx, - vals: &mut ArgValuesIter, - alias: Option<&str>, - ref_temp_name: &str, - extra_decls: &mut Vec, - ) -> Result<(), GenerateError> { - match state.types.realize_ty(ty) { - // Primitives and Enums are the only "real" values with actual bytes - Ty::Primitive(_) | Ty::Enum(_) => { - let val = vals.next_val(); - self.generate_leaf_value(f, state, ty, &val, alias)?; - } - Ty::Empty => { - write!(f, "()")?; - } - Ty::Ref(RefTy { pointee_ty }) => { - // The value is a mutable reference to a temporary - write!(f, "&mut {ref_temp_name}")?; - - // TODO: should this be a recursive call to create_var (need create_var_inner?) - // Now do the rest of the recursion on constructing the temporary - let mut ref_temp = String::new(); - let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); - write!(&mut ref_temp_f, "let mut {ref_temp_name} = ")?; - let ref_temp_name = format!("{ref_temp_name}_"); - self.generate_value( - &mut ref_temp_f, - state, - *pointee_ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; - write!(&mut ref_temp_f, ";")?; - extra_decls.push(ref_temp); - } - Ty::Array(ArrayTy { elem_ty, len }) => { - write!(f, "[")?; - for arr_idx in 0..*len { - if arr_idx > 0 { - write!(f, ", ")?; - } - let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); - self.generate_value( - f, - state, - *elem_ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, "]")?; - } - // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => { - let name = alias.unwrap_or(&struct_ty.name); - write!(f, "{name} {{ ")?; - for (field_idx, field) in struct_ty.fields.iter().enumerate() { - if field_idx > 0 { - write!(f, ", ")?; - } - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - Ty::Union(union_ty) => { - let name = alias.unwrap_or(&union_ty.name); - write!(f, "{name} {{ ")?; - let tag_val = vals.next_val(); - if let Some(field) = tag_val.select_val(&union_ty.fields) { - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - - Ty::Tagged(tagged_ty) => { - let name = alias.unwrap_or(&tagged_ty.name); - let tag_val = vals.next_val(); - if let Some(variant) = tag_val.select_val(&tagged_ty.variants) { - let variant_name = &variant.name; - write!(f, "{name}::{variant_name}")?; - if let Some(fields) = &variant.fields { - write!(f, " {{ ")?; - for (field_idx, field) in fields.iter().enumerate() { - if field_idx > 0 { - write!(f, ", ")?; - } - let field_name = &field.ident; - write!(f, "{field_name}: ")?; - let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; - } - write!(f, " }}")?; - } - } - } - Ty::Alias(AliasTy { real, name, .. }) => { - let alias = alias.or_else(|| Some(name)); - self.generate_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; - } - - // Puns should be evaporated - Ty::Pun(pun) => { - let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - self.generate_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; - } - }; - - Ok(()) - } - - fn convention_decl( - &self, - convention: CallingConvention, - ) -> Result<&'static str, GenerateError> { - let conv = match convention { - CallingConvention::C => "C", - CallingConvention::Cdecl => "cdecl", - CallingConvention::System => "system", - CallingConvention::Win64 => "win64", - CallingConvention::Sysv64 => "sysv64", - CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", - CallingConvention::Vectorcall => { - return Err(UnsupportedError::Other( - "vectorcall is an unstable rust feature".to_owned(), - ))? - } - }; - Ok(conv) - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_harness_prefix(&self, f: &mut Fivemat, state: &TestImpl) -> Result<(), GenerateError> { - // No extra harness gunk if not needed - if state.options.val_writer != WriteImpl::HarnessCallback { - return Ok(()); - } - if state.options.convention == CallingConvention::Vectorcall { - writeln!(f, "#![feature(abi_vectorcall)]")?; - } - // Load test harness "headers" - writeln!(f, "{}", RUST_TEST_PREFIX)?; - writeln!(f)?; - - Ok(()) - } - - fn generate_signature( - &self, - f: &mut Fivemat, - state: &TestImpl, - func: FuncIdx, - ) -> Result<(), GenerateError> { - let function = state.types.realize_func(func); - - write!(f, "fn {}(", function.name)?; - let mut multiarg = false; - // Add inputs - for arg in &function.inputs { - if multiarg { - write!(f, ", ")?; - } - multiarg = true; - let arg_name = &arg.name; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}", arg_name, arg_ty)?; - } - // Add outparams - for arg in &function.outputs { - let is_outparam = state.types.ty_contains_ref(arg.ty); - if !is_outparam { - // Handled in next loop - continue; - } - if multiarg { - write!(f, ", ")?; - } - multiarg = true; - // NOTE: we intentionally don't use the "borrowed" tyname - // as we still don't need lifetimes here! - let arg_name = &arg.name; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}", arg_name, arg_ty)?; - } - // Add normal returns - let mut has_normal_return = false; - for arg in &function.outputs { - let is_outparam = state.types.ty_contains_ref(arg.ty); - if is_outparam { - // Already handled - continue; - } - if has_normal_return { - return Err(UnsupportedError::Other( - "multiple normal returns (should this be a tuple?)".to_owned(), - ))?; - } - has_normal_return = true; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, ") -> {}", arg_ty)?; - } - if !has_normal_return { - write!(f, ")")?; - } - Ok(()) - } - - fn create_var( - &self, - f: &mut Fivemat, - state: &TestImpl, - var_name: &str, - var_ty: TyIdx, - mut vals: ArgValuesIter, - ) -> Result<(), GenerateError> { - // Generate the input - let needs_mut = false; - let let_mut = if needs_mut { "let mut" } else { "let" }; - let mut real_var_decl = String::new(); - let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); - let mut extra_decls = Vec::new(); - write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; - let ref_temp_name = format!("{var_name}_"); - self.generate_value( - &mut real_var_decl_f, - state, - var_ty, - &mut vals, - None, - &ref_temp_name, - &mut extra_decls, - )?; - writeln!(&mut real_var_decl, ";")?; - - for decl in extra_decls { - writeln!(f, "{}", decl)?; - } - writeln!(f, "{}", real_var_decl)?; - Ok(()) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn write_var( - &self, - f: &mut Fivemat, - state: &TestImpl, - var_name: &str, - var_ty: TyIdx, - mut vals: ArgValuesIter, - to: &str, - ) -> Result<(), GenerateError> { - // If we're generating a minimized test, skip this - if !vals.should_write_arg(&state.options) { - return Ok(()); - } - // If noop, don't bother doing anything (avoids tagged union matches being generated) - if let WriteImpl::Noop = state.options.val_writer { - return Ok(()); - }; - self.write_fields(f, state, to, var_name, var_ty, &mut vals)?; - - // If doing full harness callbacks, signal we wrote all the fields of a variable - if let WriteImpl::HarnessCallback = state.options.val_writer { - writeln!(f, "finished_val({to});")?; - writeln!(f)?; - } - Ok(()) - } - - /// Recursive subroutine of write_var, which builds up rvalue paths and generates - /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. - fn write_fields( - &self, - f: &mut Fivemat, - state: &TestImpl, - to: &str, - from: &str, - var_ty: TyIdx, - vals: &mut ArgValuesIter, - ) -> Result<(), GenerateError> { - match state.types.realize_ty(var_ty) { - Ty::Primitive(_) | Ty::Enum(_) => { - // Hey an actual leaf, report it (and burn a value) - let val = vals.next_val(); - if val.should_write_val(&state.options) { - self.write_leaf_field(f, state, to, from, &val)?; - } - } - Ty::Empty => { - // nothing worth producing - } - Ty::Alias(alias_ty) => { - // keep going but with the type changed - self.write_fields(f, state, to, from, alias_ty.real, vals)?; - } - Ty::Pun(pun) => { - // keep going but with the type changed - let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - self.write_fields(f, state, to, from, real_ty, vals)? - } - Ty::Array(array_ty) => { - // recurse into each array index - for i in 0..array_ty.len { - let base = format!("{from}[{i}]"); - self.write_fields(f, state, to, &base, array_ty.elem_ty, vals)?; - } - } - Ty::Struct(struct_ty) => { - // recurse into each field - for field in &struct_ty.fields { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty, vals)?; - } - } - Ty::Tagged(tagged_ty) => { - // Process the implicit "tag" value - let tag_generator = vals.next_val(); - let tag_idx = tag_generator.generate_idx(tagged_ty.variants.len()); - if let Some(variant) = tagged_ty.variants.get(tag_idx) { - let tagged_name = &tagged_ty.name; - let variant_name = &variant.name; - let pat = match &variant.fields { - Some(fields) => { - // Variant with fields, recurse into them - let field_list = fields - .iter() - .map(|f| f.ident.to_string()) - .collect::>() - .join(", "); - format!("{tagged_name}::{variant_name} {{ {field_list} }}") - } - None => { - // Variant without fields, still need the pattern to check the tag - format!("{tagged_name}::{variant_name}") - } - }; - - // We're going to make an if-let for the case we expect, but there might not - // be anything we care about in here (especially with should_write_val) so we - // buffer up if and else branches and then only emit the if-let if one of them - // is non-empty - let if_branch = { - let mut temp_out = String::new(); - let f = &mut Fivemat::new(&mut temp_out, INDENT); - f.add_indent(1); - if tag_generator.should_write_val(&state.options) { - self.write_tag_field(f, state, to, tag_idx)?; - } - if let Some(fields) = &variant.fields { - for field in fields { - // Do the ugly deref thing to deal with pattern autoref - let base = format!("(*{})", field.ident); - self.write_fields(f, state, to, &base, field.ty, vals)?; - } - } - f.sub_indent(1); - temp_out - }; - // Add an else case to complain that the variant is wrong - let else_branch = { - let mut temp_out = String::new(); - let f = &mut Fivemat::new(&mut temp_out, INDENT); - f.add_indent(1); - if tag_generator.should_write_val(&state.options) { - self.error_tag_field(f, state, to)?; - } - f.sub_indent(1); - temp_out - }; - - let if_has_content = !if_branch.trim().is_empty(); - let else_has_content = !else_branch.trim().is_empty(); - if if_has_content || else_has_content { - writeln!(f, "if let {pat} = &{from} {{")?; - write!(f, "{}", if_branch)?; - write!(f, "}}")?; - } - if else_has_content { - writeln!(f, " else {{")?; - write!(f, "{}", else_branch)?; - writeln!(f, "}}")?; - } - } - } - Ty::Ref(ref_ty) => { - // Add a deref, and recurse into the pointee - let base = format!("(*{from})"); - self.write_fields(f, state, to, &base, ref_ty.pointee_ty, vals)? - } - Ty::Union(union_ty) => { - // Process the implicit "tag" value - let tag_generator = vals.next_val(); - let tag_idx = tag_generator.generate_idx(union_ty.fields.len()); - if tag_generator.should_write_val(&state.options) { - self.write_tag_field(f, state, to, tag_idx)?; - } - if let Some(field) = union_ty.fields.get(tag_idx) { - let field_name = &field.ident; - let base = format!("{from}.{field_name}"); - self.write_fields(f, state, to, &base, field.ty, vals)?; - } - } - }; - Ok(()) - } - - /// WRITE an actual indivisible value (primitive or c-like enum) - fn write_leaf_field( - &self, - f: &mut Fivemat, - state: &TestImpl, - to: &str, - path: &str, - val: &Value, - ) -> Result<(), GenerateError> { - match state.options.val_writer { - WriteImpl::HarnessCallback => { - // Convenience for triggering test failures - if path.contains("abicafepoison") && to.contains(VAR_CALLEE_INPUTS) { - writeln!(f, "write_field({to}, &0x12345678u32);")?; - } else { - writeln!(f, "write_field({to}, &{path});")?; - } - } - WriteImpl::Assert => { - write!(f, "assert_eq!({path}, ")?; - self.generate_leaf_value(f, state, val.ty, val, None)?; - writeln!(f, ");")?; - } - WriteImpl::Print => { - writeln!(f, "println!(\"{{:?}}\", {path});")?; - } - WriteImpl::Noop => { - // Noop, do nothing - } - } - Ok(()) - } - - fn write_tag_field( - &self, - f: &mut Fivemat, - state: &TestImpl, - to: &str, - variant_idx: usize, - ) -> Result<(), GenerateError> { - match state.options.val_writer { - WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, &{}u32);", variant_idx)?; - } - WriteImpl::Assert => { - // Noop, do nothing - } - WriteImpl::Print => { - // Noop, do nothing - } - WriteImpl::Noop => { - // Noop, do nothing - } - } - Ok(()) - } - - fn error_tag_field( - &self, - f: &mut Fivemat, - state: &TestImpl, - to: &str, - ) -> Result<(), GenerateError> { - match state.options.val_writer { - WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, &{}u32);", u32::MAX)?; - } - WriteImpl::Assert | WriteImpl::Print => { - writeln!(f, r#"unreachable!("enum had unexpected variant!?")"#)?; - } - WriteImpl::Noop => { - // Noop, do nothing - } - } - Ok(()) - } - - fn end_function( - &self, - f: &mut dyn Write, - state: &TestImpl, - inputs: &str, - outputs: &str, - ) -> Result<(), GenerateError> { - match state.options.val_writer { - WriteImpl::HarnessCallback => { - writeln!(f, "finished_func({inputs}, {outputs});")?; - } - WriteImpl::Print | WriteImpl::Noop | WriteImpl::Assert => { - // Noop - } - } - Ok(()) - } - fn pass_var( &self, f: &mut dyn Write, @@ -1233,4 +292,22 @@ impl RustcAbiImpl { writeln!(f, "{var_name}")?; Ok(()) } + + fn check_returns(&self, state: &TestImpl, function: &Func) -> Result<(), GenerateError> { + let has_outparams = function + .outputs + .iter() + .any(|arg| state.types.ty_contains_ref(arg.ty)); + if has_outparams { + return Err(UnsupportedError::Other( + "outparams (outputs containing references) aren't supported".to_owned(), + ))?; + } + if function.outputs.len() > 1 { + return Err(UnsupportedError::Other( + "multiple returns (should this be a struct?)".to_owned(), + ))?; + } + Ok(()) + } } diff --git a/src/abis/rust/declare.rs b/src/abis/rust/declare.rs new file mode 100644 index 0000000..a091888 --- /dev/null +++ b/src/abis/rust/declare.rs @@ -0,0 +1,436 @@ +use super::*; +use kdl_script::parse::Attr; +use kdl_script::types::{AliasTy, ArrayTy, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; +use std::fmt::Write; +use tracing::warn; + +impl RustcAbiImpl { + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + pub fn write_harness_prefix( + &self, + f: &mut Fivemat, + state: &TestImpl, + ) -> Result<(), GenerateError> { + // No extra harness gunk if not needed + if state.options.val_writer != WriteImpl::HarnessCallback { + return Ok(()); + } + if state.options.convention == CallingConvention::Vectorcall { + writeln!(f, "#![feature(abi_vectorcall)]")?; + } + // Load test harness "headers" + writeln!(f, "{}", RUST_TEST_PREFIX)?; + writeln!(f)?; + + Ok(()) + } + + pub fn generate_definitions( + &self, + f: &mut Fivemat, + state: &mut TestImpl, + ) -> Result<(), GenerateError> { + self.write_harness_prefix(f, state)?; + + for def in state.defs.definitions(state.desired_funcs.iter().copied()) { + match def { + kdl_script::Definition::DeclareTy(ty) => { + debug!("declare ty {}", state.types.format_ty(ty)); + self.intern_tyname(state, ty)?; + } + kdl_script::Definition::DefineTy(ty) => { + debug!("define ty {}", state.types.format_ty(ty)); + self.generate_tydef(f, state, ty)?; + } + kdl_script::Definition::DefineFunc(_) => { + // we'd buffer these up to generate them all at the end, + // but we've already got them buffered, so... do nothing. + } + kdl_script::Definition::DeclareFunc(_) => { + // nothing to do, executable kdl-script isn't real and can't hurt us + } + } + } + + Ok(()) + } + + pub fn intern_tyname(&self, state: &mut TestImpl, ty: TyIdx) -> Result<(), GenerateError> { + // Don't double-intern + if state.tynames.contains_key(&ty) { + return Ok(()); + } + + let has_borrows = state.types.ty_contains_ref(ty); + let (tyname, borrowed_tyname) = match state.types.realize_ty(ty) { + // Structural types that don't need definitions but we should + // intern the name of + Ty::Primitive(prim) => { + let name = match prim { + PrimitiveTy::I8 => "i8", + PrimitiveTy::I16 => "i16", + PrimitiveTy::I32 => "i32", + PrimitiveTy::I64 => "i64", + PrimitiveTy::I128 => "i128", + PrimitiveTy::U8 => "u8", + PrimitiveTy::U16 => "u16", + PrimitiveTy::U32 => "u32", + PrimitiveTy::U64 => "u64", + PrimitiveTy::U128 => "u128", + PrimitiveTy::F32 => "f32", + PrimitiveTy::F64 => "f64", + PrimitiveTy::Bool => "bool", + PrimitiveTy::Ptr => "*mut ()", + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? + } + PrimitiveTy::F16 => { + Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? + } + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? + } + }; + (name.to_owned(), None) + } + Ty::Array(ArrayTy { elem_ty, len }) => { + let elem_tyname = &state.tynames[elem_ty]; + let borrowed_tyname = state + .borrowed_tynames + .get(elem_ty) + .map(|elem_tyname| format!("[{elem_tyname}; {len}]")); + (format!("[{elem_tyname}; {len}]"), borrowed_tyname) + } + Ty::Ref(RefTy { pointee_ty }) => { + let pointee_tyname = &state.tynames[pointee_ty]; + let borrowed_pointee_tyname = state + .borrowed_tynames + .get(pointee_ty) + .unwrap_or(pointee_tyname); + ( + format!("&mut {pointee_tyname}"), + Some(format!("&'a mut {borrowed_pointee_tyname}")), + ) + } + Ty::Empty => ("()".to_owned(), None), + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", struct_ty.name)); + (struct_ty.name.to_string(), borrowed_tyname) + } + Ty::Union(union_ty) => { + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", union_ty.name)); + (union_ty.name.to_string(), borrowed_tyname) + } + Ty::Enum(enum_ty) => ((**enum_ty.name).clone(), None), + Ty::Tagged(tagged_ty) => { + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", tagged_ty.name)); + (tagged_ty.name.to_string(), borrowed_tyname) + } + Ty::Alias(alias_ty) => { + let borrowed_tyname = has_borrows.then(|| format!("{}<'a>", alias_ty.name)); + (alias_ty.name.to_string(), borrowed_tyname) + } + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + ( + state.tynames[&real_ty].clone(), + state.borrowed_tynames.get(&real_ty).cloned(), + ) + } + }; + + state.tynames.insert(ty, tyname); + if let Some(borrowed) = borrowed_tyname { + state.borrowed_tynames.insert(ty, borrowed); + } + + Ok(()) + } + + pub fn generate_tydef( + &self, + f: &mut Fivemat, + state: &mut TestImpl, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Make sure our own name is interned + self.intern_tyname(state, ty)?; + + let has_borrows = state.types.ty_contains_ref(ty); + match state.types.realize_ty(ty) { + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + // Emit an actual struct decl + self.generate_repr_attr(f, &struct_ty.attrs, "struct")?; + if has_borrows { + writeln!(f, "struct {}<'a> {{", struct_ty.name)?; + } else { + writeln!(f, "#[derive(Copy, Clone)]")?; + writeln!(f, "struct {} {{", struct_ty.name)?; + } + f.add_indent(1); + for field in &struct_ty.fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; + } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Union(union_ty) => { + // Emit an actual union decl + self.generate_repr_attr(f, &union_ty.attrs, "union")?; + if has_borrows { + writeln!(f, "union {}<'a> {{", union_ty.name)?; + } else { + writeln!(f, "#[derive(Copy, Clone)]")?; + writeln!(f, "union {} {{", union_ty.name)?; + } + f.add_indent(1); + for field in &union_ty.fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; + } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Enum(enum_ty) => { + // Emit an actual enum decl + self.generate_repr_attr(f, &enum_ty.attrs, "enum")?; + writeln!(f, "#[derive(Debug, Copy, Clone, PartialEq)]")?; + writeln!(f, "enum {} {{", enum_ty.name)?; + f.add_indent(1); + for variant in &enum_ty.variants { + let variant_name = &variant.name; + writeln!(f, "{variant_name},")?; + } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Tagged(tagged_ty) => { + // Emit an actual enum decl + self.generate_repr_attr(f, &tagged_ty.attrs, "tagged")?; + if has_borrows { + writeln!(f, "enum {}<'a> {{", tagged_ty.name)?; + } else { + writeln!(f, "#[derive(Copy, Clone)]")?; + writeln!(f, "enum {} {{", tagged_ty.name)?; + } + f.add_indent(1); + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + if let Some(fields) = &variant.fields { + writeln!(f, "{variant_name} {{")?; + f.add_indent(1); + for field in fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; + } + f.sub_indent(1); + writeln!(f, "}},")?; + } else { + writeln!(f, "{variant_name},")?; + } + } + f.sub_indent(1); + writeln!(f, "}}\n")?; + } + Ty::Alias(AliasTy { name, real, attrs }) => { + if !attrs.is_empty() { + return Err(UnsupportedError::Other( + "don't yet know how to apply attrs to aliases".to_string(), + ))?; + } + + // Emit an actual type alias decl + if let Some(real_tyname) = state.borrowed_tynames.get(real) { + writeln!(f, "type {name}<'a> = {real_tyname};\n")?; + } else { + let real_tyname = &state.tynames[&real]; + writeln!(f, "type {name} = {real_tyname};\n")?; + } + } + Ty::Pun(..) => { + // Puns should be evaporated by the type name interner + } + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 + | PrimitiveTy::I16 + | PrimitiveTy::I32 + | PrimitiveTy::I64 + | PrimitiveTy::I128 + | PrimitiveTy::I256 + | PrimitiveTy::U8 + | PrimitiveTy::U16 + | PrimitiveTy::U32 + | PrimitiveTy::U64 + | PrimitiveTy::U128 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + // Builtin + } + }; + } + Ty::Array(ArrayTy { .. }) => { + // Builtin + } + Ty::Ref(RefTy { .. }) => { + // Builtin + } + Ty::Empty => { + // Builtin + } + } + Ok(()) + } + + pub fn generate_repr_attr( + &self, + f: &mut Fivemat, + attrs: &[Attr], + ty_style: &str, + ) -> Result<(), GenerateError> { + let mut repr_attrs = vec![]; + let mut packed = false; + for attr in attrs { + match attr { + Attr::Derive(attr) => { + return Err(UnsupportedError::Other(format!( + "derive attr not supported {attr:?}" + )))?; + } + Attr::Packed(_) => { + packed = true; + } + Attr::Passthrough(attr) => { + warn!("found passthrough attr on {ty_style}, assuming repr(transparent)"); + repr_attrs.push("transparent"); + } + } + } + if repr_attrs.is_empty() { + repr_attrs.push("C"); + } + if packed { + repr_attrs.push("packed"); + } + if !repr_attrs.is_empty() { + write!(f, "#[repr(")?; + let mut multi = false; + for repr in repr_attrs { + if multi { + write!(f, ", ")?; + } + multi = true; + write!(f, "{repr}")?; + } + writeln!(f, ")]")?; + } + Ok(()) + } + + pub fn generate_signature( + &self, + f: &mut Fivemat, + state: &TestImpl, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.types.realize_func(func); + + write!(f, "fn {}(", function.name)?; + let mut multiarg = false; + // Add inputs + for arg in &function.inputs { + if multiarg { + write!(f, ", ")?; + } + multiarg = true; + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}", arg_name, arg_ty)?; + } + // Add outparams + for arg in &function.outputs { + let is_outparam = state.types.ty_contains_ref(arg.ty); + if !is_outparam { + // Handled in next loop + continue; + } + if multiarg { + write!(f, ", ")?; + } + multiarg = true; + // NOTE: we intentionally don't use the "borrowed" tyname + // as we still don't need lifetimes here! + let arg_name = &arg.name; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, "{}: {}", arg_name, arg_ty)?; + } + // Add normal returns + let mut has_normal_return = false; + for arg in &function.outputs { + let is_outparam = state.types.ty_contains_ref(arg.ty); + if is_outparam { + // Already handled + continue; + } + if has_normal_return { + return Err(UnsupportedError::Other( + "multiple normal returns (should this be a tuple?)".to_owned(), + ))?; + } + has_normal_return = true; + let arg_ty = &state.tynames[&arg.ty]; + write!(f, ") -> {}", arg_ty)?; + } + if !has_normal_return { + write!(f, ")")?; + } + Ok(()) + } + + pub fn convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { + let conv = match convention { + CallingConvention::C => "C", + CallingConvention::Cdecl => "cdecl", + CallingConvention::System => "system", + CallingConvention::Win64 => "win64", + CallingConvention::Sysv64 => "sysv64", + CallingConvention::Aapcs => "aapcs", + CallingConvention::Stdcall => "stdcall", + CallingConvention::Fastcall => "fastcall", + CallingConvention::Vectorcall => { + return Err(UnsupportedError::Other( + "vectorcall is an unstable rust feature".to_owned(), + ))? + } + }; + Ok(conv) + } +} diff --git a/src/abis/rust/init.rs b/src/abis/rust/init.rs new file mode 100644 index 0000000..03c7bf0 --- /dev/null +++ b/src/abis/rust/init.rs @@ -0,0 +1,246 @@ +use super::*; +use kdl_script::types::{AliasTy, ArrayTy, PrimitiveTy, RefTy, Ty, TyIdx}; +use std::fmt::Write; +use vals::{ArgValuesIter, Value}; + +impl RustcAbiImpl { + pub fn generate_leaf_value( + &self, + f: &mut Fivemat, + state: &TestImpl, + ty: TyIdx, + val: &Value, + alias: Option<&str>, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(ty) { + // Primitives are the only "real" values with actual bytes that advance val_idx + Ty::Primitive(prim) => match prim { + PrimitiveTy::I8 => write!(f, "{}i8", val.generate_i8())?, + PrimitiveTy::I16 => write!(f, "{}i16", val.generate_i16())?, + PrimitiveTy::I32 => write!(f, "{}i32", val.generate_i32())?, + PrimitiveTy::I64 => write!(f, "{}i64", val.generate_i64())?, + PrimitiveTy::I128 => write!(f, "{}i128", val.generate_i128())?, + PrimitiveTy::U8 => write!(f, "{}u8", val.generate_u8())?, + PrimitiveTy::U16 => write!(f, "{}u16", val.generate_u16())?, + PrimitiveTy::U32 => write!(f, "{}u32", val.generate_u32())?, + PrimitiveTy::U64 => write!(f, "{}u64", val.generate_u64())?, + PrimitiveTy::U128 => write!(f, "{}u128", val.generate_u128())?, + + PrimitiveTy::F32 => write!(f, "f32::from_bits({})", val.generate_u32())?, + PrimitiveTy::F64 => write!(f, "f64::from_bits({})", val.generate_u64())?, + PrimitiveTy::Bool => write!(f, "true")?, + PrimitiveTy::Ptr => { + if true { + write!(f, "{:#X}u64 as *mut ()", val.generate_u64())? + } else { + write!(f, "{:#X}u32 as *mut ()", val.generate_u32())? + } + } + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("rust doesn't have i256".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("rust doesn't have u256".to_owned()))? + } + PrimitiveTy::F16 => { + Err(UnsupportedError::Other("rust doesn't have f16".to_owned()))? + } + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("rust doesn't have f128".to_owned()))? + } + }, + Ty::Enum(enum_ty) => { + let name = alias.unwrap_or(&enum_ty.name); + if let Some(variant) = val.select_val(&enum_ty.variants) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + } + } + _ => unreachable!("only primitives and enums should be passed to generate_leaf_value"), + } + Ok(()) + } + + #[allow(clippy::too_many_arguments)] + pub fn generate_value( + &self, + f: &mut Fivemat, + state: &TestImpl, + ty: TyIdx, + vals: &mut ArgValuesIter, + alias: Option<&str>, + ref_temp_name: &str, + extra_decls: &mut Vec, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(ty) { + // Primitives and Enums are the only "real" values with actual bytes + Ty::Primitive(_) | Ty::Enum(_) => { + let val = vals.next_val(); + self.generate_leaf_value(f, state, ty, &val, alias)?; + } + Ty::Empty => { + write!(f, "()")?; + } + Ty::Ref(RefTy { pointee_ty }) => { + // The value is a mutable reference to a temporary + write!(f, "&mut {ref_temp_name}")?; + + // TODO: should this be a recursive call to create_var (need create_var_inner?) + // Now do the rest of the recursion on constructing the temporary + let mut ref_temp = String::new(); + let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); + write!(&mut ref_temp_f, "let mut {ref_temp_name} = ")?; + let ref_temp_name = format!("{ref_temp_name}_"); + self.generate_value( + &mut ref_temp_f, + state, + *pointee_ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + write!(&mut ref_temp_f, ";")?; + extra_decls.push(ref_temp); + } + Ty::Array(ArrayTy { elem_ty, len }) => { + write!(f, "[")?; + for arr_idx in 0..*len { + if arr_idx > 0 { + write!(f, ", ")?; + } + let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); + self.generate_value( + f, + state, + *elem_ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, "]")?; + } + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let name = alias.unwrap_or(&struct_ty.name); + write!(f, "{name} {{ ")?; + for (field_idx, field) in struct_ty.fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, " }}")?; + } + Ty::Union(union_ty) => { + let name = alias.unwrap_or(&union_ty.name); + write!(f, "{name} {{ ")?; + let tag_val = vals.next_val(); + if let Some(field) = tag_val.select_val(&union_ty.fields) { + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, " }}")?; + } + + Ty::Tagged(tagged_ty) => { + let name = alias.unwrap_or(&tagged_ty.name); + let tag_val = vals.next_val(); + if let Some(variant) = tag_val.select_val(&tagged_ty.variants) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + if let Some(fields) = &variant.fields { + write!(f, " {{ ")?; + for (field_idx, field) in fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.generate_value( + f, + state, + field.ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, " }}")?; + } + } + } + Ty::Alias(AliasTy { real, name, .. }) => { + let alias = alias.or_else(|| Some(name)); + self.generate_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; + } + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + self.generate_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; + } + }; + + Ok(()) + } + + pub fn create_var( + &self, + f: &mut Fivemat, + state: &TestImpl, + var_name: &str, + var_ty: TyIdx, + mut vals: ArgValuesIter, + ) -> Result<(), GenerateError> { + // Generate the input + let needs_mut = false; + let let_mut = if needs_mut { "let mut" } else { "let" }; + let mut real_var_decl = String::new(); + let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); + let mut extra_decls = Vec::new(); + write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; + let ref_temp_name = format!("{var_name}_"); + self.generate_value( + &mut real_var_decl_f, + state, + var_ty, + &mut vals, + None, + &ref_temp_name, + &mut extra_decls, + )?; + writeln!(&mut real_var_decl, ";")?; + + for decl in extra_decls { + writeln!(f, "{}", decl)?; + } + writeln!(f, "{}", real_var_decl)?; + Ok(()) + } +} diff --git a/src/abis/rust/write.rs b/src/abis/rust/write.rs new file mode 100644 index 0000000..5098026 --- /dev/null +++ b/src/abis/rust/write.rs @@ -0,0 +1,269 @@ +use super::*; +use kdl_script::types::{Ty, TyIdx}; +use std::fmt::Write; +use vals::Value; + +impl RustcAbiImpl { + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + pub fn write_var( + &self, + f: &mut Fivemat, + state: &TestImpl, + var_name: &str, + var_ty: TyIdx, + mut vals: ArgValuesIter, + to: &str, + ) -> Result<(), GenerateError> { + // If we're generating a minimized test, skip this + if !vals.should_write_arg(&state.options) { + return Ok(()); + } + // If noop, don't bother doing anything (avoids tagged union matches being generated) + if let WriteImpl::Noop = state.options.val_writer { + return Ok(()); + }; + self.write_fields(f, state, to, var_name, var_ty, &mut vals)?; + + // If doing full harness callbacks, signal we wrote all the fields of a variable + if let WriteImpl::HarnessCallback = state.options.val_writer { + writeln!(f, "finished_val({to});")?; + writeln!(f)?; + } + Ok(()) + } + + /// Recursive subroutine of write_var, which builds up rvalue paths and generates + /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. + pub fn write_fields( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + from: &str, + var_ty: TyIdx, + vals: &mut ArgValuesIter, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it (and burn a value) + let val = vals.next_val(); + if val.should_write_val(&state.options) { + self.write_leaf_field(f, state, to, from, &val)?; + } + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + self.write_fields(f, state, to, from, alias_ty.real, vals)?; + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + self.write_fields(f, state, to, from, real_ty, vals)? + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{from}[{i}]"); + self.write_fields(f, state, to, &base, array_ty.elem_ty, vals)?; + } + } + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + Ty::Tagged(tagged_ty) => { + // Process the implicit "tag" value + let tag_generator = vals.next_val(); + let tag_idx = tag_generator.generate_idx(tagged_ty.variants.len()); + if let Some(variant) = tagged_ty.variants.get(tag_idx) { + let tagged_name = &tagged_ty.name; + let variant_name = &variant.name; + let pat = match &variant.fields { + Some(fields) => { + // Variant with fields, recurse into them + let field_list = fields + .iter() + .map(|f| f.ident.to_string()) + .collect::>() + .join(", "); + format!("{tagged_name}::{variant_name} {{ {field_list} }}") + } + None => { + // Variant without fields, still need the pattern to check the tag + format!("{tagged_name}::{variant_name}") + } + }; + + // We're going to make an if-let for the case we expect, but there might not + // be anything we care about in here (especially with should_write_val) so we + // buffer up if and else branches and then only emit the if-let if one of them + // is non-empty + let if_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; + } + if let Some(fields) = &variant.fields { + for field in fields { + // Do the ugly deref thing to deal with pattern autoref + let base = format!("(*{})", field.ident); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + f.sub_indent(1); + temp_out + }; + // Add an else case to complain that the variant is wrong + let else_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_error_tag_field(f, state, to)?; + } + f.sub_indent(1); + temp_out + }; + + let if_has_content = !if_branch.trim().is_empty(); + let else_has_content = !else_branch.trim().is_empty(); + if if_has_content || else_has_content { + writeln!(f, "if let {pat} = &{from} {{")?; + write!(f, "{}", if_branch)?; + write!(f, "}}")?; + } + if else_has_content { + writeln!(f, " else {{")?; + write!(f, "{}", else_branch)?; + writeln!(f, "}}")?; + } + } + } + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{from})"); + self.write_fields(f, state, to, &base, ref_ty.pointee_ty, vals)? + } + Ty::Union(union_ty) => { + // Process the implicit "tag" value + let tag_generator = vals.next_val(); + let tag_idx = tag_generator.generate_idx(union_ty.fields.len()); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; + } + if let Some(field) = union_ty.fields.get(tag_idx) { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + }; + Ok(()) + } + + /// WRITE an actual indivisible value (primitive or c-like enum) + pub fn write_leaf_field( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + path: &str, + val: &Value, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + // Convenience for triggering test failures + if path.contains("abicafepoison") && to.contains(VAR_CALLEE_INPUTS) { + writeln!(f, "write_field({to}, &0x12345678u32);")?; + } else { + writeln!(f, "write_field({to}, &{path});")?; + } + } + WriteImpl::Assert => { + write!(f, "assert_eq!({path}, ")?; + self.generate_leaf_value(f, state, val.ty, val, None)?; + writeln!(f, ");")?; + } + WriteImpl::Print => { + writeln!(f, "println!(\"{{:?}}\", {path});")?; + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_tag_field( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + variant_idx: usize, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, &{}u32);", variant_idx)?; + } + WriteImpl::Assert => { + // Noop, do nothing + } + WriteImpl::Print => { + // Noop, do nothing + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_error_tag_field( + &self, + f: &mut Fivemat, + state: &TestImpl, + to: &str, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, &{}u32);", u32::MAX)?; + } + WriteImpl::Assert | WriteImpl::Print => { + writeln!(f, r#"unreachable!("enum had unexpected variant!?")"#)?; + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_end_function( + &self, + f: &mut dyn Write, + state: &TestImpl, + inputs: &str, + outputs: &str, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "finished_func({inputs}, {outputs});")?; + } + WriteImpl::Print | WriteImpl::Noop | WriteImpl::Assert => { + // Noop + } + } + Ok(()) + } +} diff --git a/tests/normal/IntrusiveList.kdl b/tests/normal/IntrusiveList.kdl new file mode 100644 index 0000000..002cd49 --- /dev/null +++ b/tests/normal/IntrusiveList.kdl @@ -0,0 +1,36 @@ +// A test demonstrating a self-referential type with a basic +// intrusive list using pass-by-ref. Codegen backends are +// expected to handle this, although most of the heavy lifting +// is done by kdl-script and ValTree, so as long as you do what +// those APIs say, it should just work! +// +// The way this works is that each instance of `Link` (and any `tagged`) +// will select a random one of its variants (deterministically) to take on. +// As such the length of each `IntrusiveList` will be, essentially, determined +// by flipping a coin until it comes up tails. +// +// This could be a procgen test but then it would make nightmarish outparams +// and honestly we could all do without that! + +struct "IntrusiveList" { + next "Link" +} + +struct "Node" { + val "u32"; + next "Link"; +} + +tagged "Link" { + Some { _ "&Node"; } + None +} + +fn "intrusive1" { + inputs { _ "IntrusiveList"; } +} + +fn "intrusivemany" { + inputs { _ "&[IntrusiveList; 12]"; } +} + From 7d73b96fe75976fae983d0fb210a541df6faa7d6 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 22:46:24 -0400 Subject: [PATCH 38/44] feat: add proper attributes --- kdl-script/src/parse.rs | 86 +++++++++++++++++++++---- kdl-script/src/types.rs | 54 ++++++++-------- src/abis/rust.rs | 1 - src/abis/rust/declare.rs | 89 ++++++++++++++++++-------- src/harness/read.rs | 3 +- tests/normal/types.kdl | 4 +- tests/procgen_in/MetersU32.procgen.kdl | 7 +- 7 files changed, 171 insertions(+), 73 deletions(-) diff --git a/kdl-script/src/parse.rs b/kdl-script/src/parse.rs index 2d60eac..6b26288 100644 --- a/kdl-script/src/parse.rs +++ b/kdl-script/src/parse.rs @@ -22,6 +22,7 @@ use thiserror::Error; use tracing::trace; use crate::spanned::Spanned; +use crate::types::{PrimitiveTy, PRIMITIVES}; use crate::{Compiler, Result}; pub type StableMap = linked_hash_map::LinkedHashMap; @@ -177,10 +178,12 @@ pub enum Tydent { /// a function or other such nonsense... #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Attr { - /// rust-style derive (unused, just for testing) - Derive(AttrDerive), /// The type should be packed Packed(AttrPacked), + /// The type should be aligned + Align(AttrAligned), + /// The type should use this repr + Repr(AttrRepr), /// Pass this attribute through to the target language Passthrough(AttrPassthrough), } @@ -195,17 +198,37 @@ pub enum Attr { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct AttrPacked {} -/// An attribute declaring a rust-style derive (unused, just for testing). +/// An attribute to passthrough to the target language. /// -/// @derive "Trait1" "Trait2" ... +/// @ "whatever you want buddy" +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AttrAligned { + pub align: IntExpr, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AttrRepr { + pub reprs: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Repr { + Primitive(PrimitiveTy), + Lang(LangRepr), + Transparent, +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct AttrDerive(Vec>); +pub enum LangRepr { + Rust, + C, +} /// An attribute to passthrough to the target language. /// /// @ "whatever you want buddy" #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct AttrPassthrough(Spanned); +pub struct AttrPassthrough(pub Spanned); /// A struct decl. /// @@ -761,18 +784,55 @@ impl Parser<'_> { /// Parse an `@attribute` node. fn attr(&mut self, attr: &KdlNode) -> Result { - let entries = attr.entries(); let attr = match attr.name().value() { "@packed" => { trace!("packed attr"); self.no_children(attr)?; Attr::Packed(AttrPacked {}) } - "@derive" => { - trace!("derive attr"); - let traits = self.string_list(entries)?; - self.no_children(attr)?; - Attr::Derive(AttrDerive(traits)) + "@align" => { + trace!("align attr"); + let Some(e) = attr.entries().first() else { + return Err(KdlScriptParseError { + message: "align attr needs an integer argument".to_owned(), + src: self.src.clone(), + span: *attr.name().span(), + help: None, + })?; + }; + let align = self.int_expr(e)?; + Attr::Align(AttrAligned { align }) + } + "@repr" => { + trace!("repr attr"); + let raw_reprs = self.string_list(attr.entries())?; + let mut reprs = vec![]; + for raw_repr in raw_reprs { + let repr = match &**raw_repr { + "rust" => Repr::Lang(LangRepr::Rust), + "c" => Repr::Lang(LangRepr::C), + "transparent" => Repr::Transparent, + name => { + let mut prim_repr = None; + for &(prim_name, prim) in PRIMITIVES { + if prim_name == name { + prim_repr = Some(prim); + } + } + let Some(prim_repr) = prim_repr else { + return Err(KdlScriptParseError { + message: "repr attr has unknown kind".to_owned(), + src: self.src.clone(), + span: *attr.name().span(), + help: None, + })?; + }; + Repr::Primitive(prim_repr) + } + }; + reprs.push(repr); + } + Attr::Repr(AttrRepr { reprs }) } "@" => { trace!("passthrough attr"); @@ -1160,7 +1220,7 @@ fn unicode_space(input: &str) -> NomResult<&str, &str> { /// Possibly the type checker, but it also kinda needs to be deferred /// to the target language backends as a language may not be able to /// handle a `u256` or whatever. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct IntExpr { pub span: SourceSpan, pub val: i64, diff --git a/kdl-script/src/types.rs b/kdl-script/src/types.rs index 7fefca0..811a5c5 100644 --- a/kdl-script/src/types.rs +++ b/kdl-script/src/types.rs @@ -167,7 +167,7 @@ pub struct Arg { } /// A primitive -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum PrimitiveTy { /// `i8` / `int8_t` I8, @@ -207,6 +207,27 @@ pub enum PrimitiveTy { Ptr, } +pub const PRIMITIVES: &[(&str, PrimitiveTy)] = &[ + ("i8", PrimitiveTy::I8), + ("i16", PrimitiveTy::I16), + ("i32", PrimitiveTy::I32), + ("i64", PrimitiveTy::I64), + ("i128", PrimitiveTy::I128), + ("i256", PrimitiveTy::I256), + ("u8", PrimitiveTy::U8), + ("u16", PrimitiveTy::U16), + ("u32", PrimitiveTy::U32), + ("u64", PrimitiveTy::U64), + ("u128", PrimitiveTy::U128), + ("u256", PrimitiveTy::U256), + ("f16", PrimitiveTy::F16), + ("f32", PrimitiveTy::F32), + ("f64", PrimitiveTy::F64), + ("f128", PrimitiveTy::F128), + ("bool", PrimitiveTy::Bool), + ("ptr", PrimitiveTy::Ptr), +]; + /// The Ty of a nominal struct. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct StructTy { @@ -492,27 +513,10 @@ pub fn typeck(comp: &mut Compiler, parsed: &ParsedProgram) -> Result { let lty = self.realize_ty(*l); let rty = self.realize_ty(*r); - rty.is_nominal().cmp(<y.is_nominal()).then(l.cmp(&r)) + rty.is_nominal().cmp(<y.is_nominal()).then(l.cmp(r)) } }); *component = sorted_nodes; diff --git a/src/abis/rust.rs b/src/abis/rust.rs index a7c9e08..caa8f99 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -288,7 +288,6 @@ impl RustcAbiImpl { var_name: &str, _var_ty: TyIdx, ) -> Result<(), GenerateError> { - // TODO: implement outparam returns writeln!(f, "{var_name}")?; Ok(()) } diff --git a/src/abis/rust/declare.rs b/src/abis/rust/declare.rs index a091888..fe1caa9 100644 --- a/src/abis/rust/declare.rs +++ b/src/abis/rust/declare.rs @@ -1,8 +1,7 @@ use super::*; -use kdl_script::parse::Attr; +use kdl_script::parse::{Attr, AttrAligned, AttrPacked, AttrPassthrough, AttrRepr, LangRepr, Repr}; use kdl_script::types::{AliasTy, ArrayTy, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use std::fmt::Write; -use tracing::warn; impl RustcAbiImpl { /// Every test should start by loading in the harness' "header" @@ -311,43 +310,77 @@ impl RustcAbiImpl { &self, f: &mut Fivemat, attrs: &[Attr], - ty_style: &str, + _ty_style: &str, ) -> Result<(), GenerateError> { + let mut default_c_repr = true; let mut repr_attrs = vec![]; - let mut packed = false; + let mut other_attrs = vec![]; for attr in attrs { match attr { - Attr::Derive(attr) => { - return Err(UnsupportedError::Other(format!( - "derive attr not supported {attr:?}" - )))?; + Attr::Align(AttrAligned { align }) => { + repr_attrs.push(format!("align({})", align.val)); } - Attr::Packed(_) => { - packed = true; + Attr::Packed(AttrPacked {}) => { + repr_attrs.push("packed".to_owned()); } - Attr::Passthrough(attr) => { - warn!("found passthrough attr on {ty_style}, assuming repr(transparent)"); - repr_attrs.push("transparent"); + Attr::Passthrough(AttrPassthrough(attr)) => { + other_attrs.push(attr.to_string()); + } + Attr::Repr(AttrRepr { reprs }) => { + // Any explicit repr attributes disables default C + default_c_repr = false; + for repr in reprs { + let val = match repr { + Repr::Primitive(prim) => match prim { + PrimitiveTy::I8 => "i8", + PrimitiveTy::I16 => "i16", + PrimitiveTy::I32 => "i32", + PrimitiveTy::I64 => "i64", + PrimitiveTy::I128 => "i128", + PrimitiveTy::U8 => "u8", + PrimitiveTy::U16 => "u16", + PrimitiveTy::U32 => "u32", + PrimitiveTy::U64 => "u64", + PrimitiveTy::U128 => "u128", + PrimitiveTy::I256 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + return Err(UnsupportedError::Other(format!( + "unsupport repr({prim:?})" + )))?; + } + }, + Repr::Lang(LangRepr::C) => "C", + Repr::Lang(LangRepr::Rust) => { + continue; + } + Repr::Transparent => "transparent", + }; + repr_attrs.push(val.to_owned()); + } } } } - if repr_attrs.is_empty() { - repr_attrs.push("C"); - } - if packed { - repr_attrs.push("packed"); + if default_c_repr { + repr_attrs.push("C".to_owned()); } - if !repr_attrs.is_empty() { - write!(f, "#[repr(")?; - let mut multi = false; - for repr in repr_attrs { - if multi { - write!(f, ", ")?; - } - multi = true; - write!(f, "{repr}")?; + write!(f, "#[repr(")?; + let mut multi = false; + for repr in repr_attrs { + if multi { + write!(f, ", ")?; } - writeln!(f, ")]")?; + multi = true; + write!(f, "{repr}")?; + } + writeln!(f, ")]")?; + for attr in other_attrs { + writeln!(f, "{}", attr)?; } Ok(()) } diff --git a/src/harness/read.rs b/src/harness/read.rs index c1ab675..c4837d9 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -64,7 +64,7 @@ async fn read_test_inner(test: &TestId, test_file: TestFile) -> Result let (test_file, input) = match test_file { TestFile::KdlProcgen(test_file) => { let ty_def = read_file_to_string(&test_file)?; - let input = crate::procgen::procgen_test_for_ty_string(&test, Some(&ty_def)); + let input = crate::procgen::procgen_test_for_ty_string(test, Some(&ty_def)); (test_file, input) } TestFile::Kdl(test_file) => { @@ -80,6 +80,7 @@ async fn read_test_inner(test: &TestId, test_file: TestFile) -> Result })) } +#[allow(clippy::manual_map)] fn classify_test(test_file: &Utf8Path) -> Option<(String, TestFile)> { let file_name = test_file.file_name().expect("test file had no name!?"); if let Some(test_name) = file_name.strip_suffix(".procgen.kdl") { diff --git a/tests/normal/types.kdl b/tests/normal/types.kdl index 1dc97cb..9ac1791 100644 --- a/tests/normal/types.kdl +++ b/tests/normal/types.kdl @@ -8,8 +8,6 @@ struct "Complex" { elems1 "[Simple;10]" elems2 "[Simple;9]" val "Simple" - // reffed "&Simple" - // array_ref "&[&Simple;2]" opaque "ptr" flag "bool" } @@ -75,7 +73,7 @@ fn "arraytime" { inputs { a "[i32;4]" b "[[i32;4];5]" - // c "[[[&Simple;1];2];3]" + c "[[[&Simple;1];2];3]" } } diff --git a/tests/procgen_in/MetersU32.procgen.kdl b/tests/procgen_in/MetersU32.procgen.kdl index f4c4429..7577836 100644 --- a/tests/procgen_in/MetersU32.procgen.kdl +++ b/tests/procgen_in/MetersU32.procgen.kdl @@ -1,8 +1,11 @@ +// The canonical pun type example: +// rust's repr(transparent) should behave like the bare integer + pun "MetersU32" { lang "rust" { - @ "#[repr(transparent)]" + @repr "transparent" struct "MetersU32" { - a "u32" + _ "u32" } } From 6f9dd8b3e709da8fe8ce2073f61477c223bbff50 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 27 Jun 2024 22:56:58 -0400 Subject: [PATCH 39/44] cleanup --- kdl-script/examples/simple.kdl | 3 +- src/abis/rust.rs | 50 ++++------------------------------ src/abis/rust/declare.rs | 21 ++++++-------- src/abis/rust/init.rs | 48 ++++++++------------------------ src/abis/rust/write.rs | 23 +++++++++++++++- 5 files changed, 49 insertions(+), 96 deletions(-) diff --git a/kdl-script/examples/simple.kdl b/kdl-script/examples/simple.kdl index 09c3c8b..20aeeb9 100644 --- a/kdl-script/examples/simple.kdl +++ b/kdl-script/examples/simple.kdl @@ -1,4 +1,3 @@ -@derive "Display" struct "Point" { x "f64" y "f64" @@ -15,7 +14,7 @@ fn "main" { x 10.0 y 20.0 } - + let "sum" "add:" "pt1" "pt2" print "sum" diff --git a/src/abis/rust.rs b/src/abis/rust.rs index caa8f99..68a2783 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -5,7 +5,7 @@ mod init; mod write; use camino::Utf8Path; -use kdl_script::types::{Func, FuncIdx, TyIdx}; +use kdl_script::types::{Func, FuncIdx}; use kdl_script::PunEnv; use std::fmt::Write; use std::sync::Arc; @@ -115,24 +115,6 @@ impl RustcAbiImpl { Ok(()) } - fn generate_caller_externs( - &self, - f: &mut Fivemat, - state: &TestImpl, - ) -> Result<(), GenerateError> { - let convention_decl = self.convention_decl(state.options.convention)?; - writeln!(f, "extern \"{convention_decl}\" {{",)?; - f.add_indent(1); - for &func in &state.desired_funcs { - self.generate_signature(f, state, func)?; - writeln!(f, ";")?; - } - f.sub_indent(1); - writeln!(f, "}}")?; - writeln!(f)?; - Ok(()) - } - fn generate_caller_body( &self, f: &mut Fivemat, @@ -148,7 +130,7 @@ impl RustcAbiImpl { for arg in &function.inputs { let arg_vals: ArgValuesIter = func_vals.next_arg(); // Create and report the input - self.create_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.init_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLER_INPUTS)?; } @@ -191,7 +173,7 @@ impl RustcAbiImpl { if arg_idx > 0 { write!(f, ", ")?; } - self.pass_var(f, state, &arg.name, arg.ty)?; + write!(f, "{}", arg.name)?; } writeln!(f, ");")?; writeln!(f)?; @@ -242,7 +224,7 @@ impl RustcAbiImpl { // Create outputs and report them for arg in &function.outputs { let arg_vals = func_vals.next_arg(); - self.create_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.init_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLEE_OUTPUTS)?; } @@ -252,7 +234,7 @@ impl RustcAbiImpl { // Return the outputs self.check_returns(state, function)?; for arg in function.outputs.iter() { - self.return_var(f, state, &arg.name, arg.ty)?; + writeln!(f, "{}", arg.name)?; } f.sub_indent(1); writeln!(f, "}}")?; @@ -270,28 +252,6 @@ impl RustcAbiImpl { } } - fn pass_var( - &self, - f: &mut dyn Write, - _state: &TestImpl, - var_name: &str, - _var_ty: TyIdx, - ) -> Result<(), GenerateError> { - write!(f, "{var_name}")?; - Ok(()) - } - - fn return_var( - &self, - f: &mut dyn Write, - _state: &TestImpl, - var_name: &str, - _var_ty: TyIdx, - ) -> Result<(), GenerateError> { - writeln!(f, "{var_name}")?; - Ok(()) - } - fn check_returns(&self, state: &TestImpl, function: &Func) -> Result<(), GenerateError> { let has_outparams = function .outputs diff --git a/src/abis/rust/declare.rs b/src/abis/rust/declare.rs index fe1caa9..325b758 100644 --- a/src/abis/rust/declare.rs +++ b/src/abis/rust/declare.rs @@ -4,24 +4,21 @@ use kdl_script::types::{AliasTy, ArrayTy, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx use std::fmt::Write; impl RustcAbiImpl { - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - pub fn write_harness_prefix( + pub fn generate_caller_externs( &self, f: &mut Fivemat, state: &TestImpl, ) -> Result<(), GenerateError> { - // No extra harness gunk if not needed - if state.options.val_writer != WriteImpl::HarnessCallback { - return Ok(()); - } - if state.options.convention == CallingConvention::Vectorcall { - writeln!(f, "#![feature(abi_vectorcall)]")?; + let convention_decl = self.convention_decl(state.options.convention)?; + writeln!(f, "extern \"{convention_decl}\" {{",)?; + f.add_indent(1); + for &func in &state.desired_funcs { + self.generate_signature(f, state, func)?; + writeln!(f, ";")?; } - // Load test harness "headers" - writeln!(f, "{}", RUST_TEST_PREFIX)?; + f.sub_indent(1); + writeln!(f, "}}")?; writeln!(f)?; - Ok(()) } diff --git a/src/abis/rust/init.rs b/src/abis/rust/init.rs index 03c7bf0..a4da809 100644 --- a/src/abis/rust/init.rs +++ b/src/abis/rust/init.rs @@ -4,7 +4,7 @@ use std::fmt::Write; use vals::{ArgValuesIter, Value}; impl RustcAbiImpl { - pub fn generate_leaf_value( + pub fn init_leaf_value( &self, f: &mut Fivemat, state: &TestImpl, @@ -62,7 +62,7 @@ impl RustcAbiImpl { } #[allow(clippy::too_many_arguments)] - pub fn generate_value( + pub fn init_value( &self, f: &mut Fivemat, state: &TestImpl, @@ -76,7 +76,7 @@ impl RustcAbiImpl { // Primitives and Enums are the only "real" values with actual bytes Ty::Primitive(_) | Ty::Enum(_) => { let val = vals.next_val(); - self.generate_leaf_value(f, state, ty, &val, alias)?; + self.init_leaf_value(f, state, ty, &val, alias)?; } Ty::Empty => { write!(f, "()")?; @@ -91,7 +91,7 @@ impl RustcAbiImpl { let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); write!(&mut ref_temp_f, "let mut {ref_temp_name} = ")?; let ref_temp_name = format!("{ref_temp_name}_"); - self.generate_value( + self.init_value( &mut ref_temp_f, state, *pointee_ty, @@ -110,15 +110,7 @@ impl RustcAbiImpl { write!(f, ", ")?; } let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); - self.generate_value( - f, - state, - *elem_ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; + self.init_value(f, state, *elem_ty, vals, alias, &ref_temp_name, extra_decls)?; } write!(f, "]")?; } @@ -133,15 +125,7 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; + self.init_value(f, state, field.ty, vals, alias, &ref_temp_name, extra_decls)?; } write!(f, " }}")?; } @@ -153,15 +137,7 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( - f, - state, - field.ty, - vals, - alias, - &ref_temp_name, - extra_decls, - )?; + self.init_value(f, state, field.ty, vals, alias, &ref_temp_name, extra_decls)?; } write!(f, " }}")?; } @@ -181,7 +157,7 @@ impl RustcAbiImpl { let field_name = &field.ident; write!(f, "{field_name}: ")?; let ref_temp_name = format!("{ref_temp_name}{field_name}_"); - self.generate_value( + self.init_value( f, state, field.ty, @@ -197,20 +173,20 @@ impl RustcAbiImpl { } Ty::Alias(AliasTy { real, name, .. }) => { let alias = alias.or_else(|| Some(name)); - self.generate_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; + self.init_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; } // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); - self.generate_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; + self.init_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; } }; Ok(()) } - pub fn create_var( + pub fn init_var( &self, f: &mut Fivemat, state: &TestImpl, @@ -226,7 +202,7 @@ impl RustcAbiImpl { let mut extra_decls = Vec::new(); write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; let ref_temp_name = format!("{var_name}_"); - self.generate_value( + self.init_value( &mut real_var_decl_f, state, var_ty, diff --git a/src/abis/rust/write.rs b/src/abis/rust/write.rs index 5098026..9c4b381 100644 --- a/src/abis/rust/write.rs +++ b/src/abis/rust/write.rs @@ -4,6 +4,27 @@ use std::fmt::Write; use vals::Value; impl RustcAbiImpl { + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + pub fn write_harness_prefix( + &self, + f: &mut Fivemat, + state: &TestImpl, + ) -> Result<(), GenerateError> { + // No extra harness gunk if not needed + if state.options.val_writer != WriteImpl::HarnessCallback { + return Ok(()); + } + if state.options.convention == CallingConvention::Vectorcall { + writeln!(f, "#![feature(abi_vectorcall)]")?; + } + // Load test harness "headers" + writeln!(f, "{}", RUST_TEST_PREFIX)?; + writeln!(f)?; + + Ok(()) + } + /// Emit the WRITE calls and FINISHED_VAL for this value. /// This will WRITE every leaf subfield of the type. /// `to` is the BUFFER to use, `from` is the variable name of the value. @@ -192,7 +213,7 @@ impl RustcAbiImpl { } WriteImpl::Assert => { write!(f, "assert_eq!({path}, ")?; - self.generate_leaf_value(f, state, val.ty, val, None)?; + self.init_leaf_value(f, state, val.ty, val, None)?; writeln!(f, ");")?; } WriteImpl::Print => { From af04c2fa01676f94b5903d246f6770b8f56e401a Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Fri, 28 Jun 2024 19:44:55 -0400 Subject: [PATCH 40/44] wip cc backend --- harness/c_harness_prefix.h | 14 + harness/c_test_prefix.h | 11 - ..._test_prefix.rs => rust_harness_prefix.rs} | 66 +- src/abis/c.rs | 927 +++++------------- src/abis/c/declare.rs | 532 ++++++++++ src/abis/c/init.rs | 259 +++++ src/abis/c/write.rs | 295 ++++++ src/abis/c_old.rs | 601 ++++++++++++ src/abis/mod.rs | 15 +- src/abis/rust.rs | 51 +- src/abis/rust/declare.rs | 57 +- src/abis/rust/init.rs | 6 +- src/abis/rust/write.rs | 16 +- src/cli.rs | 8 +- src/main.rs | 11 +- tests/normal/anons.kdl | 1 + 16 files changed, 2065 insertions(+), 805 deletions(-) create mode 100644 harness/c_harness_prefix.h rename harness/{rust_test_prefix.rs => rust_harness_prefix.rs} (97%) create mode 100644 src/abis/c/declare.rs create mode 100644 src/abis/c/init.rs create mode 100644 src/abis/c/write.rs create mode 100644 src/abis/c_old.rs diff --git a/harness/c_harness_prefix.h b/harness/c_harness_prefix.h new file mode 100644 index 0000000..25adc4c --- /dev/null +++ b/harness/c_harness_prefix.h @@ -0,0 +1,14 @@ + +#define WriteBuffer void* + +extern WriteBuffer CALLER_INPUTS; +extern WriteBuffer CALLER_OUTPUTS; +extern WriteBuffer CALLEE_INPUTS; +extern WriteBuffer CALLEE_OUTPUTS; +extern void (*WRITE_FIELD)(WriteBuffer, char*, uint32_t); +extern void (*FINISHED_VAL)(WriteBuffer); +extern void (*FINISHED_FUNC)(WriteBuffer, WriteBuffer); + +#define finished_val(buffer) FINISHED_VAL(buffer) +#define finished_func(inputs, outputs) FINISHED_FUNC(inputs, outputs) +#define write_field(buffer, field) WRITE_FIELD(buffer, (char*)&field, (uint32_t)sizeof(field)) diff --git a/harness/c_test_prefix.h b/harness/c_test_prefix.h index e293b3c..8bf5b5b 100644 --- a/harness/c_test_prefix.h +++ b/harness/c_test_prefix.h @@ -2,14 +2,3 @@ #include #include #include - -#define WriteBuffer void* - -extern WriteBuffer CALLER_INPUTS; -extern WriteBuffer CALLER_OUTPUTS; -extern WriteBuffer CALLEE_INPUTS; -extern WriteBuffer CALLEE_OUTPUTS; -extern void (*WRITE_FIELD)(WriteBuffer, char*, uint32_t); -extern void (*FINISHED_VAL)(WriteBuffer); -extern void (*FINISHED_FUNC)(WriteBuffer, WriteBuffer); - diff --git a/harness/rust_test_prefix.rs b/harness/rust_harness_prefix.rs similarity index 97% rename from harness/rust_test_prefix.rs rename to harness/rust_harness_prefix.rs index 5552aed..14bcc19 100644 --- a/harness/rust_test_prefix.rs +++ b/harness/rust_harness_prefix.rs @@ -1,33 +1,33 @@ -#[repr(transparent)] -#[derive(Copy, Clone)] -pub struct WriteBuffer(*mut ()); -unsafe impl Send for WriteBuffer {} -unsafe impl Sync for WriteBuffer {} - -type WriteCallback = unsafe extern fn(WriteBuffer, *const u8, u32) -> (); -type FinishedValCallback = unsafe extern fn(WriteBuffer) -> (); -type FinishedFuncCallback = unsafe extern fn(WriteBuffer, WriteBuffer) -> (); - -extern { - pub static mut CALLER_INPUTS: WriteBuffer; - pub static mut CALLER_OUTPUTS: WriteBuffer; - pub static mut CALLEE_INPUTS: WriteBuffer; - pub static mut CALLEE_OUTPUTS: WriteBuffer; - pub static mut WRITE_FIELD: Option; - pub static mut FINISHED_VAL: Option; - pub static mut FINISHED_FUNC: Option; -} - -unsafe fn write_field(buffer: WriteBuffer, field: &T) { - WRITE_FIELD.unwrap()( - buffer, - field as *const T as *const u8, - core::mem::size_of_val(field) as u32 - ); -} -unsafe fn finished_val(buffer: WriteBuffer) { - FINISHED_VAL.unwrap()(buffer); -} -unsafe fn finished_func(inputs: WriteBuffer, outputs: WriteBuffer) { - FINISHED_FUNC.unwrap()(inputs, outputs); -} +#[repr(transparent)] +#[derive(Copy, Clone)] +pub struct WriteBuffer(*mut ()); +unsafe impl Send for WriteBuffer {} +unsafe impl Sync for WriteBuffer {} + +type WriteCallback = unsafe extern fn(WriteBuffer, *const u8, u32) -> (); +type FinishedValCallback = unsafe extern fn(WriteBuffer) -> (); +type FinishedFuncCallback = unsafe extern fn(WriteBuffer, WriteBuffer) -> (); + +extern { + pub static mut CALLER_INPUTS: WriteBuffer; + pub static mut CALLER_OUTPUTS: WriteBuffer; + pub static mut CALLEE_INPUTS: WriteBuffer; + pub static mut CALLEE_OUTPUTS: WriteBuffer; + pub static mut WRITE_FIELD: Option; + pub static mut FINISHED_VAL: Option; + pub static mut FINISHED_FUNC: Option; +} + +unsafe fn write_field(buffer: WriteBuffer, field: &T) { + WRITE_FIELD.unwrap()( + buffer, + field as *const T as *const u8, + core::mem::size_of_val(field) as u32 + ); +} +unsafe fn finished_val(buffer: WriteBuffer) { + FINISHED_VAL.unwrap()(buffer); +} +unsafe fn finished_func(inputs: WriteBuffer, outputs: WriteBuffer) { + FINISHED_FUNC.unwrap()(inputs, outputs); +} diff --git a/src/abis/c.rs b/src/abis/c.rs index 2bb0901..7c6534a 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -1,9 +1,51 @@ -use crate::Config; +//! C codegen backend backend + +mod declare; +mod init; +mod write; + +use camino::Utf8Path; +use kdl_script::types::{Func, FuncIdx}; +use kdl_script::PunEnv; +use std::fmt::Write; +use std::sync::Arc; use super::super::*; use super::*; - -pub static C_TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); +use crate::fivemat::Fivemat; +use crate::vals::ArgValuesIter; + +pub static TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); +pub static HARNESS_PREFIX: &str = include_str!("../../harness/c_harness_prefix.h"); + +const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; +const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; +const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; +const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; +const INDENT: &str = " "; + +pub struct TestState { + pub inner: TestImpl, + // interning state + pub desired_funcs: Vec, + pub tynames: HashMap, +} +impl std::ops::Deref for TestState { + type Target = TestImpl; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl TestState { + fn new(inner: TestImpl) -> Self { + let desired_funcs = inner.options.functions.active_funcs(&inner.types); + Self { + inner, + desired_funcs, + tynames: Default::default(), + } + } +} pub struct CcAbiImpl { cc_flavor: CCFlavor, @@ -35,169 +77,195 @@ impl AbiImpl for CcAbiImpl { "c" } - fn supports_convention(&self, convention: CallingConvention) -> bool { - self.c_convention_decl(convention).is_ok() + fn pun_env(&self) -> Arc { + Arc::new(kdl_script::PunEnv { + lang: "c".to_string(), + }) } - fn generate_callee( + fn compile_callee( &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, out_dir, lib_name), + "gcc" => self.compile_gcc(src_path, out_dir, lib_name), + "clang" => self.compile_clang(src_path, out_dir, lib_name), + "msvc" => self.compile_msvc(src_path, out_dir, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } + + fn compile_caller( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { + match self.mode { + "cc" => self.compile_cc(src_path, out_dir, lib_name), + "gcc" => self.compile_gcc(src_path, out_dir, lib_name), + "clang" => self.compile_clang(src_path, out_dir, lib_name), + "msvc" => self.compile_msvc(src_path, out_dir, lib_name), + _ => unimplemented!("unknown c compiler"), + } + } + + fn generate_callee(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError> { + let mut f = Fivemat::new(f, INDENT); + let mut state = TestState::new(test); + self.generate_callee_impl(&mut f, &mut state) + } + + fn generate_caller(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError> { + let mut f = Fivemat::new(f, INDENT); + let mut state = TestState::new(test); + self.generate_caller_impl(&mut f, &mut state) + } +} + +impl CcAbiImpl { + pub fn generate_caller_impl( + &self, + f: &mut Fivemat, + state: &mut TestState, ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; + // Generate type decls and gather up functions + self.generate_definitions(f, state)?; + // Generate decls of the functions we want to call + self.generate_caller_externs(f, state)?; - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - self.write_c_signature(f, function, convention)?; - writeln!(f, " {{")?; - - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - if let Some(output) = &function.output { - writeln!( - f, - " {} = {};", - self.c_var_decl(output, OUTPUT_NAME)?, - self.c_val(output)? - )?; - writeln!( - f, - "{}", - self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - writeln!( - f, - " {}", - self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - } - writeln!(f, "}}")?; - writeln!(f)?; + // Generate the test function the harness will call + writeln!(f, "void do_test(void) {{")?; + f.add_indent(1); + for &func in &state.desired_funcs { + // Generate the individual function calls + self.generate_caller_body(f, state, func)?; } + f.sub_indent(1); + writeln!(f, "}}")?; Ok(()) } - fn generate_caller( + fn generate_caller_body( &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, + f: &mut Fivemat, + state: &TestState, + func: FuncIdx, ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; + let function = state.types.realize_func(func); + + // Create vars for all the inputs + let mut func_vals = state.vals.at_func(func); + for arg in &function.inputs { + let arg_vals: ArgValuesIter = func_vals.next_arg(); + // Create and report the input + self.init_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLER_INPUTS)?; + } - // Generate the extern block - for function in &test.funcs { - self.write_c_signature(f, function, convention)?; - writeln!(f, ";")?; + // Call the function + self.call_function(f, state, function)?; + + // Report all the outputs + for arg in &function.outputs { + let arg_vals: ArgValuesIter = func_vals.next_arg(); + + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLER_OUTPUTS)?; } - writeln!(f)?; - writeln!(f, "void do_test(void) {{")?; + // Report the function is complete + self.write_end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; + Ok(()) + } - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Add an extra scope to avoid clashes between subtests - writeln!(f, "{{")?; - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.c_var_decl(input, ARG_NAMES[idx])?, - self.c_val(input)? - )?; - writeln!( - f, - "{}", - self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Output - let pass_out = if let Some(output) = &function.output { - if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {};", out_param_var)?; - write!(f, " ")?; - true - } else { - write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - write!(f, " ")?; - false - }; - - // Do the actual call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; - if function.inputs.is_empty() { - write!(f, "{}", pass)?; - } else { - write!(f, ", {}", pass)?; - } - } - writeln!(f, ");")?; - - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; + fn call_function( + &self, + f: &mut Fivemat, + state: &TestState, + function: &Func, + ) -> Result<(), GenerateError> { + let func_name = &function.name; + + // make sure the outputs aren't weird + self.check_returns(state, function)?; + if let Some(arg) = function.outputs.first() { + let (pre, post) = &state.tynames[&arg.ty]; + write!(f, "{pre}{}{post} = ", arg.name)?; + } + + // Call the function + write!(f, "{func_name}(")?; + let inputs = function.inputs.iter(); + + for (arg_idx, arg) in inputs.enumerate() { + if arg_idx > 0 { + write!(f, ", ")?; } - writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; - writeln!(f, "}}")?; - writeln!(f)?; + write!(f, "{}", arg.name)?; } - writeln!(f, "}}")?; + writeln!(f, ");")?; + writeln!(f)?; Ok(()) } +} - fn compile_callee(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), +impl CcAbiImpl { + pub fn generate_callee_impl( + &self, + f: &mut Fivemat, + state: &mut TestState, + ) -> Result<(), GenerateError> { + // Generate type decls and gather up functions + self.generate_definitions(f, state)?; + + for &func in &state.desired_funcs { + // Generate the individual function definitions + self.generate_callee_body(f, state, func)?; } + Ok(()) } - fn compile_caller(&self, src_path: &Path, lib_name: &str) -> Result { - match self.mode { - "cc" => self.compile_cc(src_path, lib_name), - "gcc" => self.compile_gcc(src_path, lib_name), - "clang" => self.compile_clang(src_path, lib_name), - "msvc" => self.compile_msvc(src_path, lib_name), - _ => unimplemented!("unknown c compiler"), + fn generate_callee_body( + &self, + f: &mut Fivemat, + state: &TestState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.types.realize_func(func); + self.generate_signature(f, state, func)?; + writeln!(f, " {{")?; + f.add_indent(1); + + // Report the inputs + let mut func_vals = state.vals.at_func(func); + for arg in &function.inputs { + let arg_vals = func_vals.next_arg(); + let arg_name = &arg.name; + self.write_var(f, state, arg_name, arg.ty, arg_vals, VAR_CALLEE_INPUTS)?; + } + + // Create outputs and report them + for arg in &function.outputs { + let arg_vals = func_vals.next_arg(); + self.init_var(f, state, &arg.name, arg.ty, arg_vals.clone())?; + self.write_var(f, state, &arg.name, arg.ty, arg_vals, VAR_CALLEE_OUTPUTS)?; } + + // Report the function is complete + self.write_end_function(f, state, VAR_CALLEE_INPUTS, VAR_CALLEE_OUTPUTS)?; + + // Return the outputs + self.check_returns(state, function)?; + if let Some(arg) = function.outputs.first() { + writeln!(f, "return {};", arg.name)?; + } + f.sub_indent(1); + writeln!(f, "}}")?; + Ok(()) } } @@ -227,21 +295,31 @@ impl CcAbiImpl { } } - fn compile_cc(&self, src_path: &Path, lib_name: &str) -> Result { + fn compile_cc( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { cc::Build::new() .file(src_path) .opt_level(0) .cargo_metadata(false) .target(built_info::TARGET) + .out_dir(out_dir) // .warnings_into_errors(true) .try_compile(lib_name)?; Ok(String::from(lib_name)) } - fn compile_clang(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); + fn compile_clang( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { + let obj_path = out_dir.join(format!("{lib_name}.o")); + let lib_path = out_dir.join(format!("lib{lib_name}.a")); Command::new("clang") .arg("-ffunction-sections") .arg("-fdata-sections") @@ -262,10 +340,14 @@ impl CcAbiImpl { Ok(String::from(lib_name)) } - fn compile_gcc(&self, src_path: &Path, lib_name: &str) -> Result { - let base_path = PathBuf::from("target/temp/"); - let obj_path = base_path.join(format!("{lib_name}.o")); - let lib_path = base_path.join(format!("lib{lib_name}.a")); + fn compile_gcc( + &self, + src_path: &Utf8Path, + out_dir: &Utf8Path, + lib_name: &str, + ) -> Result { + let obj_path = out_dir.join(format!("{lib_name}.o")); + let lib_path = out_dir.join(format!("lib{lib_name}.a")); Command::new("gcc") .arg("-ffunction-sections") .arg("-fdata-sections") @@ -286,537 +368,30 @@ impl CcAbiImpl { Ok(String::from(lib_name)) } - fn compile_msvc(&self, _src_path: &Path, _lib_name: &str) -> Result { - unimplemented!() - } - - fn c_convention_decl( + fn compile_msvc( &self, - convention: CallingConvention, - ) -> Result<&'static str, GenerateError> { - use CCFlavor::*; - use CallingConvention::*; - use Platform::*; - // GCC (as __attribute__'s) - // - // * x86: cdecl, fastcall, thiscall, stdcall, - // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), - // naked, interrupt, sseregparm - // * ARM: pcs="aapcs", pcs="aapcs-vfp", - // long_call, short_call, naked, - // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), - // - // MSVC (as ~keywords) - // - // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall - - let val = match convention { - Handwritten => "handwritten", - All => { - // All is sugar, we shouldn't get here! - return Err(GenerateError::UnsupportedConvention); - } - System | Win64 | Sysv64 | Aapcs => { - // Don't want to think about these yet, I think they're - // all properly convered by other ABIs - return Err(GenerateError::UnsupportedConvention); - } - C => "", - Cdecl => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__cdecl ", - Gcc | Clang => "__attribute__((cdecl)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Stdcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__stdcall ", - Gcc | Clang => "__attribute__((stdcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Fastcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__fastcall ", - Gcc | Clang => "__attribute__((fastcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - Vectorcall => { - if self.platform == Windows { - match self.cc_flavor { - Msvc => "__vectorcall ", - Gcc | Clang => "__attribute__((vectorcall)) ", - } - } else { - return Err(GenerateError::UnsupportedConvention); - } - } - }; - - Ok(val) + _src_path: &Utf8Path, + _out_dir: &Utf8Path, + _lib_name: &str, + ) -> Result { + unimplemented!() } - // Emit a function signature - fn write_c_signature( - &self, - f: &mut dyn Write, - function: &Func, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let convention_decl = self.c_convention_decl(convention)?; - - // First figure out the return (by-ref requires an out-param) - let out_param = if let Some(output) = &function.output { - let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; - if out_param.is_none() { - write!(f, "{} ", self.c_arg_type(output)?)?; - } else { - write!(f, "void ")?; - } - out_param - } else { - write!(f, "void ")?; - None - }; - - write!(f, "{}", convention_decl)?; - - // Now write out the args - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; + fn check_returns(&self, state: &TestState, function: &Func) -> Result<(), GenerateError> { + let has_outparams = function + .outputs + .iter() + .any(|arg| state.types.ty_contains_ref(arg.ty)); + if has_outparams { + return Err(UnsupportedError::Other( + "outparams (outputs containing references) aren't supported".to_owned(), + ))?; } - - // Add extra implicit args - if let Some(out_param) = out_param { - if !function.inputs.is_empty() { - write!(f, ", ")?; - } - write!(f, "{out_param}")?; - } else if function.inputs.is_empty() { - write!(f, "void")?; + if function.outputs.len() > 1 { + return Err(UnsupportedError::Other( + "multiple returns (should this be a struct?)".to_owned(), + ))?; } - write!(f, ")")?; - Ok(()) } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { - // Load test harness "headers" - write!(f, "{}", C_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.c_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } - } - - Ok(()) - } - - fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.c_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = format!("struct {name}"); - output.push_str(&format!("struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); - output.push_str(&line); - } - output.push_str("};\n"); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.c_forward_decl(&vals[0]), - Ref(pointee) => self.c_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { - use Val::*; - let val = match val { - Ref(pointee) => self.c_var_decl(pointee, var_name)?, - Array(_) => { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) - } - normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), - }; - Ok(val) - } - - /// The decl to use for a function arg (apply referenceness) - fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - format!("{}* {arg_name}", self.c_arg_type(cur_val)?) - } else { - format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) - } - } else { - format!("{} {arg_name}", self.c_arg_type(val)?) - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param( - &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) - } else { - Some(format!( - "{} {out_param_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - } else { - None - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(self.c_var_decl(pointee, output_name)?)) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - if let Val::Array(_) = &**pointee { - Ok(arg_name.to_string()) - } else { - Ok(format!("&{arg_name}")) - } - } else { - Ok(arg_name.to_string()) - } - } - - /// How to return a value - fn c_var_return( - &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!( - "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" - )) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn c_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => { - let mut cur_val = &**pointee; - while let Val::Array(vals) = cur_val { - cur_val = &vals[0]; - } - format!("{}*", self.c_arg_type(cur_val)?) - } - Ptr(_) => "void*".to_string(), - Bool(_) => "bool".to_string(), - Array(_vals) => { - // C arrays are kinda fake due to how they decay in function arg - // position, so a ton of code needs to very delicately detect arrays - // and desugar them properly. Since most things eventually sink into - // c_arg_type, this is a good guard against something forgetting to - // specially handle arrays! - // - // But also it just isn't legal to pass an array by-value in C - // (it decays to a pointer, so you need to wrap it in Ref for - // other ABIs to understand that's what we're doing. - return Err(GenerateError::CUnsupported( - "C Arrays can't be passed directly, wrap this in Ref".to_string(), - )); - } - Struct(name, _) => format!("struct {name}"), - Float(FloatVal::c_double(_)) => "double".to_string(), - Float(FloatVal::c_float(_)) => "float".to_string(), - Int(int_val) => match int_val { - c__int128(_) => "__int128_t".to_string(), - c_int64_t(_) => "int64_t".to_string(), - c_int32_t(_) => "int32_t".to_string(), - c_int16_t(_) => "int16_t".to_string(), - c_int8_t(_) => "int8_t".to_string(), - c__uint128(_) => "__uint128_t".to_string(), - c_uint64_t(_) => "uint64_t".to_string(), - c_uint32_t(_) => "uint32_t".to_string(), - c_uint16_t(_) => "uint16_t".to_string(), - c_uint8_t(_) => "uint8_t".to_string(), - }, - }; - Ok(val) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - Ok(format!( - "{} {field_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - - /// An expression that generates this value. - pub fn c_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => self.c_val(pointee)?, - Ptr(addr) => format!("(void*){addr:#X}ull"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, elem) in vals.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = (self.c_val(elem)?).to_string(); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Struct(_name, fields) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, field) in fields.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0f") - } else { - format!("{val}f") - } - } - Int(int_val) => match *int_val { - c__int128(val) => { - let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") - } - c__uint128(val) => { - let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c_uint64_t(val) => format!("{val}ull"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(val) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn c_write_val( - &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.c_var_paths(val, from, is_var_root)? { - writeln!( - output, - " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" - ) - .unwrap(); - } - write!(output, " FINISHED_VAL({to});").unwrap(); - - Ok(output) - } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for c_write_val's use. - fn c_var_paths( - &self, - val: &Val, - from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.c_var_paths(field, &base, false)?); - } - paths - } - Val::Ref(pointee) => { - if is_var_root { - self.c_var_paths(pointee, from, false)? - } else if let Val::Array(_) = &**pointee { - self.c_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.c_var_paths(pointee, &base, false)? - } - } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.c_var_paths(elem, &base, false)?); - } - paths - } - }; - - Ok(paths) - } - - /* - /// Format specifiers for C types, for print debugging. - /// This is no longer used but it's a shame to throw out. - pub fn cfmt(&self, val: &Val) -> &'static str { - use Val::*; - use IntVal::*; - match val { - Ref(x) => self.cfmt(x), - Ptr(_) => "\"p\"", - Bool(_) => "\"d\"", - Array(_) => { - todo!() - } - Struct(_name, _fields) => { - todo!() - } - Float(FloatVal::c_double(_val)) => "\"f\"", - Float(FloatVal::c_float(_val)) => "\"f\"", - Int(int_val) => match int_val { - c_uint8_t(..) => "PRIu8", - c_uint16_t(..) => "PRIu16", - c_uint32_t(..) => "PRIu32", - c_uint64_t(..) => "PRIu64", - c_uint128_t(..) => "PRIu128", - - c_int8_t(..) => "PRId8", - c_int16_t(..) => "PRId16", - c_int32_t(..) => "PRId32", - c_int64_t(..) => "PRId64", - c_int128_t(..) => "PRId128", - } - } - } - */ } diff --git a/src/abis/c/declare.rs b/src/abis/c/declare.rs new file mode 100644 index 0000000..14748d1 --- /dev/null +++ b/src/abis/c/declare.rs @@ -0,0 +1,532 @@ +use super::*; +use kdl_script::parse::{Attr, AttrAligned, AttrPacked, AttrPassthrough, AttrRepr, LangRepr, Repr}; +use kdl_script::types::{AliasTy, ArrayTy, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; +use std::fmt::Write; + +impl CcAbiImpl { + pub fn generate_caller_externs( + &self, + f: &mut Fivemat, + state: &TestState, + ) -> Result<(), GenerateError> { + let convention_decl = self.convention_decl(state.options.convention)?; + writeln!(f, "extern \"{convention_decl}\" {{",)?; + f.add_indent(1); + for &func in &state.desired_funcs { + self.generate_signature(f, state, func)?; + writeln!(f, ";")?; + } + f.sub_indent(1); + writeln!(f, "}}")?; + writeln!(f)?; + Ok(()) + } + + pub fn generate_definitions( + &self, + f: &mut Fivemat, + state: &mut TestState, + ) -> Result<(), GenerateError> { + self.write_harness_prefix(f, state)?; + + for def in state.defs.definitions(state.desired_funcs.iter().copied()) { + match def { + kdl_script::Definition::DeclareTy(ty) => { + debug!("declare ty {}", state.types.format_ty(ty)); + self.generate_forward_decl(f, state, ty)?; + } + kdl_script::Definition::DefineTy(ty) => { + debug!("define ty {}", state.types.format_ty(ty)); + self.generate_tydef(f, state, ty)?; + } + kdl_script::Definition::DefineFunc(_) => { + // we'd buffer these up to generate them all at the end, + // but we've already got them buffered, so... do nothing. + } + kdl_script::Definition::DeclareFunc(_) => { + // nothing to do, executable kdl-script isn't real and can't hurt us + } + } + } + + Ok(()) + } + + pub fn intern_tyname(&self, state: &mut TestState, ty: TyIdx) -> Result<(), GenerateError> { + // Don't double-intern + if state.tynames.contains_key(&ty) { + return Ok(()); + } + + let (prefix, suffix) = match state.types.realize_ty(ty) { + // Structural types that don't need definitions but we should + // intern the name of + Ty::Primitive(prim) => { + let name = match prim { + PrimitiveTy::I8 => "int8_t ", + PrimitiveTy::I16 => "int16_t ", + PrimitiveTy::I32 => "int32_4 ", + PrimitiveTy::I64 => "int64_t ", + PrimitiveTy::I128 => "__int128_t ", + PrimitiveTy::U8 => "uint8_t ", + PrimitiveTy::U16 => "uint16_t ", + PrimitiveTy::U32 => "uint32_t ", + PrimitiveTy::U64 => "uint64_t ", + PrimitiveTy::U128 => "__uint128_t ", + PrimitiveTy::F32 => "float ", + PrimitiveTy::F64 => "double ", + PrimitiveTy::Bool => "bool ", + PrimitiveTy::Ptr => "void *", + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("c doesn't have i256?".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("c doesn't have u256?".to_owned()))? + } + PrimitiveTy::F16 => { + Err(UnsupportedError::Other("c doesn't have f16?".to_owned()))? + } + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("c doesn't have f128?".to_owned()))? + } + }; + (name.to_owned(), None) + } + Ty::Array(ArrayTy { elem_ty, len }) => { + let (pre, post) = &state.tynames[elem_ty]; + (pre.clone(), Some(format!("[{len}]{post}"))) + } + Ty::Ref(RefTy { pointee_ty }) => { + let (pre, post) = &state.tynames[pointee_ty]; + // If the last type modifier was postfix (an array dimension) + // Then we need to introduce a set of parens to make this pointer + // bind more tightly + let was_postfix = matches!(state.types.realize_ty(*pointee_ty), Ty::Array(_)); + if was_postfix { + (format!("{pre}(*"), Some(format!("){post}"))) + } else { + (format!("{pre}*"), Some(post.clone())) + } + } + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => (struct_ty.name.to_string(), None), + Ty::Union(union_ty) => (union_ty.name.to_string(), None), + Ty::Enum(enum_ty) => (enum_ty.name.to_string(), None), + Ty::Tagged(tagged_ty) => (tagged_ty.name.to_string(), None), + Ty::Alias(alias_ty) => (alias_ty.name.to_string(), None), + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + let (pre, post) = state.tynames[&real_ty].clone(); + (pre, Some(post)) + } + Ty::Empty => { + return Err(UnsupportedError::Other( + "c doesn't have empty tuples".to_owned(), + ))? + } + }; + + state + .tynames + .insert(ty, (prefix, suffix.unwrap_or_default())); + + Ok(()) + } + + pub fn generate_forward_decl( + &self, + f: &mut Fivemat, + state: &mut TestState, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Make sure our own name is interned + self.intern_tyname(state, ty)?; + + match state.types.realize_ty(ty) { + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let ty_name = &struct_ty.name; + writeln!(f, "typedef struct {ty_name} {ty_name};")?; + } + Ty::Union(union_ty) => { + let ty_name = &union_ty.name; + writeln!(f, "typedef union {ty_name} {ty_name};")?; + } + Ty::Enum(enum_ty) => { + let ty_name = &enum_ty.name; + writeln!(f, "typedef enum {ty_name} {ty_name};")?; + } + Ty::Tagged(tagged_ty) => { + let ty_name = &tagged_ty.name; + writeln!(f, "typedef struct {ty_name} {ty_name};")?; + } + Ty::Alias(AliasTy { name, real, attrs }) => { + if !attrs.is_empty() { + return Err(UnsupportedError::Other( + "don't yet know how to apply attrs to aliases".to_string(), + ))?; + } + let (pre, post) = &state.tynames[real]; + writeln!(f, "typedef {pre}{name}{post};\n")?; + } + Ty::Pun(..) => { + // Puns should be evaporated by the type name interner + } + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 + | PrimitiveTy::I16 + | PrimitiveTy::I32 + | PrimitiveTy::I64 + | PrimitiveTy::I128 + | PrimitiveTy::I256 + | PrimitiveTy::U8 + | PrimitiveTy::U16 + | PrimitiveTy::U32 + | PrimitiveTy::U64 + | PrimitiveTy::U128 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + // Builtin + } + }; + } + Ty::Array(ArrayTy { .. }) => { + // Builtin + } + Ty::Ref(RefTy { .. }) => { + // Builtin + } + Ty::Empty => { + return Err(UnsupportedError::Other( + "c doesn't have empty tuples".to_owned(), + ))?; + } + } + Ok(()) + } + + pub fn generate_tydef( + &self, + f: &mut Fivemat, + state: &mut TestState, + ty: TyIdx, + ) -> Result<(), GenerateError> { + // Make sure our own name is interned + self.intern_tyname(state, ty)?; + + match state.types.realize_ty(ty) { + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + // Emit an actual struct decl + self.generate_repr_attr(f, &struct_ty.attrs, "struct")?; + writeln!(f, "typedef struct {} {{", struct_ty.name)?; + f.add_indent(1); + for field in &struct_ty.fields { + let field_name = &field.ident; + let (pre, post) = &state.tynames[&field.ty]; + writeln!(f, "{pre}{field_name}{post};")?; + } + f.sub_indent(1); + writeln!(f, "}} {};\n", struct_ty.name)?; + } + Ty::Union(union_ty) => { + // Emit an actual union decl + self.generate_repr_attr(f, &union_ty.attrs, "union")?; + writeln!(f, "typedef union {} {{", union_ty.name)?; + f.add_indent(1); + for field in &union_ty.fields { + let field_name = &field.ident; + let (pre, post) = &state.tynames[&field.ty]; + writeln!(f, "{pre}{field_name}{post};")?; + } + f.sub_indent(1); + writeln!(f, "}} {};\n", union_ty.name)?; + } + Ty::Enum(enum_ty) => { + // Emit an actual enum decl + self.generate_repr_attr(f, &enum_ty.attrs, "enum")?; + writeln!(f, "typedef enum {} {{", enum_ty.name)?; + f.add_indent(1); + for variant in &enum_ty.variants { + let variant_name = &variant.name; + writeln!(f, "{variant_name};")?; + } + f.sub_indent(1); + writeln!(f, "}} {};\n", enum_ty.name)?; + } + Ty::Tagged(tagged_ty) => { + return Err(UnsupportedError::Other( + "c doesn't have tagged unions impled yet".to_owned(), + ))?; + /* + // Emit an actual enum decl + self.generate_repr_attr(f, &tagged_ty.attrs, "tagged")?; + writeln!(f, "typedef struct {} {{", tagged_ty.name)?; + f.add_indent(1); + for variant in &tagged_ty.variants { + let variant_name = &variant.name; + if let Some(fields) = &variant.fields { + writeln!(f, "{variant_name} {{")?; + f.add_indent(1); + for field in fields { + let field_name = &field.ident; + let field_tyname = state + .borrowed_tynames + .get(&field.ty) + .unwrap_or(&state.tynames[&field.ty]); + writeln!(f, "{field_name}: {field_tyname},")?; + } + f.sub_indent(1); + writeln!(f, "}},")?; + } else { + writeln!(f, "{variant_name},")?; + } + } + f.sub_indent(1); + writeln!(f, "}} {};\n", tagged_ty.name)?; + */ + } + Ty::Alias(_) => { + // Just reuse the other impl + self.generate_forward_decl(f, state, ty)?; + } + Ty::Pun(..) => { + // Puns should be evaporated by the type name interner + } + Ty::Primitive(prim) => { + match prim { + PrimitiveTy::I8 + | PrimitiveTy::I16 + | PrimitiveTy::I32 + | PrimitiveTy::I64 + | PrimitiveTy::I128 + | PrimitiveTy::I256 + | PrimitiveTy::U8 + | PrimitiveTy::U16 + | PrimitiveTy::U32 + | PrimitiveTy::U64 + | PrimitiveTy::U128 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + // Builtin + } + }; + } + Ty::Array(ArrayTy { .. }) => { + // Builtin + } + Ty::Ref(RefTy { .. }) => { + // Builtin + } + Ty::Empty => { + return Err(UnsupportedError::Other( + "c doesn't have empty tuples".to_owned(), + ))?; + } + } + Ok(()) + } + + pub fn generate_repr_attr( + &self, + f: &mut Fivemat, + attrs: &[Attr], + _ty_style: &str, + ) -> Result<(), GenerateError> { + if !attrs.is_empty() { + return Err(UnsupportedError::Other( + "c doesn't support attrs yet".to_owned(), + ))?; + } + + /* + let mut default_c_repr = true; + let mut repr_attrs = vec![]; + let mut other_attrs = vec![]; + for attr in attrs { + match attr { + Attr::Align(AttrAligned { align }) => { + repr_attrs.push(format!("align({})", align.val)); + } + Attr::Packed(AttrPacked {}) => { + repr_attrs.push("packed".to_owned()); + } + Attr::Passthrough(AttrPassthrough(attr)) => { + other_attrs.push(attr.to_string()); + } + Attr::Repr(AttrRepr { reprs }) => { + // Any explicit repr attributes disables default C + default_c_repr = false; + for repr in reprs { + let val = match repr { + Repr::Primitive(prim) => match prim { + PrimitiveTy::I8 => "i8", + PrimitiveTy::I16 => "i16", + PrimitiveTy::I32 => "i32", + PrimitiveTy::I64 => "i64", + PrimitiveTy::I128 => "i128", + PrimitiveTy::U8 => "u8", + PrimitiveTy::U16 => "u16", + PrimitiveTy::U32 => "u32", + PrimitiveTy::U64 => "u64", + PrimitiveTy::U128 => "u128", + PrimitiveTy::I256 + | PrimitiveTy::U256 + | PrimitiveTy::F16 + | PrimitiveTy::F32 + | PrimitiveTy::F64 + | PrimitiveTy::F128 + | PrimitiveTy::Bool + | PrimitiveTy::Ptr => { + return Err(UnsupportedError::Other(format!( + "unsupport repr({prim:?})" + )))?; + } + }, + Repr::Lang(LangRepr::C) => "C", + Repr::Lang(LangRepr::Rust) => { + continue; + } + Repr::Transparent => "transparent", + }; + repr_attrs.push(val.to_owned()); + } + } + } + } + if default_c_repr { + repr_attrs.push("C".to_owned()); + } + write!(f, "#[repr(")?; + let mut multi = false; + for repr in repr_attrs { + if multi { + write!(f, ", ")?; + } + multi = true; + write!(f, "{repr}")?; + } + writeln!(f, ")]")?; + for attr in other_attrs { + writeln!(f, "{}", attr)?; + } + */ + Ok(()) + } + + pub fn generate_signature( + &self, + f: &mut Fivemat, + state: &TestState, + func: FuncIdx, + ) -> Result<(), GenerateError> { + let function = state.types.realize_func(func); + + if let Some(output) = function.outputs.first() { + let (pre, post) = &state.tynames[&output.ty]; + write!(f, "{pre}{}{post}(", function.name)?; + } else { + write!(f, "void {}(", function.name)?; + } + let mut multiarg = false; + // Add inputs + for arg in &function.inputs { + if multiarg { + write!(f, ", ")?; + } + multiarg = true; + let arg_name = &arg.name; + let (pre, post) = &state.tynames[&arg.ty]; + write!(f, "{pre}{}{post}", arg_name)?; + } + Ok(()) + } + + pub fn convention_decl( + &self, + convention: CallingConvention, + ) -> Result<&'static str, GenerateError> { + use CCFlavor::*; + use CallingConvention::*; + use Platform::*; + // GCC (as __attribute__'s) + // + // * x86: cdecl, fastcall, thiscall, stdcall, + // sysv_abi, ms_abi (64-bit: -maccumulate-outgoing-args?), + // naked, interrupt, sseregparm + // * ARM: pcs="aapcs", pcs="aapcs-vfp", + // long_call, short_call, naked, + // interrupt("IRQ", "FIQ", "SWI", "ABORT", "UNDEF"), + // + // MSVC (as ~keywords) + // + // * __cdecl, __clrcall, __stdcall, __fastcall, __thiscall, __vectorcall + + let val = match convention { + System | Win64 | Sysv64 | Aapcs => { + // Don't want to think about these yet, I think they're + // all properly convered by other ABIs + return Err(self.unsupported_convention(&convention))?; + } + C => "", + Cdecl => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__cdecl ", + Gcc | Clang => "__attribute__((cdecl)) ", + } + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + Stdcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__stdcall ", + Gcc | Clang => "__attribute__((stdcall)) ", + } + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + Fastcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__fastcall ", + Gcc | Clang => "__attribute__((fastcall)) ", + } + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + Vectorcall => { + if self.platform == Windows { + match self.cc_flavor { + Msvc => "__vectorcall ", + Gcc | Clang => "__attribute__((vectorcall)) ", + } + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + }; + + Ok(val) + } + + fn unsupported_convention(&self, convention: &CallingConvention) -> UnsupportedError { + UnsupportedError::Other(format!("unsupported convention {convention}")) + } +} diff --git a/src/abis/c/init.rs b/src/abis/c/init.rs new file mode 100644 index 0000000..344581d --- /dev/null +++ b/src/abis/c/init.rs @@ -0,0 +1,259 @@ +use super::*; +use kdl_script::types::{AliasTy, ArrayTy, PrimitiveTy, RefTy, Ty, TyIdx}; +use std::fmt::Write; +use vals::{ArgValuesIter, Value}; + +impl CcAbiImpl { + pub fn init_leaf_value( + &self, + f: &mut Fivemat, + state: &TestState, + ty: TyIdx, + val: &Value, + alias: Option<&str>, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(ty) { + // Primitives are the only "real" values with actual bytes that advance val_idx + Ty::Primitive(prim) => match prim { + PrimitiveTy::I8 => write!(f, "{}", val.generate_i8())?, + PrimitiveTy::I16 => write!(f, "{}", val.generate_i16())?, + PrimitiveTy::I32 => write!(f, "{}", val.generate_i32())?, + PrimitiveTy::I64 => write!(f, "{}", val.generate_i64())?, + PrimitiveTy::U8 => write!(f, "{}", val.generate_u8())?, + PrimitiveTy::U16 => write!(f, "{}", val.generate_u16())?, + PrimitiveTy::U32 => write!(f, "{}", val.generate_u32())?, + PrimitiveTy::U64 => write!(f, "{}ull", val.generate_u64())?, + PrimitiveTy::I128 => { + let val = val.generate_u128(); + let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + write!( + f, + "((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)" + )? + } + PrimitiveTy::U128 => { + let val = val.generate_u128(); + let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + write!( + f, + "((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)" + )? + } + + PrimitiveTy::F32 => { + let val = f32::from_bits(val.generate_u32()); + if val.fract() == 0.0 { + write!(f, "{val}.0f")? + } else { + write!(f, "{val}f")? + } + } + PrimitiveTy::F64 => { + let val = f64::from_bits(val.generate_u64()); + if val.fract() == 0.0 { + write!(f, "{val}.0")? + } else { + write!(f, "{val}")? + } + } + PrimitiveTy::Bool => write!(f, "true")?, + PrimitiveTy::Ptr => { + if true { + write!(f, "(void*){:#X}ull", val.generate_u64())? + } else { + write!(f, "(void*){:#X}ul", val.generate_u32())? + } + } + PrimitiveTy::I256 => { + Err(UnsupportedError::Other("c doesn't have i256?".to_owned()))? + } + PrimitiveTy::U256 => { + Err(UnsupportedError::Other("c doesn't have u256?".to_owned()))? + } + PrimitiveTy::F16 => Err(UnsupportedError::Other("c doesn't have f16?".to_owned()))?, + PrimitiveTy::F128 => { + Err(UnsupportedError::Other("c doesn't have f128?".to_owned()))? + } + }, + Ty::Enum(enum_ty) => { + let name = alias.unwrap_or(&enum_ty.name); + if let Some(variant) = val.select_val(&enum_ty.variants) { + let variant_name = &variant.name; + write!(f, "{name}_{variant_name}")?; + } + } + _ => unreachable!("only primitives and enums should be passed to generate_leaf_value"), + } + Ok(()) + } + + #[allow(clippy::too_many_arguments)] + pub fn init_value( + &self, + f: &mut Fivemat, + state: &TestState, + ty: TyIdx, + vals: &mut ArgValuesIter, + alias: Option<&str>, + ref_temp_name: &str, + extra_decls: &mut Vec, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(ty) { + // Primitives and Enums are the only "real" values with actual bytes + Ty::Primitive(_) | Ty::Enum(_) => { + let val = vals.next_val(); + self.init_leaf_value(f, state, ty, &val, alias)?; + } + Ty::Ref(RefTy { pointee_ty }) => { + // The value is a mutable reference to a temporary + write!(f, "&{ref_temp_name}")?; + + // TODO: should this be a recursive call to create_var (need create_var_inner?) + // Now do the rest of the recursion on constructing the temporary + let mut ref_temp = String::new(); + let mut ref_temp_f = Fivemat::new(&mut ref_temp, INDENT); + let (pre, post) = &state.tynames[pointee_ty]; + write!(&mut ref_temp_f, "{pre}{ref_temp_name}{post} = ")?; + let ref_temp_name = format!("{ref_temp_name}_"); + self.init_value( + &mut ref_temp_f, + state, + *pointee_ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + write!(&mut ref_temp_f, ";")?; + extra_decls.push(ref_temp); + } + Ty::Array(ArrayTy { elem_ty, len }) => { + write!(f, "{{")?; + for arr_idx in 0..*len { + if arr_idx > 0 { + write!(f, ", ")?; + } + let ref_temp_name = format!("{ref_temp_name}{arr_idx}_"); + self.init_value(f, state, *elem_ty, vals, alias, &ref_temp_name, extra_decls)?; + } + write!(f, "}}")?; + } + // Nominal types we need to emit a decl for + Ty::Struct(struct_ty) => { + let name = alias.unwrap_or(&struct_ty.name); + write!(f, "{{ ")?; + for (field_idx, field) in struct_ty.fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, ".{field_name} = ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.init_value(f, state, field.ty, vals, alias, &ref_temp_name, extra_decls)?; + } + write!(f, " }}")?; + } + Ty::Union(union_ty) => { + let name = alias.unwrap_or(&union_ty.name); + write!(f, "{{ ")?; + let tag_val = vals.next_val(); + if let Some(field) = tag_val.select_val(&union_ty.fields) { + let field_name = &field.ident; + write!(f, ".{field_name} = ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.init_value(f, state, field.ty, vals, alias, &ref_temp_name, extra_decls)?; + } + write!(f, " }}")?; + } + + Ty::Tagged(tagged_ty) => { + return Err(UnsupportedError::Other( + "c doesn't have tagged unions impled yet".to_owned(), + ))?; + /* + let name = alias.unwrap_or(&tagged_ty.name); + let tag_val = vals.next_val(); + if let Some(variant) = tag_val.select_val(&tagged_ty.variants) { + let variant_name = &variant.name; + write!(f, "{name}::{variant_name}")?; + if let Some(fields) = &variant.fields { + write!(f, " {{ ")?; + for (field_idx, field) in fields.iter().enumerate() { + if field_idx > 0 { + write!(f, ", ")?; + } + let field_name = &field.ident; + write!(f, "{field_name}: ")?; + let ref_temp_name = format!("{ref_temp_name}{field_name}_"); + self.init_value( + f, + state, + field.ty, + vals, + alias, + &ref_temp_name, + extra_decls, + )?; + } + write!(f, " }}")?; + } + } + */ + } + Ty::Alias(AliasTy { real, name, .. }) => { + let alias = alias.or_else(|| Some(name)); + self.init_value(f, state, *real, vals, alias, ref_temp_name, extra_decls)?; + } + + // Puns should be evaporated + Ty::Pun(pun) => { + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + self.init_value(f, state, real_ty, vals, alias, ref_temp_name, extra_decls)?; + } + + Ty::Empty => { + return Err(UnsupportedError::Other( + "c doesn't have empty tuples".to_owned(), + ))? + } + }; + + Ok(()) + } + + pub fn init_var( + &self, + f: &mut Fivemat, + state: &TestState, + var_name: &str, + var_ty: TyIdx, + mut vals: ArgValuesIter, + ) -> Result<(), GenerateError> { + // Generate the input + let needs_mut = false; + let let_mut = if needs_mut { "let mut" } else { "let" }; + let mut real_var_decl = String::new(); + let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); + let mut extra_decls = Vec::new(); + write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; + let ref_temp_name = format!("{var_name}_"); + self.init_value( + &mut real_var_decl_f, + state, + var_ty, + &mut vals, + None, + &ref_temp_name, + &mut extra_decls, + )?; + writeln!(&mut real_var_decl, ";")?; + + for decl in extra_decls { + writeln!(f, "{}", decl)?; + } + writeln!(f, "{}", real_var_decl)?; + Ok(()) + } +} diff --git a/src/abis/c/write.rs b/src/abis/c/write.rs new file mode 100644 index 0000000..b21a3bd --- /dev/null +++ b/src/abis/c/write.rs @@ -0,0 +1,295 @@ +use super::*; +use kdl_script::types::{Ty, TyIdx}; +use std::fmt::Write; +use vals::Value; + +impl CcAbiImpl { + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + pub fn write_harness_prefix( + &self, + f: &mut Fivemat, + state: &TestState, + ) -> Result<(), GenerateError> { + // Always need includes for things like int8_t + writeln!(f, "{}", TEST_PREFIX)?; + // No extra harness gunk if not needed + if state.options.val_writer != WriteImpl::HarnessCallback { + return Ok(()); + } + // Load test harness "headers" + writeln!(f, "{}", HARNESS_PREFIX)?; + + writeln!(f)?; + + Ok(()) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + pub fn write_var( + &self, + f: &mut Fivemat, + state: &TestState, + var_name: &str, + var_ty: TyIdx, + mut vals: ArgValuesIter, + to: &str, + ) -> Result<(), GenerateError> { + // If we're generating a minimized test, skip this + if !vals.should_write_arg(&state.options) { + return Ok(()); + } + // If noop, don't bother doing anything (avoids tagged union matches being generated) + if let WriteImpl::Noop = state.options.val_writer { + return Ok(()); + }; + self.write_fields(f, state, to, var_name, var_ty, &mut vals)?; + + // If doing full harness callbacks, signal we wrote all the fields of a variable + if let WriteImpl::HarnessCallback = state.options.val_writer { + writeln!(f, "finished_val({to});")?; + writeln!(f)?; + } + Ok(()) + } + + /// Recursive subroutine of write_var, which builds up rvalue paths and generates + /// appropriate match statements. Actual WRITE calls are done by write_leaf_field. + pub fn write_fields( + &self, + f: &mut Fivemat, + state: &TestState, + to: &str, + from: &str, + var_ty: TyIdx, + vals: &mut ArgValuesIter, + ) -> Result<(), GenerateError> { + match state.types.realize_ty(var_ty) { + Ty::Primitive(_) | Ty::Enum(_) => { + // Hey an actual leaf, report it (and burn a value) + let val = vals.next_val(); + if val.should_write_val(&state.options) { + self.write_leaf_field(f, state, to, from, &val)?; + } + } + Ty::Empty => { + // nothing worth producing + } + Ty::Alias(alias_ty) => { + // keep going but with the type changed + self.write_fields(f, state, to, from, alias_ty.real, vals)?; + } + Ty::Pun(pun) => { + // keep going but with the type changed + let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); + self.write_fields(f, state, to, from, real_ty, vals)? + } + Ty::Array(array_ty) => { + // recurse into each array index + for i in 0..array_ty.len { + let base = format!("{from}[{i}]"); + self.write_fields(f, state, to, &base, array_ty.elem_ty, vals)?; + } + } + Ty::Struct(struct_ty) => { + // recurse into each field + for field in &struct_ty.fields { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + Ty::Tagged(tagged_ty) => { + return Err(UnsupportedError::Other( + "c doesn't have tagged unions impled yet".to_owned(), + ))?; + /* + // Process the implicit "tag" value + let tag_generator = vals.next_val(); + let tag_idx = tag_generator.generate_idx(tagged_ty.variants.len()); + if let Some(variant) = tagged_ty.variants.get(tag_idx) { + let tagged_name = &tagged_ty.name; + let variant_name = &variant.name; + let pat = match &variant.fields { + Some(fields) => { + // Variant with fields, recurse into them + let field_list = fields + .iter() + .map(|f| f.ident.to_string()) + .collect::>() + .join(", "); + format!("{tagged_name}::{variant_name} {{ {field_list} }}") + } + None => { + // Variant without fields, still need the pattern to check the tag + format!("{tagged_name}::{variant_name}") + } + }; + + // We're going to make an if-let for the case we expect, but there might not + // be anything we care about in here (especially with should_write_val) so we + // buffer up if and else branches and then only emit the if-let if one of them + // is non-empty + let if_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; + } + if let Some(fields) = &variant.fields { + for field in fields { + // Do the ugly deref thing to deal with pattern autoref + let base = format!("(*{})", field.ident); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + f.sub_indent(1); + temp_out + }; + // Add an else case to complain that the variant is wrong + let else_branch = { + let mut temp_out = String::new(); + let f = &mut Fivemat::new(&mut temp_out, INDENT); + f.add_indent(1); + if tag_generator.should_write_val(&state.options) { + self.write_error_tag_field(f, state, to)?; + } + f.sub_indent(1); + temp_out + }; + + let if_has_content = !if_branch.trim().is_empty(); + let else_has_content = !else_branch.trim().is_empty(); + if if_has_content || else_has_content { + writeln!(f, "if let {pat} = &{from} {{")?; + write!(f, "{}", if_branch)?; + write!(f, "}}")?; + } + if else_has_content { + writeln!(f, " else {{")?; + write!(f, "{}", else_branch)?; + writeln!(f, "}}")?; + } + } + */ + } + Ty::Ref(ref_ty) => { + // Add a deref, and recurse into the pointee + let base = format!("(*{from})"); + self.write_fields(f, state, to, &base, ref_ty.pointee_ty, vals)? + } + Ty::Union(union_ty) => { + // Process the implicit "tag" value + let tag_generator = vals.next_val(); + let tag_idx = tag_generator.generate_idx(union_ty.fields.len()); + if tag_generator.should_write_val(&state.options) { + self.write_tag_field(f, state, to, tag_idx)?; + } + if let Some(field) = union_ty.fields.get(tag_idx) { + let field_name = &field.ident; + let base = format!("{from}.{field_name}"); + self.write_fields(f, state, to, &base, field.ty, vals)?; + } + } + }; + Ok(()) + } + + /// WRITE an actual indivisible value (primitive or c-like enum) + pub fn write_leaf_field( + &self, + f: &mut Fivemat, + state: &TestState, + to: &str, + path: &str, + val: &Value, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + // Convenience for triggering test failures + if path.contains("abicafepoison") && to.contains(VAR_CALLEE_INPUTS) { + writeln!(f, "write_field({to}, (uint32_t)0x12345678);")?; + } else { + writeln!(f, "write_field({to}, {path});")?; + } + } + WriteImpl::Assert => { + write!(f, "assert_eq({path}, ")?; + self.init_leaf_value(f, state, val.ty, val, None)?; + writeln!(f, ");")?; + } + WriteImpl::Print => { + writeln!(f, "printf(\"%d\", {path});")?; + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_tag_field( + &self, + f: &mut Fivemat, + state: &TestState, + to: &str, + variant_idx: usize, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, (uint32_t){});", variant_idx)?; + } + WriteImpl::Assert => { + // Noop, do nothing + } + WriteImpl::Print => { + // Noop, do nothing + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_error_tag_field( + &self, + f: &mut Fivemat, + state: &TestState, + to: &str, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "write_field({to}, (uint32_t){});", u32::MAX)?; + } + WriteImpl::Assert | WriteImpl::Print => { + writeln!(f, r#"unreachable("enum had unexpected variant!?")"#)?; + } + WriteImpl::Noop => { + // Noop, do nothing + } + } + Ok(()) + } + + pub fn write_end_function( + &self, + f: &mut dyn Write, + state: &TestState, + inputs: &str, + outputs: &str, + ) -> Result<(), GenerateError> { + match state.options.val_writer { + WriteImpl::HarnessCallback => { + writeln!(f, "finished_func({inputs}, {outputs});")?; + } + WriteImpl::Print | WriteImpl::Noop | WriteImpl::Assert => { + // Noop + } + } + Ok(()) + } +} diff --git a/src/abis/c_old.rs b/src/abis/c_old.rs new file mode 100644 index 0000000..444c590 --- /dev/null +++ b/src/abis/c_old.rs @@ -0,0 +1,601 @@ + + +impl AbiImpl for CcAbiImpl { + fn generate_callee( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + self.write_c_signature(f, function, convention)?; + writeln!(f, " {{")?; + + writeln!(f)?; + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + "{}", + self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? + )?; + } + writeln!(f)?; + if let Some(output) = &function.output { + writeln!( + f, + " {} = {};", + self.c_var_decl(output, OUTPUT_NAME)?, + self.c_val(output)? + )?; + writeln!( + f, + "{}", + self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? + )?; + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + writeln!( + f, + " {}", + self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? + )?; + } else { + writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; + } + writeln!(f, "}}")?; + writeln!(f)?; + } + + Ok(()) + } + + fn generate_caller( + &self, + f: &mut dyn Write, + test: &Test, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + self.write_c_prefix(f, test)?; + + // Generate the extern block + for function in &test.funcs { + self.write_c_signature(f, function, convention)?; + writeln!(f, ";")?; + } + + writeln!(f)?; + writeln!(f, "void do_test(void) {{")?; + + // Generate the impls + for function in &test.funcs { + if !function.has_convention(convention) { + continue; + } + // Add an extra scope to avoid clashes between subtests + writeln!(f, "{{")?; + // Inputs + for (idx, input) in function.inputs.iter().enumerate() { + writeln!( + f, + " {} = {};", + self.c_var_decl(input, ARG_NAMES[idx])?, + self.c_val(input)? + )?; + writeln!( + f, + "{}", + self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? + )?; + } + writeln!(f)?; + + // Output + let pass_out = if let Some(output) = &function.output { + if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { + writeln!(f, " {};", out_param_var)?; + write!(f, " ")?; + true + } else { + write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; + false + } + } else { + write!(f, " ")?; + false + }; + + // Do the actual call + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; + } + if pass_out { + let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; + if function.inputs.is_empty() { + write!(f, "{}", pass)?; + } else { + write!(f, ", {}", pass)?; + } + } + writeln!(f, ");")?; + + if let Some(output) = &function.output { + writeln!( + f, + "{}", + self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? + )?; + } + writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; + writeln!(f, "}}")?; + writeln!(f)?; + } + writeln!(f, "}}")?; + Ok(()) + } + +} + +impl CcAbiImpl { + + // Emit a function signature + fn write_c_signature( + &self, + f: &mut dyn Write, + function: &Func, + convention: CallingConvention, + ) -> Result<(), GenerateError> { + let convention_decl = self.c_convention_decl(convention)?; + + // First figure out the return (by-ref requires an out-param) + let out_param = if let Some(output) = &function.output { + let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; + if out_param.is_none() { + write!(f, "{} ", self.c_arg_type(output)?)?; + } else { + write!(f, "void ")?; + } + out_param + } else { + write!(f, "void ")?; + None + }; + + write!(f, "{}", convention_decl)?; + + // Now write out the args + write!(f, "{}(", function.name)?; + for (idx, input) in function.inputs.iter().enumerate() { + if idx != 0 { + write!(f, ", ")?; + } + write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; + } + + // Add extra implicit args + if let Some(out_param) = out_param { + if !function.inputs.is_empty() { + write!(f, ", ")?; + } + write!(f, "{out_param}")?; + } else if function.inputs.is_empty() { + write!(f, "void")?; + } + write!(f, ")")?; + + Ok(()) + } + + /// Every test should start by loading in the harness' "header" + /// and forward-declaring any structs that will be used. + fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { + // Load test harness "headers" + write!(f, "{}", C_TEST_PREFIX)?; + + // Forward-decl struct types + let mut forward_decls = std::collections::HashMap::::new(); + for function in &test.funcs { + for val in function.inputs.iter().chain(function.output.as_ref()) { + for (name, decl) in self.c_forward_decl(val)? { + match forward_decls.entry(name) { + std::collections::hash_map::Entry::Occupied(entry) => { + if entry.get() != &decl { + return Err(GenerateError::InconsistentStructDefinition { + name: entry.key().clone(), + old_decl: entry.remove(), + new_decl: decl, + }); + } + } + std::collections::hash_map::Entry::Vacant(entry) => { + writeln!(f, "{decl}")?; + entry.insert(decl); + } + } + } + } + } + + Ok(()) + } + + fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { + use Val::*; + match val { + Struct(name, fields) => { + let mut results = vec![]; + for field in fields.iter() { + results.extend(self.c_forward_decl(field)?); + } + let mut output = String::new(); + let ref_name = format!("struct {name}"); + output.push_str(&format!("struct {name} {{\n")); + for (idx, field) in fields.iter().enumerate() { + let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); + output.push_str(&line); + } + output.push_str("};\n"); + results.push((ref_name, output)); + Ok(results) + } + Array(vals) => self.c_forward_decl(&vals[0]), + Ref(pointee) => self.c_forward_decl(pointee), + _ => Ok(vec![]), + } + } + + /// The decl to use for a local var (reference-ness stripped) + fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { + use Val::*; + let val = match val { + Ref(pointee) => self.c_var_decl(pointee, var_name)?, + Array(_) => { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) + } + normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), + }; + Ok(val) + } + + /// The decl to use for a function arg (apply referenceness) + fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + format!("{}* {arg_name}", self.c_arg_type(cur_val)?) + } else { + format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) + } + } else { + format!("{} {arg_name}", self.c_arg_type(val)?) + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param( + &self, + val: &Val, + out_param_name: &str, + ) -> Result, GenerateError> { + let out = if let Val::Ref(pointee) = val { + let mut cur_val = &**pointee; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + if array_levels.is_empty() { + Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) + } else { + Some(format!( + "{} {out_param_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + } else { + None + }; + Ok(out) + } + + /// If the return type needs to be an out_param, this returns it + fn c_out_param_var( + &self, + val: &Val, + output_name: &str, + ) -> Result, GenerateError> { + if let Val::Ref(pointee) = val { + Ok(Some(self.c_var_decl(pointee, output_name)?)) + } else { + Ok(None) + } + } + + /// How to pass an argument + fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { + if let Val::Ref(pointee) = val { + if let Val::Array(_) = &**pointee { + Ok(arg_name.to_string()) + } else { + Ok(format!("&{arg_name}")) + } + } else { + Ok(arg_name.to_string()) + } + } + + /// How to return a value + fn c_var_return( + &self, + val: &Val, + var_name: &str, + out_param_name: &str, + ) -> Result { + if let Val::Ref(_) = val { + Ok(format!( + "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" + )) + } else { + Ok(format!("return {var_name};")) + } + } + + /// The type name to use for this value when it is stored in args/vars. + fn c_arg_type(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => { + let mut cur_val = &**pointee; + while let Val::Array(vals) = cur_val { + cur_val = &vals[0]; + } + format!("{}*", self.c_arg_type(cur_val)?) + } + Ptr(_) => "void*".to_string(), + Bool(_) => "bool".to_string(), + Array(_vals) => { + // C arrays are kinda fake due to how they decay in function arg + // position, so a ton of code needs to very delicately detect arrays + // and desugar them properly. Since most things eventually sink into + // c_arg_type, this is a good guard against something forgetting to + // specially handle arrays! + // + // But also it just isn't legal to pass an array by-value in C + // (it decays to a pointer, so you need to wrap it in Ref for + // other ABIs to understand that's what we're doing. + return Err(GenerateError::CUnsupported( + "C Arrays can't be passed directly, wrap this in Ref".to_string(), + )); + } + Struct(name, _) => format!("struct {name}"), + Float(FloatVal::c_double(_)) => "double".to_string(), + Float(FloatVal::c_float(_)) => "float".to_string(), + Int(int_val) => match int_val { + c__int128(_) => "__int128_t".to_string(), + c_int64_t(_) => "int64_t".to_string(), + c_int32_t(_) => "int32_t".to_string(), + c_int16_t(_) => "int16_t".to_string(), + c_int8_t(_) => "int8_t".to_string(), + c__uint128(_) => "__uint128_t".to_string(), + c_uint64_t(_) => "uint64_t".to_string(), + c_uint32_t(_) => "uint32_t".to_string(), + c_uint16_t(_) => "uint16_t".to_string(), + c_uint8_t(_) => "uint8_t".to_string(), + }, + }; + Ok(val) + } + + /// The type name to use for this value when it is stored in composite. + /// + /// This is separated out in case there's a type that needs different + /// handling in this context to conform to a layout (i.e. how C arrays + /// decay into pointers when used in function args). + fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { + let mut cur_val = val; + let mut array_levels = String::new(); + while let Val::Array(vals) = cur_val { + array_levels.push_str(&format!("[{}]", vals.len())); + cur_val = &vals[0]; + } + Ok(format!( + "{} {field_name}{array_levels}", + self.c_arg_type(cur_val)? + )) + } + + /// An expression that generates this value. + pub fn c_val(&self, val: &Val) -> Result { + use IntVal::*; + use Val::*; + let val = match val { + Ref(pointee) => self.c_val(pointee)?, + Ptr(addr) => format!("(void*){addr:#X}ull"), + Bool(val) => format!("{val}"), + Array(vals) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, elem) in vals.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = (self.c_val(elem)?).to_string(); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Struct(_name, fields) => { + let mut output = String::new(); + output.push_str("{ "); + for (idx, field) in fields.iter().enumerate() { + if idx != 0 { + output.push_str(", "); + } + let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); + output.push_str(&part); + } + output.push_str(" }"); + output + } + Float(FloatVal::c_double(val)) => { + if val.fract() == 0.0 { + format!("{val}.0") + } else { + format!("{val}") + } + } + Float(FloatVal::c_float(val)) => { + if val.fract() == 0.0 { + format!("{val}.0f") + } else { + format!("{val}f") + } + } + Int(int_val) => match *int_val { + c__int128(val) => { + let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") + } + c__uint128(val) => { + let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; + let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; + format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") + } + c_int64_t(val) => format!("{val}"), + c_int32_t(val) => format!("{val}"), + c_int16_t(val) => format!("{val}"), + c_int8_t(val) => format!("{val}"), + c_uint64_t(val) => format!("{val}ull"), + c_uint32_t(val) => format!("{val:#X}"), + c_uint16_t(val) => format!("{val:#X}"), + c_uint8_t(val) => format!("{val:#X}"), + }, + }; + Ok(val) + } + + /// Emit the WRITE calls and FINISHED_VAL for this value. + /// This will WRITE every leaf subfield of the type. + /// `to` is the BUFFER to use, `from` is the variable name of the value. + fn c_write_val( + &self, + val: &Val, + to: &str, + from: &str, + is_var_root: bool, + ) -> Result { + use std::fmt::Write; + let mut output = String::new(); + for path in self.c_var_paths(val, from, is_var_root)? { + writeln!( + output, + " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" + ) + .unwrap(); + } + write!(output, " FINISHED_VAL({to});").unwrap(); + + Ok(output) + } + + /// Compute the paths to every subfield of this value, with `from` + /// as the base path to that value, for c_write_val's use. + fn c_var_paths( + &self, + val: &Val, + from: &str, + is_var_root: bool, + ) -> Result, GenerateError> { + let paths = match val { + Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { + vec![format!("{from}")] + } + Val::Struct(_name, fields) => { + let mut paths = vec![]; + for (idx, field) in fields.iter().enumerate() { + let base = format!("{from}.{}", FIELD_NAMES[idx]); + paths.extend(self.c_var_paths(field, &base, false)?); + } + paths + } + Val::Ref(pointee) => { + if is_var_root { + self.c_var_paths(pointee, from, false)? + } else if let Val::Array(_) = &**pointee { + self.c_var_paths(pointee, from, false)? + } else { + let base = format!("(*{from})"); + self.c_var_paths(pointee, &base, false)? + } + } + Val::Array(vals) => { + let mut paths = vec![]; + for (i, elem) in vals.iter().enumerate() { + let base = format!("{from}[{i}]"); + paths.extend(self.c_var_paths(elem, &base, false)?); + } + paths + } + }; + + Ok(paths) + } + + /* + /// Format specifiers for C types, for print debugging. + /// This is no longer used but it's a shame to throw out. + pub fn cfmt(&self, val: &Val) -> &'static str { + use Val::*; + use IntVal::*; + match val { + Ref(x) => self.cfmt(x), + Ptr(_) => "\"p\"", + Bool(_) => "\"d\"", + Array(_) => { + todo!() + } + Struct(_name, _fields) => { + todo!() + } + Float(FloatVal::c_double(_val)) => "\"f\"", + Float(FloatVal::c_float(_val)) => "\"f\"", + Int(int_val) => match int_val { + c_uint8_t(..) => "PRIu8", + c_uint16_t(..) => "PRIu16", + c_uint32_t(..) => "PRIu32", + c_uint64_t(..) => "PRIu64", + c_uint128_t(..) => "PRIu128", + + c_int8_t(..) => "PRId8", + c_int16_t(..) => "PRId16", + c_int32_t(..) => "PRId32", + c_int64_t(..) => "PRId64", + c_int128_t(..) => "PRId128", + } + } + } + */ +} diff --git a/src/abis/mod.rs b/src/abis/mod.rs index 1661e0b..bc8b298 100644 --- a/src/abis/mod.rs +++ b/src/abis/mod.rs @@ -1,7 +1,10 @@ -// pub mod c; +pub mod c; pub mod rust; pub mod vals; +pub use c::CcAbiImpl; +pub use rust::RustcAbiImpl; + use std::{collections::HashMap, fmt::Write, sync::Arc}; use camino::Utf8Path; @@ -9,7 +12,6 @@ use kdl_script::{ types::{FuncIdx, TyIdx}, DefinitionGraph, PunEnv, TypedProgram, }; -pub use rust::RustcAbiImpl; use serde::Serialize; use vals::{ValueGeneratorKind, ValueTree}; @@ -223,11 +225,6 @@ impl std::ops::Deref for TestWithAbi { pub struct TestImpl { pub inner: Arc, pub options: TestOptions, - - // interning state - pub desired_funcs: Vec, - pub tynames: HashMap, - pub borrowed_tynames: HashMap, } impl std::ops::Deref for TestImpl { type Target = TestWithAbi; @@ -325,13 +322,9 @@ impl TestWithVals { impl TestWithAbi { pub fn with_options(self: &Arc, options: TestOptions) -> Result { - let desired_funcs = options.functions.active_funcs(&self.types); Ok(TestImpl { inner: self.clone(), options, - desired_funcs, - tynames: Default::default(), - borrowed_tynames: Default::default(), }) } } diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 68a2783..4ffeba0 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -15,7 +15,7 @@ use super::*; use crate::fivemat::Fivemat; use crate::vals::ArgValuesIter; -pub static RUST_TEST_PREFIX: &str = include_str!("../../harness/rust_test_prefix.rs"); +pub static RUST_HARNESS_PREFIX: &str = include_str!("../../harness/rust_harness_prefix.rs"); const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; @@ -23,6 +23,31 @@ const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; const VAR_CALLEE_OUTPUTS: &str = "CALLEE_OUTPUTS"; const INDENT: &str = " "; +pub struct TestState { + pub inner: TestImpl, + // interning state + pub desired_funcs: Vec, + pub tynames: HashMap, + pub borrowed_tynames: HashMap, +} +impl std::ops::Deref for TestState { + type Target = TestImpl; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl TestState { + fn new(inner: TestImpl) -> Self { + let desired_funcs = inner.options.functions.active_funcs(&inner.types); + Self { + inner, + desired_funcs, + tynames: Default::default(), + borrowed_tynames: Default::default(), + } + } +} + #[allow(dead_code)] pub struct RustcAbiImpl { is_nightly: bool, @@ -82,14 +107,16 @@ impl AbiImpl for RustcAbiImpl { self.compile_callee(src_path, out_dir, lib_name) } - fn generate_callee(&self, f: &mut dyn Write, mut test: TestImpl) -> Result<(), GenerateError> { + fn generate_callee(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError> { let mut f = Fivemat::new(f, INDENT); - self.generate_callee_impl(&mut f, &mut test) + let mut state = TestState::new(test); + self.generate_callee_impl(&mut f, &mut state) } - fn generate_caller(&self, f: &mut dyn Write, mut test: TestImpl) -> Result<(), GenerateError> { + fn generate_caller(&self, f: &mut dyn Write, test: TestImpl) -> Result<(), GenerateError> { let mut f = Fivemat::new(f, INDENT); - self.generate_caller_impl(&mut f, &mut test) + let mut state = TestState::new(test); + self.generate_caller_impl(&mut f, &mut state) } } @@ -97,7 +124,7 @@ impl RustcAbiImpl { pub fn generate_caller_impl( &self, f: &mut Fivemat, - state: &mut TestImpl, + state: &mut TestState, ) -> Result<(), GenerateError> { // Generate type decls and gather up functions self.generate_definitions(f, state)?; @@ -118,7 +145,7 @@ impl RustcAbiImpl { fn generate_caller_body( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, func: FuncIdx, ) -> Result<(), GenerateError> { writeln!(f, "unsafe {{")?; @@ -154,7 +181,7 @@ impl RustcAbiImpl { fn call_function( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, function: &Func, ) -> Result<(), GenerateError> { let func_name = &function.name; @@ -185,7 +212,7 @@ impl RustcAbiImpl { pub fn generate_callee_impl( &self, f: &mut Fivemat, - state: &mut TestImpl, + state: &mut TestState, ) -> Result<(), GenerateError> { // Generate type decls and gather up functions self.generate_definitions(f, state)?; @@ -200,7 +227,7 @@ impl RustcAbiImpl { fn generate_callee_body( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, func: FuncIdx, ) -> Result<(), GenerateError> { let function = state.types.realize_func(func); @@ -233,7 +260,7 @@ impl RustcAbiImpl { // Return the outputs self.check_returns(state, function)?; - for arg in function.outputs.iter() { + if let Some(arg) = function.outputs.first() { writeln!(f, "{}", arg.name)?; } f.sub_indent(1); @@ -252,7 +279,7 @@ impl RustcAbiImpl { } } - fn check_returns(&self, state: &TestImpl, function: &Func) -> Result<(), GenerateError> { + fn check_returns(&self, state: &TestState, function: &Func) -> Result<(), GenerateError> { let has_outparams = function .outputs .iter() diff --git a/src/abis/rust/declare.rs b/src/abis/rust/declare.rs index 325b758..952658f 100644 --- a/src/abis/rust/declare.rs +++ b/src/abis/rust/declare.rs @@ -7,7 +7,7 @@ impl RustcAbiImpl { pub fn generate_caller_externs( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, ) -> Result<(), GenerateError> { let convention_decl = self.convention_decl(state.options.convention)?; writeln!(f, "extern \"{convention_decl}\" {{",)?; @@ -25,7 +25,7 @@ impl RustcAbiImpl { pub fn generate_definitions( &self, f: &mut Fivemat, - state: &mut TestImpl, + state: &mut TestState, ) -> Result<(), GenerateError> { self.write_harness_prefix(f, state)?; @@ -52,7 +52,7 @@ impl RustcAbiImpl { Ok(()) } - pub fn intern_tyname(&self, state: &mut TestImpl, ty: TyIdx) -> Result<(), GenerateError> { + pub fn intern_tyname(&self, state: &mut TestState, ty: TyIdx) -> Result<(), GenerateError> { // Don't double-intern if state.tynames.contains_key(&ty) { return Ok(()); @@ -152,7 +152,7 @@ impl RustcAbiImpl { pub fn generate_tydef( &self, f: &mut Fivemat, - state: &mut TestImpl, + state: &mut TestState, ty: TyIdx, ) -> Result<(), GenerateError> { // Make sure our own name is interned @@ -385,10 +385,11 @@ impl RustcAbiImpl { pub fn generate_signature( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, func: FuncIdx, ) -> Result<(), GenerateError> { let function = state.types.realize_func(func); + self.check_returns(state, function)?; write!(f, "fn {}(", function.name)?; let mut multiarg = false; @@ -402,41 +403,11 @@ impl RustcAbiImpl { let arg_ty = &state.tynames[&arg.ty]; write!(f, "{}: {}", arg_name, arg_ty)?; } - // Add outparams - for arg in &function.outputs { - let is_outparam = state.types.ty_contains_ref(arg.ty); - if !is_outparam { - // Handled in next loop - continue; - } - if multiarg { - write!(f, ", ")?; - } - multiarg = true; - // NOTE: we intentionally don't use the "borrowed" tyname - // as we still don't need lifetimes here! - let arg_name = &arg.name; - let arg_ty = &state.tynames[&arg.ty]; - write!(f, "{}: {}", arg_name, arg_ty)?; - } // Add normal returns - let mut has_normal_return = false; - for arg in &function.outputs { - let is_outparam = state.types.ty_contains_ref(arg.ty); - if is_outparam { - // Already handled - continue; - } - if has_normal_return { - return Err(UnsupportedError::Other( - "multiple normal returns (should this be a tuple?)".to_owned(), - ))?; - } - has_normal_return = true; + if let Some(arg) = function.outputs.first() { let arg_ty = &state.tynames[&arg.ty]; - write!(f, ") -> {}", arg_ty)?; - } - if !has_normal_return { + write!(f, ") -> {arg_ty}")?; + } else { write!(f, ")")?; } Ok(()) @@ -456,9 +427,13 @@ impl RustcAbiImpl { CallingConvention::Stdcall => "stdcall", CallingConvention::Fastcall => "fastcall", CallingConvention::Vectorcall => { - return Err(UnsupportedError::Other( - "vectorcall is an unstable rust feature".to_owned(), - ))? + if self.is_nightly { + "vectorcall" + } else { + return Err(UnsupportedError::Other( + "vectorcall is an unstable rust feature".to_owned(), + ))?; + } } }; Ok(conv) diff --git a/src/abis/rust/init.rs b/src/abis/rust/init.rs index a4da809..844db1d 100644 --- a/src/abis/rust/init.rs +++ b/src/abis/rust/init.rs @@ -7,7 +7,7 @@ impl RustcAbiImpl { pub fn init_leaf_value( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, ty: TyIdx, val: &Value, alias: Option<&str>, @@ -65,7 +65,7 @@ impl RustcAbiImpl { pub fn init_value( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, ty: TyIdx, vals: &mut ArgValuesIter, alias: Option<&str>, @@ -189,7 +189,7 @@ impl RustcAbiImpl { pub fn init_var( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, var_name: &str, var_ty: TyIdx, mut vals: ArgValuesIter, diff --git a/src/abis/rust/write.rs b/src/abis/rust/write.rs index 9c4b381..ac512f4 100644 --- a/src/abis/rust/write.rs +++ b/src/abis/rust/write.rs @@ -9,7 +9,7 @@ impl RustcAbiImpl { pub fn write_harness_prefix( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, ) -> Result<(), GenerateError> { // No extra harness gunk if not needed if state.options.val_writer != WriteImpl::HarnessCallback { @@ -19,7 +19,7 @@ impl RustcAbiImpl { writeln!(f, "#![feature(abi_vectorcall)]")?; } // Load test harness "headers" - writeln!(f, "{}", RUST_TEST_PREFIX)?; + writeln!(f, "{}", RUST_HARNESS_PREFIX)?; writeln!(f)?; Ok(()) @@ -31,7 +31,7 @@ impl RustcAbiImpl { pub fn write_var( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, var_name: &str, var_ty: TyIdx, mut vals: ArgValuesIter, @@ -60,7 +60,7 @@ impl RustcAbiImpl { pub fn write_fields( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, to: &str, from: &str, var_ty: TyIdx, @@ -197,7 +197,7 @@ impl RustcAbiImpl { pub fn write_leaf_field( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, to: &str, path: &str, val: &Value, @@ -229,7 +229,7 @@ impl RustcAbiImpl { pub fn write_tag_field( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, to: &str, variant_idx: usize, ) -> Result<(), GenerateError> { @@ -253,7 +253,7 @@ impl RustcAbiImpl { pub fn write_error_tag_field( &self, f: &mut Fivemat, - state: &TestImpl, + state: &TestState, to: &str, ) -> Result<(), GenerateError> { match state.options.val_writer { @@ -273,7 +273,7 @@ impl RustcAbiImpl { pub fn write_end_function( &self, f: &mut dyn Write, - state: &TestImpl, + state: &TestState, inputs: &str, outputs: &str, ) -> Result<(), GenerateError> { diff --git a/src/cli.rs b/src/cli.rs index 48b6b09..63da0e3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -31,10 +31,10 @@ struct Cli { pub fn make_app() -> Config { /// The pairings of impls to run. LHS calls RHS. static DEFAULT_TEST_PAIRS: &[(&str, &str)] = &[ - (ABI_IMPL_RUSTC, ABI_IMPL_RUSTC), - // (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C - // (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust - // (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C + (ABI_IMPL_RUSTC, ABI_IMPL_RUSTC), // Rust calls Rust + (ABI_IMPL_RUSTC, ABI_IMPL_CC), // Rust calls C + (ABI_IMPL_CC, ABI_IMPL_RUSTC), // C calls Rust + (ABI_IMPL_CC, ABI_IMPL_CC), // C calls C ]; let config = Cli::parse(); diff --git a/src/main.rs b/src/main.rs index 07bfaf4..e034193 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,24 +102,23 @@ fn main() -> Result<(), Box> { ABI_IMPL_RUSTC.to_owned(), abis::RustcAbiImpl::new(&cfg, None), ); - /* - runner.add_abi_impl( + harness.add_abi_impl( ABI_IMPL_CC.to_owned(), abis::CcAbiImpl::new(&cfg, ABI_IMPL_CC), ); - runner.add_abi_impl( + harness.add_abi_impl( ABI_IMPL_GCC.to_owned(), abis::CcAbiImpl::new(&cfg, ABI_IMPL_GCC), ); - runner.add_abi_impl( + harness.add_abi_impl( ABI_IMPL_CLANG.to_owned(), abis::CcAbiImpl::new(&cfg, ABI_IMPL_CLANG), ); - runner.add_abi_impl( + harness.add_abi_impl( ABI_IMPL_MSVC.to_owned(), abis::CcAbiImpl::new(&cfg, ABI_IMPL_MSVC), ); - */ + for (name, path) in &cfg.rustc_codegen_backends { harness.add_abi_impl( name.to_owned(), diff --git a/tests/normal/anons.kdl b/tests/normal/anons.kdl index 0848ced..b201803 100644 --- a/tests/normal/anons.kdl +++ b/tests/normal/anons.kdl @@ -23,6 +23,7 @@ tagged "MyTagged" { } NoneLike } + fn "anons" { inputs { _ "u32" From 85e618413022184cc7f46205bb45aa1e88f100f9 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Fri, 28 Jun 2024 20:04:12 -0400 Subject: [PATCH 41/44] fix up c impl --- src/abis/c.rs | 4 ++++ src/abis/c/declare.rs | 26 ++++++++++++-------------- src/abis/c/init.rs | 5 ++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/abis/c.rs b/src/abis/c.rs index 7c6534a..98c2850 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -156,6 +156,8 @@ impl CcAbiImpl { state: &TestState, func: FuncIdx, ) -> Result<(), GenerateError> { + writeln!(f, "{{")?; + f.add_indent(1); let function = state.types.realize_func(func); // Create vars for all the inputs @@ -179,6 +181,8 @@ impl CcAbiImpl { // Report the function is complete self.write_end_function(f, state, VAR_CALLER_INPUTS, VAR_CALLER_OUTPUTS)?; + f.sub_indent(1); + writeln!(f, "}}")?; Ok(()) } diff --git a/src/abis/c/declare.rs b/src/abis/c/declare.rs index 14748d1..5835031 100644 --- a/src/abis/c/declare.rs +++ b/src/abis/c/declare.rs @@ -9,15 +9,10 @@ impl CcAbiImpl { f: &mut Fivemat, state: &TestState, ) -> Result<(), GenerateError> { - let convention_decl = self.convention_decl(state.options.convention)?; - writeln!(f, "extern \"{convention_decl}\" {{",)?; - f.add_indent(1); for &func in &state.desired_funcs { self.generate_signature(f, state, func)?; writeln!(f, ";")?; } - f.sub_indent(1); - writeln!(f, "}}")?; writeln!(f)?; Ok(()) } @@ -109,11 +104,11 @@ impl CcAbiImpl { } } // Nominal types we need to emit a decl for - Ty::Struct(struct_ty) => (struct_ty.name.to_string(), None), - Ty::Union(union_ty) => (union_ty.name.to_string(), None), - Ty::Enum(enum_ty) => (enum_ty.name.to_string(), None), - Ty::Tagged(tagged_ty) => (tagged_ty.name.to_string(), None), - Ty::Alias(alias_ty) => (alias_ty.name.to_string(), None), + Ty::Struct(struct_ty) => (format!("{} ", struct_ty.name), None), + Ty::Union(union_ty) => (format!("{} ", union_ty.name), None), + Ty::Enum(enum_ty) => (format!("{} ", enum_ty.name), None), + Ty::Tagged(tagged_ty) => (format!("{} ", tagged_ty.name), None), + Ty::Alias(alias_ty) => (format!("{} ", alias_ty.name), None), // Puns should be evaporated Ty::Pun(pun) => { let real_ty = state.types.resolve_pun(pun, &state.env).unwrap(); @@ -434,12 +429,14 @@ impl CcAbiImpl { ) -> Result<(), GenerateError> { let function = state.types.realize_func(func); - if let Some(output) = function.outputs.first() { + let (pre, post) = if let Some(output) = function.outputs.first() { let (pre, post) = &state.tynames[&output.ty]; - write!(f, "{pre}{}{post}(", function.name)?; + (&**pre, &**post) } else { - write!(f, "void {}(", function.name)?; - } + ("void ", "") + }; + let convention_decl = self.convention_decl(state.options.convention)?; + write!(f, "{pre}{}{}{post}(", convention_decl, function.name)?; let mut multiarg = false; // Add inputs for arg in &function.inputs { @@ -451,6 +448,7 @@ impl CcAbiImpl { let (pre, post) = &state.tynames[&arg.ty]; write!(f, "{pre}{}{post}", arg_name)?; } + write!(f, ")")?; Ok(()) } diff --git a/src/abis/c/init.rs b/src/abis/c/init.rs index 344581d..cfff9a0 100644 --- a/src/abis/c/init.rs +++ b/src/abis/c/init.rs @@ -232,12 +232,11 @@ impl CcAbiImpl { mut vals: ArgValuesIter, ) -> Result<(), GenerateError> { // Generate the input - let needs_mut = false; - let let_mut = if needs_mut { "let mut" } else { "let" }; let mut real_var_decl = String::new(); let mut real_var_decl_f = Fivemat::new(&mut real_var_decl, INDENT); let mut extra_decls = Vec::new(); - write!(&mut real_var_decl_f, "{let_mut} {var_name} = ")?; + let (pre, post) = &state.tynames[&var_ty]; + write!(&mut real_var_decl_f, "{pre}{var_name}{post} = ")?; let ref_temp_name = format!("{var_name}_"); self.init_value( &mut real_var_decl_f, From d4cd383e3c97eec334dfbb1c3d17a42f6fa8a99f Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Fri, 28 Jun 2024 23:47:58 -0400 Subject: [PATCH 42/44] cleanup file structure, unify static file access --- Cargo.lock | 20 +++++ Cargo.toml | 1 + .../harness/c/harness_prefix.h | 0 .../harness/c/test_prefix.h | 0 {harness => include/harness}/harness.rs | 0 .../harness/rust/harness_prefix.rs | 0 .../tests}/normal/IntrusiveList.kdl | 0 {tests => include/tests}/normal/anons.kdl | 0 {tests => include/tests}/normal/types.kdl | 0 .../procgen/primitives}/bool.procgen.kdl | 0 .../tests/procgen/primitives}/f32.procgen.kdl | 0 .../tests/procgen/primitives}/f64.procgen.kdl | 0 .../procgen/primitives}/i128.procgen.kdl | 0 .../tests/procgen/primitives}/i16.procgen.kdl | 0 .../tests/procgen/primitives}/i32.procgen.kdl | 0 .../tests/procgen/primitives}/i64.procgen.kdl | 0 .../tests/procgen/primitives}/i8.procgen.kdl | 0 .../tests/procgen/primitives}/ptr.procgen.kdl | 0 .../procgen/primitives}/u128.procgen.kdl | 0 .../tests/procgen/primitives}/u16.procgen.kdl | 0 .../tests/procgen/primitives}/u32.procgen.kdl | 0 .../tests/procgen/primitives}/u64.procgen.kdl | 0 .../tests/procgen/primitives}/u8.procgen.kdl | 0 .../tests/procgen/puns}/MetersU32.procgen.kdl | 0 src/abis/c.rs | 10 ++- src/abis/c/declare.rs | 2 +- src/abis/c/write.rs | 8 +- src/abis/rust.rs | 2 - src/abis/rust/write.rs | 6 +- src/cli.rs | 15 +++- src/files.rs | 78 ++++++++++++++++++ src/harness/build.rs | 24 +----- src/harness/generate.rs | 13 +-- src/harness/mod.rs | 41 ++++------ src/harness/read.rs | 82 ++++++++++++++++--- src/main.rs | 27 +++--- src/procgen.rs | 8 +- 37 files changed, 236 insertions(+), 101 deletions(-) rename harness/c_harness_prefix.h => include/harness/c/harness_prefix.h (100%) rename harness/c_test_prefix.h => include/harness/c/test_prefix.h (100%) rename {harness => include/harness}/harness.rs (100%) rename harness/rust_harness_prefix.rs => include/harness/rust/harness_prefix.rs (100%) rename {tests => include/tests}/normal/IntrusiveList.kdl (100%) rename {tests => include/tests}/normal/anons.kdl (100%) rename {tests => include/tests}/normal/types.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/bool.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/f32.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/f64.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/i128.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/i16.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/i32.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/i64.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/i8.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/ptr.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/u128.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/u16.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/u32.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/u64.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/primitives}/u8.procgen.kdl (100%) rename {tests/procgen_in => include/tests/procgen/puns}/MetersU32.procgen.kdl (100%) create mode 100644 src/files.rs diff --git a/Cargo.lock b/Cargo.lock index 07a2b68..7884a44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "cc 1.0.73", "clap", "console", + "include_dir", "kdl", "kdl-script", "libloading", @@ -331,6 +332,25 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "2.2.6" diff --git a/Cargo.toml b/Cargo.toml index b127e7a..786f658 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ thiserror.workspace = true tokio.workspace = true tracing.workspace = true tracing-subscriber.workspace = true +include_dir = "0.7.4" [build-dependencies] built.workspace = true diff --git a/harness/c_harness_prefix.h b/include/harness/c/harness_prefix.h similarity index 100% rename from harness/c_harness_prefix.h rename to include/harness/c/harness_prefix.h diff --git a/harness/c_test_prefix.h b/include/harness/c/test_prefix.h similarity index 100% rename from harness/c_test_prefix.h rename to include/harness/c/test_prefix.h diff --git a/harness/harness.rs b/include/harness/harness.rs similarity index 100% rename from harness/harness.rs rename to include/harness/harness.rs diff --git a/harness/rust_harness_prefix.rs b/include/harness/rust/harness_prefix.rs similarity index 100% rename from harness/rust_harness_prefix.rs rename to include/harness/rust/harness_prefix.rs diff --git a/tests/normal/IntrusiveList.kdl b/include/tests/normal/IntrusiveList.kdl similarity index 100% rename from tests/normal/IntrusiveList.kdl rename to include/tests/normal/IntrusiveList.kdl diff --git a/tests/normal/anons.kdl b/include/tests/normal/anons.kdl similarity index 100% rename from tests/normal/anons.kdl rename to include/tests/normal/anons.kdl diff --git a/tests/normal/types.kdl b/include/tests/normal/types.kdl similarity index 100% rename from tests/normal/types.kdl rename to include/tests/normal/types.kdl diff --git a/tests/procgen_in/bool.procgen.kdl b/include/tests/procgen/primitives/bool.procgen.kdl similarity index 100% rename from tests/procgen_in/bool.procgen.kdl rename to include/tests/procgen/primitives/bool.procgen.kdl diff --git a/tests/procgen_in/f32.procgen.kdl b/include/tests/procgen/primitives/f32.procgen.kdl similarity index 100% rename from tests/procgen_in/f32.procgen.kdl rename to include/tests/procgen/primitives/f32.procgen.kdl diff --git a/tests/procgen_in/f64.procgen.kdl b/include/tests/procgen/primitives/f64.procgen.kdl similarity index 100% rename from tests/procgen_in/f64.procgen.kdl rename to include/tests/procgen/primitives/f64.procgen.kdl diff --git a/tests/procgen_in/i128.procgen.kdl b/include/tests/procgen/primitives/i128.procgen.kdl similarity index 100% rename from tests/procgen_in/i128.procgen.kdl rename to include/tests/procgen/primitives/i128.procgen.kdl diff --git a/tests/procgen_in/i16.procgen.kdl b/include/tests/procgen/primitives/i16.procgen.kdl similarity index 100% rename from tests/procgen_in/i16.procgen.kdl rename to include/tests/procgen/primitives/i16.procgen.kdl diff --git a/tests/procgen_in/i32.procgen.kdl b/include/tests/procgen/primitives/i32.procgen.kdl similarity index 100% rename from tests/procgen_in/i32.procgen.kdl rename to include/tests/procgen/primitives/i32.procgen.kdl diff --git a/tests/procgen_in/i64.procgen.kdl b/include/tests/procgen/primitives/i64.procgen.kdl similarity index 100% rename from tests/procgen_in/i64.procgen.kdl rename to include/tests/procgen/primitives/i64.procgen.kdl diff --git a/tests/procgen_in/i8.procgen.kdl b/include/tests/procgen/primitives/i8.procgen.kdl similarity index 100% rename from tests/procgen_in/i8.procgen.kdl rename to include/tests/procgen/primitives/i8.procgen.kdl diff --git a/tests/procgen_in/ptr.procgen.kdl b/include/tests/procgen/primitives/ptr.procgen.kdl similarity index 100% rename from tests/procgen_in/ptr.procgen.kdl rename to include/tests/procgen/primitives/ptr.procgen.kdl diff --git a/tests/procgen_in/u128.procgen.kdl b/include/tests/procgen/primitives/u128.procgen.kdl similarity index 100% rename from tests/procgen_in/u128.procgen.kdl rename to include/tests/procgen/primitives/u128.procgen.kdl diff --git a/tests/procgen_in/u16.procgen.kdl b/include/tests/procgen/primitives/u16.procgen.kdl similarity index 100% rename from tests/procgen_in/u16.procgen.kdl rename to include/tests/procgen/primitives/u16.procgen.kdl diff --git a/tests/procgen_in/u32.procgen.kdl b/include/tests/procgen/primitives/u32.procgen.kdl similarity index 100% rename from tests/procgen_in/u32.procgen.kdl rename to include/tests/procgen/primitives/u32.procgen.kdl diff --git a/tests/procgen_in/u64.procgen.kdl b/include/tests/procgen/primitives/u64.procgen.kdl similarity index 100% rename from tests/procgen_in/u64.procgen.kdl rename to include/tests/procgen/primitives/u64.procgen.kdl diff --git a/tests/procgen_in/u8.procgen.kdl b/include/tests/procgen/primitives/u8.procgen.kdl similarity index 100% rename from tests/procgen_in/u8.procgen.kdl rename to include/tests/procgen/primitives/u8.procgen.kdl diff --git a/tests/procgen_in/MetersU32.procgen.kdl b/include/tests/procgen/puns/MetersU32.procgen.kdl similarity index 100% rename from tests/procgen_in/MetersU32.procgen.kdl rename to include/tests/procgen/puns/MetersU32.procgen.kdl diff --git a/src/abis/c.rs b/src/abis/c.rs index 98c2850..b20c4cf 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -15,9 +15,6 @@ use super::*; use crate::fivemat::Fivemat; use crate::vals::ArgValuesIter; -pub static TEST_PREFIX: &str = include_str!("../../harness/c_test_prefix.h"); -pub static HARNESS_PREFIX: &str = include_str!("../../harness/c_harness_prefix.h"); - const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; @@ -305,6 +302,13 @@ impl CcAbiImpl { out_dir: &Utf8Path, lib_name: &str, ) -> Result { + /* + let out_sub = src_path.parent().unwrap(); + let ensure_out = out_dir.join(out_sub); + std::fs::create_dir_all(ensure_out).unwrap(); + info!("out: {}", out_dir); + info!("lib: {}", lib_name); + */ cc::Build::new() .file(src_path) .opt_level(0) diff --git a/src/abis/c/declare.rs b/src/abis/c/declare.rs index 5835031..97081da 100644 --- a/src/abis/c/declare.rs +++ b/src/abis/c/declare.rs @@ -60,7 +60,7 @@ impl CcAbiImpl { let name = match prim { PrimitiveTy::I8 => "int8_t ", PrimitiveTy::I16 => "int16_t ", - PrimitiveTy::I32 => "int32_4 ", + PrimitiveTy::I32 => "int32_t ", PrimitiveTy::I64 => "int64_t ", PrimitiveTy::I128 => "__int128_t ", PrimitiveTy::U8 => "uint8_t ", diff --git a/src/abis/c/write.rs b/src/abis/c/write.rs index b21a3bd..9825b44 100644 --- a/src/abis/c/write.rs +++ b/src/abis/c/write.rs @@ -12,13 +12,17 @@ impl CcAbiImpl { state: &TestState, ) -> Result<(), GenerateError> { // Always need includes for things like int8_t - writeln!(f, "{}", TEST_PREFIX)?; + writeln!(f, "{}", crate::files::get_file("harness/c/test_prefix.h"))?; // No extra harness gunk if not needed if state.options.val_writer != WriteImpl::HarnessCallback { return Ok(()); } // Load test harness "headers" - writeln!(f, "{}", HARNESS_PREFIX)?; + writeln!( + f, + "{}", + crate::files::get_file("harness/c/harness_prefix.h") + )?; writeln!(f)?; diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 4ffeba0..4a8bd00 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -15,8 +15,6 @@ use super::*; use crate::fivemat::Fivemat; use crate::vals::ArgValuesIter; -pub static RUST_HARNESS_PREFIX: &str = include_str!("../../harness/rust_harness_prefix.rs"); - const VAR_CALLER_INPUTS: &str = "CALLER_INPUTS"; const VAR_CALLER_OUTPUTS: &str = "CALLER_OUTPUTS"; const VAR_CALLEE_INPUTS: &str = "CALLEE_INPUTS"; diff --git a/src/abis/rust/write.rs b/src/abis/rust/write.rs index ac512f4..8709ec1 100644 --- a/src/abis/rust/write.rs +++ b/src/abis/rust/write.rs @@ -19,7 +19,11 @@ impl RustcAbiImpl { writeln!(f, "#![feature(abi_vectorcall)]")?; } // Load test harness "headers" - writeln!(f, "{}", RUST_HARNESS_PREFIX)?; + writeln!( + f, + "{}", + crate::files::get_file("harness/rust/harness_prefix.rs") + )?; writeln!(f)?; Ok(()) diff --git a/src/cli.rs b/src/cli.rs index 63da0e3..fd290f4 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,4 +1,5 @@ -use crate::{abis::*, Config, OutputFormat}; +use crate::{abis::*, files::Paths, Config, OutputFormat}; +use camino::Utf8PathBuf; use clap::Parser; use tracing::warn; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; @@ -99,6 +100,17 @@ Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. .with(filter_layer) .with(logger.clone()) .init(); + + let target_dir: Utf8PathBuf = "target".into(); + let out_dir = target_dir.join("temp"); + let generated_src_dir = target_dir.join("generated_impls"); + let runtime_test_input_dir = "abi_cafe_tests".into(); + let paths = Paths { + target_dir, + out_dir, + generated_src_dir, + runtime_test_input_dir, + }; Config { output_format, procgen_tests, @@ -110,5 +122,6 @@ Hint: Try using `--pairs {name}_calls_rustc` or `--pairs rustc_calls_{name}`. val_generator, write_impl, minimizing_write_impl, + paths, } } diff --git a/src/files.rs b/src/files.rs new file mode 100644 index 0000000..000bd2a --- /dev/null +++ b/src/files.rs @@ -0,0 +1,78 @@ +use std::io::Write; + +use camino::{Utf8Path, Utf8PathBuf}; +use include_dir::{include_dir, Dir, File}; + +use crate::{built_info, GenerateError}; + +const INCLUDES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/include"); + +#[derive(Debug, Clone)] +pub struct Paths { + pub target_dir: Utf8PathBuf, + pub out_dir: Utf8PathBuf, + pub generated_src_dir: Utf8PathBuf, + pub runtime_test_input_dir: Utf8PathBuf, +} +impl Paths { + pub fn harness_main_file(&self) -> Utf8PathBuf { + self.out_dir.join("harness.rs") + } + + /// Delete and recreate the build dir + pub fn init_dirs(&self) -> Result<(), GenerateError> { + // Make sure these dirs exist and are empty + clear_and_create_dir(&self.out_dir); + clear_and_create_dir(&self.generated_src_dir); + + // Initialize harness.rs + { + let harness_file_contents = get_file("harness/harness.rs"); + let harness_file_path = self.harness_main_file(); + let mut file = + std::fs::File::create_new(&harness_file_path).expect("failed to create harness.rs"); + file.write_all(harness_file_contents.as_bytes()) + .expect("failed to initialize harness.rs"); + } + + // Set up env vars for CC + std::env::set_var("OUT_DIR", &self.out_dir); + std::env::set_var("HOST", built_info::HOST); + std::env::set_var("TARGET", built_info::TARGET); + std::env::set_var("OPT_LEVEL", "0"); + + Ok(()) + } +} + +pub fn clear_and_create_dir(path: impl AsRef) { + let path = path.as_ref(); + std::fs::create_dir_all(path).expect("failed to clear and create build dir"); + std::fs::remove_dir_all(path).expect("failed to clear and create build dir"); + std::fs::create_dir_all(path).expect("failed to clear and create build dir"); +} + +pub fn get_file(path: impl AsRef) -> String { + let path = path.as_ref(); + let Some(file) = INCLUDES.get_file(path) else { + unreachable!("embedded file didn't exist: {path}"); + }; + load_file(file) +} + +pub fn load_file(file: &File) -> String { + let Some(string) = file.contents_utf8() else { + unreachable!("embedded file wasn't utf8: {}", file.path().display()); + }; + clean_newlines(string) +} + +pub fn tests() -> &'static Dir<'static> { + INCLUDES + .get_dir("tests") + .expect("includes didn't contain ./test") +} + +fn clean_newlines(input: &str) -> String { + input.replace('\r', "") +} diff --git a/src/harness/build.rs b/src/harness/build.rs index 05809a8..963aa6b 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -1,17 +1,13 @@ -use std::env; -use std::path::PathBuf; use std::process::Command; use std::sync::Arc; -use camino::{Utf8Path, Utf8PathBuf}; +use camino::Utf8Path; use tracing::info; use crate::error::*; use crate::report::*; use crate::*; -const OUT_DIR: &str = "target/temp"; - impl TestHarness { pub async fn build_test( &self, @@ -82,22 +78,6 @@ impl TestHarness { } } -/// Delete and recreate the build dir -pub fn init_build_dir() -> Result { - let out_dir = Utf8PathBuf::from(OUT_DIR); - std::fs::create_dir_all(&out_dir)?; - std::fs::remove_dir_all(&out_dir)?; - std::fs::create_dir_all(&out_dir)?; - - // Set up env vars for CC - env::set_var("OUT_DIR", &out_dir); - env::set_var("HOST", built_info::HOST); - env::set_var("TARGET", built_info::TARGET); - env::set_var("OPT_LEVEL", "0"); - - Ok(out_dir) -} - async fn build_static_lib( src_path: &Utf8Path, abi: Arc, @@ -119,7 +99,7 @@ fn link_dynamic_lib( out_dir: &Utf8Path, dynamic_lib_name: &str, ) -> Result { - let src = PathBuf::from("harness/harness.rs"); + let src = out_dir.join("harness.rs"); let output = out_dir.join(dynamic_lib_name); let mut cmd = Command::new("rustc"); cmd.arg("-v") diff --git a/src/harness/generate.rs b/src/harness/generate.rs index 70dcee4..bf347e3 100644 --- a/src/harness/generate.rs +++ b/src/harness/generate.rs @@ -10,8 +10,6 @@ use crate::abis::*; use crate::error::*; use crate::*; -const GENERATED_SRC_DIR: &str = "generated_impls"; - impl TestHarness { pub async fn generate_test(&self, key: &TestKey) -> Result { // FIXME: these two could be done concurrently @@ -57,24 +55,15 @@ impl TestHarness { } fn src_path(&self, key: &TestKey, call_side: CallSide) -> Utf8PathBuf { - let src_dir = Utf8PathBuf::from(GENERATED_SRC_DIR); let abi_id = key.abi_id(call_side); let abi = self.abi_by_test_key(key, call_side); let mut output = self.base_id(key, Some(call_side), "_"); output.push('.'); output.push_str(abi.src_ext()); - src_dir.join(abi_id).join(output) + self.paths.generated_src_dir.join(abi_id).join(output) } } -/// Delete and recreate the generated src dir -pub fn init_generate_dir() -> Result<(), GenerateError> { - std::fs::create_dir_all(GENERATED_SRC_DIR)?; - std::fs::remove_dir_all(GENERATED_SRC_DIR)?; - std::fs::create_dir_all(GENERATED_SRC_DIR)?; - Ok(()) -} - async fn generate_src( src_path: &Utf8Path, abi: Arc, diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 1e4188c..ad47365 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -7,15 +7,12 @@ //! 5. checking the test results use crate::{ - get_test_rules, vals::ValueGeneratorKind, AbiImpl, AbiImplId, ArgSelector, CallSide, - FunctionSelector, GenerateError, SortedMap, Test, TestId, TestKey, TestOptions, TestRules, - TestRunMode, TestRunResults, TestWithAbi, TestWithVals, ValSelector, WriteImpl, + files::Paths, get_test_rules, vals::ValueGeneratorKind, AbiImpl, AbiImplId, ArgSelector, + CallSide, FunctionSelector, GenerateError, SortedMap, Test, TestId, TestKey, TestOptions, + TestRules, TestRunMode, TestRunResults, TestWithAbi, TestWithVals, ValSelector, WriteImpl, }; use camino::Utf8PathBuf; -use std::{ - error::Error, - sync::{Arc, Mutex}, -}; +use std::sync::{Arc, Mutex}; use tokio::sync::OnceCell; use tracing::warn; @@ -25,15 +22,13 @@ mod generate; mod read; mod run; -use build::init_build_dir; -use generate::init_generate_dir; pub use read::{find_tests, spawn_read_test}; pub use run::WriteBuffer; pub type Memoized = Mutex>>>; -#[derive(Default)] pub struct TestHarness { + paths: Paths, abi_impls: SortedMap>, tests: SortedMap>, tests_with_vals: Memoized<(TestId, ValueGeneratorKind), Arc>, @@ -43,10 +38,15 @@ pub struct TestHarness { } impl TestHarness { - pub fn new(tests: SortedMap>) -> Self { + pub fn new(tests: SortedMap>, paths: Paths) -> Self { Self { + paths, tests, - ..Self::default() + abi_impls: Default::default(), + tests_with_vals: Default::default(), + tests_with_abi_impl: Default::default(), + generated_sources: Default::default(), + built_static_libs: Default::default(), } } pub fn add_abi_impl(&mut self, id: AbiImplId, abi_impl: A) { @@ -120,22 +120,17 @@ impl TestHarness { rt: &tokio::runtime::Runtime, rules: TestRules, test_key: TestKey, - out_dir: Utf8PathBuf, ) -> tokio::task::JoinHandle { let harness = self.clone(); - rt.spawn(async move { harness.do_test(test_key, rules, out_dir).await }) + rt.spawn(async move { harness.do_test(test_key, rules).await }) } /// Generate, Compile, Link, Load, and Run this test. #[tracing::instrument(name = "test", skip_all, fields(id = self.base_id(&test_key, None, "::")))] - pub async fn do_test( - &self, - test_key: TestKey, - test_rules: TestRules, - out_dir: Utf8PathBuf, - ) -> TestRunResults { + pub async fn do_test(&self, test_key: TestKey, test_rules: TestRules) -> TestRunResults { use TestRunMode::*; + let out_dir = self.paths.out_dir.clone(); let mut res = TestRunResults::new(test_key, test_rules); if res.rules.run <= Skip { return res; @@ -208,12 +203,6 @@ impl TestHarness { } } -pub fn init_dirs() -> Result> { - init_generate_dir()?; - let build_dir = init_build_dir()?; - Ok(build_dir) -} - impl TestHarness { pub fn base_id( &self, diff --git a/src/harness/read.rs b/src/harness/read.rs index c4837d9..8b4469b 100644 --- a/src/harness/read.rs +++ b/src/harness/read.rs @@ -8,16 +8,39 @@ use std::{ use camino::{Utf8Path, Utf8PathBuf}; use tracing::warn; -use crate::{error::*, SortedMap, Test, TestId}; +use crate::{error::*, files::Paths, SortedMap, Test, TestId}; #[derive(Debug, Clone)] pub enum TestFile { - Kdl(Utf8PathBuf), - KdlProcgen(Utf8PathBuf), + Kdl(Pathish), + KdlProcgen(Pathish), } -pub fn find_tests(start_dir: &Path) -> Result, GenerateError> { +#[derive(Debug, Clone)] +pub enum Pathish { + Runtime(Utf8PathBuf), + Static(Utf8PathBuf), +} +impl Pathish { + fn as_str(&self) -> &str { + match self { + Pathish::Runtime(path) | Pathish::Static(path) => path.as_str(), + } + } +} + +pub fn find_tests(paths: &Paths) -> Result, GenerateError> { + let mut tests = find_tests_runtime(paths.runtime_test_input_dir.as_std_path())?; + let mut more_tests = find_tests_static()?; + tests.append(&mut more_tests); + Ok(tests) +} + +pub fn find_tests_runtime(start_dir: &Path) -> Result, GenerateError> { let mut tests = SortedMap::new(); + if !start_dir.exists() { + return Ok(tests); + } let mut dirs = vec![start_dir.to_owned()]; while let Some(dir) = dirs.pop() { for entry in std::fs::read_dir(dir)? { @@ -31,7 +54,7 @@ pub fn find_tests(start_dir: &Path) -> Result, Gener let path = entry.path(); let test_file = Utf8PathBuf::from_path_buf(path).expect("non-utf8 test path"); - let Some((name, test)) = classify_test(&test_file) else { + let Some((name, test)) = classify_test(&test_file, true) else { warn!("test isn't a known test format: {}", test_file); continue; }; @@ -41,6 +64,32 @@ pub fn find_tests(start_dir: &Path) -> Result, Gener Ok(tests) } +pub fn find_tests_static() -> Result, GenerateError> { + let mut tests = SortedMap::new(); + let mut dirs = vec![crate::files::tests()]; + while let Some(dir) = dirs.pop() { + for entry in dir.entries() { + // If it's a dir, add it to the working set + if let Some(dir) = entry.as_dir() { + dirs.push(dir); + continue; + } + + if let Some(file) = entry.as_file() { + let path = file.path(); + let test_file = + Utf8PathBuf::from_path_buf(path.to_owned()).expect("non-utf8 test path"); + let Some((name, test)) = classify_test(&test_file, false) else { + warn!("test isn't a known test format: {}", test_file); + continue; + }; + tests.insert(name, test); + } + } + } + Ok(tests) +} + pub fn spawn_read_test( rt: &tokio::runtime::Runtime, test: TestId, @@ -80,22 +129,31 @@ async fn read_test_inner(test: &TestId, test_file: TestFile) -> Result })) } +fn read_file_to_string(pathish: &Pathish) -> std::io::Result { + match pathish { + Pathish::Runtime(path) => read_runtime_file_to_string(path), + Pathish::Static(path) => Ok(crate::files::get_file(path)), + } +} + #[allow(clippy::manual_map)] -fn classify_test(test_file: &Utf8Path) -> Option<(String, TestFile)> { +fn classify_test(test_file: &Utf8Path, is_runtime: bool) -> Option<(String, TestFile)> { let file_name = test_file.file_name().expect("test file had no name!?"); + let pathish = if is_runtime { + Pathish::Runtime(test_file.to_owned()) + } else { + Pathish::Static(test_file.to_owned()) + }; if let Some(test_name) = file_name.strip_suffix(".procgen.kdl") { - Some(( - test_name.to_owned(), - TestFile::KdlProcgen(test_file.to_owned()), - )) + Some((test_name.to_owned(), TestFile::KdlProcgen(pathish))) } else if let Some(test_name) = file_name.strip_suffix(".kdl") { - Some((test_name.to_owned(), TestFile::Kdl(test_file.to_owned()))) + Some((test_name.to_owned(), TestFile::Kdl(pathish))) } else { None } } -fn read_file_to_string(file: &Utf8Path) -> std::io::Result { +fn read_runtime_file_to_string(file: &Utf8Path) -> std::io::Result { let file = File::open(file)?; let mut reader = BufReader::new(file); let mut input = String::new(); diff --git a/src/main.rs b/src/main.rs index e034193..af56822 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ mod abis; mod cli; mod error; +mod files; mod fivemat; mod harness; mod log; @@ -9,8 +10,8 @@ mod procgen; mod report; use abis::*; -use camino::Utf8Path; use error::*; +use files::Paths; use harness::*; use report::*; use std::error::Error; @@ -71,6 +72,7 @@ pub struct Config { pub val_generator: ValueGeneratorKind, pub write_impl: WriteImpl, pub minimizing_write_impl: WriteImpl, + pub paths: Paths, } #[derive(Debug, thiserror::Error)] @@ -80,13 +82,13 @@ pub struct TestsFailed {} fn main() -> Result<(), Box> { let cfg = cli::make_app(); debug!("parsed cli!"); - let out_dir = init_dirs()?; + cfg.paths.init_dirs()?; let rt = tokio::runtime::Runtime::new().expect("failed to init tokio runtime"); let _handle = rt.enter(); // Grab all the tests - let test_sources = harness::find_tests(&std::path::PathBuf::from("tests"))?; + let test_sources = harness::find_tests(&cfg.paths)?; let read_tasks = test_sources .into_iter() .map(|(test, test_file)| harness::spawn_read_test(&rt, test, test_file)); @@ -96,7 +98,7 @@ fn main() -> Result<(), Box> { .filter_map(|task| rt.block_on(task).expect("failed to join on task").ok()) .map(|test| (test.name.clone(), test)) .collect(); - let mut harness = TestHarness::new(tests); + let mut harness = TestHarness::new(tests, cfg.paths.clone()); harness.add_abi_impl( ABI_IMPL_RUSTC.to_owned(), @@ -172,12 +174,10 @@ fn main() -> Result<(), Box> { }, }; let rules = harness.get_test_rules(&test_key); - let task = harness.clone().spawn_test( - &rt, - rules.clone(), - test_key.clone(), - out_dir.clone(), - ); + let task = + harness + .clone() + .spawn_test(&rt, rules.clone(), test_key.clone()); Some(task) }) @@ -233,7 +233,7 @@ fn main() -> Result<(), Box> { } if full_report.failed() { - generate_minimized_failures(&cfg, &harness, &rt, &out_dir, &full_report); + generate_minimized_failures(&cfg, &harness, &rt, &full_report); Err(TestsFailed {})?; } Ok(()) @@ -243,7 +243,6 @@ fn generate_minimized_failures( cfg: &Config, harness: &Arc, rt: &tokio::runtime::Runtime, - out_dir: &Utf8Path, reports: &FullReport, ) { info!("rerunning failures"); @@ -298,9 +297,7 @@ fn generate_minimized_failures( let mut rules = report.rules.clone(); rules.run = TestRunMode::Generate; - let task = harness - .clone() - .spawn_test(rt, rules, test_key, out_dir.to_owned()); + let task = harness.clone().spawn_test(rt, rules, test_key); Some(task) }) .collect() diff --git a/src/procgen.rs b/src/procgen.rs index 1104a6e..35c0846 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -140,13 +140,13 @@ fn add_func( ) -> std::fmt::Result { writeln!(out, r#"fn "{func_name}" {{"#)?; writeln!(out, r#" inputs {{"#)?; - for (idx, arg_ty) in inputs.iter().enumerate() { - writeln!(out, r#" arg{idx} "{arg_ty}""#)?; + for arg_ty in inputs { + writeln!(out, r#" _ "{arg_ty}""#)?; } writeln!(out, r#" }}"#)?; writeln!(out, r#" outputs {{"#)?; - for (idx, arg_ty) in outputs.iter().enumerate() { - writeln!(out, r#" arg{idx} "{arg_ty}""#)?; + for arg_ty in outputs { + writeln!(out, r#" _ "{arg_ty}""#)?; } writeln!(out, r#" }}"#)?; writeln!(out, r#"}}"#)?; From 62106a8d8419abea351eab52739896cf6cb93e30 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 30 Jun 2024 14:10:09 -0400 Subject: [PATCH 43/44] initial C backend with lots of tests --- include/harness/harness.rs | 25 +- include/harness/main.rs | 17 + .../tests/procgen/array/F32Array.procgen.kdl | 5 + .../tests/procgen/array/I64Array.procgen.kdl | 5 + .../tests/procgen/array/U8Array.procgen.kdl | 5 + .../procgen/enum/MultiVariantEnum.procgen.kdl | 8 + .../enum/SingleVariantEnum.procgen.kdl | 5 + .../fancy/IntrusiveList.procgen.kdl} | 9 - .../procgen/primitive/EmptyTup.procgen.kdl | 1 + .../bool.procgen.kdl | 0 .../{primitives => primitive}/f32.procgen.kdl | 0 .../{primitives => primitive}/f64.procgen.kdl | 0 .../i128.procgen.kdl | 0 .../{primitives => primitive}/i16.procgen.kdl | 0 .../{primitives => primitive}/i32.procgen.kdl | 0 .../{primitives => primitive}/i64.procgen.kdl | 0 .../{primitives => primitive}/i8.procgen.kdl | 0 .../{primitives => primitive}/ptr.procgen.kdl | 0 .../u128.procgen.kdl | 0 .../{primitives => primitive}/u16.procgen.kdl | 0 .../{primitives => primitive}/u32.procgen.kdl | 0 .../{primitives => primitive}/u64.procgen.kdl | 0 .../{primitives => primitive}/u8.procgen.kdl | 0 .../{puns => pun}/MetersU32.procgen.kdl | 0 .../tests/procgen/ref/RefArray.procgen.kdl | 1 + .../procgen/struct/EmptyStruct.procgen.kdl | 3 + .../struct/EmptyStructInside.procgen.kdl | 10 + .../struct/SimplePaddedStruct.procgen.kdl | 9 + .../procgen/struct/SimpleStruct.procgen.kdl | 9 + .../procgen/tagged/CLikeTagged.procgen.kdl | 9 + .../procgen/tagged/OptI32Tagged.procgen.kdl | 6 + .../union/MultiVariantUnion.procgen.kdl | 10 + .../union/SingleVariantUnion.procgen.kdl | 3 + src/abis/c.rs | 4 +- src/abis/c/declare.rs | 8 +- src/abis/c/init.rs | 6 +- src/abis/c/write.rs | 17 +- src/abis/c_old.rs | 601 ------------------ src/abis/rust.rs | 14 + src/abis/rust/declare.rs | 44 +- src/files.rs | 2 +- src/harness/build.rs | 14 +- src/harness/mod.rs | 4 +- src/procgen.rs | 20 +- src/report.rs | 45 +- 45 files changed, 260 insertions(+), 659 deletions(-) create mode 100644 include/harness/main.rs create mode 100644 include/tests/procgen/array/F32Array.procgen.kdl create mode 100644 include/tests/procgen/array/I64Array.procgen.kdl create mode 100644 include/tests/procgen/array/U8Array.procgen.kdl create mode 100644 include/tests/procgen/enum/MultiVariantEnum.procgen.kdl create mode 100644 include/tests/procgen/enum/SingleVariantEnum.procgen.kdl rename include/tests/{normal/IntrusiveList.kdl => procgen/fancy/IntrusiveList.procgen.kdl} (87%) create mode 100644 include/tests/procgen/primitive/EmptyTup.procgen.kdl rename include/tests/procgen/{primitives => primitive}/bool.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/f32.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/f64.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/i128.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/i16.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/i32.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/i64.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/i8.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/ptr.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/u128.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/u16.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/u32.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/u64.procgen.kdl (100%) rename include/tests/procgen/{primitives => primitive}/u8.procgen.kdl (100%) rename include/tests/procgen/{puns => pun}/MetersU32.procgen.kdl (100%) create mode 100644 include/tests/procgen/ref/RefArray.procgen.kdl create mode 100644 include/tests/procgen/struct/EmptyStruct.procgen.kdl create mode 100644 include/tests/procgen/struct/EmptyStructInside.procgen.kdl create mode 100644 include/tests/procgen/struct/SimplePaddedStruct.procgen.kdl create mode 100644 include/tests/procgen/struct/SimpleStruct.procgen.kdl create mode 100644 include/tests/procgen/tagged/CLikeTagged.procgen.kdl create mode 100644 include/tests/procgen/tagged/OptI32Tagged.procgen.kdl create mode 100644 include/tests/procgen/union/MultiVariantUnion.procgen.kdl create mode 100644 include/tests/procgen/union/SingleVariantUnion.procgen.kdl delete mode 100644 src/abis/c_old.rs diff --git a/include/harness/harness.rs b/include/harness/harness.rs index 3e75f7d..b97173b 100644 --- a/include/harness/harness.rs +++ b/include/harness/harness.rs @@ -1,3 +1,14 @@ +//! This is the primary file for the abi-cafe cdylib that all tests are compiled into. +//! +//! This will be statically linked into a cdylib with two other static libraries: +//! the caller and callee. The caller is expected to define the function `do_test`, +//! and call a bunch of functions defined by the callee. The cdylib +//! is run by the harness `dlopen`ing it and running `test_start`, passing in various +//! buffers and callbacks for instrumenting the result of the execution. +//! +//! This instrumentation is only used in the default mode of `WriteImpl::HarnessCallback`. +//! Otherwise the caller/callee may use things like asserts/prints. + #[repr(transparent)] #[derive(Copy, Clone)] pub struct WriteBuffer(*mut ()); @@ -23,18 +34,18 @@ pub static mut FINISHED_VAL: Option = None; #[no_mangle] pub static mut FINISHED_FUNC: Option = None; -extern { +extern { fn do_test(); } #[no_mangle] pub extern fn test_start( - write_callback: WriteCallback, - finished_val_callback: FinishedValCallback, - finished_func_callback: FinishedFuncCallback, - caller_inputs: WriteBuffer, - caller_outputs: WriteBuffer, - callee_inputs: WriteBuffer, + write_callback: WriteCallback, + finished_val_callback: FinishedValCallback, + finished_func_callback: FinishedFuncCallback, + caller_inputs: WriteBuffer, + caller_outputs: WriteBuffer, + callee_inputs: WriteBuffer, callee_outputs: WriteBuffer, ) { unsafe { diff --git a/include/harness/main.rs b/include/harness/main.rs new file mode 100644 index 0000000..9bf9047 --- /dev/null +++ b/include/harness/main.rs @@ -0,0 +1,17 @@ +//! This is the primary file for the abi-cafe standalone binary/project mode. +//! +//! This mode is primarily intended for reporting/debugging abi-cafe test failures, +//! where you want the particulars of abi-cafe to go away, and want a minimized +//! reproduction of the issue. +//! +//! As such this is incompatible with `WriteImpl::HarnessCallback`. +//! +//! In theory this could be replaced with just making `caller::do_test` into `main` +//! but this might be a bit easier..? +extern { + fn do_test(); +} + +fn main() { + do_test(); +} \ No newline at end of file diff --git a/include/tests/procgen/array/F32Array.procgen.kdl b/include/tests/procgen/array/F32Array.procgen.kdl new file mode 100644 index 0000000..71285e0 --- /dev/null +++ b/include/tests/procgen/array/F32Array.procgen.kdl @@ -0,0 +1,5 @@ +// An array of floats (wrapped in a struct because C hates arrays) + +struct "F32Array" { + _ "[f32; 4]" +} \ No newline at end of file diff --git a/include/tests/procgen/array/I64Array.procgen.kdl b/include/tests/procgen/array/I64Array.procgen.kdl new file mode 100644 index 0000000..0370532 --- /dev/null +++ b/include/tests/procgen/array/I64Array.procgen.kdl @@ -0,0 +1,5 @@ +// An array of i64 (wrapped in a struct because C hates arrays) + +struct "I64Array" { + _ "[i64; 3]" +} \ No newline at end of file diff --git a/include/tests/procgen/array/U8Array.procgen.kdl b/include/tests/procgen/array/U8Array.procgen.kdl new file mode 100644 index 0000000..8d6f8ac --- /dev/null +++ b/include/tests/procgen/array/U8Array.procgen.kdl @@ -0,0 +1,5 @@ +// An array of bytes (wrapped in a struct because C hates arrays) + +struct "U8Array" { + _ "[u8; 6]" +} \ No newline at end of file diff --git a/include/tests/procgen/enum/MultiVariantEnum.procgen.kdl b/include/tests/procgen/enum/MultiVariantEnum.procgen.kdl new file mode 100644 index 0000000..633f4c6 --- /dev/null +++ b/include/tests/procgen/enum/MultiVariantEnum.procgen.kdl @@ -0,0 +1,8 @@ +// Just a nice little multi variant enum + +enum "MultiVariantEnum" { + "A" + "B" + "C" + "D" +} \ No newline at end of file diff --git a/include/tests/procgen/enum/SingleVariantEnum.procgen.kdl b/include/tests/procgen/enum/SingleVariantEnum.procgen.kdl new file mode 100644 index 0000000..38ce29f --- /dev/null +++ b/include/tests/procgen/enum/SingleVariantEnum.procgen.kdl @@ -0,0 +1,5 @@ +// Just a nice little single variant enum + +enum "SingleVariantEnum" { + "A" +} \ No newline at end of file diff --git a/include/tests/normal/IntrusiveList.kdl b/include/tests/procgen/fancy/IntrusiveList.procgen.kdl similarity index 87% rename from include/tests/normal/IntrusiveList.kdl rename to include/tests/procgen/fancy/IntrusiveList.procgen.kdl index 002cd49..6e6f860 100644 --- a/include/tests/normal/IntrusiveList.kdl +++ b/include/tests/procgen/fancy/IntrusiveList.procgen.kdl @@ -25,12 +25,3 @@ tagged "Link" { Some { _ "&Node"; } None } - -fn "intrusive1" { - inputs { _ "IntrusiveList"; } -} - -fn "intrusivemany" { - inputs { _ "&[IntrusiveList; 12]"; } -} - diff --git a/include/tests/procgen/primitive/EmptyTup.procgen.kdl b/include/tests/procgen/primitive/EmptyTup.procgen.kdl new file mode 100644 index 0000000..d1dcc28 --- /dev/null +++ b/include/tests/procgen/primitive/EmptyTup.procgen.kdl @@ -0,0 +1 @@ +alias "EmptyTup" "()" \ No newline at end of file diff --git a/include/tests/procgen/primitives/bool.procgen.kdl b/include/tests/procgen/primitive/bool.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/bool.procgen.kdl rename to include/tests/procgen/primitive/bool.procgen.kdl diff --git a/include/tests/procgen/primitives/f32.procgen.kdl b/include/tests/procgen/primitive/f32.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/f32.procgen.kdl rename to include/tests/procgen/primitive/f32.procgen.kdl diff --git a/include/tests/procgen/primitives/f64.procgen.kdl b/include/tests/procgen/primitive/f64.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/f64.procgen.kdl rename to include/tests/procgen/primitive/f64.procgen.kdl diff --git a/include/tests/procgen/primitives/i128.procgen.kdl b/include/tests/procgen/primitive/i128.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/i128.procgen.kdl rename to include/tests/procgen/primitive/i128.procgen.kdl diff --git a/include/tests/procgen/primitives/i16.procgen.kdl b/include/tests/procgen/primitive/i16.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/i16.procgen.kdl rename to include/tests/procgen/primitive/i16.procgen.kdl diff --git a/include/tests/procgen/primitives/i32.procgen.kdl b/include/tests/procgen/primitive/i32.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/i32.procgen.kdl rename to include/tests/procgen/primitive/i32.procgen.kdl diff --git a/include/tests/procgen/primitives/i64.procgen.kdl b/include/tests/procgen/primitive/i64.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/i64.procgen.kdl rename to include/tests/procgen/primitive/i64.procgen.kdl diff --git a/include/tests/procgen/primitives/i8.procgen.kdl b/include/tests/procgen/primitive/i8.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/i8.procgen.kdl rename to include/tests/procgen/primitive/i8.procgen.kdl diff --git a/include/tests/procgen/primitives/ptr.procgen.kdl b/include/tests/procgen/primitive/ptr.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/ptr.procgen.kdl rename to include/tests/procgen/primitive/ptr.procgen.kdl diff --git a/include/tests/procgen/primitives/u128.procgen.kdl b/include/tests/procgen/primitive/u128.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/u128.procgen.kdl rename to include/tests/procgen/primitive/u128.procgen.kdl diff --git a/include/tests/procgen/primitives/u16.procgen.kdl b/include/tests/procgen/primitive/u16.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/u16.procgen.kdl rename to include/tests/procgen/primitive/u16.procgen.kdl diff --git a/include/tests/procgen/primitives/u32.procgen.kdl b/include/tests/procgen/primitive/u32.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/u32.procgen.kdl rename to include/tests/procgen/primitive/u32.procgen.kdl diff --git a/include/tests/procgen/primitives/u64.procgen.kdl b/include/tests/procgen/primitive/u64.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/u64.procgen.kdl rename to include/tests/procgen/primitive/u64.procgen.kdl diff --git a/include/tests/procgen/primitives/u8.procgen.kdl b/include/tests/procgen/primitive/u8.procgen.kdl similarity index 100% rename from include/tests/procgen/primitives/u8.procgen.kdl rename to include/tests/procgen/primitive/u8.procgen.kdl diff --git a/include/tests/procgen/puns/MetersU32.procgen.kdl b/include/tests/procgen/pun/MetersU32.procgen.kdl similarity index 100% rename from include/tests/procgen/puns/MetersU32.procgen.kdl rename to include/tests/procgen/pun/MetersU32.procgen.kdl diff --git a/include/tests/procgen/ref/RefArray.procgen.kdl b/include/tests/procgen/ref/RefArray.procgen.kdl new file mode 100644 index 0000000..65fd7d1 --- /dev/null +++ b/include/tests/procgen/ref/RefArray.procgen.kdl @@ -0,0 +1 @@ +alias "RefArray" "&[u32; 7]" \ No newline at end of file diff --git a/include/tests/procgen/struct/EmptyStruct.procgen.kdl b/include/tests/procgen/struct/EmptyStruct.procgen.kdl new file mode 100644 index 0000000..1bd5fe6 --- /dev/null +++ b/include/tests/procgen/struct/EmptyStruct.procgen.kdl @@ -0,0 +1,3 @@ +// How disagreeable are top-level empty structs? +struct "EmptyStruct" { +} \ No newline at end of file diff --git a/include/tests/procgen/struct/EmptyStructInside.procgen.kdl b/include/tests/procgen/struct/EmptyStructInside.procgen.kdl new file mode 100644 index 0000000..1fd4137 --- /dev/null +++ b/include/tests/procgen/struct/EmptyStructInside.procgen.kdl @@ -0,0 +1,10 @@ +// Are empty structs ok if they're inside another struct? + +struct "EmptyStructInside" { + _ "u32" + _ "EmptyStruct" + _ "u64" +} + +struct "EmptyStruct" { +} \ No newline at end of file diff --git a/include/tests/procgen/struct/SimplePaddedStruct.procgen.kdl b/include/tests/procgen/struct/SimplePaddedStruct.procgen.kdl new file mode 100644 index 0000000..a49c24a --- /dev/null +++ b/include/tests/procgen/struct/SimplePaddedStruct.procgen.kdl @@ -0,0 +1,9 @@ +// A nice little struct with probably a lot of padding + +struct "SimplePaddedStruct" { + _ "u8" + _ "f32" + _ "i16" + _ "bool" + _ "i64" +} \ No newline at end of file diff --git a/include/tests/procgen/struct/SimpleStruct.procgen.kdl b/include/tests/procgen/struct/SimpleStruct.procgen.kdl new file mode 100644 index 0000000..d68fbaf --- /dev/null +++ b/include/tests/procgen/struct/SimpleStruct.procgen.kdl @@ -0,0 +1,9 @@ +// A nice little struct with probably no padding + +struct "SimpleStruct" { + _ "i32" + _ "u32" + _ "f64" + _ "u64" + _ "bool" +} diff --git a/include/tests/procgen/tagged/CLikeTagged.procgen.kdl b/include/tests/procgen/tagged/CLikeTagged.procgen.kdl new file mode 100644 index 0000000..7cb3762 --- /dev/null +++ b/include/tests/procgen/tagged/CLikeTagged.procgen.kdl @@ -0,0 +1,9 @@ +// A tagged that's basically an enum + +tagged "CLikeTagged" { + "A" + "B" + "C" + "D" + "E" +} \ No newline at end of file diff --git a/include/tests/procgen/tagged/OptI32Tagged.procgen.kdl b/include/tests/procgen/tagged/OptI32Tagged.procgen.kdl new file mode 100644 index 0000000..2d1a56e --- /dev/null +++ b/include/tests/procgen/tagged/OptI32Tagged.procgen.kdl @@ -0,0 +1,6 @@ +// An option-like enum of i32 + +tagged "OptI32Tagged" { + Some { _ "i32"; } + None +} \ No newline at end of file diff --git a/include/tests/procgen/union/MultiVariantUnion.procgen.kdl b/include/tests/procgen/union/MultiVariantUnion.procgen.kdl new file mode 100644 index 0000000..03c9f5c --- /dev/null +++ b/include/tests/procgen/union/MultiVariantUnion.procgen.kdl @@ -0,0 +1,10 @@ +union "MultiVariantUnion" { + _ "u32" + _ "i64" +} + +struct "Point3" { + x "f32" + y "f32" + z "f32" +} \ No newline at end of file diff --git a/include/tests/procgen/union/SingleVariantUnion.procgen.kdl b/include/tests/procgen/union/SingleVariantUnion.procgen.kdl new file mode 100644 index 0000000..18c84ec --- /dev/null +++ b/include/tests/procgen/union/SingleVariantUnion.procgen.kdl @@ -0,0 +1,3 @@ +union "SingleVariantUnion" { + _ "u32" +} \ No newline at end of file diff --git a/src/abis/c.rs b/src/abis/c.rs index b20c4cf..f4b7627 100644 --- a/src/abis/c.rs +++ b/src/abis/c.rs @@ -335,7 +335,7 @@ impl CcAbiImpl { .arg("-o") .arg(&obj_path) .arg("-c") - .arg(&src_path) + .arg(src_path) .status() .unwrap(); Command::new("ar") @@ -363,7 +363,7 @@ impl CcAbiImpl { .arg("-o") .arg(&obj_path) .arg("-c") - .arg(&src_path) + .arg(src_path) .status() .unwrap(); Command::new("ar") diff --git a/src/abis/c/declare.rs b/src/abis/c/declare.rs index 97081da..cf1de5f 100644 --- a/src/abis/c/declare.rs +++ b/src/abis/c/declare.rs @@ -1,5 +1,5 @@ use super::*; -use kdl_script::parse::{Attr, AttrAligned, AttrPacked, AttrPassthrough, AttrRepr, LangRepr, Repr}; +use kdl_script::parse::Attr; use kdl_script::types::{AliasTy, ArrayTy, FuncIdx, PrimitiveTy, RefTy, Ty, TyIdx}; use std::fmt::Write; @@ -251,12 +251,12 @@ impl CcAbiImpl { f.add_indent(1); for variant in &enum_ty.variants { let variant_name = &variant.name; - writeln!(f, "{variant_name};")?; + writeln!(f, "{}_{variant_name},", enum_ty.name)?; } f.sub_indent(1); writeln!(f, "}} {};\n", enum_ty.name)?; } - Ty::Tagged(tagged_ty) => { + Ty::Tagged(_tagged_ty) => { return Err(UnsupportedError::Other( "c doesn't have tagged unions impled yet".to_owned(), ))?; @@ -336,7 +336,7 @@ impl CcAbiImpl { pub fn generate_repr_attr( &self, - f: &mut Fivemat, + _f: &mut Fivemat, attrs: &[Attr], _ty_style: &str, ) -> Result<(), GenerateError> { diff --git a/src/abis/c/init.rs b/src/abis/c/init.rs index cfff9a0..86433a6 100644 --- a/src/abis/c/init.rs +++ b/src/abis/c/init.rs @@ -24,7 +24,7 @@ impl CcAbiImpl { PrimitiveTy::U32 => write!(f, "{}", val.generate_u32())?, PrimitiveTy::U64 => write!(f, "{}ull", val.generate_u64())?, PrimitiveTy::I128 => { - let val = val.generate_u128(); + let val = val.generate_i128(); let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; write!( @@ -142,7 +142,6 @@ impl CcAbiImpl { } // Nominal types we need to emit a decl for Ty::Struct(struct_ty) => { - let name = alias.unwrap_or(&struct_ty.name); write!(f, "{{ ")?; for (field_idx, field) in struct_ty.fields.iter().enumerate() { if field_idx > 0 { @@ -156,7 +155,6 @@ impl CcAbiImpl { write!(f, " }}")?; } Ty::Union(union_ty) => { - let name = alias.unwrap_or(&union_ty.name); write!(f, "{{ ")?; let tag_val = vals.next_val(); if let Some(field) = tag_val.select_val(&union_ty.fields) { @@ -168,7 +166,7 @@ impl CcAbiImpl { write!(f, " }}")?; } - Ty::Tagged(tagged_ty) => { + Ty::Tagged(_tagged_ty) => { return Err(UnsupportedError::Other( "c doesn't have tagged unions impled yet".to_owned(), ))?; diff --git a/src/abis/c/write.rs b/src/abis/c/write.rs index 9825b44..3a341cb 100644 --- a/src/abis/c/write.rs +++ b/src/abis/c/write.rs @@ -105,7 +105,7 @@ impl CcAbiImpl { self.write_fields(f, state, to, &base, field.ty, vals)?; } } - Ty::Tagged(tagged_ty) => { + Ty::Tagged(_tagged_ty) => { return Err(UnsupportedError::Other( "c doesn't have tagged unions impled yet".to_owned(), ))?; @@ -244,7 +244,12 @@ impl CcAbiImpl { ) -> Result<(), GenerateError> { match state.options.val_writer { WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, (uint32_t){});", variant_idx)?; + writeln!(f, "{{")?; + f.add_indent(1); + writeln!(f, "uint32_t _temp = {};", variant_idx)?; + writeln!(f, "write_field({to}, _temp);")?; + f.sub_indent(1); + writeln!(f, "}}")?; } WriteImpl::Assert => { // Noop, do nothing @@ -259,6 +264,7 @@ impl CcAbiImpl { Ok(()) } + #[allow(dead_code)] pub fn write_error_tag_field( &self, f: &mut Fivemat, @@ -267,7 +273,12 @@ impl CcAbiImpl { ) -> Result<(), GenerateError> { match state.options.val_writer { WriteImpl::HarnessCallback => { - writeln!(f, "write_field({to}, (uint32_t){});", u32::MAX)?; + writeln!(f, "{{")?; + f.add_indent(1); + writeln!(f, "uint32_t _temp = {};", u32::MAX)?; + writeln!(f, "write_field({to}, _temp);")?; + f.sub_indent(1); + writeln!(f, "}}")?; } WriteImpl::Assert | WriteImpl::Print => { writeln!(f, r#"unreachable("enum had unexpected variant!?")"#)?; diff --git a/src/abis/c_old.rs b/src/abis/c_old.rs deleted file mode 100644 index 444c590..0000000 --- a/src/abis/c_old.rs +++ /dev/null @@ -1,601 +0,0 @@ - - -impl AbiImpl for CcAbiImpl { - fn generate_callee( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - self.write_c_signature(f, function, convention)?; - writeln!(f, " {{")?; - - writeln!(f)?; - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - "{}", - self.c_write_val(input, "CALLEE_INPUTS", ARG_NAMES[idx], false)? - )?; - } - writeln!(f)?; - if let Some(output) = &function.output { - writeln!( - f, - " {} = {};", - self.c_var_decl(output, OUTPUT_NAME)?, - self.c_val(output)? - )?; - writeln!( - f, - "{}", - self.c_write_val(output, "CALLEE_OUTPUTS", OUTPUT_NAME, true)? - )?; - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - writeln!( - f, - " {}", - self.c_var_return(output, OUTPUT_NAME, OUT_PARAM_NAME)? - )?; - } else { - writeln!(f, " FINISHED_FUNC(CALLEE_INPUTS, CALLEE_OUTPUTS);")?; - } - writeln!(f, "}}")?; - writeln!(f)?; - } - - Ok(()) - } - - fn generate_caller( - &self, - f: &mut dyn Write, - test: &Test, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - self.write_c_prefix(f, test)?; - - // Generate the extern block - for function in &test.funcs { - self.write_c_signature(f, function, convention)?; - writeln!(f, ";")?; - } - - writeln!(f)?; - writeln!(f, "void do_test(void) {{")?; - - // Generate the impls - for function in &test.funcs { - if !function.has_convention(convention) { - continue; - } - // Add an extra scope to avoid clashes between subtests - writeln!(f, "{{")?; - // Inputs - for (idx, input) in function.inputs.iter().enumerate() { - writeln!( - f, - " {} = {};", - self.c_var_decl(input, ARG_NAMES[idx])?, - self.c_val(input)? - )?; - writeln!( - f, - "{}", - self.c_write_val(input, "CALLER_INPUTS", ARG_NAMES[idx], true)? - )?; - } - writeln!(f)?; - - // Output - let pass_out = if let Some(output) = &function.output { - if let Some(out_param_var) = self.c_out_param_var(output, OUTPUT_NAME)? { - writeln!(f, " {};", out_param_var)?; - write!(f, " ")?; - true - } else { - write!(f, " {} = ", self.c_var_decl(output, OUTPUT_NAME)?)?; - false - } - } else { - write!(f, " ")?; - false - }; - - // Do the actual call - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_pass(input, ARG_NAMES[idx])?)?; - } - if pass_out { - let pass = self.c_arg_pass(function.output.as_ref().unwrap(), OUTPUT_NAME)?; - if function.inputs.is_empty() { - write!(f, "{}", pass)?; - } else { - write!(f, ", {}", pass)?; - } - } - writeln!(f, ");")?; - - if let Some(output) = &function.output { - writeln!( - f, - "{}", - self.c_write_val(output, "CALLER_OUTPUTS", OUTPUT_NAME, true)? - )?; - } - writeln!(f, " FINISHED_FUNC(CALLER_INPUTS, CALLER_OUTPUTS);")?; - writeln!(f, "}}")?; - writeln!(f)?; - } - writeln!(f, "}}")?; - Ok(()) - } - -} - -impl CcAbiImpl { - - // Emit a function signature - fn write_c_signature( - &self, - f: &mut dyn Write, - function: &Func, - convention: CallingConvention, - ) -> Result<(), GenerateError> { - let convention_decl = self.c_convention_decl(convention)?; - - // First figure out the return (by-ref requires an out-param) - let out_param = if let Some(output) = &function.output { - let out_param = self.c_out_param(output, OUT_PARAM_NAME)?; - if out_param.is_none() { - write!(f, "{} ", self.c_arg_type(output)?)?; - } else { - write!(f, "void ")?; - } - out_param - } else { - write!(f, "void ")?; - None - }; - - write!(f, "{}", convention_decl)?; - - // Now write out the args - write!(f, "{}(", function.name)?; - for (idx, input) in function.inputs.iter().enumerate() { - if idx != 0 { - write!(f, ", ")?; - } - write!(f, "{}", self.c_arg_decl(input, ARG_NAMES[idx])?)?; - } - - // Add extra implicit args - if let Some(out_param) = out_param { - if !function.inputs.is_empty() { - write!(f, ", ")?; - } - write!(f, "{out_param}")?; - } else if function.inputs.is_empty() { - write!(f, "void")?; - } - write!(f, ")")?; - - Ok(()) - } - - /// Every test should start by loading in the harness' "header" - /// and forward-declaring any structs that will be used. - fn write_c_prefix(&self, f: &mut dyn Write, test: &Test) -> Result<(), GenerateError> { - // Load test harness "headers" - write!(f, "{}", C_TEST_PREFIX)?; - - // Forward-decl struct types - let mut forward_decls = std::collections::HashMap::::new(); - for function in &test.funcs { - for val in function.inputs.iter().chain(function.output.as_ref()) { - for (name, decl) in self.c_forward_decl(val)? { - match forward_decls.entry(name) { - std::collections::hash_map::Entry::Occupied(entry) => { - if entry.get() != &decl { - return Err(GenerateError::InconsistentStructDefinition { - name: entry.key().clone(), - old_decl: entry.remove(), - new_decl: decl, - }); - } - } - std::collections::hash_map::Entry::Vacant(entry) => { - writeln!(f, "{decl}")?; - entry.insert(decl); - } - } - } - } - } - - Ok(()) - } - - fn c_forward_decl(&self, val: &Val) -> Result, GenerateError> { - use Val::*; - match val { - Struct(name, fields) => { - let mut results = vec![]; - for field in fields.iter() { - results.extend(self.c_forward_decl(field)?); - } - let mut output = String::new(); - let ref_name = format!("struct {name}"); - output.push_str(&format!("struct {name} {{\n")); - for (idx, field) in fields.iter().enumerate() { - let line = format!(" {};\n", self.c_field_decl(field, FIELD_NAMES[idx])?); - output.push_str(&line); - } - output.push_str("};\n"); - results.push((ref_name, output)); - Ok(results) - } - Array(vals) => self.c_forward_decl(&vals[0]), - Ref(pointee) => self.c_forward_decl(pointee), - _ => Ok(vec![]), - } - } - - /// The decl to use for a local var (reference-ness stripped) - fn c_var_decl(&self, val: &Val, var_name: &str) -> Result { - use Val::*; - let val = match val { - Ref(pointee) => self.c_var_decl(pointee, var_name)?, - Array(_) => { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - format!("{} {var_name}{array_levels}", self.c_arg_type(cur_val)?) - } - normal_val => format!("{} {var_name}", self.c_arg_type(normal_val)?), - }; - Ok(val) - } - - /// The decl to use for a function arg (apply referenceness) - fn c_arg_decl(&self, val: &Val, arg_name: &str) -> Result { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - format!("{}* {arg_name}", self.c_arg_type(cur_val)?) - } else { - format!("{} {arg_name}{array_levels}", self.c_arg_type(cur_val)?) - } - } else { - format!("{} {arg_name}", self.c_arg_type(val)?) - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param( - &self, - val: &Val, - out_param_name: &str, - ) -> Result, GenerateError> { - let out = if let Val::Ref(pointee) = val { - let mut cur_val = &**pointee; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - if array_levels.is_empty() { - Some(format!("{}* {out_param_name}", self.c_arg_type(cur_val)?)) - } else { - Some(format!( - "{} {out_param_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - } else { - None - }; - Ok(out) - } - - /// If the return type needs to be an out_param, this returns it - fn c_out_param_var( - &self, - val: &Val, - output_name: &str, - ) -> Result, GenerateError> { - if let Val::Ref(pointee) = val { - Ok(Some(self.c_var_decl(pointee, output_name)?)) - } else { - Ok(None) - } - } - - /// How to pass an argument - fn c_arg_pass(&self, val: &Val, arg_name: &str) -> Result { - if let Val::Ref(pointee) = val { - if let Val::Array(_) = &**pointee { - Ok(arg_name.to_string()) - } else { - Ok(format!("&{arg_name}")) - } - } else { - Ok(arg_name.to_string()) - } - } - - /// How to return a value - fn c_var_return( - &self, - val: &Val, - var_name: &str, - out_param_name: &str, - ) -> Result { - if let Val::Ref(_) = val { - Ok(format!( - "memcpy({out_param_name}, &{var_name}, sizeof({var_name}));" - )) - } else { - Ok(format!("return {var_name};")) - } - } - - /// The type name to use for this value when it is stored in args/vars. - fn c_arg_type(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => { - let mut cur_val = &**pointee; - while let Val::Array(vals) = cur_val { - cur_val = &vals[0]; - } - format!("{}*", self.c_arg_type(cur_val)?) - } - Ptr(_) => "void*".to_string(), - Bool(_) => "bool".to_string(), - Array(_vals) => { - // C arrays are kinda fake due to how they decay in function arg - // position, so a ton of code needs to very delicately detect arrays - // and desugar them properly. Since most things eventually sink into - // c_arg_type, this is a good guard against something forgetting to - // specially handle arrays! - // - // But also it just isn't legal to pass an array by-value in C - // (it decays to a pointer, so you need to wrap it in Ref for - // other ABIs to understand that's what we're doing. - return Err(GenerateError::CUnsupported( - "C Arrays can't be passed directly, wrap this in Ref".to_string(), - )); - } - Struct(name, _) => format!("struct {name}"), - Float(FloatVal::c_double(_)) => "double".to_string(), - Float(FloatVal::c_float(_)) => "float".to_string(), - Int(int_val) => match int_val { - c__int128(_) => "__int128_t".to_string(), - c_int64_t(_) => "int64_t".to_string(), - c_int32_t(_) => "int32_t".to_string(), - c_int16_t(_) => "int16_t".to_string(), - c_int8_t(_) => "int8_t".to_string(), - c__uint128(_) => "__uint128_t".to_string(), - c_uint64_t(_) => "uint64_t".to_string(), - c_uint32_t(_) => "uint32_t".to_string(), - c_uint16_t(_) => "uint16_t".to_string(), - c_uint8_t(_) => "uint8_t".to_string(), - }, - }; - Ok(val) - } - - /// The type name to use for this value when it is stored in composite. - /// - /// This is separated out in case there's a type that needs different - /// handling in this context to conform to a layout (i.e. how C arrays - /// decay into pointers when used in function args). - fn c_field_decl(&self, val: &Val, field_name: &str) -> Result { - let mut cur_val = val; - let mut array_levels = String::new(); - while let Val::Array(vals) = cur_val { - array_levels.push_str(&format!("[{}]", vals.len())); - cur_val = &vals[0]; - } - Ok(format!( - "{} {field_name}{array_levels}", - self.c_arg_type(cur_val)? - )) - } - - /// An expression that generates this value. - pub fn c_val(&self, val: &Val) -> Result { - use IntVal::*; - use Val::*; - let val = match val { - Ref(pointee) => self.c_val(pointee)?, - Ptr(addr) => format!("(void*){addr:#X}ull"), - Bool(val) => format!("{val}"), - Array(vals) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, elem) in vals.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = (self.c_val(elem)?).to_string(); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Struct(_name, fields) => { - let mut output = String::new(); - output.push_str("{ "); - for (idx, field) in fields.iter().enumerate() { - if idx != 0 { - output.push_str(", "); - } - let part = format!(".{} = {}", FIELD_NAMES[idx], self.c_val(field)?); - output.push_str(&part); - } - output.push_str(" }"); - output - } - Float(FloatVal::c_double(val)) => { - if val.fract() == 0.0 { - format!("{val}.0") - } else { - format!("{val}") - } - } - Float(FloatVal::c_float(val)) => { - if val.fract() == 0.0 { - format!("{val}.0f") - } else { - format!("{val}f") - } - } - Int(int_val) => match *int_val { - c__int128(val) => { - let lower = (val as u128) & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = ((val as u128) & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__int128_t){lower:#X}ull) | (((__int128_t){higher:#X}ull) << 64)") - } - c__uint128(val) => { - let lower = val & 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF; - let higher = (val & 0xFFFF_FFFF_FFFF_FFFF_0000_0000_0000_0000) >> 64; - format!("((__uint128_t){lower:#X}ull) | (((__uint128_t){higher:#X}ull) << 64)") - } - c_int64_t(val) => format!("{val}"), - c_int32_t(val) => format!("{val}"), - c_int16_t(val) => format!("{val}"), - c_int8_t(val) => format!("{val}"), - c_uint64_t(val) => format!("{val}ull"), - c_uint32_t(val) => format!("{val:#X}"), - c_uint16_t(val) => format!("{val:#X}"), - c_uint8_t(val) => format!("{val:#X}"), - }, - }; - Ok(val) - } - - /// Emit the WRITE calls and FINISHED_VAL for this value. - /// This will WRITE every leaf subfield of the type. - /// `to` is the BUFFER to use, `from` is the variable name of the value. - fn c_write_val( - &self, - val: &Val, - to: &str, - from: &str, - is_var_root: bool, - ) -> Result { - use std::fmt::Write; - let mut output = String::new(); - for path in self.c_var_paths(val, from, is_var_root)? { - writeln!( - output, - " WRITE_FIELD({to}, (char*)&{path}, (uint32_t)sizeof({path}));" - ) - .unwrap(); - } - write!(output, " FINISHED_VAL({to});").unwrap(); - - Ok(output) - } - - /// Compute the paths to every subfield of this value, with `from` - /// as the base path to that value, for c_write_val's use. - fn c_var_paths( - &self, - val: &Val, - from: &str, - is_var_root: bool, - ) -> Result, GenerateError> { - let paths = match val { - Val::Int(_) | Val::Float(_) | Val::Bool(_) | Val::Ptr(_) => { - vec![format!("{from}")] - } - Val::Struct(_name, fields) => { - let mut paths = vec![]; - for (idx, field) in fields.iter().enumerate() { - let base = format!("{from}.{}", FIELD_NAMES[idx]); - paths.extend(self.c_var_paths(field, &base, false)?); - } - paths - } - Val::Ref(pointee) => { - if is_var_root { - self.c_var_paths(pointee, from, false)? - } else if let Val::Array(_) = &**pointee { - self.c_var_paths(pointee, from, false)? - } else { - let base = format!("(*{from})"); - self.c_var_paths(pointee, &base, false)? - } - } - Val::Array(vals) => { - let mut paths = vec![]; - for (i, elem) in vals.iter().enumerate() { - let base = format!("{from}[{i}]"); - paths.extend(self.c_var_paths(elem, &base, false)?); - } - paths - } - }; - - Ok(paths) - } - - /* - /// Format specifiers for C types, for print debugging. - /// This is no longer used but it's a shame to throw out. - pub fn cfmt(&self, val: &Val) -> &'static str { - use Val::*; - use IntVal::*; - match val { - Ref(x) => self.cfmt(x), - Ptr(_) => "\"p\"", - Bool(_) => "\"d\"", - Array(_) => { - todo!() - } - Struct(_name, _fields) => { - todo!() - } - Float(FloatVal::c_double(_val)) => "\"f\"", - Float(FloatVal::c_float(_val)) => "\"f\"", - Int(int_val) => match int_val { - c_uint8_t(..) => "PRIu8", - c_uint16_t(..) => "PRIu16", - c_uint32_t(..) => "PRIu32", - c_uint64_t(..) => "PRIu64", - c_uint128_t(..) => "PRIu128", - - c_int8_t(..) => "PRId8", - c_int16_t(..) => "PRId16", - c_int32_t(..) => "PRId32", - c_int64_t(..) => "PRId64", - c_int128_t(..) => "PRId128", - } - } - } - */ -} diff --git a/src/abis/rust.rs b/src/abis/rust.rs index 4a8bd00..22e9eb3 100644 --- a/src/abis/rust.rs +++ b/src/abis/rust.rs @@ -49,9 +49,16 @@ impl TestState { #[allow(dead_code)] pub struct RustcAbiImpl { is_nightly: bool, + platform: Platform, codegen_backend: Option, } +#[derive(PartialEq)] +enum Platform { + Windows, + Unixy, +} + impl AbiImpl for RustcAbiImpl { fn name(&self) -> &'static str { "rustc" @@ -271,7 +278,14 @@ impl RustcAbiImpl { impl RustcAbiImpl { pub fn new(_system_info: &Config, codegen_backend: Option) -> Self { + let platform = if cfg!(target_os = "windows") { + Platform::Windows + } else { + Platform::Unixy + }; + Self { + platform, is_nightly: built_info::RUSTC_VERSION.contains("nightly"), codegen_backend, } diff --git a/src/abis/rust/declare.rs b/src/abis/rust/declare.rs index 952658f..a5bcb6b 100644 --- a/src/abis/rust/declare.rs +++ b/src/abis/rust/declare.rs @@ -417,25 +417,53 @@ impl RustcAbiImpl { &self, convention: CallingConvention, ) -> Result<&'static str, GenerateError> { + use super::Platform::*; + let conv = match convention { CallingConvention::C => "C", - CallingConvention::Cdecl => "cdecl", CallingConvention::System => "system", CallingConvention::Win64 => "win64", CallingConvention::Sysv64 => "sysv64", CallingConvention::Aapcs => "aapcs", - CallingConvention::Stdcall => "stdcall", - CallingConvention::Fastcall => "fastcall", + CallingConvention::Cdecl => { + if self.platform == Windows { + "cdecl" + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + CallingConvention::Stdcall => { + if self.platform == Windows { + "stdcall" + } else { + return Err(self.unsupported_convention(&convention))?; + } + } + CallingConvention::Fastcall => { + if self.platform == Windows { + "fastcall" + } else { + return Err(self.unsupported_convention(&convention))?; + } + } CallingConvention::Vectorcall => { - if self.is_nightly { - "vectorcall" + if self.platform == Windows { + if self.is_nightly { + "vectorcall" + } else { + return Err(UnsupportedError::Other( + "vectorcall is an unstable rust feature, requires nightly".to_owned(), + ))?; + } } else { - return Err(UnsupportedError::Other( - "vectorcall is an unstable rust feature".to_owned(), - ))?; + return Err(self.unsupported_convention(&convention))?; } } }; Ok(conv) } + + fn unsupported_convention(&self, convention: &CallingConvention) -> UnsupportedError { + UnsupportedError::Other(format!("unsupported convention {convention}")) + } } diff --git a/src/files.rs b/src/files.rs index 000bd2a..646fdfd 100644 --- a/src/files.rs +++ b/src/files.rs @@ -30,7 +30,7 @@ impl Paths { let harness_file_contents = get_file("harness/harness.rs"); let harness_file_path = self.harness_main_file(); let mut file = - std::fs::File::create_new(&harness_file_path).expect("failed to create harness.rs"); + std::fs::File::create_new(harness_file_path).expect("failed to create harness.rs"); file.write_all(harness_file_contents.as_bytes()) .expect("failed to initialize harness.rs"); } diff --git a/src/harness/build.rs b/src/harness/build.rs index 963aa6b..27c4c39 100644 --- a/src/harness/build.rs +++ b/src/harness/build.rs @@ -47,9 +47,14 @@ impl TestHarness { .clone(); // Either acquire the cached result, or make it let real_lib_name = once - .get_or_try_init(|| { + .get_or_try_init(|| async { + let _token = self + .concurrency_limiter + .acquire() + .await + .expect("failed to acquire concurrency limit semaphore"); info!("compiling {lib_name}"); - build_static_lib(src_path, abi_impl, call_side, out_dir, &lib_name) + build_static_lib(src_path, abi_impl, call_side, out_dir, &lib_name).await }) .await? .clone(); @@ -62,6 +67,11 @@ impl TestHarness { build: &BuildOutput, out_dir: &Utf8Path, ) -> Result { + let _token = self + .concurrency_limiter + .acquire() + .await + .expect("failed to acquire concurrency limit semaphore"); let dynamic_lib_name = self.dynamic_lib_name(key); info!("linking {dynamic_lib_name}"); link_dynamic_lib(build, out_dir, &dynamic_lib_name) diff --git a/src/harness/mod.rs b/src/harness/mod.rs index ad47365..20df7aa 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -13,7 +13,7 @@ use crate::{ }; use camino::Utf8PathBuf; use std::sync::{Arc, Mutex}; -use tokio::sync::OnceCell; +use tokio::sync::{OnceCell, Semaphore}; use tracing::warn; mod build; @@ -35,6 +35,7 @@ pub struct TestHarness { tests_with_abi_impl: Memoized<(TestId, ValueGeneratorKind, AbiImplId), Arc>, generated_sources: Memoized, built_static_libs: Memoized, + concurrency_limiter: tokio::sync::Semaphore, } impl TestHarness { @@ -47,6 +48,7 @@ impl TestHarness { tests_with_abi_impl: Default::default(), generated_sources: Default::default(), built_static_libs: Default::default(), + concurrency_limiter: Semaphore::new(8), } } pub fn add_abi_impl(&mut self, id: AbiImplId, abi_impl: A) { diff --git a/src/procgen.rs b/src/procgen.rs index 35c0846..5be07f9 100644 --- a/src/procgen.rs +++ b/src/procgen.rs @@ -11,17 +11,25 @@ fn procgen_test_for_ty_impl( ) -> std::fmt::Result { let ty = ty_name; let ty_ref = format!("&{ty_name}"); - if let Some(ty_def) = ty_def { + + // Apply the type's definitions first + let has_refs = if let Some(ty_def) = ty_def { writeln!(out, "{}", ty_def)?; - } + // To avoid outparam nonsense, avoid testing outputs of the type + // if any part of its definition involves a reference. + // (Yes this is a blunt check but it's fine enough.) + ty_def.contains('&') + } else { + false + }; // Start gentle with basic one value in/out tests add_func(out, "val_in", &[ty], &[])?; - add_func(out, "val_out", &[], &[ty])?; - add_func(out, "val_in_out", &[ty], &[ty])?; add_func(out, "ref_in", &[&ty_ref], &[])?; - // add_func(out, "ref_out", &[], &[&ty_ref])?; - // add_func(out, "ref_in_out", &[&ty_ref], &[&ty_ref])?; + if !has_refs { + add_func(out, "val_out", &[], &[ty])?; + add_func(out, "val_in_out", &[ty], &[ty])?; + } // Stress out the calling convention and try lots of different // input counts. For many types this will result in register diff --git a/src/report.rs b/src/report.rs index a9e705c..c5200b5 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,4 +1,5 @@ use camino::Utf8PathBuf; +use console::Style; use serde::Serialize; use serde_json::json; @@ -333,25 +334,40 @@ impl FullReport { use TestConclusion::*; writeln!(f, "Final Results:")?; + let red = Style::new().red(); + let green = Style::new().green(); + let blue = Style::new().blue(); for test in &self.tests { + if let Skipped = test.conclusion { + continue; + } let pretty_test_name = harness.full_test_name(&test.key); write!(f, "{pretty_test_name:<40} ")?; match (&test.conclusion, &test.rules.check) { - (Skipped, _) => write!(f, "skipped")?, + (Skipped, _) => { + // Don't mention these, too many + // write!(f, "skipped")? + } (Passed, Pass(_)) => write!(f, "passed")?, (Passed, Random) => write!(f, "passed (random, result ignored)")?, (Passed, Fail(_)) => write!(f, "passed (failed as expected)")?, - (Failed, Pass(_)) => write!(f, "failed")?, - (Failed, Random) => write!(f, "failed!? (failed but random!?)")?, - (Failed, Fail(_)) => write!(f, "failed (passed unexpectedly!)")?, - (Failed, TestCheckMode::Busted(_)) => { - write!(f, "fixed (test was busted, congrats!)")? + (Failed, Pass(_)) => write!(f, "{}", red.apply_to("failed"))?, + (Failed, Random) => { + write!(f, "{}", red.apply_to("failed!? (failed but random!?)"))? } + (Failed, Fail(_)) => { + write!(f, "{}", red.apply_to("failed (passed unexpectedly!)"))? + } + (Failed, TestCheckMode::Busted(_)) => write!( + f, + "{}", + green.apply_to("fixed (test was busted, congrats!)") + )?, (TestConclusion::Busted, _) | (Passed, TestCheckMode::Busted(_)) => { - write!(f, "busted (known failure, ignored)")? + write!(f, "{}", blue.apply_to("busted (known failure, ignored)"))? } } @@ -386,15 +402,22 @@ impl FullReport { writeln!(f)?; } writeln!(f)?; - writeln!( - f, + let summary_style = if self.summary.num_failed > 0 { + red + } else if self.summary.num_busted > 0 { + blue + } else { + green + }; + let summary = format!( "{} tests run - {} passed, {} busted, {} failed, {} skipped", self.summary.num_tests, self.summary.num_passed, self.summary.num_busted, self.summary.num_failed, - self.summary.num_skipped, - )?; + self.summary.num_skipped + ); + writeln!(f, "{}", summary_style.apply_to(summary),)?; Ok(()) } From 6c819c947e3ee861f07d3228587a4579220772fd Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Sun, 30 Jun 2024 14:24:25 -0400 Subject: [PATCH 44/44] mark C tests --- src/error.rs | 2 +- src/report.rs | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/error.rs b/src/error.rs index 483f40f..9d14554 100644 --- a/src/error.rs +++ b/src/error.rs @@ -49,7 +49,7 @@ pub enum BuildError { std::str::from_utf8(&.0.stdout).unwrap(), std::str::from_utf8(&.0.stderr).unwrap())] RustCompile(std::process::Output), - #[error("c compile errror\n{0}")] + #[error("c compile error\n{0}")] CCompile(#[from] cc::Error), } diff --git a/src/report.rs b/src/report.rs index c5200b5..acfce38 100644 --- a/src/report.rs +++ b/src/report.rs @@ -11,6 +11,7 @@ use crate::TestId; use crate::WriteBuffer; /// These are the builtin test-expectations, edit these if there are new rules! +#[allow(unused_variables)] pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl) -> TestRules { use TestCheckMode::*; use TestRunMode::*; @@ -26,28 +27,18 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl let is_rust = caller.lang() == "rust" || callee.lang() == "rust"; let is_rust_and_c = is_c && is_rust; - // llvm and gcc disagree on the u128 ABI everywhere but aarch64 (arm64) and s390x. - // This is Bad! Ideally we should check for all clang<->gcc pairs but to start - // let's mark rust <-> C as disagreeing (because rust also disagrees with clang). - if !cfg!(any(target_arch = "aarch64", target_arch = "s390x")) - && test.test == "ui128" - && is_rust_and_c - { - result.check = Busted(Check); - } - // i128 types are fake on windows so this is all random garbage that might // not even compile, but that datapoint is a little interesting/useful // so let's keep running them and just ignore the result for now. // // Anyone who cares about this situation more can make the expectations more precise. - if cfg!(windows) && test.test == "ui128" { + if cfg!(windows) && (test.test == "i128" || test.test == "u128") { result.check = Random; } - // This test is just for investigation right now, nothing normative - if test.test == "sysv_i128_emulation" { - result.check = Random; + // FIXME: investigate why this is failing to build + if cfg!(windows) && is_c && (test.test == "EmptyStruct" || test.test == "EmptyStructInside") { + result.check = Busted(Build); } //