summaryrefslogtreecommitdiff
path: root/doc/COMPLETED.md
blob: 2e229cb07c77c3a4fdc3c7598688a0e861f2d3d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Completed Tasks

Completed task archive. See `doc/archive/` for detailed historical documents.

---

## Archive Index

**Analysis & Architecture:**
- ANALYSIS_VARIABLE_TEMPO.md, ANALYSIS_VARIABLE_TEMPO_V2.md
- AUDIO_LIFECYCLE_REFACTOR.md, AUDIO_TIMING_ARCHITECTURE.md
- BUILD_OPTIMIZATION_PROPOSAL.md, BUILD_OPTIMIZATION_PROPOSAL_V2.md
- PLATFORM_ANALYSIS.md, SHADER_PARAMETRIZATION_PLAN.md

**Handoffs & Summaries:**
- HANDOFF.md, HANDOFF_2026-02-04.md, HANDOFF_2026-02-08.md, HANDOFF_CLAUDE.md
- HANDOFF_SCENE_LOADER.md, HANDOFF_SPECTRAL_EDITOR.md
- PLATFORM_SIDE_QUEST_SUMMARY.md, TASKS_SUMMARY.md

**Debug Reports:**
- DEBUG_SHADOWS.md, PEAK_FIX_SUMMARY.md, PEAK_METER_DEBUG.md
- SAMPLE_ACCURATE_TIMING_FIX.md, VISUAL_DEBUG.md

**Testing & Reports:**
- FINAL_STRIP_REPORT.md, GPU_EFFECTS_TEST_ANALYSIS.md

**Planning Docs:**
- PHASE2_COMPRESSION.md, SPEC_EDITOR.md, STRIPPING.md

---

## March 2026

- [x] **NTSC post-process effect** — Fisheye distortion + NTSC scan-line simulation as `WgslEffect` thin wrapper. Files: `src/effects/ntsc.wgsl`, `ntsc_effect.h`. Tests: 35/35.

- [x] **Scratch post-process effect** — Film-scratch overlay effect. Scratch logic extracted into reusable snippet `src/shaders/render/scratch_lines.wgsl` (`#include "render/scratch_lines"`). Applied to first two timeline sequences. Tests: 35/35.

- [x] **OLA-IDCT Synthesis (click-free .spec decoding)** — Added v2 spectrogram format with Hann analysis window, rectangular synthesis, 50% overlap, hop=256. Extracted `ola_encode()`/`ola_decode()` into `src/audio/ola.h/.cc`. Fixed two bugs: `load_asset()` never propagated `version` field; `spectool` used non-overlapping frames. Fixed `synth.cc` incorrectly applying Hann synthesis window post-IDCT. All `.spec` files regenerated. Tests: 35/35.

---

## February 21, 2026

- [x] **getScreenCoord WGSL helper** — Added `getScreenCoord(p, resolution)` to `common/shaders/math/common_utils.wgsl`. Updated `scene1.wgsl` to use it.

---

## February 20, 2026

- [x] **Scene1Effect + seq_compiler timing bug fix** — Ported `scene1.wgsl` raymarching effect. Fixed critical `seq_compiler.py` bug: emitted local effect times instead of absolute times, so effects in sequences starting after t=0 were never active. Tests: 34/34.

---

## February 18, 2026

- [x] **MQ Spectral Editor improvements** — Predictive kinematic tracking (velocity), peak prominence pruning, least-squares Bezier fitting. Files: `mq_extract.js`, `index.html`, `README.md`.

- [x] **mq_editor refactoring** — Extracted `utils.js`, `app.js`; generalized jog sliders; eliminated duplicate `evalBezier`/`getCanvasCoords`/`buildBandPoints` across 5 files.

---

## February 17, 2026

- [x] **MQ Spectral Editor Phase 2: JS Synthesizer** — Replica oscillator bank, cubic Bezier evaluation, PCM buffer generation, Web Audio playback. STFT cache optimization. Files: `mq_synth.js`, `fft.js`.

- [x] **MQ Spectral Editor Phase 1: Extraction & Visualization** — FFT peak detection, trajectory tracking, cubic Bezier fitting, spectrogram visualization, pan/zoom, WAV playback. Files: `tools/mq_editor/`.

---

## February 16, 2026

- [x] **Sequence v2 Migration (Phase 4)** — Explicit DAG node routing, deleted v1 base classes, ported 7 effects, `seq_compiler_v2.py` with topological sort + ping-pong optimization. Tests: 35/35.

