Skip to content

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

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 this changes

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.

  • 25 unused imports
  • EllipseCalibration.ProgressSpan.none, an unused constant
  • test leftovers: isUnimodularWithPositiveDeterminant, relErr, the Lattice struct of Py4DSTEMRealFamilyTests, the unread file / line arguments of refusal and the unread key argument of appLibrary

Periphery findings: 89 before, 57 after. What is left is not dead code:

  • 52: stored fields of the test fixture structs, filled by JSONDecoder from the pinned files
  • 4: the fields of the ACOM Metal Params block, which the shader reads
  • 1: SendableBox.value in PhaseVectorMatching, which is written through (ptr.value[position] = ...)

How it was tested

  • 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.

- 25 unused imports
- EllipseCalibration.ProgressSpan.none, an unused constant
- test leftovers: isUnimodularWithPositiveDeterminant, relErr, the Lattice struct of Py4DSTEMRealFamilyTests, the unread file / line arguments of refusal and the unread key argument of appLibrary

Periphery: 89 findings before, 57 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 enabled auto-merge (squash) November 6, 2026 12:50
@Paullo9
Paullo9 merged commit aa10090 into main Nov 6, 2026
6 checks passed
@Paullo9
Paullo9 deleted the refactor/dead-code-2026-11 branch November 6, 2026 12:54
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