summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
17 hoursrefactor: Factor WGPU boilerplate into builder pattern helpersskal
Add BindGroupLayoutBuilder, BindGroupBuilder, RenderPipelineBuilder, and SamplerCache to reduce repetitive WGPU code. Refactor post_process_helper, cnn_effect, and rotating_cube_effect. Changes: - Bind group creation: 19 instances, 14→4 lines each - Pipeline creation: 30-50→8 lines - Sampler deduplication: 6 instances → cached - Total boilerplate reduction: -122 lines across 3 files Builder pattern prevents binding index errors and consolidates platform-specific #ifdef in fewer locations. Binary size unchanged (6.3M debug). Tests pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
18 hoursfeat: CNN RGBD→grayscale with 7-channel augmented inputskal
Upgrade CNN architecture to process RGBD input, output grayscale, with 7-channel layer inputs (RGBD + UV coords + grayscale). Architecture changes: - Inner layers: Conv2d(7→4) output RGBD - Final layer: Conv2d(7→1) output grayscale - All inputs normalized to [-1,1] for tanh activation - Removed CoordConv2d in favor of unified 7-channel input Training (train_cnn.py): - SimpleCNN: 7→4 (inner), 7→1 (final) architecture - Forward: Normalize RGBD/coords/gray to [-1,1] - Weight export: array<array<f32, 8>, 36> (inner), array<f32, 8>, 9> (final) - Dataset: Load RGBA (RGBD) input Shaders (cnn_conv3x3.wgsl): - Added cnn_conv3x3_7to4: 7-channel input → RGBD output - Added cnn_conv3x3_7to1: 7-channel input → grayscale output - Both normalize inputs and use flattened weight arrays Documentation: - CNN_EFFECT.md: Updated architecture, training, weight format - CNN_RGBD_GRAYSCALE_SUMMARY.md: Implementation summary - HOWTO.md: Added training command example Next: Train with RGBD input data Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
18 hoursudpateskal
18 hoursupdate timelineskal
18 hoursfix: Resolve CNN effect black screen bug (framebuffer capture + uniforms)skal
Two bugs causing black screen when CNN post-processing activated: 1. Framebuffer capture timing: Capture ran inside post-effect loop after ping-pong swaps, causing layers 1+ to capture wrong buffer. Moved capture before loop to copy framebuffer_a once before post-chain starts. 2. Missing uniforms update: CNNEffect never updated uniforms_ buffer, leaving uniforms.resolution uninitialized (0,0). UV calculation p.xy/uniforms.resolution produced NaN, causing all texture samples to return black. Added uniforms update in update_bind_group(). Files modified: - src/gpu/effect.cc: Capture before post-chain (lines 308-346) - src/gpu/effects/cnn_effect.cc: Add uniforms update (lines 132-142) - workspaces/main/shaders/cnn/cnn_layer.wgsl: Remove obsolete comment - doc/CNN_DEBUG.md: Historical debugging doc - CLAUDE.md: Reference CNN_DEBUG.md in historical section Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
20 hoursfix: Capture scene framebuffer before post-processing for CNN effectskal
CNNEffect's "original" input was black because FadeEffect (priority 1) ran before CNNEffect (priority 1), fading the scene. Changed framebuffer capture to use framebuffer_a (scene output) instead of current_input (post-chain). Also add seq_compiler validation to detect post-process priority collisions within and across concurrent sequences, preventing similar render order issues. Updated stub_types.h WGPULoadOp enum values to match webgpu.h spec. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
21 hoursfeat: Add multi-layer CNN support with framebuffer capture and blend controlskal
Implements automatic layer chaining and generic framebuffer capture API for multi-layer neural network effects with proper original input preservation. Key changes: - Effect::needs_framebuffer_capture() - generic API for pre-render capture - MainSequence: auto-capture to "captured_frame" auxiliary texture - CNNEffect: multi-layer support via layer_index/total_layers params - seq_compiler: expands "layers=N" to N chained effect instances - Shader: @binding(4) original_input available to all layers - Training: generates layer switches and original input binding - Blend: mix(original, result, blend_amount) uses layer 0 input Timeline syntax: CNNEffect layers=3 blend=0.7 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 hoursdocs: Update and streamline CNN training documentationskal
- Document coordinate-aware layer 0 architecture - Add checkpointing examples and options table - Consolidate training workflow with practical examples - Clarify CoordConv2d usage and size impact - Streamline training/README.md structure Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 hoursfeat: Add checkpointing support to CNN training scriptskal
- Save checkpoints every N epochs (--checkpoint-every) - Resume from checkpoint (--resume) - Store model, optimizer, epoch, loss, and architecture info - Auto-create checkpoint directory Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 hoursfix: Auto-expand single kernel size to all layers in training scriptskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
24 hoursupdate target imagesskal
24 hoursfeat: Add coordinate-aware CNN layer 0 for position-dependent stylizationskal
- Implement CoordConv2d custom layer accepting (x,y) patch center - Split layer 0 weights: rgba_weights (9x mat4x4) + coord_weights (mat2x4) - Add *_with_coord() functions to 3x3/5x5/7x7 convolution shaders - Update training script to generate coordinate grid and export split weights - Regenerate placeholder weights with new format Size impact: +32B coord weights + ~100B shader code = +132B total All 36 tests passing (100%) handoff(Claude): CNN coordinate awareness implemented, ready for training Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 hoursdocs: Add CNN effect documentation and update project statusskal
**New Documentation:** - `doc/CNN_EFFECT.md` (223 lines): Comprehensive implementation guide - Architecture overview (file structure, shader composition) - Usage examples (C++ API, timeline integration) - Training workflow (planned) - Implementation details (convolution signatures, weight storage) - Size budget breakdown (~5-8 KB total) - Testing and troubleshooting **Updated Documentation:** - `doc/CNN.md`: Added implementation status section - Completed items (✅ modular shaders, C++ class, tests) - Pending items (⏳ training script, multi-layer, quantization) - Size impact summary - `PROJECT_CONTEXT.md`: - Added "Effects: CNN post-processing foundation" to Current Status - Added `CNN_EFFECT.md` to Technical Reference list **Summary:** CNN effect foundation complete with modular WGSL architecture, ready for training script integration. All tests passing (36/36). ~5-8 KB footprint. handoff(Claude): Documentation complete for CNN effect implementation
26 hoursfeat: Add CNN post-processing effect with modular WGSL architectureskal
Implements multi-layer convolutional neural network shader for stylized post-processing of 3D rendered scenes: **Core Components:** - CNNEffect: C++ effect class with single-layer rendering (expandable to multi-pass) - Modular WGSL snippets: cnn_activation, cnn_conv3x3/5x5/7x7, cnn_weights_generated - Placeholder identity-like weights for initial testing (to be replaced by trained weights) **Architecture:** - Flexible kernel sizes (3×3, 5×5, 7×7) via separate snippet files - ShaderComposer integration (#include resolution) - Residual connections (input + processed output) - Supports parallel convolutions (design ready, single conv implemented) **Size Impact:** - ~3-4 KB shader code (snippets + main shader) - ~2-4 KB weights (depends on network architecture when trained) - Total: ~5-8 KB (acceptable for 64k demo) **Testing:** - CNNEffect added to test_demo_effects.cc - 36/36 tests passing (100%) **Next Steps:** - Training script (scripts/train_cnn.py) to generate real weights - Multi-layer rendering with ping-pong textures - Weight quantization for size optimization handoff(Claude): CNN effect foundation complete, ready for training integration
27 hoursinitial doc for the CNN projectskal
33 hoursdocs: Reorganize shader editor documentationskal
README.md: Streamlined quick start and feature overview SHADER_EDITOR_DETAILS.md: Technical reference (architecture, uniforms, examples) SHADER_EDITOR_PLAN.md: Development roadmap with 5 phases Summary of implemented features: - Live WebGPU preview (1280×720, autoplay) - Syntax highlighting (placeholder-based, prevents overlap) - #include composition (recursive resolution) - Animation controls (time, beat, audio_peak) - File I/O (load/save .wgsl) Next priorities: 1. Multi-resolution support 2. Improved syntax highlighting 3. Texture upload Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
33 hoursfix: Use placeholder technique to prevent syntax highlighting overlapskal
Replace comments/strings with placeholders, highlight rest, restore. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursrefactor: Improve syntax highlighting to avoid overlapping matchesskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfeat: Add WGSL syntax highlightingskal
Overlay highlighting: keywords, types, attributes, functions, numbers, comments. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursrefactor: Increase editor pane size by 20% (36% → 43%)skal
Preview: 57%, Editor: 43% Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfix: Remove resolutionSelect references after removing UI elementskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfeat: Remove resolution selector, enable autoplay on loadskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfix: Use 16:9 aspect ratio and object-fit contain for canvasskal
Default resolution: 1280x720 (16:9) Canvas uses object-fit: contain to preserve aspect ratio Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfix: Canvas fills available height instead of maintaining square aspectskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfix: Reference texture/sampler in default shader for bind group layoutskal
WebGPU auto layout requires all bindings to be used in shader. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfix: Use var instead of let for mutable uv in default shaderskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursrefactor: Adjust shader editor layout and add default animationskal
- Editor pane: 30% → 36% (20% larger) - Preview pane: 70% → 64% - Default shader: animated gradient + pulsing circle (was plain color) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursfeat: Add HTML WGSL shader editor toolskal
ShaderToy-like web tool for live WGSL shader editing with WebGPU preview. Features: - Live WebGPU preview with real-time shader updates - Shader composition: #include directive support - Animation controls: time, loop_time (0..1), audio_peak - File I/O: Load/save .wgsl files - CommonUniforms binding (resolution, time, beat, audio_intensity) - Keyboard shortcuts: Ctrl+S (save), Ctrl+O (load), Space (play/pause) Single-file HTML (no build step, no CORS issues). handoff(Claude): Implemented HTML WGSL shader editor per plan Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
35 hoursfix: Guard --headless flag with DEMO_HEADLESS defineskal
Prevents user confusion when DEMO_HEADLESS is not defined at compile time. The --headless and --duration flags are now only available when headless support is compiled in. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
38 hoursrefactor: Reorganize tests into subsystem subdirectoriesskal
Restructured test suite for better organization and targeted testing: **Structure:** - src/tests/audio/ - 15 audio system tests - src/tests/gpu/ - 12 GPU/shader tests - src/tests/3d/ - 6 3D rendering tests - src/tests/assets/ - 2 asset system tests - src/tests/util/ - 3 utility tests - src/tests/common/ - 3 shared test helpers - src/tests/scripts/ - 2 bash test scripts (moved conceptually, not physically) **CMake changes:** - Updated add_demo_test macro to accept LABEL parameter - Applied CTest labels to all 36 tests for subsystem filtering - Updated all test file paths in CMakeLists.txt - Fixed common helper paths (webgpu_test_fixture, etc.) - Added custom targets for subsystem testing: - run_audio_tests, run_gpu_tests, run_3d_tests - run_assets_tests, run_util_tests, run_all_tests **Include path updates:** - Fixed relative includes in GPU tests to reference ../common/ **Documentation:** - Updated doc/HOWTO.md with subsystem test commands - Updated doc/CONTRIBUTING.md with new test organization - Updated scripts/check_all.sh to reflect new structure **Verification:** - All 36 tests passing (100%) - ctest -L <subsystem> filters work correctly - make run_<subsystem>_tests targets functional - scripts/check_all.sh passes Backward compatible: make test and ctest continue to work unchanged. handoff(Gemini): Test reorganization complete. 36/36 tests passing.
38 hoursfix: Reduce default audio volumes to prevent clippingskal
Reduced tracker pattern volumes: - Kicks: 1.0 → 0.7 - Snares: 1.0/0.9 → 0.6 - Crash: 0.85 → 0.6 Multiple simultaneous voices were summing to excessive levels. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 hoursdocs: Streamline headless mode documentationskal
Summary: - HEADLESS_MODE.md: 58→32 lines (-45%) - HOWTO.md: Condensed to one-liner + reference - Removed implementation details (in code comments) - Simplified comparison table - Clearer use case description handoff(Claude): Documentation cleanup
39 hoursfeat: Add headless mode for testing without GPUskal
Implements DEMO_HEADLESS build option for fast iteration cycles: - Functional GPU/platform stubs (not pure no-ops like STRIP_EXTERNAL_LIBS) - Audio and timeline systems work normally - No rendering overhead - Useful for CI, audio development, timeline validation Files added: - doc/HEADLESS_MODE.md - Documentation - src/gpu/headless_gpu.cc - Validated GPU stubs - src/platform/headless_platform.cc - Time simulation (60Hz) - scripts/test_headless.sh - End-to-end test script Usage: cmake -B build_headless -DDEMO_HEADLESS=ON cmake --build build_headless -j4 ./build_headless/demo64k --headless --duration 30 Progress printed every 5s. Compatible with --dump_wav mode. handoff(Claude): Task #76 follow-up - headless mode complete
39 hoursdocs: Update references to workspace layoutskal
Update all doc references from old paths to workspace structure: - assets/demo.seq → workspaces/main/timeline.seq - assets/music.track → workspaces/main/music.track - assets/final/demo_assets.txt → workspaces/main/assets.txt - assets/test_demo.* → workspaces/test/* Files updated: - HOWTO.md: Add workspace selection, update paths - SEQUENCE.md: Update examples and integration - ASSET_SYSTEM.md: Workspace-aware workflow - CONTRIBUTING.md: Workspace timeline paths - ARCHITECTURE.md: Generic workspace reference Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 hoursdocs: Streamline top-level documentationskal
Condense README, PROJECT_CONTEXT, and TODO: - README: Remove verbose file listings, focus on quickstart - PROJECT_CONTEXT: Condense status, remove recent completions - TODO: Mark Task #77 complete, remove verbose details - WORKSPACE_SYSTEM: Mark as completed Details moved to individual doc/ files. Net: -76 lines Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 hoursfeat: Add workspace header comments to config filesskal
Add `# WORKSPACE: <name>` header to all workspace config files: - timeline.seq - music.track - assets.txt Format: First line contains workspace identifier. Editors must preserve this header comment. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 hoursfeat: Implement workspace system (Task #77)skal
Self-contained workspaces for parallel demo development. Structure: - workspaces/main,test - Demo-specific resources - assets/common - Shared resources - workspace.cfg - Configuration per workspace CMake integration: - DEMO_WORKSPACE option (defaults to main) - cmake/ParseWorkspace.cmake - Config parser - Workspace-relative asset/timeline/music paths Migration: - Main demo: demo.seq to workspaces/main/timeline.seq - Test demo: test_demo.seq to workspaces/test/timeline.seq - Common shaders: assets/common/shaders - Workspace shaders: workspaces/*/shaders Build: cmake -B build -DDEMO_WORKSPACE=main cmake -B build_test -DDEMO_WORKSPACE=test All tests passing (36/36). handoff(Claude): Task #77 workspace system complete. Both main and test workspaces build and pass all tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
40 hoursdocs: Condense HOWTO.md, move details to technical docsskal
- HOWTO.md: 184→97 lines (quick reference only) - BUILD.md: Add build modes, header organization, dependency tracking - ASSET_SYSTEM.md: Add developer workflow section - TRACKER.md: Add AudioEngine API documentation Net: -147 lines in HOWTO.md
40 hoursdocs: Update docs for Task #76 size measurementskal
- Add size measurement section to HOWTO.md - Move Task #76 to COMPLETED.md - Update TODO.md and PROJECT_CONTEXT.md - Document measurement results (Demo=4.4MB, External=2.0MB)
40 hoursfeat: Implement Task #76 external library size measurementskal
- Use ma_backend_null for audio (100-200KB savings) - Stub platform/gpu abstractions instead of external APIs - Add DEMO_STRIP_EXTERNAL_LIBS build mode - Create stub_types.h with minimal WebGPU opaque types - Add scripts/measure_size.sh for automated measurement Results: Demo=4.4MB, External=2.0MB (69% vs 31%) handoff(Claude): Task #76 complete. Binary compiles but doesn't run (size measurement only).
40 hoursdocs: Streamline top-level project filesskal
Move implementation details to design docs, keep TODO.md and PROJECT_CONTEXT.md concise and high-level. Improves readability. Changes: - TODO.md: Condensed from 162 to 52 lines - PROJECT_CONTEXT.md: Grouped design docs by category - Recently Completed: Date-grouped format Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
40 hoursfeat: Add Task #77 for workspace system architectureskal
Proposes self-contained workspace structure for parallel demo development. Each workspace includes timeline, music, assets, and shaders in one place. Enables clean separation and scalability for multiple demos. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
41 hoursdocs: Update documentation and clean up obsolete filesskal
- Add Task #76: External library size measurement - Update hot-reload documentation across README, HOWTO, PROJECT_CONTEXT - Update test count: 36/36 passing (100%) - Remove completed analysis files from root Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
41 hoursfeat: Add debug-only file change detection for rapid iterationskal
Enables --hot-reload flag to watch config files and notify on changes. Detects modifications to assets/sequences/music for rebuild workflow. Completely stripped from release builds (0 bytes overhead). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursdocs: Condense essential context files (856→599 lines)skal
Extract detailed examples and untriaged tasks to on-demand docs. Created BACKLOG.md, ARCHITECTURE.md, CODING_STYLE.md, TOOLS_REFERENCE.md. Reduces always-loaded token budget by 30% while preserving all information. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursdocs: Add sub-task for type-safe shader compositionskal
Low priority task to prevent recurrent error of forgetting to call ShaderComposer::Compose() by using strong typing (ComposedShader class). Would make it a compile-time error instead of runtime crash. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursdocs: Add sub-task for splitting common_uniforms.wgslskal
Low priority task to split common_uniforms.wgsl (4 structs) into separate files for more granular #include directives. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursfix: Add ShaderComposer to CircleMaskEffect pipelinesskal
CircleMaskEffect was creating shader modules directly without using ShaderComposer, causing #include directives to fail at runtime. Changes: - Add ShaderComposer.Compose() for compute and render shaders - Include shader_composer.h header Fixes demo64k crash on CircleMaskEffect initialization. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursrefactor: Deduplicate CommonUniforms with #include in WGSL shadersskal
Replace redundant CommonUniforms struct definitions across 13 shaders with #include "common_uniforms" directive. Integrate ShaderComposer preprocessing into all shader creation pipelines. Changes: - Replace 9-line CommonUniforms definitions with single #include line - Add ShaderComposer.Compose() to create_post_process_pipeline() - Add ShaderComposer.Compose() to gpu_create_render_pass() - Add ShaderComposer.Compose() to gpu_create_compute_pass() - Add InitShaderComposer() calls to test_effect_base and test_demo_effects - Update test_shader_compilation to compose shaders before validation Net reduction: 83 lines of duplicate code eliminated All 35 tests passing (100%) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 hoursrefactor: Move .spec audio assets to assets/final/music subdirectoryskal
- Created assets/final/music/ directory for audio samples - Moved 14 .spec files from assets/final/ to assets/final/music/ - Updated demo_assets.txt and test_demo_assets.txt with music/ prefix - Updated gen_spectrograms.sh to output to new location - CMakeLists.txt unchanged (still uses assets/final/ as base) handoff(Claude): Music assets reorganized into subdirectory