| Age | Commit message (Collapse) | Author |
|
**Architecture changes:**
- Static features (8D): p0-p3 (parametric) + uv_x, uv_y, sin(10×uv_x), bias
- Input RGBD (4D): fed separately to all layers
- All layers: uniform 12D→4D (4 prev/input + 8 static → 4 output)
- Bias integrated in static features (bias=False in PyTorch)
**Weight calculations:**
- 3 layers × (12 × 3×3 × 4) = 1296 weights
- f16: 2.6 KB (vs old variable arch: ~6.4 KB)
**Updated files:**
*Training (Python):*
- train_cnn_v2.py: Uniform model, takes input_rgbd + static_features
- export_cnn_v2_weights.py: Binary export for storage buffers
- export_cnn_v2_shader.py: Per-layer shader export (debugging)
*Shaders (WGSL):*
- cnn_v2_static.wgsl: p0-p3 parametric features (mips/gradients)
- cnn_v2_compute.wgsl: 12D input, 4D output, vec4 packing
*Tools:*
- HTML tool (cnn_v2_test): Updated for 12D→4D, layer visualization
*Docs:*
- CNN_V2.md: Updated architecture, training, validation sections
- HOWTO.md: Reference HTML tool for validation
*Removed:*
- validate_cnn_v2.sh: Obsolete (used CNN v1 tool)
All code consistent with bias=False (bias in static features as 1.0).
handoff(Claude): CNN v2 architecture finalized and documented
|
|
- Rename 'Static (L0)' → 'Static' (clearer, less confusing)
- Update channel labels: 'R/G/B/D' → 'Ch0 (R)/Ch1 (G)/Ch2 (B)/Ch3 (D)'
- Add 'Layer' prefix in weights table for consistency
- Document layer indexing: Static + Layer 1,2,3... (UI) ↔ weights.layers[0,1,2...]
- Add explanatory notes about 7D input and 4-of-8 channel display
- Create doc/CNN_V2_BINARY_FORMAT.md with complete .bin specification
- Cross-reference spec in CNN_V2.md and CNN_V2_WEB_TOOL.md
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Features:
- Right sidebar with Layer Visualization (top) and Weights Info (collapsible, bottom)
- Activations mode: 4-channel grayscale views per layer (Static L0 + CNN layers)
- Weights mode: Kernel visualization with 2D canvas rendering
- Mode tabs to switch between activation and weight inspection
- Per-layer texture storage (separate from ping-pong compute buffers)
- Debug shader modes (UV gradient, raw packed data, unpacked f16)
- Comprehensive logging for diagnostics
Architecture:
- Persistent layerTextures[] for visualization (one per layer)
- Separate computeTextures[] for CNN ping-pong
- copyTextureToTexture after each layer pass
- Canvas recreation on mode switch (2D vs WebGPU context)
- Weight parsing with f16 unpacking and min/max calculation
Known Issues:
- Layer activations show black (texture data empty despite copies)
- Weight kernels not displaying (2D canvas renders not visible)
- Debug mode 10 (UV gradient) works, confirming texture access OK
- Root cause: likely GPU command ordering or texture usage flags
Documentation:
- Added doc/CNN_V2_WEB_TOOL.md with full status, architecture, debug steps
- Detailed issue tracking with investigation notes and next steps
Status: Infrastructure complete, debugging data flow issues.
handoff(Claude): Layer viz black due to empty textures despite copyTextureToTexture.
Weight viz black despite correct canvas setup. Both issues need GPU pipeline audit.
|
|
Implements single-file HTML tool for rapid CNN weight validation:
Features:
- Drag-drop PNG images (whole window) and .bin weights
- Real-time WebGPU compute pipeline (static features + N layers)
- Data-driven execution (reads layer count from binary)
- View modes: CNN output / Original / Diff (×10)
- Blend slider (0.0-1.0) for effect strength
- Console log with timestamps
- Keyboard shortcuts: SPACE (original), D (diff)
Architecture:
- Embedded WGSL shaders (static + compute + display)
- Binary parser for .bin format (header + layer info + f16 weights)
- Persistent textures for view mode switching
- Absolute weight offset calculation (header + layer info skip)
Implementation notes:
- Weight offsets in binary are relative to weights section
- JavaScript precalculates absolute offsets: headerOffsetU32 * 2 + offset
- Matches C++ shader behavior (simple get_weight without offset param)
- Ping-pong textures for multi-layer processing
TODO:
- Side panel: .bin metadata, weight statistics, validation
- Layer inspection: R/G/B/A plane split, intermediate outputs
- Activation heatmaps for debugging
Files:
- tools/cnn_v2_test/index.html (24 KB, 730 lines)
- tools/cnn_v2_test/README.md (usage guide, troubleshooting)
handoff(Claude): CNN v2 HTML testing tool complete, documented TODOs for future enhancements
|
|
Consolidate repeated timeline/resource analysis code to improve
maintainability and reduce duplication.
seq_compiler.cc changes:
- Extract timeline analysis (max time, sorting) into analyze_timeline()
- Extract sequence end calculation into get_sequence_end()
- Reduces ~45 lines of duplicate code
tracker_compiler.cc changes:
- Extract resource analysis into ResourceAnalysis struct
- Consolidate sample counting and recommendations
- Reduces ~75 lines of duplicate code
Both tools verified with successful builds.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Extract repeated logic into focused helper functions:
- ParseProceduralParams() - eliminates 2× duplicate parameter parsing
- ParseProceduralFunction() - unifies PROC() and PROC_GPU() handling
- ProcessMeshFile() - encapsulates 164-line mesh processing
- ProcessImageFile() - encapsulates image loading
Reduces 598→568 lines (-5%), improves readability, preserves behavior.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
EOF
|
|
Updated docs to reflect February 13, 2026 changes:
- doc/FILE_HIERARCHY_CLEANUP_2026-02-13.md: Complete summary
- doc/WORKSPACE_SYSTEM.md: Current structure, workspace.cfg format
- doc/SHADER_REUSE_INVESTIGATION.md: Implementation status
- PROJECT_CONTEXT.md: Workspace and shader system updates
Key changes documented:
- src/app/ application structure
- workspaces/{music,weights,obj,shaders}/ layout
- common/shaders/ shared shader system
- Eliminated 36 duplicate shaders
- Asset packer path normalization
handoff(Claude): Documentation updated for hierarchy cleanup
|
|
Eliminates 36 duplicate shader files across workspaces.
Structure:
- common/shaders/{math,render,compute}/ - Shared utilities (20 files)
- workspaces/*/shaders/ - Workspace-specific only
Changes:
- Created common/shaders/ with math, render, compute subdirectories
- Moved 20 common shaders from workspaces to common/
- Removed duplicates from test workspace
- Updated assets.txt: ../../common/shaders/ references
- Enhanced asset_packer.cc: filesystem path normalization for ../ resolution
Implementation: Option 1 from SHADER_REUSE_INVESTIGATION.md
- Single source of truth for common code
- Workspace references via relative paths
- Path normalization in asset packer
handoff(Claude): Common shader directory implemented
|
|
Analyzed 36 duplicate common shaders across workspaces.
Documented 5 approaches with tradeoffs:
1. Shared common/ directory
2. Symbolic links
3. Build-time sync
4. Asset system extension
5. Status quo + documentation
See doc/SHADER_REUSE_INVESTIGATION.md for full analysis.
handoff(Claude): Shader reuse investigation complete
|
|
Updated asset_dirs and shader_dirs to reflect reorganization:
- Removed legacy assets/ and ../common/ references
- Added new directories: music/, weights/, obj/
- Simplified shader_dirs to just shaders/
handoff(Claude): workspace.cfg files updated
|
|
Each workspace now has a weights/ directory to store binary weight files
from CNN training (e.g., cnn_v2_weights.bin).
Changes:
- Created workspaces/{main,test}/weights/
- Moved cnn_v2_weights.bin → workspaces/main/weights/
- Updated assets.txt reference
- Updated training scripts and export tool paths
handoff(Claude): Workspace weights/ directories added
|
|
Workspace structure now:
- workspaces/{main,test}/obj/ (3D models)
- workspaces/{main,test}/shaders/ (WGSL shaders)
- workspaces/{main,test}/music/ (audio samples)
Changes:
- Moved workspaces/*/assets/music/ → workspaces/*/music/
- Updated assets.txt paths (assets/music/ → music/)
- Moved test_demo.{seq,track} to tools/
- Moved assets/originals/ → tools/originals/
- Removed assets/common/ (legacy, duplicated in workspaces)
- Removed assets/final/ (legacy, superseded by workspaces)
- Updated hot-reload paths in main.cc
- Updated CMake references for test_demo and validation
- Updated gen_spectrograms.sh paths
handoff(Claude): Workspace reorganization complete
|
|
Moved main.cc, stub_main.cc, and test_demo.cc from src/ to src/app/
for better organization. Updated cmake/DemoExecutables.cmake paths.
handoff(Claude): App files reorganized into src/app/ directory
|
|
- Add --cnn-version <1|2> flag to select between CNN v1 and v2
- Implement beat_phase modulation for dynamic blend in both CNN effects
- Fix CNN v2 per-layer uniform buffer sharing (each layer needs own buffer)
- Fix CNN v2 y-axis orientation to match render pass convention
- Add Scene1Effect as base visual layer to test_demo timeline
- Reorganize CNN v2 shaders into cnn_v2/ subdirectory
- Update asset paths and documentation for new shader organization
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
|
|
|
|
FATAL_CHECK triggers when condition is TRUE (error case).
Inverted equality checks: magic/version == correct_value
would fatal when weights were valid.
Changed to != checks to fail on invalid data.
|
|
Use container's getBoundingClientRect instead of timeline's. Timeline can
scroll off-screen with negative left values. Container stays visible and
provides reliable viewport coordinates. Fixes double-click seek and drag.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Read actual canvas offset from style.left instead of assuming scrollLeft.
Canvas is positioned with negative left offset, so we subtract it to get
correct beat position.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Use helper functions (beatsToTime, timeToBeats) consistently in click
handlers. Fixes red cursor jumping to wrong position during seek.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Factorize common patterns: POST_PROCESS_EFFECTS constant, helper functions
(beatsToTime, timeToBeats, beatRange, detectConflicts). Reduce verbosity
with modern JS features (nullish coalescing, optional chaining, Object.assign).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Detects same-priority post-process effects (within and cross-sequence).
CPU load bar (10px, pastel colors) shows conflicts. Matches seq_compiler.cc
logic: warns when 2+ post-process effects share priority, regardless of
time overlap.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Features:
- CPU load bar: Color-coded (green→yellow→red) effect density visualization
- Overlays under waveform to save space, always visible
- Constant load (1.0) per active effect, 0.1 beat resolution
- Add Effect button: Create new effects in selected sequence
- Delete buttons in properties panel for quick access
- Timeline favicon (green bars SVG)
Fixes:
- Handle drag no longer jumps on mousedown (offset tracking)
- Sequence name input accepts numbers (explicit inputmode)
- Start Time label corrected (beats, not seconds)
Updated timeline.seq with beat-based timing adjustments.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Updated:
- HOWTO.md: Complete pipeline, storage buffer, --validate mode
- TODO.md: Mark CNN v2 complete, add QAT TODO
- PROJECT_CONTEXT.md: Update Effects status
- CNN_V2.md: Mark complete, add storage buffer notes
- train_cnn_v2_full.sh: Add --help message
All documentation now reflects:
- Storage buffer architecture
- Binary weight format
- Live training progress
- Validation-only mode
- 8-bit quantization TODO
|
|
Usage:
./train_cnn_v2_full.sh --validate [checkpoint.pth]
Skips training and weight export, uses existing weights.
Validates all input images with latest (or specified) checkpoint.
Example:
./train_cnn_v2_full.sh --validate checkpoints/checkpoint_epoch_50.pth
|
|
1. Loss printed at every epoch with \r (no scrolling)
2. Validation only on final epoch (not all checkpoints)
3. Process all input images (not just img_000.png)
Training output now shows live progress with single line update.
|
|
- Add QAT (quantization-aware training) notes
- Requires training with fake quantization
- Target: ~1.6 KB weights (vs 3.2 KB f16)
- Shader unpacking needs adaptation (4× u8 per u32)
|
|
- Export weights from epoch 70 checkpoint (3.2 KB binary)
- Disable shader template generation (use manual cnn_v2_compute.wgsl)
- Build successful with real weights
- Ready for integration testing
Storage buffer architecture complete:
- Dynamic layer count support
- ~0.3ms overhead vs constants (negligible)
- Single shader, flexible configuration
- Binary format: header + layer info + f16 weights
|
|
- Create bind groups per layer with ping-pong buffers
- Update layer params uniform per dispatch
- Execute all layers in sequence with proper input/output swapping
- Ready for weight export and end-to-end testing
|
|
- Add binary weight format (header + layer info + packed f16)
- New export_cnn_v2_weights.py for binary weight export
- Single cnn_v2_compute.wgsl shader with storage buffer
- Load weights in CNNv2Effect::load_weights()
- Create layer compute pipeline with 5 bindings
- Fast training config: 100 epochs, 3×3 kernels, 8→4→4 channels
Next: Complete bind group creation and multi-layer compute execution
|
|
Added note for future enhancement: mix salient + random samples.
Rationale:
- Salient point detection focuses on edges/corners
- Random samples improve generalization across entire image
- Prevents overfitting to only high-gradient regions
Proposed implementation:
- Default: 90% salient points, 10% random samples
- Configurable: --random-sample-percent parameter
- Example: 64 patches = 58 salient + 6 random
Location: train_cnn_v2.py
- TODO in _detect_salient_points() method
- TODO in argument parser
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Salient point detection on original images with patch extraction.
Changes:
- Added PatchDataset class (harris/fast/shi-tomasi/gradient detectors)
- Detects salient points on ORIGINAL images (no resize)
- Extracts 32×32 patches around salient points
- Default: 64 patches/image, harris detector
- Batch size: 16 (512 patches per batch)
Training modes:
1. Patch-based (default): --patch-size 32 --patches-per-image 64 --detector harris
2. Full-image (option): --full-image --image-size 256
Benefits:
- Focuses training on interesting regions
- Handles variable image sizes naturally
- Matches CNN v1 workflow
- Better convergence with limited data (8 images → 512 patches)
Script updated:
- train_cnn_v2_full.sh: Patch-based by default
- Configuration exposed for easy switching
Example:
./scripts/train_cnn_v2_full.sh # Patch-based
# Edit script: uncomment FULL_IMAGE for resize mode
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Training script now resizes all images to fixed size before batching.
Issue: RuntimeError when batching variable-sized images
- Images had different dimensions (376x626 vs 344x361)
- PyTorch DataLoader requires uniform tensor sizes for batching
Solution:
- Add --image-size parameter (default: 256)
- Resize all images to target_size using LANCZOS interpolation
- Preserves aspect ratio independent training
Changes:
- train_cnn_v2.py: ImagePairDataset now resizes to fixed dimensions
- train_cnn_v2_full.sh: Added IMAGE_SIZE=256 configuration
Tested: 8 image pairs, variable sizes → uniform 256×256 batches
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Updated project status to reflect CNN v2 implementation completion.
Changes:
- TODO.md: Marked Task #85 as [READY FOR TRAINING]
- All 5 phases complete
- Infrastructure ready for model training and integration
- PROJECT_CONTEXT.md: Updated Effects section
- Added CNN v2 parametric static features reference
- Added CNN_V2.md to technical documentation list
Status summary:
✅ Phase 1: Static features shader (8×f16 packed, 3 mip levels)
✅ Phase 2: C++ effect class (CNNv2Effect)
✅ Phase 3: Training pipeline (train_cnn_v2.py, export)
✅ Phase 4: Validation tooling (validate_cnn_v2.sh)
✅ Phase 5: Render pipeline (compute passes, bind groups)
Next steps: Train model, generate layer shaders, demo integration
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Complete multi-pass compute execution for CNNv2Effect.
Implementation:
- Layer texture creation (ping-pong buffers for intermediate results)
- Static features compute pipeline with bind group layout
- Bind group creation with 5 bindings (input mips + depth + output)
- compute() override for multi-pass execution
- Static features pass with proper workgroup dispatch
Architecture:
- Static features: 8×f16 packed as 4×u32 (RGBD + UV + sin + bias)
- Layer buffers: 2×RGBA32Uint textures (8 channels f16 each)
- Input mips: 3 levels (0, 1, 2) for multi-scale features
- Workgroup size: 8×8 threads
Status:
- Static features compute pass functional
- Layer pipeline infrastructure ready
- All 36/36 tests passing
Next: Layer shader integration, multi-layer execution
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Infrastructure for enhanced CNN post-processing with 7D feature input.
Phase 1: Shaders
- Static features compute (RGBD + UV + sin10_x + bias → 8×f16)
- Layer template (convolution skeleton, packing/unpacking)
- 3 mip level support for multi-scale features
Phase 2: C++ Effect
- CNNv2Effect class (multi-pass architecture)
- Texture management (static features, layer buffers)
- Build integration (CMakeLists, assets, tests)
Phase 3: Training Pipeline
- train_cnn_v2.py: PyTorch model with static feature concatenation
- export_cnn_v2_shader.py: f32→f16 quantization, WGSL generation
- Configurable architecture (kernels, channels)
Phase 4: Validation
- validate_cnn_v2.sh: End-to-end pipeline
- Checkpoint → shaders → build → test images
Tests: 36/36 passing
Next: Complete render pipeline implementation (bind groups, multi-pass)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Design document for CNN v2 with enhanced feature inputs:
- 7D static features: RGBD + UV + sin encoding + bias
- Per-layer configurable kernels (1×1, 3×3, 5×5)
- Float16 weight storage (~6.4 KB vs 3.2 KB)
- Multi-pass architecture with static feature compute
Implementation plan:
1. Static features compute shader (RGBD + UV + sin + bias)
2. C++ effect class (CNNv2Effect)
3. Training pipeline (train_cnn_v2.py, export_cnn_v2_shader.py)
4. Validation tooling (validate_cnn_v2.sh)
Files:
- doc/CNN_V2.md: Complete technical design (architecture, training, export)
- scripts/validate_cnn_v2.sh: End-to-end validation script
- TODO.md: Add CNN v2 as Priority 2 task
- doc/HOWTO.md: Add CNN v2 validation usage
Target: <10 KB for 64k demo constraint
handoff(Claude): CNN v2 design ready for implementation
|
|
Fixes:
- Sequence dragging with scroll offset
- Double-click collapse/expand (DOM recreation issue)
- Collapsed sequence dragging (removed stopPropagation)
Features:
- Quantize dropdown (Off, 1/32→1 beat) replaces snap-to-beat checkbox
- Works in both beat and second display modes
- Hotkeys: 0=Off, 1=1beat, 2=1/2, 3=1/4, 4=1/8, 5=1/16, 6=1/32
- Separate "Show Beats" toggle for display vs snap behavior
Technical:
- Track dragMoved state to avoid unnecessary DOM recreation
- Preserve dblclick detection by deferring renderTimeline()
- Quantization applies to sequences and effects uniformly
handoff(Claude): timeline editor quantize + drag fixes complete
|
|
Remove test snippets (a/b) that belong in test workspace only.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
|
|
|
|
§
|
|
Reduced file size from 1899 to 823 lines (57% reduction) while improving
maintainability and user experience.
CSS improvements:
- Added CSS variables for colors, spacing, and border radius
- Consolidated duplicate button/input/label styles
- Added missing .zoom-controls class definition
- Reduced CSS from ~510 to ~100 lines
JavaScript refactoring:
- Centralized global state into single `state` object
- Created `dom` object to cache all element references
- Removed all inline event handlers (onclick, oninput)
- Replaced with proper addEventListener pattern
- Fixed missing playbackControls reference (bug fix)
- Reduced JS from ~1320 to ~660 lines
UX improvements:
- Playback indicators (red bars) now always visible, start at 0s
- During playback, highlight current sequence green (no expand/collapse reflow)
- Smooth scrolling follows playback indicator (10% interpolation at 40% viewport)
- Moved "Show Beats" checkbox inline with BPM controls
- Fixed playback controls layout (time left of button, proper gap/alignment)
- Error messages now logged to console as well as UI
No functional regressions - all features work identically.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Add red bar playback indicator on waveform (synced with timeline)
- Fix playback continuation after double-click seek (async/await)
- Improve stopPlayback() to preserve jump positions
- Add error handling to startPlayback()
- Update waveform click-to-seek to match double-click behavior
- Sync waveform indicator scroll with timeline
- Display time in both seconds and beats on seek
- Update documentation with new features
handoff(Claude): Timeline editor now has dual playback indicators and seamless seeking.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Update test status: 34/36 (94%) → 36/36 (100%)
- Add timeline editor to PROJECT_CONTEXT.md
- Fix broken BEAT_TIMING_SUMMARY.md references → doc/BEAT_TIMING.md
- Consolidate duplicate entries in README.md
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
|
|
- Add render/scene_query_mode to known placeholders in VerifyIncludes
- Remove warning for duplicate auxiliary texture registration (valid for multiple CNNEffect stacks)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
- Audio playback controls (play/pause, spacebar shortcut)
- Red playback indicator with auto-scroll (middle third viewport)
- Auto-expand active sequence during playback, collapse previous
- Click waveform to seek
- Sticky header: waveform + timeline ticks stay at top
- Sequences confined to separate scrollable container below header
- Document known bugs: zoom sync, positioning, reflow issues
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Timeline editor now stores all times internally as beats (not seconds),
aligning with the project's beat-based timing system. Added BPM slider
for tempo control. Serializes to beats (default format) and displays
beats primarily with seconds in tooltips.
Changes:
- parseTime() returns beats (converts 's' suffix to beats)
- serializeSeqFile() outputs beats (bare numbers)
- Timeline markers show beats (4-beat/bar increments)
- BPM slider (60-200) for tempo editing
- Snap-to-beat rounds to nearest beat
- Audio waveform aligned to beats
- showBeats enabled by default
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|