Skip to content

Claude/audit codebase bloat jpskt#182

Merged
Krilliac merged 2 commits intoWorkingfrom
claude/audit-codebase-bloat-Jpskt
Mar 14, 2026
Merged

Claude/audit codebase bloat jpskt#182
Krilliac merged 2 commits intoWorkingfrom
claude/audit-codebase-bloat-Jpskt

Conversation

@Krilliac
Copy link
Owner

No description provided.

claude added 2 commits March 14, 2026 11:14
AUDIT SUMMARY:
- 22 files violate hard size limits (6,000+ lines removable)
- SparkConsole.cpp: 6,996 lines (17.5x over 400-line limit)
  → 4,000+ lines of embedded UI that should be in SparkConsole.exe
  → 52 Register*Commands methods scattered (limit: 1 per subsystem)
- PhysicsSystem.h: 1,909 lines (9.5x over 200-line limit)
- RenderGraph.h: 1,730 lines (8.6x over 200-line limit)
- ConsoleProcessManager: built but never initialized or called
  → Fix: 15 min, 3 lines of code
- SimpleConsole::Initialize() called 3+ times at different paths
  → Consolidate to single startup call

KNOWLEDGE BASE ENTRIES:
1. codebase-bloat-audit-2026-03-14.md — Full audit with metrics
2. sparkconsole-refactor-plan.md — 2-session refactor plan
3. consoleprocessmanager-wiring.md — Quick fix for unwired system

All findings logged in persistent context database with clear
refactoring guidance and success criteria. Ready for next session.

https://claude.ai/code/session_01GN8Vd4E8VtwkQj75aaqoui
NEW FINDINGS:

Dead utility headers (1,052 lines, 0 usages — delete immediately):
- ChromeTracing.h (211 lines): macros never called anywhere
- MemoryDebugger.h (433 lines): SPARK_TRACK_ALLOC/FREE/LEAK never called
- FrameInspector.h (408 lines): GetInstance() never called

ODR risk:
- Two classes named AudioMixer in same namespace Spark::Audio
  (AudioMixer.h + MusicManager.h line 57) — rename MusicManager's
  internal class to AudioBusMixer

Duplicate startup paths (SparkEngine.cpp):
- PhysicsSystem created 5× across startup paths (should be 1)
- GraphicsEngine created 3× across startup paths (should be 1)
- console.Initialize() called 3× (should be 1)
- Root cause: each startup variant copy-pastes rather than calling
  shared InitCoreSystems() — ~600 removable lines

Two parallel visual scripting systems (7,343 combined lines):
- VisualScriptSystem (engine): 2,406 lines — Init() possibly unwired
- VisualScriptingSystem (editor): 4,937 lines — node types duplicated

Shader.cpp: duplicate #include at line 1298 (harmless, indicates
  the file was spliced together)

Updated index.md with P0/P1/P2 priority ordering.
Running total removable lines: ~8,650

https://claude.ai/code/session_01GN8Vd4E8VtwkQj75aaqoui
@Krilliac Krilliac merged commit 8beb144 into Working Mar 14, 2026
31 checks passed
@Krilliac Krilliac deleted the claude/audit-codebase-bloat-Jpskt branch March 14, 2026 11:41
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