Skip to content

Fix infinite retry loops, bare asserts, double iteration counter, and stale docstring#304

Merged
ekosman merged 2 commits intomainfrom
copilot/improve-repository-structure
Feb 21, 2026
Merged

Fix infinite retry loops, bare asserts, double iteration counter, and stale docstring#304
ekosman merged 2 commits intomainfrom
copilot/improve-repository-structure

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

Several reliability and correctness bugs across the data loading and training pipeline. Key issues: retry loops with no exit condition could hang indefinitely, bare assert statements are silently stripped under -O, and self.iteration was double-incremented per training step.

Fixes

  • Infinite retry loops (data_loader.py, features_loader.py): All three while not succ retry loops now accept max_retries=10 and raise RuntimeError after exhaustion instead of spinning forever
  • Bare asserts → FileNotFoundError (features_loader.py): assert os.path.exists(path) replaced with explicit guards in both FeaturesLoader._get_features_list and FeaturesLoaderVal._get_features_list
  • Double self.iteration increment (network/TorchUtils.py): self.iteration += 1 appeared at both the top and bottom of the do_epoch loop body, advancing the counter by 2 per step — removed the duplicate at the bottom
  • Placeholder docstring (features_loader.py): get_feature returned _type_: _description_ — replaced with accurate return type annotation tuple[Tensor, Tensor, int] and description
  • Misleading log prefixes: FeaturesLoader.__getitem__ and FeaturesLoaderVal.__getitem__ logged errors as VideoIter:: — corrected to their actual class names

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ncomplete docstring

Co-authored-by: ekosman <10260165+ekosman@users.noreply.github.com>
Copilot AI changed the title [WIP] Update repository organization for better usability Fix infinite retry loops, bare asserts, double iteration counter, and stale docstring Feb 21, 2026
Copilot AI requested a review from ekosman February 21, 2026 23:04
@ekosman ekosman marked this pull request as ready for review February 21, 2026 23:04
@ekosman ekosman merged commit 11e8fc2 into main Feb 21, 2026
4 checks passed
@ekosman ekosman deleted the copilot/improve-repository-structure branch February 21, 2026 23:09
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.

2 participants