From d594609420b3d0ca43d760ff043b3750e2be55ca Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 11 Feb 2026 07:11:59 +0100 Subject: fix: CNN test tool ping-pong bug and RGBA16Float intermediates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugfixes: - Fixed ping-pong logic: update current_input BEFORE flipping dst_idx - Use RGBA16Float for intermediate layers (preserve [-1,1] range from tanh) - Separate BGRA8Unorm final output texture for readback - Create two pipelines: intermediate (RGBA16Float) and final (BGRA8Unorm) - Fix all cleanup code to reference correct pipeline variables Implementation: - Intermediate textures use RGBA16Float to avoid clamping [-1,1] → [0,1] - Final layer renders to separate BGRA8Unorm texture - Correct texture view descriptors for each format - Layer 0-1: render to RGBA16Float ping-pong textures - Layer 2: render to BGRA8Unorm output texture Documentation: - Added CNN testing section to doc/HOWTO.md - Updated CNN_TEST_TOOL.md with ground-truth comparison workflow - Noted remaining black output bug (under investigation) Status: - Tool compiles and runs without GPU errors - Architecture correct: ping-pong, format conversion, separate pipelines - Output still all-black (unknown cause, needs debugging) - All 36 tests still pass handoff(Claude): CNN test tool bugfixes complete, black output remains Co-Authored-By: Claude Sonnet 4.5 --- doc/CNN_TEST_TOOL.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/CNN_TEST_TOOL.md') diff --git a/doc/CNN_TEST_TOOL.md b/doc/CNN_TEST_TOOL.md index 7a970fe..09c55d4 100644 --- a/doc/CNN_TEST_TOOL.md +++ b/doc/CNN_TEST_TOOL.md @@ -178,11 +178,12 @@ assert mse < 10.0, f'MSE too high: {mse}' ## Known Issues -**BUG: Black output (uninitialized input texture)** -- Tool produces all-black output (MSE 64860 vs ground truth) -- Root cause: First intermediate texture not initialized with input image -- Multi-layer processing starts with uninitialized data -- Fix required: Copy input_texture → intermediate_textures[0] before layer loop +**BUG: Black output (unknown cause)** +- Tool produces all-black output despite correct architecture +- Fixed ping-pong logic, RGBA16Float intermediates, proper pipelines +- Shader compiles, GPU commands execute without errors +- Possible causes: shader execution issue, synchronization, binding problem +- Status: Under investigation --- -- cgit v1.2.3