summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
24 hoursdocs: Add variable tempo architecture analysisskal
Comprehensive analysis of BPM dependencies and variable tempo requirements. Key findings: - BPM is baked into spectrogram generation (cannot change dynamically) - Music time currently tied 1:1 to physical time - Synth playback rate is fixed (no variable speed support) Proposes solution: - Global tempo_scale multiplier - Unified music_time abstraction - Variable synth playback with spectral interpolation - Trade-off: pitch shifts with tempo (acceptable for demos) Implementation roadmap: ~12 hours estimated effort Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 hoursfeat(audio): Tracker timing test suite (Tasks #51.3 & #51.4)skal
Comprehensive tracker timing verification using MockAudioBackend. Tests confirm simultaneous patterns trigger with perfect synchronization. Changes: - Created test_tracker_timing.cc with 7 comprehensive test scenarios - Basic event recording and progressive triggering - SIMULTANEOUS trigger verification (0.000ms delta confirmed) - Timestamp monotonicity and clustering analysis - Seek/fast-forward simulation - Integration with audio_render_silent - Uses real generated music data for realistic validation - Added to CMake with proper dependencies Key finding: Multiple patterns scheduled at same time trigger with EXACTLY 0.000ms delta, confirming perfect audio synchronization. All 15 tests pass (100% success rate). handoff(Claude): Task #51 complete, tracker timing fully verified Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
25 hoursfeat(audio): Implement mock audio backend for testing (Task #51.2)skal
Created MockAudioBackend for deterministic audio event recording and timing verification. Enables robust tracker synchronization testing. Changes: - Created VoiceTriggerEvent structure (timestamp, spec_id, volume, pan) - Implemented MockAudioBackend with event recording capabilities - Added time tracking: manual (advance_time) and automatic (on_frames_rendered) - Created test_mock_backend.cc with 6 comprehensive test scenarios - Verified synth integration and audio_render_silent compatibility - Added to CMake test builds All test infrastructure guarded by #if !defined(STRIP_ALL). Zero size impact on production build. All 14 tests pass. handoff(Claude): Task #51.2 complete, mock backend ready for tracker tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
25 hoursfeat(audio): Implement audio backend abstraction (Task #51.1)skal
Created interface-based audio backend system to enable testing without hardware. This is the foundation for robust tracker timing verification. Changes: - Created AudioBackend interface with init/start/shutdown methods - Added test-only hooks: on_voice_triggered() and on_frames_rendered() - Moved miniaudio implementation to MiniaudioBackend class - Refactored audio.cc to use backend abstraction with auto-fallback - Added time tracking to synth.cc (elapsed time from rendered frames) - Created test_audio_backend.cc to verify backend injection works - Fixed audio test linking to include util/procedural dependencies All test infrastructure guarded by #if !defined(STRIP_ALL) for zero size impact on final build. Production path unchanged, 100% backward compatible. All 13 tests pass. handoff(Claude): Task #51.1 complete, audio backend abstraction ready Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
25 hoursupdate notesskal
26 hoursdocs: Handoff state snapshot with WebGPU fixesskal
26 hoursdocs: Update project context and state for handoffskal
26 hoursasset location cleanupskal
26 hourschore(assets): Update generated asset data for modular WGSLskal
26 hoursfeat(gpu): Implement recursive WGSL composition and modularize shaders (Task ↵skal
#50) - Updated ShaderComposer to support recursive #include "snippet_name" with cycle detection. - Extracted granular WGSL snippets: math/sdf_shapes, math/sdf_utils, render/shadows, render/scene_query, render/lighting_utils. - Refactored Renderer3D to use #include in shaders, simplifying C++ dependency lists. - Fixed WGPUShaderSourceWGSL usage on macOS to correctly handle composed shader strings. - Added comprehensive unit tests for recursive composition in test_shader_composer. - Verified system stability with test_3d_render and full test suite. - Marked Task #50 as recurrent for future code hygiene.
26 hoursdocs(3d): Plan BVH, Physics, and WGSL modularization (Task #49, #50)skal
- Added detailed design for dynamic BVH and GPU traversal in 3D.md. - Outlined SDF-based collision detection and semi-implicit Euler physics loop. - Updated TODO.md with atomic tasks for physics implementation and granular WGSL refactoring.
27 hourstest(coverage): Improve Audio coverage (Task #48)skal
Added unit tests for DCT and procedural audio generation. Enhanced synth tests to cover rendering and resource management. Audio subsystem coverage increased to 93%.
27 hoursrevised .gitignoreskal
27 hourstest(coverage): Improve Asset Manager coverage (Task #47)skal
Added tests for runtime error handling in Asset Manager (unknown function, generation failure). Updated asset_packer to warn instead of fail on unknown functions to facilitate testing. Increased coverage from 71% to 88%.
27 hoursfeat(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.
27 hourstest(procedural): Improve test coverage (Task #45)skal
Added tests for gen_perlin and make_periodic. Improved parameter handling checks. Coverage for src/procedural/generator.cc increased to 96%.
27 hoursfeat(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.
28 hoursadd a TODO about coverage scriptskal
28 hoursfeat(tests): Add comprehensive tests for math and 3d librariesskal
28 hourschore: Ignore generated source filesskal
28 hourshandoff(Claude): Stabilize 3D renderer with rotating skybox and two-pass ↵skal
architecture - Fixed black screen by ensuring clear operations in Pass 2 when Skybox pass is skipped. - Resolved WebGPU validation errors by synchronizing depth-stencil state. - Implemented rotating skybox using world-space ray unprojection (inv_view_proj). - Improved procedural noise generation (multi-octave Value Noise). - Restored scene integrity by correcting object indexing and removing artifacts. - Updated documentation (TODO.md, PROJECT_CONTEXT.md).
42 hoursfix: Correct depth handling in two-pass rendering for skybox and objectsskal
- Adjusted and for both the skybox and object rendering passes in . - The skybox pass now clears the depth buffer to 1.0 and stores this cleared value. - The object pass correctly loads this pre-cleared depth, ensuring proper depth testing for all scene objects. - Verified fix in , confirming both skybox and objects are visible and correctly depth-sorted. handoff(Gemini): The rendering pipeline now correctly handles depth for two-pass rendering, with the skybox as background and objects properly visible and depth-tested.
42 hoursfix: Resolve skybox and floor rendering bugs with two-pass approachskal
- Implemented a two-pass rendering strategy in Renderer3D::render: - First pass renders the skybox without depth writes. - Second pass renders scene objects with proper depth testing. - Ensured skybox pipeline explicitly ignores depth via . - Corrected struct in C++ and WGSL for and padding, resolving validation errors. - Reverted to for SDF misses, preventing sky bleed-through. - Updated to include a SKYBOX object with Perlin noise. handoff(Gemini): Resolved rendering bugs. Skybox renders correctly as background, and scene objects (including floor) are now visible. Codebase stable.
42 hoursfix: Implement proper skybox rendering with Perlin noiseskal
- Added ObjectType::SKYBOX for dedicated skybox rendering. - Created assets/final/shaders/skybox.wgsl for background rendering. - Implemented a two-pass rendering strategy in Renderer3D::render: - First pass renders the skybox without depth writes. - Second pass renders scene objects with depth testing. - Corrected GlobalUniforms struct in common_uniforms.wgsl and src/3d/renderer.h to include and explicit padding for 112-byte alignment. - Updated Renderer3D::update_uniforms to set the new and zero-initialize padding. - Reverted sky sampling logic in renderer_3d.wgsl to for SDF misses, preventing background bleed-through. - Updated test_3d_render.cc to include a SKYBOX object with Perlin noise. handoff(Gemini): The skybox is now correctly rendered with Perlin noise as a dedicated background pass. Objects render correctly without transparency to the sky. All necessary C++ and WGSL shader changes are implemented and verified.
43 hoursfeat: side-quest - Perlin noise sky and ProcGenFunc error handlingskal
- Updated ProcGenFunc signature to return bool for error reporting. - Implemented gen_perlin (Fractional Brownian Motion) in procedural/generator.cc. - Added support for sky texture in Renderer3D and its shader. - Integrated Perlin noise sky texture in test_3d_render.cc. - Caught and handled memory/generation errors in AssetManager and TextureManager. - Assigned reference numbers to all remaining tasks in documentation. handoff(Gemini): Side-quest complete. ProcGenFunc now returns bool. Perlin noise added and used for sky in 3D test. Windows build remains stable. All tasks numbered.
43 hoursdocs: number all tasks for referenceskal
Assigned reference numbers to all remaining tasks in documentation: - Task #34: Full STL Removal - Task #35: CRT Replacement - Task #36: Blender Exporter - Task #37: Asset Ingestion - Task #38: Runtime Loader - Task #39: Visual Debugging System - Task #40: Advanced Lighting & Transparency - Task #41: Spectrogram Editor HTML Tool - Task #42: Vectorial Spectrogram Reader (C++) - Task #43: Spectrogram Drawing Bricks Ensured consistent task numbering across PROJECT_CONTEXT.md and TODO.md.
43 hoursdocs: defer full STL removal to Phase 2skal
Lowered the priority of the 'replace STL' task. It will be addressed in the final optimization phase (Phase 2) to simplify current development. Hot paths in AssetManager and Procedural remain optimized. handoff(Gemini): STL usage is now permitted for non-critical paths until the final optimization phase. PROJECT_CONTEXT.md and TODO.md updated accordingly.
43 hoursrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
43 hoursclean-up the procedural code a bitskal
2 daysfeat(audio): Fix tracker bugs and implement rock demo trackskal
Critical Bug Fixes: - Fixed pool exhaustion: Tracker slots never freed after use, music stopped after 8 patterns. Implemented round-robin allocation with cleanup. - Fixed note name parsing: Added automatic note-to-frequency conversion in tracker_compiler. Bass and melody now play correctly. - Fixed timing mismatch: Patterns are 2 seconds but triggered every 4 seconds, causing silence gaps. Updated SCORE to trigger every 2 seconds. Improvements: - Implemented dynamic resource sizing in tracker_compiler: Analyzes score to determine optimal MAX_VOICES/MAX_SPECTROGRAMS values. - Created comprehensive rock track: 11 patterns with drums, bass, power chords, and lead melody over 25 seconds. - Added 213 lines of asset system documentation with 8 prioritized tasks. Known Issues for next session: - Audio quality could be improved (some artifacts remain) - Note synthesis uses default parameters, needs tuning - Pattern overlaps might cause voice exhaustion under heavy load Files Changed: - src/audio/tracker.cc: Round-robin pool allocation, cleanup logic - tools/tracker_compiler.cc: Note name parser, resource usage analysis - src/audio/synth.h: Increased limits to 16 based on analysis - assets/music.track: 230-line rock arrangement - doc/ASSET_SYSTEM.md: Comprehensive documentation + 8 tasks - TODO.md: Updated with recent completions and known issues handoff(Gemini): Music system now functional but needs quality improvements. Audio artifacts and synthesis tuning remain. See TODO.md for details. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 daysbuild: Enable parallel compilation in build scriptsskal
Add -j8 flag to all cmake --build commands to use 8 threads for faster parallel compilation across gen_assets.sh, crunch_demo.sh, and build_win.sh scripts. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 daysdocs: Finalize documentation and store project statev0.1skal
Consolidated 'Recently Completed' sections in PROJECT_CONTEXT.md and TODO.md. Verified all recent tasks (Build System, Asset Pipeline, Shader Testing) are correctly recorded. Making a final commit to preserve current progress before moving to Platform Hygiene.
2 daysadd Claude guidelinesskal
2 daystest(shader): Add ShaderComposer and WGSL asset validation tests (Task #26)skal
Implemented comprehensive unit tests for ShaderComposer and a validation test for production WGSL shader assets. This ensures the shader asset pipeline is robust and that all shaders contain required entry points and snippets. Also improved InitShaderComposer to be more robust during testing.
2 daysdocs: Add sub-task for Shader Asset Testing & Validation (Task #26)skal
Added a new sub-task to the project roadmap for developing comprehensive tests for ShaderComposer and WGSL shader code assets. This will ensure robustness and correctness of the shader asset pipeline.
2 daysdocs: Update project status and task listsskal
Updated PROJECT_CONTEXT.md and TODO.md to reflect the completion of the asset conversion sub-task and the build system consolidation (Task #25).
2 daysfeat(assets): Add new drum samples and improve conversion scriptskal
Created a new script, scripts/gen_spectrograms.sh, to robustly convert all audio files in assets/originals to .spec format. The new script is more portable and provides better feedback. Added the newly generated drum and bass samples to the asset list, organizing them by type for clarity. This completes the requested sub-task.
2 dayschore: Finalize Build System Consolidation (Task #25)skal
Updated project roadmap and to-do list to reflect the completion of the modular build system refactor.
2 daysrefactor(build): Modularize build system with static librariesskal
Completed the first part of Task #25. Created static libraries for each subsystem (audio, gpu, 3d, util, procedural) and refactored all executables to link against them. This improves modularity and simplifies the build process. Also fixed linker errors related to glfw, wgpu, and miniaudio.
2 daysadd 'use libraries' task for the Build Systemskal
2 daysfix(assets): Resolve static initialization order fiascoskal
Replaces the global array with which wraps a local static array. This ensures the asset table is initialized on first use, preventing crashes when other globals (like shader strings) try to access assets during dynamic initialization.
2 daysfix: Resolve shader initialization crashes and build errorsskal
Fixes crashes in demo64k and test_3d_render caused by uninitialized ShaderComposer. Moves InitShaderComposer() call before effect initialization in gpu.cc and adds explicit call in test_3d_render.cc. Also fixes include paths for generated assets.h in multiple files.
2 daysdocs: Mark Shader Asset Integration (Task #24) as completedskal
Updates status in PROJECT_CONTEXT.md and TODO.md.
2 daysrefactor: Shader Asset Integration (Task #24)skal
Extracted all hardcoded WGSL shaders into external assets. Updated AssetManager to handle shader snippets. Refactored Renderer3D, VisualDebug, and Effects to load shaders via the AssetManager, enabling better shader management and composition.
2 daysdocs: Document asset system technical detailsskal
Adds a section on Alignment, String Safety, and Size Reporting to ASSET_SYSTEM.md.
2 daysfeat(assets): Enforce 16-byte alignment and string safetyskal
Updates asset_packer to align static asset arrays to 16 bytes and append a null-terminator. This allows assets to be safely reinterpreted as typed pointers (e.g., float*, const char*) without copying. Updates AssetManager documentation to reflect these guarantees.
2 daysdocs: Plan Shader Asset Integration (Task #24)skal
Updates ASSET_SYSTEM.md to describe shader asset handling. Adds Task #24 to TODO.md and PROJECT_CONTEXT.md to extract hardcoded shaders and integrate them with the AssetManager and ShaderComposer.
2 daysdocs: Update project context and re-prioritize task listskal
This commit finalizes the session by updating the project documentation to reflect recent progress and future priorities. - **Recently Completed**: Summarized the finalization of the audio tracker, implementation of build stripping (STRIP_ALL), and resolution of WebGPU stability issues on macOS. - **Re-prioritization**: Promoted 'Platform & Code Hygiene' (Task #20) to Priority 1 and established '3D System Enhancements' (Task #18) as Priority 2, focusing on Blender integration. - **Session Summary**: Appended a detailed summary of the session's key achievements to SESSION_NOTES.md.
2 daysfeat: Finalize tracker asset-sample integration with unified pasting strategyskal
3 daysdocs: Update TODO.md with tracker asset sample integration progressskal