test: end-to-end roundtrip tests comparing decomposition vs direct Ondsel #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Build a comprehensive test suite that validates the decomposition solver against the Ondsel backend by solving identical assemblies with both and comparing results.
Context
The decomposition solver is a meta-solver that wraps Ondsel — its results must be equivalent (within tolerance) to solving the same problem monolithically. Roundtrip tests are the primary correctness validation: if decompose → dispatch → reconcile produces the same placements as direct Ondsel, the decomposition is correct.
These tests require either the real
kcsolvemodule (FreeCAD build) or carefully constructed mock solvers that replicate Ondsel's behavior for known test cases.Depends on: #30 (DecompositionSolver — the complete pipeline to test)
Test assemblies
Tier 1: Minimal cases (2-3 parts)
Tier 2: Medium assemblies (5-10 parts)
Tier 3: Stress cases (50-100 parts)
Tier 4: Diagnostic validation
Test structure
Benchmark tests
In addition to correctness, measure timing:
solve()wall time for both solvers on each test assemblyBenchmarks should be marked with
@pytest.mark.benchmarkand not run in CI by default.Tasks
_solve_both()helper (with mock fallback when kcsolve unavailable)@pytest.mark.benchmarkAcceptance criteria