Skip to content

test(tinytorch): regression coverage for architecture module gaps - #3

Closed
Shashank-Tripathi-07 wants to merge 1 commit into
devfrom
mcdc-03-architecture
Closed

test(tinytorch): regression coverage for architecture module gaps#3
Shashank-Tripathi-07 wants to merge 1 commit into
devfrom
mcdc-03-architecture

Conversation

@Shashank-Tripathi-07

@Shashank-Tripathi-07 Shashank-Tripathi-07 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds regression tests for architecture module gaps found by an MC/DC audit: convolutions, tokenization, embeddings, attention, and transformers. Independent of the other companion PRs in this series (#1, #2, #4, #5), each covers a different module group and can be reviewed/merged in any order.

Covered gaps:

  • Non-4D input validation for Conv2d/MaxPool2d/AvgPool2d
  • Conv2d's requires_grad propagation when neither operand needs gradients
  • BatchNorm2d's standalone pytest coverage (previously zero)
  • tokenize_dataset's default no-truncation path, create_tokenizer's invalid-strategy error
  • Embedding's out-of-range and negative index validation
  • PositionalEncoding's four shape-validation checks
  • MultiHeadAttention's non-3D mask handling and embed_dim mismatch check
  • LayerNorm's all-frozen requires_grad branch

Pure regression tests, no source or package files touched.

Test plan

  • pytest tests/09_convolutions tests/10_tokenization tests/11_embeddings tests/12_attention tests/13_transformers -q passes locally, including all new cases
  • Verified each new test's target behavior directly against a clean origin/dev checkout before adding it

Covers convolutions, tokenization, embeddings, attention, and transformers:
non-4D input validation for Conv2d/MaxPool2d/AvgPool2d, requires_grad
propagation when neither operand needs gradients, BatchNorm2d's standalone
pytest coverage, tokenize_dataset's default (no truncation) path,
create_tokenizer's invalid-strategy error, Embedding's out-of-range and
negative index validation, PositionalEncoding's four shape-validation
checks, MultiHeadAttention's non-3D mask handling and embed_dim mismatch
check, and LayerNorm's all-frozen requires_grad branch.

Pure regression tests, no source or package files touched. Each test
was verified against a clean origin/dev checkout before being added.
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.

1 participant