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
33 changes: 33 additions & 0 deletions .trinity/seals/t27o_T27oSpice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"built_by": "t27c-bootstrap@0.5.2+9b556b7c3",
"closure": [
{
"spec": "specs/tools/t27o/rust_convert.t27",
"spec_hash": "sha256:8c8390a800ed8c1bb291e59d6c2013e7d27fcf1d087b81da1495bbcaf85499c9"
}
],
"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",
"module": "T27oSpice",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-18T16:29:45Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:812d4b02cc31d3bcd52926375323bd2766fa30f9ca204da1f637639e824073d3",
"spec_path": "specs/tools/t27o/spice_convert.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 22,
"total": 22,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
"zig": "0.16.0"
}
}
10 changes: 9 additions & 1 deletion cli/tri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ mod hot; // t27c gen-rust of specs/tri/hot/hot.t27 (#8870): every rule of `tri h
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)
mod renum;
mod reseal;
mod rtl;
Expand Down Expand Up @@ -424,7 +426,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).
/// 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 {
file: String,
/// The module name; default the file's stem.
Expand Down Expand Up @@ -1332,6 +1334,12 @@ fn main() -> Result<()> {
/// `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> {
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);
std::io::Write::write_all(&mut std::io::stdout(), &out[..n.min(out.len())])?;
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) };
Expand Down
37 changes: 0 additions & 37 deletions cli/tri/src/nownote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,43 +401,6 @@ fn gate_script(root: &Path) -> Result<PathBuf> {
Ok(script)
}

/// Did the entries this branch adds satisfy the gate? Written for the `check` row of
/// `tri gates preview`, which needed the verdict rather than a process exit, and
/// quietly. That row was removed in #5935, so nothing calls this now.
///
/// **An empty set is a FAIL here and an OK in `tri now check`, and that is not
/// an inconsistency.** `tri now check` runs mid-work, where a commit that adds
/// no entry has no shape to judge. `gates preview` asks what the gate would
/// say about this branch AS A PULL REQUEST, and the gate's own words on an
/// empty set are *"FAIL: this change adds no docs/now/ entry"*. Mirroring the
/// gate includes mirroring what it does with nothing.
pub fn check_added(base: &str) -> Result<bool> {
let root = repo_root()?;
let script = gate_script(&root)?;
let files = git_paths(
&root,
&["diff", "--name-only", "--diff-filter=A"],
Some(&format!("{base}...HEAD")),
)?;
if files.is_empty() {
return Ok(false);
}
let out = std::process::Command::new("python3")
.arg(&script)
.arg("--check-files")
.args(&files)
.current_dir(&root)
.output()
.context("failed to run tools/check_now_entry_shape.py")?;
Ok(out.status.success())
}

/// The shape of what the index adds. Was the pre-commit hook's entry point; `tri hooks
/// pre-commit` stopped calling it in #5935, so nothing calls this now.
pub fn check_staged() -> Result<()> {
check(&[], true, "origin/master")
}

/// Added `docs/now/*.md` paths from one git invocation, README excluded.
fn git_paths(root: &Path, args: &[&str], range: Option<&str>) -> Result<Vec<String>> {
let mut cmd = std::process::Command::new("git");
Expand Down
Loading
Loading