Skip to content

Add CTC CLI oracle tests - #371

Merged
ziw-liu merged 4 commits into
live-image-tracking-tools:mainfrom
ziw-liu:ctc-oracle-test
Oct 21, 2026
Merged

ziw-liu merged 4 commits into
live-image-tracking-tools:mainfrom
ziw-liu:ctc-oracle-test

Conversation

@ziw-liu

@ziw-liu ziw-liu commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Proposed Change

Add tests against the CTC CLI binaries (#184).
Currently xfail since the discrepancies might be reflecting different interpretations for the metrics.

Failing cases

Non-split

This seems to be an regression from 6afc40d. The operation-counting function still exists, but the metrics is computed from node-counting.

Single-daughter division semantics

CTC distinguishes links within a track from parent links between tracks. A parent link can exist with only one observed daughter based on the track ID. See this paper. This might have be an implementation tradeoff with TrackingGraph not requiring track ID.

Types of Changes

What types of changes does your code introduce? Delete those that do not apply.

  • Tests and benchmarks

Which topics does your change affect? Delete those that do not apply.

  • Track Errors
  • Metrics

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the developer/contributing docs.
  • I have added tests that prove that my feature works in various situations or tests the bugfix (if appropriate).
  • I have checked that I maintained or improved code coverage.
  • I have checked the benchmarking action to verify that my changes did not adversely affect performance.
  • I have written docstrings and checked that they render correctly in the Read The Docs build (created after the PR is opened).
  • I have updated the general documentation including Metric descriptions and example notebooks if necessary.

Further Comments

In #184 (comment) the maintainers decided that this is not supposed to be part of CI. I'm opening a PR to have a concrete substrate for discussion.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@msschwartz21 msschwartz21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ziwen! Thanks for opening this PR! This is something that we want to test.

I think I would like to limit running this test on only one OS/python combo just to reduce our CI run time. I think the easiest option is just to skip based on which OS/python version is running for a given test.

Do you know why it's currently failing on ubuntu?

@msschwartz21 msschwartz21 added the 🧪 tests Test case related issues label Oct 20, 2026
@ziw-liu

ziw-liu commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Do you know why it's currently failing on ubuntu?

Hi Morgan! I think it's a libc mismatch between the binary and the CI runner. I added workaround that passed on a local box.

I think I would like to limit running this test on only one OS/python combo just to reduce our CI run time. I think the easiest option is just to skip based on which OS/python version is running for a given test.

I assume you want it to run locally regardless of the developer's machine platform and only skip in github actions? Is there an idiomatic way to do this in this repo?

@msschwartz21

Copy link
Copy Markdown
Collaborator

I assume you want it to run locally regardless of the developer's machine platform and only skip in github actions? Is there an idiomatic way to do this in this repo?

Honestly I don't mind if it only runs on CI. If someone really cares they can run it locally and manually toggle the skips according to their workstation.

@ziw-liu

ziw-liu commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@msschwartz21 do you know why the "Test case coverage" job fails?

Comment thread scripts/test_case_report.py Resolved
Comment thread scripts/test_case_report.py Resolved
@msschwartz21

Copy link
Copy Markdown
Collaborator

@msschwartz21 do you know why the "Test case coverage" job fails?

It fails when the PR is opened from a fork. It's not relevant for this PR so don't worry about it. It's helpful when adding new metrics or track errors.

return counts


@pytest.fixture(scope="module", params=CASES, ids=lambda c: c.name)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know you could parametrize fixtures! Very useful!

return case, oracle, actual, gt_data.graph.number_of_nodes(), gt_data.graph.number_of_edges()


def test_oracle_scores_follow_from_error_counts(oracle_case):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming, this test case is verifying that the TRA and DET scores reported by the ctc binaries match the error counts that the ctc binaries also report?

@ziw-liu ziw-liu Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to test the _scores helper function, which is used in the "real" test case below instead of the printed output. It also sanity-checks the output parsing. So not really covering anything in the library, just here to demonstrate correctness.

@msschwartz21 msschwartz21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened issues for the two differences you uncovered so that we can address them in future PRs. Thank you Ziwen!

@ziw-liu
ziw-liu merged commit 76a84a5 into live-image-tracking-tools:main Oct 21, 2026
19 of 20 checks passed
@ziw-liu
ziw-liu deleted the ctc-oracle-test branch October 21, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧪 tests Test case related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants