Regenerate ground-truth expected files from C# output; remove C++-mimicking implementation artifacts#3
Merged
MichaConrad merged 3 commits intomainfrom Feb 22, 2026
Conversation
…xt files Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
…ted files Co-authored-by: MichaCo <5837539+MichaCo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor unit tests for performance and maintainability
Regenerate ground-truth expected files from C# output; remove C++-mimicking implementation artifacts
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test suite used expected files generated from the C++ CDT implementation. 90/990 tests failed due to tie-breaking divergence in degenerate cases — correct Delaunay output, wrong C++ parity. The fix: C# expected files generated from C# output, and removal of code that existed solely to match C++ internals.
Expected files
.expectedfiles regenerated from the C# triangulation154_*.txt) not referenced by any test assertionf32_/f64_filesTriangulation.cs— removed C++-mimicking implementationsnth_elementport (~170 lines withgoto): replaced with a 20-line Lomuto quickselectSplitMix64PRNG: removed entirelyInsertVertices_Randomizedshuffle →Random.SharedFisher-YatesWalkTrianglesedge offset →guard % 3Unsafe.As): deleted;using static CDT.TriangleUtilsadded so all 17 call sites are unchangedTriangleUtils.cs— collapsed duplicate overloadsReplaced 8 type-specific
double/floatoverload pairs with 4 generic methods. A single privateOrient2D<T>helper centralises the one unavoidableUnsafe.Asdispatch (needed becausePredicateshas fundamentally different adaptive-precision implementations for each type).IntersectionPosition<T>now uses genericTarithmetic with no unsafe casts:Net: −586 / +261 lines. All 990 tests pass.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.