Skip to content

Remove dead code and empty files; widen selftest coverage#33

Merged
audexdev merged 1 commit into
mainfrom
chore/cleanup-dead-code
Jun 4, 2026
Merged

Remove dead code and empty files; widen selftest coverage#33
audexdev merged 1 commit into
mainfrom
chore/cleanup-dead-code

Conversation

@audexdev

@audexdev audexdev commented Jun 4, 2026

Copy link
Copy Markdown
Owner

What

Phase 1 cleanup from docs/refactor-roadmap.md. Removes dead code and empty placeholder files, and widens the CLI selftest to cover the previously-untested mono and per-block (auto) stereo paths.

Changes

  • Remove Rice::compute_k — dead (no callers in src/ or tests/) and it used a double estimator inconsistent with the live integer Rice::adapt_k.
  • Delete empty placeholder files and drop them from CMake:
    • src/codec/bitstream/bit_reader.cpp (BitReader is header-only)
    • src/utils/logger.cpp (Logger is header-only)
    • src/utils/endian.hpp (0 bytes, included nowhere)
  • Expand lac_cli selftest to also round-trip mono and per-block / auto stereo (mode 2), and document why the selftest stays in the CLI (CI smoke test + dependency-free user check).

Deferred

  • The dead Block::Encoder / LAC::Encoder order parameter is not removed here. It cascades through both encoder constructors, main.cpp, and ~15 call sites with an int→bool / argument-shift hazard that compiles silently. It is better removed in Decompose the monolithic block/frame encode functions #25 (decompose encode), where those constructors are reworked.

Verification (local, macOS)

  • Clean cmake configure + build succeeds.
  • ctest: 2/2 suites pass.
  • lac_cli selftest: passes, now exercising LR, MS, auto-stereo, and mono.

Refs #30

- Drop Rice::compute_k: it has no callers and used a float k estimator
  inconsistent with the live integer Rice::adapt_k.
- Delete empty placeholder files and remove them from CMake:
  bit_reader.cpp and logger.cpp (both header-only) and endian.hpp (unused).
- Expand `lac_cli selftest` to also round-trip mono and per-block/auto
  stereo (mode 2), and document why the selftest stays in the CLI.

The dead Encoder `order` parameter is intentionally left for #25, where the
encoder constructors are reworked; removing it now would shift arguments
across ~15 call sites in a way that compiles silently.

Refs #30

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@audexdev audexdev merged commit 1c21b6f into main Jun 4, 2026
8 checks passed
@audexdev audexdev deleted the chore/cleanup-dead-code branch June 4, 2026 17:46
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