Repository navigation
Conversation
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.
What and why
Closes #353.
Make
ids.UUIDv7,ids.UUIDandids.ULIDstrictly increase within one process, including in a tight same-millisecond loop.A shared, mutex-guarded clock returns a 12-bit sub-millisecond fraction in units of 256 ns, advancing the previous pair when the clock does not. The entropy read stays outside the lock. UUIDv7 places the fraction in
rand_a, following RFC 9562 section 6.2 method 3; ULID places it in the first 12 bits after the timestamp. Their public signatures, versions, variants, text lengths and remaining random bits are unchanged.Decision 179 records the behavior and amends decision 168. The skill now states the within-millisecond guarantee.
Checklist
feat:,fix:,docs:...), since it becomes the squashed commitmain(git pull --rebase origin main), with no merge commitsmake fmt,make lintandmake testpassmake test-pgpasses, if the change reaches the database (and the other dialects' targets, if it touches them)docs/api.txtis updated withgo test ./tests/api -update, if the exported API changed on purpose (no exported API change)go test -race -count=1 ./idspasses, including concurrent time-pair generation.A local probe generated 1,000,000 UUIDv7 values per run, three runs against each implementation.
origin/mainproduced 499,111–499,750 inversions per run at 434.9–438.1 ns/id; this branch produced zero inversions at 447.8–474.4 ns/id.The skill doccheck type-checks all 14 samples. It still reports the pre-existing gofmt alignment issue in the
ant.Raw[int]example:origin/mainreports it at line 296 and this branch at line 297 after the added documentation line.