summaryrefslogtreecommitdiff
path: root/tools/seq_compiler.cc
AgeCommit message (Collapse)Author
21 hoursfix: Correct sequence end time calculation in Gantt chartsskal
Fixes bug where all sequences appeared to run until demo end time instead of their actual end times in Gantt chart visualizations. Issue: - Both ASCII and HTML Gantt generators initialized seq_end to max_time - This caused all sequences to display full demo duration - Example: SEQ@0s showed (0-36s) instead of actual (0-2s) Fix: - Initialize seq_end to seq_start instead of max_time - Calculate actual end from effects or explicit [end_time] - Sequences now show correct duration in visualizations Before: SEQ@0s [pri=0] (0-36s) # Wrong - shows full demo duration SEQ@2s [pri=0] (2-36s) # Wrong After: SEQ@0s [pri=0] (0-2s) # Correct - shows actual sequence duration SEQ@2s [pri=0] (2-5s) # Correct This makes Gantt charts much more accurate for understanding actual sequence overlap and timing relationships.
21 hoursfeat: Replace explicit priorities with stack-based priority modifiersskal
Simplifies effect priority management by using relative modifiers instead of explicit numbers, making timeline reordering much more practical. ## New Priority System Effects now use priority modifiers after EFFECT keyword: - `+` increment priority by 1 (or start at 0 if first) - `=` keep same priority as previous effect - `-` decrement priority (or start at -1 if first, for background) Old syntax: ``` EFFECT FlashEffect 0.0 0.5 0 EFFECT FadeEffect 0.1 0.3 1 EFFECT BgCube 0.2 3 -1 ``` New syntax: ``` EFFECT - BgCube 0.2 3 # Priority -1 (background) EFFECT + FlashEffect 0.0 0.5 # Priority 0 EFFECT + FadeEffect 0.1 0.3 # Priority 1 ``` ## Benefits ✓ Reordering effects no longer requires renumbering all priorities ✓ Priority relationships are explicit and relative ✓ File order matches render order (easier to understand) ✓ Same-priority effects clearly marked with `=` ✓ Background layers (-1) clearly marked with `-` ✓ Reduces errors when reorganizing timelines ## Implementation - Updated seq_compiler to parse +/=/- modifiers - Tracks current priority per sequence - First effect sets base priority (0 or -1) - Subsequent effects modify relative to previous - Generated C++ code unchanged (still uses integer priorities) ## Changes to demo.seq - All effects updated to use new syntax - Effects reordered by priority within sequences - Priority gaps removed (were likely unintentional) - Comments updated to reflect new system ## Documentation - Updated SEQUENCE.md with new syntax - Added examples showing +, =, - usage - Explained priority calculation rules This makes timeline authoring significantly more maintainable, especially when experimenting with different effect orderings during development.
21 hoursfeat: Add validation-only mode and HTML/SVG Gantt charts to seq_compilerskal
Enhances seq_compiler with flexible output modes and beautiful HTML visualization. ## New Features ### 1. Optional C++ Output (Validation Mode) - Output .cc file is now optional - Running without output performs validation only - Useful for checking .seq syntax before committing - Example: `./seq_compiler assets/demo.seq` ### 2. HTML/SVG Gantt Chart - New --gantt-html=<file.html> option - Generates interactive HTML page with SVG timeline - Much more readable than ASCII version - Features: * Color-coded sequences (blue) and effects (teal) * Invalid time ranges highlighted in red * Hover tooltips with full effect details * Time axis with 5-second markers * Dark theme matching IDE aesthetics * Vertical time markers for easy reading * Legend explaining visual elements ### 3. Flexible Command Line All output modes can be combined: ```bash # Validation only ./seq_compiler demo.seq # Code + ASCII Gantt ./seq_compiler demo.seq timeline.cc --gantt=chart.txt # Code + HTML Gantt ./seq_compiler demo.seq timeline.cc --gantt-html=chart.html # All outputs ./seq_compiler demo.seq timeline.cc --gantt=t.txt --gantt-html=t.html ``` ## HTML Gantt Advantages Over ASCII ✓ Precise pixel-perfect positioning ✓ Scalable vector graphics (zoom without quality loss) ✓ Color coding for priorities and validity ✓ Interactive hover tooltips ✓ Professional dark theme ✓ Much easier to read complex timelines ✓ Can be shared via browser or screenshots ## Implementation Details - Added ~190 lines for HTML/SVG generation - Dark theme (#1e1e1e background) matches IDE - SVG dynamically sized based on sequence count - Invalid time ranges rendered in red with warning symbol - Time scale automatically calculated from demo duration - Hover effects provide detailed information ## Use Cases - **Validation**: Quick syntax check without code generation - **ASCII Gantt**: Terminal-friendly, git-friendly text visualization - **HTML Gantt**: Beautiful presentation for design discussions - **Combined**: Full toolchain for timeline development The HTML output answers your question about SVG generation - it turned out to be straightforward (~190 lines) and provides significantly better visualization than ASCII art! ## Files Changed - tools/seq_compiler.cc: Added validation mode and HTML generation - assets/demo.seq: Updated documentation with new usage examples - .gitignore: Exclude generated timeline files Example HTML output: 17KB file with full interactive timeline visualization.
22 hoursfeat: Add Gantt chart visualization to seq_compilerskal
Implements ASCII Gantt chart generation for timeline debugging and visualization. ## New Feature - Added --gantt=<output.txt> flag to seq_compiler - Generates visual timeline showing sequences and effects on time axis - Displays sequence priority, effect priority, and time ranges - Shows explicit sequence end times with [END=...] markers - Detects and warns about invalid time ranges (end < start) ## Usage ```bash ./build/seq_compiler assets/demo.seq src/generated/timeline.cc --gantt=timeline.txt ``` ## Chart Format - Time axis in seconds with 5-second markers - Sequences shown as solid bars (█) - Effects shown as shaded bars (▓) with sequence background (·) - Labels include start/end times and priorities - Legend and documentation at chart end ## Example Output ``` Time (s): 0 5 10 15 20 25 30 |----|----|----|----|----|----|----| SEQ@0s [pri=0] ████████████████████████████████ (0-30s) FlashEffect [pri=4] ▓▓·························· (0-1s) HeptagonEffect [pri=0] ▓▓▓▓▓▓▓▓▓▓▓▓················ (0-10s) ``` ## Benefits - Visualize sequence overlap and layering - Identify timing conflicts and gaps - Verify effect priorities render in correct order - Debug invalid time ranges - Plan demo choreography visually ## Files Changed - tools/seq_compiler.cc: Added generate_gantt_chart() function - assets/demo.seq: Added usage documentation - .gitignore: Exclude generated demo_timeline.txt This debugging tool significantly improves timeline development workflow by providing visual feedback on sequence and effect timing.
23 hoursfeat: Optional sequence end times and comprehensive effect documentationskal
This milestone implements several key enhancements to the sequencing system and developer documentation: ## Optional Sequence End Times (New Feature) - Added support for explicit sequence termination via [time] syntax - Example: SEQUENCE 0 0 [30.0] forcefully ends all effects at 30 seconds - Updated seq_compiler.cc to parse optional [time] parameter with brackets - Added end_time_ field to Sequence class (default -1.0 = no explicit end) - Modified update_active_list() to check sequence end time and deactivate all effects when reached - Fully backward compatible - existing sequences work unchanged ## Comprehensive Effect Documentation (demo.seq) - Documented all effect constructor parameters (standard: device, queue, format) - Added runtime parameter documentation (time, beat, intensity, aspect_ratio) - Created detailed effect catalog with specific behaviors: * Scene effects: HeptagonEffect, ParticlesEffect, Hybrid3DEffect, FlashCubeEffect * Post-process effects: GaussianBlurEffect, SolarizeEffect, ChromaAberrationEffect, ThemeModulationEffect, FadeEffect, FlashEffect - Added examples section showing common usage patterns - Documented exact parameter behaviors (e.g., blur pulsates 0.5x-2.5x, flash triggers at intensity > 0.7, theme cycles every 8 seconds) ## Code Quality & Verification - Audited all hardcoded 1280x720 dimensions throughout codebase - Verified all shaders use uniforms.resolution and uniforms.aspect_ratio - Confirmed Effect::resize() properly updates width_/height_ members - No issues found - dimension handling is fully dynamic and robust ## Files Changed - tools/seq_compiler.cc: Parse [end_time], generate set_end_time() calls - src/gpu/effect.h: Added end_time_, set_end_time(), get_end_time() - src/gpu/effect.cc: Check sequence end time in update_active_list() - assets/demo.seq: Comprehensive syntax and effect documentation - Generated files updated (timeline.cc, assets_data.cc, music_data.cc) This work establishes a more flexible sequencing system and provides developers with clear documentation for authoring demo timelines. handoff(Claude): Optional sequence end times implemented, effect documentation complete, dimension handling verified. Ready for next phase of development.
5 daysChore: Apply clang-format to the codebaseskal
5 daysclang-formatskal
5 daysstyle: add vertical compression rules to clang-formatskal
- Enabled AllowShortFunctionsOnASingleLine: All - Enabled AllowShortBlocksOnASingleLine: Always - Enabled AllowShortIfStatementsOnASingleLine: Always - Enabled AllowShortLoopsOnASingleLine: true - Set MaxEmptyLinesToKeep: 1 - Applied formatting to all source files.
5 daysfix(gpu): resolve multiple WebGPU validation and runtime errorsskal
- Fixed 'Invalid sample count 0' and 'Invalid anisotropic clamp: 0' by ensuring explicit pipeline and sampler states. - Resolved WGSL parsing errors by replacing swizzle assignments in compute shaders. - Fixed 'Texture destroyed' error in render_frame by reordering command submission and resource presentation/release. - Added WGPU_DEPTH_SLICE_UNDEFINED for Windows compatibility and ensured consistent resolveTarget initialization. - Cleaned up PassthroughEffect bind group layout mismatch and redundant string helper definitions. - Verified all tests pass and applied consistent formatting.
5 daysfix seq-compiler help messageskal
5 daystools: Improve seq_compiler usage with example commandskal
Adds a copy-pasteable example line to the seq_compiler usage message when run without arguments.
5 daysfix: Cross-compilation and style complianceskal
Fixes seq_compiler build for Windows cross-compilation. Moves common WebGPU compatibility shims to gpu.h. Applies project-wide coding style via clang-format. Verified on both macOS (native) and Windows (cross-compile).
5 daysfeat: Implement Sequence Compiler for data-driven choreographyskal
Adds a 'seq_compiler' tool that converts a text-based timeline (assets/demo.seq) into a generated C++ file. This allows editing effect sequences and timing without modifying engine code. Replaces manual sequence creation with a generated 'LoadTimeline' function.