From 64095c683f15e8bd7c19d32041fcc81b1bd6c214 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 25 Mar 2026 08:07:53 +0100 Subject: feat(cnn_v3): add infer_cnn_v3.py + rewrite cnn_test for v3 parity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cnn_v3/training/infer_cnn_v3.py: PyTorch inference tool; simple mode (single PNG, zeroed geometry) and full mode (sample directory); supports --identity-film (γ=1 β=0) to match C++ default, --cond for FiLM MLP, --blend, --debug-hex for pixel comparison - tools/cnn_test.cc: full rewrite, v3 only; packs 20-channel features on CPU (training format: [0,1] oct normals, pyrdown mip), uploads to GPU, runs CNNv3Effect, reads back RGBA16Float, saves PNG; --sample-dir for full G-buffer input, --weights for .bin override, --debug-hex - cmake/DemoTests.cmake: add cnn_v3/src include path, drop unused offscreen_render_target.cc from cnn_test sources - cnn_v3/docs/HOWTO.md: new §10 documenting both tools, comparison workflow, and feature-format convention (training vs runtime) handoff(Gemini): cnn_test + infer_cnn_v3.py ready for parity testing. Run both with --identity-film / --debug-hex on same image to compare. --- cmake/DemoTests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake/DemoTests.cmake') diff --git a/cmake/DemoTests.cmake b/cmake/DemoTests.cmake index 69b9195..59859c5 100644 --- a/cmake/DemoTests.cmake +++ b/cmake/DemoTests.cmake @@ -196,17 +196,17 @@ add_demo_test(test_gpu_procedural GpuProceduralTest gpu target_link_libraries(test_gpu_procedural PRIVATE 3d gpu audio procedural util ${DEMO_LIBS}) demo_add_asset_deps(test_gpu_procedural shaders) -# CNN shader testing tool (only when STRIP_ALL is OFF and workspace is main) +# CNN v3 shader testing tool (only when STRIP_ALL is OFF and workspace is main) if(NOT DEMO_STRIP_ALL AND DEMO_WORKSPACE STREQUAL "main") add_executable(cnn_test tools/cnn_test.cc src/tests/common/webgpu_test_fixture.cc - src/tests/common/offscreen_render_target.cc ${PLATFORM_SOURCES} ${GEN_DEMO_CC}) target_include_directories(cnn_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/cnn_v3/src ${CMAKE_CURRENT_SOURCE_DIR}/third_party ${CMAKE_CURRENT_BINARY_DIR}/src/generated ${CORE_INCLUDES}) -- cgit v1.2.3