agentsclimarketplace

Research debugging

Skill Gaaaavin/claude-eureka/skills/research-debugging

Debugging guidance for research code — triggers on: error, exception, failed, crash, NaN, OOM, CUDA, traceback, bug, brokenFrom its SKILL.md

Install
npx -y skills add Gaaaavin/claude-eureka --skill research-debugging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.6 KB, as published. Nobody here has run it

Debugging Protocol

When encountering errors in research code, follow this order strictly.

1. Understand before fixing

  • Read the full error message and traceback, not just the last line.
  • Identify the exact line and operation that failed.
  • Do NOT guess-and-patch. Reproduce the error first if possible.

2. ML debugging order

Check in this sequence — most bugs are data bugs:

  1. Data: shapes, dtypes, NaN/Inf values, loader output, augmentation correctness
  2. Model: parameter shapes, forward pass with dummy input, gradient flow
  3. Training loop: loss computation, optimizer step, scheduler, logging
  4. Infrastructure: GPU memory, CUDA version, library compatibility

3. Check recent changes

git diff HEAD~3 --stat
git log --oneline -5

If it worked before, the bug is in the diff.

4. Quick-check lists

NaN values:

  • Check learning rate (too high?)
  • Check loss function inputs (log of zero? division by zero?)
  • Check data normalization
  • Insert torch.autograd.set_detect_anomaly(True) temporarily

OOM (Out of Memory):

  • Reduce batch size first
  • Check for tensor accumulation in loops (missing .detach() or with torch.no_grad())
  • Profile with torch.cuda.memory_summary()

CUDA errors:

  • Device mismatch: print .device for all tensors involved
  • Shape mismatch: print .shape at each step
  • Driver issue: check nvidia-smi and torch.cuda.is_available()

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.