Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .trinity/seals/t27o_T27oSpice.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
{
"built_by": "t27c-bootstrap@0.5.2+9b556b7c3",
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"closure": [
{
"spec": "specs/analog/linear.t27",
"spec_hash": "sha256:3ddef7be183aba583ed285334ee389b48a65b41335e98914514235db7c4e5d62"
},
{
"spec": "specs/tools/t27o/rust_convert.t27",
"spec_hash": "sha256:8c8390a800ed8c1bb291e59d6c2013e7d27fcf1d087b81da1495bbcaf85499c9"
"spec_hash": "sha256:7960832212d5781ccfec0c213b5829caebf2c13ab27e01fc06b8c5b0a1ec60de"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:9b05123b13e02aae3088d95948111712ec1d8eed04ded741f01ce5cd0cf82e12",
"gen_hash_rust": "sha256:42e6e611f51a07780957af0b55539ab2555e87f7efd238ca05c21965ac5e522d",
"gen_hash_verilog": "sha256:1248991934ac8dba423ddc78364dab55018d0839450eed55c480eb862b5b2bd0",
"gen_hash_zig": "sha256:5c64e5f9d665c49de50eeec3efc8d169b9f78caf656ad5f22fd3a224d1fdb487",
"gen_hash_c": "sha256:7297ba8aab948b38842ae2d27fd8f27b8618622d5598a40a5fc4e2f0fb439e4a",
"gen_hash_rust": "sha256:e2b6ca2bec4889e964c7dd10b7d5a904fcfedabe58e248d798e2daf9b1f8a800",
"gen_hash_verilog": "sha256:de18b898c7dbe583e56b8ad8c892f70f7694b78caf3fcb33091901667ea8bcf6",
"gen_hash_zig": "sha256:eb812466ae4b331738ed7812c2913ce1e52ec82760feab8b32a41ad6d21a436c",
"module": "T27oSpice",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-18T16:29:45Z",
"sealed_at": "2026-10-19T02:17:13Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:812d4b02cc31d3bcd52926375323bd2766fa30f9ca204da1f637639e824073d3",
"spec_hash": "sha256:f1fd54e59d731af677e0c7301135092ce6b2db03b15178e63421a02b09a061b3",
"spec_path": "specs/tools/t27o/spice_convert.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 22,
"total": 22,
"passed": 39,
"total": 39,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
26 changes: 0 additions & 26 deletions cli/tri/src/fpga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6733,32 +6733,6 @@ fn build_theorem_matrix_report(
})
}

/// Strip `fixture_dir` from the fixture paths inside matrix entries so that
/// snapshots are stable across machines.
#[cfg(test)]
fn normalize_fixture_paths(
entries: &[serde_json::Value],
fixture_dir: &std::path::Path,
) -> Vec<serde_json::Value> {
entries
.iter()
.map(|entry| {
let mut entry = entry.clone();
if let Some(serde_json::Value::Object(fixtures)) = entry.get_mut("fixtures") {
for (_key, value) in fixtures.iter_mut() {
if let Some(path_str) = value.as_str() {
let path = std::path::Path::new(path_str);
if let Ok(rel) = path.strip_prefix(fixture_dir) {
*value = serde_json::Value::String(rel.to_string_lossy().to_string());
}
}
}
}
entry
})
.collect()
}

fn boot_protocol(checklist: bool) -> Result<()> {
println!("== Cold-POR boot-from-flash protocol ==");
println!();
Expand Down
10 changes: 6 additions & 4 deletions cli/tri/src/main.rs
Original file line number Diff line number Diff line change
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 (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).
T27o {
file: String,
/// The module name; default the file's stem.
Expand All @@ -438,6 +438,8 @@ enum Commands {
#[arg(long)] check: bool,
/// The t27c binary; default target/release/t27c, then t27c on PATH.
#[arg(long)] t27c: Option<String>,
/// A netlist: print the M1 cell constants (CELL_N, CELL_D, CELL_NV) folded from it, or the refusal, instead of the inventory.
#[arg(long)] emit_cell: bool,
},
/// t27o over a tree (#10543): every tracked .rs file converted in-process; a file's row is reused while its key holds (its SHA-256 and the seals of rust_convert.t27 and rust_std.t27, read from the t27 checkout this runs in); `--repo <dir>` sweeps another checkout, with a cache of its own (#10638); counts, coverage and the ranked first-refusal kinds (rules: specs/tools/t27o/ledger.t27).
T27oSweep { paths: Vec<String>, #[arg(long, default_value = t27o_ledger::SWEEP_HERE)] repo: String, #[arg(long, default_value_t = t27o_ledger::SWEEP_MAX_BYTES)] max_bytes: usize, #[arg(long)] cache: Option<String>, #[arg(long, default_value_t = t27o_ledger::SWEEP_TOP)] top: usize },
Expand Down Expand Up @@ -1330,19 +1332,19 @@ fn main() -> Result<()> {
Commands::Actors { url, bound, replay } => std::process::exit(cmd_actors(url, *bound, *replay)? as i32),
Commands::Hot { t27c, action, rest } => std::process::exit(cmd_hot(action, rest, t27c.as_deref()) as i32),
Commands::Payout { epoch, pool, json } => std::process::exit(payout::cmd(*epoch, *pool, *json)? as i32),
Commands::T27o { file, name, oracle, check, t27c } => std::process::exit(cmd_t27o(file, name.as_deref(), *oracle, *check, t27c.as_deref())? as i32),
Commands::T27o { file, name, oracle, check, t27c, emit_cell } => std::process::exit(cmd_t27o(file, name.as_deref(), *oracle, *check, t27c.as_deref(), *emit_cell)? as i32),
Commands::T27oSweep { paths, repo, max_bytes, cache, top } => std::process::exit(cmd_t27o_sweep(paths, repo, *max_bytes, cache.as_deref(), *top)? as i32),
}

Ok(())
}

/// `tri t27o` (#8967): every rule is gen-rust of rust_convert.t27; this reads the file, runs rustc and t27c, and writes.
fn cmd_t27o(file: &str, name: Option<&str>, oracle: bool, check: bool, t27c: Option<&str>) -> Result<u8> {
fn cmd_t27o(file: &str, name: Option<&str>, oracle: bool, check: bool, t27c: Option<&str>, emit_cell: bool) -> Result<u8> {
let src = fs::read(file).with_context(|| format!("reading {file}"))?;
if spice::is_spice_name(file.as_bytes()) { // a netlist: every rule is specs/tools/t27o/spice_convert.t27 (#10509)
let (mut work, mut out, mut st) = (vec![0u8; 2 * src.len() + 8192], vec![0u8; 1 << 24], vec![0usize; 1 << 16]);
let n = spice::inventory(&src, &mut work, &mut out, &mut st);
let n = if emit_cell { spice::emit_cell(&src, &mut work, &mut out, &mut st) } else { spice::inventory(&src, &mut work, &mut out, &mut st) };
std::io::Write::write_all(&mut std::io::stdout(), &out[..n.min(out.len())])?;
return Ok(spice::exit_code(&st));
}
Expand Down
Loading
Loading