This document provides instructions for building and testing the BiCGSTAB and linSolve0 re-enablement.
- Stack build tool installed
- Internet connection for downloading dependencies
# Build the project
stack build
# Or using make
make buildExpected output: Successful compilation with no errors.
# Run full test suite
stack test
# Or using make
make test# Test BiCGSTAB only
stack test --test-arguments "-m BiCGSTAB"
# Test CGS only
stack test --test-arguments "-m CGS"
# Test linSolve0 interface
stack test --test-arguments "-m linSolve"- ✅ bicgsInit creates initial BiCGSTAB state
- ✅ bicgstabStep performs one iteration
- ✅ BiCGSTAB converges on 2x2 system
- ✅ BiCGSTAB converges on 3x3 SPD system
- ✅ prop_bicgstab : BiCGSTAB converges for SPD systems (100 QuickCheck cases)
- ✅ BiCGSTAB (2 x 2 dense)
- ✅ BiCGSTAB (3 x 3 sparse, symmetric pos.def.)
- ✅ CGS (2 x 2 dense)
- ✅ CGS (3 x 3 sparse, SPD)
- ✅ CGNE (2 x 2 dense)
- ✅ CGNE (3 x 3 sparse, SPD)
- ✅ cgsInit creates initial CGS state
- ✅ cgsStep performs one iteration
- ✅ CGS converges on 2x2 system
- ✅ CGS converges on 3x3 SPD system
- ✅ prop_cgs : CGS converges for SPD systems (100 QuickCheck cases)
-
Check tolerance settings: The tests use lenient tolerances (1e-4 relative, 1e-6 absolute)
- If tests fail due to convergence issues, consider increasing the number of iterations
- Location:
test/LibSpec.hs, functionscheckBiCGSTAB,checkCGS
-
Check system properties: Property tests guard against degenerate cases:
- Systems smaller than 3x3
- Nearly zero RHS or solution vectors
- Very sparse matrices with few non-zeros
- Large sparse systems (n > 20 with density < 0.1)
-
Debug with trace output: Use
checkCGSDebugfunction for detailed iteration output -
Verify preconditioning: Consider adding preconditioning for ill-conditioned systems
If stack build fails due to network timeouts:
- Try again - sometimes Stackage servers are temporarily unavailable
- Check your internet connection
- Try using a different resolver in
stack.yaml - Use cached dependencies if available:
stack build --no-install-ghc
Before considering the task complete:
-
stack buildcompletes successfully with no warnings - All BiCGSTAB tests pass
- All linSolve0 tests pass
- All existing tests (CGS, etc.) still pass
- No new compiler warnings introduced
- Documentation is up to date
- BiCGSTAB typically converges faster than CGS on most systems
- BiCGSTAB is more stable for ill-conditioned matrices
- linSolve0 uses 200 fixed iterations - convergence usually happens much sooner
- Property tests may take a few seconds due to QuickCheck generating 100 test cases
After successful build and test:
- Review test output for any warnings
- Check if any tests are flaky or timeout
- Consider adding preconditioner support
- Benchmark performance against other solvers
- Add more comprehensive documentation/examples