Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
==========================================
+ Coverage 96.50% 96.61% +0.11%
==========================================
Files 29 31 +2
Lines 1916 1980 +64
==========================================
+ Hits 1849 1913 +64
Misses 67 67 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 4/5
- Minor but concrete edge-case risk:
src/tdhook/latent/dimension_estimation/twonn.pycan hit an IndexError whenndim < 2because it routes into the batched path without validation. - Overall risk is low since the issue is a specific input validation gap with limited scope and no other findings.
- Pay close attention to
src/tdhook/latent/dimension_estimation/twonn.py- validate dimensionality before calling_write_batched_resultto avoid batched path errors.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/tdhook/latent/dimension_estimation/twonn.py">
<violation number="1" location="src/tdhook/latent/dimension_estimation/twonn.py:34">
P2: Validate input dimensionality before calling _write_batched_result; ndim < 2 currently falls into the batched path and will throw IndexError.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/tdhook/latent/dimension_estimation/twonn.py">
<violation number="1" location="src/tdhook/latent/dimension_estimation/twonn.py:49">
P2: The new singleton handling drops batch dimensions for batched inputs with size-1 batch axes (e.g., data shape (1, N, D)), so out_key_x/out_key_y shapes no longer match the batch_shape used for out_key. This breaks shape consistency for callers that rely on batch preservation.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Key insights about the PR.
Linked Issues
Checklist
Summary by cubic
Adds TwoNN intrinsic dimension estimation as a TensorDict module with batched support and optional x/y diagnostics. Fixes return_xy batch shape handling (multi-batch and size-1 axes) and seeds tests for stable determinism; addresses part of #34.
New Features
Bug Fixes
Written for commit 46e1ae3. Summary will update on new commits.