summaryrefslogtreecommitdiff
path: root/doc/HOWTO.md
AgeCommit message (Collapse)Author
26 hoursfeat(build): Add FINAL_STRIP mode for maximum size optimizationskal
Implemented systematic fatal error checking infrastructure that can be stripped for final builds. This addresses the need to remove all error checking (abort() calls) from the production binary while maintaining safety during development. ## New Infrastructure ### 1. CMake Option: DEMO_FINAL_STRIP - New build mode for absolute minimum binary size - Implies DEMO_STRIP_ALL (stricter superset) - NOT included in DEMO_ALL_OPTIONS (manual opt-in only) - Message printed during configuration ### 2. Header: src/util/fatal_error.h - Systematic macro-based error checking - Zero cost when FINAL_STRIP enabled (compiles to ((void)0)) - Full error messages with file:line info when enabled - Five macros for different use cases: - FATAL_CHECK(cond, msg, ...): Conditional checks (most common) - FATAL_ERROR(msg, ...): Unconditional errors - FATAL_UNREACHABLE(): Unreachable code markers - FATAL_ASSERT(cond): Assertion-style invariants - FATAL_CODE_BEGIN/END: Complex validation blocks ### 3. CMake Target: make final - Convenience target for triggering final build - Reconfigures with FINAL_STRIP and rebuilds demo64k - Only available when NOT in FINAL_STRIP mode (prevents recursion) ### 4. Script: scripts/build_final.sh - Automated final build workflow - Creates build_final/ directory - Shows size comparison with STRIP_ALL build (if available) - Comprehensive warnings about stripped error checking ## Build Mode Hierarchy | Mode | Error Checks | Debug Features | Size Opt | |-------------|--------------|----------------|----------| | Debug | ✅ | ✅ | ❌ | | STRIP_ALL | ✅ | ❌ | ✅ | | FINAL_STRIP | ❌ | ❌ | ✅✅ | ## Design Decisions (All Agreed Upon) 1. **FILE:LINE Info**: ✅ Include (worth 200 bytes for debugging) 2. **ALL_OPTIONS**: ❌ Manual opt-in only (too dangerous for testing) 3. **FATAL_ASSERT**: ✅ Add macro (semantic clarity for invariants) 4. **Strip Hierarchy**: ✅ STRIP_ALL keeps checks, FINAL_STRIP removes all 5. **Naming**: ✅ FATAL_* prefix (clear intent, conventional) ## Size Impact Current: 10 abort() calls in production code - ring_buffer.cc: 7 checks (~350 bytes) - miniaudio_backend.cc: 3 checks (~240 bytes) Estimated savings with FINAL_STRIP: ~500-600 bytes ## Documentation Updated: - doc/HOWTO.md: Added FINAL_STRIP build instructions - doc/CONTRIBUTING.md: Added fatal error checking guidelines - src/util/fatal_error.h: Comprehensive usage documentation ## Next Steps (Not in This Commit) Phase 2: Convert ring_buffer.cc abort() calls to FATAL_CHECK() Phase 3: Convert miniaudio_backend.cc abort() calls to FATAL_CHECK() Phase 4: Systematic scan for remaining abort() calls Phase 5: Verify size reduction with actual measurements ## Usage # Convenience methods make final # From normal build directory ./scripts/build_final.sh # Creates build_final/ # Manual cmake -S . -B build_final -DDEMO_FINAL_STRIP=ON cmake --build build_final ⚠️ WARNING: FINAL_STRIP builds have NO error checking. Use ONLY for final release, never for development/testing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
44 hoursdocs: Document specplay tool and add future enhancement roadmapskal
- Created tools/specplay_README.md with comprehensive documentation - Added Task #64 to TODO.md for future specplay enhancements - Updated HOWTO.md with specplay usage examples and use cases - Outlined 5 priority levels of potential features (20+ ideas) Key enhancements planned: - Priority 1: Spectral visualization, waveform display, frequency analysis - Priority 2: Diff mode, batch analysis, CSV reports - Priority 3: WAV export, normalization - Priority 4: Advanced spectral analysis (harmonics, onsets) - Priority 5: Interactive mode (seek, loop, volume control) The tool is production-ready and actively used for debugging.
2 daysdocs: Update documentation for completed build optimization (Task C)skal
Updated documentation to reflect completed build system improvements: TODO.md: - Moved Task C to 'Recently Completed (February 6, 2026)' section - Documented header split (asset_manager_dcl/core/utils) - Documented asset dependency tracking (42 demo + 17 test assets) - Noted 58% performance improvement and critical correctness bug fix - Removed Task C from 'Critical Fixes' section (completed) PROJECT_CONTEXT.md: - Added 'Milestone: Build System Optimization (February 6, 2026)' section - Detailed header refactoring strategy and asset dependency implementation - Explained critical bug: shader changes weren't triggering rebuilds - Documented workaround elimination (no more 'touch demo_assets.txt') HOWTO.md: - Added 'Build System Notes' section after developer build instructions - Explained incremental build behavior and asset tracking - Documented header organization (dcl/core/utils) for developers - Clarified that all asset types (.wgsl, .spec, .obj) are tracked All documentation now accurately reflects current build system state. Ready to begin next task: Spectrogram Editor (HTML).
3 daysfeat(audio): Complete Phase 4 - Cleanup and Documentation (Task #56)skal
Completed final cleanup phase of Audio Lifecycle Refactor. Removed backwards compatibility shims and updated documentation to reflect new AudioEngine-based initialization patterns. Changes: 1. Removed Backwards Compatibility: - Removed synth_init() call from audio_init() in audio.cc - Added comment explaining AudioEngine is the preferred initialization method - All tests already explicitly call synth_init() or use AudioEngine 2. Documentation Updates: - Updated HOWTO.md with AudioEngine usage examples and best practices - Updated CONTRIBUTING.md with audio subsystem initialization protocols - Documented when to use AudioEngine vs direct synth API calls - Clarified that AudioEngine is a lifecycle manager, not a complete facade 3. Size Verification: - Size-optimized build: 5.0MB (vs 6.2MB debug) - AudioEngine overhead: <500 bytes (within acceptable limits) - No size regression from refactor Results: - All 20 tests pass (100% pass rate) - Demo runs successfully - No backwards compatibility issues - Clear documentation for future development - Binary size impact negligible Design Philosophy: - AudioEngine manages initialization order (synth before tracker) - Direct synth API calls remain valid for performance-critical paths - Low-level tests can still use synth_init() directly if needed - Preferred pattern: Use AudioEngine for lifecycle, direct APIs for operations handoff(Claude): Completed Task #56 Phase 4 - All phases complete! Audio Lifecycle Refactor is fully implemented, tested, and documented. The fragile initialization order dependency has been eliminated. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4 daysfeat(tooling): Add directory filtering to coverage report script (Task #46)skal
Updated gen_coverage_report.sh to accept an optional argument for targeting specific directories using lcov --extract.
4 daysfeat(tooling): Implement code coverage reporting (Task #44)skal
Added CMake support for coverage builds and a script to generate HTML reports using lcov on macOS. Also cleaned up .gitignore.
6 daysdocs: Add submodule update instructions to HOWTO.mdskal
6 daysrefactor(build): Centralize generated files and clean up project layoutskal
- Task A: Centralized all generated code (assets, timeline) into a single directory to create a single source of truth. - Task A: Isolated test asset generation into a temporary build directory, preventing pollution of the main source tree. - Task B: Vertically compacted all C/C++ source files by removing superfluous newlines. - Task C: Created a top-level README.md with project overview and file descriptions. - Task D: Moved non-essential documentation into a directory to reduce root-level clutter.