# To-Do List This file tracks prioritized tasks with detailed attack plans. ## Recently Completed (February 4, 2026) - [x] **Task #50: WGSL Modularization**: - [x] **Recursive Composition**: Updated `ShaderComposer` to support recursive `#include "snippet_name"` directives with cycle detection. - [x] **Granular SDF Library**: Extracted `math/sdf_shapes.wgsl`, `math/sdf_utils.wgsl`, `render/shadows.wgsl`, `render/scene_query.wgsl`, and `render/lighting_utils.wgsl`. - [x] **Pipeline Update**: Refactored `Renderer3D` and `renderer_3d.wgsl` to use the new modular system, reducing C++-side dependency management. - [x] **Platform Fix**: Resolved `WGPUShaderSourceWGSL` usage on macOS to ensure compatibility with composed shader strings. - [x] **Task #48: Improve Audio Coverage**: - [x] **New Tests**: Added `test_dct` (100% coverage for transforms) and `test_audio_gen` (94% coverage for procedural audio). - [x] **Enhanced Tests**: Updated `test_synth` to cover rendering loop, double-buffering, and resource exhaustion. - [x] **Coverage Boost**: Increased `src/audio/` coverage from ~42% to 93%. - [x] **Task #47: Improve Asset Manager Coverage**: - [x] **New Tests**: Added tests for unknown procedural functions, generation failures, and edge cases in `src/tests/test_assets.cc`. - [x] **Tooling Update**: Downgraded `asset_packer` validation error to warning to allow testing invalid assets. - [x] **Coverage Boost**: Increased `src/util/asset_manager.cc` coverage from 71% to 88%. - [x] **Task #46: Enhance Coverage Script**: Updated `scripts/gen_coverage_report.sh` to accept an optional directory argument for targeted coverage reports (e.g., `src/procedural`). - [x] **Task #45: Improve Procedural Generation Coverage**: - [x] **Unit Tests:** Implemented comprehensive tests for `gen_perlin`, `make_periodic`, and default parameter handling in `src/tests/test_procedural.cc`. - [x] **Coverage Boost:** Increased `src/procedural/generator.cc` coverage from 38% to 96%. - [x] **Task #44: Developer Tooling (Coverage)**: - [x] **Implement Code Coverage:** Added `DEMO_ENABLE_COVERAGE` CMake option and created `scripts/gen_coverage_report.sh` to generate HTML coverage reports using `lcov` on macOS. - [x] **Documentation:** Updated `doc/HOWTO.md` with usage instructions. - [x] **Skybox & Two-pass Rendering Stability**: - [x] **Fixed Two-pass Rendering:** Implemented mandatory clear operations for color and depth when the skybox is absent, preventing black screens and depth validation errors. - [x] **Implemented Rotating Skybox:** Added `inv_view_proj` to `GlobalUniforms` and updated the skybox shader to perform world-space ray unprojection, enabling correct rotation with the camera. - [x] **Enhanced Procedural Noise:** Implemented a multi-octave Value Noise generator for higher-quality skybox textures. - [x] **Scene Integrity:** Restored proper object indexing and removed redundant geometry, ensuring the floor grid and objects render correctly. ## Priority 1: 3D System Enhancements (Task #18) **Goal:** Establish a pipeline for importing complex 3D scenes to replace hardcoded geometry. - [ ] **Task #36: Blender Exporter:** Create a Python script (`tools/blender_export.py`) to export meshes/cameras/lights to a binary asset format. - [ ] **Task #37: Asset Ingestion:** Update `asset_packer` to handle the new 3D binary format. - [ ] **Task #38: Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer. ## Priority 2: WGSL Modularization (Task #50) [RECURRENT] **Goal**: Refactor `ShaderComposer` and WGSL assets to support granular, reusable snippets and `#include` directives. This is an ongoing task to maintain shader code hygiene as new features are added. ## Priority 3: Physics & Collision (Task #49) **Goal**: Implement a lightweight physics engine using SDFs and BVH acceleration. (See `doc/3D.md` for design). - [ ] **Task #49.1: CPU-Side SDF Library**: - [ ] Create `src/3d/sdf_cpu.h` implementing `sdSphere`, `sdBox`, `sdTorus`, `sdPlane` using `mini_math.h`. - [ ] Implement `calc_normal` (numerical gradient) for these SDFs. - [ ] Add unit tests in `src/tests/test_physics.cc` to verify CPU SDFs match ground truth. - [ ] **Task #49.2: BVH Construction**: - [ ] Define `BVHNode` struct in `src/3d/bvh.h` (shared/compatible with GPU layout). - [ ] Implement `BVHBuilder::Build(const std::vector&)` in `src/3d/bvh.cc`. - [ ] Implement `BVH::Query(AABB)` for broad-phase collision detection. - [ ] Visualize BVH in `src/tests/test_3d_render.cc` (using `VisualDebug`). - [ ] **Task #49.3: Physics Loop**: - [ ] Create `PhysicsSystem` class in `src/3d/physics.h`. - [ ] Implement `Update(dt)`: Integration -> Broad Phase -> Narrow Phase (SDF Probe) -> Resolution. - [ ] Add `velocity`, `mass`, `restitution` fields to `Object3D`. - [ ] Integrate into `test_3d_render.cc` main loop. ## Priority 4: Developer Tooling & CI **Goal**: Improve developer workflows, code quality, and release processes. *(No active tasks)* ## Phase 2: Size Optimization (Final Goal) - [ ] **Task #34: Full STL Removal**: Replace all remaining `std::vector`, `std::map`, and `std::string` usage with custom minimal containers or C-style arrays to allow for CRT replacement. (Minimal Priority - deferred to end). - [ ] **Task #22: Windows Native Platform**: Replace GLFW with direct Win32 API calls for the final 64k push. - [ ] **Task #28: Spectrogram Quantization**: Research optimal frequency bin distribution and implement quantization. - [ ] **Task #35: CRT Replacement**: investigation and implementation of CRT-free entry point. ## Future Goals