Skip to content

refactor: remove unused imports and unreachable code (Periphery pass) - #50

Merged
Paullo9 merged 1 commit into
mainfrom
refactor/dead-code-2026-11
Nov 6, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
refactor/dead-code-2026-11

Conversation

@Paullo9

@Paullo9 Paullo9 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul

What and why

Removes code that nothing reaches, found with Periphery (--retain-public, the weekly scan's own command). No public API changes, no behaviour changes, no fixture or tolerance is touched.

  • 9 unused imports (2 in Sources, 7 in the parity tests)
  • MetalExecutable.output, a stored field that was always the empty array and never read
  • the count argument of the private filterAxis, which the function never read

Periphery findings: 17 before, 6 after. What is left is not dead code:

  • 5: the beam argument of the public Detector.shape(for:beam:) requirement and its four conformances (public API)
  • 1: lobatoTableSourceSHA256, written by tools/pins/potential-multislice/pins.py with the table (provenance)

How it was checked

  • swift test -c release: 0 failures (full suite with the parity tests, on the Mac)
  • No new compiler warning; SwiftLint 0.65.1 --strict and SwiftFormat 0.64.4 --lint pass
  • Every removed symbol was searched for in Sources, Tests, docs and tools before it went
  • A test that fails without the change: not applicable, nothing observable changes

🤖 Generated with Claude Code

Code that nothing reaches, found with Periphery (--retain-public). No public API, behaviour, fixture or tolerance changes.

- 9 unused imports (2 in Sources, 7 in the parity tests)
- MetalExecutable.output, a stored field that was always the empty array and never read
- the count argument of the private filterAxis, which the function never read

Periphery: 17 findings before, 6 after; the rest are fixture fields, GPU parameter blocks, public API or documented.

Done: the dead-code pass for this repo, full test suite green. Next: a PR check against a Periphery baseline so new dead code is caught.

Co-Authored-By: Claude <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Nov 6, 2026
@Paullo9
Paullo9 merged commit 78a03f5 into main Nov 6, 2026
6 checks passed
@Paullo9
Paullo9 deleted the refactor/dead-code-2026-11 branch November 6, 2026 12:49
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