Repository navigation
chore: remove unused sam3_bbox_mlp, sam3_params::seed, SAM3_VISUAL enum - #21
Conversation
| __func__, eis, hp.img_size, state->encode_feat_size, hp.feat_size()); | ||
| } | ||
|
|
||
| return state; |
There was a problem hiding this comment.
Rebase on main, and check the change is still useful.
There was a problem hiding this comment.
Rebased onto main (base retargeted from the closed cleanup/remove-test-api), and you were right to ask — one of the four removals is no longer valid.
Since #20 was closed, tests/ stays on main, and tests/test_sam2_pvs_compare.cpp:15 declares sam3_state_set_orig_dims via extern and calls it at line 49. I've kept that function; removing it would break the tests build.
The other three are still dead on current main:
| Symbol | Check |
|---|---|
sam3_bbox_mlp |
git grep -w sam3_bbox_mlp → only its own definition |
sam3_params::seed |
only the field declaration; tc.seed in test_metal_conv_transpose_2d.cpp is a different local struct |
SAM3_MODEL_SAM3_VISUAL |
only the enumerator; never assigned, so sam3_get_model_type() never returns it |
Now 15 deletions across 2 files, down from 20.
Verified: a Release build with -DSAM3_BUILD_TESTS=ON builds the library, all examples and all 43 test targets with no errors or new warnings. Output is unchanged too — encode, PVS point + box, and a 3-frame visual track match main byte for byte on EdgeTAM f16 and SAM2.1-tiny q8_0, CPU and Metal (PARITY OK ×4).
- sam3_bbox_mlp: static, never called. - sam3_params::seed: never read. - SAM3_MODEL_SAM3_VISUAL: never assigned, so sam3_get_model_type can't return it. Visual-only SAM3 still reports SAM3_MODEL_SAM3 + sam3_is_visual_only(). Remaining enum values keep their numbers. sam3_state_set_orig_dims is kept: tests/test_sam2_pvs_compare.cpp calls it through an extern declaration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq
20b938a to
6b653a5
Compare
Removes code with no callers:
sam3_bbox_mlp(static)sam3_params::seedtc.seedintests/test_metal_conv_transpose_2d.cppis an unrelated local struct)SAM3_MODEL_SAM3_VISUALsam3_get_model_type()never returns it. Visual-only SAM3 still reportsSAM3_MODEL_SAM3, andsam3_is_visual_only()returns true. The other enum values keep their explicit numbers.Kept:
sam3_state_set_orig_dims. An earlier revision of this PR removed it, which was only safe on top of #20 (removetests/). #20 is closed, sotests/test_sam2_pvs_compare.cppstill calls the function through anexterndeclaration and it has to stay.Rebased onto
main; no longer stacked on anything.Verification: a Release build with
-DSAM3_BUILD_TESTS=ONbuilds the library, all examples and all 43 test targets with no errors or new warnings.Output is unchanged: a parity tool runs encode, PVS point + box, and a 3-frame visual track, then compares byte for byte against
main.git diff --shortstat main: 2 files changed, 15 deletions(-).Part of an over-engineering cleanup series.
🤖 Generated with Claude Code
https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq