summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PROJECT_CONTEXT.md19
-rw-r--r--SESSION_NOTES.md21
-rw-r--r--TODO.md39
3 files changed, 44 insertions, 35 deletions
diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md
index a938801..a0dd4a6 100644
--- a/PROJECT_CONTEXT.md
+++ b/PROJECT_CONTEXT.md
@@ -28,19 +28,19 @@ Style:
## Project Roadmap
### Next Up
-- **Task #8: Implement Final Build Stripping**
- - [ ] Define and document a consistent set of rules for code stripping under the `STRIP_ALL` macro.
- - [ ] Remove unused functions, strip debug fields from structs, simplify code paths.
- - [ ] Verify no useless printf() or std::cout in final code.
-
- **Task #20: Code & Platform Hygiene**
- [ ] Gather all cross-compile and platform-specific conditional code into `platform.h`.
- - [ ] Refactor `platform_init()` to return `PlatformState` directly.
+ - [ ] Refactor `platform_init()` and `platform_poll()` for cleaner abstraction.
- [ ] Consolidate WebGPU header inclusions.
+ - [ ] Remove `std::map`/`std::vector` from hot paths.
+
+- **Task #18: 3D System Enhancements**
+ - [ ] **Blender Exporter**: Create script to export scenes to internal binary format.
+ - [ ] **Asset Pipeline**: Update `asset_packer` and runtime loader for 3D scenes.
- **Task #21: Shader Optimization**
- [ ] Use macros or code generation to factorize common WGSL code (normals, bump, lighting).
- - [ ] Implement tight ray-marching bounds (min/max t) derived from proxy hull hits.
+ - [ ] Implement Tri-planar mapping for better procedural textures.
### Future Goals
- **Task #5: Implement Spectrogram Editor**
@@ -54,12 +54,13 @@ Style:
- [ ] CRT replacement investigation.
### Recently Completed
+- **WebGPU Stabilization**: Resolved `WGPUSurface` creation failures on macOS by adding platform-specific `GLFW_EXPOSE_NATIVE_COCOA` definitions and fixed validation errors in the render pass configuration.
+- **Final Build Stripping (Task #8)**: Implemented the `STRIP_ALL` macro to remove non-essential code (CLI parsing, debug labels, iostream) and refined size optimization flags (`-dead_strip`) for macOS.
+- **Minimal Audio Tracker (Task 21.3)**: Finalized a pattern-based audio tracker supporting both procedural notes and asset-based spectrograms with a unified "one-voice-per-pattern" pasting strategy.
- **WGSL Library (Task 21.1)**: Implemented `ShaderComposer` for modular WGSL snippet management.
- **Tight Ray Bounds (Task 21.2)**: Implemented local-space ray-box intersection to optimize SDF raymarching.
- **High-DPI Fix**: Resolved viewport "squishing" via dynamic resolution uniforms and explicit viewports.
- **Unified 3D Shadows**: Implemented robust SDF shadows across all objects using `inv_model` transforms.
-- **Tight Proxy Hulls**: Optimized Torus proxy geometry and debug wireframes.
-- **Procedural Textures**: Restored floor grid and SDF bump mapping.
---
*For a detailed list of all completed tasks, see the git history.*
diff --git a/SESSION_NOTES.md b/SESSION_NOTES.md
index 5ba42f7..4fc265b 100644
--- a/SESSION_NOTES.md
+++ b/SESSION_NOTES.md
@@ -8943,3 +8943,24 @@ The `final` target is now part of the build system. What's next?
* The demo now features a working sequencer with embedded drum samples.
* Final compressed binary size on macOS is approximately 107KB (with assets).
* The project is ready for the next phase of development (cross-compilation or advanced compression).
+
+## SESSION SUMMARY - Tue Feb 3 07:42:59 CET 2026
+
+- **Audio Tracker Finalization**:
+ - Completed the integration of asset-based spectrograms into the pattern tracker.
+ - Implemented a unified pasting strategy in `tracker_update` where all notes and samples are baked into a single voice-buffer per pattern.
+ - Verified timing and drum patterns in `assets/music.track`.
+
+- **Build Optimization & Stripping (Task #8)**:
+ - Implemented `DEMO_STRIP_ALL` CMake option.
+ - `STRIP_ALL` removes CLI parsing, debug labels, error callbacks, and heavy `<iostream>` headers.
+ - Optimized macOS linker flags: Replaced GNU-specific `--gc-sections` with `-dead_strip`.
+
+- **WebGPU Stability (macOS)**:
+ - Fixed `g_surface` assertion failure by adding `-DGLFW_EXPOSE_NATIVE_COCOA` to enable GLFW native handles.
+ - Resolved WebGPU validation errors by explicitly setting `WGPUTextureUsage_RenderAttachment` and initializing `resolveTarget = nullptr` in render pass descriptors.
+
+- **Quality Assurance**:
+ - Added `clang-format` requirement to `CONTRIBUTING.md`.
+ - Verified all tests and builds (native + strip build) pass on macOS.
+
diff --git a/TODO.md b/TODO.md
index 41ea008..d874bb1 100644
--- a/TODO.md
+++ b/TODO.md
@@ -2,49 +2,36 @@
This file tracks prioritized tasks with detailed attack plans.
-## Priority 1: Final Build Stripping (Task #8)
-**Goal:** Reduce binary size by removing all non-essential code under the `STRIP_ALL` macro.
-- [ ] **Attack Plan - Rules:** Document stripping rules in `doc/STRIPPING.md`.
-- [ ] **Attack Plan - Error Strings:** Wrap all non-critical `printf`, `std::cerr`, and error strings in `STRIP_ALL`.
-- [ ] **Attack Plan - CLI Parsing:** Disable all non-essential CLI arguments (seek, resolution, debug) in `STRIP_ALL`.
-- [ ] **Attack Plan - Struct Hygiene:** Remove debug-only fields (like `label` or `name`) from core structs.
-
-## Priority 2: Platform & Code Hygiene (Task #20)
+## Priority 1: Platform & Code Hygiene (Task #20)
**Goal:** Clean up the codebase for easier cross-platform maintenance and CRT replacement.
- [ ] **Attack Plan - Header Consolidation:** Move all `#ifdef` logic for WebGPU headers and platform-specific shims into `src/platform.h`.
- [ ] **Attack Plan - Refactor platform_init:** Change `void platform_init(PlatformState* state, ...)` to `PlatformState platform_init(...)`.
- [ ] **Attack Plan - Unified Poll:** Incorporate `platform_get_time()` and `platform_get_aspect_ratio()` updates into `platform_poll()`.
- [ ] **Attack Plan - Standard Container Removal:** Replace `std::map`, `std::string`, and `std::vector` in performance-critical or size-sensitive paths with simpler C-style alternatives.
+## Priority 2: 3D System Enhancements (Task #18)
+**Goal:** Establish a pipeline for importing complex 3D scenes to replace hardcoded geometry.
+- [ ] **Attack Plan - Blender Exporter:** Create a Python script (`tools/blender_export.py`) to export meshes/cameras/lights to a binary asset format.
+- [ ] **Attack Plan - Asset Ingestion:** Update `asset_packer` to handle the new 3D binary format.
+- [ ] **Attack Plan - Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer.
+
## Priority 3: Shader Optimization (Task #21)
**Goal:** Improve GPU performance and reduce shader source bloat.
- [ ] **Attack Plan - Normal Factorization:** Create a standard WGSL helper for normal calculation to avoid duplicate code in every effect.
-- [ ] **Attack Plan - implement Tri-planar or bi-planar mapping: see https://iquilezles.org/articles/biplanar/ for instance
+- [ ] **Attack Plan - Tri-planar Mapping:** Implement bi/tri-planar mapping for procedural textures to improve visual quality on complex SDFs.
## Future Goals
- [ ] **Task #5: Spectrogram Editor**: Web-based visual tool for extreme audio compression.
-- [ ] **Task #18: 3D System Enhancements**: Blender exporter and GPU-based BVH for complex scenes.
+- [ ] **Task #18-B: GPU BVH**: Optimize scene queries with a GPU-based BVH for the new 3D system.
- [ ] **Task #22: Windows Native Platform**: Replace GLFW with direct Win32 API calls for the final 64k push.
- [ ] **Task #23: Shader Performance Analysis**: Analyze shader performance using Xcode Metal debugger on macOS.
## Phase 2: Advanced Size Optimization
-- [ ] **Task #8**: Implement Final Build Stripping
+- [ ] **Task #22**: Windows Native Platform (Win32 API)
## Recently Completed
-- [x] **Tracker Asset Sample Integration**: Modified `assets/music.track` for `SAMPLE ASSET_NAME` syntax, updated `tools/tracker_compiler.cc` for parsing and code generation (including `init_asset_samples()`), and partially adjusted `src/audio/tracker.cc` for asset sample lookups.
+- [x] **WebGPU Stability & macOS Fixes**: Resolved surface creation failures by adding `GLFW_EXPOSE_NATIVE_COCOA` and fixed validation errors in surface configuration and render pass attachments.
+- [x] **Final Build Stripping (Task #8)**: Implemented `STRIP_ALL` macro to remove CLI parsing and debug info. Optimized macOS linker flags (`-dead_strip`).
+- [x] **Tracker Asset Sample Integration**: Modified `assets/music.track` for `SAMPLE ASSET_NAME` syntax, updated `tools/tracker_compiler.cc` for parsing and code generation, and finalized `src/audio/tracker.cc` for unified asset sample pasting.
- [x] **Minimal Audio Tracker**: Implemented a pattern and score-based audio tracker system. Details in `doc/TRACKER.md`.
- [x] **WGSL Library (Task 21.1)**: Implemented ShaderComposer for modular WGSL snippet management.
-- [x] **Tight Ray Bounds (Task 21.2)**: Derived t_min and t_max from proxy hull hits via local-space ray-box intersection.
-- [x] **Math & Unit Tests**: Added rigorous matrix inversion checks and ShaderComposer verification tests.
-- [x] **High-DPI Fix**: Resolved viewport "squishing" via dynamic resolution uniforms and explicit viewports.
-- [x] **Unified 3D Shadows**: Implemented robust SDF shadows across all objects using `inv_model` transforms.
-- [x] **Tight Proxy Hulls**: Optimized Torus proxy geometry and debug wireframes.
-- [x] **Procedural Textures**: Restored floor grid and SDF bump mapping.
-- [x] **Code Hygiene**: Completed a project-wide code formatting pass with `clang-format`.
-
-## In Progress
-- [ ] **Tracker Asset Sample Integration - Finalization**:
- - **Compiler**: Finalize `tools/tracker_compiler.cc` generation of `TrackerEvent` data (asset names vs. indices) and `init_asset_samples()` function.
- - **Runtime**: Finalize `src/audio/tracker.cc` to handle `TrackerEvent` types correctly in `tracker_update`.
- - **Main Application**: Add call to generated `init_asset_samples()` in `src/main.cc`.
- - **Build & Verify**: Rebuild project and test asset sample integration.