Skip to content

chore(loc): exclude fuzz and guest programs from LOC count#616

Merged
MauroToscano merged 2 commits into
mainfrom
refactor/loc-exclude-fuzz-programs
May 22, 2026
Merged

chore(loc): exclude fuzz and guest programs from LOC count#616
MauroToscano merged 2 commits into
mainfrom
refactor/loc-exclude-fuzz-programs

Conversation

@diegokingston
Copy link
Copy Markdown
Collaborator

The loc tool counted executor/programs (RISC-V guest test programs) as production code. Add fuzz, programs and program_artifacts to the EXCLUDED patterns.

This removes 502 LOC of guest test programs (executor/programs/rust/*, 30 files) from the reported total (32,937 -> 32,435). Fuzz harnesses already scored 0 because fuzz_targets/ coincidentally matched target; they are now excluded explicitly so a harness placed elsewhere under crypto/math/fuzz/ is not counted either.

@github-actions
Copy link
Copy Markdown

Codex Code Review

No issues found in the PR diff.

The changes only add the MIT LICENSE, a short Fiat-Shamir README, and LOC-tool exclusion patterns for fuzz/program fixture directories. I did not see security, correctness, or significant performance concerns in these changes.

Tests not run; this was a diff-only review.

@claude
Copy link
Copy Markdown

claude Bot commented May 22, 2026

Review: chore(loc): exclude fuzz and guest programs from LOC count

Overall: LGTM with one observation.

Observation — dual semantics of EXCLUDED

The EXCLUDED slice is used in two distinct ways inside main.rs:

  1. Exact string match at line 42: EXCLUDED.contains(&crate_name) — compares the literal top-level directory name against slice entries. Glob wildcards have no effect here.
  2. Glob patterns at line 61: passed to tokei's get_statistics — wildcards do work here.

The new patterns (*fuzz*, *programs*, *program_artifacts*) only take effect through tokei, which is the desired behaviour (they suppress subdirectories found recursively during counting). They never fire in the contains() check, but that check only guards top-level crate dirs and none is literally named programs or fuzz, so there is no functional problem.

The existing code already relied on this split — not introduced here. Worth a follow-up to rename the constant (e.g. EXCLUDED_GLOBS) to make the two call sites obviously different, but not blocking.

Bundled changes

LICENSE and the Fiat-Shamir README are unrelated to the LOC fix. No issues with the content.

Comment thread tooling/loc/src/main.rs
The loc tool counted executor/programs (RISC-V guest test programs) as
production code. Add *fuzz*, *programs* and *program_artifacts* to the
EXCLUDED patterns.

This removes 502 LOC of guest test programs (executor/programs/rust/*,
30 files) from the reported total (32,937 -> 32,435). Fuzz harnesses
already scored 0 because fuzz_targets/ coincidentally matched *target*;
they are now excluded explicitly so a harness placed elsewhere under
crypto/math/fuzz/ is not counted either.
@diegokingston diegokingston force-pushed the refactor/loc-exclude-fuzz-programs branch from 5d634f3 to 1399d3c Compare May 22, 2026 20:06
@diegokingston diegokingston marked this pull request as ready for review May 22, 2026 20:08
@github-actions
Copy link
Copy Markdown

Codex Code Review

No issues found in the PR diff.

The change only adds LOC-report exclusions for fuzz harnesses, guest programs, and program artifacts. I don’t see security, correctness, or significant performance concerns from these added patterns. Tests were not run; review was based on the diff and matching repo paths.

@claude
Copy link
Copy Markdown

claude Bot commented May 22, 2026

Review: chore(loc): exclude fuzz and guest programs from LOC count

The change is correct and consistent with the existing exclusion convention in this file. One thing worth noting:

Low — *programs* is a broad glob

The pattern *programs* will silently exclude any future crate whose name contains that word (e.g. syscall_programs, programs_api). The existing patterns (*bench*, *tests*, etc.) follow the same convention, so this is consistent — but those words are less likely to appear in production crate names than "programs" might be in a zkVM project.

If there's ever a production crate whose path includes "programs", it'll be dropped from the LOC count with no warning. A narrower path like *guest_programs* or executor/programs would scope it more tightly if that risk matters.

Low — *program_artifacts* has no current target

No directory matching this pattern exists in the repo today. Harmless as a forward-looking exclusion, but worth noting it's speculative.

Otherwise no issues — no security, performance, or correctness concerns.

@MauroToscano MauroToscano added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 8b46647 May 22, 2026
12 checks passed
@MauroToscano MauroToscano deleted the refactor/loc-exclude-fuzz-programs branch May 22, 2026 20:29
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.

2 participants