v6.2: bulk generation, TimeProvider overloads, EF Core value generation#29
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
SemVer minor (v6.2.0) — all changes additive. Implements the approved spec at
docs/superpowers/specs/2026-06-09-sequentialguid-v6.2-design.md.Fill/FillSql/NewGuids/NewSqlGuidsonGuidV7andGuidV8Time, .NET 8+ assets):one timestamp capture, one counter-block reservation, one RNG call per batch — ~11× faster than a
Guid.CreateVersion7loop and zero-alloc. LoudArgumentOutOfRangeExceptionwhen a batch wouldexceed the counter space (2^26 v7 / 2^22 v8). Block reservation mirrors
Interlocked.Incrementpost-increment semantics so bulk and single-call generation interleave without slot reuse
(regression-tested with singles on both sides of a bulk call).
TimeProvideroverloads (.NET 8+) on every generation path, single-call and bulk.ValueGeneratorclasses plusUseSequentialGuidValueGeneration(bool sqlServerByteOrder = false)— a model-finalizingconvention covering
Guid,SequentialGuid, andSequentialSqlGuidprimary keys (compositekeys included). Explicit configuration always wins. Includes a
HasSentinel(default)pin forstruct keys: EF 8/9 compute sentinels via
Activator.CreateInstance, which invokes the structs'generating parameterless ctors (fixed in EF 10 via
GetUninitializedObject).MongoSequentialGuidGeneratorgains aSequentialGuidTypeconstructor;Instancestays v8(no silent behavior change). The spec's optional type parameter on
RegisterMongoIdGenerator()was dropped — the instance already carries its type.
GetInt32bias fix: mask-and-reject sampling replacesGetNonZeroBytes+ double-modulo.(public generators only — converters are internal and covered by build-time analyzers) wired
into CI with per-exe exit-code guards. Native ILC publish verifies in CI.
Guid.CreateVersion7?" section with measured benchmark table (honest aboutper-call latency; the win is monotonicity, SQL ordering, tooling, reach, and bulk throughput).
Minor deviations from spec snippets: TimeProvider tests live in their own file; bulk sort-order
tests use inline arrays; the bulk benchmark exercises
Fillrather thanNewGuids(fairerbuffer-reuse comparison); test field naming follows
.editorconfigover spec pseudocode.Test plan
dotnet build— 0 warnings across all TFMs (warnings-as-errors)dotnet test— 31,605 tests, 0 failures, all TFMs (net11/net10/net9/net8/net472)BclComparisonBenchmarksrun on Release; README table is verbatim measured output