---

## February 14, 2026

- [x] **SDF Shapes Consolidation** — Merged `sdf_primitives.wgsl` into `math/sdf_shapes.wgsl`, added `sdBox2D`/`sdEllipse`, removed duplicates.

- [x] **Fullscreen VS Modularization** — Replaced inline `vs_main()` with `#include "render/fullscreen_vs"` in 8 shaders.

- [x] **CNN v2 Training Pipeline fixes** — Fixed checkpoint saving (always save final), stale checkpoint overwrite, `num_layers` derived from kernel-sizes list length, streamlined output (90% less verbose).

---

## February 11, 2026

- [x] **Effect Render API Refactor** — Added `get_common_uniforms()` to Effect base class, refactored all `render()`/`compute()` signatures to single `CommonPostProcessUniforms&`, fixed uninitialized uniforms in CircleMaskEffect and CNNv1Effect.

- [x] **CNN Shader Testing Tool** — `src/gpu/texture_readback.{h,cc}` + `tools/cnn_test.cc`. Offline PNG→CNN→PNG validation with `--blend`, `--format`, `--debug-hex`. See `cnn_v1/docs/CNN_TEST_TOOL.md`.

---

## February 10, 2026

- [x] **WGPU Boilerplate Factorization** — `BindGroupLayoutBuilder`, `BindGroupBuilder`, `RenderPipelineBuilder`, `SamplerCache`. -122 lines boilerplate.

---

## February 9, 2026

