Skip to content

chore: remove test/debug API and tests/ - #20

Closed
PABannier wants to merge 1 commit into
mainfrom
cleanup/remove-test-api
Closed

PABannier wants to merge 1 commit into
mainfrom
cleanup/remove-test-api

Conversation

@PABannier

Copy link
Copy Markdown
Owner

What

Deletes the test/debug API from sam3.h / sam3.cpp and the tracked tests/ directory.

Why

tests/ was the only caller of these symbols; no library or example code uses them. The tests were one-off numerical-parity harnesses from the port and are no longer built or run.

Removed

  • Public (sam3.h): all sam3_test_* functions (tokenizer, text-encoder / phase5 / phase6 / phase7 / geom-enc / fenc dumps, ViT prefix/block stage runners, host-reference linear ops), sam3_dump_state_tensor, sam3_get_state_tensor_info, sam3_dump_model_tensor, sam3_get_model_tensor_info, sam3_encode_image_from_preprocessed, sam3_encode_vit_from_preprocessed_selective, struct sam3_tensor_info, enum sam3_vit_block_stage, enum sam3_vit_prefix_stage.
  • Internal (sam3.cpp): static helpers used only by the above: sam3_clear_encoder_state, sam3_mark_named_outputs, sam3_normalize_ne4, sam3_new_f32_tensor_4d_from_ne, sam3_copy_tensor_to_f32 (+ forward decl), sam3_build_vit_{prefix,block}_stage_from_input, sam3_build_vit_attn_core_from_qkv, g_test_tokenizer, dump/ref-loading helpers (sam3_dump_tensor_to_path, sam3_dump_raw_f32_to_path, sam3_load_ref_f32_data, sam3_reorder_nchw_to_ggml_dwh, sam3_load_kv_text_file, sam3_meta_get_int), sam3_find_state_tensor, sam3_fill_tensor_info.
  • The mkdir → _mkdir Windows macro and the <direct.h> / <sys/stat.h> includes (only used by the dump code).
  • tests/ (89 files).

The Profiling section (sam3_profile_edgetam_encode) is untouched.

Verification

Parity tool (byte-compared against deterministic origin/main baselines; covers encode_image, segment_pvs point + box, visual tracker add_instance + propagate_frame):

PARITY OK   edgetam_f16 gpu0
PARITY OK   edgetam_f16 gpu1
PARITY OK   sam2.1_hiera_tiny_q8_0 gpu0
PARITY OK   sam2.1_hiera_tiny_q8_0 gpu1

Full Release build (lib + all examples): no errors, no new warnings (only pre-existing ggml/stb ones). sam3.cpp compiled with -Wunused-function -Wunused-variable -Wunused-macros: 0 warnings before and after. No full SAM3 checkpoint is available locally, so the text/PCS path is verified compile-only.

91 files changed, 21819 deletions(-)

Follow-up

The SAM3_BUILD_TESTS CMake option is now dangling; it is removed in a stacked follow-up PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq

tests/ was the only consumer of the sam3_test_* functions, the state/model
tensor dump and info helpers, sam3_encode_image_from_preprocessed,
sam3_encode_vit_from_preprocessed_selective, struct sam3_tensor_info and
the sam3_vit_block_stage / sam3_vit_prefix_stage enums. Remove them along
with the static helpers only they used, the Windows mkdir macro and its
includes, and the tests/ directory itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant