-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Repository Research and Test Coverage Analysis
Repository Overview
Furnace is an F# tensor library for differentiable programming, designed for machine learning with PyTorch-familiar naming and LibTorch backend support. It's a fork of DiffSharp with nested/mixed-mode differentiation capabilities.
Technology Stack:
- F# (.NET 6.0)
- LibTorch/PyTorch backend (TorchSharp bindings)
- Reference backend for semantic definition
- GPU/CUDA support available
- Testing framework: .NET test framework
Current Test Coverage Analysis
Based on coverage/Summary.txt (generated 08/30/2025 - 01:16:27):
Overall Coverage:
- Line coverage: 75.2% (1879/2497 lines covered)
- Branch coverage: 45.5% (3115/6842 branches covered)
⚠️ LOW - Method coverage: 67.3% (832/1236 methods covered)
Areas of Concern (Low Coverage):
Critical Issues (0% coverage):
Furnace.Backends.Reference.Utils- 0.0%Furnace.TorchExtensions- 0.0%Furnace.Data.MNIST- 0.0%Furnace.Util.helpers- 0.0%Furnace.Util.Pyplot- 0.0%
Low Coverage Areas (< 60%):
Furnace.Backends.Reference.RawTensorBFloat16- 51.5%Furnace.Backends.Reference.RawTensorFloat16- 51.5%Furnace.Backends.Reference.RawTensorBool- 57.1%Furnace.Backends.Torch.Utils- 58.5%Furnace.Dataoverall - 55.6%
Build and Test Commands
Build:
dotnet restore
dotnet build --configuration Release --no-restoreRun Tests:
dotnet test --configuration ReleaseGenerate Coverage Report:
# Install ReportGenerator
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.1.26
# Run tests with coverage
dotnet test --configuration Release --no-build \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=opencover \
/p:CoverletOutput="$PWD/coverage/coverage.opencover.xml"
# Generate HTML reports
reportgenerator \
-reports:"$PWD/coverage/coverage.opencover.xml" \
-targetdir:"$PWD/coverage" \
-reporttypes:HtmlTest Organization
- Main test project:
tests/Furnace.Tests/ - Tests organized by functionality:
TestTensor.fs,TestModel.*.fs,TestOp.*.fs, etc. - Benchmarks:
tests/Furnace.Benchmarks/ - Test utilities in
TestUtils.fs
Improvement Strategy
Phase 1: Zero Coverage Classes (Highest Impact)
- Utils classes - Often contain essential utility functions
- MNIST data loading - Critical for ML workflows
- Plotting utilities - Important for data visualization
- TorchExtensions - Core PyTorch interop functionality
Phase 2: Low Coverage Numeric Types
- BFloat16/Float16 tensor operations - Modern ML precision types
- Boolean tensor operations - Logic operations
- Reference backend utilities - Semantic correctness validation
Phase 3: Branch Coverage Improvement
- Focus on conditional logic, error handling, edge cases
- Current 45.5% branch coverage indicates many code paths untested
Opportunities for Major Coverage Increases
- Property-based testing for tensor operations across different dtypes
- Error condition testing - Invalid inputs, dimension mismatches
- Backend comparison tests - Reference vs Torch consistency
- Data loading edge cases - Corrupted files, missing data
- GPU/CPU backend switching tests
Questions for Maintainers
- Are the 0% coverage utility classes actually used in production code?
- Should we prioritize Reference backend completeness for semantic correctness?
- What's the priority between line coverage vs branch coverage improvements?
- Are there specific tensor operations or edge cases known to be problematic?
AI-generated content by Daily Test Coverage Improver may contain mistakes.
Metadata
Metadata
Assignees
Labels
No labels