Repository navigation
tri t27o-sweep: t27o over a whole tree, rows reused while the file and the two seals hold (Closes #10543) - #10587
Merged
Merged
Conversation
Owner
Author
|
Review (orchestrator, Opus), before auto-merge:
|
9 of 12 tasks
This was referenced Oct 18, 2026
Merged
Merged
…ur booleans, sweep paths, cap, coverage, refusal kind and cascade, ranking (Closes #10543) key_check takes the four booleans (recorded, same source, same converter, same std table) and is the one rule of staleness; key_state calls it with the two version constants compared. Added for the sweep: reuse_row, sweep_path (a .rs file with no gen/ or target/ directory above it), over_cap, coverage_permille (seen == 0 is unknown, never 1000), is_refusal / kind_from / kind_to (the words before the first backtick of a refusal reason), is_cascade, rank_cmp. 11 new tests, 3 of them negative controls (a stale or missing key is never reused; no fn seen is never 100 percent; a line that is not a refusal is not misread). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…42 dead lines deleted (Closes #10543) `tri t27o-sweep [PATHS...] [--max-bytes N] [--cache FILE] [--top K]`: git ls-files, a SHA-256 per file, an in-process t27o::convert, a TSV cache keyed by the file digest and the spec_hash of the seals of rust_convert.t27 and rust_std.t27. Every decision is a fn of ledger.t27 (which paths, which rows are reusable, the cap, coverage, the kind of a refusal, cascade or root, the ranking); main.rs holds 34 added lines of I/O and printing. The own-language budget (added <= deleted over the counted foreign files) is paid with code nothing calls and no test reaches: gates::rev (allow(dead_code), its only caller removed in #5935), MiningEpoch::next and the never-read start_ts field of depin/types.rs, and dlc10's migen_latency with its constant (rustc: never used). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#10543) t27c dupes --name starts_at found it in builtin_parity_table.t27, text_escape.t27 and seal.t27 already; seal.t27's has the same signature (string, usize, string), so ledger.t27 uses it. dupes back to 3 places; t27b 23/23; gen-rust regenerated (the use splices seal.t27's fns in); cargo check -p tri clean; seal re-saved, --verify MATCH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
force-pushed
the
t27o/sweep-10543
branch
from
October 18, 2026 18:39
19d4054 to
31f8323
Compare
gHashTag
enabled auto-merge (squash)
October 18, 2026 18:40
Owner
Author
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
Closed
Merged
Contributor
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10543. Part of #10522.
Stacked on #10538 (branch
t27o/check-t27b-first-10525) and must merge after it. Until then this PR's diff also shows that PR's two commits; mine are the last two (ledger.t27: the rules of tri t27o-sweep ...andtri t27o-sweep: the command ...).What it does
tri t27o-sweep [PATHS...] [--max-bytes N (300000)] [--cache FILE (target/t27o-sweep.tsv)] [--top K (15)]runs t27o over every tracked.rsfile in-process and prints one line per file (path seen converted tests stubs reused|fresh|skipped), the totals with the coverage share, the top-K root refusal kinds, the cascade total, andcold N / reused M / skipped Swith the wall time.A file's row is reused only when its key holds: the SHA-256 of the file, and the
spec_hashof the seals ofrust_convert.t27andrust_std.t27. Re-sealing either spec makes every row stale by itself; there is no version constant to bump. A file over--max-bytesis listed as skipped instead of hanging the converter.Rules are in
specs/tools/t27o/ledger.t27(not in main.rs)key_check(recorded, same_source, same_converter, same_std)is the one rule of staleness. The existingkey_state(version constants) now calls it, so there is still one rule; all 12 earlier tests pass unchanged.reuse_row,sweep_path(a.rsfile with nogen/ortarget/directory above it),over_cap,coverage_permille(seen == 0 is unknown, 1001, never 1000),is_refusal/kind_from/kind_to(the words before the first backtick of a refusal reason),is_cascade,text_order/rank_cmp(more refusals first, equal counts in text order). The defaults (SWEEP_MAX_BYTES,SWEEP_TOP,SWEEP_CACHE) are constants there too and clap reads them.use tri::lab::receipt::span_is;instead of a second copy of the byte comparison (the ledger seal's closure now lists receipt.t27).gencomponent, the cascade prefix) and each mutation fails exactly one test.t27b test: 23 passed, 0 failed.t27c test-report:vacuous passes 0 of 23.t27c seal --verify: all hashes MATCH.gen/rust/tools/t27o/ledger.rsand.trinity/seals/t27o_T27oLedger.jsonare regenerated.Glue (cli/tri/src/main.rs): 34 added lines
One
T27oSweepvariant (2 lines), its dispatch line, andcmd_t27o_sweep:git ls-files, SHA-256 (sha2was already imported), the two seal files,t27o::convertwith the counters read from the state vector (NFNseen,NOKconverted,NTESTtests converted,NTStests seen,NSTUBstubs), the TSV cache (path, three keys, five counts,kind=count;...), printing. Everyifthat decides something is a call intot27o_ledger::. Nothing incmd_t27oor theT27ovariant is touched, norrust_convert.t27.Gen-rust's text parameters are
&'static str, so the glue leaks each converted file's output text once (a cold run leaks about the output size, the process exits right after); the same pattern is incmd_lanes.Own-language budget
Added 34, deleted 42 in counted foreign files, so the sweep's own part nets to minus 8. Over the whole stacked diff against
git merge-base origin/master HEAD:40 49(added, deleted) with the one-liner from the review. The deleted lines are code nothing calls and no test reaches, each checked with grep overcli/and the rustc dead-code warning:gates.rs:rev(#[allow(dead_code)], its only caller was removed in Remove the NOW gate from hooks and CI (owner decision 2026-10-04) #5935) - 14 linesdepin/types.rs:MiningEpoch::nextand the never-readstart_tsfield - 14 linesdlc10/src/lib.rs:migen_latencyand its constant (never used) - 14 linesI did not use the items other PRs take (
nownote.rs check_added/check_staged,fpga.rs cclk_variant_and_xadc_envelope_check), nor the dead-in-the-non-test-build items that have test callers.Measured (this Mac, the repo at this branch)
bootstrap/src/compiler.rs,bootstrap/src/main.rs,cli/t27b/src/lower.rs,cli/tri/src/fpga.rs,cli/tri/src/gates.rs): 47.8 s wall at load average about 60 (222 s at load average about 150).tri t27o <file> | tail -1(fn seen, converted, tests converted of seen, stubs); 0 differ.--cacheon edited copies of the cache: one row's source hash changed - only that file converted (1 cold / 376 reused); one row's std key changed - only that file; every row's converter key changed (what re-sealingrust_convert.t27does) - 377 cold. A real edit did the same by accident: I deleted dead code in two files while the cold run was going, and the next warm run converted exactly those two.specs/tools/t27oare identical between that commit and this branch's base, so the 54 fewer fns and 6 more converted are not a change of the code or the converter; I could not reproduce that sweep's per-file numbers (its scratch files are gone), and every file here matchestri t27o. The 5 files over the cap are not in this total.Not in this PR
The converter has no time cap: a file just under the cap can still take long;
--max-bytesstands in until the superlinear pass is fixed.🤖 Generated with Claude Code