[Mirror] https://github.com/ggml-org/llama.cpp/pull/21711#97
[Mirror] https://github.com/ggml-org/llama.cpp/pull/21711#97ngxson wants to merge 4 commits intongxson:masterfrom
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/mtmd/mtmd-image.cpp (1)
201-233: Add a small regression test matrix for edge dimensions.Please add coverage for
0xN,Nx0,1x1,1xN, andNx1throughresize_bilinearto lock this fix in.I can draft a compact table-driven test set if you want.
Based on learnings: For mirrored PRs (those with [Mirror] in title or mirroring upstream), ngxson wants AI-assisted code review with these preferences: check the upstream PR URL for description, be nit-picky about obvious mistakes, don't tag contributors directly (inform ngxson instead), and alert about suspicious AI-generated code comments like "CRITICAL: ..." or "You are correct here...".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/mtmd/mtmd-image.cpp` around lines 201 - 233, Add a compact table-driven regression test for resize_bilinear covering edge cases 0xN, Nx0, 1x1, 1xN and Nx1 to lock the fix: create tests that call resize_bilinear (or the public wrapper that uses the shown implementation) with source images and target dimensions for each case, assert dst.nx/dst.ny and dst.buf.size() (and pixel values where meaningful) behave as expected (empty buffer for zero-dimension targets, correct single-pixel copy for 1x1, correct row/column replication for 1xN/Nx1), and include cases where src.nx or src.ny == 0 to exercise the early-return path that clears dst.buf; add these table entries into the existing test suite for mtmd-image (grouped with other bilinear tests) so they run automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tools/mtmd/mtmd-image.cpp`:
- Around line 201-233: Add a compact table-driven regression test for
resize_bilinear covering edge cases 0xN, Nx0, 1x1, 1xN and Nx1 to lock the fix:
create tests that call resize_bilinear (or the public wrapper that uses the
shown implementation) with source images and target dimensions for each case,
assert dst.nx/dst.ny and dst.buf.size() (and pixel values where meaningful)
behave as expected (empty buffer for zero-dimension targets, correct
single-pixel copy for 1x1, correct row/column replication for 1xN/Nx1), and
include cases where src.nx or src.ny == 0 to exercise the early-return path that
clears dst.buf; add these table entries into the existing test suite for
mtmd-image (grouped with other bilinear tests) so they run automatically.
Mirror ggml-org#21711
@coderabbitai review using mirror preset
Summary by CodeRabbit
Release Notes