summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-21 09:51:58 +0100
committerskal <pascal.massimino@gmail.com>2026-03-21 09:51:58 +0100
commit673a24215b2670007317060325256059d1448f3b (patch)
treebfb2cf37a93eb62055bcca8441d9b15c3533e17c /cmake
parentb8b2707d7b3f2eaabd896395f2625e13405a24e2 (diff)
feat(cnn_v3): Phase 5 complete — parity validation passing (36/36 tests)
- Add test_cnn_v3_parity.cc: zero_weights + random_weights tests - Add gen_test_vectors.py: PyTorch reference implementation for enc0/enc1/bn/dec1/dec0 - Add test_vectors.h: generated C header with enc0, dec1, output expected values - Fix declare_nodes(): intermediate textures at fractional resolutions (W/2, W/4) using new NodeRegistry::default_width()/default_height() getters - Add layer-by-layer readback (enc0, dec1) for regression coverage - Final parity: enc0 max_err=1.95e-3, dec1 max_err=1.95e-3, out max_err=4.88e-4 handoff(Claude): CNN v3 parity done. Next: train_cnn_v3.py (FiLM MLP training).
Diffstat (limited to 'cmake')
-rw-r--r--cmake/DemoTests.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/DemoTests.cmake b/cmake/DemoTests.cmake
index 0b7fbb7..69b9195 100644
--- a/cmake/DemoTests.cmake
+++ b/cmake/DemoTests.cmake
@@ -222,6 +222,24 @@ if(NOT DEMO_STRIP_ALL AND DEMO_WORKSPACE STREQUAL "main")
STB_IMAGE_WRITE_IMPLEMENTATION)
endif()
+# CNN v3 parity test (zero-weight + random-weight vs Python reference)
+if(NOT DEMO_STRIP_ALL AND DEMO_WORKSPACE STREQUAL "main")
+ add_demo_test(test_cnn_v3_parity CnnV3ParityTest gpu
+ src/tests/gpu/test_cnn_v3_parity.cc
+ src/tests/common/webgpu_test_fixture.cc
+ ${PLATFORM_SOURCES}
+ ${GEN_DEMO_CC})
+
+ target_include_directories(test_cnn_v3_parity PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/cnn_v3/src)
+
+ target_link_libraries(test_cnn_v3_parity PRIVATE
+ gpu util procedural ${DEMO_LIBS})
+
+ demo_add_asset_deps(test_cnn_v3_parity shaders)
+endif()
+
# GPU Composite Texture Test (Phase 4)
add_demo_test(test_gpu_composite GpuCompositeTest gpu
src/tests/gpu/test_gpu_composite.cc