| Age | Commit message (Collapse) | Author |
|
C++ GBufViewEffect: renders all 20 feature channels from feat_tex0/feat_tex1
in a 4×5 tiled grid. Custom BGL with WGPUTextureSampleType_Uint; bind group
rebuilt per frame via wgpuRenderPipelineGetBindGroupLayout.
Web tool: "Load sample directory" button — webkitdirectory picker, FULL_PACK_SHADER
compute (matches gbuf_pack.wgsl packing), runFromFeat() skips photo-pack step,
computePSNR() readback + comparison vs target.png side-by-side.
36/36 tests pass. Docs updated: HOWTO.md §9, README, PROJECT_CONTEXT, TODO,
COMPLETED.
handoff(Gemini): CNN v3 Phase 7 done. Next: run train_cnn_v3.py (see HOWTO §3).
|
|
- Add test_cnn_v3_parity.cc: zero_weights + random_weights tests
- Add gen_test_vectors.py: PyTorch reference implementation for enc0/enc1/bn/dec1/dec0
- Add test_vectors.h: generated C header with enc0, dec1, output expected values
- Fix declare_nodes(): intermediate textures at fractional resolutions (W/2, W/4)
using new NodeRegistry::default_width()/default_height() getters
- Add layer-by-layer readback (enc0, dec1) for regression coverage
- Final parity: enc0 max_err=1.95e-3, dec1 max_err=1.95e-3, out max_err=4.88e-4
handoff(Claude): CNN v3 parity done. Next: train_cnn_v3.py (FiLM MLP training).
|
|
- TODO.md: mark Phase 4 done, add FiLM MLP training details (blocked on
train_cnn_v3.py), clarify what 'real' set_film_params() requires
- COMPLETED.md: archive Phase 4 with alignment fix note (vec3u→64/96 bytes)
handoff(Gemini): next up CNN v3 Phase 5 (parity validation) or train_cnn_v3.py
|
|
- Archive WORKSPACE_SYSTEM.md (completed); replace with 36-line operational ref
- Archive SHADER_REUSE_INVESTIGATION.md (implemented Feb 2026)
- Archive GPU_PROCEDURAL_PHASE4.md (completed feature)
- Archive GEOM_BUFFER.md (ideation only, never implemented)
- Archive SPECTRAL_BRUSH_EDITOR.md (v1 DCT approach, superseded by MQ v2)
- Update CLAUDE.md Tier 3 refs; point Audio to SPECTRAL_BRUSH_2.md
- Update TODO.md Task #5 design link to SPECTRAL_BRUSH_2.md
- Update COMPLETED.md archive index
handoff(Claude): doc cleanup done, 30 active docs (was 34), -1300 lines
|
|
|
|
project_init.sh now checks/installs both wgpu-native and glfw via brew.
HOWTO.md documents the macOS prerequisites before the build steps.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet
- sample_ntsc_signal() hook decouples input format from processing
- ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase)
- ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output
- Add NtscYiq WgslEffect thin wrapper; register both in tests
handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
rotating_cube_effect.cc was bypassing ShaderComposer, causing #include
directives in rotating_cube.wgsl to fail at runtime.
handoff(Claude): ShaderComposer rule documented and enforced in rotating_cube.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Add rule to CODING_STYLE.md and apply to ntsc.wgsl.
handoff(Claude): rule added, ntsc.wgsl patched; scratch_lines and color_c64 already compliant.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
handoff(Gemini): SEQUENCE.md updated - removed obsolete v1 migration
notes, updated effect count 7→12, added absolute-time note, removed
completed TODO items.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
The fullscreen post-process VS uses Y-up UVs (uv.y=0 = bottom), so
textureSample() Y-flips any rasterized offscreen texture. SDF effects
author their content Y-down and look correct after the flip. Rasterized
effects (RotatingCube, Hybrid3D) must pre-flip their geometry:
- mat4::perspective(): m[5] = -t (negated Y scale)
- Pipelines with cullMode=Back: frontFace = WGPUFrontFace_CW (Y-flip
reverses winding, so CW becomes the visible face)
- Remove incorrect transposes from GlobalUniforms::make(),
ObjectData::make(), and Uniforms::make() — mini_math is column-major,
no transpose needed for GPU upload
- Document the convention in doc/3D.md under "Rasterized 3D and the
Y-flip rule"
handoff(Gemini): Y-flip rule now documented; all rasterized 3D pipelines
must follow it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
WGSL shaders now join SPEC/MP3 in being loaded from disk in development
mode, enabling shader iteration without rebuild.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
This commit introduces a dual-mode asset loading system to enhance developer workflow and optimize release builds.
Key changes include:
- **Dual-Mode Asset Loading:** Assets are now loaded from disk during development (when is OFF) for faster iteration, particularly for heavy assets like and files. For release builds ( ON), all assets are embedded directly into the binary, ensuring a single, self-contained executable.
- **Explicit Asset Typing:** Replaced generic asset type with specific types (, , , , ) in and the enum in for clearer categorization and more robust processing.
- **Build System Integration:** Modified to pass a flag to in development builds.
- **Asset Packer Updates:** now generates file paths for disk-loaded assets and embeds data for others based on the build mode.
- **Asset Manager Enhancements:** includes new logic in for loading and caching disk-based assets and updates to for proper memory deallocation.
- **Documentation:** Updated to reflect the new asset nomenclature and dual-mode loading strategy.
- **Project Rules:** Added a concise rule to mandating top-level documentation updates for medium/large sub-system changes.
handoff(Gemini): Implemented dual-mode asset loading and updated documentation.
|
|
conventions
- Add textureSampleYUp() helper to fullscreen_uv_vs.wgsl to correct
y-flip when sampling WebGPU textures with y-up UV coordinates
- Use textureSampleYUp() in passthrough, gaussian_blur, combined_postprocess
- Fix skybox.wgsl: remove erroneous (1.0 - uv.y) flip (double-flip bug)
- Document world/view/screen conventions in doc/3D.md, camera_common.wgsl,
and fullscreen_uv_vs.wgsl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
Replace boilerplate .h/.cc pairs for simple single-pass effects with a
generic WgslEffect base class that takes a shader string + optional
WgslEffectParams (binding 3). Port Flash, Passthrough, Heptagon, Scratch,
and GaussianBlur to thin header-only wrappers — no .cc files, no CMake
entries needed. Removes 5 .cc files (-243 lines).
Update EFFECT_WORKFLOW.md, CONTRIBUTING.md, and AI_RULES.md to document
the WgslEffect (Path A) vs full class (Path B) workflow. Doc cleanup:
fix stale GaussianBlurParams/PostProcessEffect references and test counts.
handoff(Claude): WgslEffect landed; 5 effects ported; docs updated.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
snippet
- src/shaders/render/scratch_lines.wgsl: reusable WGSL snippet registered as
"render/scratch_lines"; call scratch_lines(uv, resolution, time)->f32 from
any effect. Uses hash_1f from math/noise; 8 lines/frame, ~24fps flicker.
- src/effects/scratch.{wgsl,h,cc}: thin Scratch effect wrapping the snippet.
- Applied to "intro" and "rotating_cube" sequences as the final step.
- 35/35 tests passing.
handoff(Gemini): Scratch effect added. render/scratch_lines snippet is reusable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- Remove erroneous Hann synthesis window from synth.cc (g_hann * tmp[j]).
Hann analysis at 50% overlap satisfies w[n]+w[n+H]=1, so rectangular
synthesis gives perfect reconstruction; applying Hann twice was wrong.
- Extract ola_encode()/ola_decode()/ola_num_frames() into src/audio/ola.h+cc.
spectool and test_wav_roundtrip now use the shared functions.
synth.cc lazy-decode path stays inlined (see TODO for future refactor).
- Drop dead <atomic> include and g_hann array from synth.cc.
- Drop dead window.h include from spectool.cc.
- Update PROJECT_CONTEXT.md, COMPLETED.md, TODO.md to reflect correct
analysis-only Hann window and new ola.h API.
handoff(Gemini): OLA synthesis bug fixed + ola.h factorized. synth.cc
lazy-decode still inline (TODO item added). 34/35 tests pass; WavDumpBackendTest
failure is pre-existing and unrelated.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
specplay was removed from the build but source/docs remained.
Delete tools/specplay.cc, tools/specplay_README.md, and remove
specplay sections from TOOLS_REFERENCE.md and BACKLOG.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- spectool --wav <input.spec> <output.wav>: decodes .spec to mono 16-bit
WAV at 32 kHz using IDCT-OLA synthesis (no synthesis window).
The analysis Hann window at 50% overlap satisfies w[n]+w[n+H]=1,
so the synthesis window must be rectangular for perfect reconstruction.
- Add imdct_512 / imdct_fft to audio lib (fft.cc, fft.h, idct.cc, dct.h)
for future MDCT-based synthesis.
- test_wav_roundtrip: in-process OLA analyze+decode SNR test (≥30 dB).
Currently measures 53 dB on a 440 Hz sine.
- Fix stale test_spectool.cc: version assertion updated from 1 to
SPEC_VERSION_V2_OLA (was always wrong since OLA fix landed).
- Docs: TOOLS_REFERENCE.md removes dead specview, documents --wav /
--normalize / test_gen. HOWTO.md adds decode section. TRACKER.md
notes spec v2 OLA format and decode command.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Two bugs kept the v2 OLA path permanently disabled:
1. SpectrogramResourceManager::load_asset() never set spec.version from
SpecHeader::version — all .spec assets loaded with version=0, so
ola_mode was always false in the voice.
2. spectool analyze_audio() used non-overlapping chunks (stride=DCT_SIZE),
hamming_window_512, and hardcoded header.version=1 — OLA analysis was
never implemented in the encoder.
Fixes: propagate header->version in load_asset(); switch spectool to
OLA_HOP_SIZE stride, hann_window_512, and SPEC_VERSION_V2_OLA.
Regenerated all .spec files.
handoff(Gemini): OLA enc/dec chain now correct end-to-end. .spec files
are v2 (50% overlap, Hann). No API changes; 33/34 tests pass
(WavDumpBackendTest pre-existing failure unrelated).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
enum, add MP3 type
- Add AssetType enum {STATIC, PROC, PROC_GPU, MP3} to AssetRecord
- Add GetAssetType() API to asset_manager.h/cc
- asset_packer: parse 'MP3' compression keyword in assets.txt
- tracker: remove magic-byte is_mp3_asset(); use GetAssetType() instead
- assets.txt: NEVER_MP3 now uses 'MP3' compression type
- doc/ASSET_SYSTEM.md: rewritten to document new types and API
handoff(Gemini): AssetType enum landed; MP3 detection is now explicit via asset metadata.
|
|
spectool was missing from DemoTools.cmake; scripts/gen_spectrograms.sh
could not find build/spectool. Document the regeneration workflow in HOWTO.md.
handoff(Claude): spectool now builds with -DDEMO_BUILD_TOOLS=ON
|
|
- PROJECT_CONTEXT: audio section reflects OLA-IDCT (Hann, 50% overlap);
test count 35->34; Next Up notes .spec regen needed
- TODO: remove stale MP3 sub-task (done), trim test TODOs, add .spec
regen as Priority 3, update test count to 34/34
- COMPLETED: archive OLA-IDCT task with implementation summary
|
|
Detect MP3 blobs by magic bytes in tracker_init(), decode to spectrogram
(hamming window + FDCT) using new mp3_decode(), and register with synth
exactly like .spec assets. STRIP_ALL builds guard with FATAL_CHECK.
handoff(Gemini): MP3 assets now usable in music.track with SAMPLE ASSET_*
syntax; see doc/TRACKER.md for usage. No synth/compiler/packer changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
src/effects/
Move 13 effect-specific shaders from workspaces/main/shaders/ to src/effects/
so each effect's .h, .cc, and .wgsl are together. Update assets.txt paths in
both main and test workspaces. Update EFFECT_WORKFLOW.md to reflect new location.
Shared/reusable snippets remain in src/shaders/.
handoff(Gemini): shaders moved; src/effects/ now has .h, .cc, and .wgsl per effect.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Fix assets.txt path: shaders/xxx.wgsl (not ../../src/shaders/)
- Fix shader output path to workspaces/main/shaders/
- Step 5: reference cmake/DemoSourceLists.cmake COMMON_GPU_EFFECTS (not CMakeLists.txt GPU_SOURCES)
- Add step for test_demo_effects.cc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Relocates shared WGSL shaders under src/ where all source code lives,
eliminating the top-level common/ directory.
- Update asset references in workspaces/main/assets.txt and workspaces/test/assets.txt
- Update docs: PROJECT_CONTEXT.md, ARCHITECTURE.md, WORKSPACE_SYSTEM.md, SHADER_REUSE_INVESTIGATION.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Delete unused SDFEffect base class (src/gpu/sdf_effect.h)
- Delete sdf_test.wgsl and SHADER_SDF_TEST from assets.txt
- Rewrite SDF_EFFECT_GUIDE.md based on Scene1 canonical pattern:
correct bindings (2/3), vec4f syntax, UniformsSequenceParams
- Fix missing newline at end of gpu.h
handoff(Claude): SDF cleanup done, guide updated to match current Effect API
|
|
- build_win.sh: platform-aware MinGW DLL search (macOS Homebrew vs Linux apt paths)
- HOWTO.md: new WSL section covering native Linux build and Windows cross-compile
- PROJECT_CONTEXT.md: note WSL support in Build status
handoff(Gemini): WSL native + cross-compile build support added.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Replaces all instances of `vec<f32>` with the more concise `vec*f` alias (e.g., `vec3f`) across all `.wgsl` shaders. This improves readability and aligns with common graphics programming conventions.
Also adds a new coding style rule to `doc/CODING_STYLE.md` to enforce this standard going forward.
Finally, this commit fixes a build error in `test_effect_base.cc` by replacing a call to the non-existent `wgpuDeviceTick` with `wgpuDevicePoll`, which resolves the test failure.
|
|
Factorizes the screen coordinate calculation from scene1.wgsl into a reusable getScreenCoord function in common/shaders/math/common_utils.wgsl.
This improves code reuse and simplifies fragment shaders.
|
|
- Add Scene1 effect: raymarching cube+sphere+ground (reflections, shadows)
- Fix scene1.wgsl: binding 0→2, CommonUniforms→UniformsSequenceParams
- Replace Heptagon+Placeholder stub in heptagon_scene with Scene1
- Fix seq_compiler.py: emit seq.start_time+effect.start/end (absolute times)
so dispatch_render active check works correctly for all sequences
Bug: effects in sequences starting after t=0 were never active because
local times (e.g. 0-8) never satisfied params.time<end for absolute time 20+.
34/34 tests passing.
handoff(Gemini): seq_compiler now emits absolute effect times. All existing
sequences affected — verify visual output across the full timeline.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- utils.js (new): evalBezier (robust), getCanvasCoords, buildBandPoints
- app.js (new): extract ~450-line inline script from index.html
- editor.js: generalize _makeJogSlider(inp, options) with onUpdate cb,
eliminate 50-line inline resonator jog duplication, use getCanvasCoords
- mq_extract.js: extract findBestPeak(), replace two identical loop bodies
- viewer.js: remove duplicate evalBezier, use getCanvasCoords/buildBandPoints
- mq_synth.js: remove duplicate evalBezier
- index.html: inline script removed, load order: utils→fft→extract→synth→viewer→editor→app
handoff(Claude): mq_editor refactor complete — no logic changes, browser-ready.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Implement Predictive Kinematic Tracking to improve partial tracking during fast glissandos and vibrato.
- Add Peak Prominence Pruning to filter out insignificant local maxima.
- Replace heuristic Bezier fitting with a Least-Squares solver for more accurate trajectories.
- Update UI to include a Prominence parameter input.
- Archive MQ_EXTRACTION_IMPROVEMENTS.md design document.
handoff(Gemini): implemented MQ extraction improvements (kinematic tracking, prominence pruning, least-squares bezier)
|
|
JS synthesizer with replica oscillator bank and STFT cache complete.
Ready for Phase 3 (editing UI).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Phase 2 - JS Synthesizer:
- Created mq_synth.js with replica oscillator bank
- Bezier curve evaluation (cubic De Casteljau algorithm)
- Replica synthesis: frequency spread, amplitude decay, phase jitter
- PCM buffer generation from extracted MQ partials
- Normalization to prevent clipping
- Key '1' plays synthesized audio, key '2' plays original
- Playback comparison with animated playhead
STFT Cache Optimization:
- Created STFTCache class in fft.js for pre-computed windowed FFT frames
- Clean interface: getFFT(t), getMagnitudeDB(t, freq), setHopSize()
- Pre-computes all frames on WAV load (eliminates redundant FFT calls)
- Dynamic cache update when hop size changes
- Shared across spectrogram, tooltip, and mini-spectrum viewer
- Significant performance improvement
Mini-Spectrum Viewer:
- Bottom-right overlay (200x100) matching spectral_editor style
- Real-time FFT display at playhead or mouse position
- 100-bar visualization with cyan-to-yellow gradient
- Updates during playback or mouse hover
Files:
- tools/mq_editor/mq_synth.js (new)
- tools/mq_editor/fft.js (STFTCache class added)
- tools/mq_editor/index.html (synthesis playback, cache integration)
- tools/mq_editor/viewer.js (cache-based rendering, spectrum viewer)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Completed MQ extraction and visualization with improved tracking.
Ready for Phase 2 (JS synthesizer).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Phase 1 deliverables complete:
- MQ extraction with improved tracking
- Spectrogram visualization with zoom/scroll
- Original WAV playback with playhead
- Ready for Phase 2 (JS synthesizer)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Implement McAulay-Quatieri sinusoidal analysis tool for audio compression.
New files:
- doc/SPECTRAL_BRUSH_2.md: Complete design doc (MQ algorithm, data format, synthesis, roadmap)
- tools/mq_editor/index.html: Web UI (file loader, params, canvas)
- tools/mq_editor/fft.js: Radix-2 Cooley-Tukey FFT (from spectral_editor)
- tools/mq_editor/mq_extract.js: MQ algorithm (peak detection, tracking, bezier fitting)
- tools/mq_editor/viewer.js: Visualization (spectrogram, partials, zoom, axes)
- tools/mq_editor/README.md: Usage and implementation status
Features:
- Load WAV → extract sinusoidal partials → fit cubic bezier curves
- Time-frequency spectrogram with hot colormap (0-16 kHz)
- Horizontal zoom (mousewheel) around mouse position
- Axis ticks with labels (time: seconds, freq: Hz/kHz)
- Mouse tooltip showing time/frequency coordinates
- Real-time adjustable MQ parameters (FFT size, hop, threshold)
Algorithm:
- STFT with Hann windows (2048 FFT, 512 hop)
- Peak detection with parabolic interpolation
- Birth/death/continuation tracking (50 Hz tolerance)
- Cubic bezier fitting (4 control points per trajectory)
Next: Phase 2 (JS synthesizer for audio preview)
handoff(Claude): MQ editor Phase 1 complete. Ready for synthesis implementation.
|
|
Centralized uniforms_buffer_ initialization and updates to Effect base class:
- init_uniforms_buffer() now automatic in Effect::Effect()
- uniforms_buffer_.update() now automatic in dispatch_render()
- Removed redundant calls from all effect subclasses
- Updated effect.h comments to reflect automatic behavior
- Updated EFFECT_WORKFLOW.md templates
Benefits:
- 16 lines removed from effect implementations
- Consistent pattern enforced at compile time
- Reduced boilerplate for new effects
Tests: 34/34 passing
handoff(Claude): Effect base class now handles uniforms automatically
|
|
|
|
|
|
Move platform-specific type definitions to gpu.h and establish coding rule
that platform ifdefs must be confined to gpu/platform layers.
- gpu.h: add GpuTextureCopyInfo, GpuTextureDataLayout type aliases
- effect.cc: use GpuTextureCopyInfo instead of platform ifdefs
- texture_manager.cc: use type aliases and label_view() helper
- CODING_STYLE.md: add platform-specific code section with rule
Tests: 34/34 passing
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
|
|
Updates all documentation to reflect Sequence V2 format support:
Timeline Editor (tools/timeline_editor/):
- README.md: Updated features list, file format examples with NODE
declarations and arrow syntax, usage instructions for node editing
- ROADMAP.md: Added completed item 1.0 "Sequence V2 Format Support"
Core Documentation (doc/):
- HOWTO.md: Updated timeline example to use v2 arrow syntax, added
NODE/buffer chain features to visual editor description
- SEQUENCE.md: Marked timeline editor graph visualization as completed
All examples now show v2 format:
EFFECT + ClassName input1 input2 -> output1 output2 start end
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
Hybrid3D was calling Renderer3D::render() which creates its own command
encoder, bypassing the sequence system. Now uses renderer_.draw() with
the passed encoder.
Also adds texture blit support for RotatingCube compositing.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|