Skip to content

Delete 18 unreachable pub fns from cli_run.rs - #8517

Merged
briansrls merged 1 commit into
mainfrom
integration/cli-run-dead-helpers
Aug 19, 2026
Merged

briansrls merged 1 commit into
mainfrom
integration/cli-run-dead-helpers

Conversation

@briansrls

@briansrls briansrls commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #8514 (integration/manifest-cut). −320 lines.

18 pub fns in cli_run.rs with zero call sites in Rust, zero references in the .dag corpus, and no host-builtin registration.

Discriminating control (a census without one proves nothing): known-live host builtins score dispatch=2–3 / dag=3–81 against the interpreter dispatch table and the corpus; all 18 candidates score 0 / 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, and cargo check --features test_hooks is 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 three cannot find function in this scope errors 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-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 flagged these as unused — and -D warnings on --bin cannot see an unused pub fn in 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 — clean
  • cargo check -p v1-compiler --lib --features test_hooks — 0 errors (the gated 18 still compile)
  • cargo fmt --all --check — clean
  • Floor run pending; a dead-code deletion should not move the floor, which is exactly the claim worth executing rather than assuming, since .dag can reach host functions in ways a Rust grep cannot.

🤖 Generated with Claude Code

@gunbai-bot gunbai-bot Bot changed the title delete cli_run governor Delete 18 unreachable pub fns from cli_run.rs Aug 19, 2026
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
gunbai-bot Bot force-pushed the integration/cli-run-dead-helpers branch from c30ff6a to 370c702 Compare August 19, 2026 05:56
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 19, 2026 06:28
@gunbai-bot

gunbai-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Floor verified on srv2 (full corpus, unshrunk):

planned=9135 executed=9135 terminal=9135 passed=8829 known_red_held=302 failed=0 stale_quarantine=4 budget_refused=0 host_tool_unresolved=0

failed=0. Two caveats stated rather than smoothed over:

  • claims=9135 vs the 9122 I recorded on 8b20599960 is base drift — this PR deletes only Rust pub fns and cannot change .dag witness discovery. The bar I used is failed=0, not a count match against an older commit.
  • known_red_held=302 / stale_quarantine=4 (vs 306/0 in CI) is a pre-existing srv2 host difference, reproduced on unmodified code before this branch existed. It is why the process exits 1; it is not this change.

— sent from fierce-ram-721

@briansrls
briansrls merged commit 493efb3 into main Aug 19, 2026
2 checks passed
@briansrls
briansrls deleted the integration/cli-run-dead-helpers branch August 19, 2026 07:13
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant