From 2a793c23b582ed134b8294bfbbe3b6d7aaafe0c0 Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 09:33:12 +0100 Subject: Add CNN v2 WebGPU testing tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements single-file HTML tool for rapid CNN weight validation: Features: - Drag-drop PNG images (whole window) and .bin weights - Real-time WebGPU compute pipeline (static features + N layers) - Data-driven execution (reads layer count from binary) - View modes: CNN output / Original / Diff (×10) - Blend slider (0.0-1.0) for effect strength - Console log with timestamps - Keyboard shortcuts: SPACE (original), D (diff) Architecture: - Embedded WGSL shaders (static + compute + display) - Binary parser for .bin format (header + layer info + f16 weights) - Persistent textures for view mode switching - Absolute weight offset calculation (header + layer info skip) Implementation notes: - Weight offsets in binary are relative to weights section - JavaScript precalculates absolute offsets: headerOffsetU32 * 2 + offset - Matches C++ shader behavior (simple get_weight without offset param) - Ping-pong textures for multi-layer processing TODO: - Side panel: .bin metadata, weight statistics, validation - Layer inspection: R/G/B/A plane split, intermediate outputs - Activation heatmaps for debugging Files: - tools/cnn_v2_test/index.html (24 KB, 730 lines) - tools/cnn_v2_test/README.md (usage guide, troubleshooting) handoff(Claude): CNN v2 HTML testing tool complete, documented TODOs for future enhancements --- tools/cnn_v2_test/index.html | 809 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 809 insertions(+) create mode 100644 tools/cnn_v2_test/index.html (limited to 'tools/cnn_v2_test/index.html') diff --git a/tools/cnn_v2_test/index.html b/tools/cnn_v2_test/index.html new file mode 100644 index 0000000..9c28455 --- /dev/null +++ b/tools/cnn_v2_test/index.html @@ -0,0 +1,809 @@ + + + + + + + CNN v2 Testing Tool + + + +
+

CNN v2 Testing Tool

+
+
+ + + 1.0 +
+
+ + +
+
+ + CNN Output +
+
+
Drop .bin Weights
+
+
+ +
+ + + + + -- cgit v1.2.3