Skip to content
Merged
33 changes: 33 additions & 0 deletions .trinity/seals/t27o_T27oZig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"closure": [
{
"spec": "specs/tools/t27o/rust_convert.t27",
"spec_hash": "sha256:11f3aefa0a152d9ca963773018e35b1e39730ac53b25604be67252aaf85522a3"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:1902658b3fdd4234f5995a344bff8e880b6469635ea1fb0af023899d9cc6ead8",
"gen_hash_rust": "sha256:b804e5f4927cb4226bd6623c919e290f26a54d42d2c09ae9b949daeb1f00ee46",
"gen_hash_verilog": "sha256:1824c0407ae4c0cf97e7afb4b103ad6adcc20052636dbad081dd9330c1439e8e",
"gen_hash_zig": "sha256:c6e3f12811dd2eeaab6f29949789c444d9b65bdfa683d7a9d2ddb46d0359b906",
"module": "T27oZig",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T03:31:24Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:a21f02d266648e370fcaf0e2d9cc50f30b4b23277caa3dc4a625369a1b4c59e0",
"spec_path": "specs/tools/t27o/zig_convert.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 45,
"total": 45,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
10 changes: 5 additions & 5 deletions cli/tri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ mod t27o_ledger; // t27c gen-rust of specs/tools/t27o/ledger.t27: which runner's
mod lanes; // t27c gen-rust of specs/tri/lanes/lanes.t27: every rule of `tri lanes`
#[path = "../../../gen/rust/tools/t27o/rust_convert.rs"] #[allow(dead_code, unused_parens, unused_mut, unused_variables, non_snake_case, unused_assignments, clippy::all)]
mod t27o; // t27c gen-rust of specs/tools/t27o/rust_convert.t27: every rule of `tri t27o` (#8967)
#[path = "../../../gen/rust/tools/t27o/spice_convert.rs"] #[allow(dead_code, unused_parens, unused_mut, unused_variables, non_snake_case, unused_assignments, clippy::all)]
mod spice; // t27c gen-rust of specs/tools/t27o/spice_convert.t27: the SPICE front end of `tri t27o` (#10509)
#[path = "../../../gen/rust/tools/t27o/spice_convert.rs"] #[allow(dead_code, unused_parens, unused_mut, unused_variables, non_snake_case, unused_assignments, clippy::all)] mod spice; // t27c gen-rust of specs/tools/t27o/spice_convert.t27: the SPICE front end of `tri t27o` (#10509)
#[path = "../../../gen/rust/tools/t27o/zig_convert.rs"] #[allow(dead_code, unused_parens, unused_mut, unused_variables, non_snake_case, unused_assignments, clippy::all)] mod zig; // t27c gen-rust of specs/tools/t27o/zig_convert.t27: the Zig front end of `tri t27o` (#10765)
mod renum;
mod reseal;
mod rtl;
Expand Down Expand Up @@ -428,7 +428,7 @@ enum Commands {
/// Print one JSON object instead of the table.
#[arg(long)] json: bool,
},
/// t27o (Ouroboros): a Rust file as a t27 spec; --oracle prints the rustc harness, --check runs it and t27c test-report on the spec and its oracle tests (rules: specs/tools/t27o/rust_convert.t27). A .spice/.cir/.sp netlist prints its inventory or the refusal, and with --emit-cell the constants of the M1 linear cell folded from it (rules: specs/tools/t27o/spice_convert.t27).
/// t27o (Ouroboros): a Rust file as a t27 spec; --oracle prints the rustc harness, --check runs it and t27c test-report on the spec and its oracle tests (rules: specs/tools/t27o/rust_convert.t27). A .spice/.cir/.sp netlist prints its inventory or the refusal, and with --emit-cell the constants of the M1 linear cell folded from it (rules: specs/tools/t27o/spice_convert.t27). A .zig file prints the spec and its count line (rules: specs/tools/t27o/zig_convert.t27); its own tests are the oracle, so run `t27b test` on the spec (--oracle and --check are for Rust).
T27o {
file: String,
/// The module name; default the file's stem.
Expand Down Expand Up @@ -1349,8 +1349,8 @@ fn cmd_t27o(file: &str, name: Option<&str>, oracle: bool, check: bool, t27c: Opt
return Ok(spice::exit_code(&st));
}
let stem = name.map_or_else(|| Path::new(file).file_stem().map_or("Converted".into(), |s| s.to_string_lossy().into_owned()), str::to_string);
let (mut out, mut st, mut spec) = (vec![0u8; 1 << 24], vec![0usize; 1 << 16], vec![0u8; 1 << 24]);
let n = if oracle || check { t27o::oracle(&src, &mut out, &mut st) } else { t27o::convert(&src, stem.as_bytes(), &mut out, &mut st) };
let (mut out, mut st, mut spec) = (vec![0u8; 1 << 24], vec![0usize; 1 << 18], vec![0u8; 1 << 24]);
let n = if zig::is_zig_name(file.as_bytes()) { zig::to_t27(&src, stem.as_bytes(), &mut out, &mut st) } else if oracle || check { t27o::oracle(&src, &mut out, &mut st) } else { t27o::convert(&src, stem.as_bytes(), &mut out, &mut st) };
if !check {
std::io::Write::write_all(&mut std::io::stdout(), &out[..n.min(out.len())])?;
return Ok(0);
Expand Down
Loading
Loading