Commit Graph

8 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
389989ece7 refactor(tests): clean up test folder and fix gradient flow issues
Test Cleanup (113 files, -22,000 lines):
- Remove 21 redundant run_all_tests.py files
- Remove checkpoints/ folder (22 obsolete checkpoint files)
- Remove progressive/, debugging/, diagnostic/ folders
- Remove duplicate integration tests and examples
- Remove orphaned dev artifacts and generated outputs
- Consolidate test_gradient_flow_overall.py into system/

Documentation Cleanup (4 files removed):
- Remove duplicate HOW_TO_USE.md, WORKFLOW.md, SYSTEM_DESIGN.md
- Trim environment/README.md from 334 to 86 lines
- Update capstone/README.md removing outdated bug references

Test Fixes:
- Add requires_grad=True to layer parameters in gradient tests
- Fix PositionalEncoding argument order in test_shapes.py
- Adjust performance thresholds for realistic expectations
- Fix gradient clipping to handle memoryview correctly
- Update zero_grad assertions to accept None or zeros
2026-01-24 12:22:37 -05:00
Vijay Janapa Reddi
42face28fb refactor(tests): remove all pytest.skip patterns for honest test results
- Move imports to module level in all *_core.py test files (16 files)
- Remove try/except/skip patterns from integration tests
- Remove @pytest.mark.skip decorators from gradient flow tests
- Convert environment validation skips to warnings for optional checks
- Change milestone tests from skip to fail when scripts missing

Tests now either pass or fail - no silent skipping that hides issues.
This ensures the test suite provides accurate feedback about what works.
2026-01-23 23:06:23 -05:00
Vijay Janapa Reddi
acb5142fd7 fix(tests): resolve import issues and test naming collisions
- Fix incorrect imports (tinytorch.text/nn/data → tinytorch.core.*)
- Fix MeanSquaredError → MSELoss imports
- Fix learning_rate= → lr= for optimizer arguments
- Rename test_progressive_integration.py files to unique names
- Add missing PerformanceTestSuite classes to performance framework
- Add pytest config to tinytorch/pyproject.toml to override coverage

This resolves the pytest collection errors caused by module name conflicts.
2026-01-23 17:59:43 -05:00
Vijay Janapa Reddi
44e5822fbc fix(tests): correct MODULE_NUMBER and MODULE_NAME in all run_all_tests.py
Fixed copy-paste errors where MODULE metadata was incorrect:
- 01_tensor: 02 → 01
- 02_activations: 03 → 02
- 03_layers: 04 → 03
- 04_losses: Dense/Networks → Losses
- 05_dataloader: 09/Autograd → 05/DataLoader
- 06_autograd: XX → 06/Autograd
- 07_optimizers: 06/Spatial/CNN → 07/Optimizers
- 08_training: XX → 08/Training
- 09_convolutions: XX → 09/Convolutions
- 10_tokenization: XX → 10/Tokenization
- 11_embeddings: XX → 11/Embeddings
- 12_attention: XX → 12/Attention
- 13_transformers: XX → 13/Transformers
- 14_profiling: KV Caching → Profiling
- 15_quantization: Module 16 → Module 15
- 18_memoization: XX → 18/Memoization
2026-01-23 13:17:15 -05:00
Vijay Janapa Reddi
41023a17ca fix(tests): remove misplaced autograd tests from 05_dataloader
test_autograd_core.py was incorrectly placed in the 05_dataloader test
directory. These tests belong in 06_autograd since they test autograd
functionality that doesn't exist until Module 06.

This was causing test failures when students ran tests progressively
through the modules (issues #1127, #1112).
2026-01-23 13:16:58 -05:00
Vijay Janapa Reddi
d8475a0b59 fix(tests): enforce progressive disclosure in integration tests
Fixed module integration tests to only use modules up to and including
the current module (progressive disclosure). Tests were importing from
future modules which caused validation failures.

Changes:
- Module 05: Remove seed parameter (DataLoader does not support it)
- Module 06: Remove spatial/attention imports (modules 09, 12)
- Module 07: Make gradient tests lenient for partial autograd
- Module 08: Remove spatial imports (module 09)
- Module 09: Remove attention imports (module 12)

Validation result: All 20 modules now pass
2026-01-15 14:45:14 -05:00
Vijay Janapa Reddi
d203fba8b8 fix: complete module renumbering across entire codebase
Updated all references to reflect new module order:
- Module 05: DataLoader (was 08)
- Module 06: Autograd (was 05)
- Module 07: Optimizers (was 06)
- Module 08: Training (was 07)

Changes include:
- paper/paper.tex: 20+ references, tier descriptions, milestones
- src/: Export commands, dependency diagrams, docstrings
- tests/: Dependency chains, integration tests, README
- tito/: export_utils.py path mappings
- tinytorch/: Auto-generated package file headers

Foundation Tier is now Modules 01-08
Architecture Tier is now Modules 09-13
2025-12-19 17:43:41 -05:00
Vijay Janapa Reddi
5b423f917a refactor(tinytorch): rename module directories for dataloader reordering
Move DataLoader from position 08 to 05, cascading renumbers:
- 08_dataloader → 05_dataloader
- 05_autograd → 06_autograd
- 06_optimizers → 07_optimizers
- 07_training → 08_training

Addresses module dependency reorganization to place DataLoader
earlier in the learning path (before autograd).
2025-12-18 13:07:19 -05:00