Skip to content

fix: preserve dictionary key comparers across value conversion - #45

Merged
AGiorgetti merged 1 commit into
developfrom
fix/codex-issue-31-dictionary-comparers
Oct 9, 2026
Merged

AGiorgetti merged 1 commit into
developfrom
fix/codex-issue-31-dictionary-comparers

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #31.

  • Preserve a concrete Dictionary source's compatible key comparer when the selected key conversion is language identity, independently of value conversion.
  • Use the destination default comparer for custom key conversions, including same-type local/default/external converters. Retain Add collision semantics and existing set behavior.
  • Add 31 generator regressions and a shared normally compiled example used by clean-package, framework/language, normal, trimmed, and Native AOT consumers. Synchronize consumer guidance and implementation records.
  • No public API or specification semantics change.

Test-first evidence

  • On unchanged develop c973aac8e457cc40a4069889aeab49d8278ccca3, the new 31-case C# 9 fixture produced 19 failures and 12 passing controls, zero skips.
  • Value widening and structural mapping lost comparer identity; same-type custom key mappings incorrectly retained it. Fixture inputs compile without unrelated errors, and successful generated fixtures are warning-free.
  • The normally compiled Collections sample independently built with zero warnings/errors, then failed its comparer-preservation assertion.
  • Coverage includes all three dictionary destinations, empty collections, nullable structural values, same-type/widening value converters, local/default/external key converters, independent mutation, Add collisions, interface-declared sources, member/update helpers, null policies, and same-driver deterministic output.

Local validation

  • Final Release solution build: zero warnings/errors.
  • Full generator: 904 passed; runtime: 5 passed; integration: 1 passed. Zero failures/skips in these projects.
  • Focused dictionary/collection/set group: 96 passed, zero failures/skips.
  • All three source samples passed. Actual generated source preserves the comparer for identity keys and uses default construction for transformed keys, with one foreach/Add loop.
  • Available packaging: 224 passed, two infrastructure failures, zero skips.
  • All 12 framework/language combinations compile and execute the shared dictionary example, including genuine netstandard2.0 references, plus net8.0/net9.0/net10.0 and C# 9/14/latest.
  • Clean-package samples, usage validation, package/API checks, and benchmark smoke passed.
  • Independent read-only review found no scoped blocker. Consumer-skill and CRLF-aware diff checks passed.
  • Every uploaded blob and the remote tree matches the tested local source tree 34cc2cfead4977b84e1884c336d66ddf7651afaf.

Local environment limits

Trimming and Native AOT fail at ILLink's ComputeManagedAssemblies task-host creation with MSB4216 / Unix-domain SocketException (13), before publish behavior is established. PowerShell and clang are absent; 49 PowerShell-dependent tests were not run locally. No assertion, warning, dependency, prerequisite, credential, or security setting was weakened.

Validation used the existing official Microsoft SDK 10.0.401 and runtimes 8.0.31/9.0.20/10.0.12, workspace-local caches/temporary files, and one-processor builds.

CI and review

Exact-head CI run 37944436770 succeeded for cc123ef7e1e7dd5078588d5867b0e60a40b90b2e.

  • Windows and Linux each passed 1,185 tests: 904 generator, 275 packaging, 5 runtime, and 1 integration; zero failures and zero skipped tests on each OS.
  • All six Roslyn jobs (4.8.0, 4.14.0, and 5.9.0 on both OSes) passed 904 tests each, with zero failures/skips.
  • Both full jobs cover the locally unavailable PowerShell, trimming, and Native AOT checks. Linux sample/benchmark smoke and both solution-path checks also passed.
  • Release packing, artifact verification, and NuGet publication jobs were correctly skipped for this ordinary PR event.

The PR was opened as a draft and subsequently merged by the maintainer at 2026-10-09 14:37:41 UTC as 7b19def74753df90cb3770c7410ff5d7a3951244. No merge, release, tag, NuGet publication, or workflow dispatch was performed by Codex.

Issue #32 and the previously documented nullable-intermediate enum defect remain outside this scope.

Prepared with OpenAI Codex.

Classify the selected key conversion independently of dictionary values. Preserve compatible comparers for identity keys and use default comparison for custom key conversions. Add runtime, generated-source, sample, and package-consumer coverage.

Fixes #31.

Co-authored-by: Codex <codex@openai.com>
@AGiorgetti
AGiorgetti marked this pull request as ready for review October 9, 2026 14:34
@AGiorgetti
AGiorgetti merged commit 7b19def into develop Oct 9, 2026
11 checks passed
@AGiorgetti
AGiorgetti deleted the fix/codex-issue-31-dictionary-comparers branch October 9, 2026 14:37
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.

[P3] Preserve dictionary key comparers when only the value type changes

1 participant