Skip to content

fix: use default set comparer after element conversion - #52

Merged
AGiorgetti merged 1 commit into
developfrom
feat/codex-51-set-comparer
Oct 12, 2026
Merged

AGiorgetti merged 1 commit into
developfrom
feat/codex-51-set-comparer

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #51.

  • Resolve the selected set element conversion before choosing a comparer. Preserve compatible source comparers only for language identity; custom conversions use the destination default comparer even when element types match.
  • Keep portable/capacity constructor capability checks, independent collection identity, one-pass enumeration and conversion, null policy, converter precedence and dictionary behavior intact.
  • Add 45 generator regression/control cases and extend the shared portable set sample used by source, clean-package, framework/language, trimmed and Native AOT consumers.
  • Synchronize usage, consumer guidance and implementation records. No public API, dependency, TFM, specification, release or performance-gate change.

Test-first evidence

Unchanged baseline: f7de4cf28ec63c2c3ac4c812cbdbe16502b2be62.

  • New generator fixture: 26 expected contract failures, 19 passing controls, zero skips. All input and generated compilations are checked under C# 9 without warnings.
  • Normally compiled Collections sample: zero-warning build, then the expected default-comparer/value-preservation assertion failed.
  • Actual clean-package baseline matrix: all 12 framework/language cases failed the expected comparer-constructor assertion, without unrelated compiler failures.
  • The issue separately records the executed reproduction against published NuGet 3.0.0: this is a pre-existing defect.

Local validation

  • Release solution build: zero warnings/errors.
  • Full generator: 1,034 passed; runtime: 5 passed; integration: 1 passed. Zero failures/skips.
  • Related focused group: 99 passed, including all 45 new cases.
  • Completed available packaging retry: 224 passed, two infrastructure failures, zero skips.
  • All 12 netstandard2.0/net8.0/net9.0/net10.0 × C# 9/14/latest clean-package consumers pass. Generated-source assertions prove default-comparer parameterless/portable construction versus modern capacity construction and retain identity comparer controls.
  • Clean-package samples, usage/source-sample validation, package/API checks and benchmark smoke pass.
  • Independent read-only review found no scoped code/test blocker; the requested STATUS checkpoint was added after validation. Consumer-skill validation and CRLF-aware diff checks pass.
  • Every uploaded blob and the remote tree match the tested local source tree 535fc13da48b23b9749c29e0f02eba25980c3c14.

Coverage includes all four local/default/registered conversion stages across HashSet/ISet/IReadOnlySet, values distinct under default equality, genuine duplicate collapse, identity/unmarked-helper controls, marked return-input-unchanged converters, empty/null sets, nested/member/update/patch paths, one-shot enumeration, converter counts, instance receivers, exception identity, and same-driver addition/removal determinism.

Local environment limits

Trimming and Native AOT fail before publish behavior is established at ILLink's ComputeManagedAssemblies task-host creation, with MSB4216 / Unix-domain SocketException 13. PowerShell and clang are absent; 49 PowerShell-dependent tests were not run locally.

The first solution attempt was interrupted by automatic approval-review cancellation during packaging and produced no final packaging TRX. Its completed generator/runtime TRX files plus the completed packaging retry and integration run supply the evidence above. This is not a single all-green local solution run.

Official SDK 10.0.401 and runtimes 8.0.31/9.0.20/10.0.12 use task-local caches/temp and one-processor builds. No assertion, warning, prerequisite, dependency, credential or security setting was weakened.

CI and review

Exact-head CI run 38229815308 passed for eff1882e994b46034f97d7633b75a28a87101e17.

  • Windows and Linux each passed 1,315 tests: 1,034 generator, 275 packaging, five runtime and one integration; zero failures and zero skipped tests on each OS.
  • All six Roslyn 4.8.0/4.14.0/5.9.0 Windows/Linux jobs passed 1,034 tests each, zero failures/skips.
  • The complete packaging suites cover the PowerShell, trimming and Native AOT checks unavailable locally.
  • Linux source-sample/benchmark smoke and solution-path checks passed.
  • Release packing, artifact verification and NuGet publishing jobs were correctly skipped for this ordinary PR event.

This PR remains draft for human review. No merge, release, tag, package publication or workflow dispatch was performed. This scoped correctness fix does not establish overall release readiness.

Prepared with OpenAI Codex.

Classify the selected set element conversion before choosing a comparer. Preserve compatible comparers only for language identity and retain capability-based constructors. Add test-first generator, sample, package-consumer and documentation coverage.

Fixes #51.

Co-authored-by: Codex <codex@openai.com>
@AGiorgetti
AGiorgetti marked this pull request as ready for review October 12, 2026 09:38
@AGiorgetti
AGiorgetti merged commit f0d4bee into develop Oct 12, 2026
11 checks passed
@AGiorgetti
AGiorgetti deleted the feat/codex-51-set-comparer branch October 12, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Use the default set comparer after custom element conversion

1 participant