summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md19
-rw-r--r--doc/COMPLETED.md2
2 files changed, 15 insertions, 6 deletions
diff --git a/TODO.md b/TODO.md
index e33072f..11c629e 100644
--- a/TODO.md
+++ b/TODO.md
@@ -69,16 +69,23 @@ PyTorch / HTML WebGPU / C++ WebGPU.
**Design:** `cnn_v3/docs/CNN_V3.md`
**Phases:**
-1. ✅ G-buffer: `GBufferEffect` integrated. Assets, CMake, demo_effects.h, test all wired. 35/35 tests pass.
- - NodeTypes: `GBUF_ALBEDO`, `GBUF_DEPTH32`, `GBUF_R8`, `GBUF_RGBA32UINT`
- - Shaders: `cnn_v3/shaders/gbuf_raster.wgsl` (ShaderComposer), `gbuf_pack.wgsl`
- - SDF/shadow passes TODO (placeholder: shadow=1, transp=0)
- - Howto: `cnn_v3/docs/HOWTO.md`
+1. ✅ G-buffer: `GBufferEffect` integrated. SDF/shadow placeholder (shadow=1, transp=0).
2. ✅ Training infrastructure: `blender_export.py`, `pack_blender_sample.py`, `pack_photo_sample.py`
3. ✅ WGSL shaders: cnn_v3_common (snippet), enc0, enc1, bottleneck, dec1, dec0
-4. ✅ C++ CNNv3Effect + FiLM uniform upload
+4. ✅ C++ `CNNv3Effect`: 5 compute passes, FiLM uniform upload, `set_film_params()` API
+ - Params alignment fix: WGSL `vec3u` align=16 → C++ structs 64/96 bytes
+ - Weight offsets as explicit formulas (e.g. `20*4*9+4`)
+ - FiLM γ/β: identity defaults; real values require trained MLP (see below)
5. Parity validation (test vectors, ≤1/255 per pixel)
+**FiLM MLP training** (blocks meaningful Phase 4 output):
+- Needs `cnn_v3/training/train_cnn_v3.py` — not yet written
+- MLP: `Linear(5→16) → ReLU → Linear(16→48)` trained jointly with U-Net
+- Input: `[beat_phase, beat_time/8, audio_intensity, style_p0, style_p1]`
+- Output: γ/β for enc0(4ch) + enc1(8ch) + dec1(4ch) + dec0(4ch) = 40 floats
+- Trained weights (~3 KB f16) stored in `.bin` after conv weights; loaded at runtime
+- See `cnn_v3/docs/CNN_V3.md` §5 for full MLP spec and §11 for training pipeline plan
+
## Future: CNN v2 8-bit Quantization
Reduce weights from f16 (~3.2 KB) to i8 (~1.6 KB).
diff --git a/doc/COMPLETED.md b/doc/COMPLETED.md
index 42e4bc6..6868484 100644
--- a/doc/COMPLETED.md
+++ b/doc/COMPLETED.md
@@ -36,6 +36,8 @@ Completed task archive. See `doc/archive/` for detailed historical documents.
## March 2026
+- [x] **CNN v3 Phase 4: C++ CNNv3Effect + FiLM uniform upload** — `cnn_v3/src/cnn_v3_effect.{h,cc}`. 5 compute passes (enc0→enc1→bottleneck→dec1→dec0), shared f16 weights buffer, per-pass uniform buffers, `set_film_params()` API. Key fix: WGSL `vec3u` has align=16, so `CnnV3Params4ch`=64B and `CnnV3ParamsEnc1`=96B (not 48/80). Weight offsets as explicit formulas. FiLM γ/β identity defaults; real values await `train_cnn_v3.py`. 35/35 tests.
+
- [x] **NTSC post-process effect** — Fisheye distortion + NTSC scan-line simulation as `WgslEffect` thin wrappers. Common logic in `render/ntsc_common` snippet (`sample_ntsc_signal` hook). Two variants: `ntsc_rgb.wgsl` (RGB→YIQ internally, `Ntsc`) and `ntsc_yiq.wgsl` (YIQ passthrough, `NtscYiq`, for RotatingCube output). Files: `src/effects/ntsc_rgb.wgsl`, `ntsc_yiq.wgsl`, `src/shaders/render/ntsc_common.wgsl`, `ntsc_effect.h`. Tests: 36/36.
- [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.