Skip to content

fix: detect HashSet capacity constructor capabilities - #44

Merged
AGiorgetti merged 1 commit into
developfrom
fix/codex-issue-30-hashset-capabilities
Oct 9, 2026
Merged

AGiorgetti merged 1 commit into
developfrom
fix/codex-issue-30-hashset-capabilities

Conversation

@AGiorgetti

@AGiorgetti AGiorgetti commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #30.

  • Probe exact accessible HashSet<T>(int) and HashSet<T>(int, IEqualityComparer<T>) constructor signatures independently through consumer Roslyn symbols.
  • Use parameterless/comparer-only fallbacks when capacity overloads are absent, including on netstandard2.0.
  • Preserve set contents, duplicate collapsing, comparer selection, independent collection identity, and single enumeration. List and dictionary construction are unchanged.
  • Add capability/runtime regressions and a shared normally compiled Collections example used by clean-package, framework/language, normal, trimmed, and Native AOT consumers. Synchronize usage and implementation records; no public API or specification semantics change.

Test-first evidence

  • Final 36-case generator fixture on unchanged develop 63885e1af353b45f85c28fdf2306c06409cd92bb: 15 failures, 21 controls, zero skips.
  • Genuine clean-package baseline matrix: three netstandard2.0 failures, one per C# 9/14/latest variant, each exposing four CS1503 constructor errors; nine modern-framework controls passed, zero skips.
  • Synthetic fixtures independently cover absent, capacity-only, capacity-plus-comparer-only, public/internal/private, wrong-type/arity, and by-ref overloads. Runtime cases verify contents, comparer identity, detached mutation, and one enumeration.
  • Same-driver capability changes match fresh deterministic output.

Local validation

  • Final Release solution build: zero warnings/errors.
  • Full generator: 873 passed; runtime: 5 passed; integration: 1 passed. Zero failures/skips in these projects.
  • Final focused fixture after line-ending verification: 36 passed, zero failures/skips.
  • Available packaging: 224 passed, two infrastructure failures, zero skips.
  • All 12 framework/language combinations compile and execute with exact generated-constructor assertions: portable forms on actual netstandard2.0 references, capacity/combined forms on net8.0/net9.0/net10.0.
  • Clean-package/source samples, usage validation, package/API checks, and benchmark smoke passed.
  • Independent read-only review found no remaining blocker after repairing the clean-sample copy to include all top-level sample C# files.
  • Consumer-skill validation and CRLF-aware diff checks passed.
  • All uploaded blobs and remote tree match the tested local source tree 6351ba8103ad2c867c789eeb3cdca39eb90700b0; the fetched commit was verified and aligned locally.

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 assertions, warning checks, dependencies, prerequisites, credentials, or security settings were weakened.

The fresh cloud workspace restored the previously authorized official Microsoft SDK 10.0.401 and runtimes 8.0.31/9.0.20; runtime 10.0.12 is included. Caches and temporary files are task-local.

CI and review

Exact-head CI run 37935404203 succeeded for 542c24cb886aeae7c33fd2bc34f045e4bb277a35.

  • Windows and Linux each passed 1,154 tests: 873 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 873 tests each, with zero failures/skips.
  • Both full jobs cover the locally unavailable PowerShell, trimming, and Native AOT checks. Linux sample/benchmark smoke and solution-path validation also passed.
  • Release packing, artifact verification, and NuGet publication jobs were correctly skipped for this ordinary PR event.

This PR remains draft for human review and has no merge conflict. No merge, release, tag, NuGet publication, or workflow dispatch was performed.

Dictionary comparer issue #31 and the previously documented nullable-intermediate enum runtime defect remain outside this scope.

Prepared with OpenAI Codex.

Probe exact accessible capacity and capacity-plus-comparer signatures independently and preserve portable set construction. Add capability, runtime, package, sample, and documentation coverage.

Fixes #30.

Co-authored-by: Codex <codex@openai.com>
@AGiorgetti
AGiorgetti marked this pull request as ready for review October 9, 2026 13:47
@AGiorgetti
AGiorgetti merged commit c973aac into develop Oct 9, 2026
11 checks passed
@AGiorgetti
AGiorgetti deleted the fix/codex-issue-30-hashset-capabilities branch October 9, 2026 13:47
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] Detect HashSet capacity constructor availability before emitting it

1 participant