Repository navigation
Delete 18 unreachable pub fns from cli_run.rs - #8517
Merged
Merged
Conversation
Zero call sites in Rust, zero references in the .dag corpus, and not registered as host builtins. Verified with a discriminating control: known-live host builtins score dispatch=2-3 / dag=3-81 against the interpreter dispatch table and the corpus; all 18 score 0 / 0. SCOPE CORRECTION, recorded because the first attempt was wrong. The initial census found 36 candidates. Half of them -- 18 -- carry `#[cfg(feature = "test_hooks")]` or `#[cfg(any(test, feature = "interp_test_witness"))]` and are conditionally compiled test hooks, NOT dead code. A call-site scan cannot see that, because the callers live behind the same feature gate. Those 18 are kept, and `cargo check --features test_hooks` is now part of this change's evidence rather than an assumption. The first deletion script was also mechanically wrong in a way worth naming: it walked back over `//` comments but stopped at attribute lines, so removing a function left its `#[cfg(...)]` attribute orphaned, which then bound to the NEXT function and made it conditional. That produced three "cannot find function in this scope" errors against symbols that were still present in the file. The span finder now walks comments and attributes together, counts braces rather than guessing at the first column-0 `}`, and refuses outright if any span contains another top-level item. WHY THESE COULD ACCUMULATE UNSEEN: `cargo check -p v1-compiler --all-targets` does not compile on main -- `compiler_tests.rs:1615` imports `crate::v1_tests_claim_caret_parse_smoke_test`, a module deleted by the #8146 suite cutover. The crate's test targets have not built since, so nothing reported these as unused, and `-D warnings` on `--bin` cannot see a `pub fn` in a lib. That defect is NOT fixed here; it is reported as its own finding. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gunbai-bot
Bot
force-pushed
the
integration/cli-run-dead-helpers
branch
from
August 19, 2026 05:56
c30ff6a to
370c702
Compare
Contributor
|
Floor verified on srv2 (full corpus, unshrunk): failed=0. Two caveats stated rather than smoothed over:
— sent from fierce-ram-721 |
briansrls
added a commit
that referenced
this pull request
Aug 19, 2026
…d module (#8532) `cargo check -p v1-compiler --all-targets` has not compiled since #8486, which deleted the `.dag` witness `v1_tests_claim_caret_parse_smoke_test` and its generated Rust module but left `caret_parse_smoke_native_compile_emit_witnesses` importing it: error[E0432]: unresolved import `crate::v1_tests_claim_caret_parse_smoke_test` Only `--bin` was still compiling, so `-D warnings` covered one target and dead code in the other accumulated unobserved (#8517 removes 18 such fns). This removes the orphaned test at all three of its homes, which is the part worth reviewing: 1. `src/v1/compiler_tests_rust.dag` — the authority 2. `src/v1/stage0/src/v1_compiler_compiler_tests_rust.rs` — its generated projection 3. `src/v1/stage0/src/compiler_tests.rs` — output of running (2) `compiler_tests.rs` is produced by RUNNING the generator, not by emitting from the `.dag`, so editing (1) and (3) alone leaves (2) stale and the authority silently disagreeing with its projection — `--all-targets` still goes green in that state. Verified instead by regenerating and diffing: `compiler_tests.rs` is byte-identical to generator output (diff exit 0). Coverage, stated exactly: `dag/test/claim/caret_syntax_witness_test.dag` covers the 3 endpoint claims (compile-clean, symbol-literal emit, discriminant-sugar emit). The 7 tokenize/parse intermediates have no `.dag` equivalent and have not executed since #8486 deleted the module; the Rust suite left CI in July. This deletes unbuildable code, not live coverage, but those 7 are a real gap rather than parity. Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks
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.
Stacked on #8514 (
integration/manifest-cut). −320 lines.18
pub fns incli_run.rswith zero call sites in Rust, zero references in the.dagcorpus, and no host-builtin registration.Discriminating control (a census without one proves nothing): known-live host builtins score
dispatch=2–3 / dag=3–81against the interpreter dispatch table and the corpus; all 18 candidates score0 / 0.Scope correction — the first census was wrong
The initial scan found 36 candidates. Half of them carry
#[cfg(feature = "test_hooks")]or#[cfg(any(test, feature = "interp_test_witness"))]and are conditionally compiled test hooks, not dead code — a call-site scan cannot see that, because their callers sit behind the same feature gate. Those 18 are kept, andcargo check --features test_hooksis now evidence in this PR rather than an assumption.The first deletion script was also mechanically wrong, and it is worth naming rather than quietly fixing: it walked back over
//comments but stopped at attribute lines, so deleting a function left its#[cfg(...)]orphaned, which then bound to the next function and made it conditional. That produced threecannot find function in this scopeerrors against symbols still present in the file. The span finder now walks comments and attributes together, counts braces instead of guessing at the first column-0}, and refuses if any span contains another top-level item.Why these could accumulate unseen — reported, not fixed here
cargo check -p v1-compiler --all-targetsdoes not compile on main:compiler_tests.rs:1615importscrate::v1_tests_claim_caret_parse_smoke_test, a module deleted by the #8146 suite cutover. The crate's test targets have not built since, so nothing flagged these as unused — and-D warningson--bincannot see an unusedpub fnin a lib.That is a separate defect with its own remedy and is not addressed by this PR.
Verification
RUSTFLAGS="-D warnings" cargo check -p v1-compiler --lib --bin claim_executor— cleancargo check -p v1-compiler --lib --features test_hooks— 0 errors (the gated 18 still compile)cargo fmt --all --check— clean.dagcan reach host functions in ways a Rust grep cannot.🤖 Generated with Claude Code