codepath-debugging

Trace Python runtime failures and tensor shape mismatches to their root cause.

3|Updated Apr 21, 2024
One-click install
npx skills add https://github.com/gabrielfruet/.dotfiles --skill codepath-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codepath-debugging
Source: https://github.com/gabrielfruet/.dotfiles/tree/main/pi/agent/skills/codepath-debugging
Command: npx skills add https://github.com/gabrielfruet/.dotfiles --skill codepath-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork and hours of wasted effort when debugging runtime failures, tracebacks, unexpected behavior, value/config mismatches, or tensor/data shape issues, helping you pinpoint the exact root cause without modifying any project code.

Core Features & Use Cases

  • Systematic Backward Tracing: Start at the exact failure or observation site and walk backward through callers to find where the incorrect value, config, or input was first created.
  • Structured Variable Ledger: Track important variables' origins, transformations, concrete values/shapes, and next consumers to avoid missing critical context during investigation.
  • ML/PyTorch Specialized Guidance: Includes targeted checks for tensor shape tracking through dataset → transform → collate → model → loss pipelines, train/eval mode mismatches, dtype/device issues, and common convolution/pooling output calculations.
  • Use Case: If you encounter a tensor shape mismatch during PyTorch model training, use this Skill to trace the shape through each pipeline step to isolate the first point of divergence between working and failing runs.

Quick Start

Use the codepath-debugging skill to trace the root cause of the latest traceback you encountered in your Python project without modifying any project files.

Frequently Asked Questions about codepath-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace a Python traceback to its root cause without modifying project code?

You trace runtime failures back to their root cause by systematically walking backward from the failure site through callers and building a structured variable ledger, without modifying project files.

What is the best way to debug tensor shape mismatches in a PyTorch training pipeline?

Debug tensor shape mismatches by tracking tensor shapes through the dataset, transform, collate, model, and loss pipeline steps to isolate the first point of divergence between working and failing runs.

How does building a variable ledger help with root cause analysis?

Building a variable ledger helps root cause analysis by tracking important variables' origins, transformations, concrete values or shapes, and next consumers to capture critical context during runtime error investigation.

Can I use this approach to debug train and eval mode mismatches in PyTorch?

Yes, you can use this approach to debug PyTorch train and eval mode mismatches, dtype and device issues, as well as common convolution and pooling output calculations.

Do I need to install any dependencies to trace runtime errors with this method?

No, you do not need to install any dependencies to trace runtime errors with this method, as it proposes minimal instrumentation for validation and relies on a structured process rather than external packages.