fix(tinytorch): stop module start/resume dead-ending on tracking/disk desync - #2026
Closed
Shashank-Tripathi-07 wants to merge 1 commit into
Closed
Conversation
… desync started_modules/completed_modules tracking in .tito/progress.json and the actual notebook under modules/ can go out of sync (e.g. tito system reset --keep-progress clears modules/ but intentionally preserves tracking). When that happens, module start refused with 'already started', pointing to module resume, and module resume then failed inside _open_jupyter with 'directory not found', pointing back at nothing. Neither message ever mentioned the actual fix (module reset --force). Both commands now check whether the notebook actually exists before trusting the tracking flag, and recreate it from src/ when it doesn't, the same way a genuinely new module is created. The normal already-started path (notebook genuinely present) is unchanged.
This was referenced Aug 17, 2026
Closed
Collaborator
Author
Shashank-Tripathi-07
deleted the
fix/tinytorch-module-start-resume-deadlock
branch
August 19, 2026 19:09
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.
Summary
tito module startandtito module resumecan deadlock each other when.tito/progress.json's tracking (started_modules) desyncs from the actual notebook on disk undermodules/. Each command's own failure message points at the other, and neither ever mentions the actual fix.Area
Changes
tito/commands/module/workflow.py:start_modulenow checks whether the notebook directory actually exists before trusting theis_module_startedflag, and recreates it fromsrc/when it doesn't, instead of refusing with 'already started'.resume_modulenow does the same check before calling_open_jupyter, recreating the notebook fromsrc/instead of dead-ending inside_open_jupyterwith 'directory not found'.Testing
quarto render)pytest tests/)tito module test NNfor affected module(s)Reproduced the exact desync on a real, install.sh-created TinyTorch environment: started module 01, then deleted
modules/01_tensor/while leaving.tito/progress.jsonuntouched (the same statetito system reset --keep-progressproduces). Before the fix:tito module start 01refused with 'already started',tito module resume 01then failed with 'Module directory not found: 01_tensor', a closed loop with no escape mentioned in either message. After the fix: both commands detect the missing notebook, print a clear 'was started before, but its notebook is missing, recreating it from source' message, regenerate the notebook via the same_create_module_from_srcpath used for a genuinely new module, and proceed normally (resumegoes on to open Jupyter Lab, confirmed via a real running server). Also confirmed the untouched case: starting an already-started module whose notebook genuinely still exists still correctly refuses and points toresume, unchanged from before.Related Issues
None filed. Found while auditing every
titocommand against a real, isolated TinyTorch install to check which work correctly.By submitting this PR, you agree to release your contribution under the project's license.