progressive-verification-debugging
Skill5 starsChanged 34 days agoMITView on GitHub
Progressive verification methodology for debugging complex systems. Use when: (1) Facing mysterious crashes or errors with no clear cause, (2) System works in some environments but not others, (3) Multiple potential failure points exist, (4) Need to isolate whether issue is environment configuration vs code bug. Core principle: Start with simplest test, gradually increase complexity to pinpoint exact failure point.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-validation-kaggleSkill
- agent-nurture-frameworkSkill
- agent-session-memory-protocolSkill
- arxiv-paper-searchSkill
- autogluon-firstSkill
- autogluon-preset-strategySkill
- autogluon-timeseries-strategySkill
- catboost-first-tabularSkill
- claudeceptionSkill
- code-competition-artifact-pipelineSkill
- competition-orchestration-multimodelSkill
- context-engineeringSkill
- controlled-submission-experimentSkill
- cross-competition-feature-transferSkill
- cv-lb-gap-acknowledgmentSkill
- domain-knowledge-constraints-trapSkill
- ensemble-model-correlation-trapSkill
- feature-engineering-saturation-detectionSkill
- gpu-readiness-assessmentSkill
- gsd-loop-engineeringSkill
- kaggle-cognitive-cost-optimizationSkill
- kaggle-competition-best-practicesSkill
- kaggle-competition-type-strategySkill
- kaggle-data-format-firstSkill
- kaggle-discussion-searchSkill
- kaggle-experiment-sopSkill
- kaggle-oof-lb-validation-protocolSkill
- kaggle-optimal-blendingSkill
- kaggle-submission-format-by-metricSkill
- kaggle-top-performer-replicationSkill
- knowledge-crystallization-feedback-loopSkill
- ladder-drift-and-meta-aware-regressionSkill
- learned-value-beats-heuristic-augmentationSkill
- llm-competition-pipelineSkill
- mcts-pipeline-searchSkill
- mem0-dynamic-graph-memorySkill
- memory-hierarchy-managementSkill
- ml-sweet-spot-principleSkill
- model-ensemble-negative-weight-effectSkill
- multi-agent-rolesSkill
- multi-level-aggregation-overfittingSkill
- okf-visualize-knowledgeSkill
- onnx-minimal-network-designSkill
- per-category-modeling-backfireSkill
- ptcg-2ply-bounded-searchSkill
- ptcg-bc-large-model-submissionSkill
- retail-eda-frameworkSkill
- rmsle-zero-threshold-asymmetrySkill
- runtime-reflexionSkill
- sc-tir-mathematical-reasoningSkill
- self-evolving-skillsSkill
- skill-governance-and-automationSkill
- spatiotemporal-graph-feature-engineeringSkill
- store-sales-darts-chronos-blendSkill
- tabular-polynomial-features-breakthroughSkill
- three-layer-wisdom-extractionSkill
- time-series-walk-forward-validationSkill
- trueskill-simulation-competition-strategySkill
- ts-day-specific-forecastingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When debugging complex systems (ML training, distributed systems, integrations), it's easy to:
- Distinctive: line 46
Create a test ladder from simplest to most complex:
- Distinctive: line 134
When Level N fails, you know the problem is at that exact level:
- Distinctive: line 158
After applying this methodology:
- Distinctive: line 190
Experiment: Run test for level N
- Distinctive: line 196
If you have strong evidence, you can skip levels:
- Distinctive: line 232
Test-driven development (TDD) mindset
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Progressive Verification Methodology
Problem
When debugging complex systems (ML training, distributed systems, integrations), it's easy to:
- Waste time checking logs without a strategy
- Assume the wrong component is broken
- Try complex solutions before understanding root cause
- Get overwhelmed by multiple potential failure points
Context / Trigger Conditions
Use this methodology when:
- Silent crashes with no error messages
- "Works on my machine" but fails elsewhere
- Multiple layers: environment → code → data → model
- Version compatibility issues suspected
- Need to isolate environment vs code issues
Classic symptoms:
- Process exits silently after starting
- GPU utilization 0-1% despite training script running
- Empty log files despite process being active
- Different behavior across platforms (Mac vs WSL2 vs Linux)
Solution
Core Principle
"先要用简单代码验证环境,然后判断是不是配置问题"
Always start with the simplest test, gradually increase complexity.
Progressive Verification Steps
Create a test ladder from simplest to most complex:
Level 1: Basic Infrastructure
├── Test: torch.randn(2, 3).cuda()
└── Validates: CUDA driver, GPU access
Level 2: Core Components
├── Test: nn.Linear(10, 5).cuda()
└── Validates: Model creation, CUDA memory allocation
Level 3: Real Models
├── Test: ResNet50(weights=None).cuda()
└── Validates: Complex model architecture
Level 4: Data Pipeline (Synthetic)
├── Test: DataLoader with random tensors
└── Validates: DataLoader, multiprocessing
Level 5: Data Pipeline (Real)
├── Test: PIL.Image.open + transforms
└── Validates: File I/O, image decoding
Level 6: Training Loop
├── Test: Single forward + backward pass
└── Validates: Optimization, gradient flowDecision Tree
Does Level N pass?
├── Yes: Proceed to Level N+1
└── No: Issue is at Level N
└── Fix before proceedingExample Test Script
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from torchvision.models import resnet50
from PIL import Image
print("=== Progressive Verification ===")
# Level 1: Basic CUDA
print("Level 1: Basic CUDA")
x = torch.randn(10, 10).cuda()
print(" PASSED")
# Level 2: Model on CUDA
print("Level 2: Model on CUDA")
model = nn.Linear(10, 5).cuda()
y = model(x)
print(" PASSED")
# Level 3: ResNet50 on CUDA
print("Level 3: ResNet50 on CUDA")
resnet = resnet50(weights=None).cuda()
print(" PASSED")
# Level 4: DataLoader (synthetic)
print("Level 4: DataLoader (synthetic)")
class DummyDataset(Dataset):
def __len__(self): return 10
def __getitem__(self, i): return torch.randn(3, 224, 224), 0
ds = DummyDataset()
loader = DataLoader(ds, batch_size=4, num_workers=0)
for x, y in loader:
x, y = x.cuda(), y.cuda()
output = resnet(x)
break
print(" PASSED")
# Level 5: Real data loading
print("Level 5: Real data loading")
# Test actual file loading here
print(" PASSED")
print("All levels passed!")Strategy: Isolate Variables
When Level N fails, you know the problem is at that exact level:
| Fail Level | Known Working | Known Broken | Likely Issue |
| Level 1 | None | CUDA basics | Driver, GPU |
| Level 2 | CUDA | Model creation | Memory, architecture |
| Level 3 | Simple models | Complex models | Model size, dependencies |
| Level 4 | Models | DataLoader | Multiprocessing, I/O |
| Level 5 | Synthetic data | Real data | File format, permissions |
| Level 6 | Data loading | Training loop | Optimizer, gradients |
Common Anti-Patterns
❌ Don't: Run full training script first, then debug when it fails ✅ Do: Verify each component independently before combining
❌ Don't: Check logs without hypothesis ✅ Do: Create minimal test to confirm hypothesis
❌ Don't: Change multiple things at once ✅ Do: Change one variable, test, repeat
Verification
After applying this methodology:
- You should know exactly which level fails
- You should have a minimal reproduction (the failing test)
- You should have eliminated all higher levels as causes
- Fix should be validated by re-running that specific test
Example: WSL2 PyTorch Debug Session
Problem: Training crashes silently after 1-3 batches
Progressive Verification Results:
- Level 1 ✅: Basic CUDA works
- Level 2 ✅: Model on CUDA works
- Level 3 ✅: ResNet50 on CUDA works
- Level 4 ✅: DataLoader with dummy data works
- Level 5 ❌: Real image loading fails with
._train_XXXX.png
Root Cause Identified: macOS metadata files
Fix Applied: Filter out ._ prefix in file listing
Result: Training works after fix
This took 30 minutes with progressive verification vs. hours without it.
Notes
Philosophy
This methodology is based on scientific method:
- Hypothesis: Problem is at level N
- Experiment: Run test for level N
- Observe: Pass or fail
- Conclude: Isolate or eliminate
When to Skip Levels
If you have strong evidence, you can skip levels:
- Previous debugging already ruled out lower levels
- Error message directly points to specific component
- Similar issue was solved before
But always verify your assumption first!
Time Trade-off
Creating tests takes time upfront, but saves time overall:
- Test creation: 10-20 minutes
- Focused debugging: 20-60 minutes
- Total: 30-80 minutes
vs. random debugging:
- Log spelunking: 1-2 hours
- Trial-and-error: 2-4 hours
- Total: 3-6 hours
Adaptability
This pattern applies beyond ML:
- Web services: Database → API → Frontend → Integration
- Data pipelines: Source → Extract → Transform → Load
- DevOps: Local → Staging → Production
- Distributed systems: Single node → Cluster → Network
References
Empirical validation:
- WSL2 PyTorch training crash (2026-03-01): Isolated PIL image loading issue in 30 minutes
- Progressive testing reduced debugging time by 60-80% across multiple sessions
Related concepts:
- Binary search algorithm applied to debugging
- Minimal reproducible example (MRE) principle
- Test-driven development (TDD) mindset
See also:
- wsl2-pytorch-training-crash - Specific application example
- systematic-debugging - General debugging workflow
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

