summaryrefslogtreecommitdiff
path: root/doc/CNN_V2.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/CNN_V2.md')
-rw-r--r--doc/CNN_V2.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/CNN_V2.md b/doc/CNN_V2.md
index a66dc1d..2913498 100644
--- a/doc/CNN_V2.md
+++ b/doc/CNN_V2.md
@@ -645,6 +645,36 @@ workspaces/main/shaders/cnn_*.wgsl # Original v1 shaders
## Future Extensions
+### Flexible Feature Layout (Binary Format v3)
+
+**TODO:** Support arbitrary feature vector layouts and ordering in binary format.
+
+**Current Limitation:**
+- Feature layout hardcoded: `[p0, p1, p2, p3, uv_x, uv_y, sin10_x, bias]`
+- Shader must match training script exactly
+- Experimentation requires shader recompilation
+
+**Proposed Enhancement:**
+- Add feature descriptor to binary format header
+- Specify feature types, sources, and ordering
+- Runtime shader generation or dynamic feature indexing
+- Examples: `[R, G, B, dx, dy, uv_x, bias]` or `[mip1.r, mip2.g, laplacian, uv_x, sin20_x, bias]`
+
+**Benefits:**
+- Training experiments without C++/shader changes
+- A/B test different feature combinations
+- Single binary format, multiple architectures
+- Faster iteration on feature engineering
+
+**Implementation Options:**
+1. **Static approach:** Generate shader code from descriptor at load time
+2. **Dynamic approach:** Array-based indexing with feature map uniform
+3. **Hybrid:** Precompile common layouts, fallback to dynamic
+
+See `doc/CNN_V2_BINARY_FORMAT.md` for proposed descriptor format.
+
+---
+
### More Features (uint8 Packing)
```wgsl