- [x] **External Library Size Measurement (Task #76)** — `DEMO_STRIP_EXTERNAL_LIBS` mode with platform/GPU stubs + miniaudio null backend. `scripts/measure_size.sh`. Result: Demo=4.4MB (69%), External=2.0MB (31%).

- [x] **WGSL Uniform Buffer Validation (Task #75)** — Standardized binding 2/3 layout across effects. `tools/validate_uniforms.py`. `doc/UNIFORM_BUFFER_GUIDELINES.md`.

---

## February 8, 2026

- [x] **Shader Parametrization System (Task #73)** — `UniformHelper<T>`, `FlashEffectParams`, key=value `.seq` syntax. Fixed WGSL alignment (24→32 bytes FlashUniforms). Tests: 32/32.

- [x] **3D: Plane Scaling Fix + Shadow Investigation** — Fixed `ObjectType::PLANE` SDF distance for non-uniform scaling in shader and physics. Documented mesh shadow limitation (AABB proxy) in `doc/DEBUG_SHADOWS.md`.

- [x] **OBJ Asset Pipeline (Task #18.0)** — `ASSET_MESH` type, asset_packer OBJ parsing, `Renderer3D` MESH rasterization, Blender exporter, binary scene loader.

- [x] **GPU BVH & Shadows (Task #18-B)** — BVH storage buffer, stack-based shader traversal, dual-pipeline (BVH/Linear) via `ShaderComposer` substitution.

---

## February 7, 2026

- [x] **Real-Time Audio Peak Fix** — Peak now measured at playback time (audio callback) not write time. Exponential decay 0.7 (1.15s fade). `SilentBackend` for tests. Backend reorganized to `src/audio/backend/`. Tests: 28/28.

---

## February 6, 2026

- [x] **Critical Shader Bug Fixes** — Fixed 3 WGSL validation crashes: `inverse()` dead code in renderer_3d.wgsl, `get_normal_basic()` signature mismatch, `scene_query_linear.wgsl` incorrectly declaring BVH binding 2.

- [x] **Shader Compilation Tests** — `test_shader_compilation.cc`: compiles all production shaders through WebGPU, validates both BVH/Linear modes.

- [x] **Build System: Asset Dependency Tracking (Task C)** — Header split (`asset_manager_dcl.h`, `asset_manager.h`, `asset_manager_utils.h`). File-level CMake deps for 42 demo + 17 test assets. Fixed stale shader rebuild bug. Build: 4.82s → 2.01s.

- [x] **FFT-based DCT/IDCT** — Numerical Recipes reordering, orthonormal normalization. Fixed normalization mismatch (regenerated all `.spec`), procedural note scaling, windowing error in `synth.cc`. Tests: 23/23.

---

## February 5, 2026

- [x] **Audio Lifecycle Refactor (Task #56)** — `AudioEngine` class + `SpectrogramResourceManager`. Eliminated init-order fragility. Migrated all tracker tests. Tests: 20/20.

- [x] **Physics & Collision (Task #49)** — CPU SDF library (`sdf_cpu.h`), BVH builder, `PhysicsSystem` (semi-implicit Euler, BVH broad-phase, SDF narrow-phase), integrated into `test_3d_render.cc`.

- [x] **Timeline Editor Phase 1 (Task #57)** — Web-based `tools/timeline_editor/index.html`: drag/drop, snap-to-beat, resize handles, priority stack, waveform overlay, load/save `.seq`.

---

## February 4, 2026

- [x] **Event-Based Tracker for Tempo Scaling** — Refactored from pattern compositing to individual event triggering. Notes within patterns now respect tempo scale. Tests: 17/17.

- [x] **WAV Dump Backend** — `WavDumpBackend` + `--dump-wav` flag. Fixed stereo bug (was writing mono). `test_wav_dump.cc` regression test.

- [x] **Variable Tempo System** — `g_tempo_scale` music time abstraction in `main.cc`. `test_variable_tempo.cc`: 6 scenarios. Zero pitch shift.

- [x] **Core Audio Stability** — Forced 32kHz native (`allowNominalSampleRateChange`), 4096-frame buffers (128ms). Ring buffer 200ms→400ms. Fixed tempo-scaled pre-fill bug.

- [x] **NOTE_ Parsing Fix & Sample Caching** — Fixed `is_note_name()` false positives. Implemented caching: 256→32 `MAX_SPECTROGRAMS`. Zero `spectrogram_id=-1` errors.

- [x] **Debug Logging Infrastructure** — `src/util/debug.h`: 7 category macros. `DEMO_ENABLE_DEBUG_LOGS` CMake option. Zero cost in default builds.

- [x] **Mock Audio Backend & Tracker Timing Tests** — `MockAudioBackend`, `test_tracker_timing.cc`: verified simultaneous triggers have 0.000ms delta.

---

## Earlier (January–February 2026)

- [x] **Task #51: Audio Backend Abstraction** — `AudioBackend` interface, `MiniaudioBackend`, event hooks in `synth.cc`.
- [x] **Task #50: WGSL Modularization** — Recursive `#include`, granular SDF/lighting/render library, `ShaderComposer` multi-path.
- [x] **Task #48/47/46/45/44: Test Coverage** — Audio 42%→93%, asset manager 71%→88%, procedural 38%→96%. `gen_coverage_report.sh`.
- [x] **Skybox & Two-pass Rendering** — Rotating skybox via `inv_view_proj`, multi-octave procedural noise, mandatory clears.
- [x] **Task #57 Phase 1 / Timeline Editor** — See February 5 entry.
- [x] **Task #68: Mesh Wireframe Debug** — `VisualDebug::add_mesh_wireframe()`.
- [x] **Task #39: Visual Debug Primitives** — Sphere, Cone, Cross, Line, Trajectory wireframes.
- [x] **Task #26: Shader Asset Testing** — `ShaderComposer` tests, WGSL asset validation.
- [x] **Task #25: Build System Consolidation** — Subsystem libraries, helper macros.
- [x] **Task #20: Platform Hygiene** — Consolidated platform shims, removed STL from hot paths.
- [x] **Workspace System (Task #77)** — Multi-workspace `cmake -DDEMO_WORKSPACE=<name>`. See `doc/WORKSPACE_SYSTEM.md`.
- [x] **CNN v1 Bias Fix** — Bias divided by `num_positions` at export; RGBA output, `--debug-hex`. See `cnn_v1/docs/CNN_BIAS_FIX_2026-02.md`.
- [x] **CNN RGBD→Grayscale Architecture** — 7-channel input [RGBD, UV, gray], inner layers 7→4, final 7→1. See `cnn_v1/docs/CNN_RGBD_GRAYSCALE_SUMMARY.md`.
- [x] **Particles Polish (Task #53)** — Transparent circular particles, distance falloff, lifetime alpha fade, alpha blending.
- [x] **Asset Pipeline** — `gen_spectrograms.sh`, 13 new drum/bass samples, robust OBJ/scene pipeline.
- [x] **WebGPU Stabilization** — macOS `WGPUSurface` fix, render pass validation, High-DPI viewport fix.
- [x] **Final Build Stripping (Task #8)** — `STRIP_ALL` macro, `-dead_strip` macOS flags.