From 581c67b75aa3c089c86f764b67e6de7476a13993 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 22 Mar 2026 12:53:13 +0100 Subject: feat(cnn_v3): wire trained weights into CNNv3Effect + add timeline test sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CNNv3Effect constructor loads ASSET_WEIGHTS_CNN_V3 via GetAsset on startup - seq_compiler.py: CLASS_TO_HEADER supports full #include paths for cnn_v3/ classes - timeline.seq: add cnn_v3_test sequence at 48s (GBufferEffect → CNNv3Effect) - test_cnn_v3_parity: zero_weights test now explicitly uploads zeros to override asset handoff(Gemini): CNNv3Effect ready; export weights to workspaces/main/weights/ and seek to 48s to test --- cnn_v3/src/cnn_v3_effect.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cnn_v3/src') diff --git a/cnn_v3/src/cnn_v3_effect.cc b/cnn_v3/src/cnn_v3_effect.cc index 759e7ef..4aa2c25 100644 --- a/cnn_v3/src/cnn_v3_effect.cc +++ b/cnn_v3/src/cnn_v3_effect.cc @@ -2,8 +2,16 @@ // See cnn_v3/docs/CNN_V3.md for architecture, HOWTO.md §7 for shader details. #include "cnn_v3_effect.h" + +#if defined(USE_TEST_ASSETS) +#include "test_assets.h" +#else +#include "generated/assets.h" +#endif + #include "gpu/gpu.h" #include "gpu/shader_composer.h" +#include "util/asset_manager.h" #include "util/fatal_error.h" #include #include @@ -180,6 +188,14 @@ CNNv3Effect::CNNv3Effect(const GpuContext& ctx, for (int i = 0; i < 4; ++i) { dec0_params_.gamma[i] = 1.0f; } create_pipelines(); + + // Load trained weights from asset system (zero-initialized if absent). + size_t weights_size = 0; + const void* weights_data = + GetAsset(AssetId::ASSET_WEIGHTS_CNN_V3, &weights_size); + if (weights_data && weights_size == kWeightsBufBytes) { + upload_weights(ctx_.queue, weights_data, (uint32_t)weights_size); + } } // --------------------------------------------------------------------------- -- cgit v1.2.3