From e4c1641201af04c9919410325f4e0865e8b88d5d Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 16:52:41 +0100 Subject: Doc: Update CNN v2 docs for binary format v2 and mip-level support Updated documentation to reflect binary format v2 with mip_level field. Changes: - CNN_V2_BINARY_FORMAT.md: Document v2 (20-byte header) with mip_level, v1 backward compat - CNN_V2_WEB_TOOL.md: Document auto-detection of mip_level, UI updates - CNN_V2.md: Update overview with mip-level feature, training pipeline Binary format v2: - Header: 20 bytes (was 16) - New field: mip_level (u32) at offset 0x10 - Backward compatible: v1 loaders treat as mip_level=0 Documentation complete for full mip-level pipeline integration. Co-Authored-By: Claude Sonnet 4.5 --- doc/CNN_V2_WEB_TOOL.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'doc/CNN_V2_WEB_TOOL.md') diff --git a/doc/CNN_V2_WEB_TOOL.md b/doc/CNN_V2_WEB_TOOL.md index 8c661b2..25f4ec7 100644 --- a/doc/CNN_V2_WEB_TOOL.md +++ b/doc/CNN_V2_WEB_TOOL.md @@ -10,7 +10,8 @@ Browser-based WebGPU tool for validating CNN v2 inference with layer visualizati **Working:** - ✅ WebGPU initialization and device setup -- ✅ Binary weight file parsing (.bin format) +- ✅ Binary weight file parsing (v1 and v2 formats) +- ✅ Automatic mip-level detection from binary format v2 - ✅ Weight statistics (min/max per layer) - ✅ UI layout with collapsible panels - ✅ Mode switching (Activations/Weights tabs) @@ -24,6 +25,10 @@ Browser-based WebGPU tool for validating CNN v2 inference with layer visualizati - ✅ Mip level selection (p0-p3 features at different resolutions) **Recent Changes (Latest):** +- Binary format v2 support: Reads mip_level from 20-byte header +- Backward compatible: v1 (16-byte header) → mip_level=0 +- Auto-update UI dropdown when loading weights with mip_level +- Display mip_level in metadata panel - Code refactoring: Extracted FULLSCREEN_QUAD_VS shader (reused 3× across pipelines) - Added helper methods: `getDimensions()`, `setVideoControlsEnabled()` - Improved code organization with section headers and comments @@ -70,9 +75,11 @@ Browser-based WebGPU tool for validating CNN v2 inference with layer visualizati ### Key Components **1. Weight Parsing** -- Reads binary format: header (16B) + layer info (20B×N) + f16 weights +- Reads binary format v2: header (20B) + layer info (20B×N) + f16 weights +- Backward compatible with v1: header (16B), mip_level defaults to 0 - Computes min/max per layer via f16 unpacking -- Stores `{ layers[], weights[], fileSize }` +- Stores `{ layers[], weights[], mipLevel, fileSize }` +- Auto-sets UI mip-level dropdown from loaded weights **2. CNN Pipeline** - Static features computation (RGBD + UV + sin + bias → 7D packed) -- cgit v1.2.3